ultracart_api 3.10.67 → 3.10.69
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -4
- data/docs/ConversationApi.md +51 -0
- data/docs/ConversationEventAddCoupon.md +2 -0
- data/docs/ConversationEventAddItem.md +3 -1
- data/docs/ConversationEventWebchatContext.md +10 -0
- data/docs/ConversationWebchatContext.md +12 -0
- data/docs/ConversationWebsocketMessage.md +1 -0
- data/docs/HitPageView.md +18 -0
- data/docs/HitPageViewMetaData.md +9 -0
- data/docs/HitSessionStart.md +24 -0
- data/docs/HitSessionUtm.md +22 -0
- data/lib/ultracart_api/api/conversation_api.rb +55 -0
- data/lib/ultracart_api/models/conversation_event_add_coupon.rb +19 -1
- data/lib/ultracart_api/models/conversation_event_add_item.rb +27 -7
- data/lib/ultracart_api/models/conversation_event_webchat_context.rb +202 -0
- data/lib/ultracart_api/models/conversation_webchat_context.rb +222 -0
- data/lib/ultracart_api/models/conversation_websocket_message.rb +12 -3
- data/lib/ultracart_api/models/hit_page_view.rb +276 -0
- data/lib/ultracart_api/models/hit_page_view_meta_data.rb +193 -0
- data/lib/ultracart_api/models/hit_session_start.rb +328 -0
- data/lib/ultracart_api/models/hit_session_utm.rb +310 -0
- data/lib/ultracart_api/models/order_property.rb +5 -5
- data/lib/ultracart_api/models/weight.rb +2 -2
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +6 -0
- metadata +14 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1103c12b7948ddc60c291a1c814afd77b21e766db291075521acc3ec6a424a92
|
4
|
+
data.tar.gz: 5290aa17302e832dcbdf2c711f66b326a65a90c67878b93d597e950bd98b76b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bf2a66e41e019c7ddcb4af1633fd8ccfca0bfad8d1dd4cde816daa1c59ae2215b35a9b6c203524054b0b5d1cfd9365617fcfcf2f9cf158dc751abf7542d3f81
|
7
|
+
data.tar.gz: 6185b32a541b629ac87e3acd94a398ef485aab0e4769dd423a9a0dcea8dea2aec58b73a7857e17dc1a91d7940c324a4059899102a5d62832cbd5d0e53ba74527
|
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.
|
10
|
+
- Package version: 3.10.69
|
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.
|
27
|
+
gem install ./ultracart_api-3.10.69.gem
|
28
28
|
```
|
29
|
-
(for development, run `gem install --dev ./ultracart_api-3.10.
|
29
|
+
(for development, run `gem install --dev ./ultracart_api-3.10.69.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.
|
35
|
+
gem 'ultracart_api', '~> 3.10.69'
|
36
36
|
|
37
37
|
### Install from Git
|
38
38
|
|
@@ -128,6 +128,7 @@ Class | Method | HTTP request | Description
|
|
128
128
|
*UltracartClient::ConversationApi* | [**get_agent_keep_alive**](docs/ConversationApi.md#get_agent_keep_alive) | **GET** /conversation/agent/keepalive | Agent keep alive
|
129
129
|
*UltracartClient::ConversationApi* | [**get_agent_websocket_authorization**](docs/ConversationApi.md#get_agent_websocket_authorization) | **PUT** /conversation/agent/auth | Get agent websocket authorization
|
130
130
|
*UltracartClient::ConversationApi* | [**get_conversation**](docs/ConversationApi.md#get_conversation) | **GET** /conversation/conversations/{conversation_uuid} | Retrieve a conversation
|
131
|
+
*UltracartClient::ConversationApi* | [**get_conversation_context**](docs/ConversationApi.md#get_conversation_context) | **PUT** /conversation/conversations/{conversation_uuid}/context | Get a webchat conversation context
|
131
132
|
*UltracartClient::ConversationApi* | [**get_conversation_messages**](docs/ConversationApi.md#get_conversation_messages) | **GET** /conversation/conversations/{conversation_uuid}/messages/{since} | Retrieve conversation messages
|
132
133
|
*UltracartClient::ConversationApi* | [**get_conversation_multimedia_upload_url**](docs/ConversationApi.md#get_conversation_multimedia_upload_url) | **GET** /conversation/upload_url/{extension} | Get a presigned conersation multimedia upload URL
|
133
134
|
*UltracartClient::ConversationApi* | [**get_conversation_webchat_queue_statuses**](docs/ConversationApi.md#get_conversation_webchat_queue_statuses) | **GET** /conversation/conversations/queues/statuses | Retrieve a conversation webchat queue statuses
|
@@ -588,6 +589,7 @@ Class | Method | HTTP request | Description
|
|
588
589
|
- [UltracartClient::ConversationEventRRWeb](docs/ConversationEventRRWeb.md)
|
589
590
|
- [UltracartClient::ConversationEventReadMessage](docs/ConversationEventReadMessage.md)
|
590
591
|
- [UltracartClient::ConversationEventTyping](docs/ConversationEventTyping.md)
|
592
|
+
- [UltracartClient::ConversationEventWebchatContext](docs/ConversationEventWebchatContext.md)
|
591
593
|
- [UltracartClient::ConversationMessage](docs/ConversationMessage.md)
|
592
594
|
- [UltracartClient::ConversationMessageTransportStatus](docs/ConversationMessageTransportStatus.md)
|
593
595
|
- [UltracartClient::ConversationMessagesResponse](docs/ConversationMessagesResponse.md)
|
@@ -599,6 +601,7 @@ Class | Method | HTTP request | Description
|
|
599
601
|
- [UltracartClient::ConversationStartResponse](docs/ConversationStartResponse.md)
|
600
602
|
- [UltracartClient::ConversationSummary](docs/ConversationSummary.md)
|
601
603
|
- [UltracartClient::ConversationTwilioAccount](docs/ConversationTwilioAccount.md)
|
604
|
+
- [UltracartClient::ConversationWebchatContext](docs/ConversationWebchatContext.md)
|
602
605
|
- [UltracartClient::ConversationWebchatQueueStatus](docs/ConversationWebchatQueueStatus.md)
|
603
606
|
- [UltracartClient::ConversationWebchatQueueStatusAgent](docs/ConversationWebchatQueueStatusAgent.md)
|
604
607
|
- [UltracartClient::ConversationWebchatQueueStatusQueueEntry](docs/ConversationWebchatQueueStatusQueueEntry.md)
|
@@ -851,6 +854,10 @@ Class | Method | HTTP request | Description
|
|
851
854
|
- [UltracartClient::GroupUserMembership](docs/GroupUserMembership.md)
|
852
855
|
- [UltracartClient::GroupsResponse](docs/GroupsResponse.md)
|
853
856
|
- [UltracartClient::HTTPHeader](docs/HTTPHeader.md)
|
857
|
+
- [UltracartClient::HitPageView](docs/HitPageView.md)
|
858
|
+
- [UltracartClient::HitPageViewMetaData](docs/HitPageViewMetaData.md)
|
859
|
+
- [UltracartClient::HitSessionStart](docs/HitSessionStart.md)
|
860
|
+
- [UltracartClient::HitSessionUtm](docs/HitSessionUtm.md)
|
854
861
|
- [UltracartClient::IntegrationLog](docs/IntegrationLog.md)
|
855
862
|
- [UltracartClient::IntegrationLogFile](docs/IntegrationLogFile.md)
|
856
863
|
- [UltracartClient::IntegrationLogLog](docs/IntegrationLogLog.md)
|
@@ -1217,6 +1224,8 @@ Not every change is committed to every SDK.
|
|
1217
1224
|
|
1218
1225
|
| Version | Date | Comments |
|
1219
1226
|
| --: | :-: | --- |
|
1227
|
+
| 3.10.69 | 11/21/2022 | conversation context method |
|
1228
|
+
| 3.10.68 | 11/21/2022 | adjusted conversation event model |
|
1220
1229
|
| 3.10.67 | 11/15/2022 | conversation methods bug fix |
|
1221
1230
|
| 3.10.66 | 11/15/2022 | conversations - enw events for add coupon and items |
|
1222
1231
|
| 3.10.65 | 11/15/2022 | order api new method is order refundable |
|
data/docs/ConversationApi.md
CHANGED
@@ -7,6 +7,7 @@ Method | HTTP request | Description
|
|
7
7
|
[**get_agent_keep_alive**](ConversationApi.md#get_agent_keep_alive) | **GET** /conversation/agent/keepalive | Agent keep alive
|
8
8
|
[**get_agent_websocket_authorization**](ConversationApi.md#get_agent_websocket_authorization) | **PUT** /conversation/agent/auth | Get agent websocket authorization
|
9
9
|
[**get_conversation**](ConversationApi.md#get_conversation) | **GET** /conversation/conversations/{conversation_uuid} | Retrieve a conversation
|
10
|
+
[**get_conversation_context**](ConversationApi.md#get_conversation_context) | **PUT** /conversation/conversations/{conversation_uuid}/context | Get a webchat conversation context
|
10
11
|
[**get_conversation_messages**](ConversationApi.md#get_conversation_messages) | **GET** /conversation/conversations/{conversation_uuid}/messages/{since} | Retrieve conversation messages
|
11
12
|
[**get_conversation_multimedia_upload_url**](ConversationApi.md#get_conversation_multimedia_upload_url) | **GET** /conversation/upload_url/{extension} | Get a presigned conersation multimedia upload URL
|
12
13
|
[**get_conversation_webchat_queue_statuses**](ConversationApi.md#get_conversation_webchat_queue_statuses) | **GET** /conversation/conversations/queues/statuses | Retrieve a conversation webchat queue statuses
|
@@ -160,6 +161,56 @@ Name | Type | Description | Notes
|
|
160
161
|
|
161
162
|
|
162
163
|
|
164
|
+
# **get_conversation_context**
|
165
|
+
> ConversationWebchatContext get_conversation_context(conversation_uuid)
|
166
|
+
|
167
|
+
Get a webchat conversation context
|
168
|
+
|
169
|
+
Get a webchat conversation context
|
170
|
+
|
171
|
+
### Example
|
172
|
+
```ruby
|
173
|
+
# load the gem
|
174
|
+
require 'ultracart_api'
|
175
|
+
|
176
|
+
# Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
|
177
|
+
simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00'
|
178
|
+
api_instance = UltracartClient::ConversationApi.new_using_api_key(simple_key, false, false)
|
179
|
+
|
180
|
+
|
181
|
+
conversation_uuid = 'conversation_uuid_example' # String |
|
182
|
+
|
183
|
+
|
184
|
+
begin
|
185
|
+
#Get a webchat conversation context
|
186
|
+
result = api_instance.get_conversation_context(conversation_uuid)
|
187
|
+
p result
|
188
|
+
rescue UltracartClient::ApiError => e
|
189
|
+
puts "Exception when calling ConversationApi->get_conversation_context: #{e}"
|
190
|
+
end
|
191
|
+
```
|
192
|
+
|
193
|
+
### Parameters
|
194
|
+
|
195
|
+
Name | Type | Description | Notes
|
196
|
+
------------- | ------------- | ------------- | -------------
|
197
|
+
**conversation_uuid** | **String**| |
|
198
|
+
|
199
|
+
### Return type
|
200
|
+
|
201
|
+
[**ConversationWebchatContext**](ConversationWebchatContext.md)
|
202
|
+
|
203
|
+
### Authorization
|
204
|
+
|
205
|
+
[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
206
|
+
|
207
|
+
### HTTP request headers
|
208
|
+
|
209
|
+
- **Content-Type**: application/json
|
210
|
+
- **Accept**: application/json
|
211
|
+
|
212
|
+
|
213
|
+
|
163
214
|
# **get_conversation_messages**
|
164
215
|
> ConversationMessagesResponse get_conversation_messages(conversation_uuid, since, opts)
|
165
216
|
|
@@ -3,6 +3,8 @@
|
|
3
3
|
## Properties
|
4
4
|
Name | Type | Description | Notes
|
5
5
|
------------ | ------------- | ------------- | -------------
|
6
|
-
**
|
6
|
+
**agent_arn** | **String** | | [optional]
|
7
|
+
**agent_name** | **String** | | [optional]
|
8
|
+
**items** | [**Array<CartItem>**](CartItem.md) | | [optional]
|
7
9
|
|
8
10
|
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# UltracartClient::ConversationEventWebchatContext
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**cart_id** | **String** | | [optional]
|
7
|
+
**ucacid** | **String** | | [optional]
|
8
|
+
**url** | **String** | | [optional]
|
9
|
+
|
10
|
+
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# UltracartClient::ConversationWebchatContext
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**cart** | [**Cart**](Cart.md) | | [optional]
|
7
|
+
**current_url** | **String** | | [optional]
|
8
|
+
**page_view** | [**Array<HitPageView>**](HitPageView.md) | | [optional]
|
9
|
+
**session_start** | [**HitSessionStart**](HitSessionStart.md) | | [optional]
|
10
|
+
**session_utm** | [**HitSessionUtm**](HitSessionUtm.md) | | [optional]
|
11
|
+
|
12
|
+
|
@@ -17,6 +17,7 @@ Name | Type | Description | Notes
|
|
17
17
|
**event_type** | **String** | Type of event | [optional]
|
18
18
|
**event_typing** | [**ConversationEventTyping**](ConversationEventTyping.md) | | [optional]
|
19
19
|
**event_updated_message** | [**ConversationMessage**](ConversationMessage.md) | | [optional]
|
20
|
+
**event_webchat_context** | [**ConversationEventWebchatContext**](ConversationEventWebchatContext.md) | | [optional]
|
20
21
|
**message** | [**ConversationMessage**](ConversationMessage.md) | | [optional]
|
21
22
|
**type** | **String** | Type of message | [optional]
|
22
23
|
|
data/docs/HitPageView.md
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
# UltracartClient::HitPageView
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**bounce** | **BOOLEAN** | | [optional]
|
7
|
+
**meta_data** | [**Array<HitPageViewMetaData>**](HitPageViewMetaData.md) | | [optional]
|
8
|
+
**method** | **String** | | [optional]
|
9
|
+
**prefetch** | **BOOLEAN** | | [optional]
|
10
|
+
**query** | **String** | | [optional]
|
11
|
+
**recording** | **BOOLEAN** | | [optional]
|
12
|
+
**redirect** | **BOOLEAN** | | [optional]
|
13
|
+
**referrer** | **String** | | [optional]
|
14
|
+
**time_on_page** | **Float** | | [optional]
|
15
|
+
**title** | **String** | | [optional]
|
16
|
+
**url** | **String** | | [optional]
|
17
|
+
|
18
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# UltracartClient::HitSessionStart
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**bot** | **BOOLEAN** | | [optional]
|
7
|
+
**bounce** | **BOOLEAN** | | [optional]
|
8
|
+
**channel** | **String** | | [optional]
|
9
|
+
**device_switch_detected** | **BOOLEAN** | | [optional]
|
10
|
+
**fake_bot** | **BOOLEAN** | | [optional]
|
11
|
+
**geolocation_country** | **String** | | [optional]
|
12
|
+
**geolocation_latitude** | **Float** | | [optional]
|
13
|
+
**geolocation_longitude** | **Float** | | [optional]
|
14
|
+
**geolocation_province** | **String** | | [optional]
|
15
|
+
**no_cookie_support** | **BOOLEAN** | | [optional]
|
16
|
+
**prefetch** | **BOOLEAN** | | [optional]
|
17
|
+
**referrer** | **String** | | [optional]
|
18
|
+
**screen_height** | **Integer** | | [optional]
|
19
|
+
**screen_width** | **Integer** | | [optional]
|
20
|
+
**time_on_site** | **Float** | | [optional]
|
21
|
+
**user_agent** | **String** | | [optional]
|
22
|
+
**user_ip** | **String** | | [optional]
|
23
|
+
|
24
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# UltracartClient::HitSessionUtm
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
Name | Type | Description | Notes
|
5
|
+
------------ | ------------- | ------------- | -------------
|
6
|
+
**fb_ad_id** | **String** | | [optional]
|
7
|
+
**fbclid** | **String** | | [optional]
|
8
|
+
**gbraid** | **String** | | [optional]
|
9
|
+
**gclid** | **String** | | [optional]
|
10
|
+
**msclkid** | **String** | | [optional]
|
11
|
+
**ttclid** | **String** | | [optional]
|
12
|
+
**uc_message_id** | **String** | | [optional]
|
13
|
+
**utm_campaign** | **String** | | [optional]
|
14
|
+
**utm_content** | **String** | | [optional]
|
15
|
+
**utm_id** | **String** | | [optional]
|
16
|
+
**utm_medium** | **String** | | [optional]
|
17
|
+
**utm_source** | **String** | | [optional]
|
18
|
+
**utm_term** | **String** | | [optional]
|
19
|
+
**vmcid** | **String** | | [optional]
|
20
|
+
**wbraid** | **String** | | [optional]
|
21
|
+
|
22
|
+
|
@@ -187,6 +187,61 @@ module UltracartClient
|
|
187
187
|
end
|
188
188
|
return data, status_code, headers
|
189
189
|
end
|
190
|
+
# Get a webchat conversation context
|
191
|
+
# Get a webchat conversation context
|
192
|
+
# @param conversation_uuid
|
193
|
+
# @param [Hash] opts the optional parameters
|
194
|
+
# @return [ConversationWebchatContext]
|
195
|
+
def get_conversation_context(conversation_uuid, opts = {})
|
196
|
+
data, _status_code, _headers = get_conversation_context_with_http_info(conversation_uuid, opts)
|
197
|
+
data
|
198
|
+
end
|
199
|
+
|
200
|
+
# Get a webchat conversation context
|
201
|
+
# Get a webchat conversation context
|
202
|
+
# @param conversation_uuid
|
203
|
+
# @param [Hash] opts the optional parameters
|
204
|
+
# @return [Array<(ConversationWebchatContext, Fixnum, Hash)>] ConversationWebchatContext data, response status code and response headers
|
205
|
+
def get_conversation_context_with_http_info(conversation_uuid, opts = {})
|
206
|
+
if @api_client.config.debugging
|
207
|
+
@api_client.config.logger.debug 'Calling API: ConversationApi.get_conversation_context ...'
|
208
|
+
end
|
209
|
+
# verify the required parameter 'conversation_uuid' is set
|
210
|
+
if @api_client.config.client_side_validation && conversation_uuid.nil?
|
211
|
+
fail ArgumentError, "Missing the required parameter 'conversation_uuid' when calling ConversationApi.get_conversation_context"
|
212
|
+
end
|
213
|
+
# resource path
|
214
|
+
local_var_path = '/conversation/conversations/{conversation_uuid}/context'.sub('{' + 'conversation_uuid' + '}', conversation_uuid.to_s)
|
215
|
+
|
216
|
+
# query parameters
|
217
|
+
query_params = {}
|
218
|
+
|
219
|
+
# header parameters
|
220
|
+
header_params = {}
|
221
|
+
header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
|
222
|
+
# HTTP header 'Accept' (if needed)
|
223
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
224
|
+
# HTTP header 'Content-Type'
|
225
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
226
|
+
|
227
|
+
# form parameters
|
228
|
+
form_params = {}
|
229
|
+
|
230
|
+
# http body (model)
|
231
|
+
post_body = nil
|
232
|
+
auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
|
233
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
234
|
+
:header_params => header_params,
|
235
|
+
:query_params => query_params,
|
236
|
+
:form_params => form_params,
|
237
|
+
:body => post_body,
|
238
|
+
:auth_names => auth_names,
|
239
|
+
:return_type => 'ConversationWebchatContext')
|
240
|
+
if @api_client.config.debugging
|
241
|
+
@api_client.config.logger.debug "API called: ConversationApi#get_conversation_context\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
242
|
+
end
|
243
|
+
return data, status_code, headers
|
244
|
+
end
|
190
245
|
# Retrieve conversation messages
|
191
246
|
# Retrieve conversation messages since a particular time
|
192
247
|
# @param conversation_uuid
|
@@ -14,11 +14,17 @@ require 'date'
|
|
14
14
|
|
15
15
|
module UltracartClient
|
16
16
|
class ConversationEventAddCoupon
|
17
|
+
attr_accessor :agent_arn
|
18
|
+
|
19
|
+
attr_accessor :agent_name
|
20
|
+
|
17
21
|
attr_accessor :coupon_code
|
18
22
|
|
19
23
|
# Attribute mapping from ruby-style variable name to JSON key.
|
20
24
|
def self.attribute_map
|
21
25
|
{
|
26
|
+
:'agent_arn' => :'agent_arn',
|
27
|
+
:'agent_name' => :'agent_name',
|
22
28
|
:'coupon_code' => :'coupon_code'
|
23
29
|
}
|
24
30
|
end
|
@@ -26,6 +32,8 @@ module UltracartClient
|
|
26
32
|
# Attribute type mapping.
|
27
33
|
def self.swagger_types
|
28
34
|
{
|
35
|
+
:'agent_arn' => :'String',
|
36
|
+
:'agent_name' => :'String',
|
29
37
|
:'coupon_code' => :'String'
|
30
38
|
}
|
31
39
|
end
|
@@ -38,6 +46,14 @@ module UltracartClient
|
|
38
46
|
# convert string to symbol for hash key
|
39
47
|
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
40
48
|
|
49
|
+
if attributes.has_key?(:'agent_arn')
|
50
|
+
self.agent_arn = attributes[:'agent_arn']
|
51
|
+
end
|
52
|
+
|
53
|
+
if attributes.has_key?(:'agent_name')
|
54
|
+
self.agent_name = attributes[:'agent_name']
|
55
|
+
end
|
56
|
+
|
41
57
|
if attributes.has_key?(:'coupon_code')
|
42
58
|
self.coupon_code = attributes[:'coupon_code']
|
43
59
|
end
|
@@ -61,6 +77,8 @@ module UltracartClient
|
|
61
77
|
def ==(o)
|
62
78
|
return true if self.equal?(o)
|
63
79
|
self.class == o.class &&
|
80
|
+
agent_arn == o.agent_arn &&
|
81
|
+
agent_name == o.agent_name &&
|
64
82
|
coupon_code == o.coupon_code
|
65
83
|
end
|
66
84
|
|
@@ -73,7 +91,7 @@ module UltracartClient
|
|
73
91
|
# Calculates hash code according to all attributes.
|
74
92
|
# @return [Fixnum] Hash code
|
75
93
|
def hash
|
76
|
-
[coupon_code].hash
|
94
|
+
[agent_arn, agent_name, coupon_code].hash
|
77
95
|
end
|
78
96
|
|
79
97
|
# Builds the object from hash
|
@@ -14,19 +14,27 @@ require 'date'
|
|
14
14
|
|
15
15
|
module UltracartClient
|
16
16
|
class ConversationEventAddItem
|
17
|
-
attr_accessor :
|
17
|
+
attr_accessor :agent_arn
|
18
|
+
|
19
|
+
attr_accessor :agent_name
|
20
|
+
|
21
|
+
attr_accessor :items
|
18
22
|
|
19
23
|
# Attribute mapping from ruby-style variable name to JSON key.
|
20
24
|
def self.attribute_map
|
21
25
|
{
|
22
|
-
:'
|
26
|
+
:'agent_arn' => :'agent_arn',
|
27
|
+
:'agent_name' => :'agent_name',
|
28
|
+
:'items' => :'items'
|
23
29
|
}
|
24
30
|
end
|
25
31
|
|
26
32
|
# Attribute type mapping.
|
27
33
|
def self.swagger_types
|
28
34
|
{
|
29
|
-
:'
|
35
|
+
:'agent_arn' => :'String',
|
36
|
+
:'agent_name' => :'String',
|
37
|
+
:'items' => :'Array<CartItem>'
|
30
38
|
}
|
31
39
|
end
|
32
40
|
|
@@ -38,8 +46,18 @@ module UltracartClient
|
|
38
46
|
# convert string to symbol for hash key
|
39
47
|
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
40
48
|
|
41
|
-
if attributes.has_key?(:'
|
42
|
-
self.
|
49
|
+
if attributes.has_key?(:'agent_arn')
|
50
|
+
self.agent_arn = attributes[:'agent_arn']
|
51
|
+
end
|
52
|
+
|
53
|
+
if attributes.has_key?(:'agent_name')
|
54
|
+
self.agent_name = attributes[:'agent_name']
|
55
|
+
end
|
56
|
+
|
57
|
+
if attributes.has_key?(:'items')
|
58
|
+
if (value = attributes[:'items']).is_a?(Array)
|
59
|
+
self.items = value
|
60
|
+
end
|
43
61
|
end
|
44
62
|
end
|
45
63
|
|
@@ -61,7 +79,9 @@ module UltracartClient
|
|
61
79
|
def ==(o)
|
62
80
|
return true if self.equal?(o)
|
63
81
|
self.class == o.class &&
|
64
|
-
|
82
|
+
agent_arn == o.agent_arn &&
|
83
|
+
agent_name == o.agent_name &&
|
84
|
+
items == o.items
|
65
85
|
end
|
66
86
|
|
67
87
|
# @see the `==` method
|
@@ -73,7 +93,7 @@ module UltracartClient
|
|
73
93
|
# Calculates hash code according to all attributes.
|
74
94
|
# @return [Fixnum] Hash code
|
75
95
|
def hash
|
76
|
-
[
|
96
|
+
[agent_arn, agent_name, items].hash
|
77
97
|
end
|
78
98
|
|
79
99
|
# Builds the object from hash
|
@@ -0,0 +1,202 @@
|
|
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 ConversationEventWebchatContext
|
17
|
+
attr_accessor :cart_id
|
18
|
+
|
19
|
+
attr_accessor :ucacid
|
20
|
+
|
21
|
+
attr_accessor :url
|
22
|
+
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
24
|
+
def self.attribute_map
|
25
|
+
{
|
26
|
+
:'cart_id' => :'cart_id',
|
27
|
+
:'ucacid' => :'ucacid',
|
28
|
+
:'url' => :'url'
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
# Attribute type mapping.
|
33
|
+
def self.swagger_types
|
34
|
+
{
|
35
|
+
:'cart_id' => :'String',
|
36
|
+
:'ucacid' => :'String',
|
37
|
+
:'url' => :'String'
|
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?(:'cart_id')
|
50
|
+
self.cart_id = attributes[:'cart_id']
|
51
|
+
end
|
52
|
+
|
53
|
+
if attributes.has_key?(:'ucacid')
|
54
|
+
self.ucacid = attributes[:'ucacid']
|
55
|
+
end
|
56
|
+
|
57
|
+
if attributes.has_key?(:'url')
|
58
|
+
self.url = attributes[:'url']
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
63
|
+
# @return Array for valid properties with the reasons
|
64
|
+
def list_invalid_properties
|
65
|
+
invalid_properties = Array.new
|
66
|
+
invalid_properties
|
67
|
+
end
|
68
|
+
|
69
|
+
# Check to see if the all the properties in the model are valid
|
70
|
+
# @return true if the model is valid
|
71
|
+
def valid?
|
72
|
+
true
|
73
|
+
end
|
74
|
+
|
75
|
+
# Checks equality by comparing each attribute.
|
76
|
+
# @param [Object] Object to be compared
|
77
|
+
def ==(o)
|
78
|
+
return true if self.equal?(o)
|
79
|
+
self.class == o.class &&
|
80
|
+
cart_id == o.cart_id &&
|
81
|
+
ucacid == o.ucacid &&
|
82
|
+
url == o.url
|
83
|
+
end
|
84
|
+
|
85
|
+
# @see the `==` method
|
86
|
+
# @param [Object] Object to be compared
|
87
|
+
def eql?(o)
|
88
|
+
self == o
|
89
|
+
end
|
90
|
+
|
91
|
+
# Calculates hash code according to all attributes.
|
92
|
+
# @return [Fixnum] Hash code
|
93
|
+
def hash
|
94
|
+
[cart_id, ucacid, url].hash
|
95
|
+
end
|
96
|
+
|
97
|
+
# Builds the object from hash
|
98
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
99
|
+
# @return [Object] Returns the model itself
|
100
|
+
def build_from_hash(attributes)
|
101
|
+
return nil unless attributes.is_a?(Hash)
|
102
|
+
self.class.swagger_types.each_pair do |key, type|
|
103
|
+
if type =~ /\AArray<(.*)>/i
|
104
|
+
# check to ensure the input is an array given that the attribute
|
105
|
+
# is documented as an array but the input is not
|
106
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
107
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
108
|
+
end
|
109
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
110
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
111
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
112
|
+
end
|
113
|
+
|
114
|
+
self
|
115
|
+
end
|
116
|
+
|
117
|
+
# Deserializes the data based on type
|
118
|
+
# @param string type Data type
|
119
|
+
# @param string value Value to be deserialized
|
120
|
+
# @return [Object] Deserialized data
|
121
|
+
def _deserialize(type, value)
|
122
|
+
case type.to_sym
|
123
|
+
when :DateTime
|
124
|
+
DateTime.parse(value)
|
125
|
+
when :Date
|
126
|
+
Date.parse(value)
|
127
|
+
when :String
|
128
|
+
value.to_s
|
129
|
+
when :Integer
|
130
|
+
value.to_i
|
131
|
+
when :Float
|
132
|
+
value.to_f
|
133
|
+
when :BOOLEAN
|
134
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
135
|
+
true
|
136
|
+
else
|
137
|
+
false
|
138
|
+
end
|
139
|
+
when :Object
|
140
|
+
# generic object (usually a Hash), return directly
|
141
|
+
value
|
142
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
143
|
+
inner_type = Regexp.last_match[:inner_type]
|
144
|
+
value.map { |v| _deserialize(inner_type, v) }
|
145
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
146
|
+
k_type = Regexp.last_match[:k_type]
|
147
|
+
v_type = Regexp.last_match[:v_type]
|
148
|
+
{}.tap do |hash|
|
149
|
+
value.each do |k, v|
|
150
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
151
|
+
end
|
152
|
+
end
|
153
|
+
else # model
|
154
|
+
temp_model = UltracartClient.const_get(type).new
|
155
|
+
temp_model.build_from_hash(value)
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
159
|
+
# Returns the string representation of the object
|
160
|
+
# @return [String] String presentation of the object
|
161
|
+
def to_s
|
162
|
+
to_hash.to_s
|
163
|
+
end
|
164
|
+
|
165
|
+
# to_body is an alias to to_hash (backward compatibility)
|
166
|
+
# @return [Hash] Returns the object in the form of hash
|
167
|
+
def to_body
|
168
|
+
to_hash
|
169
|
+
end
|
170
|
+
|
171
|
+
# Returns the object in the form of hash
|
172
|
+
# @return [Hash] Returns the object in the form of hash
|
173
|
+
def to_hash
|
174
|
+
hash = {}
|
175
|
+
self.class.attribute_map.each_pair do |attr, param|
|
176
|
+
value = self.send(attr)
|
177
|
+
next if value.nil?
|
178
|
+
hash[param] = _to_hash(value)
|
179
|
+
end
|
180
|
+
hash
|
181
|
+
end
|
182
|
+
|
183
|
+
# Outputs non-array value in the form of hash
|
184
|
+
# For object, use to_hash. Otherwise, just return the value
|
185
|
+
# @param [Object] value Any valid value
|
186
|
+
# @return [Hash] Returns the value in the form of hash
|
187
|
+
def _to_hash(value)
|
188
|
+
if value.is_a?(Array)
|
189
|
+
value.compact.map { |v| _to_hash(v) }
|
190
|
+
elsif value.is_a?(Hash)
|
191
|
+
{}.tap do |hash|
|
192
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
193
|
+
end
|
194
|
+
elsif value.respond_to? :to_hash
|
195
|
+
value.to_hash
|
196
|
+
else
|
197
|
+
value
|
198
|
+
end
|
199
|
+
end
|
200
|
+
|
201
|
+
end
|
202
|
+
end
|