ultracart_api 4.0.62.rc → 4.0.63.rc
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -4
- data/docs/EmailPostcardTracking.md +66 -0
- data/docs/EmailPostcardTrackingResponse.md +26 -0
- data/docs/StorefrontApi.md +72 -0
- data/lib/ultracart_api/api/storefront_api.rb +68 -0
- data/lib/ultracart_api/models/email_postcard_tracking.rb +439 -0
- data/lib/ultracart_api/models/email_postcard_tracking_response.rb +256 -0
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +2 -0
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15484cd481220bf96f131fc0acecfeee27a83afa20836d4804198613d206d67b
|
4
|
+
data.tar.gz: 8654390b05267c0e34e5dc43e9c9d49facfa49b5e298a88069a21a62e22cf462
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d7cf627cbbca6e6a3b35f08fbaf70701185d9883dff012f3a62d95fa2520b2d5a0e9bfaff8bf1d2800fbf0f6f192399e800694b1225e9a0234cca6ba0ed6a44
|
7
|
+
data.tar.gz: d27642bc84c9af9c1461615825fa390860755f513e69cf9640e43351780bc1d8671cbe94c269f51648c5deff54090ef5cb87efe156417c13edf0616f7250d92a
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@ UltraCart REST API Version 2
|
|
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.0.
|
10
|
+
- Package version: 4.0.63.rc
|
11
11
|
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
12
12
|
For more information, please visit [http://www.ultracart.com](http://www.ultracart.com)
|
13
13
|
|
@@ -24,16 +24,16 @@ gem build ultracart_api.gemspec
|
|
24
24
|
Then either install the gem locally:
|
25
25
|
|
26
26
|
```shell
|
27
|
-
gem install ./ultracart_api-4.0.
|
27
|
+
gem install ./ultracart_api-4.0.63.rc.gem
|
28
28
|
```
|
29
29
|
|
30
|
-
(for development, run `gem install --dev ./ultracart_api-4.0.
|
30
|
+
(for development, run `gem install --dev ./ultracart_api-4.0.63.rc.gem` to install the development dependencies)
|
31
31
|
|
32
32
|
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
33
33
|
|
34
34
|
Finally add this to the Gemfile:
|
35
35
|
|
36
|
-
gem 'ultracart_api', '~> 4.0.
|
36
|
+
gem 'ultracart_api', '~> 4.0.63.rc'
|
37
37
|
|
38
38
|
### Install from Git
|
39
39
|
|
@@ -275,6 +275,7 @@ Class | Method | HTTP request | Description
|
|
275
275
|
*UltracartClient::StorefrontApi* | [**get_email_commseq**](docs/StorefrontApi.md#get_email_commseq) | **GET** /storefront/{storefront_oid}/email/commseqs/{commseq_uuid} | Get email commseq
|
276
276
|
*UltracartClient::StorefrontApi* | [**get_email_commseq_email_stats**](docs/StorefrontApi.md#get_email_commseq_email_stats) | **POST** /storefront/{storefront_oid}/email/commseqs/{commseq_uuid}/emailStats | Get email communication sequence emails stats
|
277
277
|
*UltracartClient::StorefrontApi* | [**get_email_commseq_postcard_stats**](docs/StorefrontApi.md#get_email_commseq_postcard_stats) | **POST** /storefront/{storefront_oid}/email/commseqs/{commseq_uuid}/postcardStats | Get email communication sequence postcard stats
|
278
|
+
*UltracartClient::StorefrontApi* | [**get_email_commseq_postcard_tracking**](docs/StorefrontApi.md#get_email_commseq_postcard_tracking) | **GET** /storefront/{storefront_oid}/email/postcards/{commseq_postcard_uuid}/tracking | Get email communication postcard tracking
|
278
279
|
*UltracartClient::StorefrontApi* | [**get_email_commseq_stat_overall**](docs/StorefrontApi.md#get_email_commseq_stat_overall) | **GET** /storefront/{storefront_oid}/email/commseqs/{commseq_uuid}/stat | Get communication sequence stats overall
|
279
280
|
*UltracartClient::StorefrontApi* | [**get_email_commseq_step_stats**](docs/StorefrontApi.md#get_email_commseq_step_stats) | **POST** /storefront/{storefront_oid}/email/commseqs/{commseq_uuid}/stepStats | Get email communication sequence step stats
|
280
281
|
*UltracartClient::StorefrontApi* | [**get_email_commseq_step_waiting**](docs/StorefrontApi.md#get_email_commseq_step_waiting) | **POST** /storefront/{storefront_oid}/email/commseqs/{commseq_uuid}/waiting | Get email communication sequence customers waiting at each requested step
|
@@ -770,6 +771,8 @@ Class | Method | HTTP request | Description
|
|
770
771
|
- [UltracartClient::EmailPlanAdditional](docs/EmailPlanAdditional.md)
|
771
772
|
- [UltracartClient::EmailPlanResponse](docs/EmailPlanResponse.md)
|
772
773
|
- [UltracartClient::EmailPostcardStat](docs/EmailPostcardStat.md)
|
774
|
+
- [UltracartClient::EmailPostcardTracking](docs/EmailPostcardTracking.md)
|
775
|
+
- [UltracartClient::EmailPostcardTrackingResponse](docs/EmailPostcardTrackingResponse.md)
|
773
776
|
- [UltracartClient::EmailSegment](docs/EmailSegment.md)
|
774
777
|
- [UltracartClient::EmailSegmentArchiveResponse](docs/EmailSegmentArchiveResponse.md)
|
775
778
|
- [UltracartClient::EmailSegmentCustomer](docs/EmailSegmentCustomer.md)
|
@@ -1191,6 +1194,7 @@ Not every change is committed to every SDK.
|
|
1191
1194
|
|
1192
1195
|
| Version | Date | Comments |
|
1193
1196
|
| --: | :-: | --- |
|
1197
|
+
| 4.0.63-RC | 09/13/2022 | storefront comms - postcard tracking |
|
1194
1198
|
| 4.0.62-RC | 09/12/2022 | storefront comm - send back reviews.io configured flag on getEmailSettings |
|
1195
1199
|
| 4.0.61-RC | 09/07/2022 | sf comms - using aws event ruler for bigquery segmentation validation |
|
1196
1200
|
| 4.0.60-RC | 09/02/2022 | customer editor added loyal ledger descriptions |
|
@@ -0,0 +1,66 @@
|
|
1
|
+
# UltracartClient::EmailPostcardTracking
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **commseq_postcard_uuid** | **String** | | [optional] |
|
8
|
+
| **commseq_step_uuid** | **String** | | [optional] |
|
9
|
+
| **commseq_uuid** | **String** | | [optional] |
|
10
|
+
| **conversion_dts** | **String** | Conversion date time. | [optional] |
|
11
|
+
| **cost** | **Float** | | [optional] |
|
12
|
+
| **customer_uuid** | **String** | | [optional] |
|
13
|
+
| **delivered_dts** | **String** | Delivered date time. | [optional] |
|
14
|
+
| **from_address_line1** | **String** | | [optional] |
|
15
|
+
| **from_address_line2** | **String** | | [optional] |
|
16
|
+
| **from_city** | **String** | | [optional] |
|
17
|
+
| **from_name** | **String** | | [optional] |
|
18
|
+
| **from_state** | **String** | | [optional] |
|
19
|
+
| **from_zip** | **String** | | [optional] |
|
20
|
+
| **mailed_dts** | **String** | Mailed date time. | [optional] |
|
21
|
+
| **order_id** | **String** | | [optional] |
|
22
|
+
| **postcard_tracking_uuid** | **String** | | [optional] |
|
23
|
+
| **status** | **String** | | [optional] |
|
24
|
+
| **submit_dts** | **String** | Submit date time. | [optional] |
|
25
|
+
| **to_address_line1** | **String** | | [optional] |
|
26
|
+
| **to_address_line2** | **String** | | [optional] |
|
27
|
+
| **to_city** | **String** | | [optional] |
|
28
|
+
| **to_name** | **String** | | [optional] |
|
29
|
+
| **to_state** | **String** | | [optional] |
|
30
|
+
| **to_zip** | **String** | | [optional] |
|
31
|
+
| **tracking_description** | **String** | | [optional] |
|
32
|
+
|
33
|
+
## Example
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
require 'ultracart_api'
|
37
|
+
|
38
|
+
instance = UltracartClient::EmailPostcardTracking.new(
|
39
|
+
commseq_postcard_uuid: null,
|
40
|
+
commseq_step_uuid: null,
|
41
|
+
commseq_uuid: null,
|
42
|
+
conversion_dts: null,
|
43
|
+
cost: null,
|
44
|
+
customer_uuid: null,
|
45
|
+
delivered_dts: null,
|
46
|
+
from_address_line1: null,
|
47
|
+
from_address_line2: null,
|
48
|
+
from_city: null,
|
49
|
+
from_name: null,
|
50
|
+
from_state: null,
|
51
|
+
from_zip: null,
|
52
|
+
mailed_dts: null,
|
53
|
+
order_id: null,
|
54
|
+
postcard_tracking_uuid: null,
|
55
|
+
status: null,
|
56
|
+
submit_dts: null,
|
57
|
+
to_address_line1: null,
|
58
|
+
to_address_line2: null,
|
59
|
+
to_city: null,
|
60
|
+
to_name: null,
|
61
|
+
to_state: null,
|
62
|
+
to_zip: null,
|
63
|
+
tracking_description: null
|
64
|
+
)
|
65
|
+
```
|
66
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# UltracartClient::EmailPostcardTrackingResponse
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **error** | [**Error**](Error.md) | | [optional] |
|
8
|
+
| **metadata** | [**ResponseMetadata**](ResponseMetadata.md) | | [optional] |
|
9
|
+
| **success** | **Boolean** | Indicates if API call was successful | [optional] |
|
10
|
+
| **tracking** | [**EmailPostcardTracking**](EmailPostcardTracking.md) | | [optional] |
|
11
|
+
| **warning** | [**Warning**](Warning.md) | | [optional] |
|
12
|
+
|
13
|
+
## Example
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
require 'ultracart_api'
|
17
|
+
|
18
|
+
instance = UltracartClient::EmailPostcardTrackingResponse.new(
|
19
|
+
error: null,
|
20
|
+
metadata: null,
|
21
|
+
success: null,
|
22
|
+
tracking: null,
|
23
|
+
warning: null
|
24
|
+
)
|
25
|
+
```
|
26
|
+
|
data/docs/StorefrontApi.md
CHANGED
@@ -44,6 +44,7 @@ All URIs are relative to *https://secure.ultracart.com/rest/v2*
|
|
44
44
|
| [**get_email_commseq**](StorefrontApi.md#get_email_commseq) | **GET** /storefront/{storefront_oid}/email/commseqs/{commseq_uuid} | Get email commseq |
|
45
45
|
| [**get_email_commseq_email_stats**](StorefrontApi.md#get_email_commseq_email_stats) | **POST** /storefront/{storefront_oid}/email/commseqs/{commseq_uuid}/emailStats | Get email communication sequence emails stats |
|
46
46
|
| [**get_email_commseq_postcard_stats**](StorefrontApi.md#get_email_commseq_postcard_stats) | **POST** /storefront/{storefront_oid}/email/commseqs/{commseq_uuid}/postcardStats | Get email communication sequence postcard stats |
|
47
|
+
| [**get_email_commseq_postcard_tracking**](StorefrontApi.md#get_email_commseq_postcard_tracking) | **GET** /storefront/{storefront_oid}/email/postcards/{commseq_postcard_uuid}/tracking | Get email communication postcard tracking |
|
47
48
|
| [**get_email_commseq_stat_overall**](StorefrontApi.md#get_email_commseq_stat_overall) | **GET** /storefront/{storefront_oid}/email/commseqs/{commseq_uuid}/stat | Get communication sequence stats overall |
|
48
49
|
| [**get_email_commseq_step_stats**](StorefrontApi.md#get_email_commseq_step_stats) | **POST** /storefront/{storefront_oid}/email/commseqs/{commseq_uuid}/stepStats | Get email communication sequence step stats |
|
49
50
|
| [**get_email_commseq_step_waiting**](StorefrontApi.md#get_email_commseq_step_waiting) | **POST** /storefront/{storefront_oid}/email/commseqs/{commseq_uuid}/waiting | Get email communication sequence customers waiting at each requested step |
|
@@ -3000,6 +3001,77 @@ end
|
|
3000
3001
|
- **Accept**: application/json
|
3001
3002
|
|
3002
3003
|
|
3004
|
+
## get_email_commseq_postcard_tracking
|
3005
|
+
|
3006
|
+
> <EmailPostcardTrackingResponse> get_email_commseq_postcard_tracking(storefront_oid, commseq_postcard_uuid)
|
3007
|
+
|
3008
|
+
Get email communication postcard tracking
|
3009
|
+
|
3010
|
+
### Examples
|
3011
|
+
|
3012
|
+
```ruby
|
3013
|
+
require 'time'
|
3014
|
+
require 'ultracart_api'
|
3015
|
+
require 'json'
|
3016
|
+
require 'yaml'
|
3017
|
+
require_relative '../constants' # https://github.com/UltraCart/sdk_samples/blob/master/ruby/constants.rb
|
3018
|
+
|
3019
|
+
# This example is based on our samples_sdk project, but still contains auto-generated content from our sdk generators.
|
3020
|
+
# As such, this might not be the best way to use this object.
|
3021
|
+
# Please see https://github.com/UltraCart/sdk_samples for working examples.
|
3022
|
+
|
3023
|
+
api = UltracartClient::StorefrontApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
|
3024
|
+
storefront_oid = 56 # Integer |
|
3025
|
+
commseq_postcard_uuid = 'commseq_postcard_uuid_example' # String |
|
3026
|
+
|
3027
|
+
begin
|
3028
|
+
# Get email communication postcard tracking
|
3029
|
+
result = api_instance.get_email_commseq_postcard_tracking(storefront_oid, commseq_postcard_uuid)
|
3030
|
+
p result
|
3031
|
+
rescue UltracartClient::ApiError => e
|
3032
|
+
puts "Error when calling StorefrontApi->get_email_commseq_postcard_tracking: #{e}"
|
3033
|
+
end
|
3034
|
+
```
|
3035
|
+
|
3036
|
+
#### Using the get_email_commseq_postcard_tracking_with_http_info variant
|
3037
|
+
|
3038
|
+
This returns an Array which contains the response data, status code and headers.
|
3039
|
+
|
3040
|
+
> <Array(<EmailPostcardTrackingResponse>, Integer, Hash)> get_email_commseq_postcard_tracking_with_http_info(storefront_oid, commseq_postcard_uuid)
|
3041
|
+
|
3042
|
+
```ruby
|
3043
|
+
begin
|
3044
|
+
# Get email communication postcard tracking
|
3045
|
+
data, status_code, headers = api_instance.get_email_commseq_postcard_tracking_with_http_info(storefront_oid, commseq_postcard_uuid)
|
3046
|
+
p status_code # => 2xx
|
3047
|
+
p headers # => { ... }
|
3048
|
+
p data # => <EmailPostcardTrackingResponse>
|
3049
|
+
rescue UltracartClient::ApiError => e
|
3050
|
+
puts "Error when calling StorefrontApi->get_email_commseq_postcard_tracking_with_http_info: #{e}"
|
3051
|
+
end
|
3052
|
+
```
|
3053
|
+
|
3054
|
+
### Parameters
|
3055
|
+
|
3056
|
+
| Name | Type | Description | Notes |
|
3057
|
+
| ---- | ---- | ----------- | ----- |
|
3058
|
+
| **storefront_oid** | **Integer** | | |
|
3059
|
+
| **commseq_postcard_uuid** | **String** | | |
|
3060
|
+
|
3061
|
+
### Return type
|
3062
|
+
|
3063
|
+
[**EmailPostcardTrackingResponse**](EmailPostcardTrackingResponse.md)
|
3064
|
+
|
3065
|
+
### Authorization
|
3066
|
+
|
3067
|
+
[ultraCartBrowserApiKey](../README.md#ultraCartBrowserApiKey), [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
3068
|
+
|
3069
|
+
### HTTP request headers
|
3070
|
+
|
3071
|
+
- **Content-Type**: Not defined
|
3072
|
+
- **Accept**: application/json
|
3073
|
+
|
3074
|
+
|
3003
3075
|
## get_email_commseq_stat_overall
|
3004
3076
|
|
3005
3077
|
> <EmailCommseqStatResponse> get_email_commseq_stat_overall(storefront_oid, commseq_uuid)
|
@@ -2751,6 +2751,74 @@ module UltracartClient
|
|
2751
2751
|
return data, status_code, headers
|
2752
2752
|
end
|
2753
2753
|
|
2754
|
+
# Get email communication postcard tracking
|
2755
|
+
# @param storefront_oid [Integer]
|
2756
|
+
# @param commseq_postcard_uuid [String]
|
2757
|
+
# @param [Hash] opts the optional parameters
|
2758
|
+
# @return [EmailPostcardTrackingResponse]
|
2759
|
+
def get_email_commseq_postcard_tracking(storefront_oid, commseq_postcard_uuid, opts = {})
|
2760
|
+
data, _status_code, _headers = get_email_commseq_postcard_tracking_with_http_info(storefront_oid, commseq_postcard_uuid, opts)
|
2761
|
+
data
|
2762
|
+
end
|
2763
|
+
|
2764
|
+
# Get email communication postcard tracking
|
2765
|
+
# @param storefront_oid [Integer]
|
2766
|
+
# @param commseq_postcard_uuid [String]
|
2767
|
+
# @param [Hash] opts the optional parameters
|
2768
|
+
# @return [Array<(EmailPostcardTrackingResponse, Integer, Hash)>] EmailPostcardTrackingResponse data, response status code and response headers
|
2769
|
+
def get_email_commseq_postcard_tracking_with_http_info(storefront_oid, commseq_postcard_uuid, opts = {})
|
2770
|
+
if @api_client.config.debugging
|
2771
|
+
@api_client.config.logger.debug 'Calling API: StorefrontApi.get_email_commseq_postcard_tracking ...'
|
2772
|
+
end
|
2773
|
+
# verify the required parameter 'storefront_oid' is set
|
2774
|
+
if @api_client.config.client_side_validation && storefront_oid.nil?
|
2775
|
+
fail ArgumentError, "Missing the required parameter 'storefront_oid' when calling StorefrontApi.get_email_commseq_postcard_tracking"
|
2776
|
+
end
|
2777
|
+
# verify the required parameter 'commseq_postcard_uuid' is set
|
2778
|
+
if @api_client.config.client_side_validation && commseq_postcard_uuid.nil?
|
2779
|
+
fail ArgumentError, "Missing the required parameter 'commseq_postcard_uuid' when calling StorefrontApi.get_email_commseq_postcard_tracking"
|
2780
|
+
end
|
2781
|
+
# resource path
|
2782
|
+
local_var_path = '/storefront/{storefront_oid}/email/postcards/{commseq_postcard_uuid}/tracking'.sub('{' + 'storefront_oid' + '}', CGI.escape(storefront_oid.to_s)).sub('{' + 'commseq_postcard_uuid' + '}', CGI.escape(commseq_postcard_uuid.to_s))
|
2783
|
+
|
2784
|
+
# query parameters
|
2785
|
+
query_params = opts[:query_params] || {}
|
2786
|
+
|
2787
|
+
# header parameters
|
2788
|
+
header_params = opts[:header_params] || {}
|
2789
|
+
header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
|
2790
|
+
# HTTP header 'Accept' (if needed)
|
2791
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
2792
|
+
|
2793
|
+
# form parameters
|
2794
|
+
form_params = opts[:form_params] || {}
|
2795
|
+
|
2796
|
+
# http body (model)
|
2797
|
+
post_body = opts[:debug_body]
|
2798
|
+
|
2799
|
+
# return_type
|
2800
|
+
return_type = opts[:debug_return_type] || 'EmailPostcardTrackingResponse'
|
2801
|
+
|
2802
|
+
# auth_names
|
2803
|
+
auth_names = opts[:debug_auth_names] || ['ultraCartBrowserApiKey', 'ultraCartOauth', 'ultraCartSimpleApiKey']
|
2804
|
+
|
2805
|
+
new_options = opts.merge(
|
2806
|
+
:operation => :"StorefrontApi.get_email_commseq_postcard_tracking",
|
2807
|
+
:header_params => header_params,
|
2808
|
+
:query_params => query_params,
|
2809
|
+
:form_params => form_params,
|
2810
|
+
:body => post_body,
|
2811
|
+
:auth_names => auth_names,
|
2812
|
+
:return_type => return_type
|
2813
|
+
)
|
2814
|
+
|
2815
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
2816
|
+
if @api_client.config.debugging
|
2817
|
+
@api_client.config.logger.debug "API called: StorefrontApi#get_email_commseq_postcard_tracking\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
2818
|
+
end
|
2819
|
+
return data, status_code, headers
|
2820
|
+
end
|
2821
|
+
|
2754
2822
|
# Get communication sequence stats overall
|
2755
2823
|
# @param storefront_oid [Integer]
|
2756
2824
|
# @param commseq_uuid [String]
|
@@ -0,0 +1,439 @@
|
|
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 EmailPostcardTracking
|
18
|
+
attr_accessor :commseq_postcard_uuid
|
19
|
+
|
20
|
+
attr_accessor :commseq_step_uuid
|
21
|
+
|
22
|
+
attr_accessor :commseq_uuid
|
23
|
+
|
24
|
+
# Conversion date time.
|
25
|
+
attr_accessor :conversion_dts
|
26
|
+
|
27
|
+
attr_accessor :cost
|
28
|
+
|
29
|
+
attr_accessor :customer_uuid
|
30
|
+
|
31
|
+
# Delivered date time.
|
32
|
+
attr_accessor :delivered_dts
|
33
|
+
|
34
|
+
attr_accessor :from_address_line1
|
35
|
+
|
36
|
+
attr_accessor :from_address_line2
|
37
|
+
|
38
|
+
attr_accessor :from_city
|
39
|
+
|
40
|
+
attr_accessor :from_name
|
41
|
+
|
42
|
+
attr_accessor :from_state
|
43
|
+
|
44
|
+
attr_accessor :from_zip
|
45
|
+
|
46
|
+
# Mailed date time.
|
47
|
+
attr_accessor :mailed_dts
|
48
|
+
|
49
|
+
attr_accessor :order_id
|
50
|
+
|
51
|
+
attr_accessor :postcard_tracking_uuid
|
52
|
+
|
53
|
+
attr_accessor :status
|
54
|
+
|
55
|
+
# Submit date time.
|
56
|
+
attr_accessor :submit_dts
|
57
|
+
|
58
|
+
attr_accessor :to_address_line1
|
59
|
+
|
60
|
+
attr_accessor :to_address_line2
|
61
|
+
|
62
|
+
attr_accessor :to_city
|
63
|
+
|
64
|
+
attr_accessor :to_name
|
65
|
+
|
66
|
+
attr_accessor :to_state
|
67
|
+
|
68
|
+
attr_accessor :to_zip
|
69
|
+
|
70
|
+
attr_accessor :tracking_description
|
71
|
+
|
72
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
73
|
+
def self.attribute_map
|
74
|
+
{
|
75
|
+
:'commseq_postcard_uuid' => :'commseq_postcard_uuid',
|
76
|
+
:'commseq_step_uuid' => :'commseq_step_uuid',
|
77
|
+
:'commseq_uuid' => :'commseq_uuid',
|
78
|
+
:'conversion_dts' => :'conversion_dts',
|
79
|
+
:'cost' => :'cost',
|
80
|
+
:'customer_uuid' => :'customer_uuid',
|
81
|
+
:'delivered_dts' => :'delivered_dts',
|
82
|
+
:'from_address_line1' => :'from_address_line1',
|
83
|
+
:'from_address_line2' => :'from_address_line2',
|
84
|
+
:'from_city' => :'from_city',
|
85
|
+
:'from_name' => :'from_name',
|
86
|
+
:'from_state' => :'from_state',
|
87
|
+
:'from_zip' => :'from_zip',
|
88
|
+
:'mailed_dts' => :'mailed_dts',
|
89
|
+
:'order_id' => :'order_id',
|
90
|
+
:'postcard_tracking_uuid' => :'postcard_tracking_uuid',
|
91
|
+
:'status' => :'status',
|
92
|
+
:'submit_dts' => :'submit_dts',
|
93
|
+
:'to_address_line1' => :'to_address_line1',
|
94
|
+
:'to_address_line2' => :'to_address_line2',
|
95
|
+
:'to_city' => :'to_city',
|
96
|
+
:'to_name' => :'to_name',
|
97
|
+
:'to_state' => :'to_state',
|
98
|
+
:'to_zip' => :'to_zip',
|
99
|
+
:'tracking_description' => :'tracking_description'
|
100
|
+
}
|
101
|
+
end
|
102
|
+
|
103
|
+
# Returns all the JSON keys this model knows about
|
104
|
+
def self.acceptable_attributes
|
105
|
+
attribute_map.values
|
106
|
+
end
|
107
|
+
|
108
|
+
# Attribute type mapping.
|
109
|
+
def self.openapi_types
|
110
|
+
{
|
111
|
+
:'commseq_postcard_uuid' => :'String',
|
112
|
+
:'commseq_step_uuid' => :'String',
|
113
|
+
:'commseq_uuid' => :'String',
|
114
|
+
:'conversion_dts' => :'String',
|
115
|
+
:'cost' => :'Float',
|
116
|
+
:'customer_uuid' => :'String',
|
117
|
+
:'delivered_dts' => :'String',
|
118
|
+
:'from_address_line1' => :'String',
|
119
|
+
:'from_address_line2' => :'String',
|
120
|
+
:'from_city' => :'String',
|
121
|
+
:'from_name' => :'String',
|
122
|
+
:'from_state' => :'String',
|
123
|
+
:'from_zip' => :'String',
|
124
|
+
:'mailed_dts' => :'String',
|
125
|
+
:'order_id' => :'String',
|
126
|
+
:'postcard_tracking_uuid' => :'String',
|
127
|
+
:'status' => :'String',
|
128
|
+
:'submit_dts' => :'String',
|
129
|
+
:'to_address_line1' => :'String',
|
130
|
+
:'to_address_line2' => :'String',
|
131
|
+
:'to_city' => :'String',
|
132
|
+
:'to_name' => :'String',
|
133
|
+
:'to_state' => :'String',
|
134
|
+
:'to_zip' => :'String',
|
135
|
+
:'tracking_description' => :'String'
|
136
|
+
}
|
137
|
+
end
|
138
|
+
|
139
|
+
# List of attributes with nullable: true
|
140
|
+
def self.openapi_nullable
|
141
|
+
Set.new([
|
142
|
+
])
|
143
|
+
end
|
144
|
+
|
145
|
+
# Initializes the object
|
146
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
147
|
+
def initialize(attributes = {})
|
148
|
+
if (!attributes.is_a?(Hash))
|
149
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::EmailPostcardTracking` initialize method"
|
150
|
+
end
|
151
|
+
|
152
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
153
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
154
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
155
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::EmailPostcardTracking`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
156
|
+
end
|
157
|
+
h[k.to_sym] = v
|
158
|
+
}
|
159
|
+
|
160
|
+
if attributes.key?(:'commseq_postcard_uuid')
|
161
|
+
self.commseq_postcard_uuid = attributes[:'commseq_postcard_uuid']
|
162
|
+
end
|
163
|
+
|
164
|
+
if attributes.key?(:'commseq_step_uuid')
|
165
|
+
self.commseq_step_uuid = attributes[:'commseq_step_uuid']
|
166
|
+
end
|
167
|
+
|
168
|
+
if attributes.key?(:'commseq_uuid')
|
169
|
+
self.commseq_uuid = attributes[:'commseq_uuid']
|
170
|
+
end
|
171
|
+
|
172
|
+
if attributes.key?(:'conversion_dts')
|
173
|
+
self.conversion_dts = attributes[:'conversion_dts']
|
174
|
+
end
|
175
|
+
|
176
|
+
if attributes.key?(:'cost')
|
177
|
+
self.cost = attributes[:'cost']
|
178
|
+
end
|
179
|
+
|
180
|
+
if attributes.key?(:'customer_uuid')
|
181
|
+
self.customer_uuid = attributes[:'customer_uuid']
|
182
|
+
end
|
183
|
+
|
184
|
+
if attributes.key?(:'delivered_dts')
|
185
|
+
self.delivered_dts = attributes[:'delivered_dts']
|
186
|
+
end
|
187
|
+
|
188
|
+
if attributes.key?(:'from_address_line1')
|
189
|
+
self.from_address_line1 = attributes[:'from_address_line1']
|
190
|
+
end
|
191
|
+
|
192
|
+
if attributes.key?(:'from_address_line2')
|
193
|
+
self.from_address_line2 = attributes[:'from_address_line2']
|
194
|
+
end
|
195
|
+
|
196
|
+
if attributes.key?(:'from_city')
|
197
|
+
self.from_city = attributes[:'from_city']
|
198
|
+
end
|
199
|
+
|
200
|
+
if attributes.key?(:'from_name')
|
201
|
+
self.from_name = attributes[:'from_name']
|
202
|
+
end
|
203
|
+
|
204
|
+
if attributes.key?(:'from_state')
|
205
|
+
self.from_state = attributes[:'from_state']
|
206
|
+
end
|
207
|
+
|
208
|
+
if attributes.key?(:'from_zip')
|
209
|
+
self.from_zip = attributes[:'from_zip']
|
210
|
+
end
|
211
|
+
|
212
|
+
if attributes.key?(:'mailed_dts')
|
213
|
+
self.mailed_dts = attributes[:'mailed_dts']
|
214
|
+
end
|
215
|
+
|
216
|
+
if attributes.key?(:'order_id')
|
217
|
+
self.order_id = attributes[:'order_id']
|
218
|
+
end
|
219
|
+
|
220
|
+
if attributes.key?(:'postcard_tracking_uuid')
|
221
|
+
self.postcard_tracking_uuid = attributes[:'postcard_tracking_uuid']
|
222
|
+
end
|
223
|
+
|
224
|
+
if attributes.key?(:'status')
|
225
|
+
self.status = attributes[:'status']
|
226
|
+
end
|
227
|
+
|
228
|
+
if attributes.key?(:'submit_dts')
|
229
|
+
self.submit_dts = attributes[:'submit_dts']
|
230
|
+
end
|
231
|
+
|
232
|
+
if attributes.key?(:'to_address_line1')
|
233
|
+
self.to_address_line1 = attributes[:'to_address_line1']
|
234
|
+
end
|
235
|
+
|
236
|
+
if attributes.key?(:'to_address_line2')
|
237
|
+
self.to_address_line2 = attributes[:'to_address_line2']
|
238
|
+
end
|
239
|
+
|
240
|
+
if attributes.key?(:'to_city')
|
241
|
+
self.to_city = attributes[:'to_city']
|
242
|
+
end
|
243
|
+
|
244
|
+
if attributes.key?(:'to_name')
|
245
|
+
self.to_name = attributes[:'to_name']
|
246
|
+
end
|
247
|
+
|
248
|
+
if attributes.key?(:'to_state')
|
249
|
+
self.to_state = attributes[:'to_state']
|
250
|
+
end
|
251
|
+
|
252
|
+
if attributes.key?(:'to_zip')
|
253
|
+
self.to_zip = attributes[:'to_zip']
|
254
|
+
end
|
255
|
+
|
256
|
+
if attributes.key?(:'tracking_description')
|
257
|
+
self.tracking_description = attributes[:'tracking_description']
|
258
|
+
end
|
259
|
+
end
|
260
|
+
|
261
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
262
|
+
# @return Array for valid properties with the reasons
|
263
|
+
def list_invalid_properties
|
264
|
+
invalid_properties = Array.new
|
265
|
+
invalid_properties
|
266
|
+
end
|
267
|
+
|
268
|
+
# Check to see if the all the properties in the model are valid
|
269
|
+
# @return true if the model is valid
|
270
|
+
def valid?
|
271
|
+
true
|
272
|
+
end
|
273
|
+
|
274
|
+
# Checks equality by comparing each attribute.
|
275
|
+
# @param [Object] Object to be compared
|
276
|
+
def ==(o)
|
277
|
+
return true if self.equal?(o)
|
278
|
+
self.class == o.class &&
|
279
|
+
commseq_postcard_uuid == o.commseq_postcard_uuid &&
|
280
|
+
commseq_step_uuid == o.commseq_step_uuid &&
|
281
|
+
commseq_uuid == o.commseq_uuid &&
|
282
|
+
conversion_dts == o.conversion_dts &&
|
283
|
+
cost == o.cost &&
|
284
|
+
customer_uuid == o.customer_uuid &&
|
285
|
+
delivered_dts == o.delivered_dts &&
|
286
|
+
from_address_line1 == o.from_address_line1 &&
|
287
|
+
from_address_line2 == o.from_address_line2 &&
|
288
|
+
from_city == o.from_city &&
|
289
|
+
from_name == o.from_name &&
|
290
|
+
from_state == o.from_state &&
|
291
|
+
from_zip == o.from_zip &&
|
292
|
+
mailed_dts == o.mailed_dts &&
|
293
|
+
order_id == o.order_id &&
|
294
|
+
postcard_tracking_uuid == o.postcard_tracking_uuid &&
|
295
|
+
status == o.status &&
|
296
|
+
submit_dts == o.submit_dts &&
|
297
|
+
to_address_line1 == o.to_address_line1 &&
|
298
|
+
to_address_line2 == o.to_address_line2 &&
|
299
|
+
to_city == o.to_city &&
|
300
|
+
to_name == o.to_name &&
|
301
|
+
to_state == o.to_state &&
|
302
|
+
to_zip == o.to_zip &&
|
303
|
+
tracking_description == o.tracking_description
|
304
|
+
end
|
305
|
+
|
306
|
+
# @see the `==` method
|
307
|
+
# @param [Object] Object to be compared
|
308
|
+
def eql?(o)
|
309
|
+
self == o
|
310
|
+
end
|
311
|
+
|
312
|
+
# Calculates hash code according to all attributes.
|
313
|
+
# @return [Integer] Hash code
|
314
|
+
def hash
|
315
|
+
[commseq_postcard_uuid, commseq_step_uuid, commseq_uuid, conversion_dts, cost, customer_uuid, delivered_dts, from_address_line1, from_address_line2, from_city, from_name, from_state, from_zip, mailed_dts, order_id, postcard_tracking_uuid, status, submit_dts, to_address_line1, to_address_line2, to_city, to_name, to_state, to_zip, tracking_description].hash
|
316
|
+
end
|
317
|
+
|
318
|
+
# Builds the object from hash
|
319
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
320
|
+
# @return [Object] Returns the model itself
|
321
|
+
def self.build_from_hash(attributes)
|
322
|
+
new.build_from_hash(attributes)
|
323
|
+
end
|
324
|
+
|
325
|
+
# Builds the object from hash
|
326
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
327
|
+
# @return [Object] Returns the model itself
|
328
|
+
def build_from_hash(attributes)
|
329
|
+
return nil unless attributes.is_a?(Hash)
|
330
|
+
attributes = attributes.transform_keys(&:to_sym)
|
331
|
+
self.class.openapi_types.each_pair do |key, type|
|
332
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
333
|
+
self.send("#{key}=", nil)
|
334
|
+
elsif type =~ /\AArray<(.*)>/i
|
335
|
+
# check to ensure the input is an array given that the attribute
|
336
|
+
# is documented as an array but the input is not
|
337
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
338
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
339
|
+
end
|
340
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
341
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
342
|
+
end
|
343
|
+
end
|
344
|
+
|
345
|
+
self
|
346
|
+
end
|
347
|
+
|
348
|
+
# Deserializes the data based on type
|
349
|
+
# @param string type Data type
|
350
|
+
# @param string value Value to be deserialized
|
351
|
+
# @return [Object] Deserialized data
|
352
|
+
def _deserialize(type, value)
|
353
|
+
case type.to_sym
|
354
|
+
when :Time
|
355
|
+
Time.parse(value)
|
356
|
+
when :Date
|
357
|
+
Date.parse(value)
|
358
|
+
when :String
|
359
|
+
value.to_s
|
360
|
+
when :Integer
|
361
|
+
value.to_i
|
362
|
+
when :Float
|
363
|
+
value.to_f
|
364
|
+
when :Boolean
|
365
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
366
|
+
true
|
367
|
+
else
|
368
|
+
false
|
369
|
+
end
|
370
|
+
when :Object
|
371
|
+
# generic object (usually a Hash), return directly
|
372
|
+
value
|
373
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
374
|
+
inner_type = Regexp.last_match[:inner_type]
|
375
|
+
value.map { |v| _deserialize(inner_type, v) }
|
376
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
377
|
+
k_type = Regexp.last_match[:k_type]
|
378
|
+
v_type = Regexp.last_match[:v_type]
|
379
|
+
{}.tap do |hash|
|
380
|
+
value.each do |k, v|
|
381
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
382
|
+
end
|
383
|
+
end
|
384
|
+
else # model
|
385
|
+
# models (e.g. Pet) or oneOf
|
386
|
+
klass = UltracartClient.const_get(type)
|
387
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
388
|
+
end
|
389
|
+
end
|
390
|
+
|
391
|
+
# Returns the string representation of the object
|
392
|
+
# @return [String] String presentation of the object
|
393
|
+
def to_s
|
394
|
+
to_hash.to_s
|
395
|
+
end
|
396
|
+
|
397
|
+
# to_body is an alias to to_hash (backward compatibility)
|
398
|
+
# @return [Hash] Returns the object in the form of hash
|
399
|
+
def to_body
|
400
|
+
to_hash
|
401
|
+
end
|
402
|
+
|
403
|
+
# Returns the object in the form of hash
|
404
|
+
# @return [Hash] Returns the object in the form of hash
|
405
|
+
def to_hash
|
406
|
+
hash = {}
|
407
|
+
self.class.attribute_map.each_pair do |attr, param|
|
408
|
+
value = self.send(attr)
|
409
|
+
if value.nil?
|
410
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
411
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
412
|
+
end
|
413
|
+
|
414
|
+
hash[param] = _to_hash(value)
|
415
|
+
end
|
416
|
+
hash
|
417
|
+
end
|
418
|
+
|
419
|
+
# Outputs non-array value in the form of hash
|
420
|
+
# For object, use to_hash. Otherwise, just return the value
|
421
|
+
# @param [Object] value Any valid value
|
422
|
+
# @return [Hash] Returns the value in the form of hash
|
423
|
+
def _to_hash(value)
|
424
|
+
if value.is_a?(Array)
|
425
|
+
value.compact.map { |v| _to_hash(v) }
|
426
|
+
elsif value.is_a?(Hash)
|
427
|
+
{}.tap do |hash|
|
428
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
429
|
+
end
|
430
|
+
elsif value.respond_to? :to_hash
|
431
|
+
value.to_hash
|
432
|
+
else
|
433
|
+
value
|
434
|
+
end
|
435
|
+
end
|
436
|
+
|
437
|
+
end
|
438
|
+
|
439
|
+
end
|
@@ -0,0 +1,256 @@
|
|
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 EmailPostcardTrackingResponse
|
18
|
+
attr_accessor :error
|
19
|
+
|
20
|
+
attr_accessor :metadata
|
21
|
+
|
22
|
+
# Indicates if API call was successful
|
23
|
+
attr_accessor :success
|
24
|
+
|
25
|
+
attr_accessor :tracking
|
26
|
+
|
27
|
+
attr_accessor :warning
|
28
|
+
|
29
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
30
|
+
def self.attribute_map
|
31
|
+
{
|
32
|
+
:'error' => :'error',
|
33
|
+
:'metadata' => :'metadata',
|
34
|
+
:'success' => :'success',
|
35
|
+
:'tracking' => :'tracking',
|
36
|
+
:'warning' => :'warning'
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# Returns all the JSON keys this model knows about
|
41
|
+
def self.acceptable_attributes
|
42
|
+
attribute_map.values
|
43
|
+
end
|
44
|
+
|
45
|
+
# Attribute type mapping.
|
46
|
+
def self.openapi_types
|
47
|
+
{
|
48
|
+
:'error' => :'Error',
|
49
|
+
:'metadata' => :'ResponseMetadata',
|
50
|
+
:'success' => :'Boolean',
|
51
|
+
:'tracking' => :'EmailPostcardTracking',
|
52
|
+
:'warning' => :'Warning'
|
53
|
+
}
|
54
|
+
end
|
55
|
+
|
56
|
+
# List of attributes with nullable: true
|
57
|
+
def self.openapi_nullable
|
58
|
+
Set.new([
|
59
|
+
])
|
60
|
+
end
|
61
|
+
|
62
|
+
# Initializes the object
|
63
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
64
|
+
def initialize(attributes = {})
|
65
|
+
if (!attributes.is_a?(Hash))
|
66
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::EmailPostcardTrackingResponse` initialize method"
|
67
|
+
end
|
68
|
+
|
69
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
70
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
71
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
72
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::EmailPostcardTrackingResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
73
|
+
end
|
74
|
+
h[k.to_sym] = v
|
75
|
+
}
|
76
|
+
|
77
|
+
if attributes.key?(:'error')
|
78
|
+
self.error = attributes[:'error']
|
79
|
+
end
|
80
|
+
|
81
|
+
if attributes.key?(:'metadata')
|
82
|
+
self.metadata = attributes[:'metadata']
|
83
|
+
end
|
84
|
+
|
85
|
+
if attributes.key?(:'success')
|
86
|
+
self.success = attributes[:'success']
|
87
|
+
end
|
88
|
+
|
89
|
+
if attributes.key?(:'tracking')
|
90
|
+
self.tracking = attributes[:'tracking']
|
91
|
+
end
|
92
|
+
|
93
|
+
if attributes.key?(:'warning')
|
94
|
+
self.warning = attributes[:'warning']
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
99
|
+
# @return Array for valid properties with the reasons
|
100
|
+
def list_invalid_properties
|
101
|
+
invalid_properties = Array.new
|
102
|
+
invalid_properties
|
103
|
+
end
|
104
|
+
|
105
|
+
# Check to see if the all the properties in the model are valid
|
106
|
+
# @return true if the model is valid
|
107
|
+
def valid?
|
108
|
+
true
|
109
|
+
end
|
110
|
+
|
111
|
+
# Checks equality by comparing each attribute.
|
112
|
+
# @param [Object] Object to be compared
|
113
|
+
def ==(o)
|
114
|
+
return true if self.equal?(o)
|
115
|
+
self.class == o.class &&
|
116
|
+
error == o.error &&
|
117
|
+
metadata == o.metadata &&
|
118
|
+
success == o.success &&
|
119
|
+
tracking == o.tracking &&
|
120
|
+
warning == o.warning
|
121
|
+
end
|
122
|
+
|
123
|
+
# @see the `==` method
|
124
|
+
# @param [Object] Object to be compared
|
125
|
+
def eql?(o)
|
126
|
+
self == o
|
127
|
+
end
|
128
|
+
|
129
|
+
# Calculates hash code according to all attributes.
|
130
|
+
# @return [Integer] Hash code
|
131
|
+
def hash
|
132
|
+
[error, metadata, success, tracking, warning].hash
|
133
|
+
end
|
134
|
+
|
135
|
+
# Builds the object from hash
|
136
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
137
|
+
# @return [Object] Returns the model itself
|
138
|
+
def self.build_from_hash(attributes)
|
139
|
+
new.build_from_hash(attributes)
|
140
|
+
end
|
141
|
+
|
142
|
+
# Builds the object from hash
|
143
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
144
|
+
# @return [Object] Returns the model itself
|
145
|
+
def build_from_hash(attributes)
|
146
|
+
return nil unless attributes.is_a?(Hash)
|
147
|
+
attributes = attributes.transform_keys(&:to_sym)
|
148
|
+
self.class.openapi_types.each_pair do |key, type|
|
149
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
150
|
+
self.send("#{key}=", nil)
|
151
|
+
elsif type =~ /\AArray<(.*)>/i
|
152
|
+
# check to ensure the input is an array given that the attribute
|
153
|
+
# is documented as an array but the input is not
|
154
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
155
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
156
|
+
end
|
157
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
158
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
self
|
163
|
+
end
|
164
|
+
|
165
|
+
# Deserializes the data based on type
|
166
|
+
# @param string type Data type
|
167
|
+
# @param string value Value to be deserialized
|
168
|
+
# @return [Object] Deserialized data
|
169
|
+
def _deserialize(type, value)
|
170
|
+
case type.to_sym
|
171
|
+
when :Time
|
172
|
+
Time.parse(value)
|
173
|
+
when :Date
|
174
|
+
Date.parse(value)
|
175
|
+
when :String
|
176
|
+
value.to_s
|
177
|
+
when :Integer
|
178
|
+
value.to_i
|
179
|
+
when :Float
|
180
|
+
value.to_f
|
181
|
+
when :Boolean
|
182
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
183
|
+
true
|
184
|
+
else
|
185
|
+
false
|
186
|
+
end
|
187
|
+
when :Object
|
188
|
+
# generic object (usually a Hash), return directly
|
189
|
+
value
|
190
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
191
|
+
inner_type = Regexp.last_match[:inner_type]
|
192
|
+
value.map { |v| _deserialize(inner_type, v) }
|
193
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
194
|
+
k_type = Regexp.last_match[:k_type]
|
195
|
+
v_type = Regexp.last_match[:v_type]
|
196
|
+
{}.tap do |hash|
|
197
|
+
value.each do |k, v|
|
198
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
199
|
+
end
|
200
|
+
end
|
201
|
+
else # model
|
202
|
+
# models (e.g. Pet) or oneOf
|
203
|
+
klass = UltracartClient.const_get(type)
|
204
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
# Returns the string representation of the object
|
209
|
+
# @return [String] String presentation of the object
|
210
|
+
def to_s
|
211
|
+
to_hash.to_s
|
212
|
+
end
|
213
|
+
|
214
|
+
# to_body is an alias to to_hash (backward compatibility)
|
215
|
+
# @return [Hash] Returns the object in the form of hash
|
216
|
+
def to_body
|
217
|
+
to_hash
|
218
|
+
end
|
219
|
+
|
220
|
+
# Returns the object in the form of hash
|
221
|
+
# @return [Hash] Returns the object in the form of hash
|
222
|
+
def to_hash
|
223
|
+
hash = {}
|
224
|
+
self.class.attribute_map.each_pair do |attr, param|
|
225
|
+
value = self.send(attr)
|
226
|
+
if value.nil?
|
227
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
228
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
229
|
+
end
|
230
|
+
|
231
|
+
hash[param] = _to_hash(value)
|
232
|
+
end
|
233
|
+
hash
|
234
|
+
end
|
235
|
+
|
236
|
+
# Outputs non-array value in the form of hash
|
237
|
+
# For object, use to_hash. Otherwise, just return the value
|
238
|
+
# @param [Object] value Any valid value
|
239
|
+
# @return [Hash] Returns the value in the form of hash
|
240
|
+
def _to_hash(value)
|
241
|
+
if value.is_a?(Array)
|
242
|
+
value.compact.map { |v| _to_hash(v) }
|
243
|
+
elsif value.is_a?(Hash)
|
244
|
+
{}.tap do |hash|
|
245
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
246
|
+
end
|
247
|
+
elsif value.respond_to? :to_hash
|
248
|
+
value.to_hash
|
249
|
+
else
|
250
|
+
value
|
251
|
+
end
|
252
|
+
end
|
253
|
+
|
254
|
+
end
|
255
|
+
|
256
|
+
end
|
data/lib/ultracart_api.rb
CHANGED
@@ -336,6 +336,8 @@ require 'ultracart_api/models/email_plan'
|
|
336
336
|
require 'ultracart_api/models/email_plan_additional'
|
337
337
|
require 'ultracart_api/models/email_plan_response'
|
338
338
|
require 'ultracart_api/models/email_postcard_stat'
|
339
|
+
require 'ultracart_api/models/email_postcard_tracking'
|
340
|
+
require 'ultracart_api/models/email_postcard_tracking_response'
|
339
341
|
require 'ultracart_api/models/email_segment'
|
340
342
|
require 'ultracart_api/models/email_segment_archive_response'
|
341
343
|
require 'ultracart_api/models/email_segment_customer'
|
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.0.
|
4
|
+
version: 4.0.63.rc
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- UltraCart
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-09-
|
11
|
+
date: 2022-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -388,6 +388,8 @@ files:
|
|
388
388
|
- docs/EmailPlanAdditional.md
|
389
389
|
- docs/EmailPlanResponse.md
|
390
390
|
- docs/EmailPostcardStat.md
|
391
|
+
- docs/EmailPostcardTracking.md
|
392
|
+
- docs/EmailPostcardTrackingResponse.md
|
391
393
|
- docs/EmailSegment.md
|
392
394
|
- docs/EmailSegmentArchiveResponse.md
|
393
395
|
- docs/EmailSegmentCustomer.md
|
@@ -1090,6 +1092,8 @@ files:
|
|
1090
1092
|
- lib/ultracart_api/models/email_plan_additional.rb
|
1091
1093
|
- lib/ultracart_api/models/email_plan_response.rb
|
1092
1094
|
- lib/ultracart_api/models/email_postcard_stat.rb
|
1095
|
+
- lib/ultracart_api/models/email_postcard_tracking.rb
|
1096
|
+
- lib/ultracart_api/models/email_postcard_tracking_response.rb
|
1093
1097
|
- lib/ultracart_api/models/email_segment.rb
|
1094
1098
|
- lib/ultracart_api/models/email_segment_archive_response.rb
|
1095
1099
|
- lib/ultracart_api/models/email_segment_customer.rb
|