subfi_pay 0.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 (261) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +11 -0
  3. data/Gemfile.lock +101 -0
  4. data/README.md +188 -0
  5. data/Rakefile +10 -0
  6. data/bin/console +11 -0
  7. data/docs/AccessKey.md +32 -0
  8. data/docs/AccessKeysApi.md +228 -0
  9. data/docs/AccountAttributes.md +20 -0
  10. data/docs/AccountAttributesAccount.md +20 -0
  11. data/docs/AccountCreateRequest.md +18 -0
  12. data/docs/AccountResponse.md +26 -0
  13. data/docs/AccountsApi.md +227 -0
  14. data/docs/BalanceTransactionAttributes.md +30 -0
  15. data/docs/BalanceTransactionResponse.md +38 -0
  16. data/docs/BalanceTransactionsApi.md +87 -0
  17. data/docs/BankAccountProfile.md +28 -0
  18. data/docs/BillingAddress.md +36 -0
  19. data/docs/CardProfile.md +42 -0
  20. data/docs/ChargeAttributes.md +26 -0
  21. data/docs/ChargeResponse.md +42 -0
  22. data/docs/ChargesApi.md +167 -0
  23. data/docs/ConnectedAccountAttributes.md +20 -0
  24. data/docs/ConnectedAccountResponse.md +26 -0
  25. data/docs/CreateAccountRequest.md +18 -0
  26. data/docs/CreateAccountRequestAccount.md +20 -0
  27. data/docs/CreateCustomerRequest.md +24 -0
  28. data/docs/CreateWebhookEndpointRequest.md +18 -0
  29. data/docs/CreateWebhookEndpointRequestWebhookEndpoint.md +28 -0
  30. data/docs/Customer.md +26 -0
  31. data/docs/CustomerAttributes.md +24 -0
  32. data/docs/CustomerAttributesCustomer.md +24 -0
  33. data/docs/CustomerCreateRequest.md +18 -0
  34. data/docs/CustomerUpdateAttributes.md +20 -0
  35. data/docs/CustomerUpdateAttributesCustomer.md +20 -0
  36. data/docs/CustomerUpdateRequest.md +18 -0
  37. data/docs/CustomersApi.md +307 -0
  38. data/docs/Event.md +30 -0
  39. data/docs/EventsApi.md +159 -0
  40. data/docs/ListAccessKeysResponse.md +20 -0
  41. data/docs/ListAccountsResponse.md +20 -0
  42. data/docs/ListBalanceTransactionsResponse.md +20 -0
  43. data/docs/ListChargesResponse.md +20 -0
  44. data/docs/ListCustomersResponse.md +20 -0
  45. data/docs/ListEventsResponse.md +20 -0
  46. data/docs/ListPaymentIntentsResponse.md +20 -0
  47. data/docs/ListPaymentMethodsResponse.md +20 -0
  48. data/docs/ListRefundsResponse.md +20 -0
  49. data/docs/ListWebhookEndpointsResponse.md +20 -0
  50. data/docs/ListWebhookRequestsResponse.md +20 -0
  51. data/docs/Meta.md +28 -0
  52. data/docs/PaymentIntentAttributes.md +26 -0
  53. data/docs/PaymentIntentAttributesPaymentIntent.md +26 -0
  54. data/docs/PaymentIntentCreateRequest.md +18 -0
  55. data/docs/PaymentIntentResponse.md +30 -0
  56. data/docs/PaymentIntentUpdateAttributes.md +18 -0
  57. data/docs/PaymentIntentUpdateAttributesPaymentIntent.md +18 -0
  58. data/docs/PaymentIntentsApi.md +533 -0
  59. data/docs/PaymentMethodAttributes.md +24 -0
  60. data/docs/PaymentMethodResponse.md +36 -0
  61. data/docs/PaymentMethodsApi.md +239 -0
  62. data/docs/RefundAttributes.md +20 -0
  63. data/docs/RefundResponse.md +30 -0
  64. data/docs/RefundsApi.md +311 -0
  65. data/docs/RollAccessKeyAttributes.md +18 -0
  66. data/docs/RollAccessKeyAttributesAccessKey.md +18 -0
  67. data/docs/RollAccessKeyRequest.md +18 -0
  68. data/docs/RollAccessKeyRequestAccessKey.md +18 -0
  69. data/docs/SubscriptionAttributes.md +30 -0
  70. data/docs/SubscriptionAttributesSubscription.md +30 -0
  71. data/docs/SubscriptionCreateRequest.md +18 -0
  72. data/docs/SubscriptionCreateRequestSubscription.md +30 -0
  73. data/docs/SubscriptionResponse.md +36 -0
  74. data/docs/SubscriptionsApi.md +155 -0
  75. data/docs/WebhookEndpoint.md +34 -0
  76. data/docs/WebhookEndpointsApi.md +380 -0
  77. data/docs/WebhookRequest.md +38 -0
  78. data/docs/WebhookRequestsApi.md +85 -0
  79. data/git_push.sh +57 -0
  80. data/lib/subfi_pay/api/access_keys_api.rb +235 -0
  81. data/lib/subfi_pay/api/accounts_api.rb +231 -0
  82. data/lib/subfi_pay/api/balance_transactions_api.rb +100 -0
  83. data/lib/subfi_pay/api/charges_api.rb +181 -0
  84. data/lib/subfi_pay/api/customers_api.rb +331 -0
  85. data/lib/subfi_pay/api/events_api.rb +172 -0
  86. data/lib/subfi_pay/api/payment_intents_api.rb +566 -0
  87. data/lib/subfi_pay/api/payment_methods_api.rb +262 -0
  88. data/lib/subfi_pay/api/refunds_api.rb +334 -0
  89. data/lib/subfi_pay/api/subscriptions_api.rb +177 -0
  90. data/lib/subfi_pay/api/webhook_endpoints_api.rb +404 -0
  91. data/lib/subfi_pay/api/webhook_requests_api.rb +97 -0
  92. data/lib/subfi_pay/api_client.rb +394 -0
  93. data/lib/subfi_pay/api_error.rb +58 -0
  94. data/lib/subfi_pay/configuration.rb +305 -0
  95. data/lib/subfi_pay/models/access_key.rb +275 -0
  96. data/lib/subfi_pay/models/account_attributes.rb +221 -0
  97. data/lib/subfi_pay/models/account_attributes_account.rb +221 -0
  98. data/lib/subfi_pay/models/account_create_request.rb +212 -0
  99. data/lib/subfi_pay/models/account_response.rb +248 -0
  100. data/lib/subfi_pay/models/balance_transaction_attributes.rb +266 -0
  101. data/lib/subfi_pay/models/balance_transaction_response.rb +303 -0
  102. data/lib/subfi_pay/models/bank_account_profile.rb +257 -0
  103. data/lib/subfi_pay/models/billing_address.rb +294 -0
  104. data/lib/subfi_pay/models/card_profile.rb +324 -0
  105. data/lib/subfi_pay/models/charge_attributes.rb +265 -0
  106. data/lib/subfi_pay/models/charge_response.rb +326 -0
  107. data/lib/subfi_pay/models/connected_account_attributes.rb +235 -0
  108. data/lib/subfi_pay/models/connected_account_response.rb +248 -0
  109. data/lib/subfi_pay/models/create_account_request.rb +219 -0
  110. data/lib/subfi_pay/models/create_account_request_account.rb +221 -0
  111. data/lib/subfi_pay/models/create_customer_request.rb +239 -0
  112. data/lib/subfi_pay/models/create_webhook_endpoint_request.rb +212 -0
  113. data/lib/subfi_pay/models/create_webhook_endpoint_request_webhook_endpoint.rb +257 -0
  114. data/lib/subfi_pay/models/customer.rb +248 -0
  115. data/lib/subfi_pay/models/customer_attributes.rb +239 -0
  116. data/lib/subfi_pay/models/customer_attributes_customer.rb +239 -0
  117. data/lib/subfi_pay/models/customer_create_request.rb +212 -0
  118. data/lib/subfi_pay/models/customer_update_attributes.rb +221 -0
  119. data/lib/subfi_pay/models/customer_update_attributes_customer.rb +221 -0
  120. data/lib/subfi_pay/models/customer_update_request.rb +212 -0
  121. data/lib/subfi_pay/models/event.rb +266 -0
  122. data/lib/subfi_pay/models/list_access_keys_response.rb +223 -0
  123. data/lib/subfi_pay/models/list_accounts_response.rb +223 -0
  124. data/lib/subfi_pay/models/list_balance_transactions_response.rb +223 -0
  125. data/lib/subfi_pay/models/list_charges_response.rb +223 -0
  126. data/lib/subfi_pay/models/list_customers_response.rb +223 -0
  127. data/lib/subfi_pay/models/list_events_response.rb +223 -0
  128. data/lib/subfi_pay/models/list_payment_intents_response.rb +223 -0
  129. data/lib/subfi_pay/models/list_payment_methods_response.rb +223 -0
  130. data/lib/subfi_pay/models/list_refunds_response.rb +223 -0
  131. data/lib/subfi_pay/models/list_webhook_endpoints_response.rb +223 -0
  132. data/lib/subfi_pay/models/list_webhook_requests_response.rb +223 -0
  133. data/lib/subfi_pay/models/meta.rb +259 -0
  134. data/lib/subfi_pay/models/payment_intent_attributes.rb +257 -0
  135. data/lib/subfi_pay/models/payment_intent_attributes_payment_intent.rb +257 -0
  136. data/lib/subfi_pay/models/payment_intent_create_request.rb +212 -0
  137. data/lib/subfi_pay/models/payment_intent_response.rb +268 -0
  138. data/lib/subfi_pay/models/payment_intent_update_attributes.rb +212 -0
  139. data/lib/subfi_pay/models/payment_intent_update_attributes_payment_intent.rb +214 -0
  140. data/lib/subfi_pay/models/payment_method_attributes.rb +246 -0
  141. data/lib/subfi_pay/models/payment_method_response.rb +296 -0
  142. data/lib/subfi_pay/models/refund_attributes.rb +228 -0
  143. data/lib/subfi_pay/models/refund_response.rb +268 -0
  144. data/lib/subfi_pay/models/roll_access_key_attributes.rb +212 -0
  145. data/lib/subfi_pay/models/roll_access_key_attributes_access_key.rb +219 -0
  146. data/lib/subfi_pay/models/roll_access_key_request.rb +212 -0
  147. data/lib/subfi_pay/models/roll_access_key_request_access_key.rb +219 -0
  148. data/lib/subfi_pay/models/subscription_attributes.rb +266 -0
  149. data/lib/subfi_pay/models/subscription_attributes_subscription.rb +266 -0
  150. data/lib/subfi_pay/models/subscription_create_request.rb +212 -0
  151. data/lib/subfi_pay/models/subscription_create_request_subscription.rb +266 -0
  152. data/lib/subfi_pay/models/subscription_response.rb +293 -0
  153. data/lib/subfi_pay/models/webhook_endpoint.rb +284 -0
  154. data/lib/subfi_pay/models/webhook_request.rb +302 -0
  155. data/lib/subfi_pay/version.rb +15 -0
  156. data/lib/subfi_pay.rb +99 -0
  157. data/run_fix_gemfile.sh +11 -0
  158. data/spec/api/access_keys_api_spec.rb +138 -0
  159. data/spec/api/accounts_api_spec.rb +145 -0
  160. data/spec/api/balance_transactions_api_spec.rb +86 -0
  161. data/spec/api/charges_api_spec.rb +121 -0
  162. data/spec/api/customers_api_spec.rb +134 -0
  163. data/spec/api/events_api_spec.rb +105 -0
  164. data/spec/api/payment_intents_api_spec.rb +250 -0
  165. data/spec/api/payment_methods_api_spec.rb +226 -0
  166. data/spec/api/refunds_api_spec.rb +158 -0
  167. data/spec/api/subscriptions_api_spec.rb +113 -0
  168. data/spec/api/webhook_endpoints_api_spec.rb +198 -0
  169. data/spec/api/webhook_requests_api_spec.rb +79 -0
  170. data/spec/configuration_spec.rb +23 -0
  171. data/spec/fixtures/access_keys/list_200.json +1 -0
  172. data/spec/fixtures/access_keys/roll_200.json +1 -0
  173. data/spec/fixtures/accounts/create_201.json +1 -0
  174. data/spec/fixtures/accounts/list_200.json +1 -0
  175. data/spec/fixtures/accounts/show_200.json +1 -0
  176. data/spec/fixtures/balance_transactions/list_200.json +69 -0
  177. data/spec/fixtures/charges/create_201.json +39 -0
  178. data/spec/fixtures/charges/list_200.json +1 -0
  179. data/spec/fixtures/charges/retrieve_200.json +1 -0
  180. data/spec/fixtures/customers/create_201.json +1 -0
  181. data/spec/fixtures/customers/list_200.json +1 -0
  182. data/spec/fixtures/customers/show_200.json +1 -0
  183. data/spec/fixtures/events/list_200.json +1 -0
  184. data/spec/fixtures/events/show_200.json +1 -0
  185. data/spec/fixtures/payment_intents/cancel_200.json +1 -0
  186. data/spec/fixtures/payment_intents/capture_200.json +1 -0
  187. data/spec/fixtures/payment_intents/confirm_200.json +1 -0
  188. data/spec/fixtures/payment_intents/create_201.json +1 -0
  189. data/spec/fixtures/payment_intents/fetch_200.json +1 -0
  190. data/spec/fixtures/payment_intents/list_200.json +1 -0
  191. data/spec/fixtures/payment_intents/update_200.json +1 -0
  192. data/spec/fixtures/payment_methods/create_bank_account_201.json +1 -0
  193. data/spec/fixtures/payment_methods/create_card_201.json +1 -0
  194. data/spec/fixtures/payment_methods/get_bank_account_200.json +29 -0
  195. data/spec/fixtures/payment_methods/get_card_200.json +1 -0
  196. data/spec/fixtures/payment_methods/list_200.json +1 -0
  197. data/spec/fixtures/refunds/create_201.json +1 -0
  198. data/spec/fixtures/refunds/list_200.json +1 -0
  199. data/spec/fixtures/refunds/show_200.json +1 -0
  200. data/spec/fixtures/subscriptions/create_201.json +1 -0
  201. data/spec/fixtures/subscriptions/show_200.json +1 -0
  202. data/spec/fixtures/webhook_endpoints/create_201.json +11 -0
  203. data/spec/fixtures/webhook_endpoints/list_200.json +1 -0
  204. data/spec/fixtures/webhook_endpoints/show_200.json +1 -0
  205. data/spec/fixtures/webhook_endpoints/update_200.json +13 -0
  206. data/spec/fixtures/webhook_requests/list_200.json +1 -0
  207. data/spec/models/access_key_spec.rb +39 -0
  208. data/spec/models/account_attributes_spec.rb +40 -0
  209. data/spec/models/account_create_request_spec.rb +38 -0
  210. data/spec/models/account_response_spec.rb +39 -0
  211. data/spec/models/balance_transaction_response_spec.rb +38 -0
  212. data/spec/models/bank_account_profile_spec.rb +38 -0
  213. data/spec/models/billing_address_spec.rb +38 -0
  214. data/spec/models/card_profile_spec.rb +38 -0
  215. data/spec/models/charge_attributes_spec.rb +45 -0
  216. data/spec/models/charge_response_spec.rb +45 -0
  217. data/spec/models/connected_account_attributes_spec.rb +38 -0
  218. data/spec/models/connected_account_response_spec.rb +39 -0
  219. data/spec/models/create_account_request_account_spec.rb +39 -0
  220. data/spec/models/create_account_request_spec.rb +39 -0
  221. data/spec/models/create_webhook_endpoint_request_spec.rb +38 -0
  222. data/spec/models/create_webhook_endpoint_request_webhook_endpoint_spec.rb +38 -0
  223. data/spec/models/customer_attributes_spec.rb +40 -0
  224. data/spec/models/customer_create_request_spec.rb +38 -0
  225. data/spec/models/customer_spec.rb +39 -0
  226. data/spec/models/customer_update_attributes_spec.rb +39 -0
  227. data/spec/models/customer_update_request_spec.rb +39 -0
  228. data/spec/models/event_spec.rb +39 -0
  229. data/spec/models/list_access_keys_response_spec.rb +38 -0
  230. data/spec/models/list_accounts_response_spec.rb +38 -0
  231. data/spec/models/list_balance_transactions_response_spec.rb +38 -0
  232. data/spec/models/list_charges_response_spec.rb +38 -0
  233. data/spec/models/list_customers_response_spec.rb +39 -0
  234. data/spec/models/list_events_response_spec.rb +38 -0
  235. data/spec/models/list_payment_intents_response_spec.rb +45 -0
  236. data/spec/models/list_payment_methods_response_spec.rb +39 -0
  237. data/spec/models/list_refunds_response_spec.rb +38 -0
  238. data/spec/models/list_webhook_endpoints_response_spec.rb +38 -0
  239. data/spec/models/list_webhook_requests_response_spec.rb +39 -0
  240. data/spec/models/meta_spec.rb +38 -0
  241. data/spec/models/payment_intent_attributes_spec.rb +44 -0
  242. data/spec/models/payment_intent_create_request_spec.rb +38 -0
  243. data/spec/models/payment_intent_response_spec.rb +45 -0
  244. data/spec/models/payment_intent_update_attributes_payment_intent_spec.rb +38 -0
  245. data/spec/models/payment_intent_update_attributes_spec.rb +37 -0
  246. data/spec/models/payment_method_attributes_spec.rb +38 -0
  247. data/spec/models/payment_method_response_spec.rb +38 -0
  248. data/spec/models/refund_attributes_spec.rb +39 -0
  249. data/spec/models/refund_response_spec.rb +38 -0
  250. data/spec/models/roll_access_key_attributes_access_key_spec.rb +39 -0
  251. data/spec/models/roll_access_key_attributes_spec.rb +40 -0
  252. data/spec/models/roll_access_key_request_access_key_spec.rb +38 -0
  253. data/spec/models/roll_access_key_request_spec.rb +37 -0
  254. data/spec/models/subscription_attributes_spec.rb +38 -0
  255. data/spec/models/subscription_create_request_spec.rb +40 -0
  256. data/spec/models/subscription_response_spec.rb +38 -0
  257. data/spec/models/webhook_endpoint_spec.rb +40 -0
  258. data/spec/models/webhook_request_spec.rb +40 -0
  259. data/spec/spec_helper.rb +123 -0
  260. data/subfi_pay.gemspec +39 -0
  261. metadata +444 -0
@@ -0,0 +1,294 @@
1
+ =begin
2
+ #SubFi Pay API
3
+
4
+ #API for SubFi Pay services
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.7.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module SubFiPay
17
+ class BillingAddress
18
+ attr_accessor :first_name
19
+
20
+ attr_accessor :last_name
21
+
22
+ attr_accessor :email
23
+
24
+ attr_accessor :phone
25
+
26
+ attr_accessor :address_line1
27
+
28
+ attr_accessor :address_line2
29
+
30
+ attr_accessor :city
31
+
32
+ attr_accessor :state
33
+
34
+ attr_accessor :country
35
+
36
+ attr_accessor :postal_code
37
+
38
+ # Attribute mapping from ruby-style variable name to JSON key.
39
+ def self.attribute_map
40
+ {
41
+ :'first_name' => :'first_name',
42
+ :'last_name' => :'last_name',
43
+ :'email' => :'email',
44
+ :'phone' => :'phone',
45
+ :'address_line1' => :'address_line1',
46
+ :'address_line2' => :'address_line2',
47
+ :'city' => :'city',
48
+ :'state' => :'state',
49
+ :'country' => :'country',
50
+ :'postal_code' => :'postal_code'
51
+ }
52
+ end
53
+
54
+ # Returns all the JSON keys this model knows about
55
+ def self.acceptable_attributes
56
+ attribute_map.values
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.openapi_types
61
+ {
62
+ :'first_name' => :'String',
63
+ :'last_name' => :'String',
64
+ :'email' => :'String',
65
+ :'phone' => :'String',
66
+ :'address_line1' => :'String',
67
+ :'address_line2' => :'String',
68
+ :'city' => :'String',
69
+ :'state' => :'String',
70
+ :'country' => :'String',
71
+ :'postal_code' => :'String'
72
+ }
73
+ end
74
+
75
+ # List of attributes with nullable: true
76
+ def self.openapi_nullable
77
+ Set.new([
78
+ :'address_line2',
79
+ ])
80
+ end
81
+
82
+ # Initializes the object
83
+ # @param [Hash] attributes Model attributes in the form of hash
84
+ def initialize(attributes = {})
85
+ if (!attributes.is_a?(Hash))
86
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SubFiPay::BillingAddress` initialize method"
87
+ end
88
+
89
+ # check to see if the attribute exists and convert string to symbol for hash key
90
+ attributes = attributes.each_with_object({}) { |(k, v), h|
91
+ if (!self.class.attribute_map.key?(k.to_sym))
92
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SubFiPay::BillingAddress`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
93
+ end
94
+ h[k.to_sym] = v
95
+ }
96
+
97
+ if attributes.key?(:'first_name')
98
+ self.first_name = attributes[:'first_name']
99
+ end
100
+
101
+ if attributes.key?(:'last_name')
102
+ self.last_name = attributes[:'last_name']
103
+ end
104
+
105
+ if attributes.key?(:'email')
106
+ self.email = attributes[:'email']
107
+ end
108
+
109
+ if attributes.key?(:'phone')
110
+ self.phone = attributes[:'phone']
111
+ end
112
+
113
+ if attributes.key?(:'address_line1')
114
+ self.address_line1 = attributes[:'address_line1']
115
+ end
116
+
117
+ if attributes.key?(:'address_line2')
118
+ self.address_line2 = attributes[:'address_line2']
119
+ end
120
+
121
+ if attributes.key?(:'city')
122
+ self.city = attributes[:'city']
123
+ end
124
+
125
+ if attributes.key?(:'state')
126
+ self.state = attributes[:'state']
127
+ end
128
+
129
+ if attributes.key?(:'country')
130
+ self.country = attributes[:'country']
131
+ end
132
+
133
+ if attributes.key?(:'postal_code')
134
+ self.postal_code = attributes[:'postal_code']
135
+ end
136
+ end
137
+
138
+ # Show invalid properties with the reasons. Usually used together with valid?
139
+ # @return Array for valid properties with the reasons
140
+ def list_invalid_properties
141
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
142
+ invalid_properties = Array.new
143
+ invalid_properties
144
+ end
145
+
146
+ # Check to see if the all the properties in the model are valid
147
+ # @return true if the model is valid
148
+ def valid?
149
+ warn '[DEPRECATED] the `valid?` method is obsolete'
150
+ true
151
+ end
152
+
153
+ # Checks equality by comparing each attribute.
154
+ # @param [Object] Object to be compared
155
+ def ==(o)
156
+ return true if self.equal?(o)
157
+ self.class == o.class &&
158
+ first_name == o.first_name &&
159
+ last_name == o.last_name &&
160
+ email == o.email &&
161
+ phone == o.phone &&
162
+ address_line1 == o.address_line1 &&
163
+ address_line2 == o.address_line2 &&
164
+ city == o.city &&
165
+ state == o.state &&
166
+ country == o.country &&
167
+ postal_code == o.postal_code
168
+ end
169
+
170
+ # @see the `==` method
171
+ # @param [Object] Object to be compared
172
+ def eql?(o)
173
+ self == o
174
+ end
175
+
176
+ # Calculates hash code according to all attributes.
177
+ # @return [Integer] Hash code
178
+ def hash
179
+ [first_name, last_name, email, phone, address_line1, address_line2, city, state, country, postal_code].hash
180
+ end
181
+
182
+ # Builds the object from hash
183
+ # @param [Hash] attributes Model attributes in the form of hash
184
+ # @return [Object] Returns the model itself
185
+ def self.build_from_hash(attributes)
186
+ return nil unless attributes.is_a?(Hash)
187
+ attributes = attributes.transform_keys(&:to_sym)
188
+ transformed_hash = {}
189
+ openapi_types.each_pair do |key, type|
190
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
191
+ transformed_hash["#{key}"] = nil
192
+ elsif type =~ /\AArray<(.*)>/i
193
+ # check to ensure the input is an array given that the attribute
194
+ # is documented as an array but the input is not
195
+ if attributes[attribute_map[key]].is_a?(Array)
196
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
197
+ end
198
+ elsif !attributes[attribute_map[key]].nil?
199
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
200
+ end
201
+ end
202
+ new(transformed_hash)
203
+ end
204
+
205
+ # Deserializes the data based on type
206
+ # @param string type Data type
207
+ # @param string value Value to be deserialized
208
+ # @return [Object] Deserialized data
209
+ def self._deserialize(type, value)
210
+ case type.to_sym
211
+ when :Time
212
+ Time.parse(value)
213
+ when :Date
214
+ Date.parse(value)
215
+ when :String
216
+ value.to_s
217
+ when :Integer
218
+ value.to_i
219
+ when :Float
220
+ value.to_f
221
+ when :Boolean
222
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
223
+ true
224
+ else
225
+ false
226
+ end
227
+ when :Object
228
+ # generic object (usually a Hash), return directly
229
+ value
230
+ when /\AArray<(?<inner_type>.+)>\z/
231
+ inner_type = Regexp.last_match[:inner_type]
232
+ value.map { |v| _deserialize(inner_type, v) }
233
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
234
+ k_type = Regexp.last_match[:k_type]
235
+ v_type = Regexp.last_match[:v_type]
236
+ {}.tap do |hash|
237
+ value.each do |k, v|
238
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
239
+ end
240
+ end
241
+ else # model
242
+ # models (e.g. Pet) or oneOf
243
+ klass = SubFiPay.const_get(type)
244
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
245
+ end
246
+ end
247
+
248
+ # Returns the string representation of the object
249
+ # @return [String] String presentation of the object
250
+ def to_s
251
+ to_hash.to_s
252
+ end
253
+
254
+ # to_body is an alias to to_hash (backward compatibility)
255
+ # @return [Hash] Returns the object in the form of hash
256
+ def to_body
257
+ to_hash
258
+ end
259
+
260
+ # Returns the object in the form of hash
261
+ # @return [Hash] Returns the object in the form of hash
262
+ def to_hash
263
+ hash = {}
264
+ self.class.attribute_map.each_pair do |attr, param|
265
+ value = self.send(attr)
266
+ if value.nil?
267
+ is_nullable = self.class.openapi_nullable.include?(attr)
268
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
269
+ end
270
+
271
+ hash[param] = _to_hash(value)
272
+ end
273
+ hash
274
+ end
275
+
276
+ # Outputs non-array value in the form of hash
277
+ # For object, use to_hash. Otherwise, just return the value
278
+ # @param [Object] value Any valid value
279
+ # @return [Hash] Returns the value in the form of hash
280
+ def _to_hash(value)
281
+ if value.is_a?(Array)
282
+ value.compact.map { |v| _to_hash(v) }
283
+ elsif value.is_a?(Hash)
284
+ {}.tap do |hash|
285
+ value.each { |k, v| hash[k] = _to_hash(v) }
286
+ end
287
+ elsif value.respond_to? :to_hash
288
+ value.to_hash
289
+ else
290
+ value
291
+ end
292
+ end
293
+ end
294
+ end
@@ -0,0 +1,324 @@
1
+ =begin
2
+ #SubFi Pay API
3
+
4
+ #API for SubFi Pay services
5
+
6
+ The version of the OpenAPI document: 0.1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.7.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module SubFiPay
17
+ class CardProfile
18
+ attr_accessor :avs_check
19
+
20
+ attr_accessor :avs_check_message
21
+
22
+ attr_accessor :brand
23
+
24
+ attr_accessor :cvc_check
25
+
26
+ attr_accessor :cvc_check_message
27
+
28
+ attr_accessor :exp_month
29
+
30
+ attr_accessor :exp_year
31
+
32
+ attr_accessor :funding
33
+
34
+ attr_accessor :first6
35
+
36
+ attr_accessor :last4
37
+
38
+ attr_accessor :three_d_secure_supported
39
+
40
+ attr_accessor :token
41
+
42
+ attr_accessor :state
43
+
44
+ # Attribute mapping from ruby-style variable name to JSON key.
45
+ def self.attribute_map
46
+ {
47
+ :'avs_check' => :'avs_check',
48
+ :'avs_check_message' => :'avs_check_message',
49
+ :'brand' => :'brand',
50
+ :'cvc_check' => :'cvc_check',
51
+ :'cvc_check_message' => :'cvc_check_message',
52
+ :'exp_month' => :'exp_month',
53
+ :'exp_year' => :'exp_year',
54
+ :'funding' => :'funding',
55
+ :'first6' => :'first6',
56
+ :'last4' => :'last4',
57
+ :'three_d_secure_supported' => :'three_d_secure_supported',
58
+ :'token' => :'token',
59
+ :'state' => :'state'
60
+ }
61
+ end
62
+
63
+ # Returns all the JSON keys this model knows about
64
+ def self.acceptable_attributes
65
+ attribute_map.values
66
+ end
67
+
68
+ # Attribute type mapping.
69
+ def self.openapi_types
70
+ {
71
+ :'avs_check' => :'String',
72
+ :'avs_check_message' => :'String',
73
+ :'brand' => :'String',
74
+ :'cvc_check' => :'String',
75
+ :'cvc_check_message' => :'String',
76
+ :'exp_month' => :'Integer',
77
+ :'exp_year' => :'Integer',
78
+ :'funding' => :'String',
79
+ :'first6' => :'String',
80
+ :'last4' => :'String',
81
+ :'three_d_secure_supported' => :'Boolean',
82
+ :'token' => :'String',
83
+ :'state' => :'String'
84
+ }
85
+ end
86
+
87
+ # List of attributes with nullable: true
88
+ def self.openapi_nullable
89
+ Set.new([
90
+ :'avs_check_message',
91
+ :'cvc_check_message',
92
+ :'funding',
93
+ :'three_d_secure_supported',
94
+ ])
95
+ end
96
+
97
+ # Initializes the object
98
+ # @param [Hash] attributes Model attributes in the form of hash
99
+ def initialize(attributes = {})
100
+ if (!attributes.is_a?(Hash))
101
+ fail ArgumentError, "The input argument (attributes) must be a hash in `SubFiPay::CardProfile` initialize method"
102
+ end
103
+
104
+ # check to see if the attribute exists and convert string to symbol for hash key
105
+ attributes = attributes.each_with_object({}) { |(k, v), h|
106
+ if (!self.class.attribute_map.key?(k.to_sym))
107
+ fail ArgumentError, "`#{k}` is not a valid attribute in `SubFiPay::CardProfile`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
108
+ end
109
+ h[k.to_sym] = v
110
+ }
111
+
112
+ if attributes.key?(:'avs_check')
113
+ self.avs_check = attributes[:'avs_check']
114
+ end
115
+
116
+ if attributes.key?(:'avs_check_message')
117
+ self.avs_check_message = attributes[:'avs_check_message']
118
+ end
119
+
120
+ if attributes.key?(:'brand')
121
+ self.brand = attributes[:'brand']
122
+ end
123
+
124
+ if attributes.key?(:'cvc_check')
125
+ self.cvc_check = attributes[:'cvc_check']
126
+ end
127
+
128
+ if attributes.key?(:'cvc_check_message')
129
+ self.cvc_check_message = attributes[:'cvc_check_message']
130
+ end
131
+
132
+ if attributes.key?(:'exp_month')
133
+ self.exp_month = attributes[:'exp_month']
134
+ end
135
+
136
+ if attributes.key?(:'exp_year')
137
+ self.exp_year = attributes[:'exp_year']
138
+ end
139
+
140
+ if attributes.key?(:'funding')
141
+ self.funding = attributes[:'funding']
142
+ end
143
+
144
+ if attributes.key?(:'first6')
145
+ self.first6 = attributes[:'first6']
146
+ end
147
+
148
+ if attributes.key?(:'last4')
149
+ self.last4 = attributes[:'last4']
150
+ end
151
+
152
+ if attributes.key?(:'three_d_secure_supported')
153
+ self.three_d_secure_supported = attributes[:'three_d_secure_supported']
154
+ end
155
+
156
+ if attributes.key?(:'token')
157
+ self.token = attributes[:'token']
158
+ end
159
+
160
+ if attributes.key?(:'state')
161
+ self.state = attributes[:'state']
162
+ end
163
+ end
164
+
165
+ # Show invalid properties with the reasons. Usually used together with valid?
166
+ # @return Array for valid properties with the reasons
167
+ def list_invalid_properties
168
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
169
+ invalid_properties = Array.new
170
+ invalid_properties
171
+ end
172
+
173
+ # Check to see if the all the properties in the model are valid
174
+ # @return true if the model is valid
175
+ def valid?
176
+ warn '[DEPRECATED] the `valid?` method is obsolete'
177
+ true
178
+ end
179
+
180
+ # Checks equality by comparing each attribute.
181
+ # @param [Object] Object to be compared
182
+ def ==(o)
183
+ return true if self.equal?(o)
184
+ self.class == o.class &&
185
+ avs_check == o.avs_check &&
186
+ avs_check_message == o.avs_check_message &&
187
+ brand == o.brand &&
188
+ cvc_check == o.cvc_check &&
189
+ cvc_check_message == o.cvc_check_message &&
190
+ exp_month == o.exp_month &&
191
+ exp_year == o.exp_year &&
192
+ funding == o.funding &&
193
+ first6 == o.first6 &&
194
+ last4 == o.last4 &&
195
+ three_d_secure_supported == o.three_d_secure_supported &&
196
+ token == o.token &&
197
+ state == o.state
198
+ end
199
+
200
+ # @see the `==` method
201
+ # @param [Object] Object to be compared
202
+ def eql?(o)
203
+ self == o
204
+ end
205
+
206
+ # Calculates hash code according to all attributes.
207
+ # @return [Integer] Hash code
208
+ def hash
209
+ [avs_check, avs_check_message, brand, cvc_check, cvc_check_message, exp_month, exp_year, funding, first6, last4, three_d_secure_supported, token, state].hash
210
+ end
211
+
212
+ # Builds the object from hash
213
+ # @param [Hash] attributes Model attributes in the form of hash
214
+ # @return [Object] Returns the model itself
215
+ def self.build_from_hash(attributes)
216
+ return nil unless attributes.is_a?(Hash)
217
+ attributes = attributes.transform_keys(&:to_sym)
218
+ transformed_hash = {}
219
+ openapi_types.each_pair do |key, type|
220
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
221
+ transformed_hash["#{key}"] = nil
222
+ elsif type =~ /\AArray<(.*)>/i
223
+ # check to ensure the input is an array given that the attribute
224
+ # is documented as an array but the input is not
225
+ if attributes[attribute_map[key]].is_a?(Array)
226
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
227
+ end
228
+ elsif !attributes[attribute_map[key]].nil?
229
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
230
+ end
231
+ end
232
+ new(transformed_hash)
233
+ end
234
+
235
+ # Deserializes the data based on type
236
+ # @param string type Data type
237
+ # @param string value Value to be deserialized
238
+ # @return [Object] Deserialized data
239
+ def self._deserialize(type, value)
240
+ case type.to_sym
241
+ when :Time
242
+ Time.parse(value)
243
+ when :Date
244
+ Date.parse(value)
245
+ when :String
246
+ value.to_s
247
+ when :Integer
248
+ value.to_i
249
+ when :Float
250
+ value.to_f
251
+ when :Boolean
252
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
253
+ true
254
+ else
255
+ false
256
+ end
257
+ when :Object
258
+ # generic object (usually a Hash), return directly
259
+ value
260
+ when /\AArray<(?<inner_type>.+)>\z/
261
+ inner_type = Regexp.last_match[:inner_type]
262
+ value.map { |v| _deserialize(inner_type, v) }
263
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
264
+ k_type = Regexp.last_match[:k_type]
265
+ v_type = Regexp.last_match[:v_type]
266
+ {}.tap do |hash|
267
+ value.each do |k, v|
268
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
269
+ end
270
+ end
271
+ else # model
272
+ # models (e.g. Pet) or oneOf
273
+ klass = SubFiPay.const_get(type)
274
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
275
+ end
276
+ end
277
+
278
+ # Returns the string representation of the object
279
+ # @return [String] String presentation of the object
280
+ def to_s
281
+ to_hash.to_s
282
+ end
283
+
284
+ # to_body is an alias to to_hash (backward compatibility)
285
+ # @return [Hash] Returns the object in the form of hash
286
+ def to_body
287
+ to_hash
288
+ end
289
+
290
+ # Returns the object in the form of hash
291
+ # @return [Hash] Returns the object in the form of hash
292
+ def to_hash
293
+ hash = {}
294
+ self.class.attribute_map.each_pair do |attr, param|
295
+ value = self.send(attr)
296
+ if value.nil?
297
+ is_nullable = self.class.openapi_nullable.include?(attr)
298
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
299
+ end
300
+
301
+ hash[param] = _to_hash(value)
302
+ end
303
+ hash
304
+ end
305
+
306
+ # Outputs non-array value in the form of hash
307
+ # For object, use to_hash. Otherwise, just return the value
308
+ # @param [Object] value Any valid value
309
+ # @return [Hash] Returns the value in the form of hash
310
+ def _to_hash(value)
311
+ if value.is_a?(Array)
312
+ value.compact.map { |v| _to_hash(v) }
313
+ elsif value.is_a?(Hash)
314
+ {}.tap do |hash|
315
+ value.each { |k, v| hash[k] = _to_hash(v) }
316
+ end
317
+ elsif value.respond_to? :to_hash
318
+ value.to_hash
319
+ else
320
+ value
321
+ end
322
+ end
323
+ end
324
+ end