ultracart_api 3.10.109 → 3.10.110

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f8b4957f645caf0c8bad81ec2718d9f480e7baff1e3eed81db3978fe3f2e3306
4
- data.tar.gz: 38780489a14189db37c7bd059eeec072d6d569cd05bc67dcd0dda2ae947a4177
3
+ metadata.gz: 5db5747b55451d230c39fbaf8d39e27ae438f6de418dee65fbd289199cc45df5
4
+ data.tar.gz: 0f905b2afdbdd8c4e1018e6597726381c00e4d3a0ec409523d1b404562717bf1
5
5
  SHA512:
6
- metadata.gz: a4431dbb3399e915a0e175652024a8b2895775ca125e2d0467e0ceb0efeca9f775711a91b22789829dc97ea47175e9dacdba5ae997d0c0d593fa73927665ea4e
7
- data.tar.gz: 74ccc6e942f363a910bd1eefd040f8a730e540677c1d8d8810dac8cf94af0d056f8ea347bca6fa94d3173a5d0d9780a57437fa9c3460c7754a4d559f02167303
6
+ metadata.gz: 84fef32a36c7344e961f359ce2b9db75b1d08bb068c777cb5bb52fd635d7f89f0f4a31c0158661ea8667e15c93f194480200db15829c384212a7c1df43d196a2
7
+ data.tar.gz: 050d75c0cd10fc190f45656df35cda65280c7598caa90e28f3d1ee5ea64183b07e5dff7edf697e48d4d970330c1014bade3fba72bdecadf580f289b4890ac29e
data/README.md CHANGED
@@ -7,7 +7,7 @@ UltraCart REST API Version 2
7
7
  This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
8
8
 
9
9
  - API version: 2.0.0
10
- - Package version: 3.10.109
10
+ - Package version: 3.10.110
11
11
  - Build package: io.swagger.codegen.languages.RubyClientCodegen
12
12
  For more information, please visit [http://www.ultracart.com](http://www.ultracart.com)
13
13
 
@@ -24,15 +24,15 @@ gem build ultracart_api.gemspec
24
24
  Then either install the gem locally:
25
25
 
26
26
  ```shell
27
- gem install ./ultracart_api-3.10.109.gem
27
+ gem install ./ultracart_api-3.10.110.gem
28
28
  ```
29
- (for development, run `gem install --dev ./ultracart_api-3.10.109.gem` to install the development dependencies)
29
+ (for development, run `gem install --dev ./ultracart_api-3.10.110.gem` to install the development dependencies)
30
30
 
31
31
  or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
32
32
 
33
33
  Finally add this to the Gemfile:
34
34
 
35
- gem 'ultracart_api', '~> 3.10.109'
35
+ gem 'ultracart_api', '~> 3.10.110'
36
36
 
37
37
  ### Install from Git
38
38
 
@@ -150,6 +150,7 @@ Class | Method | HTTP request | Description
150
150
  *UltracartClient::ConversationApi* | [**get_conversations**](docs/ConversationApi.md#get_conversations) | **GET** /conversation/conversations | Retrieve a list of conversation summaries newest to oldest
151
151
  *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
152
152
  *UltracartClient::ConversationApi* | [**get_conversations_search**](docs/ConversationApi.md#get_conversations_search) | **POST** /conversation/conversations/search | Search conversations
153
+ *UltracartClient::ConversationApi* | [**get_locations_for_engagement**](docs/ConversationApi.md#get_locations_for_engagement) | **POST** /conversation/locations | Get location data for engagement configuration
153
154
  *UltracartClient::ConversationApi* | [**insert_conversation_canned_message**](docs/ConversationApi.md#insert_conversation_canned_message) | **POST** /conversation/canned_messages | Insert a canned message
154
155
  *UltracartClient::ConversationApi* | [**insert_conversation_department**](docs/ConversationApi.md#insert_conversation_department) | **POST** /conversation/departments | Insert a department
155
156
  *UltracartClient::ConversationApi* | [**insert_conversation_engagement**](docs/ConversationApi.md#insert_conversation_engagement) | **POST** /conversation/engagements | Insert a engagement
@@ -642,6 +643,9 @@ Class | Method | HTTP request | Description
642
643
  - [UltracartClient::ConversationEventTyping](docs/ConversationEventTyping.md)
643
644
  - [UltracartClient::ConversationEventWebchatContext](docs/ConversationEventWebchatContext.md)
644
645
  - [UltracartClient::ConversationJoinRequest](docs/ConversationJoinRequest.md)
646
+ - [UltracartClient::ConversationLocationCountry](docs/ConversationLocationCountry.md)
647
+ - [UltracartClient::ConversationLocationStateProvince](docs/ConversationLocationStateProvince.md)
648
+ - [UltracartClient::ConversationLocationsResponse](docs/ConversationLocationsResponse.md)
645
649
  - [UltracartClient::ConversationMessage](docs/ConversationMessage.md)
646
650
  - [UltracartClient::ConversationMessageTranslation](docs/ConversationMessageTranslation.md)
647
651
  - [UltracartClient::ConversationMessageTransportStatus](docs/ConversationMessageTransportStatus.md)
@@ -1292,6 +1296,7 @@ Not every change is committed to every SDK.
1292
1296
 
1293
1297
  | Version | Date | Comments |
1294
1298
  | --: | :-: | --- |
1299
+ | 3.10.110 | 01/27/2023 | conversations - getLocationsForEngagement method |
1295
1300
  | 3.10.109 | 01/26/2023 | typo in ConversationWebsocketMessage |
1296
1301
  | 3.10.108 | 01/25/2023 | conversation - added message type of engagement prompt |
1297
1302
  | 3.10.107 | 01/25/2023 | convo event for engage customer |
@@ -23,6 +23,7 @@ Method | HTTP request | Description
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
@@ -961,6 +962,51 @@ Name | Type | Description | Notes
961
962
 
962
963
 
963
964
 
965
+ # **get_locations_for_engagement**
966
+ > ConversationLocationsResponse get_locations_for_engagement
967
+
968
+ Get location data for engagement configuration
969
+
970
+ Get location data for engagement configuration
971
+
972
+ ### Example
973
+ ```ruby
974
+ # load the gem
975
+ require 'ultracart_api'
976
+
977
+ # Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
978
+ simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00'
979
+ api_instance = UltracartClient::ConversationApi.new_using_api_key(simple_key, false, false)
980
+
981
+
982
+
983
+ begin
984
+ #Get location data for engagement configuration
985
+ result = api_instance.get_locations_for_engagement
986
+ p result
987
+ rescue UltracartClient::ApiError => e
988
+ puts "Exception when calling ConversationApi->get_locations_for_engagement: #{e}"
989
+ end
990
+ ```
991
+
992
+ ### Parameters
993
+ This endpoint does not need any parameter.
994
+
995
+ ### Return type
996
+
997
+ [**ConversationLocationsResponse**](ConversationLocationsResponse.md)
998
+
999
+ ### Authorization
1000
+
1001
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
1002
+
1003
+ ### HTTP request headers
1004
+
1005
+ - **Content-Type**: application/json
1006
+ - **Accept**: application/json
1007
+
1008
+
1009
+
964
1010
  # **insert_conversation_canned_message**
965
1011
  > ConversationCannedMessageResponse insert_conversation_canned_message(canned_message)
966
1012
 
@@ -0,0 +1,10 @@
1
+ # UltracartClient::ConversationLocationCountry
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **iso2** | **String** | | [optional]
7
+ **name** | **String** | | [optional]
8
+ **state_provinces** | [**Array<ConversationLocationStateProvince>**](ConversationLocationStateProvince.md) | | [optional]
9
+
10
+
@@ -0,0 +1,9 @@
1
+ # UltracartClient::ConversationLocationStateProvince
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **abbreviation** | **String** | | [optional]
7
+ **name** | **String** | | [optional]
8
+
9
+
@@ -0,0 +1,12 @@
1
+ # UltracartClient::ConversationLocationsResponse
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **countries** | [**Array<ConversationLocationCountry>**](ConversationLocationCountry.md) | | [optional]
7
+ **error** | [**Error**](Error.md) | | [optional]
8
+ **metadata** | [**ResponseMetadata**](ResponseMetadata.md) | | [optional]
9
+ **success** | **BOOLEAN** | Indicates if API call was successful | [optional]
10
+ **warning** | [**Warning**](Warning.md) | | [optional]
11
+
12
+
@@ -1043,6 +1043,55 @@ module UltracartClient
1043
1043
  end
1044
1044
  return data, status_code, headers
1045
1045
  end
1046
+ # Get location data for engagement configuration
1047
+ # Get location data for engagement configuration
1048
+ # @param [Hash] opts the optional parameters
1049
+ # @return [ConversationLocationsResponse]
1050
+ def get_locations_for_engagement(opts = {})
1051
+ data, _status_code, _headers = get_locations_for_engagement_with_http_info(opts)
1052
+ data
1053
+ end
1054
+
1055
+ # Get location data for engagement configuration
1056
+ # Get location data for engagement configuration
1057
+ # @param [Hash] opts the optional parameters
1058
+ # @return [Array<(ConversationLocationsResponse, Fixnum, Hash)>] ConversationLocationsResponse data, response status code and response headers
1059
+ def get_locations_for_engagement_with_http_info(opts = {})
1060
+ if @api_client.config.debugging
1061
+ @api_client.config.logger.debug 'Calling API: ConversationApi.get_locations_for_engagement ...'
1062
+ end
1063
+ # resource path
1064
+ local_var_path = '/conversation/locations'
1065
+
1066
+ # query parameters
1067
+ query_params = {}
1068
+
1069
+ # header parameters
1070
+ header_params = {}
1071
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
1072
+ # HTTP header 'Accept' (if needed)
1073
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1074
+ # HTTP header 'Content-Type'
1075
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1076
+
1077
+ # form parameters
1078
+ form_params = {}
1079
+
1080
+ # http body (model)
1081
+ post_body = nil
1082
+ auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
1083
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
1084
+ :header_params => header_params,
1085
+ :query_params => query_params,
1086
+ :form_params => form_params,
1087
+ :body => post_body,
1088
+ :auth_names => auth_names,
1089
+ :return_type => 'ConversationLocationsResponse')
1090
+ if @api_client.config.debugging
1091
+ @api_client.config.logger.debug "API called: ConversationApi#get_locations_for_engagement\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1092
+ end
1093
+ return data, status_code, headers
1094
+ end
1046
1095
  # Insert a canned message
1047
1096
  # Insert a canned message
1048
1097
  # @param canned_message Canned message
@@ -0,0 +1,204 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.15-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module UltracartClient
16
+ class ConversationLocationCountry
17
+ attr_accessor :iso2
18
+
19
+ attr_accessor :name
20
+
21
+ attr_accessor :state_provinces
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'iso2' => :'iso2',
27
+ :'name' => :'name',
28
+ :'state_provinces' => :'state_provinces'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.swagger_types
34
+ {
35
+ :'iso2' => :'String',
36
+ :'name' => :'String',
37
+ :'state_provinces' => :'Array<ConversationLocationStateProvince>'
38
+ }
39
+ end
40
+
41
+ # Initializes the object
42
+ # @param [Hash] attributes Model attributes in the form of hash
43
+ def initialize(attributes = {})
44
+ return unless attributes.is_a?(Hash)
45
+
46
+ # convert string to symbol for hash key
47
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
48
+
49
+ if attributes.has_key?(:'iso2')
50
+ self.iso2 = attributes[:'iso2']
51
+ end
52
+
53
+ if attributes.has_key?(:'name')
54
+ self.name = attributes[:'name']
55
+ end
56
+
57
+ if attributes.has_key?(:'state_provinces')
58
+ if (value = attributes[:'state_provinces']).is_a?(Array)
59
+ self.state_provinces = value
60
+ end
61
+ end
62
+ end
63
+
64
+ # Show invalid properties with the reasons. Usually used together with valid?
65
+ # @return Array for valid properties with the reasons
66
+ def list_invalid_properties
67
+ invalid_properties = Array.new
68
+ invalid_properties
69
+ end
70
+
71
+ # Check to see if the all the properties in the model are valid
72
+ # @return true if the model is valid
73
+ def valid?
74
+ true
75
+ end
76
+
77
+ # Checks equality by comparing each attribute.
78
+ # @param [Object] Object to be compared
79
+ def ==(o)
80
+ return true if self.equal?(o)
81
+ self.class == o.class &&
82
+ iso2 == o.iso2 &&
83
+ name == o.name &&
84
+ state_provinces == o.state_provinces
85
+ end
86
+
87
+ # @see the `==` method
88
+ # @param [Object] Object to be compared
89
+ def eql?(o)
90
+ self == o
91
+ end
92
+
93
+ # Calculates hash code according to all attributes.
94
+ # @return [Fixnum] Hash code
95
+ def hash
96
+ [iso2, name, state_provinces].hash
97
+ end
98
+
99
+ # Builds the object from hash
100
+ # @param [Hash] attributes Model attributes in the form of hash
101
+ # @return [Object] Returns the model itself
102
+ def build_from_hash(attributes)
103
+ return nil unless attributes.is_a?(Hash)
104
+ self.class.swagger_types.each_pair do |key, type|
105
+ if type =~ /\AArray<(.*)>/i
106
+ # check to ensure the input is an array given that the attribute
107
+ # is documented as an array but the input is not
108
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
109
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
110
+ end
111
+ elsif !attributes[self.class.attribute_map[key]].nil?
112
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
113
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
114
+ end
115
+
116
+ self
117
+ end
118
+
119
+ # Deserializes the data based on type
120
+ # @param string type Data type
121
+ # @param string value Value to be deserialized
122
+ # @return [Object] Deserialized data
123
+ def _deserialize(type, value)
124
+ case type.to_sym
125
+ when :DateTime
126
+ DateTime.parse(value)
127
+ when :Date
128
+ Date.parse(value)
129
+ when :String
130
+ value.to_s
131
+ when :Integer
132
+ value.to_i
133
+ when :Float
134
+ value.to_f
135
+ when :BOOLEAN
136
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
137
+ true
138
+ else
139
+ false
140
+ end
141
+ when :Object
142
+ # generic object (usually a Hash), return directly
143
+ value
144
+ when /\AArray<(?<inner_type>.+)>\z/
145
+ inner_type = Regexp.last_match[:inner_type]
146
+ value.map { |v| _deserialize(inner_type, v) }
147
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
148
+ k_type = Regexp.last_match[:k_type]
149
+ v_type = Regexp.last_match[:v_type]
150
+ {}.tap do |hash|
151
+ value.each do |k, v|
152
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
153
+ end
154
+ end
155
+ else # model
156
+ temp_model = UltracartClient.const_get(type).new
157
+ temp_model.build_from_hash(value)
158
+ end
159
+ end
160
+
161
+ # Returns the string representation of the object
162
+ # @return [String] String presentation of the object
163
+ def to_s
164
+ to_hash.to_s
165
+ end
166
+
167
+ # to_body is an alias to to_hash (backward compatibility)
168
+ # @return [Hash] Returns the object in the form of hash
169
+ def to_body
170
+ to_hash
171
+ end
172
+
173
+ # Returns the object in the form of hash
174
+ # @return [Hash] Returns the object in the form of hash
175
+ def to_hash
176
+ hash = {}
177
+ self.class.attribute_map.each_pair do |attr, param|
178
+ value = self.send(attr)
179
+ next if value.nil?
180
+ hash[param] = _to_hash(value)
181
+ end
182
+ hash
183
+ end
184
+
185
+ # Outputs non-array value in the form of hash
186
+ # For object, use to_hash. Otherwise, just return the value
187
+ # @param [Object] value Any valid value
188
+ # @return [Hash] Returns the value in the form of hash
189
+ def _to_hash(value)
190
+ if value.is_a?(Array)
191
+ value.compact.map { |v| _to_hash(v) }
192
+ elsif value.is_a?(Hash)
193
+ {}.tap do |hash|
194
+ value.each { |k, v| hash[k] = _to_hash(v) }
195
+ end
196
+ elsif value.respond_to? :to_hash
197
+ value.to_hash
198
+ else
199
+ value
200
+ end
201
+ end
202
+
203
+ end
204
+ end
@@ -0,0 +1,193 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.15-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module UltracartClient
16
+ class ConversationLocationStateProvince
17
+ attr_accessor :abbreviation
18
+
19
+ attr_accessor :name
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'abbreviation' => :'abbreviation',
25
+ :'name' => :'name'
26
+ }
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.swagger_types
31
+ {
32
+ :'abbreviation' => :'String',
33
+ :'name' => :'String'
34
+ }
35
+ end
36
+
37
+ # Initializes the object
38
+ # @param [Hash] attributes Model attributes in the form of hash
39
+ def initialize(attributes = {})
40
+ return unless attributes.is_a?(Hash)
41
+
42
+ # convert string to symbol for hash key
43
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
44
+
45
+ if attributes.has_key?(:'abbreviation')
46
+ self.abbreviation = attributes[:'abbreviation']
47
+ end
48
+
49
+ if attributes.has_key?(:'name')
50
+ self.name = attributes[:'name']
51
+ end
52
+ end
53
+
54
+ # Show invalid properties with the reasons. Usually used together with valid?
55
+ # @return Array for valid properties with the reasons
56
+ def list_invalid_properties
57
+ invalid_properties = Array.new
58
+ invalid_properties
59
+ end
60
+
61
+ # Check to see if the all the properties in the model are valid
62
+ # @return true if the model is valid
63
+ def valid?
64
+ true
65
+ end
66
+
67
+ # Checks equality by comparing each attribute.
68
+ # @param [Object] Object to be compared
69
+ def ==(o)
70
+ return true if self.equal?(o)
71
+ self.class == o.class &&
72
+ abbreviation == o.abbreviation &&
73
+ name == o.name
74
+ end
75
+
76
+ # @see the `==` method
77
+ # @param [Object] Object to be compared
78
+ def eql?(o)
79
+ self == o
80
+ end
81
+
82
+ # Calculates hash code according to all attributes.
83
+ # @return [Fixnum] Hash code
84
+ def hash
85
+ [abbreviation, name].hash
86
+ end
87
+
88
+ # Builds the object from hash
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ # @return [Object] Returns the model itself
91
+ def build_from_hash(attributes)
92
+ return nil unless attributes.is_a?(Hash)
93
+ self.class.swagger_types.each_pair do |key, type|
94
+ if type =~ /\AArray<(.*)>/i
95
+ # check to ensure the input is an array given that the attribute
96
+ # is documented as an array but the input is not
97
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
98
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
99
+ end
100
+ elsif !attributes[self.class.attribute_map[key]].nil?
101
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
102
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
103
+ end
104
+
105
+ self
106
+ end
107
+
108
+ # Deserializes the data based on type
109
+ # @param string type Data type
110
+ # @param string value Value to be deserialized
111
+ # @return [Object] Deserialized data
112
+ def _deserialize(type, value)
113
+ case type.to_sym
114
+ when :DateTime
115
+ DateTime.parse(value)
116
+ when :Date
117
+ Date.parse(value)
118
+ when :String
119
+ value.to_s
120
+ when :Integer
121
+ value.to_i
122
+ when :Float
123
+ value.to_f
124
+ when :BOOLEAN
125
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
126
+ true
127
+ else
128
+ false
129
+ end
130
+ when :Object
131
+ # generic object (usually a Hash), return directly
132
+ value
133
+ when /\AArray<(?<inner_type>.+)>\z/
134
+ inner_type = Regexp.last_match[:inner_type]
135
+ value.map { |v| _deserialize(inner_type, v) }
136
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
137
+ k_type = Regexp.last_match[:k_type]
138
+ v_type = Regexp.last_match[:v_type]
139
+ {}.tap do |hash|
140
+ value.each do |k, v|
141
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
142
+ end
143
+ end
144
+ else # model
145
+ temp_model = UltracartClient.const_get(type).new
146
+ temp_model.build_from_hash(value)
147
+ end
148
+ end
149
+
150
+ # Returns the string representation of the object
151
+ # @return [String] String presentation of the object
152
+ def to_s
153
+ to_hash.to_s
154
+ end
155
+
156
+ # to_body is an alias to to_hash (backward compatibility)
157
+ # @return [Hash] Returns the object in the form of hash
158
+ def to_body
159
+ to_hash
160
+ end
161
+
162
+ # Returns the object in the form of hash
163
+ # @return [Hash] Returns the object in the form of hash
164
+ def to_hash
165
+ hash = {}
166
+ self.class.attribute_map.each_pair do |attr, param|
167
+ value = self.send(attr)
168
+ next if value.nil?
169
+ hash[param] = _to_hash(value)
170
+ end
171
+ hash
172
+ end
173
+
174
+ # Outputs non-array value in the form of hash
175
+ # For object, use to_hash. Otherwise, just return the value
176
+ # @param [Object] value Any valid value
177
+ # @return [Hash] Returns the value in the form of hash
178
+ def _to_hash(value)
179
+ if value.is_a?(Array)
180
+ value.compact.map { |v| _to_hash(v) }
181
+ elsif value.is_a?(Hash)
182
+ {}.tap do |hash|
183
+ value.each { |k, v| hash[k] = _to_hash(v) }
184
+ end
185
+ elsif value.respond_to? :to_hash
186
+ value.to_hash
187
+ else
188
+ value
189
+ end
190
+ end
191
+
192
+ end
193
+ end
@@ -0,0 +1,223 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.15-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module UltracartClient
16
+ class ConversationLocationsResponse
17
+ attr_accessor :countries
18
+
19
+ attr_accessor :error
20
+
21
+ attr_accessor :metadata
22
+
23
+ # Indicates if API call was successful
24
+ attr_accessor :success
25
+
26
+ attr_accessor :warning
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'countries' => :'countries',
32
+ :'error' => :'error',
33
+ :'metadata' => :'metadata',
34
+ :'success' => :'success',
35
+ :'warning' => :'warning'
36
+ }
37
+ end
38
+
39
+ # Attribute type mapping.
40
+ def self.swagger_types
41
+ {
42
+ :'countries' => :'Array<ConversationLocationCountry>',
43
+ :'error' => :'Error',
44
+ :'metadata' => :'ResponseMetadata',
45
+ :'success' => :'BOOLEAN',
46
+ :'warning' => :'Warning'
47
+ }
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ return unless attributes.is_a?(Hash)
54
+
55
+ # convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
57
+
58
+ if attributes.has_key?(:'countries')
59
+ if (value = attributes[:'countries']).is_a?(Array)
60
+ self.countries = value
61
+ end
62
+ end
63
+
64
+ if attributes.has_key?(:'error')
65
+ self.error = attributes[:'error']
66
+ end
67
+
68
+ if attributes.has_key?(:'metadata')
69
+ self.metadata = attributes[:'metadata']
70
+ end
71
+
72
+ if attributes.has_key?(:'success')
73
+ self.success = attributes[:'success']
74
+ end
75
+
76
+ if attributes.has_key?(:'warning')
77
+ self.warning = attributes[:'warning']
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ invalid_properties = Array.new
85
+ invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ true
92
+ end
93
+
94
+ # Checks equality by comparing each attribute.
95
+ # @param [Object] Object to be compared
96
+ def ==(o)
97
+ return true if self.equal?(o)
98
+ self.class == o.class &&
99
+ countries == o.countries &&
100
+ error == o.error &&
101
+ metadata == o.metadata &&
102
+ success == o.success &&
103
+ warning == o.warning
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 [Fixnum] Hash code
114
+ def hash
115
+ [countries, error, metadata, success, warning].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 build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ self.class.swagger_types.each_pair do |key, type|
124
+ if type =~ /\AArray<(.*)>/i
125
+ # check to ensure the input is an array given that the attribute
126
+ # is documented as an array but the input is not
127
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
128
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
129
+ end
130
+ elsif !attributes[self.class.attribute_map[key]].nil?
131
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
132
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
133
+ end
134
+
135
+ self
136
+ end
137
+
138
+ # Deserializes the data based on type
139
+ # @param string type Data type
140
+ # @param string value Value to be deserialized
141
+ # @return [Object] Deserialized data
142
+ def _deserialize(type, value)
143
+ case type.to_sym
144
+ when :DateTime
145
+ DateTime.parse(value)
146
+ when :Date
147
+ Date.parse(value)
148
+ when :String
149
+ value.to_s
150
+ when :Integer
151
+ value.to_i
152
+ when :Float
153
+ value.to_f
154
+ when :BOOLEAN
155
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
156
+ true
157
+ else
158
+ false
159
+ end
160
+ when :Object
161
+ # generic object (usually a Hash), return directly
162
+ value
163
+ when /\AArray<(?<inner_type>.+)>\z/
164
+ inner_type = Regexp.last_match[:inner_type]
165
+ value.map { |v| _deserialize(inner_type, v) }
166
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
167
+ k_type = Regexp.last_match[:k_type]
168
+ v_type = Regexp.last_match[:v_type]
169
+ {}.tap do |hash|
170
+ value.each do |k, v|
171
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
172
+ end
173
+ end
174
+ else # model
175
+ temp_model = UltracartClient.const_get(type).new
176
+ temp_model.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
+ next if value.nil?
199
+ hash[param] = _to_hash(value)
200
+ end
201
+ hash
202
+ end
203
+
204
+ # Outputs non-array value in the form of hash
205
+ # For object, use to_hash. Otherwise, just return the value
206
+ # @param [Object] value Any valid value
207
+ # @return [Hash] Returns the value in the form of hash
208
+ def _to_hash(value)
209
+ if value.is_a?(Array)
210
+ value.compact.map { |v| _to_hash(v) }
211
+ elsif value.is_a?(Hash)
212
+ {}.tap do |hash|
213
+ value.each { |k, v| hash[k] = _to_hash(v) }
214
+ end
215
+ elsif value.respond_to? :to_hash
216
+ value.to_hash
217
+ else
218
+ value
219
+ end
220
+ end
221
+
222
+ end
223
+ end
@@ -11,5 +11,5 @@ Swagger Codegen version: 2.4.15-SNAPSHOT
11
11
  =end
12
12
 
13
13
  module UltracartClient
14
- VERSION = '3.10.109'
14
+ VERSION = '3.10.110'
15
15
  end
data/lib/ultracart_api.rb CHANGED
@@ -170,6 +170,9 @@ require 'ultracart_api/models/conversation_event_read_message'
170
170
  require 'ultracart_api/models/conversation_event_typing'
171
171
  require 'ultracart_api/models/conversation_event_webchat_context'
172
172
  require 'ultracart_api/models/conversation_join_request'
173
+ require 'ultracart_api/models/conversation_location_country'
174
+ require 'ultracart_api/models/conversation_location_state_province'
175
+ require 'ultracart_api/models/conversation_locations_response'
173
176
  require 'ultracart_api/models/conversation_message'
174
177
  require 'ultracart_api/models/conversation_message_translation'
175
178
  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: 3.10.109
4
+ version: 3.10.110
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
@@ -380,6 +380,9 @@ files:
380
380
  - docs/ConversationEventTyping.md
381
381
  - docs/ConversationEventWebchatContext.md
382
382
  - docs/ConversationJoinRequest.md
383
+ - docs/ConversationLocationCountry.md
384
+ - docs/ConversationLocationStateProvince.md
385
+ - docs/ConversationLocationsResponse.md
383
386
  - docs/ConversationMessage.md
384
387
  - docs/ConversationMessageTranslation.md
385
388
  - docs/ConversationMessageTransportStatus.md
@@ -1150,6 +1153,9 @@ files:
1150
1153
  - lib/ultracart_api/models/conversation_event_typing.rb
1151
1154
  - lib/ultracart_api/models/conversation_event_webchat_context.rb
1152
1155
  - lib/ultracart_api/models/conversation_join_request.rb
1156
+ - lib/ultracart_api/models/conversation_location_country.rb
1157
+ - lib/ultracart_api/models/conversation_location_state_province.rb
1158
+ - lib/ultracart_api/models/conversation_locations_response.rb
1153
1159
  - lib/ultracart_api/models/conversation_message.rb
1154
1160
  - lib/ultracart_api/models/conversation_message_translation.rb
1155
1161
  - lib/ultracart_api/models/conversation_message_transport_status.rb