ultracart_api 4.1.125 → 4.1.126
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/OauthApi.md +52 -0
- data/docs/OauthMeResponse.md +26 -0
- data/docs/OauthTokenResponse.md +2 -0
- data/lib/ultracart_api/api/oauth_api.rb +58 -0
- data/lib/ultracart_api/models/oauth_me_response.rb +262 -0
- data/lib/ultracart_api/models/oauth_token_response.rb +11 -1
- 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: f16d8b969f1eb1c7ccfe9baee0946bfb030fedc887212dc9cb776136b4bf85d5
|
|
4
|
+
data.tar.gz: 15f0b04548a750b0c2f9da148b06144b9e6fc972855173f7d72490edfe7dc68f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 360aa8d122c018e520d78b30122f6f3ca3ae0f28eaa3d671e77bccba8da9f039fd4bf716a324e35659c0ae432f9a383676873cea86431ccce3dfd244337b45bd
|
|
7
|
+
data.tar.gz: 419192f57240ea73cc700de7bd00dc28b5da64cbac54ab445cbed0807740a744673a51aefa54ccef9a40cf6cdecc62b242ece1060a8f28b4647e03cf259e7f6d
|
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.126
|
|
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.126'
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
install:
|
|
@@ -426,6 +426,7 @@ Class | Method | HTTP request | Description
|
|
|
426
426
|
*UltracartClient::ItemApi* | [**upload_temporary_multimedia**](docs/ItemApi.md#upload_temporary_multimedia) | **POST** /item/temp_multimedia | Upload an image to the temporary multimedia.
|
|
427
427
|
*UltracartClient::OauthApi* | [**oauth_access_token**](docs/OauthApi.md#oauth_access_token) | **POST** /oauth/token | Exchange authorization code for access token.
|
|
428
428
|
*UltracartClient::OauthApi* | [**oauth_device_authorize**](docs/OauthApi.md#oauth_device_authorize) | **POST** /oauth/device/authorize | Initiate a device authorization flow.
|
|
429
|
+
*UltracartClient::OauthApi* | [**oauth_me**](docs/OauthApi.md#oauth_me) | **GET** /oauth/me | Identify the merchant account this access token belongs to.
|
|
429
430
|
*UltracartClient::OauthApi* | [**oauth_revoke**](docs/OauthApi.md#oauth_revoke) | **POST** /oauth/revoke | Revoke this OAuth application.
|
|
430
431
|
*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
|
|
431
432
|
*UltracartClient::OrderApi* | [**assign_to_affiliate**](docs/OrderApi.md#assign_to_affiliate) | **POST** /order/orders/{order_id}/assignToAffiliate | Assigns an order to an affiliate
|
|
@@ -1489,6 +1490,7 @@ Class | Method | HTTP request | Description
|
|
|
1489
1490
|
- [UltracartClient::Metric](docs/Metric.md)
|
|
1490
1491
|
- [UltracartClient::Notification](docs/Notification.md)
|
|
1491
1492
|
- [UltracartClient::OauthDeviceAuthorizationResponse](docs/OauthDeviceAuthorizationResponse.md)
|
|
1493
|
+
- [UltracartClient::OauthMeResponse](docs/OauthMeResponse.md)
|
|
1492
1494
|
- [UltracartClient::OauthRevokeSuccessResponse](docs/OauthRevokeSuccessResponse.md)
|
|
1493
1495
|
- [UltracartClient::OauthTokenResponse](docs/OauthTokenResponse.md)
|
|
1494
1496
|
- [UltracartClient::Order](docs/Order.md)
|
|
@@ -1834,6 +1836,7 @@ Not every change is committed to every SDK.
|
|
|
1834
1836
|
|
|
1835
1837
|
| Version | Date | Comments |
|
|
1836
1838
|
| --: | :-: | --- |
|
|
1839
|
+
| 4.1.126 | 08/10/2026 | oauth - add /oauth/me method to assist application in indentifying the connected account |
|
|
1837
1840
|
| 4.1.125 | 08/06/2026 | order api - ability to query by bin and last 4 in unlimited scenarios for chargeback order association |
|
|
1838
1841
|
| 4.1.124 | 08/04/2026 | customer - method to remove customer profile from email suppression |
|
|
1839
1842
|
| 4.1.123 | 08/04/2026 | customer - method to remove customer profile from email suppression |
|
data/docs/OauthApi.md
CHANGED
|
@@ -6,6 +6,7 @@ All URIs are relative to *https://secure.ultracart.com/rest/v2*
|
|
|
6
6
|
| ------ | ------------ | ----------- |
|
|
7
7
|
| [**oauth_access_token**](OauthApi.md#oauth_access_token) | **POST** /oauth/token | Exchange authorization code for access token. |
|
|
8
8
|
| [**oauth_device_authorize**](OauthApi.md#oauth_device_authorize) | **POST** /oauth/device/authorize | Initiate a device authorization flow. |
|
|
9
|
+
| [**oauth_me**](OauthApi.md#oauth_me) | **GET** /oauth/me | Identify the merchant account this access token belongs to. |
|
|
9
10
|
| [**oauth_revoke**](OauthApi.md#oauth_revoke) | **POST** /oauth/revoke | Revoke this OAuth application. |
|
|
10
11
|
|
|
11
12
|
|
|
@@ -178,6 +179,57 @@ end
|
|
|
178
179
|
- **Accept**: application/json
|
|
179
180
|
|
|
180
181
|
|
|
182
|
+
## oauth_me
|
|
183
|
+
|
|
184
|
+
> oauth_me
|
|
185
|
+
|
|
186
|
+
Identify the merchant account this access token belongs to.
|
|
187
|
+
|
|
188
|
+
Returns the UltraCart merchant account that authorized your application, along with the permissions that were granted. Call it immediately after exchanging your authorization code so you can display the connected account to your user and map it within your own system. Any OAuth access token may call this endpoint regardless of the permissions it holds. The granted permissions are the ones the merchant approved, which may be narrower than the permissions your application currently requests, because permissions are recorded when the merchant authorizes and do not change afterwards. If you add a permission to your application, already connected merchants keep the permissions they originally approved until they authorize again, so read this list rather than assuming your application's configured permissions.
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
### Examples
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
(No example for this operation).
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
#### Using the oauth_me_with_http_info variant
|
|
198
|
+
|
|
199
|
+
This returns an Array which contains the response data (`nil` in this case), status code and headers.
|
|
200
|
+
|
|
201
|
+
> <Array(nil, Integer, Hash)> oauth_me_with_http_info
|
|
202
|
+
|
|
203
|
+
```ruby
|
|
204
|
+
begin
|
|
205
|
+
# Identify the merchant account this access token belongs to.
|
|
206
|
+
data, status_code, headers = api_instance.oauth_me_with_http_info
|
|
207
|
+
p status_code # => 2xx
|
|
208
|
+
p headers # => { ... }
|
|
209
|
+
p data # => nil
|
|
210
|
+
rescue UltracartClient::ApiError => e
|
|
211
|
+
puts "Error when calling OauthApi->oauth_me_with_http_info: #{e}"
|
|
212
|
+
end
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Parameters
|
|
216
|
+
|
|
217
|
+
This endpoint does not need any parameter.
|
|
218
|
+
|
|
219
|
+
### Return type
|
|
220
|
+
|
|
221
|
+
nil (empty response body)
|
|
222
|
+
|
|
223
|
+
### Authorization
|
|
224
|
+
|
|
225
|
+
[ultraCartOauth](../README.md#ultraCartOauth)
|
|
226
|
+
|
|
227
|
+
### HTTP request headers
|
|
228
|
+
|
|
229
|
+
- **Content-Type**: Not defined
|
|
230
|
+
- **Accept**: application/json
|
|
231
|
+
|
|
232
|
+
|
|
181
233
|
## oauth_revoke
|
|
182
234
|
|
|
183
235
|
> <OauthRevokeSuccessResponse> oauth_revoke(client_id, token)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# UltracartClient::OauthMeResponse
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **application_name** | **String** | The name of your application as the merchant approved it. | [optional] |
|
|
8
|
+
| **client_id** | **String** | Your application's client_id. Null when authenticating with a simple key, which is not tied to an application. | [optional] |
|
|
9
|
+
| **merchant_id** | **String** | The UltraCart merchant account that authorized your application. Stable, and the value to key your own records on. | [optional] |
|
|
10
|
+
| **merchant_name** | **String** | The account's company name, suitable for displaying to your user. The merchant can change this, so display it rather than storing it as an identifier. | [optional] |
|
|
11
|
+
| **scopes** | **Array<String>** | The permissions the merchant granted. May be narrower than the permissions your application currently requests. | [optional] |
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```ruby
|
|
16
|
+
require 'ultracart_api'
|
|
17
|
+
|
|
18
|
+
instance = UltracartClient::OauthMeResponse.new(
|
|
19
|
+
application_name: null,
|
|
20
|
+
client_id: null,
|
|
21
|
+
merchant_id: null,
|
|
22
|
+
merchant_name: null,
|
|
23
|
+
scopes: null
|
|
24
|
+
)
|
|
25
|
+
```
|
|
26
|
+
|
data/docs/OauthTokenResponse.md
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
| **error_description** | **String** | | [optional] |
|
|
10
10
|
| **error_uri** | **String** | | [optional] |
|
|
11
11
|
| **expires_in** | **String** | The number of seconds since issuance when the access token will expire and need to be refreshed using the refresh token | [optional] |
|
|
12
|
+
| **merchant_id** | **String** | The UltraCart merchant account that authorized this token. Use it to map the token to the merchant within your own system. Also returned by GET /oauth/me along with the account name. | [optional] |
|
|
12
13
|
| **refresh_token** | **String** | The refresh token that should be used to fetch a new access token when the expiration occurs | [optional] |
|
|
13
14
|
| **scope** | **String** | The scope of permissions associated with teh access token | [optional] |
|
|
14
15
|
| **token_type** | **String** | Type of token | [optional] |
|
|
@@ -24,6 +25,7 @@ instance = UltracartClient::OauthTokenResponse.new(
|
|
|
24
25
|
error_description: null,
|
|
25
26
|
error_uri: null,
|
|
26
27
|
expires_in: null,
|
|
28
|
+
merchant_id: null,
|
|
27
29
|
refresh_token: null,
|
|
28
30
|
scope: null,
|
|
29
31
|
token_type: null
|
|
@@ -198,6 +198,64 @@ module UltracartClient
|
|
|
198
198
|
return data, status_code, headers
|
|
199
199
|
end
|
|
200
200
|
|
|
201
|
+
# Identify the merchant account this access token belongs to.
|
|
202
|
+
# Returns the UltraCart merchant account that authorized your application, along with the permissions that were granted. Call it immediately after exchanging your authorization code so you can display the connected account to your user and map it within your own system. Any OAuth access token may call this endpoint regardless of the permissions it holds. The granted permissions are the ones the merchant approved, which may be narrower than the permissions your application currently requests, because permissions are recorded when the merchant authorizes and do not change afterwards. If you add a permission to your application, already connected merchants keep the permissions they originally approved until they authorize again, so read this list rather than assuming your application's configured permissions.
|
|
203
|
+
# @param [Hash] opts the optional parameters
|
|
204
|
+
# @return [nil]
|
|
205
|
+
def oauth_me(opts = {})
|
|
206
|
+
oauth_me_with_http_info(opts)
|
|
207
|
+
nil
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# Identify the merchant account this access token belongs to.
|
|
211
|
+
# Returns the UltraCart merchant account that authorized your application, along with the permissions that were granted. Call it immediately after exchanging your authorization code so you can display the connected account to your user and map it within your own system. Any OAuth access token may call this endpoint regardless of the permissions it holds. The granted permissions are the ones the merchant approved, which may be narrower than the permissions your application currently requests, because permissions are recorded when the merchant authorizes and do not change afterwards. If you add a permission to your application, already connected merchants keep the permissions they originally approved until they authorize again, so read this list rather than assuming your application's configured permissions.
|
|
212
|
+
# @param [Hash] opts the optional parameters
|
|
213
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
214
|
+
def oauth_me_with_http_info(opts = {})
|
|
215
|
+
if @api_client.config.debugging
|
|
216
|
+
@api_client.config.logger.debug 'Calling API: OauthApi.oauth_me ...'
|
|
217
|
+
end
|
|
218
|
+
# resource path
|
|
219
|
+
local_var_path = '/oauth/me'
|
|
220
|
+
|
|
221
|
+
# query parameters
|
|
222
|
+
query_params = opts[:query_params] || {}
|
|
223
|
+
|
|
224
|
+
# header parameters
|
|
225
|
+
header_params = opts[:header_params] || {}
|
|
226
|
+
header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
|
|
227
|
+
# HTTP header 'Accept' (if needed)
|
|
228
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
229
|
+
|
|
230
|
+
# form parameters
|
|
231
|
+
form_params = opts[:form_params] || {}
|
|
232
|
+
|
|
233
|
+
# http body (model)
|
|
234
|
+
post_body = opts[:debug_body]
|
|
235
|
+
|
|
236
|
+
# return_type
|
|
237
|
+
return_type = opts[:debug_return_type]
|
|
238
|
+
|
|
239
|
+
# auth_names
|
|
240
|
+
auth_names = opts[:debug_auth_names] || ['ultraCartOauth']
|
|
241
|
+
|
|
242
|
+
new_options = opts.merge(
|
|
243
|
+
:operation => :"OauthApi.oauth_me",
|
|
244
|
+
:header_params => header_params,
|
|
245
|
+
:query_params => query_params,
|
|
246
|
+
:form_params => form_params,
|
|
247
|
+
:body => post_body,
|
|
248
|
+
:auth_names => auth_names,
|
|
249
|
+
:return_type => return_type
|
|
250
|
+
)
|
|
251
|
+
|
|
252
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
253
|
+
if @api_client.config.debugging
|
|
254
|
+
@api_client.config.logger.debug "API called: OauthApi#oauth_me\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
255
|
+
end
|
|
256
|
+
return data, status_code, headers
|
|
257
|
+
end
|
|
258
|
+
|
|
201
259
|
# Revoke this OAuth application.
|
|
202
260
|
# Revokes the OAuth application associated with the specified client_id and token.
|
|
203
261
|
# @param client_id [String] The OAuth application client_id.
|
|
@@ -0,0 +1,262 @@
|
|
|
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 OauthMeResponse
|
|
18
|
+
# The name of your application as the merchant approved it.
|
|
19
|
+
attr_accessor :application_name
|
|
20
|
+
|
|
21
|
+
# Your application's client_id. Null when authenticating with a simple key, which is not tied to an application.
|
|
22
|
+
attr_accessor :client_id
|
|
23
|
+
|
|
24
|
+
# The UltraCart merchant account that authorized your application. Stable, and the value to key your own records on.
|
|
25
|
+
attr_accessor :merchant_id
|
|
26
|
+
|
|
27
|
+
# The account's company name, suitable for displaying to your user. The merchant can change this, so display it rather than storing it as an identifier.
|
|
28
|
+
attr_accessor :merchant_name
|
|
29
|
+
|
|
30
|
+
# The permissions the merchant granted. May be narrower than the permissions your application currently requests.
|
|
31
|
+
attr_accessor :scopes
|
|
32
|
+
|
|
33
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
34
|
+
def self.attribute_map
|
|
35
|
+
{
|
|
36
|
+
:'application_name' => :'application_name',
|
|
37
|
+
:'client_id' => :'client_id',
|
|
38
|
+
:'merchant_id' => :'merchant_id',
|
|
39
|
+
:'merchant_name' => :'merchant_name',
|
|
40
|
+
:'scopes' => :'scopes'
|
|
41
|
+
}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Returns all the JSON keys this model knows about
|
|
45
|
+
def self.acceptable_attributes
|
|
46
|
+
attribute_map.values
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Attribute type mapping.
|
|
50
|
+
def self.openapi_types
|
|
51
|
+
{
|
|
52
|
+
:'application_name' => :'String',
|
|
53
|
+
:'client_id' => :'String',
|
|
54
|
+
:'merchant_id' => :'String',
|
|
55
|
+
:'merchant_name' => :'String',
|
|
56
|
+
:'scopes' => :'Array<String>'
|
|
57
|
+
}
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# List of attributes with nullable: true
|
|
61
|
+
def self.openapi_nullable
|
|
62
|
+
Set.new([
|
|
63
|
+
])
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Initializes the object
|
|
67
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
68
|
+
def initialize(attributes = {})
|
|
69
|
+
if (!attributes.is_a?(Hash))
|
|
70
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::OauthMeResponse` initialize method"
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
74
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
75
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
76
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::OauthMeResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
77
|
+
end
|
|
78
|
+
h[k.to_sym] = v
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if attributes.key?(:'application_name')
|
|
82
|
+
self.application_name = attributes[:'application_name']
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
if attributes.key?(:'client_id')
|
|
86
|
+
self.client_id = attributes[:'client_id']
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
if attributes.key?(:'merchant_id')
|
|
90
|
+
self.merchant_id = attributes[:'merchant_id']
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
if attributes.key?(:'merchant_name')
|
|
94
|
+
self.merchant_name = attributes[:'merchant_name']
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
if attributes.key?(:'scopes')
|
|
98
|
+
if (value = attributes[:'scopes']).is_a?(Array)
|
|
99
|
+
self.scopes = value
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
105
|
+
# @return Array for valid properties with the reasons
|
|
106
|
+
def list_invalid_properties
|
|
107
|
+
invalid_properties = Array.new
|
|
108
|
+
invalid_properties
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Check to see if the all the properties in the model are valid
|
|
112
|
+
# @return true if the model is valid
|
|
113
|
+
def valid?
|
|
114
|
+
true
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Checks equality by comparing each attribute.
|
|
118
|
+
# @param [Object] Object to be compared
|
|
119
|
+
def ==(o)
|
|
120
|
+
return true if self.equal?(o)
|
|
121
|
+
self.class == o.class &&
|
|
122
|
+
application_name == o.application_name &&
|
|
123
|
+
client_id == o.client_id &&
|
|
124
|
+
merchant_id == o.merchant_id &&
|
|
125
|
+
merchant_name == o.merchant_name &&
|
|
126
|
+
scopes == o.scopes
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# @see the `==` method
|
|
130
|
+
# @param [Object] Object to be compared
|
|
131
|
+
def eql?(o)
|
|
132
|
+
self == o
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Calculates hash code according to all attributes.
|
|
136
|
+
# @return [Integer] Hash code
|
|
137
|
+
def hash
|
|
138
|
+
[application_name, client_id, merchant_id, merchant_name, scopes].hash
|
|
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 self.build_from_hash(attributes)
|
|
145
|
+
new.build_from_hash(attributes)
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# Builds the object from hash
|
|
149
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
150
|
+
# @return [Object] Returns the model itself
|
|
151
|
+
def build_from_hash(attributes)
|
|
152
|
+
return nil unless attributes.is_a?(Hash)
|
|
153
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
154
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
155
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
156
|
+
self.send("#{key}=", nil)
|
|
157
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
158
|
+
# check to ensure the input is an array given that the attribute
|
|
159
|
+
# is documented as an array but the input is not
|
|
160
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
161
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
162
|
+
end
|
|
163
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
164
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
165
|
+
end
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
self
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Deserializes the data based on type
|
|
172
|
+
# @param string type Data type
|
|
173
|
+
# @param string value Value to be deserialized
|
|
174
|
+
# @return [Object] Deserialized data
|
|
175
|
+
def _deserialize(type, value)
|
|
176
|
+
case type.to_sym
|
|
177
|
+
when :Time
|
|
178
|
+
Time.parse(value)
|
|
179
|
+
when :Date
|
|
180
|
+
Date.parse(value)
|
|
181
|
+
when :String
|
|
182
|
+
value.to_s
|
|
183
|
+
when :Integer
|
|
184
|
+
value.to_i
|
|
185
|
+
when :Float
|
|
186
|
+
value.to_f
|
|
187
|
+
when :Boolean
|
|
188
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
189
|
+
true
|
|
190
|
+
else
|
|
191
|
+
false
|
|
192
|
+
end
|
|
193
|
+
when :Object
|
|
194
|
+
# generic object (usually a Hash), return directly
|
|
195
|
+
value
|
|
196
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
197
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
198
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
199
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
200
|
+
k_type = Regexp.last_match[:k_type]
|
|
201
|
+
v_type = Regexp.last_match[:v_type]
|
|
202
|
+
{}.tap do |hash|
|
|
203
|
+
value.each do |k, v|
|
|
204
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
205
|
+
end
|
|
206
|
+
end
|
|
207
|
+
else # model
|
|
208
|
+
# models (e.g. Pet) or oneOf
|
|
209
|
+
klass = UltracartClient.const_get(type)
|
|
210
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
211
|
+
end
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
# Returns the string representation of the object
|
|
215
|
+
# @return [String] String presentation of the object
|
|
216
|
+
def to_s
|
|
217
|
+
to_hash.to_s
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
221
|
+
# @return [Hash] Returns the object in the form of hash
|
|
222
|
+
def to_body
|
|
223
|
+
to_hash
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
# Returns the object in the form of hash
|
|
227
|
+
# @return [Hash] Returns the object in the form of hash
|
|
228
|
+
def to_hash
|
|
229
|
+
hash = {}
|
|
230
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
231
|
+
value = self.send(attr)
|
|
232
|
+
if value.nil?
|
|
233
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
234
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
hash[param] = _to_hash(value)
|
|
238
|
+
end
|
|
239
|
+
hash
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
# Outputs non-array value in the form of hash
|
|
243
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
244
|
+
# @param [Object] value Any valid value
|
|
245
|
+
# @return [Hash] Returns the value in the form of hash
|
|
246
|
+
def _to_hash(value)
|
|
247
|
+
if value.is_a?(Array)
|
|
248
|
+
value.compact.map { |v| _to_hash(v) }
|
|
249
|
+
elsif value.is_a?(Hash)
|
|
250
|
+
{}.tap do |hash|
|
|
251
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
252
|
+
end
|
|
253
|
+
elsif value.respond_to? :to_hash
|
|
254
|
+
value.to_hash
|
|
255
|
+
else
|
|
256
|
+
value
|
|
257
|
+
end
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
end
|
|
@@ -27,6 +27,9 @@ module UltracartClient
|
|
|
27
27
|
# The number of seconds since issuance when the access token will expire and need to be refreshed using the refresh token
|
|
28
28
|
attr_accessor :expires_in
|
|
29
29
|
|
|
30
|
+
# The UltraCart merchant account that authorized this token. Use it to map the token to the merchant within your own system. Also returned by GET /oauth/me along with the account name.
|
|
31
|
+
attr_accessor :merchant_id
|
|
32
|
+
|
|
30
33
|
# The refresh token that should be used to fetch a new access token when the expiration occurs
|
|
31
34
|
attr_accessor :refresh_token
|
|
32
35
|
|
|
@@ -66,6 +69,7 @@ module UltracartClient
|
|
|
66
69
|
:'error_description' => :'error_description',
|
|
67
70
|
:'error_uri' => :'error_uri',
|
|
68
71
|
:'expires_in' => :'expires_in',
|
|
72
|
+
:'merchant_id' => :'merchant_id',
|
|
69
73
|
:'refresh_token' => :'refresh_token',
|
|
70
74
|
:'scope' => :'scope',
|
|
71
75
|
:'token_type' => :'token_type'
|
|
@@ -85,6 +89,7 @@ module UltracartClient
|
|
|
85
89
|
:'error_description' => :'String',
|
|
86
90
|
:'error_uri' => :'String',
|
|
87
91
|
:'expires_in' => :'String',
|
|
92
|
+
:'merchant_id' => :'String',
|
|
88
93
|
:'refresh_token' => :'String',
|
|
89
94
|
:'scope' => :'String',
|
|
90
95
|
:'token_type' => :'String'
|
|
@@ -132,6 +137,10 @@ module UltracartClient
|
|
|
132
137
|
self.expires_in = attributes[:'expires_in']
|
|
133
138
|
end
|
|
134
139
|
|
|
140
|
+
if attributes.key?(:'merchant_id')
|
|
141
|
+
self.merchant_id = attributes[:'merchant_id']
|
|
142
|
+
end
|
|
143
|
+
|
|
135
144
|
if attributes.key?(:'refresh_token')
|
|
136
145
|
self.refresh_token = attributes[:'refresh_token']
|
|
137
146
|
end
|
|
@@ -180,6 +189,7 @@ module UltracartClient
|
|
|
180
189
|
error_description == o.error_description &&
|
|
181
190
|
error_uri == o.error_uri &&
|
|
182
191
|
expires_in == o.expires_in &&
|
|
192
|
+
merchant_id == o.merchant_id &&
|
|
183
193
|
refresh_token == o.refresh_token &&
|
|
184
194
|
scope == o.scope &&
|
|
185
195
|
token_type == o.token_type
|
|
@@ -194,7 +204,7 @@ module UltracartClient
|
|
|
194
204
|
# Calculates hash code according to all attributes.
|
|
195
205
|
# @return [Integer] Hash code
|
|
196
206
|
def hash
|
|
197
|
-
[access_token, error, error_description, error_uri, expires_in, refresh_token, scope, token_type].hash
|
|
207
|
+
[access_token, error, error_description, error_uri, expires_in, merchant_id, refresh_token, scope, token_type].hash
|
|
198
208
|
end
|
|
199
209
|
|
|
200
210
|
# Builds the object from hash
|
data/lib/ultracart_api.rb
CHANGED
|
@@ -786,6 +786,7 @@ require 'ultracart_api/models/mailgun'
|
|
|
786
786
|
require 'ultracart_api/models/metric'
|
|
787
787
|
require 'ultracart_api/models/notification'
|
|
788
788
|
require 'ultracart_api/models/oauth_device_authorization_response'
|
|
789
|
+
require 'ultracart_api/models/oauth_me_response'
|
|
789
790
|
require 'ultracart_api/models/oauth_revoke_success_response'
|
|
790
791
|
require 'ultracart_api/models/oauth_token_response'
|
|
791
792
|
require 'ultracart_api/models/order'
|
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.126
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- UltraCart
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-08-
|
|
11
|
+
date: 2026-08-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: typhoeus
|
|
@@ -846,6 +846,7 @@ files:
|
|
|
846
846
|
- docs/Notification.md
|
|
847
847
|
- docs/OauthApi.md
|
|
848
848
|
- docs/OauthDeviceAuthorizationResponse.md
|
|
849
|
+
- docs/OauthMeResponse.md
|
|
849
850
|
- docs/OauthRevokeSuccessResponse.md
|
|
850
851
|
- docs/OauthTokenResponse.md
|
|
851
852
|
- docs/Order.md
|
|
@@ -1918,6 +1919,7 @@ files:
|
|
|
1918
1919
|
- lib/ultracart_api/models/metric.rb
|
|
1919
1920
|
- lib/ultracart_api/models/notification.rb
|
|
1920
1921
|
- lib/ultracart_api/models/oauth_device_authorization_response.rb
|
|
1922
|
+
- lib/ultracart_api/models/oauth_me_response.rb
|
|
1921
1923
|
- lib/ultracart_api/models/oauth_revoke_success_response.rb
|
|
1922
1924
|
- lib/ultracart_api/models/oauth_token_response.rb
|
|
1923
1925
|
- lib/ultracart_api/models/order.rb
|