ultracart_api 4.1.136 → 4.1.140
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 +4 -4
- data/README.md +87 -2
- data/docs/ChannelPartnerOrder.md +2 -0
- data/docs/ConversationApi.md +52 -0
- data/docs/ConversationPbxPayConnector.md +32 -0
- data/docs/ConversationPbxPayConnectorsResponse.md +26 -0
- data/docs/OrderChannelPartner.md +2 -0
- data/docs/SfvbApi.md +1933 -0
- data/docs/SfvbCompileRequest.md +26 -0
- data/docs/SfvbCompileResponse.md +28 -0
- data/docs/SfvbContainerResponse.md +36 -0
- data/docs/SfvbContainerRevertRequest.md +20 -0
- data/docs/SfvbContainerVersion.md +40 -0
- data/docs/SfvbContainerVersionsResponse.md +18 -0
- data/docs/SfvbContainerWriteRequest.md +24 -0
- data/docs/SfvbElement.md +20 -0
- data/docs/SfvbElementSchemaResponse.md +20 -0
- data/docs/SfvbElementsResponse.md +22 -0
- data/docs/SfvbErrorDetail.md +36 -0
- data/docs/SfvbFileContentResponse.md +38 -0
- data/docs/SfvbFileEntry.md +46 -0
- data/docs/SfvbFileRevertRequest.md +22 -0
- data/docs/SfvbFileSearchRequest.md +48 -0
- data/docs/SfvbFileSearchResponse.md +32 -0
- data/docs/SfvbFileVersion.md +34 -0
- data/docs/SfvbFileVersionsResponse.md +22 -0
- data/docs/SfvbFileWriteRequest.md +22 -0
- data/docs/SfvbFileWriteResponse.md +28 -0
- data/docs/SfvbFilesResponse.md +28 -0
- data/docs/SfvbLibraryEntry.md +38 -0
- data/docs/SfvbLibraryFacet.md +22 -0
- data/docs/SfvbLibraryResponse.md +28 -0
- data/docs/SfvbPreviewSessionRequest.md +20 -0
- data/docs/SfvbPreviewSessionResponse.md +30 -0
- data/docs/SfvbPreviewUrlResponse.md +30 -0
- data/docs/SfvbRenderRequest.md +40 -0
- data/docs/SfvbRenderResponse.md +28 -0
- data/docs/SfvbStorefront.md +22 -0
- data/docs/SfvbStorefrontsResponse.md +18 -0
- data/docs/SfvbTheme.md +36 -0
- data/docs/SfvbThemeDuplicateRequest.md +22 -0
- data/docs/SfvbThemeJobResponse.md +40 -0
- data/docs/SfvbThemesResponse.md +20 -0
- data/docs/SfvbUpsellOffer.md +34 -0
- data/docs/SfvbUpsellOffersResponse.md +18 -0
- data/docs/SfvbValidateRequest.md +26 -0
- data/docs/SfvbValidationResponse.md +24 -0
- data/docs/SfvbVelocityValidateRequest.md +20 -0
- data/docs/SfvbVersionResponse.md +36 -0
- data/docs/SfvbWhoamiResponse.md +36 -0
- data/docs/SfvbWidgetIdsResponse.md +22 -0
- data/lib/ultracart_api/api/conversation_api.rb +58 -0
- data/lib/ultracart_api/api/sfvb_api.rb +2565 -0
- data/lib/ultracart_api/models/channel_partner_order.rb +13 -1
- data/lib/ultracart_api/models/conversation_pbx_pay_connector.rb +426 -0
- data/lib/ultracart_api/models/conversation_pbx_pay_connectors_response.rb +258 -0
- data/lib/ultracart_api/models/order_channel_partner.rb +13 -1
- data/lib/ultracart_api/models/sfvb_compile_request.rb +260 -0
- data/lib/ultracart_api/models/sfvb_compile_response.rb +273 -0
- data/lib/ultracart_api/models/sfvb_container_response.rb +344 -0
- data/lib/ultracart_api/models/sfvb_container_revert_request.rb +230 -0
- data/lib/ultracart_api/models/sfvb_container_version.rb +376 -0
- data/lib/ultracart_api/models/sfvb_container_versions_response.rb +222 -0
- data/lib/ultracart_api/models/sfvb_container_write_request.rb +250 -0
- data/lib/ultracart_api/models/sfvb_element.rb +230 -0
- data/lib/ultracart_api/models/sfvb_element_schema_response.rb +230 -0
- data/lib/ultracart_api/models/sfvb_elements_response.rb +242 -0
- data/lib/ultracart_api/models/sfvb_error_detail.rb +346 -0
- data/lib/ultracart_api/models/sfvb_file_content_response.rb +320 -0
- data/lib/ultracart_api/models/sfvb_file_entry.rb +360 -0
- data/lib/ultracart_api/models/sfvb_file_revert_request.rb +240 -0
- data/lib/ultracart_api/models/sfvb_file_search_request.rb +370 -0
- data/lib/ultracart_api/models/sfvb_file_search_response.rb +292 -0
- data/lib/ultracart_api/models/sfvb_file_version.rb +300 -0
- data/lib/ultracart_api/models/sfvb_file_versions_response.rb +242 -0
- data/lib/ultracart_api/models/sfvb_file_write_request.rb +240 -0
- data/lib/ultracart_api/models/sfvb_file_write_response.rb +268 -0
- data/lib/ultracart_api/models/sfvb_files_response.rb +272 -0
- data/lib/ultracart_api/models/sfvb_library_entry.rb +322 -0
- data/lib/ultracart_api/models/sfvb_library_facet.rb +242 -0
- data/lib/ultracart_api/models/sfvb_library_response.rb +274 -0
- data/lib/ultracart_api/models/sfvb_preview_session_request.rb +230 -0
- data/lib/ultracart_api/models/sfvb_preview_session_response.rb +284 -0
- data/lib/ultracart_api/models/sfvb_preview_url_response.rb +280 -0
- data/lib/ultracart_api/models/sfvb_render_request.rb +330 -0
- data/lib/ultracart_api/models/sfvb_render_response.rb +274 -0
- data/lib/ultracart_api/models/sfvb_storefront.rb +240 -0
- data/lib/ultracart_api/models/sfvb_storefronts_response.rb +222 -0
- data/lib/ultracart_api/models/sfvb_theme.rb +310 -0
- data/lib/ultracart_api/models/sfvb_theme_duplicate_request.rb +240 -0
- data/lib/ultracart_api/models/sfvb_theme_job_response.rb +364 -0
- data/lib/ultracart_api/models/sfvb_themes_response.rb +232 -0
- data/lib/ultracart_api/models/sfvb_upsell_offer.rb +300 -0
- data/lib/ultracart_api/models/sfvb_upsell_offers_response.rb +222 -0
- data/lib/ultracart_api/models/sfvb_validate_request.rb +294 -0
- data/lib/ultracart_api/models/sfvb_validation_response.rb +256 -0
- data/lib/ultracart_api/models/sfvb_velocity_validate_request.rb +230 -0
- data/lib/ultracart_api/models/sfvb_version_response.rb +344 -0
- data/lib/ultracart_api/models/sfvb_whoami_response.rb +314 -0
- data/lib/ultracart_api/models/sfvb_widget_ids_response.rb +242 -0
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +46 -0
- metadata +94 -2
|
@@ -24,6 +24,9 @@ module UltracartClient
|
|
|
24
24
|
# Affiliate Sub Id
|
|
25
25
|
attr_accessor :affiliate_sub_id
|
|
26
26
|
|
|
27
|
+
# Names of pricing tiers to price this order against, without associating a customer profile. An unknown tier name will fail the import. An item that also supplies arbitrary_unit_cost keeps that cost and ignores the tier. If a customer profile is attached to this order during checkout, these tiers are granted to that profile permanently.
|
|
28
|
+
attr_accessor :arbitrary_pricing_tier_names
|
|
29
|
+
|
|
27
30
|
# Arbitrary shipping handling total
|
|
28
31
|
attr_accessor :arbitrary_shipping_handling_total
|
|
29
32
|
|
|
@@ -333,6 +336,7 @@ module UltracartClient
|
|
|
333
336
|
:'advertising_source' => :'advertisingSource',
|
|
334
337
|
:'affiliate_id' => :'affiliate_id',
|
|
335
338
|
:'affiliate_sub_id' => :'affiliate_sub_id',
|
|
339
|
+
:'arbitrary_pricing_tier_names' => :'arbitrary_pricing_tier_names',
|
|
336
340
|
:'arbitrary_shipping_handling_total' => :'arbitrary_shipping_handling_total',
|
|
337
341
|
:'arbitrary_subtotal_discount' => :'arbitrary_subtotal_discount',
|
|
338
342
|
:'arbitrary_tax' => :'arbitrary_tax',
|
|
@@ -441,6 +445,7 @@ module UltracartClient
|
|
|
441
445
|
:'advertising_source' => :'String',
|
|
442
446
|
:'affiliate_id' => :'String',
|
|
443
447
|
:'affiliate_sub_id' => :'String',
|
|
448
|
+
:'arbitrary_pricing_tier_names' => :'Array<String>',
|
|
444
449
|
:'arbitrary_shipping_handling_total' => :'Float',
|
|
445
450
|
:'arbitrary_subtotal_discount' => :'Float',
|
|
446
451
|
:'arbitrary_tax' => :'Float',
|
|
@@ -571,6 +576,12 @@ module UltracartClient
|
|
|
571
576
|
self.affiliate_sub_id = attributes[:'affiliate_sub_id']
|
|
572
577
|
end
|
|
573
578
|
|
|
579
|
+
if attributes.key?(:'arbitrary_pricing_tier_names')
|
|
580
|
+
if (value = attributes[:'arbitrary_pricing_tier_names']).is_a?(Array)
|
|
581
|
+
self.arbitrary_pricing_tier_names = value
|
|
582
|
+
end
|
|
583
|
+
end
|
|
584
|
+
|
|
574
585
|
if attributes.key?(:'arbitrary_shipping_handling_total')
|
|
575
586
|
self.arbitrary_shipping_handling_total = attributes[:'arbitrary_shipping_handling_total']
|
|
576
587
|
end
|
|
@@ -1566,6 +1577,7 @@ module UltracartClient
|
|
|
1566
1577
|
advertising_source == o.advertising_source &&
|
|
1567
1578
|
affiliate_id == o.affiliate_id &&
|
|
1568
1579
|
affiliate_sub_id == o.affiliate_sub_id &&
|
|
1580
|
+
arbitrary_pricing_tier_names == o.arbitrary_pricing_tier_names &&
|
|
1569
1581
|
arbitrary_shipping_handling_total == o.arbitrary_shipping_handling_total &&
|
|
1570
1582
|
arbitrary_subtotal_discount == o.arbitrary_subtotal_discount &&
|
|
1571
1583
|
arbitrary_tax == o.arbitrary_tax &&
|
|
@@ -1671,7 +1683,7 @@ module UltracartClient
|
|
|
1671
1683
|
# Calculates hash code according to all attributes.
|
|
1672
1684
|
# @return [Integer] Hash code
|
|
1673
1685
|
def hash
|
|
1674
|
-
[advertising_source, affiliate_id, affiliate_sub_id, arbitrary_shipping_handling_total, arbitrary_subtotal_discount, arbitrary_tax, arbitrary_tax_rate, arbitrary_taxable_subtotal, arbitrary_taxable_subtotal_discount, associate_with_customer_profile_if_present, auto_approve_purchase_order, billto_address1, billto_address2, billto_city, billto_company, billto_country_code, billto_day_phone, billto_evening_phone, billto_first_name, billto_last_name, billto_postal_code, billto_state_region, billto_title, cc_email, channel_partner_order_id, consider_recurring, coupons, creation_dts, credit_card_authorization_amount, credit_card_authorization_dts, credit_card_authorization_number, credit_card_expiration_month, credit_card_expiration_year, credit_card_type, custom_field1, custom_field2, custom_field3, custom_field4, custom_field5, custom_field6, custom_field7, delivery_date, echeck_bank_aba_code, echeck_bank_account_name, echeck_bank_account_number, echeck_bank_account_type, echeck_bank_name, echeck_bank_owner_type, echeck_customer_tax_id, echeck_drivers_license_dob, echeck_drivers_license_number, echeck_drivers_license_state, email, gift, gift_email, gift_message, hosted_fields_card_token, hosted_fields_cvv_token, insurance_application_id, insurance_claim_id, ip_address, items, least_cost_route, least_cost_route_shipping_methods, mailing_list_opt_in, no_realtime_payment_processing, payment_method, purchase_order_number, rotating_transaction_gateway_code, sales_rep_code, screen_branding_theme_code, ship_on_date, ship_to_residential, shipping_method, shipto_address1, shipto_address2, shipto_city, shipto_company, shipto_country_code, shipto_day_phone, shipto_evening_phone, shipto_first_name, shipto_last_name, shipto_postal_code, shipto_state_region, shipto_title, skip_auto_order_setup, skip_payment_processing, special_instructions, store_completed, store_if_payment_declines, storefront_host_name, tax_county, tax_exempt, transaction, treat_warnings_as_errors, use_prior_payment_information_from_order_id].hash
|
|
1686
|
+
[advertising_source, affiliate_id, affiliate_sub_id, arbitrary_pricing_tier_names, arbitrary_shipping_handling_total, arbitrary_subtotal_discount, arbitrary_tax, arbitrary_tax_rate, arbitrary_taxable_subtotal, arbitrary_taxable_subtotal_discount, associate_with_customer_profile_if_present, auto_approve_purchase_order, billto_address1, billto_address2, billto_city, billto_company, billto_country_code, billto_day_phone, billto_evening_phone, billto_first_name, billto_last_name, billto_postal_code, billto_state_region, billto_title, cc_email, channel_partner_order_id, consider_recurring, coupons, creation_dts, credit_card_authorization_amount, credit_card_authorization_dts, credit_card_authorization_number, credit_card_expiration_month, credit_card_expiration_year, credit_card_type, custom_field1, custom_field2, custom_field3, custom_field4, custom_field5, custom_field6, custom_field7, delivery_date, echeck_bank_aba_code, echeck_bank_account_name, echeck_bank_account_number, echeck_bank_account_type, echeck_bank_name, echeck_bank_owner_type, echeck_customer_tax_id, echeck_drivers_license_dob, echeck_drivers_license_number, echeck_drivers_license_state, email, gift, gift_email, gift_message, hosted_fields_card_token, hosted_fields_cvv_token, insurance_application_id, insurance_claim_id, ip_address, items, least_cost_route, least_cost_route_shipping_methods, mailing_list_opt_in, no_realtime_payment_processing, payment_method, purchase_order_number, rotating_transaction_gateway_code, sales_rep_code, screen_branding_theme_code, ship_on_date, ship_to_residential, shipping_method, shipto_address1, shipto_address2, shipto_city, shipto_company, shipto_country_code, shipto_day_phone, shipto_evening_phone, shipto_first_name, shipto_last_name, shipto_postal_code, shipto_state_region, shipto_title, skip_auto_order_setup, skip_payment_processing, special_instructions, store_completed, store_if_payment_declines, storefront_host_name, tax_county, tax_exempt, transaction, treat_warnings_as_errors, use_prior_payment_information_from_order_id].hash
|
|
1675
1687
|
end
|
|
1676
1688
|
|
|
1677
1689
|
# Builds the object from hash
|
|
@@ -0,0 +1,426 @@
|
|
|
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 ConversationPbxPayConnector
|
|
18
|
+
# Description of the connector
|
|
19
|
+
attr_accessor :description
|
|
20
|
+
|
|
21
|
+
# Environment the connector points at. Only live connectors are returned. Sandbox and unconfigured connectors are ignored.
|
|
22
|
+
attr_accessor :environment
|
|
23
|
+
|
|
24
|
+
# Friendly name of the connector as shown in the Twilio console
|
|
25
|
+
attr_accessor :friendly_name
|
|
26
|
+
|
|
27
|
+
# Merchant Id
|
|
28
|
+
attr_accessor :merchant_id
|
|
29
|
+
|
|
30
|
+
# Payment processor behind this connector
|
|
31
|
+
attr_accessor :processor
|
|
32
|
+
|
|
33
|
+
# The processor account this connector is bound to (Stripe connected account id or Braintree merchant id). A payment captured with this connector can only be charged within this account.
|
|
34
|
+
attr_accessor :processor_account_id
|
|
35
|
+
|
|
36
|
+
# Twilio installed add-on SID for this connector
|
|
37
|
+
attr_accessor :sid
|
|
38
|
+
|
|
39
|
+
# Unique name of the connector. This is the value used for the paymentConnector attribute of the Twilio Pay verb.
|
|
40
|
+
attr_accessor :unique_name
|
|
41
|
+
|
|
42
|
+
class EnumAttributeValidator
|
|
43
|
+
attr_reader :datatype
|
|
44
|
+
attr_reader :allowable_values
|
|
45
|
+
|
|
46
|
+
def initialize(datatype, allowable_values)
|
|
47
|
+
@allowable_values = allowable_values.map do |value|
|
|
48
|
+
case datatype.to_s
|
|
49
|
+
when /Integer/i
|
|
50
|
+
value.to_i
|
|
51
|
+
when /Float/i
|
|
52
|
+
value.to_f
|
|
53
|
+
else
|
|
54
|
+
value
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def valid?(value)
|
|
60
|
+
!value || allowable_values.include?(value)
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
65
|
+
def self.attribute_map
|
|
66
|
+
{
|
|
67
|
+
:'description' => :'description',
|
|
68
|
+
:'environment' => :'environment',
|
|
69
|
+
:'friendly_name' => :'friendly_name',
|
|
70
|
+
:'merchant_id' => :'merchant_id',
|
|
71
|
+
:'processor' => :'processor',
|
|
72
|
+
:'processor_account_id' => :'processor_account_id',
|
|
73
|
+
:'sid' => :'sid',
|
|
74
|
+
:'unique_name' => :'unique_name'
|
|
75
|
+
}
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Returns all the JSON keys this model knows about
|
|
79
|
+
def self.acceptable_attributes
|
|
80
|
+
attribute_map.values
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Attribute type mapping.
|
|
84
|
+
def self.openapi_types
|
|
85
|
+
{
|
|
86
|
+
:'description' => :'String',
|
|
87
|
+
:'environment' => :'String',
|
|
88
|
+
:'friendly_name' => :'String',
|
|
89
|
+
:'merchant_id' => :'String',
|
|
90
|
+
:'processor' => :'String',
|
|
91
|
+
:'processor_account_id' => :'String',
|
|
92
|
+
:'sid' => :'String',
|
|
93
|
+
:'unique_name' => :'String'
|
|
94
|
+
}
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# List of attributes with nullable: true
|
|
98
|
+
def self.openapi_nullable
|
|
99
|
+
Set.new([
|
|
100
|
+
])
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Initializes the object
|
|
104
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
105
|
+
def initialize(attributes = {})
|
|
106
|
+
if (!attributes.is_a?(Hash))
|
|
107
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `UltracartClient::ConversationPbxPayConnector` initialize method"
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
111
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
112
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
113
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `UltracartClient::ConversationPbxPayConnector`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
114
|
+
end
|
|
115
|
+
h[k.to_sym] = v
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if attributes.key?(:'description')
|
|
119
|
+
self.description = attributes[:'description']
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
if attributes.key?(:'environment')
|
|
123
|
+
self.environment = attributes[:'environment']
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
if attributes.key?(:'friendly_name')
|
|
127
|
+
self.friendly_name = attributes[:'friendly_name']
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
if attributes.key?(:'merchant_id')
|
|
131
|
+
self.merchant_id = attributes[:'merchant_id']
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
if attributes.key?(:'processor')
|
|
135
|
+
self.processor = attributes[:'processor']
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if attributes.key?(:'processor_account_id')
|
|
139
|
+
self.processor_account_id = attributes[:'processor_account_id']
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
if attributes.key?(:'sid')
|
|
143
|
+
self.sid = attributes[:'sid']
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
if attributes.key?(:'unique_name')
|
|
147
|
+
self.unique_name = attributes[:'unique_name']
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
152
|
+
# @return Array for valid properties with the reasons
|
|
153
|
+
def list_invalid_properties
|
|
154
|
+
invalid_properties = Array.new
|
|
155
|
+
if !@description.nil? && @description.to_s.length > 250
|
|
156
|
+
invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 250.')
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
if !@friendly_name.nil? && @friendly_name.to_s.length > 100
|
|
160
|
+
invalid_properties.push('invalid value for "friendly_name", the character length must be smaller than or equal to 100.')
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
if !@merchant_id.nil? && @merchant_id.to_s.length > 5
|
|
164
|
+
invalid_properties.push('invalid value for "merchant_id", the character length must be smaller than or equal to 5.')
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
if !@processor_account_id.nil? && @processor_account_id.to_s.length > 100
|
|
168
|
+
invalid_properties.push('invalid value for "processor_account_id", the character length must be smaller than or equal to 100.')
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
if !@sid.nil? && @sid.to_s.length > 50
|
|
172
|
+
invalid_properties.push('invalid value for "sid", the character length must be smaller than or equal to 50.')
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
if !@unique_name.nil? && @unique_name.to_s.length > 100
|
|
176
|
+
invalid_properties.push('invalid value for "unique_name", the character length must be smaller than or equal to 100.')
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
invalid_properties
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# Check to see if the all the properties in the model are valid
|
|
183
|
+
# @return true if the model is valid
|
|
184
|
+
def valid?
|
|
185
|
+
return false if !@description.nil? && @description.to_s.length > 250
|
|
186
|
+
environment_validator = EnumAttributeValidator.new('String', ["live"])
|
|
187
|
+
return false unless environment_validator.valid?(@environment)
|
|
188
|
+
return false if !@friendly_name.nil? && @friendly_name.to_s.length > 100
|
|
189
|
+
return false if !@merchant_id.nil? && @merchant_id.to_s.length > 5
|
|
190
|
+
processor_validator = EnumAttributeValidator.new('String', ["stripe", "braintree", "generic", "unknown"])
|
|
191
|
+
return false unless processor_validator.valid?(@processor)
|
|
192
|
+
return false if !@processor_account_id.nil? && @processor_account_id.to_s.length > 100
|
|
193
|
+
return false if !@sid.nil? && @sid.to_s.length > 50
|
|
194
|
+
return false if !@unique_name.nil? && @unique_name.to_s.length > 100
|
|
195
|
+
true
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
# Custom attribute writer method with validation
|
|
199
|
+
# @param [Object] description Value to be assigned
|
|
200
|
+
def description=(description)
|
|
201
|
+
if !description.nil? && description.to_s.length > 250
|
|
202
|
+
fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 250.'
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
@description = description
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
209
|
+
# @param [Object] environment Object to be assigned
|
|
210
|
+
def environment=(environment)
|
|
211
|
+
validator = EnumAttributeValidator.new('String', ["live"])
|
|
212
|
+
unless validator.valid?(environment)
|
|
213
|
+
fail ArgumentError, "invalid value for \"environment\", must be one of #{validator.allowable_values}."
|
|
214
|
+
end
|
|
215
|
+
@environment = environment
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
# Custom attribute writer method with validation
|
|
219
|
+
# @param [Object] friendly_name Value to be assigned
|
|
220
|
+
def friendly_name=(friendly_name)
|
|
221
|
+
if !friendly_name.nil? && friendly_name.to_s.length > 100
|
|
222
|
+
fail ArgumentError, 'invalid value for "friendly_name", the character length must be smaller than or equal to 100.'
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
@friendly_name = friendly_name
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
# Custom attribute writer method with validation
|
|
229
|
+
# @param [Object] merchant_id Value to be assigned
|
|
230
|
+
def merchant_id=(merchant_id)
|
|
231
|
+
if !merchant_id.nil? && merchant_id.to_s.length > 5
|
|
232
|
+
fail ArgumentError, 'invalid value for "merchant_id", the character length must be smaller than or equal to 5.'
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
@merchant_id = merchant_id
|
|
236
|
+
end
|
|
237
|
+
|
|
238
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
239
|
+
# @param [Object] processor Object to be assigned
|
|
240
|
+
def processor=(processor)
|
|
241
|
+
validator = EnumAttributeValidator.new('String', ["stripe", "braintree", "generic", "unknown"])
|
|
242
|
+
unless validator.valid?(processor)
|
|
243
|
+
fail ArgumentError, "invalid value for \"processor\", must be one of #{validator.allowable_values}."
|
|
244
|
+
end
|
|
245
|
+
@processor = processor
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
# Custom attribute writer method with validation
|
|
249
|
+
# @param [Object] processor_account_id Value to be assigned
|
|
250
|
+
def processor_account_id=(processor_account_id)
|
|
251
|
+
if !processor_account_id.nil? && processor_account_id.to_s.length > 100
|
|
252
|
+
fail ArgumentError, 'invalid value for "processor_account_id", the character length must be smaller than or equal to 100.'
|
|
253
|
+
end
|
|
254
|
+
|
|
255
|
+
@processor_account_id = processor_account_id
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
# Custom attribute writer method with validation
|
|
259
|
+
# @param [Object] sid Value to be assigned
|
|
260
|
+
def sid=(sid)
|
|
261
|
+
if !sid.nil? && sid.to_s.length > 50
|
|
262
|
+
fail ArgumentError, 'invalid value for "sid", the character length must be smaller than or equal to 50.'
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
@sid = sid
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
# Custom attribute writer method with validation
|
|
269
|
+
# @param [Object] unique_name Value to be assigned
|
|
270
|
+
def unique_name=(unique_name)
|
|
271
|
+
if !unique_name.nil? && unique_name.to_s.length > 100
|
|
272
|
+
fail ArgumentError, 'invalid value for "unique_name", the character length must be smaller than or equal to 100.'
|
|
273
|
+
end
|
|
274
|
+
|
|
275
|
+
@unique_name = unique_name
|
|
276
|
+
end
|
|
277
|
+
|
|
278
|
+
# Checks equality by comparing each attribute.
|
|
279
|
+
# @param [Object] Object to be compared
|
|
280
|
+
def ==(o)
|
|
281
|
+
return true if self.equal?(o)
|
|
282
|
+
self.class == o.class &&
|
|
283
|
+
description == o.description &&
|
|
284
|
+
environment == o.environment &&
|
|
285
|
+
friendly_name == o.friendly_name &&
|
|
286
|
+
merchant_id == o.merchant_id &&
|
|
287
|
+
processor == o.processor &&
|
|
288
|
+
processor_account_id == o.processor_account_id &&
|
|
289
|
+
sid == o.sid &&
|
|
290
|
+
unique_name == o.unique_name
|
|
291
|
+
end
|
|
292
|
+
|
|
293
|
+
# @see the `==` method
|
|
294
|
+
# @param [Object] Object to be compared
|
|
295
|
+
def eql?(o)
|
|
296
|
+
self == o
|
|
297
|
+
end
|
|
298
|
+
|
|
299
|
+
# Calculates hash code according to all attributes.
|
|
300
|
+
# @return [Integer] Hash code
|
|
301
|
+
def hash
|
|
302
|
+
[description, environment, friendly_name, merchant_id, processor, processor_account_id, sid, unique_name].hash
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
# Builds the object from hash
|
|
306
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
307
|
+
# @return [Object] Returns the model itself
|
|
308
|
+
def self.build_from_hash(attributes)
|
|
309
|
+
new.build_from_hash(attributes)
|
|
310
|
+
end
|
|
311
|
+
|
|
312
|
+
# Builds the object from hash
|
|
313
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
314
|
+
# @return [Object] Returns the model itself
|
|
315
|
+
def build_from_hash(attributes)
|
|
316
|
+
return nil unless attributes.is_a?(Hash)
|
|
317
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
318
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
319
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
320
|
+
self.send("#{key}=", nil)
|
|
321
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
322
|
+
# check to ensure the input is an array given that the attribute
|
|
323
|
+
# is documented as an array but the input is not
|
|
324
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
325
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
326
|
+
end
|
|
327
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
328
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
329
|
+
end
|
|
330
|
+
end
|
|
331
|
+
|
|
332
|
+
self
|
|
333
|
+
end
|
|
334
|
+
|
|
335
|
+
# Deserializes the data based on type
|
|
336
|
+
# @param string type Data type
|
|
337
|
+
# @param string value Value to be deserialized
|
|
338
|
+
# @return [Object] Deserialized data
|
|
339
|
+
def _deserialize(type, value)
|
|
340
|
+
case type.to_sym
|
|
341
|
+
when :Time
|
|
342
|
+
Time.parse(value)
|
|
343
|
+
when :Date
|
|
344
|
+
Date.parse(value)
|
|
345
|
+
when :String
|
|
346
|
+
value.to_s
|
|
347
|
+
when :Integer
|
|
348
|
+
value.to_i
|
|
349
|
+
when :Float
|
|
350
|
+
value.to_f
|
|
351
|
+
when :Boolean
|
|
352
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
353
|
+
true
|
|
354
|
+
else
|
|
355
|
+
false
|
|
356
|
+
end
|
|
357
|
+
when :Object
|
|
358
|
+
# generic object (usually a Hash), return directly
|
|
359
|
+
value
|
|
360
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
361
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
362
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
363
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
364
|
+
k_type = Regexp.last_match[:k_type]
|
|
365
|
+
v_type = Regexp.last_match[:v_type]
|
|
366
|
+
{}.tap do |hash|
|
|
367
|
+
value.each do |k, v|
|
|
368
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
369
|
+
end
|
|
370
|
+
end
|
|
371
|
+
else # model
|
|
372
|
+
# models (e.g. Pet) or oneOf
|
|
373
|
+
klass = UltracartClient.const_get(type)
|
|
374
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
|
375
|
+
end
|
|
376
|
+
end
|
|
377
|
+
|
|
378
|
+
# Returns the string representation of the object
|
|
379
|
+
# @return [String] String presentation of the object
|
|
380
|
+
def to_s
|
|
381
|
+
to_hash.to_s
|
|
382
|
+
end
|
|
383
|
+
|
|
384
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
385
|
+
# @return [Hash] Returns the object in the form of hash
|
|
386
|
+
def to_body
|
|
387
|
+
to_hash
|
|
388
|
+
end
|
|
389
|
+
|
|
390
|
+
# Returns the object in the form of hash
|
|
391
|
+
# @return [Hash] Returns the object in the form of hash
|
|
392
|
+
def to_hash
|
|
393
|
+
hash = {}
|
|
394
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
395
|
+
value = self.send(attr)
|
|
396
|
+
if value.nil?
|
|
397
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
398
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
399
|
+
end
|
|
400
|
+
|
|
401
|
+
hash[param] = _to_hash(value)
|
|
402
|
+
end
|
|
403
|
+
hash
|
|
404
|
+
end
|
|
405
|
+
|
|
406
|
+
# Outputs non-array value in the form of hash
|
|
407
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
408
|
+
# @param [Object] value Any valid value
|
|
409
|
+
# @return [Hash] Returns the value in the form of hash
|
|
410
|
+
def _to_hash(value)
|
|
411
|
+
if value.is_a?(Array)
|
|
412
|
+
value.compact.map { |v| _to_hash(v) }
|
|
413
|
+
elsif value.is_a?(Hash)
|
|
414
|
+
{}.tap do |hash|
|
|
415
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
416
|
+
end
|
|
417
|
+
elsif value.respond_to? :to_hash
|
|
418
|
+
value.to_hash
|
|
419
|
+
else
|
|
420
|
+
value
|
|
421
|
+
end
|
|
422
|
+
end
|
|
423
|
+
|
|
424
|
+
end
|
|
425
|
+
|
|
426
|
+
end
|