ultracart_api 4.0.82.rc → 4.0.84.rc
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -4
- data/docs/ConversationEventAddCoupon.md +18 -0
- data/docs/ConversationEventAddItem.md +18 -0
- data/docs/ConversationWebsocketMessage.md +4 -0
- data/docs/OrderRefundableResponse.md +1 -1
- data/lib/ultracart_api/models/conversation_event_add_coupon.rb +219 -0
- data/lib/ultracart_api/models/conversation_event_add_item.rb +219 -0
- data/lib/ultracart_api/models/conversation_websocket_message.rb +21 -3
- data/lib/ultracart_api/models/order_property.rb +5 -5
- data/lib/ultracart_api/models/order_refundable_response.rb +1 -1
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +2 -0
- metadata +5 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 57c231a3321c5d37523a15e99a323a14016a1267e0fb0e4bda7dca5c5db1d4f2
|
4
|
+
data.tar.gz: 55406f0fc39b7582e8c6ec4ad9854fdd06a8d4041b70c29612e3de89ee11739e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85e543e40655a11eb924433b85b6935af87d3f1e1b063fa81566f60bd4724419d9b721cb11b9a4a42ba28da046aaf47a0c32471cd9eb3ccc39aacb8511722068
|
7
|
+
data.tar.gz: a9bf8a04d2651f48c4f5f825bc2fa7c3b90fc0b5fdbd2ef2f923ce318b9d42fa0a1c775536479980de710a3a02f7189d7310638dcb4aa3e348176b93ee4062bc
|
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.
|
10
|
+
- Package version: 4.0.84.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.
|
27
|
+
gem install ./ultracart_api-4.0.84.rc.gem
|
28
28
|
```
|
29
29
|
|
30
|
-
(for development, run `gem install --dev ./ultracart_api-4.0.
|
30
|
+
(for development, run `gem install --dev ./ultracart_api-4.0.84.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.
|
36
|
+
gem 'ultracart_api', '~> 4.0.84.rc'
|
37
37
|
|
38
38
|
### Install from Git
|
39
39
|
|
@@ -588,6 +588,8 @@ Class | Method | HTTP request | Description
|
|
588
588
|
- [UltracartClient::Conversation](docs/Conversation.md)
|
589
589
|
- [UltracartClient::ConversationAgentAuth](docs/ConversationAgentAuth.md)
|
590
590
|
- [UltracartClient::ConversationAgentAuthResponse](docs/ConversationAgentAuthResponse.md)
|
591
|
+
- [UltracartClient::ConversationEventAddCoupon](docs/ConversationEventAddCoupon.md)
|
592
|
+
- [UltracartClient::ConversationEventAddItem](docs/ConversationEventAddItem.md)
|
591
593
|
- [UltracartClient::ConversationEventQueuePosition](docs/ConversationEventQueuePosition.md)
|
592
594
|
- [UltracartClient::ConversationEventRRWeb](docs/ConversationEventRRWeb.md)
|
593
595
|
- [UltracartClient::ConversationEventReadMessage](docs/ConversationEventReadMessage.md)
|
@@ -1224,6 +1226,8 @@ Not every change is committed to every SDK.
|
|
1224
1226
|
|
1225
1227
|
| Version | Date | Comments |
|
1226
1228
|
| --: | :-: | --- |
|
1229
|
+
| 4.0.84-RC | 11/15/2022 | conversation methods bug fix |
|
1230
|
+
| 4.0.83-RC | 11/15/2022 | conversations - enw events for add coupon and items |
|
1227
1231
|
| 4.0.82-RC | 11/15/2022 | order api new method is order refundable |
|
1228
1232
|
| 4.0.81-RC | 11/15/2022 | increase order property length to 10k char |
|
1229
1233
|
| 4.0.80-RC | 11/14/2022 | conversations - add allowed values for update agent status |
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# UltracartClient::ConversationEventAddCoupon
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **coupon_code** | **String** | | [optional] |
|
8
|
+
|
9
|
+
## Example
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require 'ultracart_api'
|
13
|
+
|
14
|
+
instance = UltracartClient::ConversationEventAddCoupon.new(
|
15
|
+
coupon_code: null
|
16
|
+
)
|
17
|
+
```
|
18
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# UltracartClient::ConversationEventAddItem
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **item_id** | **String** | | [optional] |
|
8
|
+
|
9
|
+
## Example
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
require 'ultracart_api'
|
13
|
+
|
14
|
+
instance = UltracartClient::ConversationEventAddItem.new(
|
15
|
+
item_id: null
|
16
|
+
)
|
17
|
+
```
|
18
|
+
|
@@ -5,6 +5,8 @@
|
|
5
5
|
| Name | Type | Description | Notes |
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
7
|
| **conversation_uuid** | **String** | Conversation UUID if the websocket message is tied to a specific conversation | [optional] |
|
8
|
+
| **event_add_coupon** | [**ConversationEventAddCoupon**](ConversationEventAddCoupon.md) | | [optional] |
|
9
|
+
| **event_add_item** | [**ConversationEventAddItem**](ConversationEventAddItem.md) | | [optional] |
|
8
10
|
| **event_conversation_closed** | [**ConversationSummary**](ConversationSummary.md) | | [optional] |
|
9
11
|
| **event_new_conversation** | [**ConversationSummary**](ConversationSummary.md) | | [optional] |
|
10
12
|
| **event_new_message** | [**ConversationSummary**](ConversationSummary.md) | | [optional] |
|
@@ -26,6 +28,8 @@ require 'ultracart_api'
|
|
26
28
|
|
27
29
|
instance = UltracartClient::ConversationWebsocketMessage.new(
|
28
30
|
conversation_uuid: null,
|
31
|
+
event_add_coupon: null,
|
32
|
+
event_add_item: null,
|
29
33
|
event_conversation_closed: null,
|
30
34
|
event_new_conversation: null,
|
31
35
|
event_new_message: null,
|
@@ -6,7 +6,7 @@
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
7
|
| **error** | [**Error**](Error.md) | | [optional] |
|
8
8
|
| **metadata** | [**ResponseMetadata**](ResponseMetadata.md) | | [optional] |
|
9
|
-
| **refundable** | **Boolean** | Whether the order is refundable or not. | [optional] |
|
9
|
+
| **refundable** | **Boolean** | Whether the order is refundable or not. Null should be interpreted as false. | [optional] |
|
10
10
|
| **success** | **Boolean** | Indicates if API call was successful | [optional] |
|
11
11
|
| **warning** | [**Warning**](Warning.md) | | [optional] |
|
12
12
|
|
@@ -0,0 +1,219 @@
|
|
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 ConversationEventAddCoupon
|
18
|
+
attr_accessor :coupon_code
|
19
|
+
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
+
def self.attribute_map
|
22
|
+
{
|
23
|
+
:'coupon_code' => :'coupon_code'
|
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
|
+
:'coupon_code' => :'String'
|
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::ConversationEventAddCoupon` 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::ConversationEventAddCoupon`. 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?(:'coupon_code')
|
61
|
+
self.coupon_code = attributes[:'coupon_code']
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
66
|
+
# @return Array for valid properties with the reasons
|
67
|
+
def list_invalid_properties
|
68
|
+
invalid_properties = Array.new
|
69
|
+
invalid_properties
|
70
|
+
end
|
71
|
+
|
72
|
+
# Check to see if the all the properties in the model are valid
|
73
|
+
# @return true if the model is valid
|
74
|
+
def valid?
|
75
|
+
true
|
76
|
+
end
|
77
|
+
|
78
|
+
# Checks equality by comparing each attribute.
|
79
|
+
# @param [Object] Object to be compared
|
80
|
+
def ==(o)
|
81
|
+
return true if self.equal?(o)
|
82
|
+
self.class == o.class &&
|
83
|
+
coupon_code == o.coupon_code
|
84
|
+
end
|
85
|
+
|
86
|
+
# @see the `==` method
|
87
|
+
# @param [Object] Object to be compared
|
88
|
+
def eql?(o)
|
89
|
+
self == o
|
90
|
+
end
|
91
|
+
|
92
|
+
# Calculates hash code according to all attributes.
|
93
|
+
# @return [Integer] Hash code
|
94
|
+
def hash
|
95
|
+
[coupon_code].hash
|
96
|
+
end
|
97
|
+
|
98
|
+
# Builds the object from hash
|
99
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
100
|
+
# @return [Object] Returns the model itself
|
101
|
+
def self.build_from_hash(attributes)
|
102
|
+
new.build_from_hash(attributes)
|
103
|
+
end
|
104
|
+
|
105
|
+
# Builds the object from hash
|
106
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
107
|
+
# @return [Object] Returns the model itself
|
108
|
+
def build_from_hash(attributes)
|
109
|
+
return nil unless attributes.is_a?(Hash)
|
110
|
+
attributes = attributes.transform_keys(&:to_sym)
|
111
|
+
self.class.openapi_types.each_pair do |key, type|
|
112
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
113
|
+
self.send("#{key}=", nil)
|
114
|
+
elsif type =~ /\AArray<(.*)>/i
|
115
|
+
# check to ensure the input is an array given that the attribute
|
116
|
+
# is documented as an array but the input is not
|
117
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
118
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
119
|
+
end
|
120
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
121
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
self
|
126
|
+
end
|
127
|
+
|
128
|
+
# Deserializes the data based on type
|
129
|
+
# @param string type Data type
|
130
|
+
# @param string value Value to be deserialized
|
131
|
+
# @return [Object] Deserialized data
|
132
|
+
def _deserialize(type, value)
|
133
|
+
case type.to_sym
|
134
|
+
when :Time
|
135
|
+
Time.parse(value)
|
136
|
+
when :Date
|
137
|
+
Date.parse(value)
|
138
|
+
when :String
|
139
|
+
value.to_s
|
140
|
+
when :Integer
|
141
|
+
value.to_i
|
142
|
+
when :Float
|
143
|
+
value.to_f
|
144
|
+
when :Boolean
|
145
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
146
|
+
true
|
147
|
+
else
|
148
|
+
false
|
149
|
+
end
|
150
|
+
when :Object
|
151
|
+
# generic object (usually a Hash), return directly
|
152
|
+
value
|
153
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
154
|
+
inner_type = Regexp.last_match[:inner_type]
|
155
|
+
value.map { |v| _deserialize(inner_type, v) }
|
156
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
157
|
+
k_type = Regexp.last_match[:k_type]
|
158
|
+
v_type = Regexp.last_match[:v_type]
|
159
|
+
{}.tap do |hash|
|
160
|
+
value.each do |k, v|
|
161
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
162
|
+
end
|
163
|
+
end
|
164
|
+
else # model
|
165
|
+
# models (e.g. Pet) or oneOf
|
166
|
+
klass = UltracartClient.const_get(type)
|
167
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
# Returns the string representation of the object
|
172
|
+
# @return [String] String presentation of the object
|
173
|
+
def to_s
|
174
|
+
to_hash.to_s
|
175
|
+
end
|
176
|
+
|
177
|
+
# to_body is an alias to to_hash (backward compatibility)
|
178
|
+
# @return [Hash] Returns the object in the form of hash
|
179
|
+
def to_body
|
180
|
+
to_hash
|
181
|
+
end
|
182
|
+
|
183
|
+
# Returns the object in the form of hash
|
184
|
+
# @return [Hash] Returns the object in the form of hash
|
185
|
+
def to_hash
|
186
|
+
hash = {}
|
187
|
+
self.class.attribute_map.each_pair do |attr, param|
|
188
|
+
value = self.send(attr)
|
189
|
+
if value.nil?
|
190
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
191
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
192
|
+
end
|
193
|
+
|
194
|
+
hash[param] = _to_hash(value)
|
195
|
+
end
|
196
|
+
hash
|
197
|
+
end
|
198
|
+
|
199
|
+
# Outputs non-array value in the form of hash
|
200
|
+
# For object, use to_hash. Otherwise, just return the value
|
201
|
+
# @param [Object] value Any valid value
|
202
|
+
# @return [Hash] Returns the value in the form of hash
|
203
|
+
def _to_hash(value)
|
204
|
+
if value.is_a?(Array)
|
205
|
+
value.compact.map { |v| _to_hash(v) }
|
206
|
+
elsif value.is_a?(Hash)
|
207
|
+
{}.tap do |hash|
|
208
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
209
|
+
end
|
210
|
+
elsif value.respond_to? :to_hash
|
211
|
+
value.to_hash
|
212
|
+
else
|
213
|
+
value
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
217
|
+
end
|
218
|
+
|
219
|
+
end
|
@@ -0,0 +1,219 @@
|
|
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 ConversationEventAddItem
|
18
|
+
attr_accessor :item_id
|
19
|
+
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
+
def self.attribute_map
|
22
|
+
{
|
23
|
+
:'item_id' => :'item_id'
|
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
|
+
:'item_id' => :'String'
|
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::ConversationEventAddItem` 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::ConversationEventAddItem`. 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?(:'item_id')
|
61
|
+
self.item_id = attributes[:'item_id']
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
66
|
+
# @return Array for valid properties with the reasons
|
67
|
+
def list_invalid_properties
|
68
|
+
invalid_properties = Array.new
|
69
|
+
invalid_properties
|
70
|
+
end
|
71
|
+
|
72
|
+
# Check to see if the all the properties in the model are valid
|
73
|
+
# @return true if the model is valid
|
74
|
+
def valid?
|
75
|
+
true
|
76
|
+
end
|
77
|
+
|
78
|
+
# Checks equality by comparing each attribute.
|
79
|
+
# @param [Object] Object to be compared
|
80
|
+
def ==(o)
|
81
|
+
return true if self.equal?(o)
|
82
|
+
self.class == o.class &&
|
83
|
+
item_id == o.item_id
|
84
|
+
end
|
85
|
+
|
86
|
+
# @see the `==` method
|
87
|
+
# @param [Object] Object to be compared
|
88
|
+
def eql?(o)
|
89
|
+
self == o
|
90
|
+
end
|
91
|
+
|
92
|
+
# Calculates hash code according to all attributes.
|
93
|
+
# @return [Integer] Hash code
|
94
|
+
def hash
|
95
|
+
[item_id].hash
|
96
|
+
end
|
97
|
+
|
98
|
+
# Builds the object from hash
|
99
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
100
|
+
# @return [Object] Returns the model itself
|
101
|
+
def self.build_from_hash(attributes)
|
102
|
+
new.build_from_hash(attributes)
|
103
|
+
end
|
104
|
+
|
105
|
+
# Builds the object from hash
|
106
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
107
|
+
# @return [Object] Returns the model itself
|
108
|
+
def build_from_hash(attributes)
|
109
|
+
return nil unless attributes.is_a?(Hash)
|
110
|
+
attributes = attributes.transform_keys(&:to_sym)
|
111
|
+
self.class.openapi_types.each_pair do |key, type|
|
112
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
113
|
+
self.send("#{key}=", nil)
|
114
|
+
elsif type =~ /\AArray<(.*)>/i
|
115
|
+
# check to ensure the input is an array given that the attribute
|
116
|
+
# is documented as an array but the input is not
|
117
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
118
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
119
|
+
end
|
120
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
121
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
self
|
126
|
+
end
|
127
|
+
|
128
|
+
# Deserializes the data based on type
|
129
|
+
# @param string type Data type
|
130
|
+
# @param string value Value to be deserialized
|
131
|
+
# @return [Object] Deserialized data
|
132
|
+
def _deserialize(type, value)
|
133
|
+
case type.to_sym
|
134
|
+
when :Time
|
135
|
+
Time.parse(value)
|
136
|
+
when :Date
|
137
|
+
Date.parse(value)
|
138
|
+
when :String
|
139
|
+
value.to_s
|
140
|
+
when :Integer
|
141
|
+
value.to_i
|
142
|
+
when :Float
|
143
|
+
value.to_f
|
144
|
+
when :Boolean
|
145
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
146
|
+
true
|
147
|
+
else
|
148
|
+
false
|
149
|
+
end
|
150
|
+
when :Object
|
151
|
+
# generic object (usually a Hash), return directly
|
152
|
+
value
|
153
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
154
|
+
inner_type = Regexp.last_match[:inner_type]
|
155
|
+
value.map { |v| _deserialize(inner_type, v) }
|
156
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
157
|
+
k_type = Regexp.last_match[:k_type]
|
158
|
+
v_type = Regexp.last_match[:v_type]
|
159
|
+
{}.tap do |hash|
|
160
|
+
value.each do |k, v|
|
161
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
162
|
+
end
|
163
|
+
end
|
164
|
+
else # model
|
165
|
+
# models (e.g. Pet) or oneOf
|
166
|
+
klass = UltracartClient.const_get(type)
|
167
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
# Returns the string representation of the object
|
172
|
+
# @return [String] String presentation of the object
|
173
|
+
def to_s
|
174
|
+
to_hash.to_s
|
175
|
+
end
|
176
|
+
|
177
|
+
# to_body is an alias to to_hash (backward compatibility)
|
178
|
+
# @return [Hash] Returns the object in the form of hash
|
179
|
+
def to_body
|
180
|
+
to_hash
|
181
|
+
end
|
182
|
+
|
183
|
+
# Returns the object in the form of hash
|
184
|
+
# @return [Hash] Returns the object in the form of hash
|
185
|
+
def to_hash
|
186
|
+
hash = {}
|
187
|
+
self.class.attribute_map.each_pair do |attr, param|
|
188
|
+
value = self.send(attr)
|
189
|
+
if value.nil?
|
190
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
191
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
192
|
+
end
|
193
|
+
|
194
|
+
hash[param] = _to_hash(value)
|
195
|
+
end
|
196
|
+
hash
|
197
|
+
end
|
198
|
+
|
199
|
+
# Outputs non-array value in the form of hash
|
200
|
+
# For object, use to_hash. Otherwise, just return the value
|
201
|
+
# @param [Object] value Any valid value
|
202
|
+
# @return [Hash] Returns the value in the form of hash
|
203
|
+
def _to_hash(value)
|
204
|
+
if value.is_a?(Array)
|
205
|
+
value.compact.map { |v| _to_hash(v) }
|
206
|
+
elsif value.is_a?(Hash)
|
207
|
+
{}.tap do |hash|
|
208
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
209
|
+
end
|
210
|
+
elsif value.respond_to? :to_hash
|
211
|
+
value.to_hash
|
212
|
+
else
|
213
|
+
value
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
217
|
+
end
|
218
|
+
|
219
|
+
end
|
@@ -18,6 +18,10 @@ module UltracartClient
|
|
18
18
|
# Conversation UUID if the websocket message is tied to a specific conversation
|
19
19
|
attr_accessor :conversation_uuid
|
20
20
|
|
21
|
+
attr_accessor :event_add_coupon
|
22
|
+
|
23
|
+
attr_accessor :event_add_item
|
24
|
+
|
21
25
|
attr_accessor :event_conversation_closed
|
22
26
|
|
23
27
|
attr_accessor :event_new_conversation
|
@@ -72,6 +76,8 @@ module UltracartClient
|
|
72
76
|
def self.attribute_map
|
73
77
|
{
|
74
78
|
:'conversation_uuid' => :'conversation_uuid',
|
79
|
+
:'event_add_coupon' => :'event_add_coupon',
|
80
|
+
:'event_add_item' => :'event_add_item',
|
75
81
|
:'event_conversation_closed' => :'event_conversation_closed',
|
76
82
|
:'event_new_conversation' => :'event_new_conversation',
|
77
83
|
:'event_new_message' => :'event_new_message',
|
@@ -97,6 +103,8 @@ module UltracartClient
|
|
97
103
|
def self.openapi_types
|
98
104
|
{
|
99
105
|
:'conversation_uuid' => :'String',
|
106
|
+
:'event_add_coupon' => :'ConversationEventAddCoupon',
|
107
|
+
:'event_add_item' => :'ConversationEventAddItem',
|
100
108
|
:'event_conversation_closed' => :'ConversationSummary',
|
101
109
|
:'event_new_conversation' => :'ConversationSummary',
|
102
110
|
:'event_new_message' => :'ConversationSummary',
|
@@ -138,6 +146,14 @@ module UltracartClient
|
|
138
146
|
self.conversation_uuid = attributes[:'conversation_uuid']
|
139
147
|
end
|
140
148
|
|
149
|
+
if attributes.key?(:'event_add_coupon')
|
150
|
+
self.event_add_coupon = attributes[:'event_add_coupon']
|
151
|
+
end
|
152
|
+
|
153
|
+
if attributes.key?(:'event_add_item')
|
154
|
+
self.event_add_item = attributes[:'event_add_item']
|
155
|
+
end
|
156
|
+
|
141
157
|
if attributes.key?(:'event_conversation_closed')
|
142
158
|
self.event_conversation_closed = attributes[:'event_conversation_closed']
|
143
159
|
end
|
@@ -201,7 +217,7 @@ module UltracartClient
|
|
201
217
|
# Check to see if the all the properties in the model are valid
|
202
218
|
# @return true if the model is valid
|
203
219
|
def valid?
|
204
|
-
event_type_validator = EnumAttributeValidator.new('String', ["queue position", "webchat start conversation", "conversation closed", "new conversation", "new message", "updated message", "queue status update", "rrweb", "participant update", "read message", "typing"])
|
220
|
+
event_type_validator = EnumAttributeValidator.new('String', ["queue position", "webchat start conversation", "conversation closed", "new conversation", "new message", "updated message", "queue status update", "rrweb", "participant update", "read message", "typing", "add coupon", "add item"])
|
205
221
|
return false unless event_type_validator.valid?(@event_type)
|
206
222
|
type_validator = EnumAttributeValidator.new('String', ["message", "event", "ping", "check queue position"])
|
207
223
|
return false unless type_validator.valid?(@type)
|
@@ -211,7 +227,7 @@ module UltracartClient
|
|
211
227
|
# Custom attribute writer method checking allowed values (enum).
|
212
228
|
# @param [Object] event_type Object to be assigned
|
213
229
|
def event_type=(event_type)
|
214
|
-
validator = EnumAttributeValidator.new('String', ["queue position", "webchat start conversation", "conversation closed", "new conversation", "new message", "updated message", "queue status update", "rrweb", "participant update", "read message", "typing"])
|
230
|
+
validator = EnumAttributeValidator.new('String', ["queue position", "webchat start conversation", "conversation closed", "new conversation", "new message", "updated message", "queue status update", "rrweb", "participant update", "read message", "typing", "add coupon", "add item"])
|
215
231
|
unless validator.valid?(event_type)
|
216
232
|
fail ArgumentError, "invalid value for \"event_type\", must be one of #{validator.allowable_values}."
|
217
233
|
end
|
@@ -234,6 +250,8 @@ module UltracartClient
|
|
234
250
|
return true if self.equal?(o)
|
235
251
|
self.class == o.class &&
|
236
252
|
conversation_uuid == o.conversation_uuid &&
|
253
|
+
event_add_coupon == o.event_add_coupon &&
|
254
|
+
event_add_item == o.event_add_item &&
|
237
255
|
event_conversation_closed == o.event_conversation_closed &&
|
238
256
|
event_new_conversation == o.event_new_conversation &&
|
239
257
|
event_new_message == o.event_new_message &&
|
@@ -258,7 +276,7 @@ module UltracartClient
|
|
258
276
|
# Calculates hash code according to all attributes.
|
259
277
|
# @return [Integer] Hash code
|
260
278
|
def hash
|
261
|
-
[conversation_uuid, event_conversation_closed, event_new_conversation, event_new_message, event_participant_update, event_queue_position, event_queue_status_update, event_read_message, event_rrweb, event_type, event_typing, event_updated_message, message, type].hash
|
279
|
+
[conversation_uuid, event_add_coupon, event_add_item, event_conversation_closed, event_new_conversation, event_new_message, event_participant_update, event_queue_position, event_queue_status_update, event_read_message, event_rrweb, event_type, event_typing, event_updated_message, message, type].hash
|
262
280
|
end
|
263
281
|
|
264
282
|
# Builds the object from hash
|
@@ -98,8 +98,8 @@ module UltracartClient
|
|
98
98
|
invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 100.')
|
99
99
|
end
|
100
100
|
|
101
|
-
if !@value.nil? && @value.to_s.length >
|
102
|
-
invalid_properties.push('invalid value for "value", the character length must be smaller than or equal to
|
101
|
+
if !@value.nil? && @value.to_s.length > 5000
|
102
|
+
invalid_properties.push('invalid value for "value", the character length must be smaller than or equal to 5000.')
|
103
103
|
end
|
104
104
|
|
105
105
|
invalid_properties
|
@@ -109,7 +109,7 @@ module UltracartClient
|
|
109
109
|
# @return true if the model is valid
|
110
110
|
def valid?
|
111
111
|
return false if !@name.nil? && @name.to_s.length > 100
|
112
|
-
return false if !@value.nil? && @value.to_s.length >
|
112
|
+
return false if !@value.nil? && @value.to_s.length > 5000
|
113
113
|
true
|
114
114
|
end
|
115
115
|
|
@@ -126,8 +126,8 @@ module UltracartClient
|
|
126
126
|
# Custom attribute writer method with validation
|
127
127
|
# @param [Object] value Value to be assigned
|
128
128
|
def value=(value)
|
129
|
-
if !value.nil? && value.to_s.length >
|
130
|
-
fail ArgumentError, 'invalid value for "value", the character length must be smaller than or equal to
|
129
|
+
if !value.nil? && value.to_s.length > 5000
|
130
|
+
fail ArgumentError, 'invalid value for "value", the character length must be smaller than or equal to 5000.'
|
131
131
|
end
|
132
132
|
|
133
133
|
@value = value
|
data/lib/ultracart_api.rb
CHANGED
@@ -137,6 +137,8 @@ require 'ultracart_api/models/city_state_zip'
|
|
137
137
|
require 'ultracart_api/models/conversation'
|
138
138
|
require 'ultracart_api/models/conversation_agent_auth'
|
139
139
|
require 'ultracart_api/models/conversation_agent_auth_response'
|
140
|
+
require 'ultracart_api/models/conversation_event_add_coupon'
|
141
|
+
require 'ultracart_api/models/conversation_event_add_item'
|
140
142
|
require 'ultracart_api/models/conversation_event_queue_position'
|
141
143
|
require 'ultracart_api/models/conversation_event_rr_web'
|
142
144
|
require 'ultracart_api/models/conversation_event_read_message'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ultracart_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.84.rc
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- UltraCart
|
@@ -187,6 +187,8 @@ files:
|
|
187
187
|
- docs/ConversationAgentAuth.md
|
188
188
|
- docs/ConversationAgentAuthResponse.md
|
189
189
|
- docs/ConversationApi.md
|
190
|
+
- docs/ConversationEventAddCoupon.md
|
191
|
+
- docs/ConversationEventAddItem.md
|
190
192
|
- docs/ConversationEventQueuePosition.md
|
191
193
|
- docs/ConversationEventRRWeb.md
|
192
194
|
- docs/ConversationEventReadMessage.md
|
@@ -907,6 +909,8 @@ files:
|
|
907
909
|
- lib/ultracart_api/models/conversation.rb
|
908
910
|
- lib/ultracart_api/models/conversation_agent_auth.rb
|
909
911
|
- lib/ultracart_api/models/conversation_agent_auth_response.rb
|
912
|
+
- lib/ultracart_api/models/conversation_event_add_coupon.rb
|
913
|
+
- lib/ultracart_api/models/conversation_event_add_item.rb
|
910
914
|
- lib/ultracart_api/models/conversation_event_queue_position.rb
|
911
915
|
- lib/ultracart_api/models/conversation_event_read_message.rb
|
912
916
|
- lib/ultracart_api/models/conversation_event_rr_web.rb
|