digital_femsa 1.0.0 → 1.1.0
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/Makefile +14 -0
- data/README.md +28 -33
- data/VERSION +1 -1
- data/config-ruby.json +1 -1
- data/docs/ApiKeyCreateResponse.md +1 -1
- data/docs/ApiKeyRequest.md +2 -2
- data/docs/ApiKeyResponseOnDelete.md +2 -2
- data/docs/ApiKeysApi.md +10 -10
- data/docs/BalanceResponse.md +8 -8
- data/docs/BalancesApi.md +1 -1
- data/docs/ChargeOrderResponse.md +1 -1
- data/docs/ChargeOrderResponseChannel.md +24 -0
- data/docs/ChargeRequest.md +1 -1
- data/docs/ChargeRequestPaymentMethod.md +3 -3
- data/docs/ChargeResponse.md +9 -7
- data/docs/ChargeResponseChannel.md +3 -3
- data/docs/ChargeResponseRefundsData.md +5 -1
- data/docs/ChargesApi.md +16 -12
- data/docs/ChargesDataResponse.md +9 -7
- data/docs/Checkout.md +17 -15
- data/docs/CheckoutOrderTemplate.md +3 -3
- data/docs/CheckoutResponse.md +1 -1
- data/docs/CreateCustomerFiscalEntitiesResponse.md +2 -2
- data/docs/Customer.md +13 -19
- data/docs/CustomerAddress.md +2 -2
- data/docs/CustomerFiscalEntitiesDataResponse.md +2 -2
- data/docs/CustomerFiscalEntitiesRequest.md +3 -3
- data/docs/CustomerInfo.md +4 -4
- data/docs/CustomerPaymentMethodRequest.md +1 -1
- data/docs/CustomerResponse.md +17 -21
- data/docs/CustomerShippingContactsResponse.md +5 -5
- data/docs/CustomersApi.md +15 -15
- data/docs/CustomersResponse.md +1 -1
- data/docs/DeleteApiKeysResponse.md +1 -1
- data/docs/DiscountsApi.md +9 -9
- data/docs/EventsApi.md +2 -2
- data/docs/EventsResendResponse.md +1 -1
- data/docs/GetChargesResponse.md +4 -4
- data/docs/GetTransactionsResponse.md +1 -1
- data/docs/LogsApi.md +1 -1
- data/docs/OrderFiscalEntityRequest.md +4 -4
- data/docs/OrderRefundRequest.md +7 -5
- data/docs/OrderRequest.md +17 -19
- data/docs/OrderResponse.md +37 -35
- data/docs/OrderResponseChannel.md +24 -0
- data/docs/OrderResponseShippingContact.md +4 -4
- data/docs/OrderUpdateFiscalEntityRequest.md +1 -1
- data/docs/OrderUpdateRequest.md +19 -15
- data/docs/OrdersApi.md +16 -16
- data/docs/PaymentLinkApi.md +12 -82
- data/docs/PaymentMethodCash.md +4 -4
- data/docs/PaymentMethodCashRequest.md +2 -2
- data/docs/PaymentMethodsApi.md +5 -5
- data/docs/Product.md +10 -12
- data/docs/ProductDataResponse.md +9 -11
- data/docs/ProductOrderResponse.md +9 -11
- data/docs/ProductsApi.md +7 -7
- data/docs/ShippingContactsApi.md +9 -9
- data/docs/ShippingOrderResponse.md +5 -3
- data/docs/ShippingRequest.md +2 -0
- data/docs/ShippingsApi.md +7 -7
- data/docs/TaxesApi.md +7 -7
- data/docs/TransactionResponse.md +20 -14
- data/docs/TransactionsApi.md +6 -6
- data/docs/TransfersApi.md +10 -10
- data/docs/UpdateCustomer.md +17 -21
- data/docs/UpdateCustomerFiscalEntitiesResponse.md +2 -2
- data/docs/UpdateOrderTaxRequest.md +2 -2
- data/docs/UpdateProduct.md +7 -9
- data/docs/WebhookKeysApi.md +18 -14
- data/docs/WebhooksApi.md +28 -22
- data/lib/digital_femsa/api/api_keys_api.rb +8 -8
- data/lib/digital_femsa/api/balances_api.rb +2 -2
- data/lib/digital_femsa/api/charges_api.rb +13 -9
- data/lib/digital_femsa/api/customers_api.rb +12 -12
- data/lib/digital_femsa/api/discounts_api.rb +12 -12
- data/lib/digital_femsa/api/events_api.rb +4 -4
- data/lib/digital_femsa/api/logs_api.rb +2 -2
- data/lib/digital_femsa/api/orders_api.rb +20 -20
- data/lib/digital_femsa/api/payment_link_api.rb +10 -86
- data/lib/digital_femsa/api/payment_methods_api.rb +8 -8
- data/lib/digital_femsa/api/products_api.rb +10 -10
- data/lib/digital_femsa/api/shipping_contacts_api.rb +8 -8
- data/lib/digital_femsa/api/shippings_api.rb +10 -10
- data/lib/digital_femsa/api/taxes_api.rb +10 -10
- data/lib/digital_femsa/api/transactions_api.rb +6 -6
- data/lib/digital_femsa/api/transfers_api.rb +8 -8
- data/lib/digital_femsa/api/webhook_keys_api.rb +14 -10
- data/lib/digital_femsa/api/webhooks_api.rb +23 -16
- data/lib/digital_femsa/api_client.rb +9 -5
- data/lib/digital_femsa/models/api_key_create_response.rb +1 -1
- data/lib/digital_femsa/models/api_key_request.rb +36 -1
- data/lib/digital_femsa/models/balance_response.rb +9 -9
- data/lib/digital_femsa/models/charge_order_response.rb +1 -1
- data/lib/digital_femsa/models/{order_next_action_response.rb → charge_order_response_channel.rb} +34 -18
- data/lib/digital_femsa/models/charge_request_payment_method.rb +3 -2
- data/lib/digital_femsa/models/charge_response.rb +15 -4
- data/lib/digital_femsa/models/charge_response_refunds_data.rb +23 -4
- data/lib/digital_femsa/models/charge_update_request.rb +1 -1
- data/lib/digital_femsa/models/charges_data_response.rb +15 -4
- data/lib/digital_femsa/models/checkout.rb +97 -81
- data/lib/digital_femsa/models/checkout_order_template.rb +4 -4
- data/lib/digital_femsa/models/checkout_order_template_customer_info.rb +1 -1
- data/lib/digital_femsa/models/checkout_request.rb +1 -1
- data/lib/digital_femsa/models/checkout_response.rb +1 -1
- data/lib/digital_femsa/models/create_customer_fiscal_entities_response.rb +10 -10
- data/lib/digital_femsa/models/customer.rb +57 -95
- data/lib/digital_femsa/models/customer_address.rb +7 -0
- data/lib/digital_femsa/models/customer_fiscal_entities_data_response.rb +10 -10
- data/lib/digital_femsa/models/customer_fiscal_entities_request.rb +13 -13
- data/lib/digital_femsa/models/customer_info.rb +13 -20
- data/lib/digital_femsa/models/customer_payment_method_request.rb +2 -2
- data/lib/digital_femsa/models/customer_payment_sources_inner.rb +104 -0
- data/lib/digital_femsa/models/customer_response.rb +122 -113
- data/lib/digital_femsa/models/customer_shipping_contacts_response.rb +2 -0
- data/lib/digital_femsa/models/customers_response.rb +1 -0
- data/lib/digital_femsa/models/events_resend_response.rb +1 -1
- data/lib/digital_femsa/models/get_charges_response.rb +21 -21
- data/lib/digital_femsa/models/get_transactions_response.rb +1 -1
- data/lib/digital_femsa/models/log_response.rb +1 -1
- data/lib/digital_femsa/models/logs_response.rb +1 -1
- data/lib/digital_femsa/models/order_fiscal_entity_response.rb +1 -1
- data/lib/digital_femsa/models/order_refund_request.rb +59 -11
- data/lib/digital_femsa/models/order_request.rb +69 -79
- data/lib/digital_femsa/models/order_response.rb +187 -119
- data/lib/digital_femsa/models/{order_next_action_response_redirect_to_url.rb → order_response_channel.rb} +35 -19
- data/lib/digital_femsa/models/order_response_charges.rb +1 -1
- data/lib/digital_femsa/models/order_response_checkout.rb +1 -0
- data/lib/digital_femsa/models/order_response_customer_info.rb +1 -0
- data/lib/digital_femsa/models/order_response_shipping_contact.rb +3 -0
- data/lib/digital_femsa/models/order_update_fiscal_entity_request.rb +1 -1
- data/lib/digital_femsa/models/order_update_request.rb +106 -65
- data/lib/digital_femsa/models/payment_method_cash.rb +1 -1
- data/lib/digital_femsa/models/payment_method_cash_request.rb +2 -1
- data/lib/digital_femsa/models/product.rb +103 -95
- data/lib/digital_femsa/models/product_data_response.rb +103 -95
- data/lib/digital_femsa/models/product_order_response.rb +103 -95
- data/lib/digital_femsa/models/shipping_order_response.rb +11 -1
- data/lib/digital_femsa/models/shipping_request.rb +12 -1
- data/lib/digital_femsa/models/transaction_response.rb +172 -99
- data/lib/digital_femsa/models/transfers_response.rb +1 -1
- data/lib/digital_femsa/models/transfers_response_destination.rb +312 -0
- data/lib/digital_femsa/models/update_customer.rb +42 -85
- data/lib/digital_femsa/models/update_customer_fiscal_entities_response.rb +10 -10
- data/lib/digital_femsa/models/update_order_discount_lines_request.rb +34 -0
- data/lib/digital_femsa/models/update_order_tax_request.rb +2 -2
- data/lib/digital_femsa/models/update_payment_methods_amount.rb +105 -0
- data/lib/digital_femsa/models/update_payment_methods_expires_at.rb +105 -0
- data/lib/digital_femsa/models/update_product.rb +85 -58
- data/lib/digital_femsa/models/webhook_key_delete_response.rb +1 -1
- data/lib/digital_femsa/models/webhook_key_request.rb +1 -0
- data/lib/digital_femsa/models/webhook_key_response.rb +1 -1
- data/lib/digital_femsa/models/webhook_request.rb +1 -1
- data/lib/digital_femsa/models/webhook_response.rb +1 -1
- data/lib/digital_femsa/models/webhook_update_request.rb +1 -1
- data/lib/digital_femsa/version.rb +1 -1
- data/lib/digital_femsa.rb +2 -6
- data/templates/ruby/api_client.mustache +8 -4
- metadata +26 -26
- data/docs/CustomerAntifraudInfo.md +0 -20
- data/docs/CustomerAntifraudInfoResponse.md +0 -20
- data/docs/OrderNextActionResponse.md +0 -20
- data/docs/OrderNextActionResponseRedirectToUrl.md +0 -20
- data/docs/SmsCheckoutRequest.md +0 -18
- data/docs/UpdateCustomerAntifraudInfo.md +0 -20
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Femsa API
|
|
3
|
+
|
|
4
|
+
#Femsa sdk
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 2.1.0
|
|
7
|
+
Contact: engineering@femsa.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.5.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module DigitalFemsa
|
|
17
|
+
module CustomerPaymentSourcesInner
|
|
18
|
+
class << self
|
|
19
|
+
# List of class defined in oneOf (OpenAPI v3)
|
|
20
|
+
def openapi_one_of
|
|
21
|
+
[
|
|
22
|
+
:'PaymentMethodCashRequest'
|
|
23
|
+
]
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Builds the object
|
|
27
|
+
# @param [Mixed] Data to be matched against the list of oneOf items
|
|
28
|
+
# @return [Object] Returns the model or the data itself
|
|
29
|
+
def build(data)
|
|
30
|
+
# Go through the list of oneOf items and attempt to identify the appropriate one.
|
|
31
|
+
# Note:
|
|
32
|
+
# - We do not attempt to check whether exactly one item matches.
|
|
33
|
+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
|
|
34
|
+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
|
|
35
|
+
# - TODO: scalar values are de facto behaving as if they were nullable.
|
|
36
|
+
# - TODO: logging when debugging is set.
|
|
37
|
+
openapi_one_of.each do |klass|
|
|
38
|
+
begin
|
|
39
|
+
next if klass == :AnyType # "nullable: true"
|
|
40
|
+
typed_data = find_and_cast_into_type(klass, data)
|
|
41
|
+
return typed_data if typed_data
|
|
42
|
+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
openapi_one_of.include?(:AnyType) ? data : nil
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
private
|
|
50
|
+
|
|
51
|
+
SchemaMismatchError = Class.new(StandardError)
|
|
52
|
+
|
|
53
|
+
# Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
|
|
54
|
+
def find_and_cast_into_type(klass, data)
|
|
55
|
+
return if data.nil?
|
|
56
|
+
|
|
57
|
+
case klass.to_s
|
|
58
|
+
when 'Boolean'
|
|
59
|
+
return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
|
|
60
|
+
when 'Float'
|
|
61
|
+
return data if data.instance_of?(Float)
|
|
62
|
+
when 'Integer'
|
|
63
|
+
return data if data.instance_of?(Integer)
|
|
64
|
+
when 'Time'
|
|
65
|
+
return Time.parse(data)
|
|
66
|
+
when 'Date'
|
|
67
|
+
return Date.parse(data)
|
|
68
|
+
when 'String'
|
|
69
|
+
return data if data.instance_of?(String)
|
|
70
|
+
when 'Object' # "type: object"
|
|
71
|
+
return data if data.instance_of?(Hash)
|
|
72
|
+
when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
|
|
73
|
+
if data.instance_of?(Array)
|
|
74
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
75
|
+
return data.map { |item| find_and_cast_into_type(sub_type, item) }
|
|
76
|
+
end
|
|
77
|
+
when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
|
|
78
|
+
if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
|
|
79
|
+
sub_type = Regexp.last_match[:sub_type]
|
|
80
|
+
return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
|
|
81
|
+
end
|
|
82
|
+
else # model
|
|
83
|
+
const = DigitalFemsa.const_get(klass)
|
|
84
|
+
if const
|
|
85
|
+
if const.respond_to?(:openapi_one_of) # nested oneOf model
|
|
86
|
+
model = const.build(data)
|
|
87
|
+
return model if model
|
|
88
|
+
else
|
|
89
|
+
# raise if data contains keys that are not known to the model
|
|
90
|
+
raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
|
|
91
|
+
model = const.build_from_hash(data)
|
|
92
|
+
return model if model
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
raise # if no match by now, raise
|
|
98
|
+
rescue
|
|
99
|
+
raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
end
|
|
@@ -16,66 +16,83 @@ require 'time'
|
|
|
16
16
|
module DigitalFemsa
|
|
17
17
|
# customer response
|
|
18
18
|
class CustomerResponse
|
|
19
|
-
|
|
19
|
+
# Customer's ID
|
|
20
|
+
attr_accessor :id
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
attr_accessor :corporate
|
|
22
|
+
attr_accessor :object
|
|
23
23
|
|
|
24
|
-
# Creation date of the object
|
|
24
|
+
# Creation date of the object (Unix timestamp)
|
|
25
25
|
attr_accessor :created_at
|
|
26
26
|
|
|
27
|
-
#
|
|
28
|
-
attr_accessor :
|
|
29
|
-
|
|
30
|
-
attr_accessor :default_fiscal_entity_id
|
|
31
|
-
|
|
32
|
-
attr_accessor :default_shipping_contact_id
|
|
27
|
+
# true if the object exists in live mode or false if the object exists in test mode
|
|
28
|
+
attr_accessor :livemode
|
|
33
29
|
|
|
34
|
-
|
|
30
|
+
# Customer's name
|
|
31
|
+
attr_accessor :name
|
|
35
32
|
|
|
36
33
|
attr_accessor :email
|
|
37
34
|
|
|
38
|
-
|
|
35
|
+
# Customer's phone number
|
|
36
|
+
attr_accessor :phone
|
|
39
37
|
|
|
40
|
-
#
|
|
41
|
-
attr_accessor :
|
|
38
|
+
# true if the customer is a company
|
|
39
|
+
attr_accessor :corporate
|
|
42
40
|
|
|
43
|
-
#
|
|
44
|
-
attr_accessor :
|
|
41
|
+
# Custom reference
|
|
42
|
+
attr_accessor :custom_reference
|
|
45
43
|
|
|
46
|
-
|
|
47
|
-
attr_accessor :name
|
|
44
|
+
attr_accessor :default_fiscal_entity_id
|
|
48
45
|
|
|
49
|
-
attr_accessor :
|
|
46
|
+
attr_accessor :default_shipping_contact_id
|
|
50
47
|
|
|
51
|
-
|
|
48
|
+
# Customer metadata (maps to contextual_data in backend)
|
|
49
|
+
attr_accessor :metadata
|
|
52
50
|
|
|
53
51
|
attr_accessor :payment_sources
|
|
54
52
|
|
|
55
|
-
|
|
56
|
-
attr_accessor :phone
|
|
53
|
+
attr_accessor :fiscal_entities
|
|
57
54
|
|
|
58
55
|
attr_accessor :shipping_contacts
|
|
59
56
|
|
|
57
|
+
class EnumAttributeValidator
|
|
58
|
+
attr_reader :datatype
|
|
59
|
+
attr_reader :allowable_values
|
|
60
|
+
|
|
61
|
+
def initialize(datatype, allowable_values)
|
|
62
|
+
@allowable_values = allowable_values.map do |value|
|
|
63
|
+
case datatype.to_s
|
|
64
|
+
when /Integer/i
|
|
65
|
+
value.to_i
|
|
66
|
+
when /Float/i
|
|
67
|
+
value.to_f
|
|
68
|
+
else
|
|
69
|
+
value
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def valid?(value)
|
|
75
|
+
!value || allowable_values.include?(value)
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
|
|
60
79
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
61
80
|
def self.attribute_map
|
|
62
81
|
{
|
|
63
|
-
:'
|
|
64
|
-
:'
|
|
82
|
+
:'id' => :'id',
|
|
83
|
+
:'object' => :'object',
|
|
65
84
|
:'created_at' => :'created_at',
|
|
85
|
+
:'livemode' => :'livemode',
|
|
86
|
+
:'name' => :'name',
|
|
87
|
+
:'email' => :'email',
|
|
88
|
+
:'phone' => :'phone',
|
|
89
|
+
:'corporate' => :'corporate',
|
|
66
90
|
:'custom_reference' => :'custom_reference',
|
|
67
91
|
:'default_fiscal_entity_id' => :'default_fiscal_entity_id',
|
|
68
92
|
:'default_shipping_contact_id' => :'default_shipping_contact_id',
|
|
69
|
-
:'default_payment_source_id' => :'default_payment_source_id',
|
|
70
|
-
:'email' => :'email',
|
|
71
|
-
:'fiscal_entities' => :'fiscal_entities',
|
|
72
|
-
:'id' => :'id',
|
|
73
|
-
:'livemode' => :'livemode',
|
|
74
|
-
:'name' => :'name',
|
|
75
93
|
:'metadata' => :'metadata',
|
|
76
|
-
:'object' => :'object',
|
|
77
94
|
:'payment_sources' => :'payment_sources',
|
|
78
|
-
:'
|
|
95
|
+
:'fiscal_entities' => :'fiscal_entities',
|
|
79
96
|
:'shipping_contacts' => :'shipping_contacts'
|
|
80
97
|
}
|
|
81
98
|
end
|
|
@@ -88,22 +105,20 @@ module DigitalFemsa
|
|
|
88
105
|
# Attribute type mapping.
|
|
89
106
|
def self.openapi_types
|
|
90
107
|
{
|
|
91
|
-
:'
|
|
92
|
-
:'
|
|
108
|
+
:'id' => :'String',
|
|
109
|
+
:'object' => :'String',
|
|
93
110
|
:'created_at' => :'Integer',
|
|
111
|
+
:'livemode' => :'Boolean',
|
|
112
|
+
:'name' => :'String',
|
|
113
|
+
:'email' => :'String',
|
|
114
|
+
:'phone' => :'String',
|
|
115
|
+
:'corporate' => :'Boolean',
|
|
94
116
|
:'custom_reference' => :'String',
|
|
95
117
|
:'default_fiscal_entity_id' => :'String',
|
|
96
118
|
:'default_shipping_contact_id' => :'String',
|
|
97
|
-
:'default_payment_source_id' => :'String',
|
|
98
|
-
:'email' => :'String',
|
|
99
|
-
:'fiscal_entities' => :'CustomerFiscalEntitiesResponse',
|
|
100
|
-
:'id' => :'String',
|
|
101
|
-
:'livemode' => :'Boolean',
|
|
102
|
-
:'name' => :'String',
|
|
103
119
|
:'metadata' => :'Hash<String, Object>',
|
|
104
|
-
:'object' => :'String',
|
|
105
120
|
:'payment_sources' => :'CustomerPaymentMethodsResponse',
|
|
106
|
-
:'
|
|
121
|
+
:'fiscal_entities' => :'CustomerFiscalEntitiesResponse',
|
|
107
122
|
:'shipping_contacts' => :'CustomerResponseShippingContacts'
|
|
108
123
|
}
|
|
109
124
|
end
|
|
@@ -111,9 +126,12 @@ module DigitalFemsa
|
|
|
111
126
|
# List of attributes with nullable: true
|
|
112
127
|
def self.openapi_nullable
|
|
113
128
|
Set.new([
|
|
114
|
-
:'
|
|
129
|
+
:'name',
|
|
130
|
+
:'email',
|
|
131
|
+
:'phone',
|
|
115
132
|
:'default_fiscal_entity_id',
|
|
116
|
-
:'
|
|
133
|
+
:'default_shipping_contact_id',
|
|
134
|
+
:'metadata',
|
|
117
135
|
])
|
|
118
136
|
end
|
|
119
137
|
|
|
@@ -132,12 +150,16 @@ module DigitalFemsa
|
|
|
132
150
|
h[k.to_sym] = v
|
|
133
151
|
}
|
|
134
152
|
|
|
135
|
-
if attributes.key?(:'
|
|
136
|
-
self.
|
|
153
|
+
if attributes.key?(:'id')
|
|
154
|
+
self.id = attributes[:'id']
|
|
155
|
+
else
|
|
156
|
+
self.id = nil
|
|
137
157
|
end
|
|
138
158
|
|
|
139
|
-
if attributes.key?(:'
|
|
140
|
-
self.
|
|
159
|
+
if attributes.key?(:'object')
|
|
160
|
+
self.object = attributes[:'object']
|
|
161
|
+
else
|
|
162
|
+
self.object = nil
|
|
141
163
|
end
|
|
142
164
|
|
|
143
165
|
if attributes.key?(:'created_at')
|
|
@@ -146,46 +168,38 @@ module DigitalFemsa
|
|
|
146
168
|
self.created_at = nil
|
|
147
169
|
end
|
|
148
170
|
|
|
149
|
-
if attributes.key?(:'
|
|
150
|
-
self.
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
if attributes.key?(:'default_fiscal_entity_id')
|
|
154
|
-
self.default_fiscal_entity_id = attributes[:'default_fiscal_entity_id']
|
|
155
|
-
end
|
|
156
|
-
|
|
157
|
-
if attributes.key?(:'default_shipping_contact_id')
|
|
158
|
-
self.default_shipping_contact_id = attributes[:'default_shipping_contact_id']
|
|
171
|
+
if attributes.key?(:'livemode')
|
|
172
|
+
self.livemode = attributes[:'livemode']
|
|
173
|
+
else
|
|
174
|
+
self.livemode = nil
|
|
159
175
|
end
|
|
160
176
|
|
|
161
|
-
if attributes.key?(:'
|
|
162
|
-
self.
|
|
177
|
+
if attributes.key?(:'name')
|
|
178
|
+
self.name = attributes[:'name']
|
|
163
179
|
end
|
|
164
180
|
|
|
165
181
|
if attributes.key?(:'email')
|
|
166
182
|
self.email = attributes[:'email']
|
|
167
183
|
end
|
|
168
184
|
|
|
169
|
-
if attributes.key?(:'
|
|
170
|
-
self.
|
|
185
|
+
if attributes.key?(:'phone')
|
|
186
|
+
self.phone = attributes[:'phone']
|
|
171
187
|
end
|
|
172
188
|
|
|
173
|
-
if attributes.key?(:'
|
|
174
|
-
self.
|
|
175
|
-
else
|
|
176
|
-
self.id = nil
|
|
189
|
+
if attributes.key?(:'corporate')
|
|
190
|
+
self.corporate = attributes[:'corporate']
|
|
177
191
|
end
|
|
178
192
|
|
|
179
|
-
if attributes.key?(:'
|
|
180
|
-
self.
|
|
181
|
-
else
|
|
182
|
-
self.livemode = nil
|
|
193
|
+
if attributes.key?(:'custom_reference')
|
|
194
|
+
self.custom_reference = attributes[:'custom_reference']
|
|
183
195
|
end
|
|
184
196
|
|
|
185
|
-
if attributes.key?(:'
|
|
186
|
-
self.
|
|
187
|
-
|
|
188
|
-
|
|
197
|
+
if attributes.key?(:'default_fiscal_entity_id')
|
|
198
|
+
self.default_fiscal_entity_id = attributes[:'default_fiscal_entity_id']
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
if attributes.key?(:'default_shipping_contact_id')
|
|
202
|
+
self.default_shipping_contact_id = attributes[:'default_shipping_contact_id']
|
|
189
203
|
end
|
|
190
204
|
|
|
191
205
|
if attributes.key?(:'metadata')
|
|
@@ -194,18 +208,12 @@ module DigitalFemsa
|
|
|
194
208
|
end
|
|
195
209
|
end
|
|
196
210
|
|
|
197
|
-
if attributes.key?(:'object')
|
|
198
|
-
self.object = attributes[:'object']
|
|
199
|
-
else
|
|
200
|
-
self.object = nil
|
|
201
|
-
end
|
|
202
|
-
|
|
203
211
|
if attributes.key?(:'payment_sources')
|
|
204
212
|
self.payment_sources = attributes[:'payment_sources']
|
|
205
213
|
end
|
|
206
214
|
|
|
207
|
-
if attributes.key?(:'
|
|
208
|
-
self.
|
|
215
|
+
if attributes.key?(:'fiscal_entities')
|
|
216
|
+
self.fiscal_entities = attributes[:'fiscal_entities']
|
|
209
217
|
end
|
|
210
218
|
|
|
211
219
|
if attributes.key?(:'shipping_contacts')
|
|
@@ -218,30 +226,26 @@ module DigitalFemsa
|
|
|
218
226
|
def list_invalid_properties
|
|
219
227
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
220
228
|
invalid_properties = Array.new
|
|
221
|
-
if @created_at.nil?
|
|
222
|
-
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
|
223
|
-
end
|
|
224
|
-
|
|
225
229
|
if @id.nil?
|
|
226
230
|
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
227
231
|
end
|
|
228
232
|
|
|
229
|
-
if @
|
|
230
|
-
invalid_properties.push('invalid value for "
|
|
233
|
+
if @object.nil?
|
|
234
|
+
invalid_properties.push('invalid value for "object", object cannot be nil.')
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
if @created_at.nil?
|
|
238
|
+
invalid_properties.push('invalid value for "created_at", created_at cannot be nil.')
|
|
231
239
|
end
|
|
232
240
|
|
|
233
|
-
if @
|
|
234
|
-
invalid_properties.push('invalid value for "
|
|
241
|
+
if @livemode.nil?
|
|
242
|
+
invalid_properties.push('invalid value for "livemode", livemode cannot be nil.')
|
|
235
243
|
end
|
|
236
244
|
|
|
237
245
|
if !@metadata.nil? && @metadata.length > 100
|
|
238
246
|
invalid_properties.push('invalid value for "metadata", number of items must be less than or equal to 100.')
|
|
239
247
|
end
|
|
240
248
|
|
|
241
|
-
if @object.nil?
|
|
242
|
-
invalid_properties.push('invalid value for "object", object cannot be nil.')
|
|
243
|
-
end
|
|
244
|
-
|
|
245
249
|
invalid_properties
|
|
246
250
|
end
|
|
247
251
|
|
|
@@ -249,23 +253,30 @@ module DigitalFemsa
|
|
|
249
253
|
# @return true if the model is valid
|
|
250
254
|
def valid?
|
|
251
255
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
252
|
-
return false if @created_at.nil?
|
|
253
256
|
return false if @id.nil?
|
|
257
|
+
return false if @object.nil?
|
|
258
|
+
object_validator = EnumAttributeValidator.new('String', ["customer"])
|
|
259
|
+
return false unless object_validator.valid?(@object)
|
|
260
|
+
return false if @created_at.nil?
|
|
254
261
|
return false if @livemode.nil?
|
|
255
|
-
return false if @name.nil?
|
|
256
262
|
return false if !@metadata.nil? && @metadata.length > 100
|
|
257
|
-
return false if @object.nil?
|
|
258
263
|
true
|
|
259
264
|
end
|
|
260
265
|
|
|
266
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
267
|
+
# @param [Object] object Object to be assigned
|
|
268
|
+
def object=(object)
|
|
269
|
+
validator = EnumAttributeValidator.new('String', ["customer"])
|
|
270
|
+
unless validator.valid?(object)
|
|
271
|
+
fail ArgumentError, "invalid value for \"object\", must be one of #{validator.allowable_values}."
|
|
272
|
+
end
|
|
273
|
+
@object = object
|
|
274
|
+
end
|
|
275
|
+
|
|
261
276
|
# Custom attribute writer method with validation
|
|
262
277
|
# @param [Object] metadata Value to be assigned
|
|
263
278
|
def metadata=(metadata)
|
|
264
|
-
if metadata.nil?
|
|
265
|
-
fail ArgumentError, 'metadata cannot be nil'
|
|
266
|
-
end
|
|
267
|
-
|
|
268
|
-
if metadata.length > 100
|
|
279
|
+
if !metadata.nil? && metadata.length > 100
|
|
269
280
|
fail ArgumentError, 'invalid value for "metadata", number of items must be less than or equal to 100.'
|
|
270
281
|
end
|
|
271
282
|
|
|
@@ -277,22 +288,20 @@ module DigitalFemsa
|
|
|
277
288
|
def ==(o)
|
|
278
289
|
return true if self.equal?(o)
|
|
279
290
|
self.class == o.class &&
|
|
280
|
-
|
|
281
|
-
|
|
291
|
+
id == o.id &&
|
|
292
|
+
object == o.object &&
|
|
282
293
|
created_at == o.created_at &&
|
|
294
|
+
livemode == o.livemode &&
|
|
295
|
+
name == o.name &&
|
|
296
|
+
email == o.email &&
|
|
297
|
+
phone == o.phone &&
|
|
298
|
+
corporate == o.corporate &&
|
|
283
299
|
custom_reference == o.custom_reference &&
|
|
284
300
|
default_fiscal_entity_id == o.default_fiscal_entity_id &&
|
|
285
301
|
default_shipping_contact_id == o.default_shipping_contact_id &&
|
|
286
|
-
default_payment_source_id == o.default_payment_source_id &&
|
|
287
|
-
email == o.email &&
|
|
288
|
-
fiscal_entities == o.fiscal_entities &&
|
|
289
|
-
id == o.id &&
|
|
290
|
-
livemode == o.livemode &&
|
|
291
|
-
name == o.name &&
|
|
292
302
|
metadata == o.metadata &&
|
|
293
|
-
object == o.object &&
|
|
294
303
|
payment_sources == o.payment_sources &&
|
|
295
|
-
|
|
304
|
+
fiscal_entities == o.fiscal_entities &&
|
|
296
305
|
shipping_contacts == o.shipping_contacts
|
|
297
306
|
end
|
|
298
307
|
|
|
@@ -305,7 +314,7 @@ module DigitalFemsa
|
|
|
305
314
|
# Calculates hash code according to all attributes.
|
|
306
315
|
# @return [Integer] Hash code
|
|
307
316
|
def hash
|
|
308
|
-
[
|
|
317
|
+
[id, object, created_at, livemode, name, email, phone, corporate, custom_reference, default_fiscal_entity_id, default_shipping_contact_id, metadata, payment_sources, fiscal_entities, shipping_contacts].hash
|
|
309
318
|
end
|
|
310
319
|
|
|
311
320
|
# Builds the object from hash
|
|
@@ -24,6 +24,7 @@ module DigitalFemsa
|
|
|
24
24
|
|
|
25
25
|
attr_accessor :address
|
|
26
26
|
|
|
27
|
+
# Customer ID that owns this shipping contact.
|
|
27
28
|
attr_accessor :parent_id
|
|
28
29
|
|
|
29
30
|
attr_accessor :default
|
|
@@ -37,6 +38,7 @@ module DigitalFemsa
|
|
|
37
38
|
|
|
38
39
|
attr_accessor :object
|
|
39
40
|
|
|
41
|
+
# Present only when the shipping contact was deleted.
|
|
40
42
|
attr_accessor :deleted
|
|
41
43
|
|
|
42
44
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -15,27 +15,27 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module DigitalFemsa
|
|
17
17
|
class GetChargesResponse
|
|
18
|
-
# Indicates if there are more pages to be requested
|
|
19
|
-
attr_accessor :has_more
|
|
20
|
-
|
|
21
|
-
# Object type, in this case is list
|
|
22
|
-
attr_accessor :object
|
|
23
|
-
|
|
24
18
|
# URL of the next page.
|
|
25
19
|
attr_accessor :next_page_url
|
|
26
20
|
|
|
27
21
|
# Url of the previous page.
|
|
28
22
|
attr_accessor :previous_page_url
|
|
29
23
|
|
|
24
|
+
# Indicates if there are more pages to be requested
|
|
25
|
+
attr_accessor :has_more
|
|
26
|
+
|
|
27
|
+
# Object type, in this case is list
|
|
28
|
+
attr_accessor :object
|
|
29
|
+
|
|
30
30
|
attr_accessor :data
|
|
31
31
|
|
|
32
32
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
33
33
|
def self.attribute_map
|
|
34
34
|
{
|
|
35
|
-
:'has_more' => :'has_more',
|
|
36
|
-
:'object' => :'object',
|
|
37
35
|
:'next_page_url' => :'next_page_url',
|
|
38
36
|
:'previous_page_url' => :'previous_page_url',
|
|
37
|
+
:'has_more' => :'has_more',
|
|
38
|
+
:'object' => :'object',
|
|
39
39
|
:'data' => :'data'
|
|
40
40
|
}
|
|
41
41
|
end
|
|
@@ -48,10 +48,10 @@ module DigitalFemsa
|
|
|
48
48
|
# Attribute type mapping.
|
|
49
49
|
def self.openapi_types
|
|
50
50
|
{
|
|
51
|
-
:'has_more' => :'Boolean',
|
|
52
|
-
:'object' => :'String',
|
|
53
51
|
:'next_page_url' => :'String',
|
|
54
52
|
:'previous_page_url' => :'String',
|
|
53
|
+
:'has_more' => :'Boolean',
|
|
54
|
+
:'object' => :'String',
|
|
55
55
|
:'data' => :'Array<ChargeResponse>'
|
|
56
56
|
}
|
|
57
57
|
end
|
|
@@ -87,6 +87,14 @@ module DigitalFemsa
|
|
|
87
87
|
h[k.to_sym] = v
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
+
if attributes.key?(:'next_page_url')
|
|
91
|
+
self.next_page_url = attributes[:'next_page_url']
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
if attributes.key?(:'previous_page_url')
|
|
95
|
+
self.previous_page_url = attributes[:'previous_page_url']
|
|
96
|
+
end
|
|
97
|
+
|
|
90
98
|
if attributes.key?(:'has_more')
|
|
91
99
|
self.has_more = attributes[:'has_more']
|
|
92
100
|
else
|
|
@@ -99,14 +107,6 @@ module DigitalFemsa
|
|
|
99
107
|
self.object = nil
|
|
100
108
|
end
|
|
101
109
|
|
|
102
|
-
if attributes.key?(:'next_page_url')
|
|
103
|
-
self.next_page_url = attributes[:'next_page_url']
|
|
104
|
-
end
|
|
105
|
-
|
|
106
|
-
if attributes.key?(:'previous_page_url')
|
|
107
|
-
self.previous_page_url = attributes[:'previous_page_url']
|
|
108
|
-
end
|
|
109
|
-
|
|
110
110
|
if attributes.key?(:'data')
|
|
111
111
|
if (value = attributes[:'data']).is_a?(Array)
|
|
112
112
|
self.data = value
|
|
@@ -144,10 +144,10 @@ module DigitalFemsa
|
|
|
144
144
|
def ==(o)
|
|
145
145
|
return true if self.equal?(o)
|
|
146
146
|
self.class == o.class &&
|
|
147
|
-
has_more == o.has_more &&
|
|
148
|
-
object == o.object &&
|
|
149
147
|
next_page_url == o.next_page_url &&
|
|
150
148
|
previous_page_url == o.previous_page_url &&
|
|
149
|
+
has_more == o.has_more &&
|
|
150
|
+
object == o.object &&
|
|
151
151
|
data == o.data
|
|
152
152
|
end
|
|
153
153
|
|
|
@@ -160,7 +160,7 @@ module DigitalFemsa
|
|
|
160
160
|
# Calculates hash code according to all attributes.
|
|
161
161
|
# @return [Integer] Hash code
|
|
162
162
|
def hash
|
|
163
|
-
[
|
|
163
|
+
[next_page_url, previous_page_url, has_more, object, data].hash
|
|
164
164
|
end
|
|
165
165
|
|
|
166
166
|
# Builds the object from hash
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module DigitalFemsa
|
|
17
|
-
# Fiscal entity
|
|
17
|
+
# Fiscal entity information associated with the order. This field can be `null`.
|
|
18
18
|
class OrderFiscalEntityResponse
|
|
19
19
|
attr_accessor :address
|
|
20
20
|
|