ultracart_api 4.1.80 → 4.1.82

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.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +34 -2
  3. data/docs/AgentSummary.md +30 -0
  4. data/docs/ConversationAgentCallEvent.md +30 -0
  5. data/docs/ConversationAgentChatEvent.md +26 -0
  6. data/docs/ConversationAgentStatusConfig.md +42 -0
  7. data/docs/ConversationAgentStatusConfigResponse.md +26 -0
  8. data/docs/ConversationAgentStatusConfigsResponse.md +26 -0
  9. data/docs/ConversationAgentStatusEvent.md +48 -0
  10. data/docs/ConversationAgentStatusHeatmapRequest.md +24 -0
  11. data/docs/ConversationAgentStatusHeatmapResponse.md +30 -0
  12. data/docs/ConversationAgentStatusHistorySearchRequest.md +28 -0
  13. data/docs/ConversationAgentStatusHistorySearchResponse.md +28 -0
  14. data/docs/ConversationAgentStatusRollup.md +38 -0
  15. data/docs/ConversationAgentStatusRollupSearchRequest.md +24 -0
  16. data/docs/ConversationAgentStatusRollupSearchResponse.md +26 -0
  17. data/docs/ConversationAgentStatusSummaryResponse.md +32 -0
  18. data/docs/ConversationAgentStatusTimelineResponse.md +32 -0
  19. data/docs/ConversationApi.md +600 -0
  20. data/docs/ConversationPbxDefaultTimezoneResponse.md +26 -0
  21. data/docs/ConversationPbxDefaultTimezoneUpdateRequest.md +18 -0
  22. data/docs/ConversationWebchatQueueStatusAgent.md +6 -0
  23. data/docs/ConversationWebchatQueueStatusUpdateRequest.md +5 -1
  24. data/docs/TimelineSummary.md +26 -0
  25. data/lib/ultracart_api/api/conversation_api.rb +766 -2
  26. data/lib/ultracart_api/models/agent_summary.rb +279 -0
  27. data/lib/ultracart_api/models/conversation_agent_call_event.rb +314 -0
  28. data/lib/ultracart_api/models/conversation_agent_chat_event.rb +260 -0
  29. data/lib/ultracart_api/models/conversation_agent_status_config.rb +461 -0
  30. data/lib/ultracart_api/models/conversation_agent_status_config_response.rb +256 -0
  31. data/lib/ultracart_api/models/conversation_agent_status_configs_response.rb +259 -0
  32. data/lib/ultracart_api/models/conversation_agent_status_event.rb +512 -0
  33. data/lib/ultracart_api/models/conversation_agent_status_heatmap_request.rb +296 -0
  34. data/lib/ultracart_api/models/conversation_agent_status_heatmap_response.rb +283 -0
  35. data/lib/ultracart_api/models/conversation_agent_status_history_search_request.rb +316 -0
  36. data/lib/ultracart_api/models/conversation_agent_status_history_search_response.rb +269 -0
  37. data/lib/ultracart_api/models/conversation_agent_status_rollup.rb +353 -0
  38. data/lib/ultracart_api/models/conversation_agent_status_rollup_search_request.rb +284 -0
  39. data/lib/ultracart_api/models/conversation_agent_status_rollup_search_response.rb +259 -0
  40. data/lib/ultracart_api/models/conversation_agent_status_summary_response.rb +288 -0
  41. data/lib/ultracart_api/models/conversation_agent_status_timeline_response.rb +292 -0
  42. data/lib/ultracart_api/models/conversation_pbx_default_timezone_response.rb +272 -0
  43. data/lib/ultracart_api/models/conversation_pbx_default_timezone_update_request.rb +235 -0
  44. data/lib/ultracart_api/models/conversation_webchat_queue_status_agent.rb +31 -1
  45. data/lib/ultracart_api/models/conversation_webchat_queue_status_update_request.rb +24 -4
  46. data/lib/ultracart_api/models/timeline_summary.rb +260 -0
  47. data/lib/ultracart_api/version.rb +1 -1
  48. data/lib/ultracart_api.rb +19 -0
  49. metadata +40 -2
@@ -0,0 +1,296 @@
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 ConversationAgentStatusHeatmapRequest
18
+ # Optional channel filter
19
+ attr_accessor :channel
20
+
21
+ # Range end (YYYY-MM-DD)
22
+ attr_accessor :date_end
23
+
24
+ # Range start (YYYY-MM-DD)
25
+ attr_accessor :date_start
26
+
27
+ # Cell metric
28
+ attr_accessor :metric
29
+
30
+ class EnumAttributeValidator
31
+ attr_reader :datatype
32
+ attr_reader :allowable_values
33
+
34
+ def initialize(datatype, allowable_values)
35
+ @allowable_values = allowable_values.map do |value|
36
+ case datatype.to_s
37
+ when /Integer/i
38
+ value.to_i
39
+ when /Float/i
40
+ value.to_f
41
+ else
42
+ value
43
+ end
44
+ end
45
+ end
46
+
47
+ def valid?(value)
48
+ !value || allowable_values.include?(value)
49
+ end
50
+ end
51
+
52
+ # Attribute mapping from ruby-style variable name to JSON key.
53
+ def self.attribute_map
54
+ {
55
+ :'channel' => :'channel',
56
+ :'date_end' => :'date_end',
57
+ :'date_start' => :'date_start',
58
+ :'metric' => :'metric'
59
+ }
60
+ end
61
+
62
+ # Returns all the JSON keys this model knows about
63
+ def self.acceptable_attributes
64
+ attribute_map.values
65
+ end
66
+
67
+ # Attribute type mapping.
68
+ def self.openapi_types
69
+ {
70
+ :'channel' => :'String',
71
+ :'date_end' => :'String',
72
+ :'date_start' => :'String',
73
+ :'metric' => :'String'
74
+ }
75
+ end
76
+
77
+ # List of attributes with nullable: true
78
+ def self.openapi_nullable
79
+ Set.new([
80
+ ])
81
+ end
82
+
83
+ # Initializes the object
84
+ # @param [Hash] attributes Model attributes in the form of hash
85
+ def initialize(attributes = {})
86
+ if (!attributes.is_a?(Hash))
87
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationAgentStatusHeatmapRequest` initialize method"
88
+ end
89
+
90
+ # check to see if the attribute exists and convert string to symbol for hash key
91
+ attributes = attributes.each_with_object({}) { |(k, v), h|
92
+ if (!self.class.attribute_map.key?(k.to_sym))
93
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationAgentStatusHeatmapRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
94
+ end
95
+ h[k.to_sym] = v
96
+ }
97
+
98
+ if attributes.key?(:'channel')
99
+ self.channel = attributes[:'channel']
100
+ end
101
+
102
+ if attributes.key?(:'date_end')
103
+ self.date_end = attributes[:'date_end']
104
+ end
105
+
106
+ if attributes.key?(:'date_start')
107
+ self.date_start = attributes[:'date_start']
108
+ end
109
+
110
+ if attributes.key?(:'metric')
111
+ self.metric = attributes[:'metric']
112
+ end
113
+ end
114
+
115
+ # Show invalid properties with the reasons. Usually used together with valid?
116
+ # @return Array for valid properties with the reasons
117
+ def list_invalid_properties
118
+ invalid_properties = Array.new
119
+ invalid_properties
120
+ end
121
+
122
+ # Check to see if the all the properties in the model are valid
123
+ # @return true if the model is valid
124
+ def valid?
125
+ channel_validator = EnumAttributeValidator.new('String', ["pbx", "chat"])
126
+ return false unless channel_validator.valid?(@channel)
127
+ metric_validator = EnumAttributeValidator.new('String', ["availability", "call_volume", "chat_volume"])
128
+ return false unless metric_validator.valid?(@metric)
129
+ true
130
+ end
131
+
132
+ # Custom attribute writer method checking allowed values (enum).
133
+ # @param [Object] channel Object to be assigned
134
+ def channel=(channel)
135
+ validator = EnumAttributeValidator.new('String', ["pbx", "chat"])
136
+ unless validator.valid?(channel)
137
+ fail ArgumentError, "invalid value for \"channel\", must be one of #{validator.allowable_values}."
138
+ end
139
+ @channel = channel
140
+ end
141
+
142
+ # Custom attribute writer method checking allowed values (enum).
143
+ # @param [Object] metric Object to be assigned
144
+ def metric=(metric)
145
+ validator = EnumAttributeValidator.new('String', ["availability", "call_volume", "chat_volume"])
146
+ unless validator.valid?(metric)
147
+ fail ArgumentError, "invalid value for \"metric\", must be one of #{validator.allowable_values}."
148
+ end
149
+ @metric = metric
150
+ end
151
+
152
+ # Checks equality by comparing each attribute.
153
+ # @param [Object] Object to be compared
154
+ def ==(o)
155
+ return true if self.equal?(o)
156
+ self.class == o.class &&
157
+ channel == o.channel &&
158
+ date_end == o.date_end &&
159
+ date_start == o.date_start &&
160
+ metric == o.metric
161
+ end
162
+
163
+ # @see the `==` method
164
+ # @param [Object] Object to be compared
165
+ def eql?(o)
166
+ self == o
167
+ end
168
+
169
+ # Calculates hash code according to all attributes.
170
+ # @return [Integer] Hash code
171
+ def hash
172
+ [channel, date_end, date_start, metric].hash
173
+ end
174
+
175
+ # Builds the object from hash
176
+ # @param [Hash] attributes Model attributes in the form of hash
177
+ # @return [Object] Returns the model itself
178
+ def self.build_from_hash(attributes)
179
+ new.build_from_hash(attributes)
180
+ end
181
+
182
+ # Builds the object from hash
183
+ # @param [Hash] attributes Model attributes in the form of hash
184
+ # @return [Object] Returns the model itself
185
+ def build_from_hash(attributes)
186
+ return nil unless attributes.is_a?(Hash)
187
+ attributes = attributes.transform_keys(&:to_sym)
188
+ self.class.openapi_types.each_pair do |key, type|
189
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
190
+ self.send("#{key}=", nil)
191
+ elsif type =~ /\AArray<(.*)>/i
192
+ # check to ensure the input is an array given that the attribute
193
+ # is documented as an array but the input is not
194
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
195
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
196
+ end
197
+ elsif !attributes[self.class.attribute_map[key]].nil?
198
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
199
+ end
200
+ end
201
+
202
+ self
203
+ end
204
+
205
+ # Deserializes the data based on type
206
+ # @param string type Data type
207
+ # @param string value Value to be deserialized
208
+ # @return [Object] Deserialized data
209
+ def _deserialize(type, value)
210
+ case type.to_sym
211
+ when :Time
212
+ Time.parse(value)
213
+ when :Date
214
+ Date.parse(value)
215
+ when :String
216
+ value.to_s
217
+ when :Integer
218
+ value.to_i
219
+ when :Float
220
+ value.to_f
221
+ when :Boolean
222
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
223
+ true
224
+ else
225
+ false
226
+ end
227
+ when :Object
228
+ # generic object (usually a Hash), return directly
229
+ value
230
+ when /\AArray<(?<inner_type>.+)>\z/
231
+ inner_type = Regexp.last_match[:inner_type]
232
+ value.map { |v| _deserialize(inner_type, v) }
233
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
234
+ k_type = Regexp.last_match[:k_type]
235
+ v_type = Regexp.last_match[:v_type]
236
+ {}.tap do |hash|
237
+ value.each do |k, v|
238
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
239
+ end
240
+ end
241
+ else # model
242
+ # models (e.g. Pet) or oneOf
243
+ klass = UltracartClient.const_get(type)
244
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
245
+ end
246
+ end
247
+
248
+ # Returns the string representation of the object
249
+ # @return [String] String presentation of the object
250
+ def to_s
251
+ to_hash.to_s
252
+ end
253
+
254
+ # to_body is an alias to to_hash (backward compatibility)
255
+ # @return [Hash] Returns the object in the form of hash
256
+ def to_body
257
+ to_hash
258
+ end
259
+
260
+ # Returns the object in the form of hash
261
+ # @return [Hash] Returns the object in the form of hash
262
+ def to_hash
263
+ hash = {}
264
+ self.class.attribute_map.each_pair do |attr, param|
265
+ value = self.send(attr)
266
+ if value.nil?
267
+ is_nullable = self.class.openapi_nullable.include?(attr)
268
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
269
+ end
270
+
271
+ hash[param] = _to_hash(value)
272
+ end
273
+ hash
274
+ end
275
+
276
+ # Outputs non-array value in the form of hash
277
+ # For object, use to_hash. Otherwise, just return the value
278
+ # @param [Object] value Any valid value
279
+ # @return [Hash] Returns the value in the form of hash
280
+ def _to_hash(value)
281
+ if value.is_a?(Array)
282
+ value.compact.map { |v| _to_hash(v) }
283
+ elsif value.is_a?(Hash)
284
+ {}.tap do |hash|
285
+ value.each { |k, v| hash[k] = _to_hash(v) }
286
+ end
287
+ elsif value.respond_to? :to_hash
288
+ value.to_hash
289
+ else
290
+ value
291
+ end
292
+ end
293
+
294
+ end
295
+
296
+ end
@@ -0,0 +1,283 @@
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 ConversationAgentStatusHeatmapResponse
18
+ # Y-axis labels (one per agent)
19
+ attr_accessor :agents
20
+
21
+ # Sparse cells. Each row is [agent_index, hour, value]; empty cells are omitted.
22
+ attr_accessor :data
23
+
24
+ attr_accessor :error
25
+
26
+ # X-axis values (hours of day, 0-23)
27
+ attr_accessor :hours
28
+
29
+ attr_accessor :metadata
30
+
31
+ # Indicates if API call was successful
32
+ attr_accessor :success
33
+
34
+ attr_accessor :warning
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'agents' => :'agents',
40
+ :'data' => :'data',
41
+ :'error' => :'error',
42
+ :'hours' => :'hours',
43
+ :'metadata' => :'metadata',
44
+ :'success' => :'success',
45
+ :'warning' => :'warning'
46
+ }
47
+ end
48
+
49
+ # Returns all the JSON keys this model knows about
50
+ def self.acceptable_attributes
51
+ attribute_map.values
52
+ end
53
+
54
+ # Attribute type mapping.
55
+ def self.openapi_types
56
+ {
57
+ :'agents' => :'Array<String>',
58
+ :'data' => :'Array<Object>',
59
+ :'error' => :'Error',
60
+ :'hours' => :'Array<Integer>',
61
+ :'metadata' => :'ResponseMetadata',
62
+ :'success' => :'Boolean',
63
+ :'warning' => :'Warning'
64
+ }
65
+ end
66
+
67
+ # List of attributes with nullable: true
68
+ def self.openapi_nullable
69
+ Set.new([
70
+ ])
71
+ end
72
+
73
+ # Initializes the object
74
+ # @param [Hash] attributes Model attributes in the form of hash
75
+ def initialize(attributes = {})
76
+ if (!attributes.is_a?(Hash))
77
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationAgentStatusHeatmapResponse` initialize method"
78
+ end
79
+
80
+ # check to see if the attribute exists and convert string to symbol for hash key
81
+ attributes = attributes.each_with_object({}) { |(k, v), h|
82
+ if (!self.class.attribute_map.key?(k.to_sym))
83
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationAgentStatusHeatmapResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
84
+ end
85
+ h[k.to_sym] = v
86
+ }
87
+
88
+ if attributes.key?(:'agents')
89
+ if (value = attributes[:'agents']).is_a?(Array)
90
+ self.agents = value
91
+ end
92
+ end
93
+
94
+ if attributes.key?(:'data')
95
+ if (value = attributes[:'data']).is_a?(Array)
96
+ self.data = value
97
+ end
98
+ end
99
+
100
+ if attributes.key?(:'error')
101
+ self.error = attributes[:'error']
102
+ end
103
+
104
+ if attributes.key?(:'hours')
105
+ if (value = attributes[:'hours']).is_a?(Array)
106
+ self.hours = value
107
+ end
108
+ end
109
+
110
+ if attributes.key?(:'metadata')
111
+ self.metadata = attributes[:'metadata']
112
+ end
113
+
114
+ if attributes.key?(:'success')
115
+ self.success = attributes[:'success']
116
+ end
117
+
118
+ if attributes.key?(:'warning')
119
+ self.warning = attributes[:'warning']
120
+ end
121
+ end
122
+
123
+ # Show invalid properties with the reasons. Usually used together with valid?
124
+ # @return Array for valid properties with the reasons
125
+ def list_invalid_properties
126
+ invalid_properties = Array.new
127
+ invalid_properties
128
+ end
129
+
130
+ # Check to see if the all the properties in the model are valid
131
+ # @return true if the model is valid
132
+ def valid?
133
+ true
134
+ end
135
+
136
+ # Checks equality by comparing each attribute.
137
+ # @param [Object] Object to be compared
138
+ def ==(o)
139
+ return true if self.equal?(o)
140
+ self.class == o.class &&
141
+ agents == o.agents &&
142
+ data == o.data &&
143
+ error == o.error &&
144
+ hours == o.hours &&
145
+ metadata == o.metadata &&
146
+ success == o.success &&
147
+ warning == o.warning
148
+ end
149
+
150
+ # @see the `==` method
151
+ # @param [Object] Object to be compared
152
+ def eql?(o)
153
+ self == o
154
+ end
155
+
156
+ # Calculates hash code according to all attributes.
157
+ # @return [Integer] Hash code
158
+ def hash
159
+ [agents, data, error, hours, metadata, success, warning].hash
160
+ end
161
+
162
+ # Builds the object from hash
163
+ # @param [Hash] attributes Model attributes in the form of hash
164
+ # @return [Object] Returns the model itself
165
+ def self.build_from_hash(attributes)
166
+ new.build_from_hash(attributes)
167
+ end
168
+
169
+ # Builds the object from hash
170
+ # @param [Hash] attributes Model attributes in the form of hash
171
+ # @return [Object] Returns the model itself
172
+ def build_from_hash(attributes)
173
+ return nil unless attributes.is_a?(Hash)
174
+ attributes = attributes.transform_keys(&:to_sym)
175
+ self.class.openapi_types.each_pair do |key, type|
176
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
177
+ self.send("#{key}=", nil)
178
+ elsif type =~ /\AArray<(.*)>/i
179
+ # check to ensure the input is an array given that the attribute
180
+ # is documented as an array but the input is not
181
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
182
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
183
+ end
184
+ elsif !attributes[self.class.attribute_map[key]].nil?
185
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
186
+ end
187
+ end
188
+
189
+ self
190
+ end
191
+
192
+ # Deserializes the data based on type
193
+ # @param string type Data type
194
+ # @param string value Value to be deserialized
195
+ # @return [Object] Deserialized data
196
+ def _deserialize(type, value)
197
+ case type.to_sym
198
+ when :Time
199
+ Time.parse(value)
200
+ when :Date
201
+ Date.parse(value)
202
+ when :String
203
+ value.to_s
204
+ when :Integer
205
+ value.to_i
206
+ when :Float
207
+ value.to_f
208
+ when :Boolean
209
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
210
+ true
211
+ else
212
+ false
213
+ end
214
+ when :Object
215
+ # generic object (usually a Hash), return directly
216
+ value
217
+ when /\AArray<(?<inner_type>.+)>\z/
218
+ inner_type = Regexp.last_match[:inner_type]
219
+ value.map { |v| _deserialize(inner_type, v) }
220
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
221
+ k_type = Regexp.last_match[:k_type]
222
+ v_type = Regexp.last_match[:v_type]
223
+ {}.tap do |hash|
224
+ value.each do |k, v|
225
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
226
+ end
227
+ end
228
+ else # model
229
+ # models (e.g. Pet) or oneOf
230
+ klass = UltracartClient.const_get(type)
231
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
232
+ end
233
+ end
234
+
235
+ # Returns the string representation of the object
236
+ # @return [String] String presentation of the object
237
+ def to_s
238
+ to_hash.to_s
239
+ end
240
+
241
+ # to_body is an alias to to_hash (backward compatibility)
242
+ # @return [Hash] Returns the object in the form of hash
243
+ def to_body
244
+ to_hash
245
+ end
246
+
247
+ # Returns the object in the form of hash
248
+ # @return [Hash] Returns the object in the form of hash
249
+ def to_hash
250
+ hash = {}
251
+ self.class.attribute_map.each_pair do |attr, param|
252
+ value = self.send(attr)
253
+ if value.nil?
254
+ is_nullable = self.class.openapi_nullable.include?(attr)
255
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
256
+ end
257
+
258
+ hash[param] = _to_hash(value)
259
+ end
260
+ hash
261
+ end
262
+
263
+ # Outputs non-array value in the form of hash
264
+ # For object, use to_hash. Otherwise, just return the value
265
+ # @param [Object] value Any valid value
266
+ # @return [Hash] Returns the value in the form of hash
267
+ def _to_hash(value)
268
+ if value.is_a?(Array)
269
+ value.compact.map { |v| _to_hash(v) }
270
+ elsif value.is_a?(Hash)
271
+ {}.tap do |hash|
272
+ value.each { |k, v| hash[k] = _to_hash(v) }
273
+ end
274
+ elsif value.respond_to? :to_hash
275
+ value.to_hash
276
+ else
277
+ value
278
+ end
279
+ end
280
+
281
+ end
282
+
283
+ end