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.
Files changed (166) hide show
  1. checksums.yaml +4 -4
  2. data/Makefile +14 -0
  3. data/README.md +28 -33
  4. data/VERSION +1 -1
  5. data/config-ruby.json +1 -1
  6. data/docs/ApiKeyCreateResponse.md +1 -1
  7. data/docs/ApiKeyRequest.md +2 -2
  8. data/docs/ApiKeyResponseOnDelete.md +2 -2
  9. data/docs/ApiKeysApi.md +10 -10
  10. data/docs/BalanceResponse.md +8 -8
  11. data/docs/BalancesApi.md +1 -1
  12. data/docs/ChargeOrderResponse.md +1 -1
  13. data/docs/ChargeOrderResponseChannel.md +24 -0
  14. data/docs/ChargeRequest.md +1 -1
  15. data/docs/ChargeRequestPaymentMethod.md +3 -3
  16. data/docs/ChargeResponse.md +9 -7
  17. data/docs/ChargeResponseChannel.md +3 -3
  18. data/docs/ChargeResponseRefundsData.md +5 -1
  19. data/docs/ChargesApi.md +16 -12
  20. data/docs/ChargesDataResponse.md +9 -7
  21. data/docs/Checkout.md +17 -15
  22. data/docs/CheckoutOrderTemplate.md +3 -3
  23. data/docs/CheckoutResponse.md +1 -1
  24. data/docs/CreateCustomerFiscalEntitiesResponse.md +2 -2
  25. data/docs/Customer.md +13 -19
  26. data/docs/CustomerAddress.md +2 -2
  27. data/docs/CustomerFiscalEntitiesDataResponse.md +2 -2
  28. data/docs/CustomerFiscalEntitiesRequest.md +3 -3
  29. data/docs/CustomerInfo.md +4 -4
  30. data/docs/CustomerPaymentMethodRequest.md +1 -1
  31. data/docs/CustomerResponse.md +17 -21
  32. data/docs/CustomerShippingContactsResponse.md +5 -5
  33. data/docs/CustomersApi.md +15 -15
  34. data/docs/CustomersResponse.md +1 -1
  35. data/docs/DeleteApiKeysResponse.md +1 -1
  36. data/docs/DiscountsApi.md +9 -9
  37. data/docs/EventsApi.md +2 -2
  38. data/docs/EventsResendResponse.md +1 -1
  39. data/docs/GetChargesResponse.md +4 -4
  40. data/docs/GetTransactionsResponse.md +1 -1
  41. data/docs/LogsApi.md +1 -1
  42. data/docs/OrderFiscalEntityRequest.md +4 -4
  43. data/docs/OrderRefundRequest.md +7 -5
  44. data/docs/OrderRequest.md +17 -19
  45. data/docs/OrderResponse.md +37 -35
  46. data/docs/OrderResponseChannel.md +24 -0
  47. data/docs/OrderResponseShippingContact.md +4 -4
  48. data/docs/OrderUpdateFiscalEntityRequest.md +1 -1
  49. data/docs/OrderUpdateRequest.md +19 -15
  50. data/docs/OrdersApi.md +16 -16
  51. data/docs/PaymentLinkApi.md +12 -82
  52. data/docs/PaymentMethodCash.md +4 -4
  53. data/docs/PaymentMethodCashRequest.md +2 -2
  54. data/docs/PaymentMethodsApi.md +5 -5
  55. data/docs/Product.md +10 -12
  56. data/docs/ProductDataResponse.md +9 -11
  57. data/docs/ProductOrderResponse.md +9 -11
  58. data/docs/ProductsApi.md +7 -7
  59. data/docs/ShippingContactsApi.md +9 -9
  60. data/docs/ShippingOrderResponse.md +5 -3
  61. data/docs/ShippingRequest.md +2 -0
  62. data/docs/ShippingsApi.md +7 -7
  63. data/docs/TaxesApi.md +7 -7
  64. data/docs/TransactionResponse.md +20 -14
  65. data/docs/TransactionsApi.md +6 -6
  66. data/docs/TransfersApi.md +10 -10
  67. data/docs/UpdateCustomer.md +17 -21
  68. data/docs/UpdateCustomerFiscalEntitiesResponse.md +2 -2
  69. data/docs/UpdateOrderTaxRequest.md +2 -2
  70. data/docs/UpdateProduct.md +7 -9
  71. data/docs/WebhookKeysApi.md +18 -14
  72. data/docs/WebhooksApi.md +28 -22
  73. data/lib/digital_femsa/api/api_keys_api.rb +8 -8
  74. data/lib/digital_femsa/api/balances_api.rb +2 -2
  75. data/lib/digital_femsa/api/charges_api.rb +13 -9
  76. data/lib/digital_femsa/api/customers_api.rb +12 -12
  77. data/lib/digital_femsa/api/discounts_api.rb +12 -12
  78. data/lib/digital_femsa/api/events_api.rb +4 -4
  79. data/lib/digital_femsa/api/logs_api.rb +2 -2
  80. data/lib/digital_femsa/api/orders_api.rb +20 -20
  81. data/lib/digital_femsa/api/payment_link_api.rb +10 -86
  82. data/lib/digital_femsa/api/payment_methods_api.rb +8 -8
  83. data/lib/digital_femsa/api/products_api.rb +10 -10
  84. data/lib/digital_femsa/api/shipping_contacts_api.rb +8 -8
  85. data/lib/digital_femsa/api/shippings_api.rb +10 -10
  86. data/lib/digital_femsa/api/taxes_api.rb +10 -10
  87. data/lib/digital_femsa/api/transactions_api.rb +6 -6
  88. data/lib/digital_femsa/api/transfers_api.rb +8 -8
  89. data/lib/digital_femsa/api/webhook_keys_api.rb +14 -10
  90. data/lib/digital_femsa/api/webhooks_api.rb +23 -16
  91. data/lib/digital_femsa/api_client.rb +9 -5
  92. data/lib/digital_femsa/models/api_key_create_response.rb +1 -1
  93. data/lib/digital_femsa/models/api_key_request.rb +36 -1
  94. data/lib/digital_femsa/models/balance_response.rb +9 -9
  95. data/lib/digital_femsa/models/charge_order_response.rb +1 -1
  96. data/lib/digital_femsa/models/{order_next_action_response.rb → charge_order_response_channel.rb} +34 -18
  97. data/lib/digital_femsa/models/charge_request_payment_method.rb +3 -2
  98. data/lib/digital_femsa/models/charge_response.rb +15 -4
  99. data/lib/digital_femsa/models/charge_response_refunds_data.rb +23 -4
  100. data/lib/digital_femsa/models/charge_update_request.rb +1 -1
  101. data/lib/digital_femsa/models/charges_data_response.rb +15 -4
  102. data/lib/digital_femsa/models/checkout.rb +97 -81
  103. data/lib/digital_femsa/models/checkout_order_template.rb +4 -4
  104. data/lib/digital_femsa/models/checkout_order_template_customer_info.rb +1 -1
  105. data/lib/digital_femsa/models/checkout_request.rb +1 -1
  106. data/lib/digital_femsa/models/checkout_response.rb +1 -1
  107. data/lib/digital_femsa/models/create_customer_fiscal_entities_response.rb +10 -10
  108. data/lib/digital_femsa/models/customer.rb +57 -95
  109. data/lib/digital_femsa/models/customer_address.rb +7 -0
  110. data/lib/digital_femsa/models/customer_fiscal_entities_data_response.rb +10 -10
  111. data/lib/digital_femsa/models/customer_fiscal_entities_request.rb +13 -13
  112. data/lib/digital_femsa/models/customer_info.rb +13 -20
  113. data/lib/digital_femsa/models/customer_payment_method_request.rb +2 -2
  114. data/lib/digital_femsa/models/customer_payment_sources_inner.rb +104 -0
  115. data/lib/digital_femsa/models/customer_response.rb +122 -113
  116. data/lib/digital_femsa/models/customer_shipping_contacts_response.rb +2 -0
  117. data/lib/digital_femsa/models/customers_response.rb +1 -0
  118. data/lib/digital_femsa/models/events_resend_response.rb +1 -1
  119. data/lib/digital_femsa/models/get_charges_response.rb +21 -21
  120. data/lib/digital_femsa/models/get_transactions_response.rb +1 -1
  121. data/lib/digital_femsa/models/log_response.rb +1 -1
  122. data/lib/digital_femsa/models/logs_response.rb +1 -1
  123. data/lib/digital_femsa/models/order_fiscal_entity_response.rb +1 -1
  124. data/lib/digital_femsa/models/order_refund_request.rb +59 -11
  125. data/lib/digital_femsa/models/order_request.rb +69 -79
  126. data/lib/digital_femsa/models/order_response.rb +187 -119
  127. data/lib/digital_femsa/models/{order_next_action_response_redirect_to_url.rb → order_response_channel.rb} +35 -19
  128. data/lib/digital_femsa/models/order_response_charges.rb +1 -1
  129. data/lib/digital_femsa/models/order_response_checkout.rb +1 -0
  130. data/lib/digital_femsa/models/order_response_customer_info.rb +1 -0
  131. data/lib/digital_femsa/models/order_response_shipping_contact.rb +3 -0
  132. data/lib/digital_femsa/models/order_update_fiscal_entity_request.rb +1 -1
  133. data/lib/digital_femsa/models/order_update_request.rb +106 -65
  134. data/lib/digital_femsa/models/payment_method_cash.rb +1 -1
  135. data/lib/digital_femsa/models/payment_method_cash_request.rb +2 -1
  136. data/lib/digital_femsa/models/product.rb +103 -95
  137. data/lib/digital_femsa/models/product_data_response.rb +103 -95
  138. data/lib/digital_femsa/models/product_order_response.rb +103 -95
  139. data/lib/digital_femsa/models/shipping_order_response.rb +11 -1
  140. data/lib/digital_femsa/models/shipping_request.rb +12 -1
  141. data/lib/digital_femsa/models/transaction_response.rb +172 -99
  142. data/lib/digital_femsa/models/transfers_response.rb +1 -1
  143. data/lib/digital_femsa/models/transfers_response_destination.rb +312 -0
  144. data/lib/digital_femsa/models/update_customer.rb +42 -85
  145. data/lib/digital_femsa/models/update_customer_fiscal_entities_response.rb +10 -10
  146. data/lib/digital_femsa/models/update_order_discount_lines_request.rb +34 -0
  147. data/lib/digital_femsa/models/update_order_tax_request.rb +2 -2
  148. data/lib/digital_femsa/models/update_payment_methods_amount.rb +105 -0
  149. data/lib/digital_femsa/models/update_payment_methods_expires_at.rb +105 -0
  150. data/lib/digital_femsa/models/update_product.rb +85 -58
  151. data/lib/digital_femsa/models/webhook_key_delete_response.rb +1 -1
  152. data/lib/digital_femsa/models/webhook_key_request.rb +1 -0
  153. data/lib/digital_femsa/models/webhook_key_response.rb +1 -1
  154. data/lib/digital_femsa/models/webhook_request.rb +1 -1
  155. data/lib/digital_femsa/models/webhook_response.rb +1 -1
  156. data/lib/digital_femsa/models/webhook_update_request.rb +1 -1
  157. data/lib/digital_femsa/version.rb +1 -1
  158. data/lib/digital_femsa.rb +2 -6
  159. data/templates/ruby/api_client.mustache +8 -4
  160. metadata +26 -26
  161. data/docs/CustomerAntifraudInfo.md +0 -20
  162. data/docs/CustomerAntifraudInfoResponse.md +0 -20
  163. data/docs/OrderNextActionResponse.md +0 -20
  164. data/docs/OrderNextActionResponseRedirectToUrl.md +0 -20
  165. data/docs/SmsCheckoutRequest.md +0 -18
  166. data/docs/UpdateCustomerAntifraudInfo.md +0 -20
@@ -14,12 +14,12 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module DigitalFemsa
17
- # create new taxes for an existing order
17
+ # Create a new tax line for an existing order.
18
18
  class UpdateOrderTaxRequest
19
19
  # The amount to be collected for tax in cents
20
20
  attr_accessor :amount
21
21
 
22
- # description or tax's name
22
+ # Description or tax name
23
23
  attr_accessor :description
24
24
 
25
25
  attr_accessor :metadata
@@ -0,0 +1,105 @@
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 UpdatePaymentMethodsAmount
18
+ class << self
19
+ # List of class defined in oneOf (OpenAPI v3)
20
+ def openapi_one_of
21
+ [
22
+ :'Integer',
23
+ :'String'
24
+ ]
25
+ end
26
+
27
+ # Builds the object
28
+ # @param [Mixed] Data to be matched against the list of oneOf items
29
+ # @return [Object] Returns the model or the data itself
30
+ def build(data)
31
+ # Go through the list of oneOf items and attempt to identify the appropriate one.
32
+ # Note:
33
+ # - We do not attempt to check whether exactly one item matches.
34
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
35
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
36
+ # - TODO: scalar values are de facto behaving as if they were nullable.
37
+ # - TODO: logging when debugging is set.
38
+ openapi_one_of.each do |klass|
39
+ begin
40
+ next if klass == :AnyType # "nullable: true"
41
+ typed_data = find_and_cast_into_type(klass, data)
42
+ return typed_data if typed_data
43
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
44
+ end
45
+ end
46
+
47
+ openapi_one_of.include?(:AnyType) ? data : nil
48
+ end
49
+
50
+ private
51
+
52
+ SchemaMismatchError = Class.new(StandardError)
53
+
54
+ # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
55
+ def find_and_cast_into_type(klass, data)
56
+ return if data.nil?
57
+
58
+ case klass.to_s
59
+ when 'Boolean'
60
+ return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
61
+ when 'Float'
62
+ return data if data.instance_of?(Float)
63
+ when 'Integer'
64
+ return data if data.instance_of?(Integer)
65
+ when 'Time'
66
+ return Time.parse(data)
67
+ when 'Date'
68
+ return Date.parse(data)
69
+ when 'String'
70
+ return data if data.instance_of?(String)
71
+ when 'Object' # "type: object"
72
+ return data if data.instance_of?(Hash)
73
+ when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
74
+ if data.instance_of?(Array)
75
+ sub_type = Regexp.last_match[:sub_type]
76
+ return data.map { |item| find_and_cast_into_type(sub_type, item) }
77
+ end
78
+ when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
79
+ if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
80
+ sub_type = Regexp.last_match[:sub_type]
81
+ return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
82
+ end
83
+ else # model
84
+ const = DigitalFemsa.const_get(klass)
85
+ if const
86
+ if const.respond_to?(:openapi_one_of) # nested oneOf model
87
+ model = const.build(data)
88
+ return model if model
89
+ else
90
+ # raise if data contains keys that are not known to the model
91
+ raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
92
+ model = const.build_from_hash(data)
93
+ return model if model
94
+ end
95
+ end
96
+ end
97
+
98
+ raise # if no match by now, raise
99
+ rescue
100
+ raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
101
+ end
102
+ end
103
+ end
104
+
105
+ end
@@ -0,0 +1,105 @@
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 UpdatePaymentMethodsExpiresAt
18
+ class << self
19
+ # List of class defined in oneOf (OpenAPI v3)
20
+ def openapi_one_of
21
+ [
22
+ :'Integer',
23
+ :'String'
24
+ ]
25
+ end
26
+
27
+ # Builds the object
28
+ # @param [Mixed] Data to be matched against the list of oneOf items
29
+ # @return [Object] Returns the model or the data itself
30
+ def build(data)
31
+ # Go through the list of oneOf items and attempt to identify the appropriate one.
32
+ # Note:
33
+ # - We do not attempt to check whether exactly one item matches.
34
+ # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
35
+ # due to the way the deserialization is made in the base_object template (it just casts without verifying).
36
+ # - TODO: scalar values are de facto behaving as if they were nullable.
37
+ # - TODO: logging when debugging is set.
38
+ openapi_one_of.each do |klass|
39
+ begin
40
+ next if klass == :AnyType # "nullable: true"
41
+ typed_data = find_and_cast_into_type(klass, data)
42
+ return typed_data if typed_data
43
+ rescue # rescue all errors so we keep iterating even if the current item lookup raises
44
+ end
45
+ end
46
+
47
+ openapi_one_of.include?(:AnyType) ? data : nil
48
+ end
49
+
50
+ private
51
+
52
+ SchemaMismatchError = Class.new(StandardError)
53
+
54
+ # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse.
55
+ def find_and_cast_into_type(klass, data)
56
+ return if data.nil?
57
+
58
+ case klass.to_s
59
+ when 'Boolean'
60
+ return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass)
61
+ when 'Float'
62
+ return data if data.instance_of?(Float)
63
+ when 'Integer'
64
+ return data if data.instance_of?(Integer)
65
+ when 'Time'
66
+ return Time.parse(data)
67
+ when 'Date'
68
+ return Date.parse(data)
69
+ when 'String'
70
+ return data if data.instance_of?(String)
71
+ when 'Object' # "type: object"
72
+ return data if data.instance_of?(Hash)
73
+ when /\AArray<(?<sub_type>.+)>\z/ # "type: array"
74
+ if data.instance_of?(Array)
75
+ sub_type = Regexp.last_match[:sub_type]
76
+ return data.map { |item| find_and_cast_into_type(sub_type, item) }
77
+ end
78
+ when /\AHash<String, (?<sub_type>.+)>\z/ # "type: object" with "additionalProperties: { ... }"
79
+ if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) }
80
+ sub_type = Regexp.last_match[:sub_type]
81
+ return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) }
82
+ end
83
+ else # model
84
+ const = DigitalFemsa.const_get(klass)
85
+ if const
86
+ if const.respond_to?(:openapi_one_of) # nested oneOf model
87
+ model = const.build(data)
88
+ return model if model
89
+ else
90
+ # raise if data contains keys that are not known to the model
91
+ raise if const.respond_to?(:acceptable_attributes) && !(data.keys - const.acceptable_attributes).empty?
92
+ model = const.build_from_hash(data)
93
+ return model if model
94
+ end
95
+ end
96
+ end
97
+
98
+ raise # if no match by now, raise
99
+ rescue
100
+ raise SchemaMismatchError, "#{data} doesn't match the #{klass} type"
101
+ end
102
+ end
103
+ end
104
+
105
+ end
@@ -15,35 +15,32 @@ require 'time'
15
15
 
16
16
  module DigitalFemsa
17
17
  class UpdateProduct
18
- attr_accessor :antifraud_info
19
-
20
- attr_accessor :description
21
-
22
- attr_accessor :sku
23
-
24
18
  attr_accessor :name
25
19
 
26
20
  attr_accessor :unit_price
27
21
 
28
22
  attr_accessor :quantity
29
23
 
30
- attr_accessor :tags
24
+ attr_accessor :sku
31
25
 
32
26
  attr_accessor :brand
33
27
 
28
+ attr_accessor :description
29
+
30
+ attr_accessor :tags
31
+
34
32
  attr_accessor :metadata
35
33
 
36
34
  # Attribute mapping from ruby-style variable name to JSON key.
37
35
  def self.attribute_map
38
36
  {
39
- :'antifraud_info' => :'antifraud_info',
40
- :'description' => :'description',
41
- :'sku' => :'sku',
42
37
  :'name' => :'name',
43
38
  :'unit_price' => :'unit_price',
44
39
  :'quantity' => :'quantity',
45
- :'tags' => :'tags',
40
+ :'sku' => :'sku',
46
41
  :'brand' => :'brand',
42
+ :'description' => :'description',
43
+ :'tags' => :'tags',
47
44
  :'metadata' => :'metadata'
48
45
  }
49
46
  end
@@ -56,15 +53,14 @@ module DigitalFemsa
56
53
  # Attribute type mapping.
57
54
  def self.openapi_types
58
55
  {
59
- :'antifraud_info' => :'Hash<String, Object>',
60
- :'description' => :'String',
61
- :'sku' => :'String',
62
56
  :'name' => :'String',
63
57
  :'unit_price' => :'Integer',
64
58
  :'quantity' => :'Integer',
65
- :'tags' => :'Array<String>',
59
+ :'sku' => :'String',
66
60
  :'brand' => :'String',
67
- :'metadata' => :'Hash<String, String>'
61
+ :'description' => :'String',
62
+ :'tags' => :'Array<String>',
63
+ :'metadata' => :'Hash<String, Object>'
68
64
  }
69
65
  end
70
66
 
@@ -89,20 +85,6 @@ module DigitalFemsa
89
85
  h[k.to_sym] = v
90
86
  }
91
87
 
92
- if attributes.key?(:'antifraud_info')
93
- if (value = attributes[:'antifraud_info']).is_a?(Hash)
94
- self.antifraud_info = value
95
- end
96
- end
97
-
98
- if attributes.key?(:'description')
99
- self.description = attributes[:'description']
100
- end
101
-
102
- if attributes.key?(:'sku')
103
- self.sku = attributes[:'sku']
104
- end
105
-
106
88
  if attributes.key?(:'name')
107
89
  self.name = attributes[:'name']
108
90
  end
@@ -115,16 +97,24 @@ module DigitalFemsa
115
97
  self.quantity = attributes[:'quantity']
116
98
  end
117
99
 
118
- if attributes.key?(:'tags')
119
- if (value = attributes[:'tags']).is_a?(Array)
120
- self.tags = value
121
- end
100
+ if attributes.key?(:'sku')
101
+ self.sku = attributes[:'sku']
122
102
  end
123
103
 
124
104
  if attributes.key?(:'brand')
125
105
  self.brand = attributes[:'brand']
126
106
  end
127
107
 
108
+ if attributes.key?(:'description')
109
+ self.description = attributes[:'description']
110
+ end
111
+
112
+ if attributes.key?(:'tags')
113
+ if (value = attributes[:'tags']).is_a?(Array)
114
+ self.tags = value
115
+ end
116
+ end
117
+
128
118
  if attributes.key?(:'metadata')
129
119
  if (value = attributes[:'metadata']).is_a?(Hash)
130
120
  self.metadata = value
@@ -137,10 +127,6 @@ module DigitalFemsa
137
127
  def list_invalid_properties
138
128
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
139
129
  invalid_properties = Array.new
140
- if !@description.nil? && @description.to_s.length > 250
141
- invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 250.')
142
- end
143
-
144
130
  if !@unit_price.nil? && @unit_price < 0
145
131
  invalid_properties.push('invalid value for "unit_price", must be greater than or equal to 0.')
146
132
  end
@@ -149,6 +135,18 @@ module DigitalFemsa
149
135
  invalid_properties.push('invalid value for "quantity", must be greater than or equal to 1.')
150
136
  end
151
137
 
138
+ if !@description.nil? && @description.to_s.length > 250
139
+ invalid_properties.push('invalid value for "description", the character length must be smaller than or equal to 250.')
140
+ end
141
+
142
+ if !@tags.nil? && @tags.length < 1
143
+ invalid_properties.push('invalid value for "tags", number of items must be greater than or equal to 1.')
144
+ end
145
+
146
+ if !@metadata.nil? && @metadata.length > 100
147
+ invalid_properties.push('invalid value for "metadata", number of items must be less than or equal to 100.')
148
+ end
149
+
152
150
  invalid_properties
153
151
  end
154
152
 
@@ -156,26 +154,14 @@ module DigitalFemsa
156
154
  # @return true if the model is valid
157
155
  def valid?
158
156
  warn '[DEPRECATED] the `valid?` method is obsolete'
159
- return false if !@description.nil? && @description.to_s.length > 250
160
157
  return false if !@unit_price.nil? && @unit_price < 0
161
158
  return false if !@quantity.nil? && @quantity < 1
159
+ return false if !@description.nil? && @description.to_s.length > 250
160
+ return false if !@tags.nil? && @tags.length < 1
161
+ return false if !@metadata.nil? && @metadata.length > 100
162
162
  true
163
163
  end
164
164
 
165
- # Custom attribute writer method with validation
166
- # @param [Object] description Value to be assigned
167
- def description=(description)
168
- if description.nil?
169
- fail ArgumentError, 'description cannot be nil'
170
- end
171
-
172
- if description.to_s.length > 250
173
- fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 250.'
174
- end
175
-
176
- @description = description
177
- end
178
-
179
165
  # Custom attribute writer method with validation
180
166
  # @param [Object] unit_price Value to be assigned
181
167
  def unit_price=(unit_price)
@@ -204,19 +190,60 @@ module DigitalFemsa
204
190
  @quantity = quantity
205
191
  end
206
192
 
193
+ # Custom attribute writer method with validation
194
+ # @param [Object] description Value to be assigned
195
+ def description=(description)
196
+ if description.nil?
197
+ fail ArgumentError, 'description cannot be nil'
198
+ end
199
+
200
+ if description.to_s.length > 250
201
+ fail ArgumentError, 'invalid value for "description", the character length must be smaller than or equal to 250.'
202
+ end
203
+
204
+ @description = description
205
+ end
206
+
207
+ # Custom attribute writer method with validation
208
+ # @param [Object] tags Value to be assigned
209
+ def tags=(tags)
210
+ if tags.nil?
211
+ fail ArgumentError, 'tags cannot be nil'
212
+ end
213
+
214
+ if tags.length < 1
215
+ fail ArgumentError, 'invalid value for "tags", number of items must be greater than or equal to 1.'
216
+ end
217
+
218
+ @tags = tags
219
+ end
220
+
221
+ # Custom attribute writer method with validation
222
+ # @param [Object] metadata Value to be assigned
223
+ def metadata=(metadata)
224
+ if metadata.nil?
225
+ fail ArgumentError, 'metadata cannot be nil'
226
+ end
227
+
228
+ if metadata.length > 100
229
+ fail ArgumentError, 'invalid value for "metadata", number of items must be less than or equal to 100.'
230
+ end
231
+
232
+ @metadata = metadata
233
+ end
234
+
207
235
  # Checks equality by comparing each attribute.
208
236
  # @param [Object] Object to be compared
209
237
  def ==(o)
210
238
  return true if self.equal?(o)
211
239
  self.class == o.class &&
212
- antifraud_info == o.antifraud_info &&
213
- description == o.description &&
214
- sku == o.sku &&
215
240
  name == o.name &&
216
241
  unit_price == o.unit_price &&
217
242
  quantity == o.quantity &&
218
- tags == o.tags &&
243
+ sku == o.sku &&
219
244
  brand == o.brand &&
245
+ description == o.description &&
246
+ tags == o.tags &&
220
247
  metadata == o.metadata
221
248
  end
222
249
 
@@ -229,7 +256,7 @@ module DigitalFemsa
229
256
  # Calculates hash code according to all attributes.
230
257
  # @return [Integer] Hash code
231
258
  def hash
232
- [antifraud_info, description, sku, name, unit_price, quantity, tags, brand, metadata].hash
259
+ [name, unit_price, quantity, sku, brand, description, tags, metadata].hash
233
260
  end
234
261
 
235
262
  # Builds the object from hash
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module DigitalFemsa
17
- # webhook keys model
17
+ # Represents a webhook signing key after it has been deleted.
18
18
  class WebhookKeyDeleteResponse
19
19
  # Indicates if the webhook key is active
20
20
  attr_accessor :active
@@ -40,6 +40,7 @@ module DigitalFemsa
40
40
  # List of attributes with nullable: true
41
41
  def self.openapi_nullable
42
42
  Set.new([
43
+ :'active'
43
44
  ])
44
45
  end
45
46
 
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module DigitalFemsa
17
- # webhook keys model
17
+ # Represents a webhook signing key configuration for the company.
18
18
  class WebhookKeyResponse
19
19
  # Unique identifier of the webhook key
20
20
  attr_accessor :id
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module DigitalFemsa
17
- # a webhook
17
+ # Parameters used to create or update a webhook.
18
18
  class WebhookRequest
19
19
  # Here you must place the URL of your Webhook remember that you must program what you will do with the events received. Also do not forget to handle the HTTPS protocol for greater security.
20
20
  attr_accessor :url
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module DigitalFemsa
17
- # webhooks model
17
+ # Represents a webhook endpoint configured to receive event notifications.
18
18
  class WebhookResponse
19
19
  attr_accessor :deleted
20
20
 
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module DigitalFemsa
17
- # an updated webhook
17
+ # Parameters used to update a webhook. All fields are optional; send only the fields you want to change.
18
18
  class WebhookUpdateRequest
19
19
  # Here you must place the URL of your Webhook remember that you must program what you will do with the events received. Also do not forget to handle the HTTPS protocol for greater security.
20
20
  attr_accessor :url
@@ -11,5 +11,5 @@ Generator version: 7.5.0
11
11
  =end
12
12
 
13
13
  module DigitalFemsa
14
- VERSION = '1.0.0'
14
+ VERSION = '1.1.0'
15
15
  end
data/lib/digital_femsa.rb CHANGED
@@ -25,6 +25,7 @@ require 'digital_femsa/models/api_key_update_request'
25
25
  require 'digital_femsa/models/balance_common_field'
26
26
  require 'digital_femsa/models/balance_response'
27
27
  require 'digital_femsa/models/charge_order_response'
28
+ require 'digital_femsa/models/charge_order_response_channel'
28
29
  require 'digital_femsa/models/charge_order_response_payment_method'
29
30
  require 'digital_femsa/models/charge_request'
30
31
  require 'digital_femsa/models/charge_request_payment_method'
@@ -50,8 +51,6 @@ require 'digital_femsa/models/create_customer_payment_methods_request'
50
51
  require 'digital_femsa/models/create_customer_payment_methods_response'
51
52
  require 'digital_femsa/models/customer'
52
53
  require 'digital_femsa/models/customer_address'
53
- require 'digital_femsa/models/customer_antifraud_info'
54
- require 'digital_femsa/models/customer_antifraud_info_response'
55
54
  require 'digital_femsa/models/customer_fiscal_entities_data_response'
56
55
  require 'digital_femsa/models/customer_fiscal_entities_request'
57
56
  require 'digital_femsa/models/customer_fiscal_entities_response'
@@ -103,12 +102,11 @@ require 'digital_femsa/models/order_discount_lines_request'
103
102
  require 'digital_femsa/models/order_fiscal_entity_address_response'
104
103
  require 'digital_femsa/models/order_fiscal_entity_request'
105
104
  require 'digital_femsa/models/order_fiscal_entity_response'
106
- require 'digital_femsa/models/order_next_action_response'
107
- require 'digital_femsa/models/order_next_action_response_redirect_to_url'
108
105
  require 'digital_femsa/models/order_refund_request'
109
106
  require 'digital_femsa/models/order_request'
110
107
  require 'digital_femsa/models/order_request_customer_info'
111
108
  require 'digital_femsa/models/order_response'
109
+ require 'digital_femsa/models/order_response_channel'
112
110
  require 'digital_femsa/models/order_response_charges'
113
111
  require 'digital_femsa/models/order_response_checkout'
114
112
  require 'digital_femsa/models/order_response_customer_info'
@@ -132,14 +130,12 @@ require 'digital_femsa/models/product_data_response'
132
130
  require 'digital_femsa/models/product_order_response'
133
131
  require 'digital_femsa/models/shipping_order_response'
134
132
  require 'digital_femsa/models/shipping_request'
135
- require 'digital_femsa/models/sms_checkout_request'
136
133
  require 'digital_femsa/models/transaction_response'
137
134
  require 'digital_femsa/models/transfer_destination_response'
138
135
  require 'digital_femsa/models/transfer_method_response'
139
136
  require 'digital_femsa/models/transfer_response'
140
137
  require 'digital_femsa/models/transfers_response'
141
138
  require 'digital_femsa/models/update_customer'
142
- require 'digital_femsa/models/update_customer_antifraud_info'
143
139
  require 'digital_femsa/models/update_customer_fiscal_entities_response'
144
140
  require 'digital_femsa/models/update_customer_payment_methods_response'
145
141
  require 'digital_femsa/models/update_order_discount_lines_request'
@@ -39,7 +39,7 @@ module {{moduleName}}
39
39
  @default_headers = {
40
40
  'Content-Type' => 'application/json',
41
41
  'User-Agent' => @user_agent,
42
- 'X-DigitalFemsa-Client-User-Agent' => digitalfemsa_headers.to_json
42
+ 'Spin-Client-User-Agent' => digitalfemsa_headers_to_string
43
43
  }
44
44
  end
45
45
 
@@ -245,13 +245,17 @@ module {{moduleName}}
245
245
  end
246
246
  def digitalfemsa_headers
247
247
  params = {
248
- bindings_version: DigitalFemsa::VERSION,
248
+ sdk_version: DigitalFemsa::VERSION,
249
249
  lang: 'ruby',
250
- lang_version: RUBY_VERSION,
251
- publisher: 'digitalfemsa'
250
+ lang_version: RUBY_VERSION
252
251
  }
253
252
 
254
253
  @digitalfemsa_headers ||= params
255
254
  end
255
+
256
+ def digitalfemsa_headers_to_string
257
+ headers = digitalfemsa_headers
258
+ headers.map { |k, v| "#{k}=#{v}" }.join(';')
259
+ end
256
260
  end
257
261
  end