ultracart_api 3.9.1 → 3.9.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -6
  3. data/docs/AddLibraryItemRequest.md +1 -0
  4. data/docs/Browser.md +10 -0
  5. data/docs/BrowserDevice.md +8 -0
  6. data/docs/BrowserOS.md +12 -0
  7. data/docs/BrowserUserAgent.md +11 -0
  8. data/docs/Cart.md +1 -0
  9. data/docs/DistributionCenter.md +1 -0
  10. data/docs/EmailCommseqPostcard.md +8 -0
  11. data/docs/GiftCertificate.md +2 -0
  12. data/docs/ItemTax.md +1 -0
  13. data/docs/OrderCheckout.md +2 -0
  14. data/docs/OrderItem.md +1 -0
  15. data/docs/TaxProviderUltraCartState.md +3 -0
  16. data/docs/TaxState.md +3 -0
  17. data/lib/ultracart_api/models/add_library_item_request.rb +11 -1
  18. data/lib/ultracart_api/models/browser.rb +202 -0
  19. data/lib/ultracart_api/models/browser_device.rb +184 -0
  20. data/lib/ultracart_api/models/browser_os.rb +220 -0
  21. data/lib/ultracart_api/models/browser_user_agent.rb +211 -0
  22. data/lib/ultracart_api/models/cart.rb +11 -1
  23. data/lib/ultracart_api/models/customer_tag.rb +5 -5
  24. data/lib/ultracart_api/models/distribution_center.rb +11 -1
  25. data/lib/ultracart_api/models/email_commseq_postcard.rb +81 -1
  26. data/lib/ultracart_api/models/gift_certificate.rb +36 -1
  27. data/lib/ultracart_api/models/item_tax.rb +45 -1
  28. data/lib/ultracart_api/models/order_checkout.rb +20 -1
  29. data/lib/ultracart_api/models/order_item.rb +45 -1
  30. data/lib/ultracart_api/models/tax_provider_ultra_cart_state.rb +31 -1
  31. data/lib/ultracart_api/models/tax_state.rb +31 -1
  32. data/lib/ultracart_api/models/user.rb +15 -0
  33. data/lib/ultracart_api/version.rb +1 -1
  34. data/lib/ultracart_api.rb +4 -0
  35. metadata +10 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 712bf0471253bf7a1e158a9bb195be9c21a76540aa7c876fb67e6e7100ebc036
4
- data.tar.gz: 1ee3ed296ba6e3e740256894a04aed3837953b3eb0461bf1f15785766571a4ae
3
+ metadata.gz: c21e0fbeb29a599225941362bbfd5a4fa38d1608c86df5089f33cdfcec08ad3b
4
+ data.tar.gz: 70f55016e1557be86277dec10d59e0bd0048a8f9bd2340d3e6567a942bb6a85d
5
5
  SHA512:
6
- metadata.gz: 98c9eb555e6ec5884c5ed82c219e10bc6c3bc14acb583ecde03b364074e9df5619ec2741ccb1529cdc45c1b1ac2635fb57ff3e82beca1178e5eab537469b805b
7
- data.tar.gz: ba674c5eda0a756924e1690c104727ad3254fe7b347dd23d1c11b5309a2a6a4ec08bcc0a305784e89e99e2eb227f26f5e5c14612fd268040d5b6bb4540919c3b
6
+ metadata.gz: 6186b4eab4833f0150ed24869b93524146f6bebc9c4028a7b092fa39f045c1d525a97b6ae6f60ad9d088e413b8deef821e8fd9eee15b9839a5061cb296763fa9
7
+ data.tar.gz: 9db3605fb5364fa06c971a25b3a745c5d8277ddef0f6fd06e79a2b8e17b8f429af16d83313ed3d091830f243b69251a960e41d567509b6d855a372289fd092e4
data/README.md CHANGED
@@ -7,7 +7,7 @@ UltraCart REST API Version 2
7
7
  This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
8
8
 
9
9
  - API version: 2.0.0
10
- - Package version: 3.9.1
10
+ - Package version: 3.9.2
11
11
  - Build package: io.swagger.codegen.languages.RubyClientCodegen
12
12
  For more information, please visit [http://www.ultracart.com](http://www.ultracart.com)
13
13
 
@@ -24,15 +24,15 @@ gem build ultracart_api.gemspec
24
24
  Then either install the gem locally:
25
25
 
26
26
  ```shell
27
- gem install ./ultracart_api-3.9.1.gem
27
+ gem install ./ultracart_api-3.9.2.gem
28
28
  ```
29
- (for development, run `gem install --dev ./ultracart_api-3.9.1.gem` to install the development dependencies)
29
+ (for development, run `gem install --dev ./ultracart_api-3.9.2.gem` to install the development dependencies)
30
30
 
31
31
  or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
32
32
 
33
33
  Finally add this to the Gemfile:
34
34
 
35
- gem 'ultracart_api', '~> 3.9.1'
35
+ gem 'ultracart_api', '~> 3.9.2'
36
36
 
37
37
  ### Install from Git
38
38
 
@@ -465,6 +465,10 @@ Class | Method | HTTP request | Description
465
465
  - [UltracartClient::AutoOrdersResponse](docs/AutoOrdersResponse.md)
466
466
  - [UltracartClient::AvalaraConfig](docs/AvalaraConfig.md)
467
467
  - [UltracartClient::BaseResponse](docs/BaseResponse.md)
468
+ - [UltracartClient::Browser](docs/Browser.md)
469
+ - [UltracartClient::BrowserDevice](docs/BrowserDevice.md)
470
+ - [UltracartClient::BrowserOS](docs/BrowserOS.md)
471
+ - [UltracartClient::BrowserUserAgent](docs/BrowserUserAgent.md)
468
472
  - [UltracartClient::Cart](docs/Cart.md)
469
473
  - [UltracartClient::CartAffiliate](docs/CartAffiliate.md)
470
474
  - [UltracartClient::CartAffirmCheckoutResponse](docs/CartAffirmCheckoutResponse.md)
@@ -1113,8 +1117,6 @@ Class | Method | HTTP request | Description
1113
1117
  - customer_write: Allows you to write customer information.
1114
1118
  - fulfillment_read: Allows you to read fulfillment information.
1115
1119
  - fulfillment_write: Allows you to write fulfillment information.
1116
- - gift_certificate_read: Allows you to read gift certificate information.
1117
- - gift_certificate_write: Allows you to write gift certificate information.
1118
1120
  - integration_log_read: Allows you to read integration log information.
1119
1121
  - integration_log_write: Allows you to write integration log information.
1120
1122
  - order_read: Allows you to read order information.
@@ -1131,6 +1133,8 @@ Class | Method | HTTP request | Description
1131
1133
  - ultrabooks_write: 2 of 2 required to use UltraBooks
1132
1134
  - user_read: Allows you to read user information.
1133
1135
  - user_write: Allows you to write user information.
1136
+ - gift_certificate_read: Allows you to read gift certificate information.
1137
+ - gift_certificate_write: Allows you to write gift certificate information.
1134
1138
 
1135
1139
  ### ultraCartSimpleApiKey
1136
1140
 
@@ -1146,6 +1150,7 @@ Not every change is committed to every SDK.
1146
1150
 
1147
1151
  | Version | Date | Comments |
1148
1152
  | --: | :-: | --- |
1153
+ | 3.9.2 | 04/04/2022 | user.email field extended and postcard screenshot fields |
1149
1154
  | 3.9.1 | 03/03/2022 | javascript sdk package.json bug fix |
1150
1155
  | 3.9.0 | 03/03/2022 | removed ultra_cart_rest_api_v2.d.ts from javascript sdk because typescript sdk exists now |
1151
1156
  | 3.8.8 | 03/02/2022 | bug fix for ruby sdk, uri.escape deprecated in 3.x |
@@ -5,6 +5,7 @@ Name | Type | Description | Notes
5
5
  ------------ | ------------- | ------------- | -------------
6
6
  **attributes** | [**Array<LibraryItemAttribute>**](LibraryItemAttribute.md) | Attributes associated with the library item to contain additional configuration. | [optional]
7
7
  **cjson** | **String** | Cjson to be added to library | [optional]
8
+ **cjson2** | **String** | Additional Cjson to be added to library, notably for the postcard which has a front and back. | [optional]
8
9
  **content_type** | **String** | flow, campaign, cjson, email, transactional_email, postcard or upsell | [optional]
9
10
  **description** | **String** | description of library item | [optional]
10
11
  **email_name** | **String** | Required if content_type is transactional_email. This is the name of the email template (html, not text). This name should have a .vm file extension. An example is auto_order_cancel_html.vm | [optional]
data/docs/Browser.md ADDED
@@ -0,0 +1,10 @@
1
+ # UltracartClient::Browser
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **device** | [**BrowserDevice**](BrowserDevice.md) | | [optional]
7
+ **os** | [**BrowserOS**](BrowserOS.md) | | [optional]
8
+ **user_agent** | [**BrowserUserAgent**](BrowserUserAgent.md) | | [optional]
9
+
10
+
@@ -0,0 +1,8 @@
1
+ # UltracartClient::BrowserDevice
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **family** | **String** | | [optional]
7
+
8
+
data/docs/BrowserOS.md ADDED
@@ -0,0 +1,12 @@
1
+ # UltracartClient::BrowserOS
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **family** | **String** | | [optional]
7
+ **major** | **String** | | [optional]
8
+ **minor** | **String** | | [optional]
9
+ **patch** | **String** | | [optional]
10
+ **patch_minor** | **String** | | [optional]
11
+
12
+
@@ -0,0 +1,11 @@
1
+ # UltracartClient::BrowserUserAgent
2
+
3
+ ## Properties
4
+ Name | Type | Description | Notes
5
+ ------------ | ------------- | ------------- | -------------
6
+ **family** | **String** | | [optional]
7
+ **major** | **String** | | [optional]
8
+ **minor** | **String** | | [optional]
9
+ **patch** | **String** | | [optional]
10
+
11
+
data/docs/Cart.md CHANGED
@@ -4,6 +4,7 @@
4
4
  Name | Type | Description | Notes
5
5
  ------------ | ------------- | ------------- | -------------
6
6
  **affiliate** | [**CartAffiliate**](CartAffiliate.md) | | [optional]
7
+ **affiliate_network_pixel_oid** | **Integer** | The affiliate network pixel identifier associated with the cart | [optional]
7
8
  **base_currency_code** | **String** | The ISO-4217 three letter base currency code of the account | [optional]
8
9
  **billing** | [**CartBilling**](CartBilling.md) | | [optional]
9
10
  **buysafe** | [**CartBuysafe**](CartBuysafe.md) | | [optional]
@@ -36,6 +36,7 @@ Name | Type | Description | Notes
36
36
  **shipment_cutoff_time_tuesday** | **String** | The time (EST) after which shipments will not be processed on Tuesday | [optional]
37
37
  **shipment_cutoff_time_wednesday** | **String** | The time (EST) after which shipments will not be processed on Wednesday | [optional]
38
38
  **state** | **String** | State of the distribution center | [optional]
39
+ **transmit_blank_costs** | **BOOLEAN** | True if monetary amounts should be zeroed before transmission | [optional]
39
40
  **transport** | **String** | Transport mechanism for this distribution center | [optional]
40
41
 
41
42
 
@@ -13,6 +13,14 @@ Name | Type | Description | Notes
13
13
  **postcard_container_cjson_last_modified_dts** | **String** | Timestamp the last time the container was modified. | [optional]
14
14
  **postcard_front_container_cjson** | **String** | Postcard front container cjson | [optional]
15
15
  **postcard_front_container_uuid** | **String** | Postcard front container uuid | [optional]
16
+ **screenshot_back_large_full_url** | **String** | URL to screenshot (back) in large form factor full page | [optional]
17
+ **screenshot_back_large_viewport_url** | **String** | URL to screenshot (back) in large form factor viewport | [optional]
18
+ **screenshot_back_small_full_url** | **String** | URL to screenshot (back) in small form factor full page | [optional]
19
+ **screenshot_back_small_viewport_url** | **String** | URL to screenshot (back) in small form factor viewport | [optional]
20
+ **screenshot_large_full_url** | **String** | URL to screenshot in large form factor full page | [optional]
21
+ **screenshot_large_viewport_url** | **String** | URL to screenshot in large form factor viewport | [optional]
22
+ **screenshot_small_full_url** | **String** | URL to screenshot in small form factor full page | [optional]
23
+ **screenshot_small_viewport_url** | **String** | URL to screenshot in small form factor viewport | [optional]
16
24
  **storefront_oid** | **Integer** | Storefront oid | [optional]
17
25
 
18
26
 
@@ -5,10 +5,12 @@ Name | Type | Description | Notes
5
5
  ------------ | ------------- | ------------- | -------------
6
6
  **activated** | **BOOLEAN** | True if this gift certificate is activated and ready to apply to purchases. | [optional]
7
7
  **code** | **String** | The code used by the customer to purchase against this gift certificate. | [optional]
8
+ **customer_profile_oid** | **Integer** | This is the customer profile oid associated with this internally managed gift certificate. | [optional]
8
9
  **deleted** | **BOOLEAN** | True if this gift certificate was deleted. | [optional]
9
10
  **email** | **String** | Email of the customer associated with this gift certificate. | [optional]
10
11
  **expiration_dts** | **String** | Expiration date time. | [optional]
11
12
  **gift_certificate_oid** | **Integer** | Gift certificate oid. | [optional]
13
+ **internal** | **BOOLEAN** | This is an internally managed gift certificate associated with the loyalty cash rewards program. | [optional]
12
14
  **ledger_entries** | [**Array<GiftCertificateLedgerEntry>**](GiftCertificateLedgerEntry.md) | A list of all ledger activity for this gift certificate. | [optional]
13
15
  **merchant_id** | **String** | Merchant Id | [optional]
14
16
  **merchant_note** | **String** | A list of all ledger activity for this gift certificate. | [optional]
data/docs/ItemTax.md CHANGED
@@ -5,6 +5,7 @@ Name | Type | Description | Notes
5
5
  ------------ | ------------- | ------------- | -------------
6
6
  **exemptions** | [**Array<ItemTaxExemption>**](ItemTaxExemption.md) | Exemptions | [optional]
7
7
  **tax_free** | **BOOLEAN** | True if tax free | [optional]
8
+ **tax_product_type** | **String** | Tax product type | [optional]
8
9
  **taxable_cost** | **Float** | Taxable cost if different than regular cost | [optional]
9
10
 
10
11
 
@@ -3,6 +3,7 @@
3
3
  ## Properties
4
4
  Name | Type | Description | Notes
5
5
  ------------ | ------------- | ------------- | -------------
6
+ **browser** | [**Browser**](Browser.md) | | [optional]
6
7
  **comments** | **String** | Comments from the customer. Rarely used on the single page checkout. | [optional]
7
8
  **custom_field1** | **String** | Custom field 1 | [optional]
8
9
  **custom_field2** | **String** | Custom field 2 | [optional]
@@ -13,6 +14,7 @@ Name | Type | Description | Notes
13
14
  **custom_field7** | **String** | Custom field 7 | [optional]
14
15
  **customer_ip_address** | **String** | IP address of the customer when placing the order | [optional]
15
16
  **screen_branding_theme_code** | **String** | Screen branding theme code associated with the order (legacy checkout) | [optional]
17
+ **screen_size** | **String** | Screen size small, medium or large | [optional]
16
18
  **storefront_host_name** | **String** | StoreFront host name associated with the order | [optional]
17
19
  **upsell_path_code** | **String** | Upsell path code assigned during the checkout that the customer went through | [optional]
18
20
 
data/docs/OrderItem.md CHANGED
@@ -49,6 +49,7 @@ Name | Type | Description | Notes
49
49
  **special_product_type** | **String** | Special product type (USPS Media Mail) | [optional]
50
50
  **tags** | [**Array<OrderItemTag>**](OrderItemTag.md) | Tags | [optional]
51
51
  **tax_free** | **BOOLEAN** | True if the item is tax free | [optional]
52
+ **tax_product_type** | **String** | Type of product for tax purposes (self or UltraCart Managed taxes) | [optional]
52
53
  **taxable_cost** | [**Currency**](Currency.md) | | [optional]
53
54
  **total_cost_with_discount** | [**Currency**](Currency.md) | | [optional]
54
55
  **total_refunded** | [**Currency**](Currency.md) | | [optional]
@@ -4,6 +4,9 @@
4
4
  Name | Type | Description | Notes
5
5
  ------------ | ------------- | ------------- | -------------
6
6
  **enabled** | **BOOLEAN** | True if this state taxes are managed by UltraCart | [optional]
7
+ **exempt_digital_items** | **BOOLEAN** | True if digital items are exempt from sales tax in this state. | [optional]
8
+ **exempt_physical_items** | **BOOLEAN** | True if physical items are exempt from sales tax in this state. | [optional]
9
+ **exempt_service_items** | **BOOLEAN** | True if service items are exempt from sales tax in this state. | [optional]
7
10
  **state_code** | **String** | State Code (2 digits) | [optional]
8
11
  **state_name** | **String** | Fully spelled out state name | [optional]
9
12
  **tax_gift_charge** | **BOOLEAN** | True if gift charges should be taxed in this state. | [optional]
data/docs/TaxState.md CHANGED
@@ -10,6 +10,9 @@ Name | Type | Description | Notes
10
10
  **dont_collect_county** | **BOOLEAN** | Flag instructing engine to not collect county tax for this state | [optional]
11
11
  **dont_collect_postal_code** | **BOOLEAN** | Flag instructing engine to not collect postal code tax for this state | [optional]
12
12
  **dont_collect_state** | **BOOLEAN** | Flag instructing engine to not collect state tax for this state | [optional]
13
+ **exempt_digital_items** | **BOOLEAN** | True if digital items are exempt from sales tax in this state. | [optional]
14
+ **exempt_physical_items** | **BOOLEAN** | True if physical items are exempt from sales tax in this state. | [optional]
15
+ **exempt_service_items** | **BOOLEAN** | True if service items are exempt from sales tax in this state. | [optional]
13
16
  **state_code** | **String** | State code | [optional]
14
17
  **state_oid** | **Integer** | Tax record object identifier used internally by database | [optional]
15
18
  **tax_gift_charge** | **BOOLEAN** | True if taxation within this jurisdiction should charge tax on gift charge | [optional]
@@ -20,6 +20,9 @@ module UltracartClient
20
20
  # Cjson to be added to library
21
21
  attr_accessor :cjson
22
22
 
23
+ # Additional Cjson to be added to library, notably for the postcard which has a front and back.
24
+ attr_accessor :cjson2
25
+
23
26
  # flow, campaign, cjson, email, transactional_email, postcard or upsell
24
27
  attr_accessor :content_type
25
28
 
@@ -52,6 +55,7 @@ module UltracartClient
52
55
  {
53
56
  :'attributes' => :'attributes',
54
57
  :'cjson' => :'cjson',
58
+ :'cjson2' => :'cjson2',
55
59
  :'content_type' => :'content_type',
56
60
  :'description' => :'description',
57
61
  :'email_name' => :'email_name',
@@ -69,6 +73,7 @@ module UltracartClient
69
73
  {
70
74
  :'attributes' => :'Array<LibraryItemAttribute>',
71
75
  :'cjson' => :'String',
76
+ :'cjson2' => :'String',
72
77
  :'content_type' => :'String',
73
78
  :'description' => :'String',
74
79
  :'email_name' => :'String',
@@ -99,6 +104,10 @@ module UltracartClient
99
104
  self.cjson = attributes[:'cjson']
100
105
  end
101
106
 
107
+ if attributes.has_key?(:'cjson2')
108
+ self.cjson2 = attributes[:'cjson2']
109
+ end
110
+
102
111
  if attributes.has_key?(:'content_type')
103
112
  self.content_type = attributes[:'content_type']
104
113
  end
@@ -158,6 +167,7 @@ module UltracartClient
158
167
  self.class == o.class &&
159
168
  attributes == o.attributes &&
160
169
  cjson == o.cjson &&
170
+ cjson2 == o.cjson2 &&
161
171
  content_type == o.content_type &&
162
172
  description == o.description &&
163
173
  email_name == o.email_name &&
@@ -178,7 +188,7 @@ module UltracartClient
178
188
  # Calculates hash code according to all attributes.
179
189
  # @return [Fixnum] Hash code
180
190
  def hash
181
- [attributes, cjson, content_type, description, email_name, email_path, screenshots, storefront_oid, title, upsell_offer_oid, uuid].hash
191
+ [attributes, cjson, cjson2, content_type, description, email_name, email_path, screenshots, storefront_oid, title, upsell_offer_oid, uuid].hash
182
192
  end
183
193
 
184
194
  # Builds the object from hash
@@ -0,0 +1,202 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.15-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module UltracartClient
16
+ class Browser
17
+ attr_accessor :device
18
+
19
+ attr_accessor :os
20
+
21
+ attr_accessor :user_agent
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'device' => :'device',
27
+ :'os' => :'os',
28
+ :'user_agent' => :'user_agent'
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.swagger_types
34
+ {
35
+ :'device' => :'BrowserDevice',
36
+ :'os' => :'BrowserOS',
37
+ :'user_agent' => :'BrowserUserAgent'
38
+ }
39
+ end
40
+
41
+ # Initializes the object
42
+ # @param [Hash] attributes Model attributes in the form of hash
43
+ def initialize(attributes = {})
44
+ return unless attributes.is_a?(Hash)
45
+
46
+ # convert string to symbol for hash key
47
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
48
+
49
+ if attributes.has_key?(:'device')
50
+ self.device = attributes[:'device']
51
+ end
52
+
53
+ if attributes.has_key?(:'os')
54
+ self.os = attributes[:'os']
55
+ end
56
+
57
+ if attributes.has_key?(:'user_agent')
58
+ self.user_agent = attributes[:'user_agent']
59
+ end
60
+ end
61
+
62
+ # Show invalid properties with the reasons. Usually used together with valid?
63
+ # @return Array for valid properties with the reasons
64
+ def list_invalid_properties
65
+ invalid_properties = Array.new
66
+ invalid_properties
67
+ end
68
+
69
+ # Check to see if the all the properties in the model are valid
70
+ # @return true if the model is valid
71
+ def valid?
72
+ true
73
+ end
74
+
75
+ # Checks equality by comparing each attribute.
76
+ # @param [Object] Object to be compared
77
+ def ==(o)
78
+ return true if self.equal?(o)
79
+ self.class == o.class &&
80
+ device == o.device &&
81
+ os == o.os &&
82
+ user_agent == o.user_agent
83
+ end
84
+
85
+ # @see the `==` method
86
+ # @param [Object] Object to be compared
87
+ def eql?(o)
88
+ self == o
89
+ end
90
+
91
+ # Calculates hash code according to all attributes.
92
+ # @return [Fixnum] Hash code
93
+ def hash
94
+ [device, os, user_agent].hash
95
+ end
96
+
97
+ # Builds the object from hash
98
+ # @param [Hash] attributes Model attributes in the form of hash
99
+ # @return [Object] Returns the model itself
100
+ def build_from_hash(attributes)
101
+ return nil unless attributes.is_a?(Hash)
102
+ self.class.swagger_types.each_pair do |key, type|
103
+ if type =~ /\AArray<(.*)>/i
104
+ # check to ensure the input is an array given that the attribute
105
+ # is documented as an array but the input is not
106
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
107
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
108
+ end
109
+ elsif !attributes[self.class.attribute_map[key]].nil?
110
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
111
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
112
+ end
113
+
114
+ self
115
+ end
116
+
117
+ # Deserializes the data based on type
118
+ # @param string type Data type
119
+ # @param string value Value to be deserialized
120
+ # @return [Object] Deserialized data
121
+ def _deserialize(type, value)
122
+ case type.to_sym
123
+ when :DateTime
124
+ DateTime.parse(value)
125
+ when :Date
126
+ Date.parse(value)
127
+ when :String
128
+ value.to_s
129
+ when :Integer
130
+ value.to_i
131
+ when :Float
132
+ value.to_f
133
+ when :BOOLEAN
134
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
135
+ true
136
+ else
137
+ false
138
+ end
139
+ when :Object
140
+ # generic object (usually a Hash), return directly
141
+ value
142
+ when /\AArray<(?<inner_type>.+)>\z/
143
+ inner_type = Regexp.last_match[:inner_type]
144
+ value.map { |v| _deserialize(inner_type, v) }
145
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
146
+ k_type = Regexp.last_match[:k_type]
147
+ v_type = Regexp.last_match[:v_type]
148
+ {}.tap do |hash|
149
+ value.each do |k, v|
150
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
151
+ end
152
+ end
153
+ else # model
154
+ temp_model = UltracartClient.const_get(type).new
155
+ temp_model.build_from_hash(value)
156
+ end
157
+ end
158
+
159
+ # Returns the string representation of the object
160
+ # @return [String] String presentation of the object
161
+ def to_s
162
+ to_hash.to_s
163
+ end
164
+
165
+ # to_body is an alias to to_hash (backward compatibility)
166
+ # @return [Hash] Returns the object in the form of hash
167
+ def to_body
168
+ to_hash
169
+ end
170
+
171
+ # Returns the object in the form of hash
172
+ # @return [Hash] Returns the object in the form of hash
173
+ def to_hash
174
+ hash = {}
175
+ self.class.attribute_map.each_pair do |attr, param|
176
+ value = self.send(attr)
177
+ next if value.nil?
178
+ hash[param] = _to_hash(value)
179
+ end
180
+ hash
181
+ end
182
+
183
+ # Outputs non-array value in the form of hash
184
+ # For object, use to_hash. Otherwise, just return the value
185
+ # @param [Object] value Any valid value
186
+ # @return [Hash] Returns the value in the form of hash
187
+ def _to_hash(value)
188
+ if value.is_a?(Array)
189
+ value.compact.map { |v| _to_hash(v) }
190
+ elsif value.is_a?(Hash)
191
+ {}.tap do |hash|
192
+ value.each { |k, v| hash[k] = _to_hash(v) }
193
+ end
194
+ elsif value.respond_to? :to_hash
195
+ value.to_hash
196
+ else
197
+ value
198
+ end
199
+ end
200
+
201
+ end
202
+ end
@@ -0,0 +1,184 @@
1
+ =begin
2
+ #UltraCart Rest API V2
3
+
4
+ #UltraCart REST API Version 2
5
+
6
+ OpenAPI spec version: 2.0.0
7
+ Contact: support@ultracart.com
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.15-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module UltracartClient
16
+ class BrowserDevice
17
+ attr_accessor :family
18
+
19
+ # Attribute mapping from ruby-style variable name to JSON key.
20
+ def self.attribute_map
21
+ {
22
+ :'family' => :'family'
23
+ }
24
+ end
25
+
26
+ # Attribute type mapping.
27
+ def self.swagger_types
28
+ {
29
+ :'family' => :'String'
30
+ }
31
+ end
32
+
33
+ # Initializes the object
34
+ # @param [Hash] attributes Model attributes in the form of hash
35
+ def initialize(attributes = {})
36
+ return unless attributes.is_a?(Hash)
37
+
38
+ # convert string to symbol for hash key
39
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
40
+
41
+ if attributes.has_key?(:'family')
42
+ self.family = attributes[:'family']
43
+ end
44
+ end
45
+
46
+ # Show invalid properties with the reasons. Usually used together with valid?
47
+ # @return Array for valid properties with the reasons
48
+ def list_invalid_properties
49
+ invalid_properties = Array.new
50
+ invalid_properties
51
+ end
52
+
53
+ # Check to see if the all the properties in the model are valid
54
+ # @return true if the model is valid
55
+ def valid?
56
+ true
57
+ end
58
+
59
+ # Checks equality by comparing each attribute.
60
+ # @param [Object] Object to be compared
61
+ def ==(o)
62
+ return true if self.equal?(o)
63
+ self.class == o.class &&
64
+ family == o.family
65
+ end
66
+
67
+ # @see the `==` method
68
+ # @param [Object] Object to be compared
69
+ def eql?(o)
70
+ self == o
71
+ end
72
+
73
+ # Calculates hash code according to all attributes.
74
+ # @return [Fixnum] Hash code
75
+ def hash
76
+ [family].hash
77
+ end
78
+
79
+ # Builds the object from hash
80
+ # @param [Hash] attributes Model attributes in the form of hash
81
+ # @return [Object] Returns the model itself
82
+ def build_from_hash(attributes)
83
+ return nil unless attributes.is_a?(Hash)
84
+ self.class.swagger_types.each_pair do |key, type|
85
+ if type =~ /\AArray<(.*)>/i
86
+ # check to ensure the input is an array given that the attribute
87
+ # is documented as an array but the input is not
88
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
89
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
90
+ end
91
+ elsif !attributes[self.class.attribute_map[key]].nil?
92
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
93
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
94
+ end
95
+
96
+ self
97
+ end
98
+
99
+ # Deserializes the data based on type
100
+ # @param string type Data type
101
+ # @param string value Value to be deserialized
102
+ # @return [Object] Deserialized data
103
+ def _deserialize(type, value)
104
+ case type.to_sym
105
+ when :DateTime
106
+ DateTime.parse(value)
107
+ when :Date
108
+ Date.parse(value)
109
+ when :String
110
+ value.to_s
111
+ when :Integer
112
+ value.to_i
113
+ when :Float
114
+ value.to_f
115
+ when :BOOLEAN
116
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
117
+ true
118
+ else
119
+ false
120
+ end
121
+ when :Object
122
+ # generic object (usually a Hash), return directly
123
+ value
124
+ when /\AArray<(?<inner_type>.+)>\z/
125
+ inner_type = Regexp.last_match[:inner_type]
126
+ value.map { |v| _deserialize(inner_type, v) }
127
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
128
+ k_type = Regexp.last_match[:k_type]
129
+ v_type = Regexp.last_match[:v_type]
130
+ {}.tap do |hash|
131
+ value.each do |k, v|
132
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
133
+ end
134
+ end
135
+ else # model
136
+ temp_model = UltracartClient.const_get(type).new
137
+ temp_model.build_from_hash(value)
138
+ end
139
+ end
140
+
141
+ # Returns the string representation of the object
142
+ # @return [String] String presentation of the object
143
+ def to_s
144
+ to_hash.to_s
145
+ end
146
+
147
+ # to_body is an alias to to_hash (backward compatibility)
148
+ # @return [Hash] Returns the object in the form of hash
149
+ def to_body
150
+ to_hash
151
+ end
152
+
153
+ # Returns the object in the form of hash
154
+ # @return [Hash] Returns the object in the form of hash
155
+ def to_hash
156
+ hash = {}
157
+ self.class.attribute_map.each_pair do |attr, param|
158
+ value = self.send(attr)
159
+ next if value.nil?
160
+ hash[param] = _to_hash(value)
161
+ end
162
+ hash
163
+ end
164
+
165
+ # Outputs non-array value in the form of hash
166
+ # For object, use to_hash. Otherwise, just return the value
167
+ # @param [Object] value Any valid value
168
+ # @return [Hash] Returns the value in the form of hash
169
+ def _to_hash(value)
170
+ if value.is_a?(Array)
171
+ value.compact.map { |v| _to_hash(v) }
172
+ elsif value.is_a?(Hash)
173
+ {}.tap do |hash|
174
+ value.each { |k, v| hash[k] = _to_hash(v) }
175
+ end
176
+ elsif value.respond_to? :to_hash
177
+ value.to_hash
178
+ else
179
+ value
180
+ end
181
+ end
182
+
183
+ end
184
+ end