ultracart_api 4.1.77 → 4.1.79

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.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -2
  3. data/docs/ConversationAgentAuth.md +4 -0
  4. data/docs/ConversationAgentAuthMerchant.md +22 -0
  5. data/docs/ConversationPbxAudio.md +2 -0
  6. data/docs/ConversationPbxCall.md +2 -0
  7. data/docs/ConversationPbxClassOfService.md +2 -0
  8. data/docs/ConversationPbxCustomerSnapshotRequest.md +2 -0
  9. data/docs/ConversationPbxMenu.md +2 -0
  10. data/docs/ConversationPbxPhoneNumber.md +2 -0
  11. data/docs/ConversationPbxQueue.md +2 -0
  12. data/docs/ConversationPbxTimeBased.md +2 -0
  13. data/docs/ConversationPbxTimeRange.md +2 -0
  14. data/docs/ConversationPbxVoicemailMailbox.md +2 -0
  15. data/docs/ItemShipping.md +2 -0
  16. data/lib/ultracart_api/models/conversation_agent_auth.rb +23 -1
  17. data/lib/ultracart_api/models/conversation_agent_auth_merchant.rb +255 -0
  18. data/lib/ultracart_api/models/conversation_pbx_audio.rb +26 -1
  19. data/lib/ultracart_api/models/conversation_pbx_call.rb +11 -1
  20. data/lib/ultracart_api/models/conversation_pbx_class_of_service.rb +26 -1
  21. data/lib/ultracart_api/models/conversation_pbx_customer_snapshot_request.rb +10 -1
  22. data/lib/ultracart_api/models/conversation_pbx_menu.rb +26 -1
  23. data/lib/ultracart_api/models/conversation_pbx_phone_number.rb +26 -1
  24. data/lib/ultracart_api/models/conversation_pbx_queue.rb +26 -1
  25. data/lib/ultracart_api/models/conversation_pbx_time_based.rb +10 -1
  26. data/lib/ultracart_api/models/conversation_pbx_time_range.rb +26 -1
  27. data/lib/ultracart_api/models/conversation_pbx_voicemail_mailbox.rb +26 -1
  28. data/lib/ultracart_api/models/item_shipping.rb +11 -1
  29. data/lib/ultracart_api/version.rb +1 -1
  30. data/lib/ultracart_api.rb +1 -0
  31. metadata +4 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b7ed4def4059749d557efdd0c5c5dd90a7eb112e5250f75bedcd58a6651b248f
4
- data.tar.gz: 7413b440e4ea11c3a12e60c441c46e95c6a557ee8e90b7071c629eca07b9f503
3
+ metadata.gz: 9f8db92bb22d00d81552f7d0b74588fb470f08f314814b7aa4db5bbe76aaed1a
4
+ data.tar.gz: a8c3e8fbd1ed1dc077ef1a300bada351877bc7d6772dd4df6aae3ae27723643c
5
5
  SHA512:
6
- metadata.gz: e9214ab58181126f9f28f426d9d4b9f12dcc0c125dda7d24e1d55f6cf1d4637928cef4f1db2133123e021e2a0c027e98fec82441864a8a6a94136ded097f6494
7
- data.tar.gz: 94ece6c1560a2159c9801a8e34e72e37abebefa5c6e5b1116bb8592ba1d3b457b356b2c3d04e9540c7d562663ed9586005a04fec0d3332f5265d84a1f7fc2649
6
+ metadata.gz: 4a25c2a207e0ed15274e6d88545adf3f282abf6a26969af12701f309b658c5e23b080fd0d3672aad553b0acc95c410d5b73d84e2a02c57669d076f12e64e27e7
7
+ data.tar.gz: 581f3c787efc602151b49afd829dd23767fcbeb9bb24fb6bfa373d81d916bd63eb2e2e01aeb381ee77544904a9ec02bc7cbe722622b17dbab3bb317633996875
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.77
10
+ - Package version: 4.1.79
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.77'
19
+ gem 'ultracart_api', '4.1.79'
20
20
  ```
21
21
 
22
22
  install:
@@ -802,6 +802,7 @@ Class | Method | HTTP request | Description
802
802
  - [UltracartClient::CityStateZip](docs/CityStateZip.md)
803
803
  - [UltracartClient::Conversation](docs/Conversation.md)
804
804
  - [UltracartClient::ConversationAgentAuth](docs/ConversationAgentAuth.md)
805
+ - [UltracartClient::ConversationAgentAuthMerchant](docs/ConversationAgentAuthMerchant.md)
805
806
  - [UltracartClient::ConversationAgentAuthResponse](docs/ConversationAgentAuthResponse.md)
806
807
  - [UltracartClient::ConversationAgentProfile](docs/ConversationAgentProfile.md)
807
808
  - [UltracartClient::ConversationAgentProfileResponse](docs/ConversationAgentProfileResponse.md)
@@ -1697,6 +1698,8 @@ Not every change is committed to every SDK.
1697
1698
 
1698
1699
  | Version | Date | Comments |
1699
1700
  | --: | :-: | --- |
1701
+ | 4.1.79 | 04/21/2026 | item - one line per unit flag support |
1702
+ | 4.1.78 | 04/20/2026 | conversation pbx - objects have context_merchant_id fields to linked account configs |
1700
1703
  | 4.1.77 | 04/17/2026 | conversation - embed oauth methods |
1701
1704
  | 4.1.76 | 04/17/2026 | conversation - embed oauth methods |
1702
1705
  | 4.1.75 | 04/17/2026 | conversation - embed oauth methods |
@@ -13,6 +13,8 @@
13
13
  | **group_ids** | **Array<Integer>** | UltraCart Groups this user belongs to | [optional] |
14
14
  | **jwt** | **String** | | [optional] |
15
15
  | **merchant_id** | **String** | | [optional] |
16
+ | **merchants** | [**Array<ConversationAgentAuthMerchant>**](ConversationAgentAuthMerchant.md) | List of merchants in this linked merchant group | [optional] |
17
+ | **parent_merchant_id** | **String** | The parent merchant ID for PBX. For non-linked merchants, equals merchant_id. | [optional] |
16
18
  | **pbx_admin** | **Boolean** | | [optional] |
17
19
  | **pbx_jwt** | **String** | | [optional] |
18
20
  | **pbx_supervisor** | **Boolean** | | [optional] |
@@ -40,6 +42,8 @@ instance = UltracartClient::ConversationAgentAuth.new(
40
42
  group_ids: null,
41
43
  jwt: null,
42
44
  merchant_id: null,
45
+ merchants: null,
46
+ parent_merchant_id: null,
43
47
  pbx_admin: null,
44
48
  pbx_jwt: null,
45
49
  pbx_supervisor: null,
@@ -0,0 +1,22 @@
1
+ # UltracartClient::ConversationAgentAuthMerchant
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **company** | **String** | The company name for this merchant | [optional] |
8
+ | **is_parent** | **Boolean** | True if this is the parent merchant that owns the Twilio account | [optional] |
9
+ | **merchant_id** | **String** | The merchant ID | [optional] |
10
+
11
+ ## Example
12
+
13
+ ```ruby
14
+ require 'ultracart_api'
15
+
16
+ instance = UltracartClient::ConversationAgentAuthMerchant.new(
17
+ company: null,
18
+ is_parent: null,
19
+ merchant_id: null
20
+ )
21
+ ```
22
+
@@ -5,6 +5,7 @@
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **audio_s3_listing_key** | **String** | Audio S3 Listing Key | [optional] |
8
+ | **context_merchant_id** | **String** | Optional child merchant ID this resource is assigned to. Null = shared across the linked merchant group. | [optional] |
8
9
  | **conversation_pbx_audio_uuid** | **String** | Conversation Pbx Audio UUID | [optional] |
9
10
  | **default_hold_music** | **Boolean** | If true, this will be the default hold music | [optional] |
10
11
  | **description** | **String** | Description of this audio | [optional] |
@@ -22,6 +23,7 @@ require 'ultracart_api'
22
23
 
23
24
  instance = UltracartClient::ConversationPbxAudio.new(
24
25
  audio_s3_listing_key: null,
26
+ context_merchant_id: null,
25
27
  conversation_pbx_audio_uuid: null,
26
28
  default_hold_music: null,
27
29
  description: null,
@@ -12,6 +12,7 @@
12
12
  | **call_uuid** | **String** | Unique identifier for this call record | [optional] |
13
13
  | **caller** | [**ConversationPbxCallCaller**](ConversationPbxCallCaller.md) | | [optional] |
14
14
  | **conference_sid** | **String** | Twilio conference SID if this call used conferencing | [optional] |
15
+ | **context_merchant_id** | **String** | Optional child merchant ID this call is attributed to. Null = no child attribution (parent-level call). | [optional] |
15
16
  | **created_at_dts** | **String** | Timestamp when the call record was created | [optional] |
16
17
  | **customer_name** | **String** | Customer name associated with this call | [optional] |
17
18
  | **customer_profile_oid** | **String** | UltraCart customer profile OID if the caller was matched to a customer | [optional] |
@@ -44,6 +45,7 @@ instance = UltracartClient::ConversationPbxCall.new(
44
45
  call_uuid: null,
45
46
  caller: null,
46
47
  conference_sid: null,
48
+ context_merchant_id: null,
47
49
  created_at_dts: null,
48
50
  customer_name: null,
49
51
  customer_profile_oid: null,
@@ -6,6 +6,7 @@
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **allowed_countries** | **Array<String>** | E.164 country calling codes (e.g. 1 for US/Canada, 44 for UK). Empty means domestic only. | [optional] |
8
8
  | **block_premium_numbers** | **Boolean** | Block calls to 900, 976, premium-rate, and shortcode destinations | [optional] |
9
+ | **context_merchant_id** | **String** | Optional child merchant ID this resource is assigned to. Null = shared across the linked merchant group. | [optional] |
9
10
  | **conversation_pbx_class_of_service_uuid** | **String** | Class of Service unique identifier | [optional] |
10
11
  | **default_flag** | **Boolean** | If true, this CoS applies to all agents without an explicit cos_uuid. Only one per merchant. | [optional] |
11
12
  | **description** | **String** | Description of the class of service | [optional] |
@@ -22,6 +23,7 @@ require 'ultracart_api'
22
23
  instance = UltracartClient::ConversationPbxClassOfService.new(
23
24
  allowed_countries: null,
24
25
  block_premium_numbers: null,
26
+ context_merchant_id: null,
25
27
  conversation_pbx_class_of_service_uuid: null,
26
28
  default_flag: null,
27
29
  description: null,
@@ -10,6 +10,7 @@
10
10
  | **metadata** | [**ResponseMetadata**](ResponseMetadata.md) | | [optional] |
11
11
  | **order_expand** | **String** | | [optional] |
12
12
  | **phone_number** | **String** | | [optional] |
13
+ | **search_linked_accounts** | **Boolean** | | [optional] |
13
14
  | **success** | **Boolean** | Indicates if API call was successful | [optional] |
14
15
  | **warning** | [**Warning**](Warning.md) | | [optional] |
15
16
 
@@ -25,6 +26,7 @@ instance = UltracartClient::ConversationPbxCustomerSnapshotRequest.new(
25
26
  metadata: null,
26
27
  order_expand: null,
27
28
  phone_number: null,
29
+ search_linked_accounts: null,
28
30
  success: null,
29
31
  warning: null
30
32
  )
@@ -5,6 +5,7 @@
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **allow_direct_extensions** | **Boolean** | If true, the customer is allowed to input direct extensions within this menu | [optional] |
8
+ | **context_merchant_id** | **String** | Optional child merchant ID this resource is assigned to. Null = shared across the linked merchant group. | [optional] |
8
9
  | **conversation_pbx_menu_uuid** | **String** | Conversation Pbx Menu UUID | [optional] |
9
10
  | **default_action** | **String** | The default action for this menu | [optional] |
10
11
  | **default_action_target** | **String** | The default action target for this menu | [optional] |
@@ -23,6 +24,7 @@ require 'ultracart_api'
23
24
 
24
25
  instance = UltracartClient::ConversationPbxMenu.new(
25
26
  allow_direct_extensions: null,
27
+ context_merchant_id: null,
26
28
  conversation_pbx_menu_uuid: null,
27
29
  default_action: null,
28
30
  default_action_target: null,
@@ -7,6 +7,7 @@
7
7
  | **action** | **String** | Action | [optional] |
8
8
  | **action_target** | **String** | Action target. This is the UUID associated with the configuration object of that particular type. | [optional] |
9
9
  | **address_sid** | **String** | Twilio Address SID linked to this phone number for regulatory compliance | [optional] |
10
+ | **context_merchant_id** | **String** | Optional child merchant ID this resource is assigned to. Null = shared across the linked merchant group. | [optional] |
10
11
  | **conversation_pbx_phone_number_uuid** | **String** | Conversation Pbx Phone Number UUID | [optional] |
11
12
  | **default_phone_number** | **Boolean** | Default phone number for outbound calling. | [optional] |
12
13
  | **deletion_protected** | **Boolean** | If true, this phone number cannot be deleted through the API. It must be deleted via the Twilio console. | [optional] |
@@ -22,6 +23,7 @@ instance = UltracartClient::ConversationPbxPhoneNumber.new(
22
23
  action: null,
23
24
  action_target: null,
24
25
  address_sid: null,
26
+ context_merchant_id: null,
25
27
  conversation_pbx_phone_number_uuid: null,
26
28
  default_phone_number: null,
27
29
  deletion_protected: null,
@@ -22,6 +22,7 @@
22
22
  | **callback_offer_after_seconds** | **Integer** | Seconds a caller must wait in queue before the callback option is offered | [optional] |
23
23
  | **callback_offer_interval_seconds** | **Integer** | Seconds between repeat callback offers to the same caller | [optional] |
24
24
  | **callback_retry_delay_seconds** | **Integer** | Delay in seconds between callback retry attempts | [optional] |
25
+ | **context_merchant_id** | **String** | Optional child merchant ID this resource is assigned to. Null = shared across the linked merchant group. | [optional] |
25
26
  | **conversation_pbx_queue_uuid** | **String** | Conversation Pbx Queue unique identifier | [optional] |
26
27
  | **conversation_voicemail_mailbox_uuid** | **String** | The voicemail mailbox associated with this queue | [optional] |
27
28
  | **hold_conversation_pbx_audio_uuid** | **String** | The audio to play while holding in a queue | [optional] |
@@ -69,6 +70,7 @@ instance = UltracartClient::ConversationPbxQueue.new(
69
70
  callback_offer_after_seconds: null,
70
71
  callback_offer_interval_seconds: null,
71
72
  callback_retry_delay_seconds: null,
73
+ context_merchant_id: null,
72
74
  conversation_pbx_queue_uuid: null,
73
75
  conversation_voicemail_mailbox_uuid: null,
74
76
  hold_conversation_pbx_audio_uuid: null,
@@ -4,6 +4,7 @@
4
4
 
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
+ | **context_merchant_id** | **String** | | [optional] |
7
8
  | **conversation_pbx_time_based_uuid** | **String** | | [optional] |
8
9
  | **mapping_config** | [**ConversationPbxTimeBasedMappingConfig**](ConversationPbxTimeBasedMappingConfig.md) | | [optional] |
9
10
  | **merchant_id** | **String** | | [optional] |
@@ -15,6 +16,7 @@
15
16
  require 'ultracart_api'
16
17
 
17
18
  instance = UltracartClient::ConversationPbxTimeBased.new(
19
+ context_merchant_id: null,
18
20
  conversation_pbx_time_based_uuid: null,
19
21
  mapping_config: null,
20
22
  merchant_id: null,
@@ -5,6 +5,7 @@
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
7
  | **configs** | [**Array<ConversationPbxTimeRangeConfig>**](ConversationPbxTimeRangeConfig.md) | Configurations for all ranges in this time range | [optional] |
8
+ | **context_merchant_id** | **String** | Optional child merchant ID this resource is assigned to. Null = shared across the linked merchant group. | [optional] |
8
9
  | **conversation_pbx_time_range_uuid** | **String** | Conversation Pbx Time Range UUID | [optional] |
9
10
  | **merchant_id** | **String** | Merchant Id | [optional] |
10
11
  | **time_range_name** | **String** | Time range name | [optional] |
@@ -17,6 +18,7 @@ require 'ultracart_api'
17
18
 
18
19
  instance = UltracartClient::ConversationPbxTimeRange.new(
19
20
  configs: null,
21
+ context_merchant_id: null,
20
22
  conversation_pbx_time_range_uuid: null,
21
23
  merchant_id: null,
22
24
  time_range_name: null,
@@ -4,6 +4,7 @@
4
4
 
5
5
  | Name | Type | Description | Notes |
6
6
  | ---- | ---- | ----------- | ----- |
7
+ | **context_merchant_id** | **String** | Optional child merchant ID this resource is assigned to. Null = shared across the linked merchant group. | [optional] |
7
8
  | **conversation_pbx_voicemail_mailbox_uuid** | **String** | Conversation Pbx Voicemail Mailbox UUID | [optional] |
8
9
  | **merchant_id** | **String** | Merchant Id | [optional] |
9
10
  | **send_notices_to_channel** | **String** | Send notices to channel | [optional] |
@@ -25,6 +26,7 @@
25
26
  require 'ultracart_api'
26
27
 
27
28
  instance = UltracartClient::ConversationPbxVoicemailMailbox.new(
29
+ context_merchant_id: null,
28
30
  conversation_pbx_voicemail_mailbox_uuid: null,
29
31
  merchant_id: null,
30
32
  send_notices_to_channel: null,
data/docs/ItemShipping.md CHANGED
@@ -34,6 +34,7 @@
34
34
  | **max_days_time_in_transit** | **Integer** | Maximum days allowed in transit | [optional] |
35
35
  | **methods** | [**Array<ItemShippingMethod>**](ItemShippingMethod.md) | Methods | [optional] |
36
36
  | **no_shipping_discount** | **Boolean** | No shipping discounts | [optional] |
37
+ | **one_line_per_unit** | **Boolean** | Split cart line items with quantity greater than one into individual lines of quantity one on the order | [optional] |
37
38
  | **package_requirements** | [**Array<ItemShippingPackageRequirement>**](ItemShippingPackageRequirement.md) | Package requirements | [optional] |
38
39
  | **perishable_class_name** | **String** | Perishable class name | [optional] |
39
40
  | **perishable_class_oid** | **Integer** | Perishable class object identifier | [optional] |
@@ -92,6 +93,7 @@ instance = UltracartClient::ItemShipping.new(
92
93
  max_days_time_in_transit: null,
93
94
  methods: null,
94
95
  no_shipping_discount: null,
96
+ one_line_per_unit: null,
95
97
  package_requirements: null,
96
98
  perishable_class_name: null,
97
99
  perishable_class_oid: null,
@@ -35,6 +35,12 @@ module UltracartClient
35
35
 
36
36
  attr_accessor :merchant_id
37
37
 
38
+ # List of merchants in this linked merchant group
39
+ attr_accessor :merchants
40
+
41
+ # The parent merchant ID for PBX. For non-linked merchants, equals merchant_id.
42
+ attr_accessor :parent_merchant_id
43
+
38
44
  attr_accessor :pbx_admin
39
45
 
40
46
  attr_accessor :pbx_jwt
@@ -70,6 +76,8 @@ module UltracartClient
70
76
  :'group_ids' => :'group_ids',
71
77
  :'jwt' => :'jwt',
72
78
  :'merchant_id' => :'merchant_id',
79
+ :'merchants' => :'merchants',
80
+ :'parent_merchant_id' => :'parent_merchant_id',
73
81
  :'pbx_admin' => :'pbx_admin',
74
82
  :'pbx_jwt' => :'pbx_jwt',
75
83
  :'pbx_supervisor' => :'pbx_supervisor',
@@ -101,6 +109,8 @@ module UltracartClient
101
109
  :'group_ids' => :'Array<Integer>',
102
110
  :'jwt' => :'String',
103
111
  :'merchant_id' => :'String',
112
+ :'merchants' => :'Array<ConversationAgentAuthMerchant>',
113
+ :'parent_merchant_id' => :'String',
104
114
  :'pbx_admin' => :'Boolean',
105
115
  :'pbx_jwt' => :'String',
106
116
  :'pbx_supervisor' => :'Boolean',
@@ -174,6 +184,16 @@ module UltracartClient
174
184
  self.merchant_id = attributes[:'merchant_id']
175
185
  end
176
186
 
187
+ if attributes.key?(:'merchants')
188
+ if (value = attributes[:'merchants']).is_a?(Array)
189
+ self.merchants = value
190
+ end
191
+ end
192
+
193
+ if attributes.key?(:'parent_merchant_id')
194
+ self.parent_merchant_id = attributes[:'parent_merchant_id']
195
+ end
196
+
177
197
  if attributes.key?(:'pbx_admin')
178
198
  self.pbx_admin = attributes[:'pbx_admin']
179
199
  end
@@ -248,6 +268,8 @@ module UltracartClient
248
268
  group_ids == o.group_ids &&
249
269
  jwt == o.jwt &&
250
270
  merchant_id == o.merchant_id &&
271
+ merchants == o.merchants &&
272
+ parent_merchant_id == o.parent_merchant_id &&
251
273
  pbx_admin == o.pbx_admin &&
252
274
  pbx_jwt == o.pbx_jwt &&
253
275
  pbx_supervisor == o.pbx_supervisor &&
@@ -270,7 +292,7 @@ module UltracartClient
270
292
  # Calculates hash code according to all attributes.
271
293
  # @return [Integer] Hash code
272
294
  def hash
273
- [chat_admin, chat_user, conversation_participant_arn, conversation_participant_name, customer_profile, default_phone_number, group_ids, jwt, merchant_id, pbx_admin, pbx_jwt, pbx_supervisor, pbx_user, pbx_voice_identity, pbx_voice_token, pbx_worker_token, pbx_worker_token_v2, twilio_accounts, user_id, websocket_url].hash
295
+ [chat_admin, chat_user, conversation_participant_arn, conversation_participant_name, customer_profile, default_phone_number, group_ids, jwt, merchant_id, merchants, parent_merchant_id, pbx_admin, pbx_jwt, pbx_supervisor, pbx_user, pbx_voice_identity, pbx_voice_token, pbx_worker_token, pbx_worker_token_v2, twilio_accounts, user_id, websocket_url].hash
274
296
  end
275
297
 
276
298
  # Builds the object from hash
@@ -0,0 +1,255 @@
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 ConversationAgentAuthMerchant
18
+ # The company name for this merchant
19
+ attr_accessor :company
20
+
21
+ # True if this is the parent merchant that owns the Twilio account
22
+ attr_accessor :is_parent
23
+
24
+ # The merchant ID
25
+ attr_accessor :merchant_id
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'company' => :'company',
31
+ :'is_parent' => :'is_parent',
32
+ :'merchant_id' => :'merchant_id'
33
+ }
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'company' => :'String',
45
+ :'is_parent' => :'Boolean',
46
+ :'merchant_id' => :'String'
47
+ }
48
+ end
49
+
50
+ # List of attributes with nullable: true
51
+ def self.openapi_nullable
52
+ Set.new([
53
+ ])
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationAgentAuthMerchant` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!self.class.attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationAgentAuthMerchant`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'company')
72
+ self.company = attributes[:'company']
73
+ end
74
+
75
+ if attributes.key?(:'is_parent')
76
+ self.is_parent = attributes[:'is_parent']
77
+ end
78
+
79
+ if attributes.key?(:'merchant_id')
80
+ self.merchant_id = attributes[:'merchant_id']
81
+ end
82
+ end
83
+
84
+ # Show invalid properties with the reasons. Usually used together with valid?
85
+ # @return Array for valid properties with the reasons
86
+ def list_invalid_properties
87
+ invalid_properties = Array.new
88
+ if !@merchant_id.nil? && @merchant_id.to_s.length > 20
89
+ invalid_properties.push('invalid value for "merchant_id", the character length must be smaller than or equal to 20.')
90
+ end
91
+
92
+ invalid_properties
93
+ end
94
+
95
+ # Check to see if the all the properties in the model are valid
96
+ # @return true if the model is valid
97
+ def valid?
98
+ return false if !@merchant_id.nil? && @merchant_id.to_s.length > 20
99
+ true
100
+ end
101
+
102
+ # Custom attribute writer method with validation
103
+ # @param [Object] merchant_id Value to be assigned
104
+ def merchant_id=(merchant_id)
105
+ if !merchant_id.nil? && merchant_id.to_s.length > 20
106
+ fail ArgumentError, 'invalid value for "merchant_id", the character length must be smaller than or equal to 20.'
107
+ end
108
+
109
+ @merchant_id = merchant_id
110
+ end
111
+
112
+ # Checks equality by comparing each attribute.
113
+ # @param [Object] Object to be compared
114
+ def ==(o)
115
+ return true if self.equal?(o)
116
+ self.class == o.class &&
117
+ company == o.company &&
118
+ is_parent == o.is_parent &&
119
+ merchant_id == o.merchant_id
120
+ end
121
+
122
+ # @see the `==` method
123
+ # @param [Object] Object to be compared
124
+ def eql?(o)
125
+ self == o
126
+ end
127
+
128
+ # Calculates hash code according to all attributes.
129
+ # @return [Integer] Hash code
130
+ def hash
131
+ [company, is_parent, merchant_id].hash
132
+ end
133
+
134
+ # Builds the object from hash
135
+ # @param [Hash] attributes Model attributes in the form of hash
136
+ # @return [Object] Returns the model itself
137
+ def self.build_from_hash(attributes)
138
+ new.build_from_hash(attributes)
139
+ end
140
+
141
+ # Builds the object from hash
142
+ # @param [Hash] attributes Model attributes in the form of hash
143
+ # @return [Object] Returns the model itself
144
+ def build_from_hash(attributes)
145
+ return nil unless attributes.is_a?(Hash)
146
+ attributes = attributes.transform_keys(&:to_sym)
147
+ self.class.openapi_types.each_pair do |key, type|
148
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
149
+ self.send("#{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[self.class.attribute_map[key]].is_a?(Array)
154
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
155
+ end
156
+ elsif !attributes[self.class.attribute_map[key]].nil?
157
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
158
+ end
159
+ end
160
+
161
+ self
162
+ end
163
+
164
+ # Deserializes the data based on type
165
+ # @param string type Data type
166
+ # @param string value Value to be deserialized
167
+ # @return [Object] Deserialized data
168
+ def _deserialize(type, value)
169
+ case type.to_sym
170
+ when :Time
171
+ Time.parse(value)
172
+ when :Date
173
+ Date.parse(value)
174
+ when :String
175
+ value.to_s
176
+ when :Integer
177
+ value.to_i
178
+ when :Float
179
+ value.to_f
180
+ when :Boolean
181
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
182
+ true
183
+ else
184
+ false
185
+ end
186
+ when :Object
187
+ # generic object (usually a Hash), return directly
188
+ value
189
+ when /\AArray<(?<inner_type>.+)>\z/
190
+ inner_type = Regexp.last_match[:inner_type]
191
+ value.map { |v| _deserialize(inner_type, v) }
192
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
193
+ k_type = Regexp.last_match[:k_type]
194
+ v_type = Regexp.last_match[:v_type]
195
+ {}.tap do |hash|
196
+ value.each do |k, v|
197
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
198
+ end
199
+ end
200
+ else # model
201
+ # models (e.g. Pet) or oneOf
202
+ klass = UltracartClient.const_get(type)
203
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
204
+ end
205
+ end
206
+
207
+ # Returns the string representation of the object
208
+ # @return [String] String presentation of the object
209
+ def to_s
210
+ to_hash.to_s
211
+ end
212
+
213
+ # to_body is an alias to to_hash (backward compatibility)
214
+ # @return [Hash] Returns the object in the form of hash
215
+ def to_body
216
+ to_hash
217
+ end
218
+
219
+ # Returns the object in the form of hash
220
+ # @return [Hash] Returns the object in the form of hash
221
+ def to_hash
222
+ hash = {}
223
+ self.class.attribute_map.each_pair do |attr, param|
224
+ value = self.send(attr)
225
+ if value.nil?
226
+ is_nullable = self.class.openapi_nullable.include?(attr)
227
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
228
+ end
229
+
230
+ hash[param] = _to_hash(value)
231
+ end
232
+ hash
233
+ end
234
+
235
+ # Outputs non-array value in the form of hash
236
+ # For object, use to_hash. Otherwise, just return the value
237
+ # @param [Object] value Any valid value
238
+ # @return [Hash] Returns the value in the form of hash
239
+ def _to_hash(value)
240
+ if value.is_a?(Array)
241
+ value.compact.map { |v| _to_hash(v) }
242
+ elsif value.is_a?(Hash)
243
+ {}.tap do |hash|
244
+ value.each { |k, v| hash[k] = _to_hash(v) }
245
+ end
246
+ elsif value.respond_to? :to_hash
247
+ value.to_hash
248
+ else
249
+ value
250
+ end
251
+ end
252
+
253
+ end
254
+
255
+ end