ultracart_api 4.1.122 → 4.1.124

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 71942b52f2c627128d180191ed15c60a07c07c82127fee920cf3126817de23f5
4
- data.tar.gz: 649eda60fe73357484d88de638a90d6edccf883518b6ffb244f30a96e9a0414d
3
+ metadata.gz: 18d43bd543cc8099b995151cb2e8eba1b3d395ebf4295b7dda09f6e0b551e6ff
4
+ data.tar.gz: 31bdb671cf67931fdfd9cebd7dcc86a9c62a625b7582db370f43def75bb61b1e
5
5
  SHA512:
6
- metadata.gz: 6e88efbd8fb93c3f7089c44acb19cc70e53661c2c79d16205b68888f3211f1d0581823736ae644973380a1841a7b33ec175f4787216cfb3e325e892a30b98772
7
- data.tar.gz: 8a003fbcb04fc63a0389f864eba35a23d4c975f7f7725dad7a6635a8d2b403561253653bfa46d9e96f61eab7ea0d85e46e5d0a75de586e87a70b235e0fd88eed
6
+ metadata.gz: dc463b0191fd737be10900d9ad5099d5fb66460f356b6976222873d7f8161ff399744eeb4401dd5b0c1a1253689bcdb308507f1c3886b466b9b075e09ff694a5
7
+ data.tar.gz: 9579f70e1d58c91f7a3b2fb9c89c38db34adc26b28deb6e5e18414006926ba69c703b72e51e37730329af97d3bd730f1012a19f4f9583a4128bf689013f3dddd
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.122
10
+ - Package version: 4.1.124
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.122'
19
+ gem 'ultracart_api', '4.1.124'
20
20
  ```
21
21
 
22
22
  install:
@@ -337,6 +337,7 @@ Class | Method | HTTP request | Description
337
337
  *UltracartClient::CustomerApi* | [**search_customers**](docs/CustomerApi.md#search_customers) | **GET** /customer/customers/search | Search for customers
338
338
  *UltracartClient::CustomerApi* | [**update_customer**](docs/CustomerApi.md#update_customer) | **PUT** /customer/customers/{customer_profile_oid} | Update a customer
339
339
  *UltracartClient::CustomerApi* | [**update_customer_email_lists**](docs/CustomerApi.md#update_customer_email_lists) | **POST** /customer/customers/{customer_profile_oid}/email_lists | Update email list subscriptions for a customer
340
+ *UltracartClient::CustomerApi* | [**update_customer_email_suppression**](docs/CustomerApi.md#update_customer_email_suppression) | **POST** /customer/customers/{customer_profile_oid}/email_suppression | Clear email suppression for a customer
340
341
  *UltracartClient::CustomerApi* | [**update_wish_list_item**](docs/CustomerApi.md#update_wish_list_item) | **PUT** /customer/customers/{customer_profile_oid}/wishlist/{customer_wishlist_item_oid} | Update a customer wishlist item
341
342
  *UltracartClient::CustomerApi* | [**validate_email_verification_token**](docs/CustomerApi.md#validate_email_verification_token) | **POST** /customer/customers/email_verify/validate_token | Validate a token that can be used to verify a customer email address
342
343
  *UltracartClient::DatawarehouseApi* | [**analyze_custom_report**](docs/DatawarehouseApi.md#analyze_custom_report) | **PUT** /datawarehouse/custom_reports/{custom_report_oid}/analysis | Analyze a custom report
@@ -1157,6 +1158,9 @@ Class | Method | HTTP request | Description
1157
1158
  - [UltracartClient::CustomerEditorValues](docs/CustomerEditorValues.md)
1158
1159
  - [UltracartClient::CustomerEmail](docs/CustomerEmail.md)
1159
1160
  - [UltracartClient::CustomerEmailListChanges](docs/CustomerEmailListChanges.md)
1161
+ - [UltracartClient::CustomerEmailSuppressionRequest](docs/CustomerEmailSuppressionRequest.md)
1162
+ - [UltracartClient::CustomerEmailSuppressionResponse](docs/CustomerEmailSuppressionResponse.md)
1163
+ - [UltracartClient::CustomerEmailSuppressionResult](docs/CustomerEmailSuppressionResult.md)
1160
1164
  - [UltracartClient::CustomerLoyalty](docs/CustomerLoyalty.md)
1161
1165
  - [UltracartClient::CustomerLoyaltyLedger](docs/CustomerLoyaltyLedger.md)
1162
1166
  - [UltracartClient::CustomerLoyaltyRedemption](docs/CustomerLoyaltyRedemption.md)
@@ -1304,6 +1308,7 @@ Class | Method | HTTP request | Description
1304
1308
  - [UltracartClient::EmailStepStatResponse](docs/EmailStepStatResponse.md)
1305
1309
  - [UltracartClient::EmailStepWaitingRequest](docs/EmailStepWaitingRequest.md)
1306
1310
  - [UltracartClient::EmailStepWaitingResponse](docs/EmailStepWaitingResponse.md)
1311
+ - [UltracartClient::EmailSuppressionSurfaces](docs/EmailSuppressionSurfaces.md)
1307
1312
  - [UltracartClient::EmailTemplate](docs/EmailTemplate.md)
1308
1313
  - [UltracartClient::EmailTemplatesResponse](docs/EmailTemplatesResponse.md)
1309
1314
  - [UltracartClient::EmailThirdPartyList](docs/EmailThirdPartyList.md)
@@ -1829,6 +1834,8 @@ Not every change is committed to every SDK.
1829
1834
 
1830
1835
  | Version | Date | Comments |
1831
1836
  | --: | :-: | --- |
1837
+ | 4.1.124 | 08/04/2026 | customer - method to remove customer profile from email suppression |
1838
+ | 4.1.123 | 08/04/2026 | customer - method to remove customer profile from email suppression |
1832
1839
  | 4.1.122 | 07/29/2026 | auto order api - new methods for payment information and rebill |
1833
1840
  | 4.1.121 | 07/15/2026 | storefront - parameter to include details on dispatch log methods |
1834
1841
  | 4.1.120 | 07/15/2026 | storefront - parameter to include details on dispatch log methods |
data/docs/CustomerApi.md CHANGED
@@ -28,6 +28,7 @@ All URIs are relative to *https://secure.ultracart.com/rest/v2*
28
28
  | [**search_customers**](CustomerApi.md#search_customers) | **GET** /customer/customers/search | Search for customers |
29
29
  | [**update_customer**](CustomerApi.md#update_customer) | **PUT** /customer/customers/{customer_profile_oid} | Update a customer |
30
30
  | [**update_customer_email_lists**](CustomerApi.md#update_customer_email_lists) | **POST** /customer/customers/{customer_profile_oid}/email_lists | Update email list subscriptions for a customer |
31
+ | [**update_customer_email_suppression**](CustomerApi.md#update_customer_email_suppression) | **POST** /customer/customers/{customer_profile_oid}/email_suppression | Clear email suppression for a customer |
31
32
  | [**update_wish_list_item**](CustomerApi.md#update_wish_list_item) | **PUT** /customer/customers/{customer_profile_oid}/wishlist/{customer_wishlist_item_oid} | Update a customer wishlist item |
32
33
  | [**validate_email_verification_token**](CustomerApi.md#validate_email_verification_token) | **POST** /customer/customers/email_verify/validate_token | Validate a token that can be used to verify a customer email address |
33
34
 
@@ -2445,6 +2446,60 @@ end
2445
2446
  - **Accept**: application/json
2446
2447
 
2447
2448
 
2449
+ ## update_customer_email_suppression
2450
+
2451
+ > <CustomerEmailSuppressionResponse> update_customer_email_suppression(customer_profile_oid, suppression_changes)
2452
+
2453
+ Clear email suppression for a customer
2454
+
2455
+ Clears global unsubscribe, spam complaint and/or bounce suppression for a customer. This method is clear-only and cannot set a suppression flag. Clearing a suppression removes the send gate but does not subscribe the customer to any email list -- list membership survives a global unsubscribe untouched, so the customer's original lists become deliverable again with no further action. Returns 200 with a warning if the flags were cleared but an upstream ESP suppression removal failed; the profile was still modified in that case.
2456
+
2457
+
2458
+ ### Examples
2459
+
2460
+
2461
+ (No example for this operation).
2462
+
2463
+
2464
+ #### Using the update_customer_email_suppression_with_http_info variant
2465
+
2466
+ This returns an Array which contains the response data, status code and headers.
2467
+
2468
+ > <Array(<CustomerEmailSuppressionResponse>, Integer, Hash)> update_customer_email_suppression_with_http_info(customer_profile_oid, suppression_changes)
2469
+
2470
+ ```ruby
2471
+ begin
2472
+ # Clear email suppression for a customer
2473
+ data, status_code, headers = api_instance.update_customer_email_suppression_with_http_info(customer_profile_oid, suppression_changes)
2474
+ p status_code # => 2xx
2475
+ p headers # => { ... }
2476
+ p data # => <CustomerEmailSuppressionResponse>
2477
+ rescue UltracartClient::ApiError => e
2478
+ puts "Error when calling CustomerApi->update_customer_email_suppression_with_http_info: #{e}"
2479
+ end
2480
+ ```
2481
+
2482
+ ### Parameters
2483
+
2484
+ | Name | Type | Description | Notes |
2485
+ | ---- | ---- | ----------- | ----- |
2486
+ | **customer_profile_oid** | **Integer** | The customer profile oid | |
2487
+ | **suppression_changes** | [**CustomerEmailSuppressionRequest**](CustomerEmailSuppressionRequest.md) | Suppression changes | |
2488
+
2489
+ ### Return type
2490
+
2491
+ [**CustomerEmailSuppressionResponse**](CustomerEmailSuppressionResponse.md)
2492
+
2493
+ ### Authorization
2494
+
2495
+ [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
2496
+
2497
+ ### HTTP request headers
2498
+
2499
+ - **Content-Type**: application/json; charset=UTF-8
2500
+ - **Accept**: application/json
2501
+
2502
+
2448
2503
  ## update_wish_list_item
2449
2504
 
2450
2505
  > <CustomerWishListItem> update_wish_list_item(customer_profile_oid, customer_wishlist_item_oid, wishlist_item)
@@ -0,0 +1,26 @@
1
+ # UltracartClient::CustomerEmailSuppressionRequest
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **clear_bounce** | **Boolean** | Clear bounce suppression for this address. Bounce has no per-customer flag; it exists only on the suppression tables. | [optional] |
8
+ | **clear_global_unsubscribe** | **Boolean** | Clear the global unsubscribe flag. No-op if it is already clear. | [optional] |
9
+ | **clear_spam_complaint** | **Boolean** | Clear the spam complaint flag. Requires a reason. No-op if it is already clear. | [optional] |
10
+ | **consent_source** | **String** | How the customer communicated consent. | [optional] |
11
+ | **reason** | **String** | Justification for the clear. Required when clearing a spam complaint. Retained on the audit record. | [optional] |
12
+
13
+ ## Example
14
+
15
+ ```ruby
16
+ require 'ultracart_api'
17
+
18
+ instance = UltracartClient::CustomerEmailSuppressionRequest.new(
19
+ clear_bounce: null,
20
+ clear_global_unsubscribe: null,
21
+ clear_spam_complaint: null,
22
+ consent_source: null,
23
+ reason: null
24
+ )
25
+ ```
26
+
@@ -0,0 +1,26 @@
1
+ # UltracartClient::CustomerEmailSuppressionResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **email_suppression** | [**CustomerEmailSuppressionResult**](CustomerEmailSuppressionResult.md) | | [optional] |
8
+ | **error** | [**Error**](Error.md) | | [optional] |
9
+ | **metadata** | [**ResponseMetadata**](ResponseMetadata.md) | | [optional] |
10
+ | **success** | **Boolean** | Indicates if API call was successful | [optional] |
11
+ | **warning** | [**Warning**](Warning.md) | | [optional] |
12
+
13
+ ## Example
14
+
15
+ ```ruby
16
+ require 'ultracart_api'
17
+
18
+ instance = UltracartClient::CustomerEmailSuppressionResponse.new(
19
+ email_suppression: null,
20
+ error: null,
21
+ metadata: null,
22
+ success: null,
23
+ warning: null
24
+ )
25
+ ```
26
+
@@ -0,0 +1,40 @@
1
+ # UltracartClient::CustomerEmailSuppressionResult
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **bounce_cleared** | **Boolean** | True only if this call actually removed bounce suppression. Bounce has no per-customer flag, so there is no corresponding state field. | [optional] |
8
+ | **customer_profile_oid** | **Integer** | The customer profile oid that was operated on | [optional] |
9
+ | **email** | **String** | The email address that was operated on | [optional] |
10
+ | **esp_suppression_removed** | **Boolean** | True only if every requested suppression surface was successfully cleared. When false, see esp_warning -- the profile was still modified. | [optional] |
11
+ | **esp_warning** | **String** | Human readable explanation when esp_suppression_removed is false. Suitable for display to a support agent. | [optional] |
12
+ | **global_unsubscribe_cleared** | **Boolean** | True only if this call actually changed the global unsubscribe flag. False if it was already clear. | [optional] |
13
+ | **global_unsubscribed** | **Boolean** | Global unsubscribe state AFTER this call | [optional] |
14
+ | **global_unsubscribed_dts** | **String** | Global unsubscribe timestamp after this call. Nulled when cleared; the prior value is retained on the audit record. | [optional] |
15
+ | **spam_complaint** | **Boolean** | Spam complaint state AFTER this call | [optional] |
16
+ | **spam_complaint_cleared** | **Boolean** | True only if this call actually changed the spam complaint flag. False if it was already clear. | [optional] |
17
+ | **spam_complaint_dts** | **String** | Spam complaint timestamp after this call. Nulled when cleared; the prior value is retained on the audit record. | [optional] |
18
+ | **suppression_surfaces** | [**EmailSuppressionSurfaces**](EmailSuppressionSurfaces.md) | | [optional] |
19
+
20
+ ## Example
21
+
22
+ ```ruby
23
+ require 'ultracart_api'
24
+
25
+ instance = UltracartClient::CustomerEmailSuppressionResult.new(
26
+ bounce_cleared: null,
27
+ customer_profile_oid: null,
28
+ email: null,
29
+ esp_suppression_removed: null,
30
+ esp_warning: null,
31
+ global_unsubscribe_cleared: null,
32
+ global_unsubscribed: null,
33
+ global_unsubscribed_dts: null,
34
+ spam_complaint: null,
35
+ spam_complaint_cleared: null,
36
+ spam_complaint_dts: null,
37
+ suppression_surfaces: null
38
+ )
39
+ ```
40
+
@@ -0,0 +1,22 @@
1
+ # UltracartClient::EmailSuppressionSurfaces
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **central_ses_suppression** | **String** | Outcome of removing the address from the central cross-account ses_suppression table | [optional] |
8
+ | **esp_customer_flags** | **String** | Outcome of clearing the per-customer send gates on esp_customer | [optional] |
9
+ | **ses_account_suppression** | **String** | Outcome of removing the address from the SES-native account-level suppression list | [optional] |
10
+
11
+ ## Example
12
+
13
+ ```ruby
14
+ require 'ultracart_api'
15
+
16
+ instance = UltracartClient::EmailSuppressionSurfaces.new(
17
+ central_ses_suppression: null,
18
+ esp_customer_flags: null,
19
+ ses_account_suppression: null
20
+ )
21
+ ```
22
+
data/docs/TaxCountry.md CHANGED
@@ -13,6 +13,8 @@
13
13
  | **tax_rate** | **Float** | Tax Rate | [optional] |
14
14
  | **tax_rate_formatted** | **String** | Tax rate formatted | [optional] |
15
15
  | **tax_shipping** | **Boolean** | True if taxation within this jurisdiction should charge tax on shipping | [optional] |
16
+ | **vat_threshold** | **Float** | VAT collection threshold for this country. Blank means no threshold, 0 always collects VAT, a positive value collects at or below that order subtotal. | [optional] |
17
+ | **vat_threshold_currency** | **String** | Currency code the vat_threshold amount is expressed in (USD, EUR or GBP). | [optional] |
16
18
 
17
19
  ## Example
18
20
 
@@ -28,7 +30,9 @@ instance = UltracartClient::TaxCountry.new(
28
30
  tax_gift_wrap: null,
29
31
  tax_rate: null,
30
32
  tax_rate_formatted: null,
31
- tax_shipping: null
33
+ tax_shipping: null,
34
+ vat_threshold: null,
35
+ vat_threshold_currency: null
32
36
  )
33
37
  ```
34
38
 
data/docs/TaxState.md CHANGED
@@ -22,6 +22,8 @@
22
22
  | **tax_rate_formatted** | **String** | Tax rate formatted | [optional] |
23
23
  | **tax_shipping** | **Boolean** | True if taxation within this jurisdiction should charge tax on shipping | [optional] |
24
24
  | **use_ultracart_managed_rates** | **Boolean** | If true, use UltraCart managed rates for this state | [optional] |
25
+ | **vat_threshold** | **Float** | VAT collection threshold override for this region. Blank inherits the country threshold, 0 always collects VAT, a positive value collects at or below that order subtotal. | [optional] |
26
+ | **vat_threshold_currency** | **String** | Currency code the vat_threshold amount is expressed in (USD, EUR or GBP). | [optional] |
25
27
 
26
28
  ## Example
27
29
 
@@ -46,7 +48,9 @@ instance = UltracartClient::TaxState.new(
46
48
  tax_rate: null,
47
49
  tax_rate_formatted: null,
48
50
  tax_shipping: null,
49
- use_ultracart_managed_rates: null
51
+ use_ultracart_managed_rates: null,
52
+ vat_threshold: null,
53
+ vat_threshold_currency: null
50
54
  )
51
55
  ```
52
56
 
@@ -1790,6 +1790,81 @@ module UltracartClient
1790
1790
  return data, status_code, headers
1791
1791
  end
1792
1792
 
1793
+ # Clear email suppression for a customer
1794
+ # Clears global unsubscribe, spam complaint and/or bounce suppression for a customer. This method is clear-only and cannot set a suppression flag. Clearing a suppression removes the send gate but does not subscribe the customer to any email list -- list membership survives a global unsubscribe untouched, so the customer's original lists become deliverable again with no further action. Returns 200 with a warning if the flags were cleared but an upstream ESP suppression removal failed; the profile was still modified in that case.
1795
+ # @param customer_profile_oid [Integer] The customer profile oid
1796
+ # @param suppression_changes [CustomerEmailSuppressionRequest] Suppression changes
1797
+ # @param [Hash] opts the optional parameters
1798
+ # @return [CustomerEmailSuppressionResponse]
1799
+ def update_customer_email_suppression(customer_profile_oid, suppression_changes, opts = {})
1800
+ data, _status_code, _headers = update_customer_email_suppression_with_http_info(customer_profile_oid, suppression_changes, opts)
1801
+ data
1802
+ end
1803
+
1804
+ # Clear email suppression for a customer
1805
+ # Clears global unsubscribe, spam complaint and/or bounce suppression for a customer. This method is clear-only and cannot set a suppression flag. Clearing a suppression removes the send gate but does not subscribe the customer to any email list -- list membership survives a global unsubscribe untouched, so the customer&#39;s original lists become deliverable again with no further action. Returns 200 with a warning if the flags were cleared but an upstream ESP suppression removal failed; the profile was still modified in that case.
1806
+ # @param customer_profile_oid [Integer] The customer profile oid
1807
+ # @param suppression_changes [CustomerEmailSuppressionRequest] Suppression changes
1808
+ # @param [Hash] opts the optional parameters
1809
+ # @return [Array<(CustomerEmailSuppressionResponse, Integer, Hash)>] CustomerEmailSuppressionResponse data, response status code and response headers
1810
+ def update_customer_email_suppression_with_http_info(customer_profile_oid, suppression_changes, opts = {})
1811
+ if @api_client.config.debugging
1812
+ @api_client.config.logger.debug 'Calling API: CustomerApi.update_customer_email_suppression ...'
1813
+ end
1814
+ # verify the required parameter 'customer_profile_oid' is set
1815
+ if @api_client.config.client_side_validation && customer_profile_oid.nil?
1816
+ fail ArgumentError, "Missing the required parameter 'customer_profile_oid' when calling CustomerApi.update_customer_email_suppression"
1817
+ end
1818
+ # verify the required parameter 'suppression_changes' is set
1819
+ if @api_client.config.client_side_validation && suppression_changes.nil?
1820
+ fail ArgumentError, "Missing the required parameter 'suppression_changes' when calling CustomerApi.update_customer_email_suppression"
1821
+ end
1822
+ # resource path
1823
+ local_var_path = '/customer/customers/{customer_profile_oid}/email_suppression'.sub('{' + 'customer_profile_oid' + '}', CGI.escape(customer_profile_oid.to_s))
1824
+
1825
+ # query parameters
1826
+ query_params = opts[:query_params] || {}
1827
+
1828
+ # header parameters
1829
+ header_params = opts[:header_params] || {}
1830
+ header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()
1831
+ # HTTP header 'Accept' (if needed)
1832
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
1833
+ # HTTP header 'Content-Type'
1834
+ content_type = @api_client.select_header_content_type(['application/json; charset=UTF-8'])
1835
+ if !content_type.nil?
1836
+ header_params['Content-Type'] = content_type
1837
+ end
1838
+
1839
+ # form parameters
1840
+ form_params = opts[:form_params] || {}
1841
+
1842
+ # http body (model)
1843
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(suppression_changes)
1844
+
1845
+ # return_type
1846
+ return_type = opts[:debug_return_type] || 'CustomerEmailSuppressionResponse'
1847
+
1848
+ # auth_names
1849
+ auth_names = opts[:debug_auth_names] || ['ultraCartOauth', 'ultraCartSimpleApiKey']
1850
+
1851
+ new_options = opts.merge(
1852
+ :operation => :"CustomerApi.update_customer_email_suppression",
1853
+ :header_params => header_params,
1854
+ :query_params => query_params,
1855
+ :form_params => form_params,
1856
+ :body => post_body,
1857
+ :auth_names => auth_names,
1858
+ :return_type => return_type
1859
+ )
1860
+
1861
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
1862
+ if @api_client.config.debugging
1863
+ @api_client.config.logger.debug "API called: CustomerApi#update_customer_email_suppression\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1864
+ end
1865
+ return data, status_code, headers
1866
+ end
1867
+
1793
1868
  # Update a customer wishlist item
1794
1869
  # Update a customer wishlist item
1795
1870
  # @param customer_profile_oid [Integer] The customer oid for this wishlist.
@@ -0,0 +1,294 @@
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 CustomerEmailSuppressionRequest
18
+ # Clear bounce suppression for this address. Bounce has no per-customer flag; it exists only on the suppression tables.
19
+ attr_accessor :clear_bounce
20
+
21
+ # Clear the global unsubscribe flag. No-op if it is already clear.
22
+ attr_accessor :clear_global_unsubscribe
23
+
24
+ # Clear the spam complaint flag. Requires a reason. No-op if it is already clear.
25
+ attr_accessor :clear_spam_complaint
26
+
27
+ # How the customer communicated consent.
28
+ attr_accessor :consent_source
29
+
30
+ # Justification for the clear. Required when clearing a spam complaint. Retained on the audit record.
31
+ attr_accessor :reason
32
+
33
+ class EnumAttributeValidator
34
+ attr_reader :datatype
35
+ attr_reader :allowable_values
36
+
37
+ def initialize(datatype, allowable_values)
38
+ @allowable_values = allowable_values.map do |value|
39
+ case datatype.to_s
40
+ when /Integer/i
41
+ value.to_i
42
+ when /Float/i
43
+ value.to_f
44
+ else
45
+ value
46
+ end
47
+ end
48
+ end
49
+
50
+ def valid?(value)
51
+ !value || allowable_values.include?(value)
52
+ end
53
+ end
54
+
55
+ # Attribute mapping from ruby-style variable name to JSON key.
56
+ def self.attribute_map
57
+ {
58
+ :'clear_bounce' => :'clear_bounce',
59
+ :'clear_global_unsubscribe' => :'clear_global_unsubscribe',
60
+ :'clear_spam_complaint' => :'clear_spam_complaint',
61
+ :'consent_source' => :'consent_source',
62
+ :'reason' => :'reason'
63
+ }
64
+ end
65
+
66
+ # Returns all the JSON keys this model knows about
67
+ def self.acceptable_attributes
68
+ attribute_map.values
69
+ end
70
+
71
+ # Attribute type mapping.
72
+ def self.openapi_types
73
+ {
74
+ :'clear_bounce' => :'Boolean',
75
+ :'clear_global_unsubscribe' => :'Boolean',
76
+ :'clear_spam_complaint' => :'Boolean',
77
+ :'consent_source' => :'String',
78
+ :'reason' => :'String'
79
+ }
80
+ end
81
+
82
+ # List of attributes with nullable: true
83
+ def self.openapi_nullable
84
+ Set.new([
85
+ ])
86
+ end
87
+
88
+ # Initializes the object
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ def initialize(attributes = {})
91
+ if (!attributes.is_a?(Hash))
92
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::CustomerEmailSuppressionRequest` initialize method"
93
+ end
94
+
95
+ # check to see if the attribute exists and convert string to symbol for hash key
96
+ attributes = attributes.each_with_object({}) { |(k, v), h|
97
+ if (!self.class.attribute_map.key?(k.to_sym))
98
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::CustomerEmailSuppressionRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
99
+ end
100
+ h[k.to_sym] = v
101
+ }
102
+
103
+ if attributes.key?(:'clear_bounce')
104
+ self.clear_bounce = attributes[:'clear_bounce']
105
+ end
106
+
107
+ if attributes.key?(:'clear_global_unsubscribe')
108
+ self.clear_global_unsubscribe = attributes[:'clear_global_unsubscribe']
109
+ end
110
+
111
+ if attributes.key?(:'clear_spam_complaint')
112
+ self.clear_spam_complaint = attributes[:'clear_spam_complaint']
113
+ end
114
+
115
+ if attributes.key?(:'consent_source')
116
+ self.consent_source = attributes[:'consent_source']
117
+ end
118
+
119
+ if attributes.key?(:'reason')
120
+ self.reason = attributes[:'reason']
121
+ end
122
+ end
123
+
124
+ # Show invalid properties with the reasons. Usually used together with valid?
125
+ # @return Array for valid properties with the reasons
126
+ def list_invalid_properties
127
+ invalid_properties = Array.new
128
+ invalid_properties
129
+ end
130
+
131
+ # Check to see if the all the properties in the model are valid
132
+ # @return true if the model is valid
133
+ def valid?
134
+ consent_source_validator = EnumAttributeValidator.new('String', ["phone", "email", "chat", "in_person", "written", "other"])
135
+ return false unless consent_source_validator.valid?(@consent_source)
136
+ true
137
+ end
138
+
139
+ # Custom attribute writer method checking allowed values (enum).
140
+ # @param [Object] consent_source Object to be assigned
141
+ def consent_source=(consent_source)
142
+ validator = EnumAttributeValidator.new('String', ["phone", "email", "chat", "in_person", "written", "other"])
143
+ unless validator.valid?(consent_source)
144
+ fail ArgumentError, "invalid value for \"consent_source\", must be one of #{validator.allowable_values}."
145
+ end
146
+ @consent_source = consent_source
147
+ end
148
+
149
+ # Checks equality by comparing each attribute.
150
+ # @param [Object] Object to be compared
151
+ def ==(o)
152
+ return true if self.equal?(o)
153
+ self.class == o.class &&
154
+ clear_bounce == o.clear_bounce &&
155
+ clear_global_unsubscribe == o.clear_global_unsubscribe &&
156
+ clear_spam_complaint == o.clear_spam_complaint &&
157
+ consent_source == o.consent_source &&
158
+ reason == o.reason
159
+ end
160
+
161
+ # @see the `==` method
162
+ # @param [Object] Object to be compared
163
+ def eql?(o)
164
+ self == o
165
+ end
166
+
167
+ # Calculates hash code according to all attributes.
168
+ # @return [Integer] Hash code
169
+ def hash
170
+ [clear_bounce, clear_global_unsubscribe, clear_spam_complaint, consent_source, reason].hash
171
+ end
172
+
173
+ # Builds the object from hash
174
+ # @param [Hash] attributes Model attributes in the form of hash
175
+ # @return [Object] Returns the model itself
176
+ def self.build_from_hash(attributes)
177
+ new.build_from_hash(attributes)
178
+ end
179
+
180
+ # Builds the object from hash
181
+ # @param [Hash] attributes Model attributes in the form of hash
182
+ # @return [Object] Returns the model itself
183
+ def build_from_hash(attributes)
184
+ return nil unless attributes.is_a?(Hash)
185
+ attributes = attributes.transform_keys(&:to_sym)
186
+ self.class.openapi_types.each_pair do |key, type|
187
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
188
+ self.send("#{key}=", nil)
189
+ elsif type =~ /\AArray<(.*)>/i
190
+ # check to ensure the input is an array given that the attribute
191
+ # is documented as an array but the input is not
192
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
193
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
194
+ end
195
+ elsif !attributes[self.class.attribute_map[key]].nil?
196
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
197
+ end
198
+ end
199
+
200
+ self
201
+ end
202
+
203
+ # Deserializes the data based on type
204
+ # @param string type Data type
205
+ # @param string value Value to be deserialized
206
+ # @return [Object] Deserialized data
207
+ def _deserialize(type, value)
208
+ case type.to_sym
209
+ when :Time
210
+ Time.parse(value)
211
+ when :Date
212
+ Date.parse(value)
213
+ when :String
214
+ value.to_s
215
+ when :Integer
216
+ value.to_i
217
+ when :Float
218
+ value.to_f
219
+ when :Boolean
220
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
221
+ true
222
+ else
223
+ false
224
+ end
225
+ when :Object
226
+ # generic object (usually a Hash), return directly
227
+ value
228
+ when /\AArray<(?<inner_type>.+)>\z/
229
+ inner_type = Regexp.last_match[:inner_type]
230
+ value.map { |v| _deserialize(inner_type, v) }
231
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
232
+ k_type = Regexp.last_match[:k_type]
233
+ v_type = Regexp.last_match[:v_type]
234
+ {}.tap do |hash|
235
+ value.each do |k, v|
236
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
237
+ end
238
+ end
239
+ else # model
240
+ # models (e.g. Pet) or oneOf
241
+ klass = UltracartClient.const_get(type)
242
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
243
+ end
244
+ end
245
+
246
+ # Returns the string representation of the object
247
+ # @return [String] String presentation of the object
248
+ def to_s
249
+ to_hash.to_s
250
+ end
251
+
252
+ # to_body is an alias to to_hash (backward compatibility)
253
+ # @return [Hash] Returns the object in the form of hash
254
+ def to_body
255
+ to_hash
256
+ end
257
+
258
+ # Returns the object in the form of hash
259
+ # @return [Hash] Returns the object in the form of hash
260
+ def to_hash
261
+ hash = {}
262
+ self.class.attribute_map.each_pair do |attr, param|
263
+ value = self.send(attr)
264
+ if value.nil?
265
+ is_nullable = self.class.openapi_nullable.include?(attr)
266
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
267
+ end
268
+
269
+ hash[param] = _to_hash(value)
270
+ end
271
+ hash
272
+ end
273
+
274
+ # Outputs non-array value in the form of hash
275
+ # For object, use to_hash. Otherwise, just return the value
276
+ # @param [Object] value Any valid value
277
+ # @return [Hash] Returns the value in the form of hash
278
+ def _to_hash(value)
279
+ if value.is_a?(Array)
280
+ value.compact.map { |v| _to_hash(v) }
281
+ elsif value.is_a?(Hash)
282
+ {}.tap do |hash|
283
+ value.each { |k, v| hash[k] = _to_hash(v) }
284
+ end
285
+ elsif value.respond_to? :to_hash
286
+ value.to_hash
287
+ else
288
+ value
289
+ end
290
+ end
291
+
292
+ end
293
+
294
+ end