ultracart_api 3.10.175 → 3.10.177
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 +4 -4
- data/README.md +8 -4
- data/docs/WebhookEventSubscription.md +1 -0
- data/docs/WorkflowApi.md +46 -0
- data/docs/WorkflowUserResponse.md +12 -0
- data/lib/ultracart_api/api/workflow_api.rb +49 -0
- data/lib/ultracart_api/models/webhook_event_subscription.rb +11 -1
- data/lib/ultracart_api/models/workflow_user_response.rb +221 -0
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +1 -0
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d48b225c4ce3b20a653433c433d178492b45afe0fc5d32ab08f7cc17f68b42c2
|
|
4
|
+
data.tar.gz: ddbb534ce4ff00479e1dec95198483a6ac869bc2552e030bcc51fdbf96e31d87
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f80dfcc8c2f632b27cba07d49bd8628303a250e22ac02d1a273ed5b45febc88c35fb994351ce446b846391bad68bb519ef8b6193474ce163013d173c5c6d2845
|
|
7
|
+
data.tar.gz: 5aeb3a8f88a362ed40c5210c3476a486f0a7c68f72047ac6ca2c333c41b99849205b8605384dd813ccf8566026e46a175085cc78c28faee6baa33880c5e4e25a
|
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.177
|
|
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.177.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.177.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.177'
|
|
36
36
|
|
|
37
37
|
### Install from Git
|
|
38
38
|
|
|
@@ -514,6 +514,7 @@ Class | Method | HTTP request | Description
|
|
|
514
514
|
*UltracartClient::WebhookApi* | [**update_webhook**](docs/WebhookApi.md#update_webhook) | **PUT** /webhook/webhooks/{webhookOid} | Update a webhook
|
|
515
515
|
*UltracartClient::WorkflowApi* | [**get_workflow_assignment_groups**](docs/WorkflowApi.md#get_workflow_assignment_groups) | **GET** /workflow/assignment_groups | Retrieve a list of groups that workflow tasks can be assigned to
|
|
516
516
|
*UltracartClient::WorkflowApi* | [**get_workflow_assignment_users**](docs/WorkflowApi.md#get_workflow_assignment_users) | **GET** /workflow/assignment_users | Retrieve a list of users that workflow tasks can be assigned to
|
|
517
|
+
*UltracartClient::WorkflowApi* | [**get_workflow_me**](docs/WorkflowApi.md#get_workflow_me) | **GET** /workflow/me | Retrieve a user object for myself
|
|
517
518
|
*UltracartClient::WorkflowApi* | [**get_workflow_task**](docs/WorkflowApi.md#get_workflow_task) | **GET** /workflow/tasks/{task_uuid} | Retrieve a workflow task
|
|
518
519
|
*UltracartClient::WorkflowApi* | [**get_workflow_task_attachment_upload_url**](docs/WorkflowApi.md#get_workflow_task_attachment_upload_url) | **GET** /workflow/tasks/attachments/{extension} | Get a presigned workflow task attachment upload URL
|
|
519
520
|
*UltracartClient::WorkflowApi* | [**get_workflow_task_by_object_type**](docs/WorkflowApi.md#get_workflow_task_by_object_type) | **GET** /workflow/tasks/by/{object_type}/{object_id} | Retrieve a workflow task by object type and id
|
|
@@ -1323,6 +1324,7 @@ Class | Method | HTTP request | Description
|
|
|
1323
1324
|
- [UltracartClient::WorkflowTasksRequest](docs/WorkflowTasksRequest.md)
|
|
1324
1325
|
- [UltracartClient::WorkflowTasksResponse](docs/WorkflowTasksResponse.md)
|
|
1325
1326
|
- [UltracartClient::WorkflowUser](docs/WorkflowUser.md)
|
|
1327
|
+
- [UltracartClient::WorkflowUserResponse](docs/WorkflowUserResponse.md)
|
|
1326
1328
|
- [UltracartClient::WorkflowUsersResponse](docs/WorkflowUsersResponse.md)
|
|
1327
1329
|
|
|
1328
1330
|
|
|
@@ -1396,6 +1398,8 @@ Not every change is committed to every SDK.
|
|
|
1396
1398
|
|
|
1397
1399
|
| Version | Date | Comments |
|
|
1398
1400
|
| --: | :-: | --- |
|
|
1401
|
+
| 3.10.177 | 12/15/2023 | bug fix on bad docs breaking yaml schema |
|
|
1402
|
+
| 3.10.176 | 12/12/2023 | webhook - added event ruler property |
|
|
1399
1403
|
| 3.10.175 | 11/21/2023 | coupons - addl support on tiered amount/percent off items |
|
|
1400
1404
|
| 3.10.174 | 11/20/2023 | coupon - add item tag support to percent off items and free shipping |
|
|
1401
1405
|
| 3.10.173 | 11/20/2023 | item.google_product_search.color bugfix for bad length validation: 20 to 100 |
|
|
@@ -8,6 +8,7 @@ Name | Type | Description | Notes
|
|
|
8
8
|
**discontinued_flag** | **BOOLEAN** | True if the event is discontinued. See the API change log for details on migration details. | [optional]
|
|
9
9
|
**event_description** | **String** | Description of the event | [optional]
|
|
10
10
|
**event_name** | **String** | Event name | [optional]
|
|
11
|
+
**event_ruler** | **String** | Optional - Event ruler expression to filter events to. Only events that match this Ruler expression will be transmitted to the webhook. | [optional]
|
|
11
12
|
**expansion** | **String** | The expand string for the notification object. See the individual resource _expand documentation for valid values. | [optional]
|
|
12
13
|
**subscribed** | **BOOLEAN** | True if this is event is subscribed to | [optional]
|
|
13
14
|
**supports_reflow** | **BOOLEAN** | True if the event can be triggered to reflow existing records | [optional]
|
data/docs/WorkflowApi.md
CHANGED
|
@@ -6,6 +6,7 @@ Method | HTTP request | Description
|
|
|
6
6
|
------------- | ------------- | -------------
|
|
7
7
|
[**get_workflow_assignment_groups**](WorkflowApi.md#get_workflow_assignment_groups) | **GET** /workflow/assignment_groups | Retrieve a list of groups that workflow tasks can be assigned to
|
|
8
8
|
[**get_workflow_assignment_users**](WorkflowApi.md#get_workflow_assignment_users) | **GET** /workflow/assignment_users | Retrieve a list of users that workflow tasks can be assigned to
|
|
9
|
+
[**get_workflow_me**](WorkflowApi.md#get_workflow_me) | **GET** /workflow/me | Retrieve a user object for myself
|
|
9
10
|
[**get_workflow_task**](WorkflowApi.md#get_workflow_task) | **GET** /workflow/tasks/{task_uuid} | Retrieve a workflow task
|
|
10
11
|
[**get_workflow_task_attachment_upload_url**](WorkflowApi.md#get_workflow_task_attachment_upload_url) | **GET** /workflow/tasks/attachments/{extension} | Get a presigned workflow task attachment upload URL
|
|
11
12
|
[**get_workflow_task_by_object_type**](WorkflowApi.md#get_workflow_task_by_object_type) | **GET** /workflow/tasks/by/{object_type}/{object_id} | Retrieve a workflow task by object type and id
|
|
@@ -120,6 +121,51 @@ Name | Type | Description | Notes
|
|
|
120
121
|
|
|
121
122
|
|
|
122
123
|
|
|
124
|
+
# **get_workflow_me**
|
|
125
|
+
> WorkflowUserResponse get_workflow_me
|
|
126
|
+
|
|
127
|
+
Retrieve a user object for myself
|
|
128
|
+
|
|
129
|
+
Retrieve a user object for myself
|
|
130
|
+
|
|
131
|
+
### Example
|
|
132
|
+
```ruby
|
|
133
|
+
# load the gem
|
|
134
|
+
require 'ultracart_api'
|
|
135
|
+
|
|
136
|
+
# Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
|
|
137
|
+
simple_key = '109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00'
|
|
138
|
+
api_instance = UltracartClient::WorkflowApi.new_using_api_key(simple_key, false, false)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
begin
|
|
143
|
+
#Retrieve a user object for myself
|
|
144
|
+
result = api_instance.get_workflow_me
|
|
145
|
+
p result
|
|
146
|
+
rescue UltracartClient::ApiError => e
|
|
147
|
+
puts "Exception when calling WorkflowApi->get_workflow_me: #{e}"
|
|
148
|
+
end
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Parameters
|
|
152
|
+
This endpoint does not need any parameter.
|
|
153
|
+
|
|
154
|
+
### Return type
|
|
155
|
+
|
|
156
|
+
[**WorkflowUserResponse**](WorkflowUserResponse.md)
|
|
157
|
+
|
|
158
|
+
### Authorization
|
|
159
|
+
|
|
160
|
+
[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
|
161
|
+
|
|
162
|
+
### HTTP request headers
|
|
163
|
+
|
|
164
|
+
- **Content-Type**: application/json
|
|
165
|
+
- **Accept**: application/json
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
123
169
|
# **get_workflow_task**
|
|
124
170
|
> WorkflowTaskResponse get_workflow_task(task_uuid)
|
|
125
171
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# UltracartClient::WorkflowUserResponse
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
Name | Type | Description | Notes
|
|
5
|
+
------------ | ------------- | ------------- | -------------
|
|
6
|
+
**error** | [**Error**](Error.md) | | [optional]
|
|
7
|
+
**metadata** | [**ResponseMetadata**](ResponseMetadata.md) | | [optional]
|
|
8
|
+
**success** | **BOOLEAN** | Indicates if API call was successful | [optional]
|
|
9
|
+
**user** | [**WorkflowUser**](WorkflowUser.md) | | [optional]
|
|
10
|
+
**warning** | [**Warning**](Warning.md) | | [optional]
|
|
11
|
+
|
|
12
|
+
|
|
@@ -142,6 +142,55 @@ module UltracartClient
|
|
|
142
142
|
end
|
|
143
143
|
return data, status_code, headers
|
|
144
144
|
end
|
|
145
|
+
# Retrieve a user object for myself
|
|
146
|
+
# Retrieve a user object for myself
|
|
147
|
+
# @param [Hash] opts the optional parameters
|
|
148
|
+
# @return [WorkflowUserResponse]
|
|
149
|
+
def get_workflow_me(opts = {})
|
|
150
|
+
data, _status_code, _headers = get_workflow_me_with_http_info(opts)
|
|
151
|
+
data
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Retrieve a user object for myself
|
|
155
|
+
# Retrieve a user object for myself
|
|
156
|
+
# @param [Hash] opts the optional parameters
|
|
157
|
+
# @return [Array<(WorkflowUserResponse, Fixnum, Hash)>] WorkflowUserResponse data, response status code and response headers
|
|
158
|
+
def get_workflow_me_with_http_info(opts = {})
|
|
159
|
+
if @api_client.config.debugging
|
|
160
|
+
@api_client.config.logger.debug 'Calling API: WorkflowApi.get_workflow_me ...'
|
|
161
|
+
end
|
|
162
|
+
# resource path
|
|
163
|
+
local_var_path = '/workflow/me'
|
|
164
|
+
|
|
165
|
+
# query parameters
|
|
166
|
+
query_params = {}
|
|
167
|
+
|
|
168
|
+
# header parameters
|
|
169
|
+
header_params = {}
|
|
170
|
+
header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
|
|
171
|
+
# HTTP header 'Accept' (if needed)
|
|
172
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
173
|
+
# HTTP header 'Content-Type'
|
|
174
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
|
175
|
+
|
|
176
|
+
# form parameters
|
|
177
|
+
form_params = {}
|
|
178
|
+
|
|
179
|
+
# http body (model)
|
|
180
|
+
post_body = nil
|
|
181
|
+
auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']
|
|
182
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
|
183
|
+
:header_params => header_params,
|
|
184
|
+
:query_params => query_params,
|
|
185
|
+
:form_params => form_params,
|
|
186
|
+
:body => post_body,
|
|
187
|
+
:auth_names => auth_names,
|
|
188
|
+
:return_type => 'WorkflowUserResponse')
|
|
189
|
+
if @api_client.config.debugging
|
|
190
|
+
@api_client.config.logger.debug "API called: WorkflowApi#get_workflow_me\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
191
|
+
end
|
|
192
|
+
return data, status_code, headers
|
|
193
|
+
end
|
|
145
194
|
# Retrieve a workflow task
|
|
146
195
|
# Retrieve a workflow task
|
|
147
196
|
# @param task_uuid
|
|
@@ -29,6 +29,9 @@ module UltracartClient
|
|
|
29
29
|
# Event name
|
|
30
30
|
attr_accessor :event_name
|
|
31
31
|
|
|
32
|
+
# Optional - Event ruler expression to filter events to. Only events that match this Ruler expression will be transmitted to the webhook.
|
|
33
|
+
attr_accessor :event_ruler
|
|
34
|
+
|
|
32
35
|
# The expand string for the notification object. See the individual resource _expand documentation for valid values.
|
|
33
36
|
attr_accessor :expansion
|
|
34
37
|
|
|
@@ -49,6 +52,7 @@ module UltracartClient
|
|
|
49
52
|
:'discontinued_flag' => :'discontinued_flag',
|
|
50
53
|
:'event_description' => :'event_description',
|
|
51
54
|
:'event_name' => :'event_name',
|
|
55
|
+
:'event_ruler' => :'event_ruler',
|
|
52
56
|
:'expansion' => :'expansion',
|
|
53
57
|
:'subscribed' => :'subscribed',
|
|
54
58
|
:'supports_reflow' => :'supports_reflow',
|
|
@@ -64,6 +68,7 @@ module UltracartClient
|
|
|
64
68
|
:'discontinued_flag' => :'BOOLEAN',
|
|
65
69
|
:'event_description' => :'String',
|
|
66
70
|
:'event_name' => :'String',
|
|
71
|
+
:'event_ruler' => :'String',
|
|
67
72
|
:'expansion' => :'String',
|
|
68
73
|
:'subscribed' => :'BOOLEAN',
|
|
69
74
|
:'supports_reflow' => :'BOOLEAN',
|
|
@@ -99,6 +104,10 @@ module UltracartClient
|
|
|
99
104
|
self.event_name = attributes[:'event_name']
|
|
100
105
|
end
|
|
101
106
|
|
|
107
|
+
if attributes.has_key?(:'event_ruler')
|
|
108
|
+
self.event_ruler = attributes[:'event_ruler']
|
|
109
|
+
end
|
|
110
|
+
|
|
102
111
|
if attributes.has_key?(:'expansion')
|
|
103
112
|
self.expansion = attributes[:'expansion']
|
|
104
113
|
end
|
|
@@ -139,6 +148,7 @@ module UltracartClient
|
|
|
139
148
|
discontinued_flag == o.discontinued_flag &&
|
|
140
149
|
event_description == o.event_description &&
|
|
141
150
|
event_name == o.event_name &&
|
|
151
|
+
event_ruler == o.event_ruler &&
|
|
142
152
|
expansion == o.expansion &&
|
|
143
153
|
subscribed == o.subscribed &&
|
|
144
154
|
supports_reflow == o.supports_reflow &&
|
|
@@ -154,7 +164,7 @@ module UltracartClient
|
|
|
154
164
|
# Calculates hash code according to all attributes.
|
|
155
165
|
# @return [Fixnum] Hash code
|
|
156
166
|
def hash
|
|
157
|
-
[comments, deprecated_flag, discontinued_flag, event_description, event_name, expansion, subscribed, supports_reflow, webhook_event_oid].hash
|
|
167
|
+
[comments, deprecated_flag, discontinued_flag, event_description, event_name, event_ruler, expansion, subscribed, supports_reflow, webhook_event_oid].hash
|
|
158
168
|
end
|
|
159
169
|
|
|
160
170
|
# Builds the object from hash
|
|
@@ -0,0 +1,221 @@
|
|
|
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 WorkflowUserResponse
|
|
17
|
+
attr_accessor :error
|
|
18
|
+
|
|
19
|
+
attr_accessor :metadata
|
|
20
|
+
|
|
21
|
+
# Indicates if API call was successful
|
|
22
|
+
attr_accessor :success
|
|
23
|
+
|
|
24
|
+
attr_accessor :user
|
|
25
|
+
|
|
26
|
+
attr_accessor :warning
|
|
27
|
+
|
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
29
|
+
def self.attribute_map
|
|
30
|
+
{
|
|
31
|
+
:'error' => :'error',
|
|
32
|
+
:'metadata' => :'metadata',
|
|
33
|
+
:'success' => :'success',
|
|
34
|
+
:'user' => :'user',
|
|
35
|
+
:'warning' => :'warning'
|
|
36
|
+
}
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Attribute type mapping.
|
|
40
|
+
def self.swagger_types
|
|
41
|
+
{
|
|
42
|
+
:'error' => :'Error',
|
|
43
|
+
:'metadata' => :'ResponseMetadata',
|
|
44
|
+
:'success' => :'BOOLEAN',
|
|
45
|
+
:'user' => :'WorkflowUser',
|
|
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?(:'error')
|
|
59
|
+
self.error = attributes[:'error']
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
if attributes.has_key?(:'metadata')
|
|
63
|
+
self.metadata = attributes[:'metadata']
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
if attributes.has_key?(:'success')
|
|
67
|
+
self.success = attributes[:'success']
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
if attributes.has_key?(:'user')
|
|
71
|
+
self.user = attributes[:'user']
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
if attributes.has_key?(:'warning')
|
|
75
|
+
self.warning = attributes[:'warning']
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
80
|
+
# @return Array for valid properties with the reasons
|
|
81
|
+
def list_invalid_properties
|
|
82
|
+
invalid_properties = Array.new
|
|
83
|
+
invalid_properties
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Check to see if the all the properties in the model are valid
|
|
87
|
+
# @return true if the model is valid
|
|
88
|
+
def valid?
|
|
89
|
+
true
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Checks equality by comparing each attribute.
|
|
93
|
+
# @param [Object] Object to be compared
|
|
94
|
+
def ==(o)
|
|
95
|
+
return true if self.equal?(o)
|
|
96
|
+
self.class == o.class &&
|
|
97
|
+
error == o.error &&
|
|
98
|
+
metadata == o.metadata &&
|
|
99
|
+
success == o.success &&
|
|
100
|
+
user == o.user &&
|
|
101
|
+
warning == o.warning
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# @see the `==` method
|
|
105
|
+
# @param [Object] Object to be compared
|
|
106
|
+
def eql?(o)
|
|
107
|
+
self == o
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Calculates hash code according to all attributes.
|
|
111
|
+
# @return [Fixnum] Hash code
|
|
112
|
+
def hash
|
|
113
|
+
[error, metadata, success, user, warning].hash
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Builds the object from hash
|
|
117
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
118
|
+
# @return [Object] Returns the model itself
|
|
119
|
+
def build_from_hash(attributes)
|
|
120
|
+
return nil unless attributes.is_a?(Hash)
|
|
121
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
122
|
+
if type =~ /\AArray<(.*)>/i
|
|
123
|
+
# check to ensure the input is an array given that the attribute
|
|
124
|
+
# is documented as an array but the input is not
|
|
125
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
126
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
127
|
+
end
|
|
128
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
129
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
130
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
self
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# Deserializes the data based on type
|
|
137
|
+
# @param string type Data type
|
|
138
|
+
# @param string value Value to be deserialized
|
|
139
|
+
# @return [Object] Deserialized data
|
|
140
|
+
def _deserialize(type, value)
|
|
141
|
+
case type.to_sym
|
|
142
|
+
when :DateTime
|
|
143
|
+
DateTime.parse(value)
|
|
144
|
+
when :Date
|
|
145
|
+
Date.parse(value)
|
|
146
|
+
when :String
|
|
147
|
+
value.to_s
|
|
148
|
+
when :Integer
|
|
149
|
+
value.to_i
|
|
150
|
+
when :Float
|
|
151
|
+
value.to_f
|
|
152
|
+
when :BOOLEAN
|
|
153
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
154
|
+
true
|
|
155
|
+
else
|
|
156
|
+
false
|
|
157
|
+
end
|
|
158
|
+
when :Object
|
|
159
|
+
# generic object (usually a Hash), return directly
|
|
160
|
+
value
|
|
161
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
162
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
163
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
164
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
165
|
+
k_type = Regexp.last_match[:k_type]
|
|
166
|
+
v_type = Regexp.last_match[:v_type]
|
|
167
|
+
{}.tap do |hash|
|
|
168
|
+
value.each do |k, v|
|
|
169
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
else # model
|
|
173
|
+
temp_model = UltracartClient.const_get(type).new
|
|
174
|
+
temp_model.build_from_hash(value)
|
|
175
|
+
end
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Returns the string representation of the object
|
|
179
|
+
# @return [String] String presentation of the object
|
|
180
|
+
def to_s
|
|
181
|
+
to_hash.to_s
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
185
|
+
# @return [Hash] Returns the object in the form of hash
|
|
186
|
+
def to_body
|
|
187
|
+
to_hash
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# Returns the object in the form of hash
|
|
191
|
+
# @return [Hash] Returns the object in the form of hash
|
|
192
|
+
def to_hash
|
|
193
|
+
hash = {}
|
|
194
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
195
|
+
value = self.send(attr)
|
|
196
|
+
next if value.nil?
|
|
197
|
+
hash[param] = _to_hash(value)
|
|
198
|
+
end
|
|
199
|
+
hash
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# Outputs non-array value in the form of hash
|
|
203
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
204
|
+
# @param [Object] value Any valid value
|
|
205
|
+
# @return [Hash] Returns the value in the form of hash
|
|
206
|
+
def _to_hash(value)
|
|
207
|
+
if value.is_a?(Array)
|
|
208
|
+
value.compact.map { |v| _to_hash(v) }
|
|
209
|
+
elsif value.is_a?(Hash)
|
|
210
|
+
{}.tap do |hash|
|
|
211
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
212
|
+
end
|
|
213
|
+
elsif value.respond_to? :to_hash
|
|
214
|
+
value.to_hash
|
|
215
|
+
else
|
|
216
|
+
value
|
|
217
|
+
end
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
end
|
|
221
|
+
end
|
data/lib/ultracart_api.rb
CHANGED
|
@@ -816,6 +816,7 @@ require 'ultracart_api/models/workflow_task_response'
|
|
|
816
816
|
require 'ultracart_api/models/workflow_tasks_request'
|
|
817
817
|
require 'ultracart_api/models/workflow_tasks_response'
|
|
818
818
|
require 'ultracart_api/models/workflow_user'
|
|
819
|
+
require 'ultracart_api/models/workflow_user_response'
|
|
819
820
|
require 'ultracart_api/models/workflow_users_response'
|
|
820
821
|
|
|
821
822
|
# APIs
|
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.
|
|
4
|
+
version: 3.10.177
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- UltraCart
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-
|
|
11
|
+
date: 2023-12-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: typhoeus
|
|
@@ -1041,6 +1041,7 @@ files:
|
|
|
1041
1041
|
- docs/WorkflowTasksRequest.md
|
|
1042
1042
|
- docs/WorkflowTasksResponse.md
|
|
1043
1043
|
- docs/WorkflowUser.md
|
|
1044
|
+
- docs/WorkflowUserResponse.md
|
|
1044
1045
|
- docs/WorkflowUsersResponse.md
|
|
1045
1046
|
- git_push.sh
|
|
1046
1047
|
- lib/ultracart_api.rb
|
|
@@ -1867,6 +1868,7 @@ files:
|
|
|
1867
1868
|
- lib/ultracart_api/models/workflow_tasks_request.rb
|
|
1868
1869
|
- lib/ultracart_api/models/workflow_tasks_response.rb
|
|
1869
1870
|
- lib/ultracart_api/models/workflow_user.rb
|
|
1871
|
+
- lib/ultracart_api/models/workflow_user_response.rb
|
|
1870
1872
|
- lib/ultracart_api/models/workflow_users_response.rb
|
|
1871
1873
|
- lib/ultracart_api/version.rb
|
|
1872
1874
|
- spec/api_client_spec.rb
|