ultracart_api 4.0.126.rc → 4.0.127

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: 3fee625783588cc5e92f0234a2bc51ad05cf9cfc7cba985ee51fc87dcf72876e
4
- data.tar.gz: f4b0625e2afa45c19c7d022d776f119e06224e4592f001efda0d9ed5fe8e5682
3
+ metadata.gz: 50f64e8e08ec70ce2f267c339a760045fb5d7cacbdec3e01045001501abaf08d
4
+ data.tar.gz: b44523a8d96ea5cf9d02cb68dd26c6fbc5d822f472d013bb57ae082782bebcaa
5
5
  SHA512:
6
- metadata.gz: b67f1b0e27f0d7693dbf4134db1c8553fe9288fe3ce49af829e8251ca20afbeb31132057b6e4d4f64f494fc2c06dc9e59daffbc25cd76293def65b149468fef6
7
- data.tar.gz: 3b3fcede5e97f059bdc78f28b81136c796e6085365d5b52c606ee5b69669654a4b37f647a53c8c5611cacb945c14a151baef7aa05f15f4a117f226128a931523
6
+ metadata.gz: c321c01134dce230710e03b3f089fc0b881611507e44ad8f1015dba56b7690de71b5b9beea60d5a586c47448a922ce40be5f44a540949bbd31221bedfe2508ca
7
+ data.tar.gz: 044cb93915d7f10219c9da7acb68c7f7c001a1c0ad7fbcff073f8161a4ed5471bd86de06e37fd89fa2b200abbded75db360061d63e0982f6edf7778ce28cb714
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.126.rc
10
+ - Package version: 4.0.127
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.126.rc.gem
27
+ gem install ./ultracart_api-4.0.127.gem
28
28
  ```
29
29
 
30
- (for development, run `gem install --dev ./ultracart_api-4.0.126.rc.gem` to install the development dependencies)
30
+ (for development, run `gem install --dev ./ultracart_api-4.0.127.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.126.rc'
36
+ gem 'ultracart_api', '~> 4.0.127'
37
37
 
38
38
  ### Install from Git
39
39
 
@@ -156,6 +156,7 @@ Class | Method | HTTP request | Description
156
156
  *UltracartClient::ConversationApi* | [**get_conversations**](docs/ConversationApi.md#get_conversations) | **GET** /conversation/conversations | Retrieve a list of conversation summaries newest to oldest
157
157
  *UltracartClient::ConversationApi* | [**get_conversations_autocomplete**](docs/ConversationApi.md#get_conversations_autocomplete) | **POST** /conversation/conversations/autocomplete | Retrieve a list of matching terms for a search field
158
158
  *UltracartClient::ConversationApi* | [**get_conversations_search**](docs/ConversationApi.md#get_conversations_search) | **POST** /conversation/conversations/search | Search conversations
159
+ *UltracartClient::ConversationApi* | [**get_locations_for_engagement**](docs/ConversationApi.md#get_locations_for_engagement) | **POST** /conversation/locations | Get location data for engagement configuration
159
160
  *UltracartClient::ConversationApi* | [**insert_conversation_canned_message**](docs/ConversationApi.md#insert_conversation_canned_message) | **POST** /conversation/canned_messages | Insert a canned message
160
161
  *UltracartClient::ConversationApi* | [**insert_conversation_department**](docs/ConversationApi.md#insert_conversation_department) | **POST** /conversation/departments | Insert a department
161
162
  *UltracartClient::ConversationApi* | [**insert_conversation_engagement**](docs/ConversationApi.md#insert_conversation_engagement) | **POST** /conversation/engagements | Insert a engagement
@@ -647,6 +648,9 @@ Class | Method | HTTP request | Description
647
648
  - [UltracartClient::ConversationEventTyping](docs/ConversationEventTyping.md)
648
649
  - [UltracartClient::ConversationEventWebchatContext](docs/ConversationEventWebchatContext.md)
649
650
  - [UltracartClient::ConversationJoinRequest](docs/ConversationJoinRequest.md)
651
+ - [UltracartClient::ConversationLocationCountry](docs/ConversationLocationCountry.md)
652
+ - [UltracartClient::ConversationLocationStateProvince](docs/ConversationLocationStateProvince.md)
653
+ - [UltracartClient::ConversationLocationsResponse](docs/ConversationLocationsResponse.md)
650
654
  - [UltracartClient::ConversationMessage](docs/ConversationMessage.md)
651
655
  - [UltracartClient::ConversationMessageTranslation](docs/ConversationMessageTranslation.md)
652
656
  - [UltracartClient::ConversationMessageTransportStatus](docs/ConversationMessageTransportStatus.md)
@@ -1300,6 +1304,7 @@ Not every change is committed to every SDK.
1300
1304
 
1301
1305
  | Version | Date | Comments |
1302
1306
  | --: | :-: | --- |
1307
+ | 4.0.127 | 01/27/2023 | conversations - getLocationsForEngagement method |
1303
1308
  | 4.0.126-RC | 01/26/2023 | typo in ConversationWebsocketMessage |
1304
1309
  | 4.0.125-RC | 01/26/2023 | conversation - added message type of engagement prompt |
1305
1310
  | 4.0.124-RC | 01/25/2023 | convo event for engage customer |
@@ -23,6 +23,7 @@ All URIs are relative to *https://secure.ultracart.com/rest/v2*
23
23
  | [**get_conversations**](ConversationApi.md#get_conversations) | **GET** /conversation/conversations | Retrieve a list of conversation summaries newest to oldest |
24
24
  | [**get_conversations_autocomplete**](ConversationApi.md#get_conversations_autocomplete) | **POST** /conversation/conversations/autocomplete | Retrieve a list of matching terms for a search field |
25
25
  | [**get_conversations_search**](ConversationApi.md#get_conversations_search) | **POST** /conversation/conversations/search | Search conversations |
26
+ | [**get_locations_for_engagement**](ConversationApi.md#get_locations_for_engagement) | **POST** /conversation/locations | Get location data for engagement configuration |
26
27
  | [**insert_conversation_canned_message**](ConversationApi.md#insert_conversation_canned_message) | **POST** /conversation/canned_messages | Insert a canned message |
27
28
  | [**insert_conversation_department**](ConversationApi.md#insert_conversation_department) | **POST** /conversation/departments | Insert a department |
28
29
  | [**insert_conversation_engagement**](ConversationApi.md#insert_conversation_engagement) | **POST** /conversation/engagements | Insert a engagement |
@@ -1376,6 +1377,74 @@ end
1376
1377
  - **Accept**: application/json
1377
1378
 
1378
1379
 
1380
+ ## get_locations_for_engagement
1381
+
1382
+ > <ConversationLocationsResponse> get_locations_for_engagement
1383
+
1384
+ Get location data for engagement configuration
1385
+
1386
+ Get location data for engagement configuration
1387
+
1388
+ ### Examples
1389
+
1390
+ ```ruby
1391
+ require 'time'
1392
+ require 'ultracart_api'
1393
+ require 'json'
1394
+ require 'yaml'
1395
+ require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
1396
+
1397
+ # This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
1398
+ # As such, this might not be the best way to use this object.
1399
+ # Please see https://github.com/UltraCart/sdk_samples for working examples.
1400
+
1401
+ api = UltracartClient::ConversationApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
1402
+
1403
+ begin
1404
+ # Get location data for engagement configuration
1405
+ result = api_instance.get_locations_for_engagement
1406
+ p result
1407
+ rescue UltracartClient::ApiError => e
1408
+ puts "Error when calling ConversationApi->get_locations_for_engagement: #{e}"
1409
+ end
1410
+ ```
1411
+
1412
+ #### Using the get_locations_for_engagement_with_http_info variant
1413
+
1414
+ This returns an Array which contains the response data, status code and headers.
1415
+
1416
+ > <Array(<ConversationLocationsResponse>, Integer, Hash)> get_locations_for_engagement_with_http_info
1417
+
1418
+ ```ruby
1419
+ begin
1420
+ # Get location data for engagement configuration
1421
+ data, status_code, headers = api_instance.get_locations_for_engagement_with_http_info
1422
+ p status_code # => 2xx
1423
+ p headers # => { ... }
1424
+ p data # => <ConversationLocationsResponse>
1425
+ rescue UltracartClient::ApiError => e
1426
+ puts "Error when calling ConversationApi->get_locations_for_engagement_with_http_info: #{e}"
1427
+ end
1428
+ ```
1429
+
1430
+ ### Parameters
1431
+
1432
+ This endpoint does not need any parameter.
1433
+
1434
+ ### Return type
1435
+
1436
+ [**ConversationLocationsResponse**](ConversationLocationsResponse.md)
1437
+
1438
+ ### Authorization
1439
+
1440
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1441
+
1442
+ ### HTTP request headers
1443
+
1444
+ - **Content-Type**: Not defined
1445
+ - **Accept**: application/json
1446
+
1447
+
1379
1448
  ## insert_conversation_canned_message
1380
1449
 
1381
1450
  > <ConversationCannedMessageResponse> insert_conversation_canned_message(canned_message)
@@ -0,0 +1,22 @@
1
+ # UltracartClient::ConversationLocationCountry
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **iso2** | **String** | | [optional] |
8
+ | **name** | **String** | | [optional] |
9
+ | **state_provinces** | [**Array&lt;ConversationLocationStateProvince&gt;**](ConversationLocationStateProvince.md) | | [optional] |
10
+
11
+ ## Example
12
+
13
+ ```ruby
14
+ require 'ultracart_api'
15
+
16
+ instance = UltracartClient::ConversationLocationCountry.new(
17
+ iso2: null,
18
+ name: null,
19
+ state_provinces: null
20
+ )
21
+ ```
22
+
@@ -0,0 +1,20 @@
1
+ # UltracartClient::ConversationLocationStateProvince
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **abbreviation** | **String** | | [optional] |
8
+ | **name** | **String** | | [optional] |
9
+
10
+ ## Example
11
+
12
+ ```ruby
13
+ require 'ultracart_api'
14
+
15
+ instance = UltracartClient::ConversationLocationStateProvince.new(
16
+ abbreviation: null,
17
+ name: null
18
+ )
19
+ ```
20
+
@@ -0,0 +1,26 @@
1
+ # UltracartClient::ConversationLocationsResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **countries** | [**Array&lt;ConversationLocationCountry&gt;**](ConversationLocationCountry.md) | | [optional] |
8
+ | **error** | [**Error**](Error.md) | | [optional] |
9
+ | **metadata** | [**ResponseMetadata**](ResponseMetadata.md) | | [optional] |
10
+ | **success** | **Boolean** | Indicates if API call was successful | [optional] |
11
+ | **warning** | [**Warning**](Warning.md) | | [optional] |
12
+
13
+ ## Example
14
+
15
+ ```ruby
16
+ require 'ultracart_api'
17
+
18
+ instance = UltracartClient::ConversationLocationsResponse.new(
19
+ countries: null,
20
+ error: null,
21
+ metadata: null,
22
+ success: null,
23
+ warning: null
24
+ )
25
+ ```
26
+
@@ -1228,6 +1228,64 @@ module UltracartClient
1228
1228
  return data, status_code, headers
1229
1229
  end
1230
1230
 
1231
+ # Get location data for engagement configuration
1232
+ # Get location data for engagement configuration
1233
+ # @param [Hash] opts the optional parameters
1234
+ # @return [ConversationLocationsResponse]
1235
+ def get_locations_for_engagement(opts = {})
1236
+ data, _status_code, _headers = get_locations_for_engagement_with_http_info(opts)
1237
+ data
1238
+ end
1239
+
1240
+ # Get location data for engagement configuration
1241
+ # Get location data for engagement configuration
1242
+ # @param [Hash] opts the optional parameters
1243
+ # @return [Array<(ConversationLocationsResponse, Integer, Hash)>] ConversationLocationsResponse data, response status code and response headers
1244
+ def get_locations_for_engagement_with_http_info(opts = {})
1245
+ if @api_client.config.debugging
1246
+ @api_client.config.logger.debug 'Calling API: ConversationApi.get_locations_for_engagement ...'
1247
+ end
1248
+ # resource path
1249
+ local_var_path = '/conversation/locations'
1250
+
1251
+ # query parameters
1252
+ query_params = opts[:query_params] || {}
1253
+
1254
+ # header parameters
1255
+ header_params = opts[:header_params] || {}
1256
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
1257
+ # HTTP header 'Accept' (if needed)
1258
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1259
+
1260
+ # form parameters
1261
+ form_params = opts[:form_params] || {}
1262
+
1263
+ # http body (model)
1264
+ post_body = opts[:debug_body]
1265
+
1266
+ # return_type
1267
+ return_type = opts[:debug_return_type] || 'ConversationLocationsResponse'
1268
+
1269
+ # auth_names
1270
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
1271
+
1272
+ new_options = opts.merge(
1273
+ :operation => :"ConversationApi.get_locations_for_engagement",
1274
+ :header_params => header_params,
1275
+ :query_params => query_params,
1276
+ :form_params => form_params,
1277
+ :body => post_body,
1278
+ :auth_names => auth_names,
1279
+ :return_type => return_type
1280
+ )
1281
+
1282
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1283
+ if @api_client.config.debugging
1284
+ @api_client.config.logger.debug "API called: ConversationApi#get_locations_for_engagement\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1285
+ end
1286
+ return data, status_code, headers
1287
+ end
1288
+
1231
1289
  # Insert a canned message
1232
1290
  # Insert a canned message
1233
1291
  # @param canned_message [ConversationCannedMessage] Canned message
@@ -0,0 +1,239 @@
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 ConversationLocationCountry
18
+ attr_accessor :iso2
19
+
20
+ attr_accessor :name
21
+
22
+ attr_accessor :state_provinces
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'iso2' => :'iso2',
28
+ :'name' => :'name',
29
+ :'state_provinces' => :'state_provinces'
30
+ }
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'iso2' => :'String',
42
+ :'name' => :'String',
43
+ :'state_provinces' => :'Array<ConversationLocationStateProvince>'
44
+ }
45
+ end
46
+
47
+ # List of attributes with nullable: true
48
+ def self.openapi_nullable
49
+ Set.new([
50
+ ])
51
+ end
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ def initialize(attributes = {})
56
+ if (!attributes.is_a?(Hash))
57
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationLocationCountry` initialize method"
58
+ end
59
+
60
+ # check to see if the attribute exists and convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!self.class.attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationLocationCountry`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'iso2')
69
+ self.iso2 = attributes[:'iso2']
70
+ end
71
+
72
+ if attributes.key?(:'name')
73
+ self.name = attributes[:'name']
74
+ end
75
+
76
+ if attributes.key?(:'state_provinces')
77
+ if (value = attributes[:'state_provinces']).is_a?(Array)
78
+ self.state_provinces = value
79
+ end
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ invalid_properties = Array.new
87
+ invalid_properties
88
+ end
89
+
90
+ # Check to see if the all the properties in the model are valid
91
+ # @return true if the model is valid
92
+ def valid?
93
+ true
94
+ end
95
+
96
+ # Checks equality by comparing each attribute.
97
+ # @param [Object] Object to be compared
98
+ def ==(o)
99
+ return true if self.equal?(o)
100
+ self.class == o.class &&
101
+ iso2 == o.iso2 &&
102
+ name == o.name &&
103
+ state_provinces == o.state_provinces
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(o)
109
+ self == o
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Integer] Hash code
114
+ def hash
115
+ [iso2, name, state_provinces].hash
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def self.build_from_hash(attributes)
122
+ new.build_from_hash(attributes)
123
+ end
124
+
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def build_from_hash(attributes)
129
+ return nil unless attributes.is_a?(Hash)
130
+ attributes = attributes.transform_keys(&:to_sym)
131
+ self.class.openapi_types.each_pair do |key, type|
132
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
133
+ self.send("#{key}=", nil)
134
+ elsif type =~ /\AArray<(.*)>/i
135
+ # check to ensure the input is an array given that the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
138
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
139
+ end
140
+ elsif !attributes[self.class.attribute_map[key]].nil?
141
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
142
+ end
143
+ end
144
+
145
+ self
146
+ end
147
+
148
+ # Deserializes the data based on type
149
+ # @param string type Data type
150
+ # @param string value Value to be deserialized
151
+ # @return [Object] Deserialized data
152
+ def _deserialize(type, value)
153
+ case type.to_sym
154
+ when :Time
155
+ Time.parse(value)
156
+ when :Date
157
+ Date.parse(value)
158
+ when :String
159
+ value.to_s
160
+ when :Integer
161
+ value.to_i
162
+ when :Float
163
+ value.to_f
164
+ when :Boolean
165
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
166
+ true
167
+ else
168
+ false
169
+ end
170
+ when :Object
171
+ # generic object (usually a Hash), return directly
172
+ value
173
+ when /\AArray<(?<inner_type>.+)>\z/
174
+ inner_type = Regexp.last_match[:inner_type]
175
+ value.map { |v| _deserialize(inner_type, v) }
176
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
177
+ k_type = Regexp.last_match[:k_type]
178
+ v_type = Regexp.last_match[:v_type]
179
+ {}.tap do |hash|
180
+ value.each do |k, v|
181
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
182
+ end
183
+ end
184
+ else # model
185
+ # models (e.g. Pet) or oneOf
186
+ klass = UltracartClient.const_get(type)
187
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
188
+ end
189
+ end
190
+
191
+ # Returns the string representation of the object
192
+ # @return [String] String presentation of the object
193
+ def to_s
194
+ to_hash.to_s
195
+ end
196
+
197
+ # to_body is an alias to to_hash (backward compatibility)
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_body
200
+ to_hash
201
+ end
202
+
203
+ # Returns the object in the form of hash
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_hash
206
+ hash = {}
207
+ self.class.attribute_map.each_pair do |attr, param|
208
+ value = self.send(attr)
209
+ if value.nil?
210
+ is_nullable = self.class.openapi_nullable.include?(attr)
211
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
212
+ end
213
+
214
+ hash[param] = _to_hash(value)
215
+ end
216
+ hash
217
+ end
218
+
219
+ # Outputs non-array value in the form of hash
220
+ # For object, use to_hash. Otherwise, just return the value
221
+ # @param [Object] value Any valid value
222
+ # @return [Hash] Returns the value in the form of hash
223
+ def _to_hash(value)
224
+ if value.is_a?(Array)
225
+ value.compact.map { |v| _to_hash(v) }
226
+ elsif value.is_a?(Hash)
227
+ {}.tap do |hash|
228
+ value.each { |k, v| hash[k] = _to_hash(v) }
229
+ end
230
+ elsif value.respond_to? :to_hash
231
+ value.to_hash
232
+ else
233
+ value
234
+ end
235
+ end
236
+
237
+ end
238
+
239
+ end
@@ -0,0 +1,228 @@
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 ConversationLocationStateProvince
18
+ attr_accessor :abbreviation
19
+
20
+ attr_accessor :name
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'abbreviation' => :'abbreviation',
26
+ :'name' => :'name'
27
+ }
28
+ end
29
+
30
+ # Returns all the JSON keys this model knows about
31
+ def self.acceptable_attributes
32
+ attribute_map.values
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :'abbreviation' => :'String',
39
+ :'name' => :'String'
40
+ }
41
+ end
42
+
43
+ # List of attributes with nullable: true
44
+ def self.openapi_nullable
45
+ Set.new([
46
+ ])
47
+ end
48
+
49
+ # Initializes the object
50
+ # @param [Hash] attributes Model attributes in the form of hash
51
+ def initialize(attributes = {})
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationLocationStateProvince` initialize method"
54
+ end
55
+
56
+ # check to see if the attribute exists and convert string to symbol for hash key
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationLocationStateProvince`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
61
+ h[k.to_sym] = v
62
+ }
63
+
64
+ if attributes.key?(:'abbreviation')
65
+ self.abbreviation = attributes[:'abbreviation']
66
+ end
67
+
68
+ if attributes.key?(:'name')
69
+ self.name = attributes[:'name']
70
+ end
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ invalid_properties = Array.new
77
+ invalid_properties
78
+ end
79
+
80
+ # Check to see if the all the properties in the model are valid
81
+ # @return true if the model is valid
82
+ def valid?
83
+ true
84
+ end
85
+
86
+ # Checks equality by comparing each attribute.
87
+ # @param [Object] Object to be compared
88
+ def ==(o)
89
+ return true if self.equal?(o)
90
+ self.class == o.class &&
91
+ abbreviation == o.abbreviation &&
92
+ name == o.name
93
+ end
94
+
95
+ # @see the `==` method
96
+ # @param [Object] Object to be compared
97
+ def eql?(o)
98
+ self == o
99
+ end
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Integer] Hash code
103
+ def hash
104
+ [abbreviation, name].hash
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 self.build_from_hash(attributes)
111
+ new.build_from_hash(attributes)
112
+ end
113
+
114
+ # Builds the object from hash
115
+ # @param [Hash] attributes Model attributes in the form of hash
116
+ # @return [Object] Returns the model itself
117
+ def build_from_hash(attributes)
118
+ return nil unless attributes.is_a?(Hash)
119
+ attributes = attributes.transform_keys(&:to_sym)
120
+ self.class.openapi_types.each_pair do |key, type|
121
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
122
+ self.send("#{key}=", nil)
123
+ elsif type =~ /\AArray<(.*)>/i
124
+ # check to ensure the input is an array given that the attribute
125
+ # is documented as an array but the input is not
126
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
127
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
128
+ end
129
+ elsif !attributes[self.class.attribute_map[key]].nil?
130
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
131
+ end
132
+ end
133
+
134
+ self
135
+ end
136
+
137
+ # Deserializes the data based on type
138
+ # @param string type Data type
139
+ # @param string value Value to be deserialized
140
+ # @return [Object] Deserialized data
141
+ def _deserialize(type, value)
142
+ case type.to_sym
143
+ when :Time
144
+ Time.parse(value)
145
+ when :Date
146
+ Date.parse(value)
147
+ when :String
148
+ value.to_s
149
+ when :Integer
150
+ value.to_i
151
+ when :Float
152
+ value.to_f
153
+ when :Boolean
154
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
155
+ true
156
+ else
157
+ false
158
+ end
159
+ when :Object
160
+ # generic object (usually a Hash), return directly
161
+ value
162
+ when /\AArray<(?<inner_type>.+)>\z/
163
+ inner_type = Regexp.last_match[:inner_type]
164
+ value.map { |v| _deserialize(inner_type, v) }
165
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
166
+ k_type = Regexp.last_match[:k_type]
167
+ v_type = Regexp.last_match[:v_type]
168
+ {}.tap do |hash|
169
+ value.each do |k, v|
170
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
171
+ end
172
+ end
173
+ else # model
174
+ # models (e.g. Pet) or oneOf
175
+ klass = UltracartClient.const_get(type)
176
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
177
+ end
178
+ end
179
+
180
+ # Returns the string representation of the object
181
+ # @return [String] String presentation of the object
182
+ def to_s
183
+ to_hash.to_s
184
+ end
185
+
186
+ # to_body is an alias to to_hash (backward compatibility)
187
+ # @return [Hash] Returns the object in the form of hash
188
+ def to_body
189
+ to_hash
190
+ end
191
+
192
+ # Returns the object in the form of hash
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_hash
195
+ hash = {}
196
+ self.class.attribute_map.each_pair do |attr, param|
197
+ value = self.send(attr)
198
+ if value.nil?
199
+ is_nullable = self.class.openapi_nullable.include?(attr)
200
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
201
+ end
202
+
203
+ hash[param] = _to_hash(value)
204
+ end
205
+ hash
206
+ end
207
+
208
+ # Outputs non-array value in the form of hash
209
+ # For object, use to_hash. Otherwise, just return the value
210
+ # @param [Object] value Any valid value
211
+ # @return [Hash] Returns the value in the form of hash
212
+ def _to_hash(value)
213
+ if value.is_a?(Array)
214
+ value.compact.map { |v| _to_hash(v) }
215
+ elsif value.is_a?(Hash)
216
+ {}.tap do |hash|
217
+ value.each { |k, v| hash[k] = _to_hash(v) }
218
+ end
219
+ elsif value.respond_to? :to_hash
220
+ value.to_hash
221
+ else
222
+ value
223
+ end
224
+ end
225
+
226
+ end
227
+
228
+ end
@@ -0,0 +1,258 @@
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 ConversationLocationsResponse
18
+ attr_accessor :countries
19
+
20
+ attr_accessor :error
21
+
22
+ attr_accessor :metadata
23
+
24
+ # Indicates if API call was successful
25
+ attr_accessor :success
26
+
27
+ attr_accessor :warning
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'countries' => :'countries',
33
+ :'error' => :'error',
34
+ :'metadata' => :'metadata',
35
+ :'success' => :'success',
36
+ :'warning' => :'warning'
37
+ }
38
+ end
39
+
40
+ # Returns all the JSON keys this model knows about
41
+ def self.acceptable_attributes
42
+ attribute_map.values
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.openapi_types
47
+ {
48
+ :'countries' => :'Array<ConversationLocationCountry>',
49
+ :'error' => :'Error',
50
+ :'metadata' => :'ResponseMetadata',
51
+ :'success' => :'Boolean',
52
+ :'warning' => :'Warning'
53
+ }
54
+ end
55
+
56
+ # List of attributes with nullable: true
57
+ def self.openapi_nullable
58
+ Set.new([
59
+ ])
60
+ end
61
+
62
+ # Initializes the object
63
+ # @param [Hash] attributes Model attributes in the form of hash
64
+ def initialize(attributes = {})
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationLocationsResponse` initialize method"
67
+ end
68
+
69
+ # check to see if the attribute exists and convert string to symbol for hash key
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!self.class.attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationLocationsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'countries')
78
+ if (value = attributes[:'countries']).is_a?(Array)
79
+ self.countries = value
80
+ end
81
+ end
82
+
83
+ if attributes.key?(:'error')
84
+ self.error = attributes[:'error']
85
+ end
86
+
87
+ if attributes.key?(:'metadata')
88
+ self.metadata = attributes[:'metadata']
89
+ end
90
+
91
+ if attributes.key?(:'success')
92
+ self.success = attributes[:'success']
93
+ end
94
+
95
+ if attributes.key?(:'warning')
96
+ self.warning = attributes[:'warning']
97
+ end
98
+ end
99
+
100
+ # Show invalid properties with the reasons. Usually used together with valid?
101
+ # @return Array for valid properties with the reasons
102
+ def list_invalid_properties
103
+ invalid_properties = Array.new
104
+ invalid_properties
105
+ end
106
+
107
+ # Check to see if the all the properties in the model are valid
108
+ # @return true if the model is valid
109
+ def valid?
110
+ true
111
+ end
112
+
113
+ # Checks equality by comparing each attribute.
114
+ # @param [Object] Object to be compared
115
+ def ==(o)
116
+ return true if self.equal?(o)
117
+ self.class == o.class &&
118
+ countries == o.countries &&
119
+ error == o.error &&
120
+ metadata == o.metadata &&
121
+ success == o.success &&
122
+ warning == o.warning
123
+ end
124
+
125
+ # @see the `==` method
126
+ # @param [Object] Object to be compared
127
+ def eql?(o)
128
+ self == o
129
+ end
130
+
131
+ # Calculates hash code according to all attributes.
132
+ # @return [Integer] Hash code
133
+ def hash
134
+ [countries, error, metadata, success, warning].hash
135
+ end
136
+
137
+ # Builds the object from hash
138
+ # @param [Hash] attributes Model attributes in the form of hash
139
+ # @return [Object] Returns the model itself
140
+ def self.build_from_hash(attributes)
141
+ new.build_from_hash(attributes)
142
+ end
143
+
144
+ # Builds the object from hash
145
+ # @param [Hash] attributes Model attributes in the form of hash
146
+ # @return [Object] Returns the model itself
147
+ def build_from_hash(attributes)
148
+ return nil unless attributes.is_a?(Hash)
149
+ attributes = attributes.transform_keys(&:to_sym)
150
+ self.class.openapi_types.each_pair do |key, type|
151
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
152
+ self.send("#{key}=", nil)
153
+ elsif type =~ /\AArray<(.*)>/i
154
+ # check to ensure the input is an array given that the attribute
155
+ # is documented as an array but the input is not
156
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
157
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
158
+ end
159
+ elsif !attributes[self.class.attribute_map[key]].nil?
160
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
161
+ end
162
+ end
163
+
164
+ self
165
+ end
166
+
167
+ # Deserializes the data based on type
168
+ # @param string type Data type
169
+ # @param string value Value to be deserialized
170
+ # @return [Object] Deserialized data
171
+ def _deserialize(type, value)
172
+ case type.to_sym
173
+ when :Time
174
+ Time.parse(value)
175
+ when :Date
176
+ Date.parse(value)
177
+ when :String
178
+ value.to_s
179
+ when :Integer
180
+ value.to_i
181
+ when :Float
182
+ value.to_f
183
+ when :Boolean
184
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
185
+ true
186
+ else
187
+ false
188
+ end
189
+ when :Object
190
+ # generic object (usually a Hash), return directly
191
+ value
192
+ when /\AArray<(?<inner_type>.+)>\z/
193
+ inner_type = Regexp.last_match[:inner_type]
194
+ value.map { |v| _deserialize(inner_type, v) }
195
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
196
+ k_type = Regexp.last_match[:k_type]
197
+ v_type = Regexp.last_match[:v_type]
198
+ {}.tap do |hash|
199
+ value.each do |k, v|
200
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
201
+ end
202
+ end
203
+ else # model
204
+ # models (e.g. Pet) or oneOf
205
+ klass = UltracartClient.const_get(type)
206
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
207
+ end
208
+ end
209
+
210
+ # Returns the string representation of the object
211
+ # @return [String] String presentation of the object
212
+ def to_s
213
+ to_hash.to_s
214
+ end
215
+
216
+ # to_body is an alias to to_hash (backward compatibility)
217
+ # @return [Hash] Returns the object in the form of hash
218
+ def to_body
219
+ to_hash
220
+ end
221
+
222
+ # Returns the object in the form of hash
223
+ # @return [Hash] Returns the object in the form of hash
224
+ def to_hash
225
+ hash = {}
226
+ self.class.attribute_map.each_pair do |attr, param|
227
+ value = self.send(attr)
228
+ if value.nil?
229
+ is_nullable = self.class.openapi_nullable.include?(attr)
230
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
231
+ end
232
+
233
+ hash[param] = _to_hash(value)
234
+ end
235
+ hash
236
+ end
237
+
238
+ # Outputs non-array value in the form of hash
239
+ # For object, use to_hash. Otherwise, just return the value
240
+ # @param [Object] value Any valid value
241
+ # @return [Hash] Returns the value in the form of hash
242
+ def _to_hash(value)
243
+ if value.is_a?(Array)
244
+ value.compact.map { |v| _to_hash(v) }
245
+ elsif value.is_a?(Hash)
246
+ {}.tap do |hash|
247
+ value.each { |k, v| hash[k] = _to_hash(v) }
248
+ end
249
+ elsif value.respond_to? :to_hash
250
+ value.to_hash
251
+ else
252
+ value
253
+ end
254
+ end
255
+
256
+ end
257
+
258
+ 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.126.rc'
14
+ VERSION = '4.0.127'
15
15
  end
data/lib/ultracart_api.rb CHANGED
@@ -169,6 +169,9 @@ require 'ultracart_api/models/conversation_event_read_message'
169
169
  require 'ultracart_api/models/conversation_event_typing'
170
170
  require 'ultracart_api/models/conversation_event_webchat_context'
171
171
  require 'ultracart_api/models/conversation_join_request'
172
+ require 'ultracart_api/models/conversation_location_country'
173
+ require 'ultracart_api/models/conversation_location_state_province'
174
+ require 'ultracart_api/models/conversation_locations_response'
172
175
  require 'ultracart_api/models/conversation_message'
173
176
  require 'ultracart_api/models/conversation_message_translation'
174
177
  require 'ultracart_api/models/conversation_message_transport_status'
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.126.rc
4
+ version: 4.0.127
5
5
  platform: ruby
6
6
  authors:
7
7
  - UltraCart
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-26 00:00:00.000000000 Z
11
+ date: 2023-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -219,6 +219,9 @@ files:
219
219
  - docs/ConversationEventTyping.md
220
220
  - docs/ConversationEventWebchatContext.md
221
221
  - docs/ConversationJoinRequest.md
222
+ - docs/ConversationLocationCountry.md
223
+ - docs/ConversationLocationStateProvince.md
224
+ - docs/ConversationLocationsResponse.md
222
225
  - docs/ConversationMessage.md
223
226
  - docs/ConversationMessageTranslation.md
224
227
  - docs/ConversationMessageTransportStatus.md
@@ -988,6 +991,9 @@ files:
988
991
  - lib/ultracart_api/models/conversation_event_typing.rb
989
992
  - lib/ultracart_api/models/conversation_event_webchat_context.rb
990
993
  - lib/ultracart_api/models/conversation_join_request.rb
994
+ - lib/ultracart_api/models/conversation_location_country.rb
995
+ - lib/ultracart_api/models/conversation_location_state_province.rb
996
+ - lib/ultracart_api/models/conversation_locations_response.rb
991
997
  - lib/ultracart_api/models/conversation_message.rb
992
998
  - lib/ultracart_api/models/conversation_message_translation.rb
993
999
  - lib/ultracart_api/models/conversation_message_transport_status.rb
@@ -1588,9 +1594,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
1588
1594
  version: '2.4'
1589
1595
  required_rubygems_version: !ruby/object:Gem::Requirement
1590
1596
  requirements:
1591
- - - ">"
1597
+ - - ">="
1592
1598
  - !ruby/object:Gem::Version
1593
- version: 1.3.1
1599
+ version: '0'
1594
1600
  requirements: []
1595
1601
  rubygems_version: 3.2.3
1596
1602
  signing_key: