ultracart_api 4.0.96.rc → 4.0.98.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 +25 -4
- data/docs/ConversationApi.md +583 -5
- data/docs/ConversationAutocompleteRequest.md +20 -0
- data/docs/ConversationAutocompleteResponse.md +30 -0
- data/docs/ConversationCannedMessage.md +1 -1
- data/docs/ConversationDepartment.md +26 -0
- data/docs/ConversationDepartmentResponse.md +26 -0
- data/docs/ConversationDepartmentsResponse.md +26 -0
- data/docs/ConversationEngagement.md +30 -0
- data/docs/ConversationEngagementResponse.md +26 -0
- data/docs/ConversationEngagementsResponse.md +26 -0
- data/docs/ConversationJoinRequest.md +18 -0
- data/docs/ConversationParticipant.md +4 -0
- data/docs/ConversationSearchRequest.md +36 -0
- data/docs/ConversationSearchResponse.md +22 -0
- data/docs/ConversationWebchatQueueStatusQueueEntry.md +2 -0
- data/lib/ultracart_api/api/conversation_api.rb +550 -1
- data/lib/ultracart_api/models/conversation_autocomplete_request.rb +228 -0
- data/lib/ultracart_api/models/conversation_autocomplete_response.rb +276 -0
- data/lib/ultracart_api/models/conversation_canned_message.rb +1 -1
- data/lib/ultracart_api/models/conversation_department.rb +255 -0
- data/lib/ultracart_api/models/conversation_department_response.rb +256 -0
- data/lib/ultracart_api/models/conversation_departments_response.rb +258 -0
- data/lib/ultracart_api/models/conversation_engagement.rb +275 -0
- data/lib/ultracart_api/models/conversation_engagement_response.rb +256 -0
- data/lib/ultracart_api/models/conversation_engagements_response.rb +258 -0
- data/lib/ultracart_api/models/conversation_join_request.rb +219 -0
- data/lib/ultracart_api/models/conversation_participant.rb +19 -1
- data/lib/ultracart_api/models/conversation_search_request.rb +300 -0
- data/lib/ultracart_api/models/conversation_search_response.rb +237 -0
- data/lib/ultracart_api/models/conversation_webchat_queue_status_queue_entry.rb +10 -1
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +11 -0
- metadata +24 -2
@@ -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 ConversationJoinRequest
|
18
|
+
attr_accessor :participant_language_iso_code
|
19
|
+
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
+
def self.attribute_map
|
22
|
+
{
|
23
|
+
:'participant_language_iso_code' => :'participant_language_iso_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
|
+
:'participant_language_iso_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::ConversationJoinRequest` 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::ConversationJoinRequest`. 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?(:'participant_language_iso_code')
|
61
|
+
self.participant_language_iso_code = attributes[:'participant_language_iso_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
|
+
participant_language_iso_code == o.participant_language_iso_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
|
+
[participant_language_iso_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
|
@@ -21,6 +21,8 @@ module UltracartClient
|
|
21
21
|
|
22
22
|
attr_accessor :conversation_participant_uuid
|
23
23
|
|
24
|
+
attr_accessor :email
|
25
|
+
|
24
26
|
# Joined conversation date/time
|
25
27
|
attr_accessor :joined_dts
|
26
28
|
|
@@ -34,6 +36,8 @@ module UltracartClient
|
|
34
36
|
|
35
37
|
attr_accessor :profile_image_url
|
36
38
|
|
39
|
+
attr_accessor :sms_phone_number
|
40
|
+
|
37
41
|
attr_accessor :status
|
38
42
|
|
39
43
|
attr_accessor :timezone
|
@@ -46,11 +50,13 @@ module UltracartClient
|
|
46
50
|
:'conversation_participant_arn' => :'conversation_participant_arn',
|
47
51
|
:'conversation_participant_name' => :'conversation_participant_name',
|
48
52
|
:'conversation_participant_uuid' => :'conversation_participant_uuid',
|
53
|
+
:'email' => :'email',
|
49
54
|
:'joined_dts' => :'joined_dts',
|
50
55
|
:'language_iso_code' => :'language_iso_code',
|
51
56
|
:'last_message_dts' => :'last_message_dts',
|
52
57
|
:'left_dts' => :'left_dts',
|
53
58
|
:'profile_image_url' => :'profile_image_url',
|
59
|
+
:'sms_phone_number' => :'sms_phone_number',
|
54
60
|
:'status' => :'status',
|
55
61
|
:'timezone' => :'timezone',
|
56
62
|
:'unread_messages' => :'unread_messages'
|
@@ -68,11 +74,13 @@ module UltracartClient
|
|
68
74
|
:'conversation_participant_arn' => :'String',
|
69
75
|
:'conversation_participant_name' => :'String',
|
70
76
|
:'conversation_participant_uuid' => :'String',
|
77
|
+
:'email' => :'String',
|
71
78
|
:'joined_dts' => :'String',
|
72
79
|
:'language_iso_code' => :'String',
|
73
80
|
:'last_message_dts' => :'String',
|
74
81
|
:'left_dts' => :'String',
|
75
82
|
:'profile_image_url' => :'String',
|
83
|
+
:'sms_phone_number' => :'String',
|
76
84
|
:'status' => :'String',
|
77
85
|
:'timezone' => :'String',
|
78
86
|
:'unread_messages' => :'Integer'
|
@@ -112,6 +120,10 @@ module UltracartClient
|
|
112
120
|
self.conversation_participant_uuid = attributes[:'conversation_participant_uuid']
|
113
121
|
end
|
114
122
|
|
123
|
+
if attributes.key?(:'email')
|
124
|
+
self.email = attributes[:'email']
|
125
|
+
end
|
126
|
+
|
115
127
|
if attributes.key?(:'joined_dts')
|
116
128
|
self.joined_dts = attributes[:'joined_dts']
|
117
129
|
end
|
@@ -132,6 +144,10 @@ module UltracartClient
|
|
132
144
|
self.profile_image_url = attributes[:'profile_image_url']
|
133
145
|
end
|
134
146
|
|
147
|
+
if attributes.key?(:'sms_phone_number')
|
148
|
+
self.sms_phone_number = attributes[:'sms_phone_number']
|
149
|
+
end
|
150
|
+
|
135
151
|
if attributes.key?(:'status')
|
136
152
|
self.status = attributes[:'status']
|
137
153
|
end
|
@@ -166,11 +182,13 @@ module UltracartClient
|
|
166
182
|
conversation_participant_arn == o.conversation_participant_arn &&
|
167
183
|
conversation_participant_name == o.conversation_participant_name &&
|
168
184
|
conversation_participant_uuid == o.conversation_participant_uuid &&
|
185
|
+
email == o.email &&
|
169
186
|
joined_dts == o.joined_dts &&
|
170
187
|
language_iso_code == o.language_iso_code &&
|
171
188
|
last_message_dts == o.last_message_dts &&
|
172
189
|
left_dts == o.left_dts &&
|
173
190
|
profile_image_url == o.profile_image_url &&
|
191
|
+
sms_phone_number == o.sms_phone_number &&
|
174
192
|
status == o.status &&
|
175
193
|
timezone == o.timezone &&
|
176
194
|
unread_messages == o.unread_messages
|
@@ -185,7 +203,7 @@ module UltracartClient
|
|
185
203
|
# Calculates hash code according to all attributes.
|
186
204
|
# @return [Integer] Hash code
|
187
205
|
def hash
|
188
|
-
[conversation_participant_arn, conversation_participant_name, conversation_participant_uuid, joined_dts, language_iso_code, last_message_dts, left_dts, profile_image_url, status, timezone, unread_messages].hash
|
206
|
+
[conversation_participant_arn, conversation_participant_name, conversation_participant_uuid, email, joined_dts, language_iso_code, last_message_dts, left_dts, profile_image_url, sms_phone_number, status, timezone, unread_messages].hash
|
189
207
|
end
|
190
208
|
|
191
209
|
# Builds the object from hash
|
@@ -0,0 +1,300 @@
|
|
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 ConversationSearchRequest
|
18
|
+
attr_accessor :email_filter
|
19
|
+
|
20
|
+
attr_accessor :language_filter
|
21
|
+
|
22
|
+
attr_accessor :medium_filter
|
23
|
+
|
24
|
+
attr_accessor :order_by_newest
|
25
|
+
|
26
|
+
attr_accessor :order_by_oldest
|
27
|
+
|
28
|
+
attr_accessor :range_begin
|
29
|
+
|
30
|
+
attr_accessor :range_end
|
31
|
+
|
32
|
+
attr_accessor :sms_phone_number_filter
|
33
|
+
|
34
|
+
attr_accessor :text_search
|
35
|
+
|
36
|
+
attr_accessor :visible_filter
|
37
|
+
|
38
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
39
|
+
def self.attribute_map
|
40
|
+
{
|
41
|
+
:'email_filter' => :'email_filter',
|
42
|
+
:'language_filter' => :'language_filter',
|
43
|
+
:'medium_filter' => :'medium_filter',
|
44
|
+
:'order_by_newest' => :'order_by_newest',
|
45
|
+
:'order_by_oldest' => :'order_by_oldest',
|
46
|
+
:'range_begin' => :'range_begin',
|
47
|
+
:'range_end' => :'range_end',
|
48
|
+
:'sms_phone_number_filter' => :'sms_phone_number_filter',
|
49
|
+
:'text_search' => :'text_search',
|
50
|
+
:'visible_filter' => :'visible_filter'
|
51
|
+
}
|
52
|
+
end
|
53
|
+
|
54
|
+
# Returns all the JSON keys this model knows about
|
55
|
+
def self.acceptable_attributes
|
56
|
+
attribute_map.values
|
57
|
+
end
|
58
|
+
|
59
|
+
# Attribute type mapping.
|
60
|
+
def self.openapi_types
|
61
|
+
{
|
62
|
+
:'email_filter' => :'String',
|
63
|
+
:'language_filter' => :'String',
|
64
|
+
:'medium_filter' => :'String',
|
65
|
+
:'order_by_newest' => :'Boolean',
|
66
|
+
:'order_by_oldest' => :'Boolean',
|
67
|
+
:'range_begin' => :'Integer',
|
68
|
+
:'range_end' => :'Integer',
|
69
|
+
:'sms_phone_number_filter' => :'String',
|
70
|
+
:'text_search' => :'String',
|
71
|
+
:'visible_filter' => :'Boolean'
|
72
|
+
}
|
73
|
+
end
|
74
|
+
|
75
|
+
# List of attributes with nullable: true
|
76
|
+
def self.openapi_nullable
|
77
|
+
Set.new([
|
78
|
+
])
|
79
|
+
end
|
80
|
+
|
81
|
+
# Initializes the object
|
82
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
83
|
+
def initialize(attributes = {})
|
84
|
+
if (!attributes.is_a?(Hash))
|
85
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationSearchRequest` initialize method"
|
86
|
+
end
|
87
|
+
|
88
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
89
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
90
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
91
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationSearchRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
92
|
+
end
|
93
|
+
h[k.to_sym] = v
|
94
|
+
}
|
95
|
+
|
96
|
+
if attributes.key?(:'email_filter')
|
97
|
+
self.email_filter = attributes[:'email_filter']
|
98
|
+
end
|
99
|
+
|
100
|
+
if attributes.key?(:'language_filter')
|
101
|
+
self.language_filter = attributes[:'language_filter']
|
102
|
+
end
|
103
|
+
|
104
|
+
if attributes.key?(:'medium_filter')
|
105
|
+
self.medium_filter = attributes[:'medium_filter']
|
106
|
+
end
|
107
|
+
|
108
|
+
if attributes.key?(:'order_by_newest')
|
109
|
+
self.order_by_newest = attributes[:'order_by_newest']
|
110
|
+
end
|
111
|
+
|
112
|
+
if attributes.key?(:'order_by_oldest')
|
113
|
+
self.order_by_oldest = attributes[:'order_by_oldest']
|
114
|
+
end
|
115
|
+
|
116
|
+
if attributes.key?(:'range_begin')
|
117
|
+
self.range_begin = attributes[:'range_begin']
|
118
|
+
end
|
119
|
+
|
120
|
+
if attributes.key?(:'range_end')
|
121
|
+
self.range_end = attributes[:'range_end']
|
122
|
+
end
|
123
|
+
|
124
|
+
if attributes.key?(:'sms_phone_number_filter')
|
125
|
+
self.sms_phone_number_filter = attributes[:'sms_phone_number_filter']
|
126
|
+
end
|
127
|
+
|
128
|
+
if attributes.key?(:'text_search')
|
129
|
+
self.text_search = attributes[:'text_search']
|
130
|
+
end
|
131
|
+
|
132
|
+
if attributes.key?(:'visible_filter')
|
133
|
+
self.visible_filter = attributes[:'visible_filter']
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
138
|
+
# @return Array for valid properties with the reasons
|
139
|
+
def list_invalid_properties
|
140
|
+
invalid_properties = Array.new
|
141
|
+
invalid_properties
|
142
|
+
end
|
143
|
+
|
144
|
+
# Check to see if the all the properties in the model are valid
|
145
|
+
# @return true if the model is valid
|
146
|
+
def valid?
|
147
|
+
true
|
148
|
+
end
|
149
|
+
|
150
|
+
# Checks equality by comparing each attribute.
|
151
|
+
# @param [Object] Object to be compared
|
152
|
+
def ==(o)
|
153
|
+
return true if self.equal?(o)
|
154
|
+
self.class == o.class &&
|
155
|
+
email_filter == o.email_filter &&
|
156
|
+
language_filter == o.language_filter &&
|
157
|
+
medium_filter == o.medium_filter &&
|
158
|
+
order_by_newest == o.order_by_newest &&
|
159
|
+
order_by_oldest == o.order_by_oldest &&
|
160
|
+
range_begin == o.range_begin &&
|
161
|
+
range_end == o.range_end &&
|
162
|
+
sms_phone_number_filter == o.sms_phone_number_filter &&
|
163
|
+
text_search == o.text_search &&
|
164
|
+
visible_filter == o.visible_filter
|
165
|
+
end
|
166
|
+
|
167
|
+
# @see the `==` method
|
168
|
+
# @param [Object] Object to be compared
|
169
|
+
def eql?(o)
|
170
|
+
self == o
|
171
|
+
end
|
172
|
+
|
173
|
+
# Calculates hash code according to all attributes.
|
174
|
+
# @return [Integer] Hash code
|
175
|
+
def hash
|
176
|
+
[email_filter, language_filter, medium_filter, order_by_newest, order_by_oldest, range_begin, range_end, sms_phone_number_filter, text_search, visible_filter].hash
|
177
|
+
end
|
178
|
+
|
179
|
+
# Builds the object from hash
|
180
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
181
|
+
# @return [Object] Returns the model itself
|
182
|
+
def self.build_from_hash(attributes)
|
183
|
+
new.build_from_hash(attributes)
|
184
|
+
end
|
185
|
+
|
186
|
+
# Builds the object from hash
|
187
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
188
|
+
# @return [Object] Returns the model itself
|
189
|
+
def build_from_hash(attributes)
|
190
|
+
return nil unless attributes.is_a?(Hash)
|
191
|
+
attributes = attributes.transform_keys(&:to_sym)
|
192
|
+
self.class.openapi_types.each_pair do |key, type|
|
193
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
194
|
+
self.send("#{key}=", nil)
|
195
|
+
elsif type =~ /\AArray<(.*)>/i
|
196
|
+
# check to ensure the input is an array given that the attribute
|
197
|
+
# is documented as an array but the input is not
|
198
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
199
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
200
|
+
end
|
201
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
202
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
206
|
+
self
|
207
|
+
end
|
208
|
+
|
209
|
+
# Deserializes the data based on type
|
210
|
+
# @param string type Data type
|
211
|
+
# @param string value Value to be deserialized
|
212
|
+
# @return [Object] Deserialized data
|
213
|
+
def _deserialize(type, value)
|
214
|
+
case type.to_sym
|
215
|
+
when :Time
|
216
|
+
Time.parse(value)
|
217
|
+
when :Date
|
218
|
+
Date.parse(value)
|
219
|
+
when :String
|
220
|
+
value.to_s
|
221
|
+
when :Integer
|
222
|
+
value.to_i
|
223
|
+
when :Float
|
224
|
+
value.to_f
|
225
|
+
when :Boolean
|
226
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
227
|
+
true
|
228
|
+
else
|
229
|
+
false
|
230
|
+
end
|
231
|
+
when :Object
|
232
|
+
# generic object (usually a Hash), return directly
|
233
|
+
value
|
234
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
235
|
+
inner_type = Regexp.last_match[:inner_type]
|
236
|
+
value.map { |v| _deserialize(inner_type, v) }
|
237
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
238
|
+
k_type = Regexp.last_match[:k_type]
|
239
|
+
v_type = Regexp.last_match[:v_type]
|
240
|
+
{}.tap do |hash|
|
241
|
+
value.each do |k, v|
|
242
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
243
|
+
end
|
244
|
+
end
|
245
|
+
else # model
|
246
|
+
# models (e.g. Pet) or oneOf
|
247
|
+
klass = UltracartClient.const_get(type)
|
248
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
249
|
+
end
|
250
|
+
end
|
251
|
+
|
252
|
+
# Returns the string representation of the object
|
253
|
+
# @return [String] String presentation of the object
|
254
|
+
def to_s
|
255
|
+
to_hash.to_s
|
256
|
+
end
|
257
|
+
|
258
|
+
# to_body is an alias to to_hash (backward compatibility)
|
259
|
+
# @return [Hash] Returns the object in the form of hash
|
260
|
+
def to_body
|
261
|
+
to_hash
|
262
|
+
end
|
263
|
+
|
264
|
+
# Returns the object in the form of hash
|
265
|
+
# @return [Hash] Returns the object in the form of hash
|
266
|
+
def to_hash
|
267
|
+
hash = {}
|
268
|
+
self.class.attribute_map.each_pair do |attr, param|
|
269
|
+
value = self.send(attr)
|
270
|
+
if value.nil?
|
271
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
272
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
273
|
+
end
|
274
|
+
|
275
|
+
hash[param] = _to_hash(value)
|
276
|
+
end
|
277
|
+
hash
|
278
|
+
end
|
279
|
+
|
280
|
+
# Outputs non-array value in the form of hash
|
281
|
+
# For object, use to_hash. Otherwise, just return the value
|
282
|
+
# @param [Object] value Any valid value
|
283
|
+
# @return [Hash] Returns the value in the form of hash
|
284
|
+
def _to_hash(value)
|
285
|
+
if value.is_a?(Array)
|
286
|
+
value.compact.map { |v| _to_hash(v) }
|
287
|
+
elsif value.is_a?(Hash)
|
288
|
+
{}.tap do |hash|
|
289
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
290
|
+
end
|
291
|
+
elsif value.respond_to? :to_hash
|
292
|
+
value.to_hash
|
293
|
+
else
|
294
|
+
value
|
295
|
+
end
|
296
|
+
end
|
297
|
+
|
298
|
+
end
|
299
|
+
|
300
|
+
end
|