ultracart_api 4.1.27 → 4.1.28
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 +5 -2
- data/docs/OrderApi.md +56 -0
- data/docs/OrderAssignToAffiliateRequest.md +22 -0
- data/lib/ultracart_api/api/order_api.rb +78 -0
- data/lib/ultracart_api/models/order_assign_to_affiliate_request.rb +255 -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: 5aa9633751a9e675b30a8b31ef2b245fdd6e62c382f161a50fcaaa9d67aee2c3
|
|
4
|
+
data.tar.gz: cdb95b4e70dad7597709914b796ab329c815c54ef1542b8a846eaeb02a30a4fc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d75c8740952757d5cf9989f9708af9f3ccc208fce5e4aef7dacc90bdd3d34b19f2116615fa08370b5f0bd4fbf268cd5537ac5b564ee3c671d206e62ef10ec7fc
|
|
7
|
+
data.tar.gz: 78c219a183be070e7f96d2c7eb230d355b60b8d59c736176518c68d4881087c210cf0e49ccf3fe56c51e38b98767e306bd8a08b42eee56f84978d5f37514e0da
|
data/README.md
CHANGED
|
@@ -7,7 +7,7 @@ Note: Every method has a sample for every language. See https://github.com/Ultr
|
|
|
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.1.
|
|
10
|
+
- Package version: 4.1.28
|
|
11
11
|
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
|
12
12
|
- For more information, please visit [http://www.ultracart.com/api/](http://www.ultracart.com/api/)
|
|
13
13
|
|
|
@@ -16,7 +16,7 @@ This SDK is automatically generated by the [OpenAPI Generator](https://openapi-g
|
|
|
16
16
|
gemfile:
|
|
17
17
|
|
|
18
18
|
```shell
|
|
19
|
-
gem 'ultracart_api', '4.1.
|
|
19
|
+
gem 'ultracart_api', '4.1.28'
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
install:
|
|
@@ -339,6 +339,7 @@ Class | Method | HTTP request | Description
|
|
|
339
339
|
*UltracartClient::OauthApi* | [**oauth_access_token**](docs/OauthApi.md#oauth_access_token) | **POST** /oauth/token | Exchange authorization code for access token.
|
|
340
340
|
*UltracartClient::OauthApi* | [**oauth_revoke**](docs/OauthApi.md#oauth_revoke) | **POST** /oauth/revoke | Revoke this OAuth application.
|
|
341
341
|
*UltracartClient::OrderApi* | [**adjust_order_total**](docs/OrderApi.md#adjust_order_total) | **POST** /order/orders/{order_id}/adjust_order_total/{desired_total} | Adjusts an order total
|
|
342
|
+
*UltracartClient::OrderApi* | [**assign_to_affiliate**](docs/OrderApi.md#assign_to_affiliate) | **POST** /order/orders/{order_id}/assignToAffiliate | Assigns an order to an affiliate
|
|
342
343
|
*UltracartClient::OrderApi* | [**block_refund_on_order**](docs/OrderApi.md#block_refund_on_order) | **GET** /order/orders/{order_id}/refund_block | Set a refund block on an order
|
|
343
344
|
*UltracartClient::OrderApi* | [**cancel_order**](docs/OrderApi.md#cancel_order) | **POST** /order/orders/{order_id}/cancel | Cancel an order
|
|
344
345
|
*UltracartClient::OrderApi* | [**delete_order**](docs/OrderApi.md#delete_order) | **DELETE** /order/orders/{order_id} | Delete an order
|
|
@@ -1265,6 +1266,7 @@ Class | Method | HTTP request | Description
|
|
|
1265
1266
|
- [UltracartClient::Order](docs/Order.md)
|
|
1266
1267
|
- [UltracartClient::OrderAffiliate](docs/OrderAffiliate.md)
|
|
1267
1268
|
- [UltracartClient::OrderAffiliateLedger](docs/OrderAffiliateLedger.md)
|
|
1269
|
+
- [UltracartClient::OrderAssignToAffiliateRequest](docs/OrderAssignToAffiliateRequest.md)
|
|
1268
1270
|
- [UltracartClient::OrderAutoOrder](docs/OrderAutoOrder.md)
|
|
1269
1271
|
- [UltracartClient::OrderBilling](docs/OrderBilling.md)
|
|
1270
1272
|
- [UltracartClient::OrderBuysafe](docs/OrderBuysafe.md)
|
|
@@ -1587,6 +1589,7 @@ Not every change is committed to every SDK.
|
|
|
1587
1589
|
|
|
1588
1590
|
| Version | Date | Comments |
|
|
1589
1591
|
| --: | :-: | --- |
|
|
1592
|
+
| 4.1.28 | 11/07/2025 | OrderApi.assignToAffiliate |
|
|
1590
1593
|
| 4.1.27 | 11/06/2025 | conversation ai knowledge base changes |
|
|
1591
1594
|
| 4.1.26 | 10/20/2025 | conversation api bug fixes |
|
|
1592
1595
|
| 4.1.25 | 10/20/2025 | conversation api bug fix for bad url on agent profile kb upload |
|
data/docs/OrderApi.md
CHANGED
|
@@ -5,6 +5,7 @@ All URIs are relative to *https://secure.ultracart.com/rest/v2*
|
|
|
5
5
|
| Method | HTTP request | Description |
|
|
6
6
|
| ------ | ------------ | ----------- |
|
|
7
7
|
| [**adjust_order_total**](OrderApi.md#adjust_order_total) | **POST** /order/orders/{order_id}/adjust_order_total/{desired_total} | Adjusts an order total |
|
|
8
|
+
| [**assign_to_affiliate**](OrderApi.md#assign_to_affiliate) | **POST** /order/orders/{order_id}/assignToAffiliate | Assigns an order to an affiliate |
|
|
8
9
|
| [**block_refund_on_order**](OrderApi.md#block_refund_on_order) | **GET** /order/orders/{order_id}/refund_block | Set a refund block on an order |
|
|
9
10
|
| [**cancel_order**](OrderApi.md#cancel_order) | **POST** /order/orders/{order_id}/cancel | Cancel an order |
|
|
10
11
|
| [**delete_order**](OrderApi.md#delete_order) | **DELETE** /order/orders/{order_id} | Delete an order |
|
|
@@ -116,6 +117,61 @@ end
|
|
|
116
117
|
- **Accept**: application/json
|
|
117
118
|
|
|
118
119
|
|
|
120
|
+
## assign_to_affiliate
|
|
121
|
+
|
|
122
|
+
> <OrderResponse> assign_to_affiliate(order_id, assign_to_affiliate_request, opts)
|
|
123
|
+
|
|
124
|
+
Assigns an order to an affiliate
|
|
125
|
+
|
|
126
|
+
Assigns an order to an affiliate.
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
### Examples
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
(No example for this operation).
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
#### Using the assign_to_affiliate_with_http_info variant
|
|
136
|
+
|
|
137
|
+
This returns an Array which contains the response data, status code and headers.
|
|
138
|
+
|
|
139
|
+
> <Array(<OrderResponse>, Integer, Hash)> assign_to_affiliate_with_http_info(order_id, assign_to_affiliate_request, opts)
|
|
140
|
+
|
|
141
|
+
```ruby
|
|
142
|
+
begin
|
|
143
|
+
# Assigns an order to an affiliate
|
|
144
|
+
data, status_code, headers = api_instance.assign_to_affiliate_with_http_info(order_id, assign_to_affiliate_request, opts)
|
|
145
|
+
p status_code # => 2xx
|
|
146
|
+
p headers # => { ... }
|
|
147
|
+
p data # => <OrderResponse>
|
|
148
|
+
rescue UltracartClient::ApiError => e
|
|
149
|
+
puts "Error when calling OrderApi->assign_to_affiliate_with_http_info: #{e}"
|
|
150
|
+
end
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Parameters
|
|
154
|
+
|
|
155
|
+
| Name | Type | Description | Notes |
|
|
156
|
+
| ---- | ---- | ----------- | ----- |
|
|
157
|
+
| **order_id** | **String** | The order id to assign to the affiliate. | |
|
|
158
|
+
| **assign_to_affiliate_request** | [**OrderAssignToAffiliateRequest**](OrderAssignToAffiliateRequest.md) | Assign to affiliate request | |
|
|
159
|
+
| **_expand** | **String** | The object expansion to perform on the result. See documentation for examples | [optional] |
|
|
160
|
+
|
|
161
|
+
### Return type
|
|
162
|
+
|
|
163
|
+
[**OrderResponse**](OrderResponse.md)
|
|
164
|
+
|
|
165
|
+
### Authorization
|
|
166
|
+
|
|
167
|
+
[ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
|
168
|
+
|
|
169
|
+
### HTTP request headers
|
|
170
|
+
|
|
171
|
+
- **Content-Type**: application/json
|
|
172
|
+
- **Accept**: application/json
|
|
173
|
+
|
|
174
|
+
|
|
119
175
|
## block_refund_on_order
|
|
120
176
|
|
|
121
177
|
> block_refund_on_order(order_id, opts)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# UltracartClient::OrderAssignToAffiliateRequest
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **affiliate_email** | **String** | Affiliate email to associate with the order | [optional] |
|
|
8
|
+
| **affiliate_id** | **Integer** | Affiliate id to associate with the order | [optional] |
|
|
9
|
+
| **affiliate_sub_id** | **String** | Affiliate sub id to associate with the order | [optional] |
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
require 'ultracart_api'
|
|
15
|
+
|
|
16
|
+
instance = UltracartClient::OrderAssignToAffiliateRequest.new(
|
|
17
|
+
affiliate_email: null,
|
|
18
|
+
affiliate_id: null,
|
|
19
|
+
affiliate_sub_id: null
|
|
20
|
+
)
|
|
21
|
+
```
|
|
22
|
+
|
|
@@ -102,6 +102,84 @@ module UltracartClient
|
|
|
102
102
|
return data, status_code, headers
|
|
103
103
|
end
|
|
104
104
|
|
|
105
|
+
# Assigns an order to an affiliate
|
|
106
|
+
# Assigns an order to an affiliate.
|
|
107
|
+
# @param order_id [String] The order id to assign to the affiliate.
|
|
108
|
+
# @param assign_to_affiliate_request [OrderAssignToAffiliateRequest] Assign to affiliate request
|
|
109
|
+
# @param [Hash] opts the optional parameters
|
|
110
|
+
# @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples
|
|
111
|
+
# @return [OrderResponse]
|
|
112
|
+
def assign_to_affiliate(order_id, assign_to_affiliate_request, opts = {})
|
|
113
|
+
data, _status_code, _headers = assign_to_affiliate_with_http_info(order_id, assign_to_affiliate_request, opts)
|
|
114
|
+
data
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Assigns an order to an affiliate
|
|
118
|
+
# Assigns an order to an affiliate.
|
|
119
|
+
# @param order_id [String] The order id to assign to the affiliate.
|
|
120
|
+
# @param assign_to_affiliate_request [OrderAssignToAffiliateRequest] Assign to affiliate request
|
|
121
|
+
# @param [Hash] opts the optional parameters
|
|
122
|
+
# @option opts [String] :_expand The object expansion to perform on the result. See documentation for examples
|
|
123
|
+
# @return [Array<(OrderResponse, Integer, Hash)>] OrderResponse data, response status code and response headers
|
|
124
|
+
def assign_to_affiliate_with_http_info(order_id, assign_to_affiliate_request, opts = {})
|
|
125
|
+
if @api_client.config.debugging
|
|
126
|
+
@api_client.config.logger.debug 'Calling API: OrderApi.assign_to_affiliate ...'
|
|
127
|
+
end
|
|
128
|
+
# verify the required parameter 'order_id' is set
|
|
129
|
+
if @api_client.config.client_side_validation && order_id.nil?
|
|
130
|
+
fail ArgumentError, "Missing the required parameter 'order_id' when calling OrderApi.assign_to_affiliate"
|
|
131
|
+
end
|
|
132
|
+
# verify the required parameter 'assign_to_affiliate_request' is set
|
|
133
|
+
if @api_client.config.client_side_validation && assign_to_affiliate_request.nil?
|
|
134
|
+
fail ArgumentError, "Missing the required parameter 'assign_to_affiliate_request' when calling OrderApi.assign_to_affiliate"
|
|
135
|
+
end
|
|
136
|
+
# resource path
|
|
137
|
+
local_var_path = '/order/orders/{order_id}/assignToAffiliate'.sub('{' + 'order_id' + '}', CGI.escape(order_id.to_s))
|
|
138
|
+
|
|
139
|
+
# query parameters
|
|
140
|
+
query_params = opts[:query_params] || {}
|
|
141
|
+
query_params[:'_expand'] = opts[:'_expand'] if !opts[:'_expand'].nil?
|
|
142
|
+
|
|
143
|
+
# header parameters
|
|
144
|
+
header_params = opts[:header_params] || {}
|
|
145
|
+
header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
|
|
146
|
+
# HTTP header 'Accept' (if needed)
|
|
147
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
148
|
+
# HTTP header 'Content-Type'
|
|
149
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
150
|
+
if !content_type.nil?
|
|
151
|
+
header_params['Content-Type'] = content_type
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# form parameters
|
|
155
|
+
form_params = opts[:form_params] || {}
|
|
156
|
+
|
|
157
|
+
# http body (model)
|
|
158
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(assign_to_affiliate_request)
|
|
159
|
+
|
|
160
|
+
# return_type
|
|
161
|
+
return_type = opts[:debug_return_type] || 'OrderResponse'
|
|
162
|
+
|
|
163
|
+
# auth_names
|
|
164
|
+
auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
|
|
165
|
+
|
|
166
|
+
new_options = opts.merge(
|
|
167
|
+
:operation => :"OrderApi.assign_to_affiliate",
|
|
168
|
+
:header_params => header_params,
|
|
169
|
+
:query_params => query_params,
|
|
170
|
+
:form_params => form_params,
|
|
171
|
+
:body => post_body,
|
|
172
|
+
:auth_names => auth_names,
|
|
173
|
+
:return_type => return_type
|
|
174
|
+
)
|
|
175
|
+
|
|
176
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
177
|
+
if @api_client.config.debugging
|
|
178
|
+
@api_client.config.logger.debug "API called: OrderApi#assign_to_affiliate\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
179
|
+
end
|
|
180
|
+
return data, status_code, headers
|
|
181
|
+
end
|
|
182
|
+
|
|
105
183
|
# Set a refund block on an order
|
|
106
184
|
# Sets a refund block on an order to prevent a user from performing a refund. Commonly used when a chargeback has been received.
|
|
107
185
|
# @param order_id [String] The order id to block a refund on.
|
|
@@ -0,0 +1,255 @@
|
|
|
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 OrderAssignToAffiliateRequest
|
|
18
|
+
# Affiliate email to associate with the order
|
|
19
|
+
attr_accessor :affiliate_email
|
|
20
|
+
|
|
21
|
+
# Affiliate id to associate with the order
|
|
22
|
+
attr_accessor :affiliate_id
|
|
23
|
+
|
|
24
|
+
# Affiliate sub id to associate with the order
|
|
25
|
+
attr_accessor :affiliate_sub_id
|
|
26
|
+
|
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
28
|
+
def self.attribute_map
|
|
29
|
+
{
|
|
30
|
+
:'affiliate_email' => :'affiliate_email',
|
|
31
|
+
:'affiliate_id' => :'affiliate_id',
|
|
32
|
+
:'affiliate_sub_id' => :'affiliate_sub_id'
|
|
33
|
+
}
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Returns all the JSON keys this model knows about
|
|
37
|
+
def self.acceptable_attributes
|
|
38
|
+
attribute_map.values
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Attribute type mapping.
|
|
42
|
+
def self.openapi_types
|
|
43
|
+
{
|
|
44
|
+
:'affiliate_email' => :'String',
|
|
45
|
+
:'affiliate_id' => :'Integer',
|
|
46
|
+
:'affiliate_sub_id' => :'String'
|
|
47
|
+
}
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# List of attributes with nullable: true
|
|
51
|
+
def self.openapi_nullable
|
|
52
|
+
Set.new([
|
|
53
|
+
])
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Initializes the object
|
|
57
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
58
|
+
def initialize(attributes = {})
|
|
59
|
+
if (!attributes.is_a?(Hash))
|
|
60
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::OrderAssignToAffiliateRequest` initialize method"
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
64
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
65
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
66
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::OrderAssignToAffiliateRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
67
|
+
end
|
|
68
|
+
h[k.to_sym] = v
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if attributes.key?(:'affiliate_email')
|
|
72
|
+
self.affiliate_email = attributes[:'affiliate_email']
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
if attributes.key?(:'affiliate_id')
|
|
76
|
+
self.affiliate_id = attributes[:'affiliate_id']
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
if attributes.key?(:'affiliate_sub_id')
|
|
80
|
+
self.affiliate_sub_id = attributes[:'affiliate_sub_id']
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
85
|
+
# @return Array for valid properties with the reasons
|
|
86
|
+
def list_invalid_properties
|
|
87
|
+
invalid_properties = Array.new
|
|
88
|
+
if !@affiliate_sub_id.nil? && @affiliate_sub_id.to_s.length > 50
|
|
89
|
+
invalid_properties.push('invalid value for "affiliate_sub_id", the character length must be smaller than or equal to 50.')
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
invalid_properties
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Check to see if the all the properties in the model are valid
|
|
96
|
+
# @return true if the model is valid
|
|
97
|
+
def valid?
|
|
98
|
+
return false if !@affiliate_sub_id.nil? && @affiliate_sub_id.to_s.length > 50
|
|
99
|
+
true
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Custom attribute writer method with validation
|
|
103
|
+
# @param [Object] affiliate_sub_id Value to be assigned
|
|
104
|
+
def affiliate_sub_id=(affiliate_sub_id)
|
|
105
|
+
if !affiliate_sub_id.nil? && affiliate_sub_id.to_s.length > 50
|
|
106
|
+
fail ArgumentError, 'invalid value for "affiliate_sub_id", the character length must be smaller than or equal to 50.'
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
@affiliate_sub_id = affiliate_sub_id
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Checks equality by comparing each attribute.
|
|
113
|
+
# @param [Object] Object to be compared
|
|
114
|
+
def ==(o)
|
|
115
|
+
return true if self.equal?(o)
|
|
116
|
+
self.class == o.class &&
|
|
117
|
+
affiliate_email == o.affiliate_email &&
|
|
118
|
+
affiliate_id == o.affiliate_id &&
|
|
119
|
+
affiliate_sub_id == o.affiliate_sub_id
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# @see the `==` method
|
|
123
|
+
# @param [Object] Object to be compared
|
|
124
|
+
def eql?(o)
|
|
125
|
+
self == o
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Calculates hash code according to all attributes.
|
|
129
|
+
# @return [Integer] Hash code
|
|
130
|
+
def hash
|
|
131
|
+
[affiliate_email, affiliate_id, affiliate_sub_id].hash
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Builds the object from hash
|
|
135
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
136
|
+
# @return [Object] Returns the model itself
|
|
137
|
+
def self.build_from_hash(attributes)
|
|
138
|
+
new.build_from_hash(attributes)
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Builds the object from hash
|
|
142
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
143
|
+
# @return [Object] Returns the model itself
|
|
144
|
+
def build_from_hash(attributes)
|
|
145
|
+
return nil unless attributes.is_a?(Hash)
|
|
146
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
147
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
148
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
149
|
+
self.send("#{key}=", nil)
|
|
150
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
151
|
+
# check to ensure the input is an array given that the attribute
|
|
152
|
+
# is documented as an array but the input is not
|
|
153
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
154
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
155
|
+
end
|
|
156
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
157
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
self
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Deserializes the data based on type
|
|
165
|
+
# @param string type Data type
|
|
166
|
+
# @param string value Value to be deserialized
|
|
167
|
+
# @return [Object] Deserialized data
|
|
168
|
+
def _deserialize(type, value)
|
|
169
|
+
case type.to_sym
|
|
170
|
+
when :Time
|
|
171
|
+
Time.parse(value)
|
|
172
|
+
when :Date
|
|
173
|
+
Date.parse(value)
|
|
174
|
+
when :String
|
|
175
|
+
value.to_s
|
|
176
|
+
when :Integer
|
|
177
|
+
value.to_i
|
|
178
|
+
when :Float
|
|
179
|
+
value.to_f
|
|
180
|
+
when :Boolean
|
|
181
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
182
|
+
true
|
|
183
|
+
else
|
|
184
|
+
false
|
|
185
|
+
end
|
|
186
|
+
when :Object
|
|
187
|
+
# generic object (usually a Hash), return directly
|
|
188
|
+
value
|
|
189
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
190
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
191
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
192
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
193
|
+
k_type = Regexp.last_match[:k_type]
|
|
194
|
+
v_type = Regexp.last_match[:v_type]
|
|
195
|
+
{}.tap do |hash|
|
|
196
|
+
value.each do |k, v|
|
|
197
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
198
|
+
end
|
|
199
|
+
end
|
|
200
|
+
else # model
|
|
201
|
+
# models (e.g. Pet) or oneOf
|
|
202
|
+
klass = UltracartClient.const_get(type)
|
|
203
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
204
|
+
end
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
# Returns the string representation of the object
|
|
208
|
+
# @return [String] String presentation of the object
|
|
209
|
+
def to_s
|
|
210
|
+
to_hash.to_s
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
214
|
+
# @return [Hash] Returns the object in the form of hash
|
|
215
|
+
def to_body
|
|
216
|
+
to_hash
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
# Returns the object in the form of hash
|
|
220
|
+
# @return [Hash] Returns the object in the form of hash
|
|
221
|
+
def to_hash
|
|
222
|
+
hash = {}
|
|
223
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
224
|
+
value = self.send(attr)
|
|
225
|
+
if value.nil?
|
|
226
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
227
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
hash[param] = _to_hash(value)
|
|
231
|
+
end
|
|
232
|
+
hash
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
# Outputs non-array value in the form of hash
|
|
236
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
237
|
+
# @param [Object] value Any valid value
|
|
238
|
+
# @return [Hash] Returns the value in the form of hash
|
|
239
|
+
def _to_hash(value)
|
|
240
|
+
if value.is_a?(Array)
|
|
241
|
+
value.compact.map { |v| _to_hash(v) }
|
|
242
|
+
elsif value.is_a?(Hash)
|
|
243
|
+
{}.tap do |hash|
|
|
244
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
245
|
+
end
|
|
246
|
+
elsif value.respond_to? :to_hash
|
|
247
|
+
value.to_hash
|
|
248
|
+
else
|
|
249
|
+
value
|
|
250
|
+
end
|
|
251
|
+
end
|
|
252
|
+
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
end
|
data/lib/ultracart_api.rb
CHANGED
|
@@ -668,6 +668,7 @@ require 'ultracart_api/models/oauth_token_response'
|
|
|
668
668
|
require 'ultracart_api/models/order'
|
|
669
669
|
require 'ultracart_api/models/order_affiliate'
|
|
670
670
|
require 'ultracart_api/models/order_affiliate_ledger'
|
|
671
|
+
require 'ultracart_api/models/order_assign_to_affiliate_request'
|
|
671
672
|
require 'ultracart_api/models/order_auto_order'
|
|
672
673
|
require 'ultracart_api/models/order_billing'
|
|
673
674
|
require 'ultracart_api/models/order_buysafe'
|
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.1.
|
|
4
|
+
version: 4.1.28
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- UltraCart
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-11-
|
|
11
|
+
date: 2025-11-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: typhoeus
|
|
@@ -726,6 +726,7 @@ files:
|
|
|
726
726
|
- docs/OrderAffiliate.md
|
|
727
727
|
- docs/OrderAffiliateLedger.md
|
|
728
728
|
- docs/OrderApi.md
|
|
729
|
+
- docs/OrderAssignToAffiliateRequest.md
|
|
729
730
|
- docs/OrderAutoOrder.md
|
|
730
731
|
- docs/OrderBilling.md
|
|
731
732
|
- docs/OrderBuysafe.md
|
|
@@ -1655,6 +1656,7 @@ files:
|
|
|
1655
1656
|
- lib/ultracart_api/models/order.rb
|
|
1656
1657
|
- lib/ultracart_api/models/order_affiliate.rb
|
|
1657
1658
|
- lib/ultracart_api/models/order_affiliate_ledger.rb
|
|
1659
|
+
- lib/ultracart_api/models/order_assign_to_affiliate_request.rb
|
|
1658
1660
|
- lib/ultracart_api/models/order_auto_order.rb
|
|
1659
1661
|
- lib/ultracart_api/models/order_billing.rb
|
|
1660
1662
|
- lib/ultracart_api/models/order_buysafe.rb
|