moneykit 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (212) hide show
  1. checksums.yaml +4 -4
  2. data/lib/moneykit/api/access_token_api.rb +53 -55
  3. data/lib/moneykit/api/account_numbers_api.rb +24 -24
  4. data/lib/moneykit/api/accounts_api.rb +86 -80
  5. data/lib/moneykit/api/identity_api.rb +29 -28
  6. data/lib/moneykit/api/institutions_api.rb +50 -48
  7. data/lib/moneykit/api/link_session_api.rb +47 -50
  8. data/lib/moneykit/api/links_api.rb +74 -81
  9. data/lib/moneykit/api/products_api.rb +31 -33
  10. data/lib/moneykit/api/transactions_api.rb +112 -87
  11. data/lib/moneykit/api/users_api.rb +96 -79
  12. data/lib/moneykit/api_client.rb +64 -71
  13. data/lib/moneykit/api_error.rb +14 -16
  14. data/lib/moneykit/configuration.rb +42 -45
  15. data/lib/moneykit/models/account.rb +62 -78
  16. data/lib/moneykit/models/account_balances.rb +58 -63
  17. data/lib/moneykit/models/account_group.rb +47 -47
  18. data/lib/moneykit/models/account_identity.rb +69 -89
  19. data/lib/moneykit/models/account_numbers.rb +50 -49
  20. data/lib/moneykit/models/account_numbers_link_product.rb +52 -54
  21. data/lib/moneykit/models/account_numbers_product_settings.rb +49 -48
  22. data/lib/moneykit/models/account_type.rb +23 -23
  23. data/lib/moneykit/models/account_with_account_numbers.rb +68 -89
  24. data/lib/moneykit/models/accounts_link_product.rb +46 -46
  25. data/lib/moneykit/models/ach_number.rb +48 -49
  26. data/lib/moneykit/models/address.rb +66 -75
  27. data/lib/moneykit/models/api_error_auth_expired_access_token_response.rb +63 -62
  28. data/lib/moneykit/models/api_error_auth_unauthorized_response.rb +60 -62
  29. data/lib/moneykit/models/api_error_rate_limit_exceeded_response.rb +63 -62
  30. data/lib/moneykit/models/app.rb +46 -50
  31. data/lib/moneykit/models/bacs_number.rb +45 -46
  32. data/lib/moneykit/models/balances.rb +58 -64
  33. data/lib/moneykit/models/basic_account_details.rb +55 -61
  34. data/lib/moneykit/models/country.rb +13 -14
  35. data/lib/moneykit/models/create_link_session_request.rb +83 -96
  36. data/lib/moneykit/models/create_link_session_response.rb +40 -37
  37. data/lib/moneykit/models/currency.rb +193 -193
  38. data/lib/moneykit/models/cursor.rb +40 -39
  39. data/lib/moneykit/models/cursor_pagination.rb +40 -38
  40. data/lib/moneykit/models/cursors.rb +40 -39
  41. data/lib/moneykit/models/customer_app.rb +46 -49
  42. data/lib/moneykit/models/customer_user.rb +59 -69
  43. data/lib/moneykit/models/eft_number.rb +48 -52
  44. data/lib/moneykit/models/email.rb +46 -48
  45. data/lib/moneykit/models/email1.rb +50 -53
  46. data/lib/moneykit/models/exchange_token_request.rb +40 -37
  47. data/lib/moneykit/models/exchange_token_response.rb +46 -49
  48. data/lib/moneykit/models/generate_access_token_response.rb +51 -58
  49. data/lib/moneykit/models/get_account_numbers_response.rb +48 -53
  50. data/lib/moneykit/models/get_account_response.rb +47 -52
  51. data/lib/moneykit/models/get_accounts_response.rb +47 -50
  52. data/lib/moneykit/models/get_institutions_response.rb +47 -50
  53. data/lib/moneykit/models/get_transactions_response.rb +68 -87
  54. data/lib/moneykit/models/get_user_accounts_response.rb +42 -42
  55. data/lib/moneykit/models/get_user_links_response.rb +42 -42
  56. data/lib/moneykit/models/get_user_transactions_response.rb +64 -82
  57. data/lib/moneykit/models/http_validation_error.rb +68 -71
  58. data/lib/moneykit/models/identity.rb +49 -49
  59. data/lib/moneykit/models/identity_link_product.rb +52 -54
  60. data/lib/moneykit/models/identity_product_settings.rb +49 -48
  61. data/lib/moneykit/models/identity_response.rb +47 -50
  62. data/lib/moneykit/models/institution.rb +77 -96
  63. data/lib/moneykit/models/institution_error_not_found_response.rb +63 -64
  64. data/lib/moneykit/models/institution_styling_response.rb +77 -93
  65. data/lib/moneykit/models/international_number.rb +46 -49
  66. data/lib/moneykit/models/introspect_client_response.rb +61 -73
  67. data/lib/moneykit/models/jwk_set.rb +41 -42
  68. data/lib/moneykit/models/link.rb +78 -100
  69. data/lib/moneykit/models/link1.rb +78 -100
  70. data/lib/moneykit/models/link2.rb +78 -100
  71. data/lib/moneykit/models/link3.rb +78 -100
  72. data/lib/moneykit/models/link4.rb +78 -100
  73. data/lib/moneykit/models/link_common.rb +78 -99
  74. data/lib/moneykit/models/link_error.rb +19 -19
  75. data/lib/moneykit/models/link_error_bad_state_response.rb +64 -72
  76. data/lib/moneykit/models/link_error_deleted_response.rb +63 -64
  77. data/lib/moneykit/models/link_error_forbidden_action_response.rb +60 -62
  78. data/lib/moneykit/models/link_error_not_found_response.rb +63 -64
  79. data/lib/moneykit/models/link_error_unauthorized_access_response.rb +63 -64
  80. data/lib/moneykit/models/link_permission_scope.rb +14 -15
  81. data/lib/moneykit/models/link_permissions.rb +43 -43
  82. data/lib/moneykit/models/link_products.rb +52 -63
  83. data/lib/moneykit/models/link_response.rb +90 -118
  84. data/lib/moneykit/models/link_session_customer_user.rb +58 -68
  85. data/lib/moneykit/models/link_session_customer_user_email.rb +50 -52
  86. data/lib/moneykit/models/link_session_customer_user_phone.rb +60 -67
  87. data/lib/moneykit/models/link_session_error_forbidden_config_response.rb +60 -62
  88. data/lib/moneykit/models/link_session_error_invalid_token_exchange.rb +60 -62
  89. data/lib/moneykit/models/link_session_setting_overrides.rb +61 -72
  90. data/lib/moneykit/models/link_state.rb +15 -16
  91. data/lib/moneykit/models/link_state_changed_webhook.rb +110 -134
  92. data/lib/moneykit/models/location_inner.rb +41 -46
  93. data/lib/moneykit/models/money_kit_env.rb +12 -13
  94. data/lib/moneykit/models/money_link_features.rb +49 -48
  95. data/lib/moneykit/models/moneylink_features.rb +50 -49
  96. data/lib/moneykit/models/numbers.rb +60 -73
  97. data/lib/moneykit/models/owner.rb +59 -72
  98. data/lib/moneykit/models/phone.rb +60 -68
  99. data/lib/moneykit/models/phone_number.rb +55 -59
  100. data/lib/moneykit/models/phone_number_type.rb +14 -15
  101. data/lib/moneykit/models/product.rb +14 -15
  102. data/lib/moneykit/models/products.rb +52 -64
  103. data/lib/moneykit/models/products1.rb +48 -56
  104. data/lib/moneykit/models/products_settings.rb +48 -55
  105. data/lib/moneykit/models/provider.rb +15 -16
  106. data/lib/moneykit/models/refresh_products_request.rb +43 -45
  107. data/lib/moneykit/models/requested_link_permission.rb +52 -60
  108. data/lib/moneykit/models/response401_disconnect_links_id_delete.rb +71 -77
  109. data/lib/moneykit/models/response401_exchange_token_link_session_exchange_token_post.rb +66 -72
  110. data/lib/moneykit/models/response401_get_account_links_id_accounts_account_id_get.rb +71 -77
  111. data/lib/moneykit/models/response401_get_account_numbers_links_id_accounts_numbers_get.rb +71 -77
  112. data/lib/moneykit/models/response401_get_accounts_links_id_accounts_get.rb +71 -77
  113. data/lib/moneykit/models/response401_get_identities_links_id_identity_get.rb +71 -77
  114. data/lib/moneykit/models/response401_get_institution_institutions_institution_id_get.rb +66 -72
  115. data/lib/moneykit/models/response401_get_institution_styling_institutions_institution_id_styling_get.rb +66 -72
  116. data/lib/moneykit/models/response401_get_institutions_institutions_get.rb +66 -72
  117. data/lib/moneykit/models/response401_get_link_links_id_get.rb +71 -77
  118. data/lib/moneykit/models/response401_get_transactions_diff_links_id_transactions_sync_get.rb +71 -77
  119. data/lib/moneykit/models/response401_get_transactions_links_id_transactions_get.rb +71 -77
  120. data/lib/moneykit/models/response401_get_user_accounts_users_id_accounts_get.rb +66 -72
  121. data/lib/moneykit/models/response401_get_user_links_users_id_links_get.rb +66 -72
  122. data/lib/moneykit/models/response401_get_user_transactions_users_id_transactions_get.rb +66 -72
  123. data/lib/moneykit/models/response401_get_well_known_jwks_well_known_jwks_json_get.rb +66 -72
  124. data/lib/moneykit/models/response401_instrospect_client_auth_introspect_get.rb +66 -72
  125. data/lib/moneykit/models/response401_refresh_products_links_id_products_post.rb +71 -77
  126. data/lib/moneykit/models/response401_update_link_links_id_patch.rb +71 -77
  127. data/lib/moneykit/models/settings.rb +61 -73
  128. data/lib/moneykit/models/supported_version.rb +11 -12
  129. data/lib/moneykit/models/transaction.rb +87 -114
  130. data/lib/moneykit/models/transaction_diff.rb +54 -62
  131. data/lib/moneykit/models/transaction_sync_response.rb +57 -72
  132. data/lib/moneykit/models/transaction_type.rb +12 -13
  133. data/lib/moneykit/models/transaction_type_filter.rb +12 -13
  134. data/lib/moneykit/models/transactions.rb +58 -57
  135. data/lib/moneykit/models/transactions1.rb +55 -63
  136. data/lib/moneykit/models/transactions_link_product.rb +52 -54
  137. data/lib/moneykit/models/transactions_product_settings.rb +57 -56
  138. data/lib/moneykit/models/update_link_request.rb +53 -52
  139. data/lib/moneykit/models/user_accounts_out.rb +40 -40
  140. data/lib/moneykit/models/user_links_out.rb +40 -40
  141. data/lib/moneykit/models/user_transactions_paged_response.rb +40 -40
  142. data/lib/moneykit/models/validation_error.rb +53 -64
  143. data/lib/moneykit/version.rb +10 -12
  144. data/lib/moneykit.rb +9 -11
  145. data/lib/plaid_compatible/money_kit_plaid_compatible/api/plaid_api.rb +203 -207
  146. data/lib/plaid_compatible/money_kit_plaid_compatible/api_client.rb +75 -76
  147. data/lib/plaid_compatible/money_kit_plaid_compatible/api_error.rb +19 -19
  148. data/lib/plaid_compatible/money_kit_plaid_compatible/configuration.rb +38 -40
  149. data/lib/plaid_compatible/money_kit_plaid_compatible/models/account_balance.rb +59 -61
  150. data/lib/plaid_compatible/money_kit_plaid_compatible/models/account_base.rb +71 -87
  151. data/lib/plaid_compatible/money_kit_plaid_compatible/models/account_identity.rb +77 -98
  152. data/lib/plaid_compatible/money_kit_plaid_compatible/models/account_subtype.rb +85 -86
  153. data/lib/plaid_compatible/money_kit_plaid_compatible/models/account_type.rb +18 -19
  154. data/lib/plaid_compatible/money_kit_plaid_compatible/models/accounts_get_request.rb +59 -61
  155. data/lib/plaid_compatible/money_kit_plaid_compatible/models/accounts_get_request_options.rb +44 -41
  156. data/lib/plaid_compatible/money_kit_plaid_compatible/models/accounts_get_response.rb +55 -60
  157. data/lib/plaid_compatible/money_kit_plaid_compatible/models/address.rb +49 -47
  158. data/lib/plaid_compatible/money_kit_plaid_compatible/models/address_data.rb +65 -69
  159. data/lib/plaid_compatible/money_kit_plaid_compatible/models/auth_get_numbers.rb +63 -73
  160. data/lib/plaid_compatible/money_kit_plaid_compatible/models/auth_get_request.rb +59 -61
  161. data/lib/plaid_compatible/money_kit_plaid_compatible/models/auth_get_request_options.rb +44 -41
  162. data/lib/plaid_compatible/money_kit_plaid_compatible/models/auth_get_response.rb +61 -72
  163. data/lib/plaid_compatible/money_kit_plaid_compatible/models/country_code.rb +15 -16
  164. data/lib/plaid_compatible/money_kit_plaid_compatible/models/email.rb +49 -50
  165. data/lib/plaid_compatible/money_kit_plaid_compatible/models/http_validation_error.rb +43 -41
  166. data/lib/plaid_compatible/money_kit_plaid_compatible/models/identity_get_request.rb +59 -61
  167. data/lib/plaid_compatible/money_kit_plaid_compatible/models/identity_get_request_options.rb +44 -41
  168. data/lib/plaid_compatible/money_kit_plaid_compatible/models/identity_get_response.rb +55 -60
  169. data/lib/plaid_compatible/money_kit_plaid_compatible/models/institution.rb +65 -71
  170. data/lib/plaid_compatible/money_kit_plaid_compatible/models/institutions_get_by_id_request.rb +60 -61
  171. data/lib/plaid_compatible/money_kit_plaid_compatible/models/institutions_get_by_id_response.rb +49 -50
  172. data/lib/plaid_compatible/money_kit_plaid_compatible/models/item.rb +85 -96
  173. data/lib/plaid_compatible/money_kit_plaid_compatible/models/item_error_webhook.rb +65 -77
  174. data/lib/plaid_compatible/money_kit_plaid_compatible/models/item_get_request.rb +55 -55
  175. data/lib/plaid_compatible/money_kit_plaid_compatible/models/item_get_response.rb +55 -59
  176. data/lib/plaid_compatible/money_kit_plaid_compatible/models/item_public_token_exchange_request.rb +55 -55
  177. data/lib/plaid_compatible/money_kit_plaid_compatible/models/item_public_token_exchange_response.rb +54 -59
  178. data/lib/plaid_compatible/money_kit_plaid_compatible/models/item_remove_request.rb +55 -55
  179. data/lib/plaid_compatible/money_kit_plaid_compatible/models/item_remove_response.rb +44 -41
  180. data/lib/plaid_compatible/money_kit_plaid_compatible/models/item_status_investments.rb +49 -47
  181. data/lib/plaid_compatible/money_kit_plaid_compatible/models/item_status_last_webhook.rb +50 -48
  182. data/lib/plaid_compatible/money_kit_plaid_compatible/models/item_status_nullable.rb +55 -59
  183. data/lib/plaid_compatible/money_kit_plaid_compatible/models/item_status_transactions.rb +49 -47
  184. data/lib/plaid_compatible/money_kit_plaid_compatible/models/link_token_create_request.rb +100 -121
  185. data/lib/plaid_compatible/money_kit_plaid_compatible/models/link_token_create_request_user.rb +66 -66
  186. data/lib/plaid_compatible/money_kit_plaid_compatible/models/link_token_create_response.rb +54 -59
  187. data/lib/plaid_compatible/money_kit_plaid_compatible/models/numbers_ach.rb +59 -65
  188. data/lib/plaid_compatible/money_kit_plaid_compatible/models/numbers_bacs.rb +54 -59
  189. data/lib/plaid_compatible/money_kit_plaid_compatible/models/numbers_eft.rb +59 -68
  190. data/lib/plaid_compatible/money_kit_plaid_compatible/models/numbers_international.rb +54 -59
  191. data/lib/plaid_compatible/money_kit_plaid_compatible/models/owner.rb +63 -73
  192. data/lib/plaid_compatible/money_kit_plaid_compatible/models/personal_finance_category.rb +49 -50
  193. data/lib/plaid_compatible/money_kit_plaid_compatible/models/phone_number.rb +54 -59
  194. data/lib/plaid_compatible/money_kit_plaid_compatible/models/plaid_error.rb +88 -103
  195. data/lib/plaid_compatible/money_kit_plaid_compatible/models/plaid_error_type.rb +26 -27
  196. data/lib/plaid_compatible/money_kit_plaid_compatible/models/products.rb +16 -17
  197. data/lib/plaid_compatible/money_kit_plaid_compatible/models/removed_transaction.rb +43 -39
  198. data/lib/plaid_compatible/money_kit_plaid_compatible/models/transaction.rb +107 -134
  199. data/lib/plaid_compatible/money_kit_plaid_compatible/models/transactions_get_request.rb +69 -79
  200. data/lib/plaid_compatible/money_kit_plaid_compatible/models/transactions_get_request_options.rb +66 -68
  201. data/lib/plaid_compatible/money_kit_plaid_compatible/models/transactions_get_response.rb +65 -76
  202. data/lib/plaid_compatible/money_kit_plaid_compatible/models/transactions_refresh_request.rb +55 -55
  203. data/lib/plaid_compatible/money_kit_plaid_compatible/models/transactions_refresh_response.rb +44 -41
  204. data/lib/plaid_compatible/money_kit_plaid_compatible/models/transactions_sync_request.rb +69 -75
  205. data/lib/plaid_compatible/money_kit_plaid_compatible/models/transactions_sync_request_options.rb +50 -46
  206. data/lib/plaid_compatible/money_kit_plaid_compatible/models/transactions_sync_response.rb +72 -89
  207. data/lib/plaid_compatible/money_kit_plaid_compatible/models/validation_error.rb +56 -65
  208. data/lib/plaid_compatible/money_kit_plaid_compatible/models/webhook_environment_values.rb +15 -16
  209. data/lib/plaid_compatible/money_kit_plaid_compatible/version.rb +13 -13
  210. data/lib/plaid_compatible/money_kit_plaid_compatible.rb +12 -12
  211. data/moneykit.gemspec +21 -25
  212. metadata +1 -1
@@ -1,14 +1,12 @@
1
- =begin
2
- #MoneyKit API
3
-
4
- #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
-
6
- The version of the OpenAPI document: 0.1.0
7
-
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.5.0
10
-
11
- =end
1
+ # #MoneyKit API
2
+ #
3
+ # No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ #
5
+ # The version of the OpenAPI document: 0.1.0
6
+ #
7
+ # Generated by: https://openapi-generator.tech
8
+ # OpenAPI Generator version: 6.5.0
9
+ #
12
10
 
13
11
  require 'date'
14
12
  require 'time'
@@ -24,8 +22,8 @@ module MoneyKit
24
22
  # Attribute mapping from ruby-style variable name to JSON key.
25
23
  def self.attribute_map
26
24
  {
27
- :'address' => :'address',
28
- :'customer_verified_at' => :'customer_verified_at'
25
+ 'address': :address,
26
+ 'customer_verified_at': :customer_verified_at
29
27
  }
30
28
  end
31
29
 
@@ -37,49 +35,48 @@ module MoneyKit
37
35
  # Attribute type mapping.
38
36
  def self.openapi_types
39
37
  {
40
- :'address' => :'String',
41
- :'customer_verified_at' => :'Time'
38
+ 'address': :String,
39
+ 'customer_verified_at': :Time
42
40
  }
43
41
  end
44
42
 
45
43
  # List of attributes with nullable: true
46
44
  def self.openapi_nullable
47
45
  Set.new([
48
- :'customer_verified_at'
49
- ])
46
+ :customer_verified_at
47
+ ])
50
48
  end
51
49
 
52
50
  # Initializes the object
53
51
  # @param [Hash] attributes Model attributes in the form of hash
54
52
  def initialize(attributes = {})
55
- if (!attributes.is_a?(Hash))
56
- fail ArgumentError, "The input argument (attributes) must be a hash in `MoneyKit::LinkSessionCustomerUserEmail` initialize method"
53
+ unless attributes.is_a?(Hash)
54
+ raise ArgumentError,
55
+ 'The input argument (attributes) must be a hash in `MoneyKit::LinkSessionCustomerUserEmail` initialize method'
57
56
  end
58
57
 
59
58
  # check to see if the attribute exists and convert string to symbol for hash key
60
- attributes = attributes.each_with_object({}) { |(k, v), h|
61
- if (!self.class.attribute_map.key?(k.to_sym))
62
- fail ArgumentError, "`#{k}` is not a valid attribute in `MoneyKit::LinkSessionCustomerUserEmail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
59
+ attributes = attributes.each_with_object({}) do |(k, v), h|
60
+ unless self.class.attribute_map.key?(k.to_sym)
61
+ raise ArgumentError,
62
+ "`#{k}` is not a valid attribute in `MoneyKit::LinkSessionCustomerUserEmail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
63
63
  end
64
- h[k.to_sym] = v
65
- }
66
64
 
67
- if attributes.key?(:'address')
68
- self.address = attributes[:'address']
65
+ h[k.to_sym] = v
69
66
  end
70
67
 
71
- if attributes.key?(:'customer_verified_at')
72
- self.customer_verified_at = attributes[:'customer_verified_at']
73
- end
68
+ self.address = attributes[:address] if attributes.key?(:address)
69
+
70
+ return unless attributes.key?(:customer_verified_at)
71
+
72
+ self.customer_verified_at = attributes[:customer_verified_at]
74
73
  end
75
74
 
76
75
  # Show invalid properties with the reasons. Usually used together with valid?
77
76
  # @return Array for valid properties with the reasons
78
77
  def list_invalid_properties
79
- invalid_properties = Array.new
80
- if @address.nil?
81
- invalid_properties.push('invalid value for "address", address cannot be nil.')
82
- end
78
+ invalid_properties = []
79
+ invalid_properties.push('invalid value for "address", address cannot be nil.') if @address.nil?
83
80
 
84
81
  if @address.to_s.length > 254
85
82
  invalid_properties.push('invalid value for "address", the character length must be smaller than or equal to 254.')
@@ -104,27 +101,26 @@ module MoneyKit
104
101
  return false if @address.to_s.length > 254
105
102
  return false if @address.to_s.length < 4
106
103
  return false if @address !~ Regexp.new(/[^@]+@[^@]+\.[^@]+/)
104
+
107
105
  true
108
106
  end
109
107
 
110
108
  # Custom attribute writer method with validation
111
109
  # @param [Object] address Value to be assigned
112
110
  def address=(address)
113
- if address.nil?
114
- fail ArgumentError, 'address cannot be nil'
115
- end
111
+ raise ArgumentError, 'address cannot be nil' if address.nil?
116
112
 
117
113
  if address.to_s.length > 254
118
- fail ArgumentError, 'invalid value for "address", the character length must be smaller than or equal to 254.'
114
+ raise ArgumentError, 'invalid value for "address", the character length must be smaller than or equal to 254.'
119
115
  end
120
116
 
121
117
  if address.to_s.length < 4
122
- fail ArgumentError, 'invalid value for "address", the character length must be great than or equal to 4.'
118
+ raise ArgumentError, 'invalid value for "address", the character length must be great than or equal to 4.'
123
119
  end
124
120
 
125
121
  pattern = Regexp.new(/[^@]+@[^@]+\.[^@]+/)
126
122
  if address !~ pattern
127
- fail ArgumentError, "invalid value for \"address\", must conform to the pattern #{pattern}."
123
+ raise ArgumentError, "invalid value for \"address\", must conform to the pattern #{pattern}."
128
124
  end
129
125
 
130
126
  @address = address
@@ -132,17 +128,18 @@ module MoneyKit
132
128
 
133
129
  # Checks equality by comparing each attribute.
134
130
  # @param [Object] Object to be compared
135
- def ==(o)
136
- return true if self.equal?(o)
137
- self.class == o.class &&
138
- address == o.address &&
139
- customer_verified_at == o.customer_verified_at
131
+ def ==(other)
132
+ return true if equal?(other)
133
+
134
+ self.class == other.class &&
135
+ address == other.address &&
136
+ customer_verified_at == other.customer_verified_at
140
137
  end
141
138
 
142
139
  # @see the `==` method
143
140
  # @param [Object] Object to be compared
144
- def eql?(o)
145
- self == o
141
+ def eql?(other)
142
+ self == other
146
143
  end
147
144
 
148
145
  # Calculates hash code according to all attributes.
@@ -163,18 +160,21 @@ module MoneyKit
163
160
  # @return [Object] Returns the model itself
164
161
  def build_from_hash(attributes)
165
162
  return nil unless attributes.is_a?(Hash)
163
+
166
164
  attributes = attributes.transform_keys(&:to_sym)
167
165
  self.class.openapi_types.each_pair do |key, type|
168
166
  if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
169
- self.send("#{key}=", nil)
167
+ send("#{key}=", nil)
170
168
  elsif type =~ /\AArray<(.*)>/i
171
169
  # check to ensure the input is an array given that the attribute
172
170
  # is documented as an array but the input is not
173
171
  if attributes[self.class.attribute_map[key]].is_a?(Array)
174
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
172
+ send("#{key}=", attributes[self.class.attribute_map[key]].map do |v|
173
+ _deserialize(::Regexp.last_match(1), v)
174
+ end)
175
175
  end
176
176
  elsif !attributes[self.class.attribute_map[key]].nil?
177
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
177
+ send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
178
178
  end
179
179
  end
180
180
 
@@ -241,7 +241,7 @@ module MoneyKit
241
241
  def to_hash
242
242
  hash = {}
243
243
  self.class.attribute_map.each_pair do |attr, param|
244
- value = self.send(attr)
244
+ value = send(attr)
245
245
  if value.nil?
246
246
  is_nullable = self.class.openapi_nullable.include?(attr)
247
247
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
@@ -269,7 +269,5 @@ module MoneyKit
269
269
  value
270
270
  end
271
271
  end
272
-
273
272
  end
274
-
275
273
  end
@@ -1,14 +1,12 @@
1
- =begin
2
- #MoneyKit API
3
-
4
- #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
-
6
- The version of the OpenAPI document: 0.1.0
7
-
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.5.0
10
-
11
- =end
1
+ # #MoneyKit API
2
+ #
3
+ # No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ #
5
+ # The version of the OpenAPI document: 0.1.0
6
+ #
7
+ # Generated by: https://openapi-generator.tech
8
+ # OpenAPI Generator version: 6.5.0
9
+ #
12
10
 
13
11
  require 'date'
14
12
  require 'time'
@@ -24,8 +22,7 @@ module MoneyKit
24
22
  attr_accessor :customer_verified_at
25
23
 
26
24
  class EnumAttributeValidator
27
- attr_reader :datatype
28
- attr_reader :allowable_values
25
+ attr_reader :datatype, :allowable_values
29
26
 
30
27
  def initialize(datatype, allowable_values)
31
28
  @allowable_values = allowable_values.map do |value|
@@ -48,9 +45,9 @@ module MoneyKit
48
45
  # Attribute mapping from ruby-style variable name to JSON key.
49
46
  def self.attribute_map
50
47
  {
51
- :'number' => :'number',
52
- :'country' => :'country',
53
- :'customer_verified_at' => :'customer_verified_at'
48
+ 'number': :number,
49
+ 'country': :country,
50
+ 'customer_verified_at': :customer_verified_at
54
51
  }
55
52
  end
56
53
 
@@ -62,55 +59,52 @@ module MoneyKit
62
59
  # Attribute type mapping.
63
60
  def self.openapi_types
64
61
  {
65
- :'number' => :'String',
66
- :'country' => :'Country',
67
- :'customer_verified_at' => :'Time'
62
+ 'number': :String,
63
+ 'country': :Country,
64
+ 'customer_verified_at': :Time
68
65
  }
69
66
  end
70
67
 
71
68
  # List of attributes with nullable: true
72
69
  def self.openapi_nullable
73
- Set.new([
74
- :'country',
75
- :'customer_verified_at'
76
- ])
70
+ Set.new(%i[
71
+ country
72
+ customer_verified_at
73
+ ])
77
74
  end
78
75
 
79
76
  # Initializes the object
80
77
  # @param [Hash] attributes Model attributes in the form of hash
81
78
  def initialize(attributes = {})
82
- if (!attributes.is_a?(Hash))
83
- fail ArgumentError, "The input argument (attributes) must be a hash in `MoneyKit::LinkSessionCustomerUserPhone` initialize method"
79
+ unless attributes.is_a?(Hash)
80
+ raise ArgumentError,
81
+ 'The input argument (attributes) must be a hash in `MoneyKit::LinkSessionCustomerUserPhone` initialize method'
84
82
  end
85
83
 
86
84
  # check to see if the attribute exists and convert string to symbol for hash key
87
- attributes = attributes.each_with_object({}) { |(k, v), h|
88
- if (!self.class.attribute_map.key?(k.to_sym))
89
- fail ArgumentError, "`#{k}` is not a valid attribute in `MoneyKit::LinkSessionCustomerUserPhone`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
85
+ attributes = attributes.each_with_object({}) do |(k, v), h|
86
+ unless self.class.attribute_map.key?(k.to_sym)
87
+ raise ArgumentError,
88
+ "`#{k}` is not a valid attribute in `MoneyKit::LinkSessionCustomerUserPhone`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
90
89
  end
91
- h[k.to_sym] = v
92
- }
93
90
 
94
- if attributes.key?(:'number')
95
- self.number = attributes[:'number']
91
+ h[k.to_sym] = v
96
92
  end
97
93
 
98
- if attributes.key?(:'country')
99
- self.country = attributes[:'country']
100
- end
94
+ self.number = attributes[:number] if attributes.key?(:number)
101
95
 
102
- if attributes.key?(:'customer_verified_at')
103
- self.customer_verified_at = attributes[:'customer_verified_at']
104
- end
96
+ self.country = attributes[:country] if attributes.key?(:country)
97
+
98
+ return unless attributes.key?(:customer_verified_at)
99
+
100
+ self.customer_verified_at = attributes[:customer_verified_at]
105
101
  end
106
102
 
107
103
  # Show invalid properties with the reasons. Usually used together with valid?
108
104
  # @return Array for valid properties with the reasons
109
105
  def list_invalid_properties
110
- invalid_properties = Array.new
111
- if @number.nil?
112
- invalid_properties.push('invalid value for "number", number cannot be nil.')
113
- end
106
+ invalid_properties = []
107
+ invalid_properties.push('invalid value for "number", number cannot be nil.') if @number.nil?
114
108
 
115
109
  if @number.to_s.length > 250
116
110
  invalid_properties.push('invalid value for "number", the character length must be smaller than or equal to 250.')
@@ -120,7 +114,7 @@ module MoneyKit
120
114
  invalid_properties.push('invalid value for "number", the character length must be great than or equal to 4.')
121
115
  end
122
116
 
123
- pattern = Regexp.new(/^\+?[ 0-9()\.#]+$/)
117
+ pattern = Regexp.new(/^\+?[ 0-9().#]+$/)
124
118
  if @number !~ pattern
125
119
  invalid_properties.push("invalid value for \"number\", must conform to the pattern #{pattern}.")
126
120
  end
@@ -134,47 +128,45 @@ module MoneyKit
134
128
  return false if @number.nil?
135
129
  return false if @number.to_s.length > 250
136
130
  return false if @number.to_s.length < 4
137
- return false if @number !~ Regexp.new(/^\+?[ 0-9()\.#]+$/)
131
+ return false if @number !~ Regexp.new(/^\+?[ 0-9().#]+$/)
132
+
138
133
  true
139
134
  end
140
135
 
141
136
  # Custom attribute writer method with validation
142
137
  # @param [Object] number Value to be assigned
143
138
  def number=(number)
144
- if number.nil?
145
- fail ArgumentError, 'number cannot be nil'
146
- end
139
+ raise ArgumentError, 'number cannot be nil' if number.nil?
147
140
 
148
141
  if number.to_s.length > 250
149
- fail ArgumentError, 'invalid value for "number", the character length must be smaller than or equal to 250.'
142
+ raise ArgumentError, 'invalid value for "number", the character length must be smaller than or equal to 250.'
150
143
  end
151
144
 
152
145
  if number.to_s.length < 4
153
- fail ArgumentError, 'invalid value for "number", the character length must be great than or equal to 4.'
146
+ raise ArgumentError, 'invalid value for "number", the character length must be great than or equal to 4.'
154
147
  end
155
148
 
156
- pattern = Regexp.new(/^\+?[ 0-9()\.#]+$/)
157
- if number !~ pattern
158
- fail ArgumentError, "invalid value for \"number\", must conform to the pattern #{pattern}."
159
- end
149
+ pattern = Regexp.new(/^\+?[ 0-9().#]+$/)
150
+ raise ArgumentError, "invalid value for \"number\", must conform to the pattern #{pattern}." if number !~ pattern
160
151
 
161
152
  @number = number
162
153
  end
163
154
 
164
155
  # Checks equality by comparing each attribute.
165
156
  # @param [Object] Object to be compared
166
- def ==(o)
167
- return true if self.equal?(o)
168
- self.class == o.class &&
169
- number == o.number &&
170
- country == o.country &&
171
- customer_verified_at == o.customer_verified_at
157
+ def ==(other)
158
+ return true if equal?(other)
159
+
160
+ self.class == other.class &&
161
+ number == other.number &&
162
+ country == other.country &&
163
+ customer_verified_at == other.customer_verified_at
172
164
  end
173
165
 
174
166
  # @see the `==` method
175
167
  # @param [Object] Object to be compared
176
- def eql?(o)
177
- self == o
168
+ def eql?(other)
169
+ self == other
178
170
  end
179
171
 
180
172
  # Calculates hash code according to all attributes.
@@ -195,18 +187,21 @@ module MoneyKit
195
187
  # @return [Object] Returns the model itself
196
188
  def build_from_hash(attributes)
197
189
  return nil unless attributes.is_a?(Hash)
190
+
198
191
  attributes = attributes.transform_keys(&:to_sym)
199
192
  self.class.openapi_types.each_pair do |key, type|
200
193
  if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
201
- self.send("#{key}=", nil)
194
+ send("#{key}=", nil)
202
195
  elsif type =~ /\AArray<(.*)>/i
203
196
  # check to ensure the input is an array given that the attribute
204
197
  # is documented as an array but the input is not
205
198
  if attributes[self.class.attribute_map[key]].is_a?(Array)
206
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
199
+ send("#{key}=", attributes[self.class.attribute_map[key]].map do |v|
200
+ _deserialize(::Regexp.last_match(1), v)
201
+ end)
207
202
  end
208
203
  elsif !attributes[self.class.attribute_map[key]].nil?
209
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
204
+ send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
210
205
  end
211
206
  end
212
207
 
@@ -273,7 +268,7 @@ module MoneyKit
273
268
  def to_hash
274
269
  hash = {}
275
270
  self.class.attribute_map.each_pair do |attr, param|
276
- value = self.send(attr)
271
+ value = send(attr)
277
272
  if value.nil?
278
273
  is_nullable = self.class.openapi_nullable.include?(attr)
279
274
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
@@ -301,7 +296,5 @@ module MoneyKit
301
296
  value
302
297
  end
303
298
  end
304
-
305
299
  end
306
-
307
300
  end
@@ -1,30 +1,25 @@
1
- =begin
2
- #MoneyKit API
3
-
4
- #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
-
6
- The version of the OpenAPI document: 0.1.0
7
-
8
- Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.5.0
10
-
11
- =end
1
+ # #MoneyKit API
2
+ #
3
+ # No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
4
+ #
5
+ # The version of the OpenAPI document: 0.1.0
6
+ #
7
+ # Generated by: https://openapi-generator.tech
8
+ # OpenAPI Generator version: 6.5.0
9
+ #
12
10
 
13
11
  require 'date'
14
12
  require 'time'
15
13
 
16
14
  module MoneyKit
17
15
  class LinkSessionErrorForbiddenConfigResponse
18
- attr_accessor :error_code
16
+ attr_accessor :error_code, :documentation_url
19
17
 
20
18
  # Error message
21
19
  attr_accessor :error_message
22
20
 
23
- attr_accessor :documentation_url
24
-
25
21
  class EnumAttributeValidator
26
- attr_reader :datatype
27
- attr_reader :allowable_values
22
+ attr_reader :datatype, :allowable_values
28
23
 
29
24
  def initialize(datatype, allowable_values)
30
25
  @allowable_values = allowable_values.map do |value|
@@ -47,9 +42,9 @@ module MoneyKit
47
42
  # Attribute mapping from ruby-style variable name to JSON key.
48
43
  def self.attribute_map
49
44
  {
50
- :'error_code' => :'error_code',
51
- :'error_message' => :'error_message',
52
- :'documentation_url' => :'documentation_url'
45
+ 'error_code': :error_code,
46
+ 'error_message': :error_message,
47
+ 'documentation_url': :documentation_url
53
48
  }
54
49
  end
55
50
 
@@ -61,56 +56,55 @@ module MoneyKit
61
56
  # Attribute type mapping.
62
57
  def self.openapi_types
63
58
  {
64
- :'error_code' => :'String',
65
- :'error_message' => :'String',
66
- :'documentation_url' => :'String'
59
+ 'error_code': :String,
60
+ 'error_message': :String,
61
+ 'documentation_url': :String
67
62
  }
68
63
  end
69
64
 
70
65
  # List of attributes with nullable: true
71
66
  def self.openapi_nullable
72
67
  Set.new([
73
- :'documentation_url'
74
- ])
68
+ :documentation_url
69
+ ])
75
70
  end
76
71
 
77
72
  # Initializes the object
78
73
  # @param [Hash] attributes Model attributes in the form of hash
79
74
  def initialize(attributes = {})
80
- if (!attributes.is_a?(Hash))
81
- fail ArgumentError, "The input argument (attributes) must be a hash in `MoneyKit::LinkSessionErrorForbiddenConfigResponse` initialize method"
75
+ unless attributes.is_a?(Hash)
76
+ raise ArgumentError,
77
+ 'The input argument (attributes) must be a hash in `MoneyKit::LinkSessionErrorForbiddenConfigResponse` initialize method'
82
78
  end
83
79
 
84
80
  # check to see if the attribute exists and convert string to symbol for hash key
85
- attributes = attributes.each_with_object({}) { |(k, v), h|
86
- if (!self.class.attribute_map.key?(k.to_sym))
87
- fail ArgumentError, "`#{k}` is not a valid attribute in `MoneyKit::LinkSessionErrorForbiddenConfigResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
81
+ attributes = attributes.each_with_object({}) do |(k, v), h|
82
+ unless self.class.attribute_map.key?(k.to_sym)
83
+ raise ArgumentError,
84
+ "`#{k}` is not a valid attribute in `MoneyKit::LinkSessionErrorForbiddenConfigResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
88
85
  end
89
- h[k.to_sym] = v
90
- }
91
86
 
92
- if attributes.key?(:'error_code')
93
- self.error_code = attributes[:'error_code']
94
- else
95
- self.error_code = 'link_session_error.forbidden_config'
87
+ h[k.to_sym] = v
96
88
  end
97
89
 
98
- if attributes.key?(:'error_message')
99
- self.error_message = attributes[:'error_message']
100
- end
90
+ self.error_code = if attributes.key?(:error_code)
91
+ attributes[:error_code]
92
+ else
93
+ 'link_session_error.forbidden_config'
94
+ end
101
95
 
102
- if attributes.key?(:'documentation_url')
103
- self.documentation_url = attributes[:'documentation_url']
104
- end
96
+ self.error_message = attributes[:error_message] if attributes.key?(:error_message)
97
+
98
+ return unless attributes.key?(:documentation_url)
99
+
100
+ self.documentation_url = attributes[:documentation_url]
105
101
  end
106
102
 
107
103
  # Show invalid properties with the reasons. Usually used together with valid?
108
104
  # @return Array for valid properties with the reasons
109
105
  def list_invalid_properties
110
- invalid_properties = Array.new
111
- if @error_message.nil?
112
- invalid_properties.push('invalid value for "error_message", error_message cannot be nil.')
113
- end
106
+ invalid_properties = []
107
+ invalid_properties.push('invalid value for "error_message", error_message cannot be nil.') if @error_message.nil?
114
108
 
115
109
  invalid_properties
116
110
  end
@@ -118,36 +112,39 @@ module MoneyKit
118
112
  # Check to see if the all the properties in the model are valid
119
113
  # @return true if the model is valid
120
114
  def valid?
121
- error_code_validator = EnumAttributeValidator.new('String', ["link_session_error.forbidden_config"])
115
+ error_code_validator = EnumAttributeValidator.new('String', ['link_session_error.forbidden_config'])
122
116
  return false unless error_code_validator.valid?(@error_code)
123
117
  return false if @error_message.nil?
118
+
124
119
  true
125
120
  end
126
121
 
127
122
  # Custom attribute writer method checking allowed values (enum).
128
123
  # @param [Object] error_code Object to be assigned
129
124
  def error_code=(error_code)
130
- validator = EnumAttributeValidator.new('String', ["link_session_error.forbidden_config"])
125
+ validator = EnumAttributeValidator.new('String', ['link_session_error.forbidden_config'])
131
126
  unless validator.valid?(error_code)
132
- fail ArgumentError, "invalid value for \"error_code\", must be one of #{validator.allowable_values}."
127
+ raise ArgumentError, "invalid value for \"error_code\", must be one of #{validator.allowable_values}."
133
128
  end
129
+
134
130
  @error_code = error_code
135
131
  end
136
132
 
137
133
  # Checks equality by comparing each attribute.
138
134
  # @param [Object] Object to be compared
139
- def ==(o)
140
- return true if self.equal?(o)
141
- self.class == o.class &&
142
- error_code == o.error_code &&
143
- error_message == o.error_message &&
144
- documentation_url == o.documentation_url
135
+ def ==(other)
136
+ return true if equal?(other)
137
+
138
+ self.class == other.class &&
139
+ error_code == other.error_code &&
140
+ error_message == other.error_message &&
141
+ documentation_url == other.documentation_url
145
142
  end
146
143
 
147
144
  # @see the `==` method
148
145
  # @param [Object] Object to be compared
149
- def eql?(o)
150
- self == o
146
+ def eql?(other)
147
+ self == other
151
148
  end
152
149
 
153
150
  # Calculates hash code according to all attributes.
@@ -168,18 +165,21 @@ module MoneyKit
168
165
  # @return [Object] Returns the model itself
169
166
  def build_from_hash(attributes)
170
167
  return nil unless attributes.is_a?(Hash)
168
+
171
169
  attributes = attributes.transform_keys(&:to_sym)
172
170
  self.class.openapi_types.each_pair do |key, type|
173
171
  if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
174
- self.send("#{key}=", nil)
172
+ send("#{key}=", nil)
175
173
  elsif type =~ /\AArray<(.*)>/i
176
174
  # check to ensure the input is an array given that the attribute
177
175
  # is documented as an array but the input is not
178
176
  if attributes[self.class.attribute_map[key]].is_a?(Array)
179
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
177
+ send("#{key}=", attributes[self.class.attribute_map[key]].map do |v|
178
+ _deserialize(::Regexp.last_match(1), v)
179
+ end)
180
180
  end
181
181
  elsif !attributes[self.class.attribute_map[key]].nil?
182
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
182
+ send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
183
183
  end
184
184
  end
185
185
 
@@ -246,7 +246,7 @@ module MoneyKit
246
246
  def to_hash
247
247
  hash = {}
248
248
  self.class.attribute_map.each_pair do |attr, param|
249
- value = self.send(attr)
249
+ value = send(attr)
250
250
  if value.nil?
251
251
  is_nullable = self.class.openapi_nullable.include?(attr)
252
252
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
@@ -274,7 +274,5 @@ module MoneyKit
274
274
  value
275
275
  end
276
276
  end
277
-
278
277
  end
279
-
280
278
  end