ultracart_api 4.0.103.rc → 4.0.105.rc

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: 863c755bc404ed1ae18d8c3c38b32160ae1f4dd4d15c23fbcdd726fc840a27a0
4
- data.tar.gz: 50ed92c2b89e35fd855428b123aec0ac7985fee17f8997f71be58c9ce3ded267
3
+ metadata.gz: 7f7174c109c96abdf724420526ec5b0f6a1b6393c9185e94086abaac89f43fba
4
+ data.tar.gz: 74b4401268c2324fc6c70ee31136f44a3a519246364ac0fb7dae6064efd10648
5
5
  SHA512:
6
- metadata.gz: 910c7d48bb30def245e60aea214d2da7b696339bccf53b9392d1359b242d98efb7fd07ddb1f2748bcf532ff3759cbaf0f5ddd458ca3d57bd51cf8543570e86f0
7
- data.tar.gz: 271d69adb4e1d7c2638a1984685b90b6779e8a63fc8962d6c054f67520e6a3d89735e2919140b5e8d2c4edffd13ae59f6ae920ba2b6cb39caa2b03f91358d917
6
+ metadata.gz: dd9c007251df2b16caab791f1421a0918bba30c744c31a573bd3cb961e7359dde4fc8c7c04e465e960bd7b72a55b9b5b15170f4b3c31352a4d647f6d3b70f24e
7
+ data.tar.gz: b5bf856c249b4110d7a3d78129ebcfbc16ab5154fa1372d5d39d648fa8176d546cb4fb5e87abddaff428876b73767e322152853d968605a56a81286589741af6
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.103.rc
10
+ - Package version: 4.0.105.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.103.rc.gem
27
+ gem install ./ultracart_api-4.0.105.rc.gem
28
28
  ```
29
29
 
30
- (for development, run `gem install --dev ./ultracart_api-4.0.103.rc.gem` to install the development dependencies)
30
+ (for development, run `gem install --dev ./ultracart_api-4.0.105.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.103.rc'
36
+ gem 'ultracart_api', '~> 4.0.105.rc'
37
37
 
38
38
  ### Install from Git
39
39
 
@@ -1055,6 +1055,7 @@ Class | Method | HTTP request | Description
1055
1055
  - [UltracartClient::OrderPaymentPurchaseOrder](docs/OrderPaymentPurchaseOrder.md)
1056
1056
  - [UltracartClient::OrderPaymentTransaction](docs/OrderPaymentTransaction.md)
1057
1057
  - [UltracartClient::OrderPaymentTransactionDetail](docs/OrderPaymentTransactionDetail.md)
1058
+ - [UltracartClient::OrderPointOfSale](docs/OrderPointOfSale.md)
1058
1059
  - [UltracartClient::OrderProcessPaymentRequest](docs/OrderProcessPaymentRequest.md)
1059
1060
  - [UltracartClient::OrderProcessPaymentResponse](docs/OrderProcessPaymentResponse.md)
1060
1061
  - [UltracartClient::OrderProperty](docs/OrderProperty.md)
@@ -1076,6 +1077,9 @@ Class | Method | HTTP request | Description
1076
1077
  - [UltracartClient::OrderTrackingNumberDetails](docs/OrderTrackingNumberDetails.md)
1077
1078
  - [UltracartClient::OrdersResponse](docs/OrdersResponse.md)
1078
1079
  - [UltracartClient::Permission](docs/Permission.md)
1080
+ - [UltracartClient::PointOfSaleLocation](docs/PointOfSaleLocation.md)
1081
+ - [UltracartClient::PointOfSaleReader](docs/PointOfSaleReader.md)
1082
+ - [UltracartClient::PointOfSaleRegister](docs/PointOfSaleRegister.md)
1079
1083
  - [UltracartClient::PricingTier](docs/PricingTier.md)
1080
1084
  - [UltracartClient::PricingTierNotification](docs/PricingTierNotification.md)
1081
1085
  - [UltracartClient::PricingTiersResponse](docs/PricingTiersResponse.md)
@@ -1275,6 +1279,8 @@ Not every change is committed to every SDK.
1275
1279
 
1276
1280
  | Version | Date | Comments |
1277
1281
  | --: | :-: | --- |
1282
+ | 4.0.105-RC | 01/03/2023 | conversation events for party leave and join |
1283
+ | 4.0.104-RC | 01/03/2023 | order point of sale details |
1278
1284
  | 4.0.103-RC | 12/27/2022 | additional loyalty related coupons |
1279
1285
  | 4.0.102-RC | 12/21/2022 | conversation development |
1280
1286
  | 4.0.101-RC | 12/20/2022 | conversation engagement update |
@@ -10,6 +10,10 @@
10
10
  | **event_conversation_closed** | [**ConversationSummary**](ConversationSummary.md) | | [optional] |
11
11
  | **event_new_conversation** | [**ConversationSummary**](ConversationSummary.md) | | [optional] |
12
12
  | **event_new_message** | [**ConversationSummary**](ConversationSummary.md) | | [optional] |
13
+ | **event_participant_join** | [**ConversationSummary**](ConversationSummary.md) | | [optional] |
14
+ | **event_participant_join_participant** | [**ConversationParticipant**](ConversationParticipant.md) | | [optional] |
15
+ | **event_participant_left** | [**ConversationSummary**](ConversationSummary.md) | | [optional] |
16
+ | **event_participant_left_participant** | [**ConversationParticipant**](ConversationParticipant.md) | | [optional] |
13
17
  | **event_participant_update** | [**ConversationSummary**](ConversationSummary.md) | | [optional] |
14
18
  | **event_queue_position** | [**ConversationEventQueuePosition**](ConversationEventQueuePosition.md) | | [optional] |
15
19
  | **event_queue_status_update** | [**ConversationWebchatQueueStatus**](ConversationWebchatQueueStatus.md) | | [optional] |
@@ -34,6 +38,10 @@ instance = UltracartClient::ConversationWebsocketMessage.new(
34
38
  event_conversation_closed: null,
35
39
  event_new_conversation: null,
36
40
  event_new_message: null,
41
+ event_participant_join: null,
42
+ event_participant_join_participant: null,
43
+ event_participant_left: null,
44
+ event_participant_left_participant: null,
37
45
  event_participant_update: null,
38
46
  event_queue_position: null,
39
47
  event_queue_status_update: null,
data/docs/Order.md CHANGED
@@ -29,6 +29,7 @@
29
29
  | **merchant_id** | **String** | UltraCart merchant ID owning this order | [optional] |
30
30
  | **order_id** | **String** | Order ID | [optional] |
31
31
  | **payment** | [**OrderPayment**](OrderPayment.md) | | [optional] |
32
+ | **point_of_sale** | [**OrderPointOfSale**](OrderPointOfSale.md) | | [optional] |
32
33
  | **properties** | [**Array<OrderProperty>**](OrderProperty.md) | Properties, available only through update, not through insert due to the nature of how properties are handled internally | [optional] |
33
34
  | **quote** | [**OrderQuote**](OrderQuote.md) | | [optional] |
34
35
  | **refund_dts** | **String** | If the order was refunded, the date/time that the last refund occurred | [optional] |
@@ -70,6 +71,7 @@ instance = UltracartClient::Order.new(
70
71
  merchant_id: null,
71
72
  order_id: null,
72
73
  payment: null,
74
+ point_of_sale: null,
73
75
  properties: null,
74
76
  quote: null,
75
77
  refund_dts: null,
@@ -0,0 +1,22 @@
1
+ # UltracartClient::OrderPointOfSale
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **location** | [**PointOfSaleLocation**](PointOfSaleLocation.md) | | [optional] |
8
+ | **reader** | [**PointOfSaleReader**](PointOfSaleReader.md) | | [optional] |
9
+ | **register** | [**PointOfSaleRegister**](PointOfSaleRegister.md) | | [optional] |
10
+
11
+ ## Example
12
+
13
+ ```ruby
14
+ require 'ultracart_api'
15
+
16
+ instance = UltracartClient::OrderPointOfSale.new(
17
+ location: null,
18
+ reader: null,
19
+ register: null
20
+ )
21
+ ```
22
+
@@ -0,0 +1,34 @@
1
+ # UltracartClient::PointOfSaleLocation
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **adddress2** | **String** | Address line 2 | [optional] |
8
+ | **address1** | **String** | Address line 1 | [optional] |
9
+ | **city** | **String** | City | [optional] |
10
+ | **country** | **String** | Country | [optional] |
11
+ | **distribution_center_code** | **String** | The distribution center code where inventory is reduced from for this sale. | [optional] |
12
+ | **merchant_id** | **String** | Merchant ID that owns this location | [optional] |
13
+ | **pos_location_oid** | **Integer** | Object identifier of the point of sale location. | [optional] |
14
+ | **postal_code** | **String** | Postal code | [optional] |
15
+ | **state_province** | **String** | State/province | [optional] |
16
+
17
+ ## Example
18
+
19
+ ```ruby
20
+ require 'ultracart_api'
21
+
22
+ instance = UltracartClient::PointOfSaleLocation.new(
23
+ adddress2: null,
24
+ address1: null,
25
+ city: null,
26
+ country: null,
27
+ distribution_center_code: null,
28
+ merchant_id: null,
29
+ pos_location_oid: null,
30
+ postal_code: null,
31
+ state_province: null
32
+ )
33
+ ```
34
+
@@ -0,0 +1,34 @@
1
+ # UltracartClient::PointOfSaleReader
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **device_type** | **String** | The device type of the reader. | [optional] |
8
+ | **label** | **String** | The label of the reader. | [optional] |
9
+ | **merchant_id** | **String** | The merchant id that owns this point of sale reader. | [optional] |
10
+ | **payment_provider** | **String** | The payment provider for the card reader. | [optional] |
11
+ | **pos_reader_id** | **Integer** | Object identifier of the point of sale reader. | [optional] |
12
+ | **pos_register_oid** | **Integer** | Object identifier of the point of sale register this reader is assigned to. | [optional] |
13
+ | **serial_number** | **String** | The serial number of the reader. | [optional] |
14
+ | **stripe_account_id** | **String** | If the payment provider is Stripe, this is the Stripe account id | [optional] |
15
+ | **stripe_reader_id** | **String** | If the payment provide is Stripe, this is the Stripe terminal reader id | [optional] |
16
+
17
+ ## Example
18
+
19
+ ```ruby
20
+ require 'ultracart_api'
21
+
22
+ instance = UltracartClient::PointOfSaleReader.new(
23
+ device_type: null,
24
+ label: null,
25
+ merchant_id: null,
26
+ payment_provider: null,
27
+ pos_reader_id: null,
28
+ pos_register_oid: null,
29
+ serial_number: null,
30
+ stripe_account_id: null,
31
+ stripe_reader_id: null
32
+ )
33
+ ```
34
+
@@ -0,0 +1,24 @@
1
+ # UltracartClient::PointOfSaleRegister
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **merchant_id** | **String** | The merchant id that owns this point of sale register. | [optional] |
8
+ | **name** | **String** | Name of the register. | [optional] |
9
+ | **pos_location_oid** | **Integer** | Object identifier of the point of sale location where this register is located. | [optional] |
10
+ | **pos_register_oid** | **Integer** | Object identifier of the point of sale register. | [optional] |
11
+
12
+ ## Example
13
+
14
+ ```ruby
15
+ require 'ultracart_api'
16
+
17
+ instance = UltracartClient::PointOfSaleRegister.new(
18
+ merchant_id: null,
19
+ name: null,
20
+ pos_location_oid: null,
21
+ pos_register_oid: null
22
+ )
23
+ ```
24
+
@@ -28,6 +28,14 @@ module UltracartClient
28
28
 
29
29
  attr_accessor :event_new_message
30
30
 
31
+ attr_accessor :event_participant_join
32
+
33
+ attr_accessor :event_participant_join_participant
34
+
35
+ attr_accessor :event_participant_left
36
+
37
+ attr_accessor :event_participant_left_participant
38
+
31
39
  attr_accessor :event_participant_update
32
40
 
33
41
  attr_accessor :event_queue_position
@@ -83,6 +91,10 @@ module UltracartClient
83
91
  :'event_conversation_closed' => :'event_conversation_closed',
84
92
  :'event_new_conversation' => :'event_new_conversation',
85
93
  :'event_new_message' => :'event_new_message',
94
+ :'event_participant_join' => :'event_participant_join',
95
+ :'event_participant_join_participant' => :'event_participant_join_participant',
96
+ :'event_participant_left' => :'event_participant_left',
97
+ :'event_participant_left_participant' => :'event_participant_left_participant',
86
98
  :'event_participant_update' => :'event_participant_update',
87
99
  :'event_queue_position' => :'event_queue_position',
88
100
  :'event_queue_status_update' => :'event_queue_status_update',
@@ -111,6 +123,10 @@ module UltracartClient
111
123
  :'event_conversation_closed' => :'ConversationSummary',
112
124
  :'event_new_conversation' => :'ConversationSummary',
113
125
  :'event_new_message' => :'ConversationSummary',
126
+ :'event_participant_join' => :'ConversationSummary',
127
+ :'event_participant_join_participant' => :'ConversationParticipant',
128
+ :'event_participant_left' => :'ConversationSummary',
129
+ :'event_participant_left_participant' => :'ConversationParticipant',
114
130
  :'event_participant_update' => :'ConversationSummary',
115
131
  :'event_queue_position' => :'ConversationEventQueuePosition',
116
132
  :'event_queue_status_update' => :'ConversationWebchatQueueStatus',
@@ -170,6 +186,22 @@ module UltracartClient
170
186
  self.event_new_message = attributes[:'event_new_message']
171
187
  end
172
188
 
189
+ if attributes.key?(:'event_participant_join')
190
+ self.event_participant_join = attributes[:'event_participant_join']
191
+ end
192
+
193
+ if attributes.key?(:'event_participant_join_participant')
194
+ self.event_participant_join_participant = attributes[:'event_participant_join_participant']
195
+ end
196
+
197
+ if attributes.key?(:'event_participant_left')
198
+ self.event_participant_left = attributes[:'event_participant_left']
199
+ end
200
+
201
+ if attributes.key?(:'event_participant_left_participant')
202
+ self.event_participant_left_participant = attributes[:'event_participant_left_participant']
203
+ end
204
+
173
205
  if attributes.key?(:'event_participant_update')
174
206
  self.event_participant_update = attributes[:'event_participant_update']
175
207
  end
@@ -225,7 +257,7 @@ module UltracartClient
225
257
  # Check to see if the all the properties in the model are valid
226
258
  # @return true if the model is valid
227
259
  def valid?
228
- event_type_validator = EnumAttributeValidator.new('String', ["queue position", "webchat start conversation", "conversation closed", "new conversation", "new message", "updated message", "queue status update", "rrweb", "participant update", "read message", "typing", "add coupon", "add item", "webchat context"])
260
+ event_type_validator = EnumAttributeValidator.new('String', ["queue position", "webchat start conversation", "conversation closed", "new conversation", "new message", "updated message", "queue status update", "rrweb", "participant update", "participant join", "participant leave", "read message", "typing", "add coupon", "add item", "webchat context"])
229
261
  return false unless event_type_validator.valid?(@event_type)
230
262
  type_validator = EnumAttributeValidator.new('String', ["message", "event", "ping", "check queue position"])
231
263
  return false unless type_validator.valid?(@type)
@@ -235,7 +267,7 @@ module UltracartClient
235
267
  # Custom attribute writer method checking allowed values (enum).
236
268
  # @param [Object] event_type Object to be assigned
237
269
  def event_type=(event_type)
238
- validator = EnumAttributeValidator.new('String', ["queue position", "webchat start conversation", "conversation closed", "new conversation", "new message", "updated message", "queue status update", "rrweb", "participant update", "read message", "typing", "add coupon", "add item", "webchat context"])
270
+ validator = EnumAttributeValidator.new('String', ["queue position", "webchat start conversation", "conversation closed", "new conversation", "new message", "updated message", "queue status update", "rrweb", "participant update", "participant join", "participant leave", "read message", "typing", "add coupon", "add item", "webchat context"])
239
271
  unless validator.valid?(event_type)
240
272
  fail ArgumentError, "invalid value for \"event_type\", must be one of #{validator.allowable_values}."
241
273
  end
@@ -263,6 +295,10 @@ module UltracartClient
263
295
  event_conversation_closed == o.event_conversation_closed &&
264
296
  event_new_conversation == o.event_new_conversation &&
265
297
  event_new_message == o.event_new_message &&
298
+ event_participant_join == o.event_participant_join &&
299
+ event_participant_join_participant == o.event_participant_join_participant &&
300
+ event_participant_left == o.event_participant_left &&
301
+ event_participant_left_participant == o.event_participant_left_participant &&
266
302
  event_participant_update == o.event_participant_update &&
267
303
  event_queue_position == o.event_queue_position &&
268
304
  event_queue_status_update == o.event_queue_status_update &&
@@ -285,7 +321,7 @@ module UltracartClient
285
321
  # Calculates hash code according to all attributes.
286
322
  # @return [Integer] Hash code
287
323
  def hash
288
- [conversation_uuid, event_add_coupon, event_add_item, event_conversation_closed, event_new_conversation, event_new_message, event_participant_update, event_queue_position, event_queue_status_update, event_read_message, event_rrweb, event_type, event_typing, event_updated_message, event_webchat_context, message, type].hash
324
+ [conversation_uuid, event_add_coupon, event_add_item, event_conversation_closed, event_new_conversation, event_new_message, event_participant_join, event_participant_join_participant, event_participant_left, event_participant_left_participant, event_participant_update, event_queue_position, event_queue_status_update, event_read_message, event_rrweb, event_type, event_typing, event_updated_message, event_webchat_context, message, type].hash
289
325
  end
290
326
 
291
327
  # Builds the object from hash
@@ -75,6 +75,8 @@ module UltracartClient
75
75
 
76
76
  attr_accessor :payment
77
77
 
78
+ attr_accessor :point_of_sale
79
+
78
80
  # Properties, available only through update, not through insert due to the nature of how properties are handled internally
79
81
  attr_accessor :properties
80
82
 
@@ -147,6 +149,7 @@ module UltracartClient
147
149
  :'merchant_id' => :'merchant_id',
148
150
  :'order_id' => :'order_id',
149
151
  :'payment' => :'payment',
152
+ :'point_of_sale' => :'point_of_sale',
150
153
  :'properties' => :'properties',
151
154
  :'quote' => :'quote',
152
155
  :'refund_dts' => :'refund_dts',
@@ -192,6 +195,7 @@ module UltracartClient
192
195
  :'merchant_id' => :'String',
193
196
  :'order_id' => :'String',
194
197
  :'payment' => :'OrderPayment',
198
+ :'point_of_sale' => :'OrderPointOfSale',
195
199
  :'properties' => :'Array<OrderProperty>',
196
200
  :'quote' => :'OrderQuote',
197
201
  :'refund_dts' => :'String',
@@ -331,6 +335,10 @@ module UltracartClient
331
335
  self.payment = attributes[:'payment']
332
336
  end
333
337
 
338
+ if attributes.key?(:'point_of_sale')
339
+ self.point_of_sale = attributes[:'point_of_sale']
340
+ end
341
+
334
342
  if attributes.key?(:'properties')
335
343
  if (value = attributes[:'properties']).is_a?(Array)
336
344
  self.properties = value
@@ -457,6 +465,7 @@ module UltracartClient
457
465
  merchant_id == o.merchant_id &&
458
466
  order_id == o.order_id &&
459
467
  payment == o.payment &&
468
+ point_of_sale == o.point_of_sale &&
460
469
  properties == o.properties &&
461
470
  quote == o.quote &&
462
471
  refund_dts == o.refund_dts &&
@@ -477,7 +486,7 @@ module UltracartClient
477
486
  # Calculates hash code according to all attributes.
478
487
  # @return [Integer] Hash code
479
488
  def hash
480
- [affiliates, auto_order, billing, buysafe, channel_partner, checkout, coupons, creation_dts, currency_code, current_stage, customer_profile, digital_order, edi, exchange_rate, fraud_score, gift, gift_certificate, internal, items, language_iso_code, linked_shipment, marketing, merchant_id, order_id, payment, properties, quote, refund_dts, reject_dts, salesforce, shipping, summary, tags, taxes].hash
489
+ [affiliates, auto_order, billing, buysafe, channel_partner, checkout, coupons, creation_dts, currency_code, current_stage, customer_profile, digital_order, edi, exchange_rate, fraud_score, gift, gift_certificate, internal, items, language_iso_code, linked_shipment, marketing, merchant_id, order_id, payment, point_of_sale, properties, quote, refund_dts, reject_dts, salesforce, shipping, summary, tags, taxes].hash
481
490
  end
482
491
 
483
492
  # Builds the object from hash
@@ -0,0 +1,237 @@
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 OrderPointOfSale
18
+ attr_accessor :location
19
+
20
+ attr_accessor :reader
21
+
22
+ attr_accessor :register
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'location' => :'location',
28
+ :'reader' => :'reader',
29
+ :'register' => :'register'
30
+ }
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'location' => :'PointOfSaleLocation',
42
+ :'reader' => :'PointOfSaleReader',
43
+ :'register' => :'PointOfSaleRegister'
44
+ }
45
+ end
46
+
47
+ # List of attributes with nullable: true
48
+ def self.openapi_nullable
49
+ Set.new([
50
+ ])
51
+ end
52
+
53
+ # Initializes the object
54
+ # @param [Hash] attributes Model attributes in the form of hash
55
+ def initialize(attributes = {})
56
+ if (!attributes.is_a?(Hash))
57
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::OrderPointOfSale` initialize method"
58
+ end
59
+
60
+ # check to see if the attribute exists and convert string to symbol for hash key
61
+ attributes = attributes.each_with_object({}) { |(k, v), h|
62
+ if (!self.class.attribute_map.key?(k.to_sym))
63
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::OrderPointOfSale`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
64
+ end
65
+ h[k.to_sym] = v
66
+ }
67
+
68
+ if attributes.key?(:'location')
69
+ self.location = attributes[:'location']
70
+ end
71
+
72
+ if attributes.key?(:'reader')
73
+ self.reader = attributes[:'reader']
74
+ end
75
+
76
+ if attributes.key?(:'register')
77
+ self.register = attributes[:'register']
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ invalid_properties = Array.new
85
+ invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ true
92
+ end
93
+
94
+ # Checks equality by comparing each attribute.
95
+ # @param [Object] Object to be compared
96
+ def ==(o)
97
+ return true if self.equal?(o)
98
+ self.class == o.class &&
99
+ location == o.location &&
100
+ reader == o.reader &&
101
+ register == o.register
102
+ end
103
+
104
+ # @see the `==` method
105
+ # @param [Object] Object to be compared
106
+ def eql?(o)
107
+ self == o
108
+ end
109
+
110
+ # Calculates hash code according to all attributes.
111
+ # @return [Integer] Hash code
112
+ def hash
113
+ [location, reader, register].hash
114
+ end
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def self.build_from_hash(attributes)
120
+ new.build_from_hash(attributes)
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def build_from_hash(attributes)
127
+ return nil unless attributes.is_a?(Hash)
128
+ attributes = attributes.transform_keys(&:to_sym)
129
+ self.class.openapi_types.each_pair do |key, type|
130
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
131
+ self.send("#{key}=", nil)
132
+ elsif type =~ /\AArray<(.*)>/i
133
+ # check to ensure the input is an array given that the attribute
134
+ # is documented as an array but the input is not
135
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
136
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
137
+ end
138
+ elsif !attributes[self.class.attribute_map[key]].nil?
139
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
140
+ end
141
+ end
142
+
143
+ self
144
+ end
145
+
146
+ # Deserializes the data based on type
147
+ # @param string type Data type
148
+ # @param string value Value to be deserialized
149
+ # @return [Object] Deserialized data
150
+ def _deserialize(type, value)
151
+ case type.to_sym
152
+ when :Time
153
+ Time.parse(value)
154
+ when :Date
155
+ Date.parse(value)
156
+ when :String
157
+ value.to_s
158
+ when :Integer
159
+ value.to_i
160
+ when :Float
161
+ value.to_f
162
+ when :Boolean
163
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
164
+ true
165
+ else
166
+ false
167
+ end
168
+ when :Object
169
+ # generic object (usually a Hash), return directly
170
+ value
171
+ when /\AArray<(?<inner_type>.+)>\z/
172
+ inner_type = Regexp.last_match[:inner_type]
173
+ value.map { |v| _deserialize(inner_type, v) }
174
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
175
+ k_type = Regexp.last_match[:k_type]
176
+ v_type = Regexp.last_match[:v_type]
177
+ {}.tap do |hash|
178
+ value.each do |k, v|
179
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
180
+ end
181
+ end
182
+ else # model
183
+ # models (e.g. Pet) or oneOf
184
+ klass = UltracartClient.const_get(type)
185
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
186
+ end
187
+ end
188
+
189
+ # Returns the string representation of the object
190
+ # @return [String] String presentation of the object
191
+ def to_s
192
+ to_hash.to_s
193
+ end
194
+
195
+ # to_body is an alias to to_hash (backward compatibility)
196
+ # @return [Hash] Returns the object in the form of hash
197
+ def to_body
198
+ to_hash
199
+ end
200
+
201
+ # Returns the object in the form of hash
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_hash
204
+ hash = {}
205
+ self.class.attribute_map.each_pair do |attr, param|
206
+ value = self.send(attr)
207
+ if value.nil?
208
+ is_nullable = self.class.openapi_nullable.include?(attr)
209
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
210
+ end
211
+
212
+ hash[param] = _to_hash(value)
213
+ end
214
+ hash
215
+ end
216
+
217
+ # Outputs non-array value in the form of hash
218
+ # For object, use to_hash. Otherwise, just return the value
219
+ # @param [Object] value Any valid value
220
+ # @return [Hash] Returns the value in the form of hash
221
+ def _to_hash(value)
222
+ if value.is_a?(Array)
223
+ value.compact.map { |v| _to_hash(v) }
224
+ elsif value.is_a?(Hash)
225
+ {}.tap do |hash|
226
+ value.each { |k, v| hash[k] = _to_hash(v) }
227
+ end
228
+ elsif value.respond_to? :to_hash
229
+ value.to_hash
230
+ else
231
+ value
232
+ end
233
+ end
234
+
235
+ end
236
+
237
+ end