ultracart_api 4.0.99.rc → 4.0.100.rc

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a804dd2ab329cf54941436d968e7c1f530e1f2cc3707c346cb1fb66f017c072c
4
- data.tar.gz: 6eb5984033165cf26cea8e5f2bbdbe3aea611ace052c84c53483681d3383634c
3
+ metadata.gz: 762a40805b652da96c82cdb8b5608aa7907bf3e5d962809c49436bc9e01c249e
4
+ data.tar.gz: 4895f6e1529dc3b54b6b6c8281a7f1def6f10ae00e2451f4074c612c73d99591
5
5
  SHA512:
6
- metadata.gz: 3a328e1e9ce59f8312f6bc0493da67eeb702545d2de8e375550b04717dbae15e73a34a6140e1251a96d10e71d883e42035ca948e9c601e26eca3fc3a4dfc4f28
7
- data.tar.gz: f6fc39d982342451ad265ede657fb873ef7e02f9baa39e35bc84f1504b13cb276adde51c428a805bd286116a8ed84e1a8d349993d1ea6dc629f05a1928d74668
6
+ metadata.gz: 37ab770d394b689a6179d781fe60a11dc5d1ba84fb0f35bfa0c1b93c9e5db9e530516708fe5336093da1e6882ba90b47c74882347cbd5eab76b1fac0a2f69c0d
7
+ data.tar.gz: 4e949dad14070dce9a6e84a48fee5c2e54f570d513aaffadb104993cc2857c18b2e88421372dd4e1b86a324b4d4f5d74fce30cc93f0461bc83cde7b490ce26b0
data/README.md CHANGED
@@ -7,7 +7,7 @@ UltraCart REST API Version 2
7
7
  This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
8
8
 
9
9
  - API version: 2.0.0
10
- - Package version: 4.0.99.rc
10
+ - Package version: 4.0.100.rc
11
11
  - Build package: org.openapitools.codegen.languages.RubyClientCodegen
12
12
  For more information, please visit [http://www.ultracart.com](http://www.ultracart.com)
13
13
 
@@ -24,16 +24,16 @@ gem build ultracart_api.gemspec
24
24
  Then either install the gem locally:
25
25
 
26
26
  ```shell
27
- gem install ./ultracart_api-4.0.99.rc.gem
27
+ gem install ./ultracart_api-4.0.100.rc.gem
28
28
  ```
29
29
 
30
- (for development, run `gem install --dev ./ultracart_api-4.0.99.rc.gem` to install the development dependencies)
30
+ (for development, run `gem install --dev ./ultracart_api-4.0.100.rc.gem` to install the development dependencies)
31
31
 
32
32
  or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
33
33
 
34
34
  Finally add this to the Gemfile:
35
35
 
36
- gem 'ultracart_api', '~> 4.0.99.rc'
36
+ gem 'ultracart_api', '~> 4.0.100.rc'
37
37
 
38
38
  ### Install from Git
39
39
 
@@ -614,6 +614,9 @@ Class | Method | HTTP request | Description
614
614
  - [UltracartClient::ConversationDepartmentResponse](docs/ConversationDepartmentResponse.md)
615
615
  - [UltracartClient::ConversationDepartmentsResponse](docs/ConversationDepartmentsResponse.md)
616
616
  - [UltracartClient::ConversationEngagement](docs/ConversationEngagement.md)
617
+ - [UltracartClient::ConversationEngagementEquation](docs/ConversationEngagementEquation.md)
618
+ - [UltracartClient::ConversationEngagementEquationFunction](docs/ConversationEngagementEquationFunction.md)
619
+ - [UltracartClient::ConversationEngagementEquationGroup](docs/ConversationEngagementEquationGroup.md)
617
620
  - [UltracartClient::ConversationEngagementResponse](docs/ConversationEngagementResponse.md)
618
621
  - [UltracartClient::ConversationEngagementsResponse](docs/ConversationEngagementsResponse.md)
619
622
  - [UltracartClient::ConversationEventAddCoupon](docs/ConversationEventAddCoupon.md)
@@ -1265,6 +1268,7 @@ Not every change is committed to every SDK.
1265
1268
 
1266
1269
  | Version | Date | Comments |
1267
1270
  | --: | :-: | --- |
1271
+ | 4.0.100-RC | 12/20/2022 | conversation engagement update |
1268
1272
  | 4.0.99-RC | 12/15/2022 | conversation search - added start date filtering |
1269
1273
  | 4.0.98-RC | 12/15/2022 | conversation searching |
1270
1274
  | 4.0.97-RC | 12/13/2022 | conversations - add email and sms_phone to participant object |
@@ -8,9 +8,9 @@
8
8
  | **customer_greeting** | **String** | | [optional] |
9
9
  | **department_oids** | **Array<Integer>** | | [optional] |
10
10
  | **engagement_name** | **String** | | [optional] |
11
- | **equation** | **Object** | | [optional] |
11
+ | **equation** | [**ConversationEngagementEquation**](ConversationEngagementEquation.md) | | [optional] |
12
12
  | **time_on_page** | **Integer** | | [optional] |
13
- | **visitor_type** | **String** | | [optional] |
13
+ | **visitor_type** | **String** | The type of visitor | [optional] |
14
14
 
15
15
  ## Example
16
16
 
@@ -0,0 +1,18 @@
1
+ # UltracartClient::ConversationEngagementEquation
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **groups** | [**Array<ConversationEngagementEquationGroup>**](ConversationEngagementEquationGroup.md) | | [optional] |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'ultracart_api'
13
+
14
+ instance = UltracartClient::ConversationEngagementEquation.new(
15
+ groups: null
16
+ )
17
+ ```
18
+
@@ -0,0 +1,44 @@
1
+ # UltracartClient::ConversationEngagementEquationFunction
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **any_page_url_logic** | **String** | Logic operation to perform on an any page url function type | [optional] |
8
+ | **any_page_url_value** | **String** | | [optional] |
9
+ | **current_page_url_logic** | **String** | Logic operation to perform on a current page url function type | [optional] |
10
+ | **current_page_url_value** | **String** | | [optional] |
11
+ | **customers_browsing_time_logic** | **String** | Logic operation to perform on a customer's browsing time function type | [optional] |
12
+ | **customers_browsing_time_seconds** | **Integer** | | [optional] |
13
+ | **customers_location_country** | **String** | | [optional] |
14
+ | **customers_location_logic** | **String** | Logic operation to perform on a customer's location function type | [optional] |
15
+ | **customers_location_state** | **String** | | [optional] |
16
+ | **number_of_viewed_pages_logic** | **String** | Logic operation to perform on a customer's browsing time function type | [optional] |
17
+ | **number_of_viewed_pages_value** | **Integer** | | [optional] |
18
+ | **referring_website_logic** | **String** | Logic operation to perform on a referring website function type | [optional] |
19
+ | **referring_website_value** | **String** | | [optional] |
20
+ | **type** | **String** | Type of function | [optional] |
21
+
22
+ ## Example
23
+
24
+ ```ruby
25
+ require 'ultracart_api'
26
+
27
+ instance = UltracartClient::ConversationEngagementEquationFunction.new(
28
+ any_page_url_logic: null,
29
+ any_page_url_value: null,
30
+ current_page_url_logic: null,
31
+ current_page_url_value: null,
32
+ customers_browsing_time_logic: null,
33
+ customers_browsing_time_seconds: null,
34
+ customers_location_country: null,
35
+ customers_location_logic: null,
36
+ customers_location_state: null,
37
+ number_of_viewed_pages_logic: null,
38
+ number_of_viewed_pages_value: null,
39
+ referring_website_logic: null,
40
+ referring_website_value: null,
41
+ type: null
42
+ )
43
+ ```
44
+
@@ -0,0 +1,18 @@
1
+ # UltracartClient::ConversationEngagementEquationGroup
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **functions** | [**Array<ConversationEngagementEquationFunction>**](ConversationEngagementEquationFunction.md) | | [optional] |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'ultracart_api'
13
+
14
+ instance = UltracartClient::ConversationEngagementEquationGroup.new(
15
+ functions: null
16
+ )
17
+ ```
18
+
@@ -27,8 +27,31 @@ module UltracartClient
27
27
 
28
28
  attr_accessor :time_on_page
29
29
 
30
+ # The type of visitor
30
31
  attr_accessor :visitor_type
31
32
 
33
+ class EnumAttributeValidator
34
+ attr_reader :datatype
35
+ attr_reader :allowable_values
36
+
37
+ def initialize(datatype, allowable_values)
38
+ @allowable_values = allowable_values.map do |value|
39
+ case datatype.to_s
40
+ when /Integer/i
41
+ value.to_i
42
+ when /Float/i
43
+ value.to_f
44
+ else
45
+ value
46
+ end
47
+ end
48
+ end
49
+
50
+ def valid?(value)
51
+ !value || allowable_values.include?(value)
52
+ end
53
+ end
54
+
32
55
  # Attribute mapping from ruby-style variable name to JSON key.
33
56
  def self.attribute_map
34
57
  {
@@ -54,7 +77,7 @@ module UltracartClient
54
77
  :'customer_greeting' => :'String',
55
78
  :'department_oids' => :'Array<Integer>',
56
79
  :'engagement_name' => :'String',
57
- :'equation' => :'Object',
80
+ :'equation' => :'ConversationEngagementEquation',
58
81
  :'time_on_page' => :'Integer',
59
82
  :'visitor_type' => :'String'
60
83
  }
@@ -122,9 +145,21 @@ module UltracartClient
122
145
  # Check to see if the all the properties in the model are valid
123
146
  # @return true if the model is valid
124
147
  def valid?
148
+ visitor_type_validator = EnumAttributeValidator.new('String', ["all", "first time", "returning"])
149
+ return false unless visitor_type_validator.valid?(@visitor_type)
125
150
  true
126
151
  end
127
152
 
153
+ # Custom attribute writer method checking allowed values (enum).
154
+ # @param [Object] visitor_type Object to be assigned
155
+ def visitor_type=(visitor_type)
156
+ validator = EnumAttributeValidator.new('String', ["all", "first time", "returning"])
157
+ unless validator.valid?(visitor_type)
158
+ fail ArgumentError, "invalid value for \"visitor_type\", must be one of #{validator.allowable_values}."
159
+ end
160
+ @visitor_type = visitor_type
161
+ end
162
+
128
163
  # Checks equality by comparing each attribute.
129
164
  # @param [Object] Object to be compared
130
165
  def ==(o)
@@ -0,0 +1,221 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class ConversationEngagementEquation
18
+ attr_accessor :groups
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'groups' => :'groups'
24
+ }
25
+ end
26
+
27
+ # Returns all the JSON keys this model knows about
28
+ def self.acceptable_attributes
29
+ attribute_map.values
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'groups' => :'Array<ConversationEngagementEquationGroup>'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationEngagementEquation` initialize method"
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationEngagementEquation`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'groups')
61
+ if (value = attributes[:'groups']).is_a?(Array)
62
+ self.groups = value
63
+ end
64
+ end
65
+ end
66
+
67
+ # Show invalid properties with the reasons. Usually used together with valid?
68
+ # @return Array for valid properties with the reasons
69
+ def list_invalid_properties
70
+ invalid_properties = Array.new
71
+ invalid_properties
72
+ end
73
+
74
+ # Check to see if the all the properties in the model are valid
75
+ # @return true if the model is valid
76
+ def valid?
77
+ true
78
+ end
79
+
80
+ # Checks equality by comparing each attribute.
81
+ # @param [Object] Object to be compared
82
+ def ==(o)
83
+ return true if self.equal?(o)
84
+ self.class == o.class &&
85
+ groups == o.groups
86
+ end
87
+
88
+ # @see the `==` method
89
+ # @param [Object] Object to be compared
90
+ def eql?(o)
91
+ self == o
92
+ end
93
+
94
+ # Calculates hash code according to all attributes.
95
+ # @return [Integer] Hash code
96
+ def hash
97
+ [groups].hash
98
+ end
99
+
100
+ # Builds the object from hash
101
+ # @param [Hash] attributes Model attributes in the form of hash
102
+ # @return [Object] Returns the model itself
103
+ def self.build_from_hash(attributes)
104
+ new.build_from_hash(attributes)
105
+ end
106
+
107
+ # Builds the object from hash
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ # @return [Object] Returns the model itself
110
+ def build_from_hash(attributes)
111
+ return nil unless attributes.is_a?(Hash)
112
+ attributes = attributes.transform_keys(&:to_sym)
113
+ self.class.openapi_types.each_pair do |key, type|
114
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
115
+ self.send("#{key}=", nil)
116
+ elsif type =~ /\AArray<(.*)>/i
117
+ # check to ensure the input is an array given that the attribute
118
+ # is documented as an array but the input is not
119
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
120
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
121
+ end
122
+ elsif !attributes[self.class.attribute_map[key]].nil?
123
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
124
+ end
125
+ end
126
+
127
+ self
128
+ end
129
+
130
+ # Deserializes the data based on type
131
+ # @param string type Data type
132
+ # @param string value Value to be deserialized
133
+ # @return [Object] Deserialized data
134
+ def _deserialize(type, value)
135
+ case type.to_sym
136
+ when :Time
137
+ Time.parse(value)
138
+ when :Date
139
+ Date.parse(value)
140
+ when :String
141
+ value.to_s
142
+ when :Integer
143
+ value.to_i
144
+ when :Float
145
+ value.to_f
146
+ when :Boolean
147
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
148
+ true
149
+ else
150
+ false
151
+ end
152
+ when :Object
153
+ # generic object (usually a Hash), return directly
154
+ value
155
+ when /\AArray<(?<inner_type>.+)>\z/
156
+ inner_type = Regexp.last_match[:inner_type]
157
+ value.map { |v| _deserialize(inner_type, v) }
158
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
159
+ k_type = Regexp.last_match[:k_type]
160
+ v_type = Regexp.last_match[:v_type]
161
+ {}.tap do |hash|
162
+ value.each do |k, v|
163
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
164
+ end
165
+ end
166
+ else # model
167
+ # models (e.g. Pet) or oneOf
168
+ klass = UltracartClient.const_get(type)
169
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
170
+ end
171
+ end
172
+
173
+ # Returns the string representation of the object
174
+ # @return [String] String presentation of the object
175
+ def to_s
176
+ to_hash.to_s
177
+ end
178
+
179
+ # to_body is an alias to to_hash (backward compatibility)
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_body
182
+ to_hash
183
+ end
184
+
185
+ # Returns the object in the form of hash
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_hash
188
+ hash = {}
189
+ self.class.attribute_map.each_pair do |attr, param|
190
+ value = self.send(attr)
191
+ if value.nil?
192
+ is_nullable = self.class.openapi_nullable.include?(attr)
193
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
194
+ end
195
+
196
+ hash[param] = _to_hash(value)
197
+ end
198
+ hash
199
+ end
200
+
201
+ # Outputs non-array value in the form of hash
202
+ # For object, use to_hash. Otherwise, just return the value
203
+ # @param [Object] value Any valid value
204
+ # @return [Hash] Returns the value in the form of hash
205
+ def _to_hash(value)
206
+ if value.is_a?(Array)
207
+ value.compact.map { |v| _to_hash(v) }
208
+ elsif value.is_a?(Hash)
209
+ {}.tap do |hash|
210
+ value.each { |k, v| hash[k] = _to_hash(v) }
211
+ end
212
+ elsif value.respond_to? :to_hash
213
+ value.to_hash
214
+ else
215
+ value
216
+ end
217
+ end
218
+
219
+ end
220
+
221
+ end
@@ -0,0 +1,449 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class ConversationEngagementEquationFunction
18
+ # Logic operation to perform on an any page url function type
19
+ attr_accessor :any_page_url_logic
20
+
21
+ attr_accessor :any_page_url_value
22
+
23
+ # Logic operation to perform on a current page url function type
24
+ attr_accessor :current_page_url_logic
25
+
26
+ attr_accessor :current_page_url_value
27
+
28
+ # Logic operation to perform on a customer's browsing time function type
29
+ attr_accessor :customers_browsing_time_logic
30
+
31
+ attr_accessor :customers_browsing_time_seconds
32
+
33
+ attr_accessor :customers_location_country
34
+
35
+ # Logic operation to perform on a customer's location function type
36
+ attr_accessor :customers_location_logic
37
+
38
+ attr_accessor :customers_location_state
39
+
40
+ # Logic operation to perform on a customer's browsing time function type
41
+ attr_accessor :number_of_viewed_pages_logic
42
+
43
+ attr_accessor :number_of_viewed_pages_value
44
+
45
+ # Logic operation to perform on a referring website function type
46
+ attr_accessor :referring_website_logic
47
+
48
+ attr_accessor :referring_website_value
49
+
50
+ # Type of function
51
+ attr_accessor :type
52
+
53
+ class EnumAttributeValidator
54
+ attr_reader :datatype
55
+ attr_reader :allowable_values
56
+
57
+ def initialize(datatype, allowable_values)
58
+ @allowable_values = allowable_values.map do |value|
59
+ case datatype.to_s
60
+ when /Integer/i
61
+ value.to_i
62
+ when /Float/i
63
+ value.to_f
64
+ else
65
+ value
66
+ end
67
+ end
68
+ end
69
+
70
+ def valid?(value)
71
+ !value || allowable_values.include?(value)
72
+ end
73
+ end
74
+
75
+ # Attribute mapping from ruby-style variable name to JSON key.
76
+ def self.attribute_map
77
+ {
78
+ :'any_page_url_logic' => :'any_page_url_logic',
79
+ :'any_page_url_value' => :'any_page_url_value',
80
+ :'current_page_url_logic' => :'current_page_url_logic',
81
+ :'current_page_url_value' => :'current_page_url_value',
82
+ :'customers_browsing_time_logic' => :'customers_browsing_time_logic',
83
+ :'customers_browsing_time_seconds' => :'customers_browsing_time_seconds',
84
+ :'customers_location_country' => :'customers_location_country',
85
+ :'customers_location_logic' => :'customers_location_logic',
86
+ :'customers_location_state' => :'customers_location_state',
87
+ :'number_of_viewed_pages_logic' => :'number_of_viewed_pages_logic',
88
+ :'number_of_viewed_pages_value' => :'number_of_viewed_pages_value',
89
+ :'referring_website_logic' => :'referring_website_logic',
90
+ :'referring_website_value' => :'referring_website_value',
91
+ :'type' => :'type'
92
+ }
93
+ end
94
+
95
+ # Returns all the JSON keys this model knows about
96
+ def self.acceptable_attributes
97
+ attribute_map.values
98
+ end
99
+
100
+ # Attribute type mapping.
101
+ def self.openapi_types
102
+ {
103
+ :'any_page_url_logic' => :'String',
104
+ :'any_page_url_value' => :'String',
105
+ :'current_page_url_logic' => :'String',
106
+ :'current_page_url_value' => :'String',
107
+ :'customers_browsing_time_logic' => :'String',
108
+ :'customers_browsing_time_seconds' => :'Integer',
109
+ :'customers_location_country' => :'String',
110
+ :'customers_location_logic' => :'String',
111
+ :'customers_location_state' => :'String',
112
+ :'number_of_viewed_pages_logic' => :'String',
113
+ :'number_of_viewed_pages_value' => :'Integer',
114
+ :'referring_website_logic' => :'String',
115
+ :'referring_website_value' => :'String',
116
+ :'type' => :'String'
117
+ }
118
+ end
119
+
120
+ # List of attributes with nullable: true
121
+ def self.openapi_nullable
122
+ Set.new([
123
+ ])
124
+ end
125
+
126
+ # Initializes the object
127
+ # @param [Hash] attributes Model attributes in the form of hash
128
+ def initialize(attributes = {})
129
+ if (!attributes.is_a?(Hash))
130
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationEngagementEquationFunction` initialize method"
131
+ end
132
+
133
+ # check to see if the attribute exists and convert string to symbol for hash key
134
+ attributes = attributes.each_with_object({}) { |(k, v), h|
135
+ if (!self.class.attribute_map.key?(k.to_sym))
136
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationEngagementEquationFunction`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
137
+ end
138
+ h[k.to_sym] = v
139
+ }
140
+
141
+ if attributes.key?(:'any_page_url_logic')
142
+ self.any_page_url_logic = attributes[:'any_page_url_logic']
143
+ end
144
+
145
+ if attributes.key?(:'any_page_url_value')
146
+ self.any_page_url_value = attributes[:'any_page_url_value']
147
+ end
148
+
149
+ if attributes.key?(:'current_page_url_logic')
150
+ self.current_page_url_logic = attributes[:'current_page_url_logic']
151
+ end
152
+
153
+ if attributes.key?(:'current_page_url_value')
154
+ self.current_page_url_value = attributes[:'current_page_url_value']
155
+ end
156
+
157
+ if attributes.key?(:'customers_browsing_time_logic')
158
+ self.customers_browsing_time_logic = attributes[:'customers_browsing_time_logic']
159
+ end
160
+
161
+ if attributes.key?(:'customers_browsing_time_seconds')
162
+ self.customers_browsing_time_seconds = attributes[:'customers_browsing_time_seconds']
163
+ end
164
+
165
+ if attributes.key?(:'customers_location_country')
166
+ self.customers_location_country = attributes[:'customers_location_country']
167
+ end
168
+
169
+ if attributes.key?(:'customers_location_logic')
170
+ self.customers_location_logic = attributes[:'customers_location_logic']
171
+ end
172
+
173
+ if attributes.key?(:'customers_location_state')
174
+ self.customers_location_state = attributes[:'customers_location_state']
175
+ end
176
+
177
+ if attributes.key?(:'number_of_viewed_pages_logic')
178
+ self.number_of_viewed_pages_logic = attributes[:'number_of_viewed_pages_logic']
179
+ end
180
+
181
+ if attributes.key?(:'number_of_viewed_pages_value')
182
+ self.number_of_viewed_pages_value = attributes[:'number_of_viewed_pages_value']
183
+ end
184
+
185
+ if attributes.key?(:'referring_website_logic')
186
+ self.referring_website_logic = attributes[:'referring_website_logic']
187
+ end
188
+
189
+ if attributes.key?(:'referring_website_value')
190
+ self.referring_website_value = attributes[:'referring_website_value']
191
+ end
192
+
193
+ if attributes.key?(:'type')
194
+ self.type = attributes[:'type']
195
+ end
196
+ end
197
+
198
+ # Show invalid properties with the reasons. Usually used together with valid?
199
+ # @return Array for valid properties with the reasons
200
+ def list_invalid_properties
201
+ invalid_properties = Array.new
202
+ invalid_properties
203
+ end
204
+
205
+ # Check to see if the all the properties in the model are valid
206
+ # @return true if the model is valid
207
+ def valid?
208
+ any_page_url_logic_validator = EnumAttributeValidator.new('String', ["contains", "does not contain", "is exactly", "is not"])
209
+ return false unless any_page_url_logic_validator.valid?(@any_page_url_logic)
210
+ current_page_url_logic_validator = EnumAttributeValidator.new('String', ["contains", "does not contain", "is exactly", "is not"])
211
+ return false unless current_page_url_logic_validator.valid?(@current_page_url_logic)
212
+ customers_browsing_time_logic_validator = EnumAttributeValidator.new('String', ["is at least", "is more than", "is less than", "is at most"])
213
+ return false unless customers_browsing_time_logic_validator.valid?(@customers_browsing_time_logic)
214
+ customers_location_logic_validator = EnumAttributeValidator.new('String', ["is", "is not"])
215
+ return false unless customers_location_logic_validator.valid?(@customers_location_logic)
216
+ number_of_viewed_pages_logic_validator = EnumAttributeValidator.new('String', ["is at least", "is more than", "is less than", "is at most"])
217
+ return false unless number_of_viewed_pages_logic_validator.valid?(@number_of_viewed_pages_logic)
218
+ referring_website_logic_validator = EnumAttributeValidator.new('String', ["contains", "does not contain", "is exactly", "is not"])
219
+ return false unless referring_website_logic_validator.valid?(@referring_website_logic)
220
+ type_validator = EnumAttributeValidator.new('String', ["current page url", "customer's location", "customer's browsing time", "number of viewed pages", "referring website address", "any page from session"])
221
+ return false unless type_validator.valid?(@type)
222
+ true
223
+ end
224
+
225
+ # Custom attribute writer method checking allowed values (enum).
226
+ # @param [Object] any_page_url_logic Object to be assigned
227
+ def any_page_url_logic=(any_page_url_logic)
228
+ validator = EnumAttributeValidator.new('String', ["contains", "does not contain", "is exactly", "is not"])
229
+ unless validator.valid?(any_page_url_logic)
230
+ fail ArgumentError, "invalid value for \"any_page_url_logic\", must be one of #{validator.allowable_values}."
231
+ end
232
+ @any_page_url_logic = any_page_url_logic
233
+ end
234
+
235
+ # Custom attribute writer method checking allowed values (enum).
236
+ # @param [Object] current_page_url_logic Object to be assigned
237
+ def current_page_url_logic=(current_page_url_logic)
238
+ validator = EnumAttributeValidator.new('String', ["contains", "does not contain", "is exactly", "is not"])
239
+ unless validator.valid?(current_page_url_logic)
240
+ fail ArgumentError, "invalid value for \"current_page_url_logic\", must be one of #{validator.allowable_values}."
241
+ end
242
+ @current_page_url_logic = current_page_url_logic
243
+ end
244
+
245
+ # Custom attribute writer method checking allowed values (enum).
246
+ # @param [Object] customers_browsing_time_logic Object to be assigned
247
+ def customers_browsing_time_logic=(customers_browsing_time_logic)
248
+ validator = EnumAttributeValidator.new('String', ["is at least", "is more than", "is less than", "is at most"])
249
+ unless validator.valid?(customers_browsing_time_logic)
250
+ fail ArgumentError, "invalid value for \"customers_browsing_time_logic\", must be one of #{validator.allowable_values}."
251
+ end
252
+ @customers_browsing_time_logic = customers_browsing_time_logic
253
+ end
254
+
255
+ # Custom attribute writer method checking allowed values (enum).
256
+ # @param [Object] customers_location_logic Object to be assigned
257
+ def customers_location_logic=(customers_location_logic)
258
+ validator = EnumAttributeValidator.new('String', ["is", "is not"])
259
+ unless validator.valid?(customers_location_logic)
260
+ fail ArgumentError, "invalid value for \"customers_location_logic\", must be one of #{validator.allowable_values}."
261
+ end
262
+ @customers_location_logic = customers_location_logic
263
+ end
264
+
265
+ # Custom attribute writer method checking allowed values (enum).
266
+ # @param [Object] number_of_viewed_pages_logic Object to be assigned
267
+ def number_of_viewed_pages_logic=(number_of_viewed_pages_logic)
268
+ validator = EnumAttributeValidator.new('String', ["is at least", "is more than", "is less than", "is at most"])
269
+ unless validator.valid?(number_of_viewed_pages_logic)
270
+ fail ArgumentError, "invalid value for \"number_of_viewed_pages_logic\", must be one of #{validator.allowable_values}."
271
+ end
272
+ @number_of_viewed_pages_logic = number_of_viewed_pages_logic
273
+ end
274
+
275
+ # Custom attribute writer method checking allowed values (enum).
276
+ # @param [Object] referring_website_logic Object to be assigned
277
+ def referring_website_logic=(referring_website_logic)
278
+ validator = EnumAttributeValidator.new('String', ["contains", "does not contain", "is exactly", "is not"])
279
+ unless validator.valid?(referring_website_logic)
280
+ fail ArgumentError, "invalid value for \"referring_website_logic\", must be one of #{validator.allowable_values}."
281
+ end
282
+ @referring_website_logic = referring_website_logic
283
+ end
284
+
285
+ # Custom attribute writer method checking allowed values (enum).
286
+ # @param [Object] type Object to be assigned
287
+ def type=(type)
288
+ validator = EnumAttributeValidator.new('String', ["current page url", "customer's location", "customer's browsing time", "number of viewed pages", "referring website address", "any page from session"])
289
+ unless validator.valid?(type)
290
+ fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
291
+ end
292
+ @type = type
293
+ end
294
+
295
+ # Checks equality by comparing each attribute.
296
+ # @param [Object] Object to be compared
297
+ def ==(o)
298
+ return true if self.equal?(o)
299
+ self.class == o.class &&
300
+ any_page_url_logic == o.any_page_url_logic &&
301
+ any_page_url_value == o.any_page_url_value &&
302
+ current_page_url_logic == o.current_page_url_logic &&
303
+ current_page_url_value == o.current_page_url_value &&
304
+ customers_browsing_time_logic == o.customers_browsing_time_logic &&
305
+ customers_browsing_time_seconds == o.customers_browsing_time_seconds &&
306
+ customers_location_country == o.customers_location_country &&
307
+ customers_location_logic == o.customers_location_logic &&
308
+ customers_location_state == o.customers_location_state &&
309
+ number_of_viewed_pages_logic == o.number_of_viewed_pages_logic &&
310
+ number_of_viewed_pages_value == o.number_of_viewed_pages_value &&
311
+ referring_website_logic == o.referring_website_logic &&
312
+ referring_website_value == o.referring_website_value &&
313
+ type == o.type
314
+ end
315
+
316
+ # @see the `==` method
317
+ # @param [Object] Object to be compared
318
+ def eql?(o)
319
+ self == o
320
+ end
321
+
322
+ # Calculates hash code according to all attributes.
323
+ # @return [Integer] Hash code
324
+ def hash
325
+ [any_page_url_logic, any_page_url_value, current_page_url_logic, current_page_url_value, customers_browsing_time_logic, customers_browsing_time_seconds, customers_location_country, customers_location_logic, customers_location_state, number_of_viewed_pages_logic, number_of_viewed_pages_value, referring_website_logic, referring_website_value, type].hash
326
+ end
327
+
328
+ # Builds the object from hash
329
+ # @param [Hash] attributes Model attributes in the form of hash
330
+ # @return [Object] Returns the model itself
331
+ def self.build_from_hash(attributes)
332
+ new.build_from_hash(attributes)
333
+ end
334
+
335
+ # Builds the object from hash
336
+ # @param [Hash] attributes Model attributes in the form of hash
337
+ # @return [Object] Returns the model itself
338
+ def build_from_hash(attributes)
339
+ return nil unless attributes.is_a?(Hash)
340
+ attributes = attributes.transform_keys(&:to_sym)
341
+ self.class.openapi_types.each_pair do |key, type|
342
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
343
+ self.send("#{key}=", nil)
344
+ elsif type =~ /\AArray<(.*)>/i
345
+ # check to ensure the input is an array given that the attribute
346
+ # is documented as an array but the input is not
347
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
348
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
349
+ end
350
+ elsif !attributes[self.class.attribute_map[key]].nil?
351
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
352
+ end
353
+ end
354
+
355
+ self
356
+ end
357
+
358
+ # Deserializes the data based on type
359
+ # @param string type Data type
360
+ # @param string value Value to be deserialized
361
+ # @return [Object] Deserialized data
362
+ def _deserialize(type, value)
363
+ case type.to_sym
364
+ when :Time
365
+ Time.parse(value)
366
+ when :Date
367
+ Date.parse(value)
368
+ when :String
369
+ value.to_s
370
+ when :Integer
371
+ value.to_i
372
+ when :Float
373
+ value.to_f
374
+ when :Boolean
375
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
376
+ true
377
+ else
378
+ false
379
+ end
380
+ when :Object
381
+ # generic object (usually a Hash), return directly
382
+ value
383
+ when /\AArray<(?<inner_type>.+)>\z/
384
+ inner_type = Regexp.last_match[:inner_type]
385
+ value.map { |v| _deserialize(inner_type, v) }
386
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
387
+ k_type = Regexp.last_match[:k_type]
388
+ v_type = Regexp.last_match[:v_type]
389
+ {}.tap do |hash|
390
+ value.each do |k, v|
391
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
392
+ end
393
+ end
394
+ else # model
395
+ # models (e.g. Pet) or oneOf
396
+ klass = UltracartClient.const_get(type)
397
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
398
+ end
399
+ end
400
+
401
+ # Returns the string representation of the object
402
+ # @return [String] String presentation of the object
403
+ def to_s
404
+ to_hash.to_s
405
+ end
406
+
407
+ # to_body is an alias to to_hash (backward compatibility)
408
+ # @return [Hash] Returns the object in the form of hash
409
+ def to_body
410
+ to_hash
411
+ end
412
+
413
+ # Returns the object in the form of hash
414
+ # @return [Hash] Returns the object in the form of hash
415
+ def to_hash
416
+ hash = {}
417
+ self.class.attribute_map.each_pair do |attr, param|
418
+ value = self.send(attr)
419
+ if value.nil?
420
+ is_nullable = self.class.openapi_nullable.include?(attr)
421
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
422
+ end
423
+
424
+ hash[param] = _to_hash(value)
425
+ end
426
+ hash
427
+ end
428
+
429
+ # Outputs non-array value in the form of hash
430
+ # For object, use to_hash. Otherwise, just return the value
431
+ # @param [Object] value Any valid value
432
+ # @return [Hash] Returns the value in the form of hash
433
+ def _to_hash(value)
434
+ if value.is_a?(Array)
435
+ value.compact.map { |v| _to_hash(v) }
436
+ elsif value.is_a?(Hash)
437
+ {}.tap do |hash|
438
+ value.each { |k, v| hash[k] = _to_hash(v) }
439
+ end
440
+ elsif value.respond_to? :to_hash
441
+ value.to_hash
442
+ else
443
+ value
444
+ end
445
+ end
446
+
447
+ end
448
+
449
+ end
@@ -0,0 +1,221 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ The version of the OpenAPI document: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 6.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module UltracartClient
17
+ class ConversationEngagementEquationGroup
18
+ attr_accessor :functions
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'functions' => :'functions'
24
+ }
25
+ end
26
+
27
+ # Returns all the JSON keys this model knows about
28
+ def self.acceptable_attributes
29
+ attribute_map.values
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'functions' => :'Array<ConversationEngagementEquationFunction>'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationEngagementEquationGroup` initialize method"
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationEngagementEquationGroup`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'functions')
61
+ if (value = attributes[:'functions']).is_a?(Array)
62
+ self.functions = value
63
+ end
64
+ end
65
+ end
66
+
67
+ # Show invalid properties with the reasons. Usually used together with valid?
68
+ # @return Array for valid properties with the reasons
69
+ def list_invalid_properties
70
+ invalid_properties = Array.new
71
+ invalid_properties
72
+ end
73
+
74
+ # Check to see if the all the properties in the model are valid
75
+ # @return true if the model is valid
76
+ def valid?
77
+ true
78
+ end
79
+
80
+ # Checks equality by comparing each attribute.
81
+ # @param [Object] Object to be compared
82
+ def ==(o)
83
+ return true if self.equal?(o)
84
+ self.class == o.class &&
85
+ functions == o.functions
86
+ end
87
+
88
+ # @see the `==` method
89
+ # @param [Object] Object to be compared
90
+ def eql?(o)
91
+ self == o
92
+ end
93
+
94
+ # Calculates hash code according to all attributes.
95
+ # @return [Integer] Hash code
96
+ def hash
97
+ [functions].hash
98
+ end
99
+
100
+ # Builds the object from hash
101
+ # @param [Hash] attributes Model attributes in the form of hash
102
+ # @return [Object] Returns the model itself
103
+ def self.build_from_hash(attributes)
104
+ new.build_from_hash(attributes)
105
+ end
106
+
107
+ # Builds the object from hash
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ # @return [Object] Returns the model itself
110
+ def build_from_hash(attributes)
111
+ return nil unless attributes.is_a?(Hash)
112
+ attributes = attributes.transform_keys(&:to_sym)
113
+ self.class.openapi_types.each_pair do |key, type|
114
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
115
+ self.send("#{key}=", nil)
116
+ elsif type =~ /\AArray<(.*)>/i
117
+ # check to ensure the input is an array given that the attribute
118
+ # is documented as an array but the input is not
119
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
120
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
121
+ end
122
+ elsif !attributes[self.class.attribute_map[key]].nil?
123
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
124
+ end
125
+ end
126
+
127
+ self
128
+ end
129
+
130
+ # Deserializes the data based on type
131
+ # @param string type Data type
132
+ # @param string value Value to be deserialized
133
+ # @return [Object] Deserialized data
134
+ def _deserialize(type, value)
135
+ case type.to_sym
136
+ when :Time
137
+ Time.parse(value)
138
+ when :Date
139
+ Date.parse(value)
140
+ when :String
141
+ value.to_s
142
+ when :Integer
143
+ value.to_i
144
+ when :Float
145
+ value.to_f
146
+ when :Boolean
147
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
148
+ true
149
+ else
150
+ false
151
+ end
152
+ when :Object
153
+ # generic object (usually a Hash), return directly
154
+ value
155
+ when /\AArray<(?<inner_type>.+)>\z/
156
+ inner_type = Regexp.last_match[:inner_type]
157
+ value.map { |v| _deserialize(inner_type, v) }
158
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
159
+ k_type = Regexp.last_match[:k_type]
160
+ v_type = Regexp.last_match[:v_type]
161
+ {}.tap do |hash|
162
+ value.each do |k, v|
163
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
164
+ end
165
+ end
166
+ else # model
167
+ # models (e.g. Pet) or oneOf
168
+ klass = UltracartClient.const_get(type)
169
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
170
+ end
171
+ end
172
+
173
+ # Returns the string representation of the object
174
+ # @return [String] String presentation of the object
175
+ def to_s
176
+ to_hash.to_s
177
+ end
178
+
179
+ # to_body is an alias to to_hash (backward compatibility)
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_body
182
+ to_hash
183
+ end
184
+
185
+ # Returns the object in the form of hash
186
+ # @return [Hash] Returns the object in the form of hash
187
+ def to_hash
188
+ hash = {}
189
+ self.class.attribute_map.each_pair do |attr, param|
190
+ value = self.send(attr)
191
+ if value.nil?
192
+ is_nullable = self.class.openapi_nullable.include?(attr)
193
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
194
+ end
195
+
196
+ hash[param] = _to_hash(value)
197
+ end
198
+ hash
199
+ end
200
+
201
+ # Outputs non-array value in the form of hash
202
+ # For object, use to_hash. Otherwise, just return the value
203
+ # @param [Object] value Any valid value
204
+ # @return [Hash] Returns the value in the form of hash
205
+ def _to_hash(value)
206
+ if value.is_a?(Array)
207
+ value.compact.map { |v| _to_hash(v) }
208
+ elsif value.is_a?(Hash)
209
+ {}.tap do |hash|
210
+ value.each { |k, v| hash[k] = _to_hash(v) }
211
+ end
212
+ elsif value.respond_to? :to_hash
213
+ value.to_hash
214
+ else
215
+ value
216
+ end
217
+ end
218
+
219
+ end
220
+
221
+ end
@@ -11,5 +11,5 @@ OpenAPI Generator version: 6.0.1-SNAPSHOT
11
11
  =end
12
12
 
13
13
  module UltracartClient
14
- VERSION = '4.0.99.rc'
14
+ VERSION = '4.0.100.rc'
15
15
  end
data/lib/ultracart_api.rb CHANGED
@@ -149,6 +149,9 @@ require 'ultracart_api/models/conversation_department'
149
149
  require 'ultracart_api/models/conversation_department_response'
150
150
  require 'ultracart_api/models/conversation_departments_response'
151
151
  require 'ultracart_api/models/conversation_engagement'
152
+ require 'ultracart_api/models/conversation_engagement_equation'
153
+ require 'ultracart_api/models/conversation_engagement_equation_function'
154
+ require 'ultracart_api/models/conversation_engagement_equation_group'
152
155
  require 'ultracart_api/models/conversation_engagement_response'
153
156
  require 'ultracart_api/models/conversation_engagements_response'
154
157
  require 'ultracart_api/models/conversation_event_add_coupon'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ultracart_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.99.rc
4
+ version: 4.0.100.rc
5
5
  platform: ruby
6
6
  authors:
7
7
  - UltraCart
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-15 00:00:00.000000000 Z
11
+ date: 2022-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -199,6 +199,9 @@ files:
199
199
  - docs/ConversationDepartmentResponse.md
200
200
  - docs/ConversationDepartmentsResponse.md
201
201
  - docs/ConversationEngagement.md
202
+ - docs/ConversationEngagementEquation.md
203
+ - docs/ConversationEngagementEquationFunction.md
204
+ - docs/ConversationEngagementEquationGroup.md
202
205
  - docs/ConversationEngagementResponse.md
203
206
  - docs/ConversationEngagementsResponse.md
204
207
  - docs/ConversationEventAddCoupon.md
@@ -946,6 +949,9 @@ files:
946
949
  - lib/ultracart_api/models/conversation_department_response.rb
947
950
  - lib/ultracart_api/models/conversation_departments_response.rb
948
951
  - lib/ultracart_api/models/conversation_engagement.rb
952
+ - lib/ultracart_api/models/conversation_engagement_equation.rb
953
+ - lib/ultracart_api/models/conversation_engagement_equation_function.rb
954
+ - lib/ultracart_api/models/conversation_engagement_equation_group.rb
949
955
  - lib/ultracart_api/models/conversation_engagement_response.rb
950
956
  - lib/ultracart_api/models/conversation_engagements_response.rb
951
957
  - lib/ultracart_api/models/conversation_event_add_coupon.rb