late-sdk 0.0.1501 → 0.0.1502

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: d85bb4156dae150be5ab754baccaee3d0d8a5315c4bdd612c1fac9777bed06b3
4
- data.tar.gz: a6069b9fff8fde9f8a4bcd15df71d7a326495486710758ed9ae48b01ed611034
3
+ metadata.gz: 25481b5b429bb2072fbfa1b87740382de5bee2f2bcf46e0073d72ee893776cdb
4
+ data.tar.gz: 2650e6bac4b426a7cb6ff38a43d9b69a7b4b4c2e89f6c0c45fcb46457a76fec6
5
5
  SHA512:
6
- metadata.gz: fa2d68ee989341457171b796dd90358bb001f516abfe586af6fac110f1d4c0b5af94421f602a674b2e15e44ea02c1d8b554741dc850ed1914e18cb560d904a08
7
- data.tar.gz: e899c8709d31cbe3ab9b0217bef8ceb41d09ca659d845d8a1b41f1ce9371a33db1e0d98068c93758c10f4cc8eb58b972feb9ff0a9ee263ab2304dddd6a4ec043
6
+ metadata.gz: 8af57af3e34244b70fee578fd6594ad1ae65bd9beab5f61e3a78ff7e2e71f393b32ff896f35e7137923f90f7814de2eca6ed330a5fb5791bbe7d55e53313ea7f
7
+ data.tar.gz: 33e46b53973597b8ee7cb2a2be788fea1775687fb36e4996e694336da148c1f782e4d6aa51a9e024e15238310728526133f9bcf2575e482c0adfcb1546c3e82e
data/README.md CHANGED
@@ -1408,6 +1408,7 @@ Class | Method | HTTP request | Description
1408
1408
  - [Zernio::CommerceMetaobjectFieldsInner](docs/CommerceMetaobjectFieldsInner.md)
1409
1409
  - [Zernio::CommerceMoney](docs/CommerceMoney.md)
1410
1410
  - [Zernio::CommerceOrder](docs/CommerceOrder.md)
1411
+ - [Zernio::CommerceOrderAttribution](docs/CommerceOrderAttribution.md)
1411
1412
  - [Zernio::CommerceOrderChargeLine](docs/CommerceOrderChargeLine.md)
1412
1413
  - [Zernio::CommerceOrderCustomer](docs/CommerceOrderCustomer.md)
1413
1414
  - [Zernio::CommerceOrderFulfillmentsInner](docs/CommerceOrderFulfillmentsInner.md)
@@ -1415,6 +1416,8 @@ Class | Method | HTTP request | Description
1415
1416
  - [Zernio::CommerceOrderRefundsInner](docs/CommerceOrderRefundsInner.md)
1416
1417
  - [Zernio::CommerceOrderRefundsInnerLineItemsInner](docs/CommerceOrderRefundsInnerLineItemsInner.md)
1417
1418
  - [Zernio::CommerceOrderStatus](docs/CommerceOrderStatus.md)
1419
+ - [Zernio::CommerceOrderVisit](docs/CommerceOrderVisit.md)
1420
+ - [Zernio::CommerceOrderVisitUtm](docs/CommerceOrderVisitUtm.md)
1418
1421
  - [Zernio::CommercePage](docs/CommercePage.md)
1419
1422
  - [Zernio::CommercePriceList](docs/CommercePriceList.md)
1420
1423
  - [Zernio::CommerceProduct](docs/CommerceProduct.md)
@@ -31,6 +31,7 @@
31
31
  | **billing_address** | [**CommerceAddress**](CommerceAddress.md) | | [optional] |
32
32
  | **shipping_address** | [**CommerceAddress**](CommerceAddress.md) | | [optional] |
33
33
  | **buyer_note** | **String** | | [optional] |
34
+ | **attribution** | [**CommerceOrderAttribution**](CommerceOrderAttribution.md) | | [optional] |
34
35
  | **line_items** | [**Array<CommerceOrderLineItemsInner>**](CommerceOrderLineItemsInner.md) | | [optional] |
35
36
  | **shipping_lines** | [**Array<CommerceOrderChargeLine>**](CommerceOrderChargeLine.md) | | [optional] |
36
37
  | **fee_lines** | [**Array<CommerceOrderChargeLine>**](CommerceOrderChargeLine.md) | WooCommerce fees. Always empty on Shopify. | [optional] |
@@ -72,6 +73,7 @@ instance = Zernio::CommerceOrder.new(
72
73
  billing_address: null,
73
74
  shipping_address: null,
74
75
  buyer_note: null,
76
+ attribution: null,
75
77
  line_items: null,
76
78
  shipping_lines: null,
77
79
  fee_lines: null,
@@ -0,0 +1,24 @@
1
+ # Zernio::CommerceOrderAttribution
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **ready** | **Boolean** | False while Shopify is still attributing a new order. No webhook fires when it becomes true, so read the order again later. Always true on WooCommerce. | [optional] |
8
+ | **first_visit** | [**CommerceOrderVisit**](CommerceOrderVisit.md) | | [optional] |
9
+ | **last_visit** | [**CommerceOrderVisit**](CommerceOrderVisit.md) | | [optional] |
10
+ | **custom_attributes** | [**Array<BoostPostRequestTrackingUrlTagsInner>**](BoostPostRequestTrackingUrlTagsInner.md) | Shopify cart and note attributes, or WooCommerce public order meta. | [optional] |
11
+
12
+ ## Example
13
+
14
+ ```ruby
15
+ require 'zernio-sdk'
16
+
17
+ instance = Zernio::CommerceOrderAttribution.new(
18
+ ready: null,
19
+ first_visit: null,
20
+ last_visit: null,
21
+ custom_attributes: null
22
+ )
23
+ ```
24
+
@@ -0,0 +1,28 @@
1
+ # Zernio::CommerceOrderVisit
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **occurred_at** | **Time** | Null on WooCommerce, which records the session start without a timezone. | [optional] |
8
+ | **landing_url** | **String** | The first page of the session, with its query string. | [optional] |
9
+ | **referrer_url** | **String** | | [optional] |
10
+ | **source** | **String** | Where the visit came from, as the platform names it. | [optional] |
11
+ | **source_type** | **String** | Shopify marketing tactic (e.g. SOCIAL, AD, SEARCH) or WooCommerce source type (utm, organic, referral, typein, admin). | [optional] |
12
+ | **utm** | [**CommerceOrderVisitUtm**](CommerceOrderVisitUtm.md) | | [optional] |
13
+
14
+ ## Example
15
+
16
+ ```ruby
17
+ require 'zernio-sdk'
18
+
19
+ instance = Zernio::CommerceOrderVisit.new(
20
+ occurred_at: null,
21
+ landing_url: null,
22
+ referrer_url: null,
23
+ source: instagram,
24
+ source_type: null,
25
+ utm: null
26
+ )
27
+ ```
28
+
@@ -0,0 +1,26 @@
1
+ # Zernio::CommerceOrderVisitUtm
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **source** | **String** | | [optional] |
8
+ | **medium** | **String** | | [optional] |
9
+ | **campaign** | **String** | | [optional] |
10
+ | **term** | **String** | | [optional] |
11
+ | **content** | **String** | | [optional] |
12
+
13
+ ## Example
14
+
15
+ ```ruby
16
+ require 'zernio-sdk'
17
+
18
+ instance = Zernio::CommerceOrderVisitUtm.new(
19
+ source: null,
20
+ medium: null,
21
+ campaign: null,
22
+ term: null,
23
+ content: null
24
+ )
25
+ ```
26
+
@@ -77,6 +77,8 @@ module Zernio
77
77
 
78
78
  attr_accessor :buyer_note
79
79
 
80
+ attr_accessor :attribution
81
+
80
82
  attr_accessor :line_items
81
83
 
82
84
  attr_accessor :shipping_lines
@@ -146,6 +148,7 @@ module Zernio
146
148
  :'billing_address' => :'billingAddress',
147
149
  :'shipping_address' => :'shippingAddress',
148
150
  :'buyer_note' => :'buyerNote',
151
+ :'attribution' => :'attribution',
149
152
  :'line_items' => :'lineItems',
150
153
  :'shipping_lines' => :'shippingLines',
151
154
  :'fee_lines' => :'feeLines',
@@ -196,6 +199,7 @@ module Zernio
196
199
  :'billing_address' => :'CommerceAddress',
197
200
  :'shipping_address' => :'CommerceAddress',
198
201
  :'buyer_note' => :'String',
202
+ :'attribution' => :'CommerceOrderAttribution',
199
203
  :'line_items' => :'Array<CommerceOrderLineItemsInner>',
200
204
  :'shipping_lines' => :'Array<CommerceOrderChargeLine>',
201
205
  :'fee_lines' => :'Array<CommerceOrderChargeLine>',
@@ -349,6 +353,10 @@ module Zernio
349
353
  self.buyer_note = attributes[:'buyer_note']
350
354
  end
351
355
 
356
+ if attributes.key?(:'attribution')
357
+ self.attribution = attributes[:'attribution']
358
+ end
359
+
352
360
  if attributes.key?(:'line_items')
353
361
  if (value = attributes[:'line_items']).is_a?(Array)
354
362
  self.line_items = value
@@ -463,6 +471,7 @@ module Zernio
463
471
  billing_address == o.billing_address &&
464
472
  shipping_address == o.shipping_address &&
465
473
  buyer_note == o.buyer_note &&
474
+ attribution == o.attribution &&
466
475
  line_items == o.line_items &&
467
476
  shipping_lines == o.shipping_lines &&
468
477
  fee_lines == o.fee_lines &&
@@ -481,7 +490,7 @@ module Zernio
481
490
  # Calculates hash code according to all attributes.
482
491
  # @return [Integer] Hash code
483
492
  def hash
484
- [id, account_id, platform, number, status, platform_status, payment_status, platform_payment_status, currency, taxes_included, created_at, updated_at, paid_at, cancelled_at, cancel_reason, subtotal, discount_total, shipping_total, tax_total, total, refunded_total, discount_codes, payment_methods, customer, billing_address, shipping_address, buyer_note, line_items, shipping_lines, fee_lines, tax_lines, refunds, fulfillments, platform_data].hash
493
+ [id, account_id, platform, number, status, platform_status, payment_status, platform_payment_status, currency, taxes_included, created_at, updated_at, paid_at, cancelled_at, cancel_reason, subtotal, discount_total, shipping_total, tax_total, total, refunded_total, discount_codes, payment_methods, customer, billing_address, shipping_address, buyer_note, attribution, line_items, shipping_lines, fee_lines, tax_lines, refunds, fulfillments, platform_data].hash
485
494
  end
486
495
 
487
496
  # Builds the object from hash
@@ -0,0 +1,181 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema). Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
5
+
6
+ The version of the OpenAPI document: 1.332.0
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zernio
17
+ # Where the order came from. Shopify reads it from the customer journey, WooCommerce from its order attribution (WooCommerce 8.5+ with the feature on, orders placed after it was turned on).
18
+ class CommerceOrderAttribution < ApiModelBase
19
+ # False while Shopify is still attributing a new order. No webhook fires when it becomes true, so read the order again later. Always true on WooCommerce.
20
+ attr_accessor :ready
21
+
22
+ attr_accessor :first_visit
23
+
24
+ attr_accessor :last_visit
25
+
26
+ # Shopify cart and note attributes, or WooCommerce public order meta.
27
+ attr_accessor :custom_attributes
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :'ready' => :'ready',
33
+ :'first_visit' => :'firstVisit',
34
+ :'last_visit' => :'lastVisit',
35
+ :'custom_attributes' => :'customAttributes'
36
+ }
37
+ end
38
+
39
+ # Returns attribute mapping this model knows about
40
+ def self.acceptable_attribute_map
41
+ attribute_map
42
+ end
43
+
44
+ # Returns all the JSON keys this model knows about
45
+ def self.acceptable_attributes
46
+ acceptable_attribute_map.values
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.openapi_types
51
+ {
52
+ :'ready' => :'Boolean',
53
+ :'first_visit' => :'CommerceOrderVisit',
54
+ :'last_visit' => :'CommerceOrderVisit',
55
+ :'custom_attributes' => :'Array<BoostPostRequestTrackingUrlTagsInner>'
56
+ }
57
+ end
58
+
59
+ # List of attributes with nullable: true
60
+ def self.openapi_nullable
61
+ Set.new([
62
+ :'first_visit',
63
+ :'last_visit',
64
+ ])
65
+ end
66
+
67
+ # Initializes the object
68
+ # @param [Hash] attributes Model attributes in the form of hash
69
+ def initialize(attributes = {})
70
+ if (!attributes.is_a?(Hash))
71
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::CommerceOrderAttribution` initialize method"
72
+ end
73
+
74
+ # check to see if the attribute exists and convert string to symbol for hash key
75
+ acceptable_attribute_map = self.class.acceptable_attribute_map
76
+ attributes = attributes.each_with_object({}) { |(k, v), h|
77
+ if (!acceptable_attribute_map.key?(k.to_sym))
78
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::CommerceOrderAttribution`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
79
+ end
80
+ h[k.to_sym] = v
81
+ }
82
+
83
+ if attributes.key?(:'ready')
84
+ self.ready = attributes[:'ready']
85
+ end
86
+
87
+ if attributes.key?(:'first_visit')
88
+ self.first_visit = attributes[:'first_visit']
89
+ end
90
+
91
+ if attributes.key?(:'last_visit')
92
+ self.last_visit = attributes[:'last_visit']
93
+ end
94
+
95
+ if attributes.key?(:'custom_attributes')
96
+ if (value = attributes[:'custom_attributes']).is_a?(Array)
97
+ self.custom_attributes = value
98
+ end
99
+ end
100
+ end
101
+
102
+ # Show invalid properties with the reasons. Usually used together with valid?
103
+ # @return Array for valid properties with the reasons
104
+ def list_invalid_properties
105
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
106
+ invalid_properties = Array.new
107
+ invalid_properties
108
+ end
109
+
110
+ # Check to see if the all the properties in the model are valid
111
+ # @return true if the model is valid
112
+ def valid?
113
+ warn '[DEPRECATED] the `valid?` method is obsolete'
114
+ true
115
+ end
116
+
117
+ # Checks equality by comparing each attribute.
118
+ # @param [Object] Object to be compared
119
+ def ==(o)
120
+ return true if self.equal?(o)
121
+ self.class == o.class &&
122
+ ready == o.ready &&
123
+ first_visit == o.first_visit &&
124
+ last_visit == o.last_visit &&
125
+ custom_attributes == o.custom_attributes
126
+ end
127
+
128
+ # @see the `==` method
129
+ # @param [Object] Object to be compared
130
+ def eql?(o)
131
+ self == o
132
+ end
133
+
134
+ # Calculates hash code according to all attributes.
135
+ # @return [Integer] Hash code
136
+ def hash
137
+ [ready, first_visit, last_visit, custom_attributes].hash
138
+ end
139
+
140
+ # Builds the object from hash
141
+ # @param [Hash] attributes Model attributes in the form of hash
142
+ # @return [Object] Returns the model itself
143
+ def self.build_from_hash(attributes)
144
+ return nil unless attributes.is_a?(Hash)
145
+ attributes = attributes.transform_keys(&:to_sym)
146
+ transformed_hash = {}
147
+ openapi_types.each_pair do |key, type|
148
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
149
+ transformed_hash["#{key}"] = nil
150
+ elsif type =~ /\AArray<(.*)>/i
151
+ # check to ensure the input is an array given that the attribute
152
+ # is documented as an array but the input is not
153
+ if attributes[attribute_map[key]].is_a?(Array)
154
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
155
+ end
156
+ elsif !attributes[attribute_map[key]].nil?
157
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
158
+ end
159
+ end
160
+ new(transformed_hash)
161
+ end
162
+
163
+ # Returns the object in the form of hash
164
+ # @return [Hash] Returns the object in the form of hash
165
+ def to_hash
166
+ hash = {}
167
+ self.class.attribute_map.each_pair do |attr, param|
168
+ value = self.send(attr)
169
+ if value.nil?
170
+ is_nullable = self.class.openapi_nullable.include?(attr)
171
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
172
+ end
173
+
174
+ hash[param] = _to_hash(value)
175
+ end
176
+ hash
177
+ end
178
+
179
+ end
180
+
181
+ end
@@ -0,0 +1,202 @@
1
+ =begin
2
+ #Zernio API
3
+
4
+ #API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema). Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
5
+
6
+ The version of the OpenAPI document: 1.332.0
7
+ Contact: support@zernio.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.19.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Zernio
17
+ # A store session that led to the order.
18
+ class CommerceOrderVisit < ApiModelBase
19
+ # Null on WooCommerce, which records the session start without a timezone.
20
+ attr_accessor :occurred_at
21
+
22
+ # The first page of the session, with its query string.
23
+ attr_accessor :landing_url
24
+
25
+ attr_accessor :referrer_url
26
+
27
+ # Where the visit came from, as the platform names it.
28
+ attr_accessor :source
29
+
30
+ # Shopify marketing tactic (e.g. SOCIAL, AD, SEARCH) or WooCommerce source type (utm, organic, referral, typein, admin).
31
+ attr_accessor :source_type
32
+
33
+ attr_accessor :utm
34
+
35
+ # Attribute mapping from ruby-style variable name to JSON key.
36
+ def self.attribute_map
37
+ {
38
+ :'occurred_at' => :'occurredAt',
39
+ :'landing_url' => :'landingUrl',
40
+ :'referrer_url' => :'referrerUrl',
41
+ :'source' => :'source',
42
+ :'source_type' => :'sourceType',
43
+ :'utm' => :'utm'
44
+ }
45
+ end
46
+
47
+ # Returns attribute mapping this model knows about
48
+ def self.acceptable_attribute_map
49
+ attribute_map
50
+ end
51
+
52
+ # Returns all the JSON keys this model knows about
53
+ def self.acceptable_attributes
54
+ acceptable_attribute_map.values
55
+ end
56
+
57
+ # Attribute type mapping.
58
+ def self.openapi_types
59
+ {
60
+ :'occurred_at' => :'Time',
61
+ :'landing_url' => :'String',
62
+ :'referrer_url' => :'String',
63
+ :'source' => :'String',
64
+ :'source_type' => :'String',
65
+ :'utm' => :'CommerceOrderVisitUtm'
66
+ }
67
+ end
68
+
69
+ # List of attributes with nullable: true
70
+ def self.openapi_nullable
71
+ Set.new([
72
+ :'occurred_at',
73
+ :'landing_url',
74
+ :'referrer_url',
75
+ :'source',
76
+ :'source_type',
77
+ ])
78
+ end
79
+
80
+ # Initializes the object
81
+ # @param [Hash] attributes Model attributes in the form of hash
82
+ def initialize(attributes = {})
83
+ if (!attributes.is_a?(Hash))
84
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::CommerceOrderVisit` initialize method"
85
+ end
86
+
87
+ # check to see if the attribute exists and convert string to symbol for hash key
88
+ acceptable_attribute_map = self.class.acceptable_attribute_map
89
+ attributes = attributes.each_with_object({}) { |(k, v), h|
90
+ if (!acceptable_attribute_map.key?(k.to_sym))
91
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::CommerceOrderVisit`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
92
+ end
93
+ h[k.to_sym] = v
94
+ }
95
+
96
+ if attributes.key?(:'occurred_at')
97
+ self.occurred_at = attributes[:'occurred_at']
98
+ end
99
+
100
+ if attributes.key?(:'landing_url')
101
+ self.landing_url = attributes[:'landing_url']
102
+ end
103
+
104
+ if attributes.key?(:'referrer_url')
105
+ self.referrer_url = attributes[:'referrer_url']
106
+ end
107
+
108
+ if attributes.key?(:'source')
109
+ self.source = attributes[:'source']
110
+ end
111
+
112
+ if attributes.key?(:'source_type')
113
+ self.source_type = attributes[:'source_type']
114
+ end
115
+
116
+ if attributes.key?(:'utm')
117
+ self.utm = attributes[:'utm']
118
+ end
119
+ end
120
+
121
+ # Show invalid properties with the reasons. Usually used together with valid?
122
+ # @return Array for valid properties with the reasons
123
+ def list_invalid_properties
124
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
125
+ invalid_properties = Array.new
126
+ invalid_properties
127
+ end
128
+
129
+ # Check to see if the all the properties in the model are valid
130
+ # @return true if the model is valid
131
+ def valid?
132
+ warn '[DEPRECATED] the `valid?` method is obsolete'
133
+ true
134
+ end
135
+
136
+ # Checks equality by comparing each attribute.
137
+ # @param [Object] Object to be compared
138
+ def ==(o)
139
+ return true if self.equal?(o)
140
+ self.class == o.class &&
141
+ occurred_at == o.occurred_at &&
142
+ landing_url == o.landing_url &&
143
+ referrer_url == o.referrer_url &&
144
+ source == o.source &&
145
+ source_type == o.source_type &&
146
+ utm == o.utm
147
+ end
148
+
149
+ # @see the `==` method
150
+ # @param [Object] Object to be compared
151
+ def eql?(o)
152
+ self == o
153
+ end
154
+
155
+ # Calculates hash code according to all attributes.
156
+ # @return [Integer] Hash code
157
+ def hash
158
+ [occurred_at, landing_url, referrer_url, source, source_type, utm].hash
159
+ end
160
+
161
+ # Builds the object from hash
162
+ # @param [Hash] attributes Model attributes in the form of hash
163
+ # @return [Object] Returns the model itself
164
+ def self.build_from_hash(attributes)
165
+ return nil unless attributes.is_a?(Hash)
166
+ attributes = attributes.transform_keys(&:to_sym)
167
+ transformed_hash = {}
168
+ openapi_types.each_pair do |key, type|
169
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
170
+ transformed_hash["#{key}"] = nil
171
+ elsif type =~ /\AArray<(.*)>/i
172
+ # check to ensure the input is an array given that the attribute
173
+ # is documented as an array but the input is not
174
+ if attributes[attribute_map[key]].is_a?(Array)
175
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
176
+ end
177
+ elsif !attributes[attribute_map[key]].nil?
178
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
179
+ end
180
+ end
181
+ new(transformed_hash)
182
+ end
183
+
184
+ # Returns the object in the form of hash
185
+ # @return [Hash] Returns the object in the form of hash
186
+ def to_hash
187
+ hash = {}
188
+ self.class.attribute_map.each_pair do |attr, param|
189
+ value = self.send(attr)
190
+ if value.nil?
191
+ is_nullable = self.class.openapi_nullable.include?(attr)
192
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
193
+ end
194
+
195
+ hash[param] = _to_hash(value)
196
+ end
197
+ hash
198
+ end
199
+
200
+ end
201
+
202
+ end