jamm 1.2.2 → 1.4.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 (84) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/jamm/api/api/customer_api.rb +82 -52
  4. data/lib/jamm/api/api/healthcheck_api.rb +18 -15
  5. data/lib/jamm/api/api/payment_api.rb +113 -62
  6. data/lib/jamm/api/api/webhook_service_api.rb +91 -19
  7. data/lib/jamm/api/api_client.rb +74 -66
  8. data/lib/jamm/api/api_error.rb +16 -16
  9. data/lib/jamm/api/configuration.rb +42 -34
  10. data/lib/jamm/api/models/apiv1_error.rb +238 -0
  11. data/lib/jamm/api/models/apiv1_status.rb +57 -47
  12. data/lib/jamm/api/models/customer_service_update_customer_body.rb +107 -69
  13. data/lib/jamm/api/models/googlerpc_status.rb +61 -45
  14. data/lib/jamm/api/models/protobuf_any.rb +42 -35
  15. data/lib/jamm/api/models/v1_add_charge_request.rb +59 -44
  16. data/lib/jamm/api/models/v1_add_charge_response.rb +59 -44
  17. data/lib/jamm/api/models/v1_bank.rb +350 -0
  18. data/lib/jamm/api/models/v1_bank_assets.rb +244 -0
  19. data/lib/jamm/api/models/v1_bank_branch.rb +259 -0
  20. data/lib/jamm/api/models/v1_bank_information.rb +71 -51
  21. data/lib/jamm/api/models/v1_bank_quota.rb +278 -0
  22. data/lib/jamm/api/models/v1_bank_scheduled_maintenance_period.rb +250 -0
  23. data/lib/jamm/api/models/v1_buyer.rb +104 -76
  24. data/lib/jamm/api/models/v1_charge.rb +67 -52
  25. data/lib/jamm/api/models/v1_charge_message.rb +151 -93
  26. data/lib/jamm/api/models/v1_charge_message_status.rb +17 -18
  27. data/lib/jamm/api/models/v1_charge_result.rb +152 -93
  28. data/lib/jamm/api/models/v1_contract.rb +64 -52
  29. data/lib/jamm/api/models/v1_contract_message.rb +67 -48
  30. data/lib/jamm/api/models/v1_contract_status.rb +20 -21
  31. data/lib/jamm/api/models/v1_create_contract_with_charge_request.rb +59 -44
  32. data/lib/jamm/api/models/v1_create_contract_with_charge_response.rb +67 -48
  33. data/lib/jamm/api/models/v1_create_contract_without_charge_request.rb +51 -40
  34. data/lib/jamm/api/models/v1_create_contract_without_charge_response.rb +59 -44
  35. data/lib/jamm/api/models/v1_create_customer_request.rb +42 -35
  36. data/lib/jamm/api/models/v1_create_customer_response.rb +42 -35
  37. data/lib/jamm/api/models/v1_customer.rb +91 -60
  38. data/lib/jamm/api/models/v1_delete_customer_response.rb +42 -35
  39. data/lib/jamm/api/models/v1_deposit_type.rb +14 -15
  40. data/lib/jamm/api/models/v1_error_detail.rb +233 -0
  41. data/lib/jamm/api/models/v1_error_response.rb +238 -0
  42. data/lib/jamm/api/models/v1_error_type.rb +57 -0
  43. data/lib/jamm/api/models/v1_event_type.rb +20 -21
  44. data/lib/jamm/api/models/{v1_error.rb → v1_get_bank_response.rb} +45 -48
  45. data/lib/jamm/api/models/v1_get_branch_response.rb +214 -0
  46. data/lib/jamm/api/models/v1_get_branches_response.rb +216 -0
  47. data/lib/jamm/api/models/v1_get_charge_response.rb +51 -40
  48. data/lib/jamm/api/models/v1_get_charges_response.rb +60 -45
  49. data/lib/jamm/api/models/v1_get_contract_response.rb +51 -40
  50. data/lib/jamm/api/models/v1_get_customer_response.rb +42 -35
  51. data/lib/jamm/api/models/v1_get_major_banks_response.rb +232 -0
  52. data/lib/jamm/api/models/v1_initial_charge.rb +61 -48
  53. data/lib/jamm/api/models/v1_kyc_status.rb +16 -17
  54. data/lib/jamm/api/models/v1_merchant.rb +51 -40
  55. data/lib/jamm/api/models/v1_merchant_customer.rb +51 -40
  56. data/lib/jamm/api/models/v1_merchant_webhook_message.rb +75 -57
  57. data/lib/jamm/api/models/v1_message_response.rb +67 -48
  58. data/lib/jamm/api/models/v1_off_session_payment_request.rb +51 -40
  59. data/lib/jamm/api/models/v1_off_session_payment_response.rb +51 -40
  60. data/lib/jamm/api/models/v1_on_session_payment_data.rb +67 -48
  61. data/lib/jamm/api/models/v1_on_session_payment_error.rb +55 -45
  62. data/lib/jamm/api/models/v1_on_session_payment_error_code.rb +21 -22
  63. data/lib/jamm/api/models/v1_on_session_payment_request.rb +67 -48
  64. data/lib/jamm/api/models/v1_on_session_payment_response.rb +59 -44
  65. data/lib/jamm/api/models/v1_pagination.rb +51 -40
  66. data/lib/jamm/api/models/v1_payment_authorization_status.rb +14 -15
  67. data/lib/jamm/api/models/v1_payment_link.rb +57 -44
  68. data/lib/jamm/api/models/v1_ping_response.rb +42 -35
  69. data/lib/jamm/api/models/v1_search_banks_response.rb +216 -0
  70. data/lib/jamm/api/models/v1_search_branches_response.rb +216 -0
  71. data/lib/jamm/api/models/v1_update_customer_response.rb +42 -35
  72. data/lib/jamm/api/models/v1_url.rb +48 -39
  73. data/lib/jamm/api/models/v1_user_account_message.rb +67 -48
  74. data/lib/jamm/api/models/v1_withdraw_request.rb +51 -40
  75. data/lib/jamm/api/models/v1_withdraw_response.rb +51 -40
  76. data/lib/jamm/api/version.rb +11 -11
  77. data/lib/jamm/api.rb +25 -11
  78. data/lib/jamm/charge.rb +12 -0
  79. data/lib/jamm/deprecation.rb +13 -0
  80. data/lib/jamm/errors.rb +27 -1
  81. data/lib/jamm/payment.rb +61 -0
  82. data/lib/jamm/version.rb +1 -1
  83. data/lib/jamm.rb +2 -0
  84. metadata +19 -3
@@ -0,0 +1,238 @@
1
+ =begin
2
+ #Jamm API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.9.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Api
17
+ class ErrorResponse
18
+ attr_accessor :error_type
19
+
20
+ class EnumAttributeValidator
21
+ attr_reader :datatype
22
+ attr_reader :allowable_values
23
+
24
+ def initialize(datatype, allowable_values)
25
+ @allowable_values = allowable_values.map do |value|
26
+ case datatype.to_s
27
+ when /Integer/i
28
+ value.to_i
29
+ when /Float/i
30
+ value.to_f
31
+ else
32
+ value
33
+ end
34
+ end
35
+ end
36
+
37
+ def valid?(value)
38
+ !value || allowable_values.include?(value)
39
+ end
40
+ end
41
+
42
+ # Attribute mapping from ruby-style variable name to JSON key.
43
+ def self.attribute_map
44
+ {
45
+ :'error_type' => :'errorType'
46
+ }
47
+ end
48
+
49
+ # Returns all the JSON keys this model knows about
50
+ def self.acceptable_attributes
51
+ attribute_map.values
52
+ end
53
+
54
+ # Attribute type mapping.
55
+ def self.openapi_types
56
+ {
57
+ :'error_type' => :'ErrorType'
58
+ }
59
+ end
60
+
61
+ # List of attributes with nullable: true
62
+ def self.openapi_nullable
63
+ Set.new([
64
+ ])
65
+ end
66
+
67
+ # Initializes the object
68
+ # @param [Hash] attributes Model attributes in the form of hash
69
+ def initialize(attributes = {})
70
+ if (!attributes.is_a?(Hash))
71
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Api::ErrorResponse` initialize method"
72
+ end
73
+
74
+ # check to see if the attribute exists and convert string to symbol for hash key
75
+ attributes = attributes.each_with_object({}) { |(k, v), h|
76
+ if (!self.class.attribute_map.key?(k.to_sym))
77
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Api::ErrorResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
78
+ end
79
+ h[k.to_sym] = v
80
+ }
81
+
82
+ if attributes.key?(:'error_type')
83
+ self.error_type = attributes[:'error_type']
84
+ else
85
+ self.error_type = 'ERROR_TYPE_UNSPECIFIED'
86
+ end
87
+ end
88
+
89
+ # Show invalid properties with the reasons. Usually used together with valid?
90
+ # @return Array for valid properties with the reasons
91
+ def list_invalid_properties
92
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
93
+ invalid_properties = Array.new
94
+ invalid_properties
95
+ end
96
+
97
+ # Check to see if the all the properties in the model are valid
98
+ # @return true if the model is valid
99
+ def valid?
100
+ warn '[DEPRECATED] the `valid?` method is obsolete'
101
+ true
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ error_type == o.error_type
110
+ end
111
+
112
+ # @see the `==` method
113
+ # @param [Object] Object to be compared
114
+ def eql?(o)
115
+ self == o
116
+ end
117
+
118
+ # Calculates hash code according to all attributes.
119
+ # @return [Integer] Hash code
120
+ def hash
121
+ [error_type].hash
122
+ end
123
+
124
+ # Builds the object from hash
125
+ # @param [Hash] attributes Model attributes in the form of hash
126
+ # @return [Object] Returns the model itself
127
+ def self.build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ attributes = attributes.transform_keys(&:to_sym)
130
+ transformed_hash = {}
131
+ openapi_types.each_pair do |key, type|
132
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
133
+ transformed_hash["#{key}"] = nil
134
+ elsif type =~ /\AArray<(.*)>/i
135
+ # check to ensure the input is an array given that the attribute
136
+ # is documented as an array but the input is not
137
+ if attributes[attribute_map[key]].is_a?(Array)
138
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
139
+ end
140
+ elsif !attributes[attribute_map[key]].nil?
141
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
142
+ end
143
+ end
144
+ new(transformed_hash)
145
+ end
146
+
147
+ # Deserializes the data based on type
148
+ # @param string type Data type
149
+ # @param string value Value to be deserialized
150
+ # @return [Object] Deserialized data
151
+ def self._deserialize(type, value)
152
+ case type.to_sym
153
+ when :Time
154
+ Time.parse(value)
155
+ when :Date
156
+ Date.parse(value)
157
+ when :String
158
+ value.to_s
159
+ when :Integer
160
+ value.to_i
161
+ when :Float
162
+ value.to_f
163
+ when :Boolean
164
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
165
+ true
166
+ else
167
+ false
168
+ end
169
+ when :Object
170
+ # generic object (usually a Hash), return directly
171
+ value
172
+ when /\AArray<(?<inner_type>.+)>\z/
173
+ inner_type = Regexp.last_match[:inner_type]
174
+ value.map { |v| _deserialize(inner_type, v) }
175
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
176
+ k_type = Regexp.last_match[:k_type]
177
+ v_type = Regexp.last_match[:v_type]
178
+ {}.tap do |hash|
179
+ value.each do |k, v|
180
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
181
+ end
182
+ end
183
+ else # model
184
+ # models (e.g. Pet) or oneOf
185
+ klass = Api.const_get(type)
186
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
187
+ end
188
+ end
189
+
190
+ # Returns the string representation of the object
191
+ # @return [String] String presentation of the object
192
+ def to_s
193
+ to_hash.to_s
194
+ end
195
+
196
+ # to_body is an alias to to_hash (backward compatibility)
197
+ # @return [Hash] Returns the object in the form of hash
198
+ def to_body
199
+ to_hash
200
+ end
201
+
202
+ # Returns the object in the form of hash
203
+ # @return [Hash] Returns the object in the form of hash
204
+ def to_hash
205
+ hash = {}
206
+ self.class.attribute_map.each_pair do |attr, param|
207
+ value = self.send(attr)
208
+ if value.nil?
209
+ is_nullable = self.class.openapi_nullable.include?(attr)
210
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
211
+ end
212
+
213
+ hash[param] = _to_hash(value)
214
+ end
215
+ hash
216
+ end
217
+
218
+ # Outputs non-array value in the form of hash
219
+ # For object, use to_hash. Otherwise, just return the value
220
+ # @param [Object] value Any valid value
221
+ # @return [Hash] Returns the value in the form of hash
222
+ def _to_hash(value)
223
+ if value.is_a?(Array)
224
+ value.compact.map { |v| _to_hash(v) }
225
+ elsif value.is_a?(Hash)
226
+ {}.tap do |hash|
227
+ value.each { |k, v| hash[k] = _to_hash(v) }
228
+ end
229
+ elsif value.respond_to? :to_hash
230
+ value.to_hash
231
+ else
232
+ value
233
+ end
234
+ end
235
+
236
+ end
237
+
238
+ end
@@ -0,0 +1,57 @@
1
+ =begin
2
+ #Jamm API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.9.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Api
17
+ class ErrorType
18
+ UNSPECIFIED = "ERROR_TYPE_UNSPECIFIED".freeze
19
+ AUTH_FAILED = "ERROR_TYPE_AUTH_FAILED".freeze
20
+ AUTH_REJECTED = "ERROR_TYPE_AUTH_REJECTED".freeze
21
+ ACCOUNT_CREATION_FAILED = "ERROR_TYPE_ACCOUNT_CREATION_FAILED".freeze
22
+ ACCOUNT_MODIFICATION_FAILED = "ERROR_TYPE_ACCOUNT_MODIFICATION_FAILED".freeze
23
+ ACCOUNT_DELETION_FAILED = "ERROR_TYPE_ACCOUNT_DELETION_FAILED".freeze
24
+ ACCOUNT_BANK_REGISTRATION_FAILED = "ERROR_TYPE_ACCOUNT_BANK_REGISTRATION_FAILED".freeze
25
+ KYC_REJECTED = "ERROR_TYPE_KYC_REJECTED".freeze
26
+ NOTIFICATION_WEBHOOK_FAILED = "ERROR_TYPE_NOTIFICATION_WEBHOOK_FAILED".freeze
27
+ NOTIFICATION_EMAIL_FAILED = "ERROR_TYPE_NOTIFICATION_EMAIL_FAILED".freeze
28
+ NOTIFICATION_SMS_FAILED = "ERROR_TYPE_NOTIFICATION_SMS_FAILED".freeze
29
+ PAYMENT_GATEWAY_UNAVAILABLE = "ERROR_TYPE_PAYMENT_GATEWAY_UNAVAILABLE".freeze
30
+ PAYMENT_GATEWAY_FAILED = "ERROR_TYPE_PAYMENT_GATEWAY_FAILED".freeze
31
+ PAYMENT_VALIDATION_FAILED = "ERROR_TYPE_PAYMENT_VALIDATION_FAILED".freeze
32
+ PAYMENT_CHARGE_FAILED = "ERROR_TYPE_PAYMENT_CHARGE_FAILED".freeze
33
+ PAYMENT_CHARGE_REJECTED = "ERROR_TYPE_PAYMENT_CHARGE_REJECTED".freeze
34
+ PAYMENT_CHARGE_OVER_LIMIT = "ERROR_TYPE_PAYMENT_CHARGE_OVER_LIMIT".freeze
35
+ PAYMENT_CHARGE_SUBSCRIPTION_EXPIRED = "ERROR_TYPE_PAYMENT_CHARGE_SUBSCRIPTION_EXPIRED".freeze
36
+ PAYMENT_LINK_EXPIRED = "ERROR_TYPE_PAYMENT_LINK_EXPIRED".freeze
37
+
38
+ def self.all_vars
39
+ @all_vars ||= [UNSPECIFIED, AUTH_FAILED, AUTH_REJECTED, ACCOUNT_CREATION_FAILED, ACCOUNT_MODIFICATION_FAILED, ACCOUNT_DELETION_FAILED, ACCOUNT_BANK_REGISTRATION_FAILED, KYC_REJECTED, NOTIFICATION_WEBHOOK_FAILED, NOTIFICATION_EMAIL_FAILED, NOTIFICATION_SMS_FAILED, PAYMENT_GATEWAY_UNAVAILABLE, PAYMENT_GATEWAY_FAILED, PAYMENT_VALIDATION_FAILED, PAYMENT_CHARGE_FAILED, PAYMENT_CHARGE_REJECTED, PAYMENT_CHARGE_OVER_LIMIT, PAYMENT_CHARGE_SUBSCRIPTION_EXPIRED, PAYMENT_LINK_EXPIRED].freeze
40
+ end
41
+
42
+ # Builds the enum from string
43
+ # @param [String] The enum value in the form of the string
44
+ # @return [String] The enum value
45
+ def self.build_from_hash(value)
46
+ new.build_from_hash(value)
47
+ end
48
+
49
+ # Builds the enum from string
50
+ # @param [String] The enum value in the form of the string
51
+ # @return [String] The enum value
52
+ def build_from_hash(value)
53
+ return value if ErrorType.all_vars.include?(value)
54
+ raise "Invalid ENUM value #{value} for class #ErrorType"
55
+ end
56
+ end
57
+ end
@@ -1,29 +1,29 @@
1
- # frozen_string_literal: true
2
-
3
- # #Jamm API
4
- #
5
- # No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
- #
7
- # The version of the OpenAPI document: 1.0
8
- #
9
- # Generated by: https://openapi-generator.tech
10
- # Generator version: 7.9.0
11
- #
1
+ =begin
2
+ #Jamm API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.9.0
10
+
11
+ =end
12
12
 
13
13
  require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Api
17
17
  class EventType
18
- UNSPECIFIED = 'EVENT_TYPE_UNSPECIFIED'
19
- CHARGE_CREATED = 'EVENT_TYPE_CHARGE_CREATED'
20
- CHARGE_UPDATED = 'EVENT_TYPE_CHARGE_UPDATED'
21
- CHARGE_SUCCESS = 'EVENT_TYPE_CHARGE_SUCCESS'
22
- CHARGE_FAIL = 'EVENT_TYPE_CHARGE_FAIL'
23
- CHARGE_CANCEL = 'EVENT_TYPE_CHARGE_CANCEL'
24
- CONTRACT_ACTIVATED = 'EVENT_TYPE_CONTRACT_ACTIVATED'
25
- USER_ACCOUNT_DELETED = 'EVENT_TYPE_USER_ACCOUNT_DELETED'
26
- TESTING = 'EVENT_TYPE_TESTING'
18
+ UNSPECIFIED = "EVENT_TYPE_UNSPECIFIED".freeze
19
+ CHARGE_CREATED = "EVENT_TYPE_CHARGE_CREATED".freeze
20
+ CHARGE_UPDATED = "EVENT_TYPE_CHARGE_UPDATED".freeze
21
+ CHARGE_SUCCESS = "EVENT_TYPE_CHARGE_SUCCESS".freeze
22
+ CHARGE_FAIL = "EVENT_TYPE_CHARGE_FAIL".freeze
23
+ CHARGE_CANCEL = "EVENT_TYPE_CHARGE_CANCEL".freeze
24
+ CONTRACT_ACTIVATED = "EVENT_TYPE_CONTRACT_ACTIVATED".freeze
25
+ USER_ACCOUNT_DELETED = "EVENT_TYPE_USER_ACCOUNT_DELETED".freeze
26
+ TESTING = "EVENT_TYPE_TESTING".freeze
27
27
 
28
28
  def self.all_vars
29
29
  @all_vars ||= [UNSPECIFIED, CHARGE_CREATED, CHARGE_UPDATED, CHARGE_SUCCESS, CHARGE_FAIL, CHARGE_CANCEL, CONTRACT_ACTIVATED, USER_ACCOUNT_DELETED, TESTING].freeze
@@ -41,7 +41,6 @@ module Api
41
41
  # @return [String] The enum value
42
42
  def build_from_hash(value)
43
43
  return value if EventType.all_vars.include?(value)
44
-
45
44
  raise "Invalid ENUM value #{value} for class #EventType"
46
45
  end
47
46
  end
@@ -1,32 +1,26 @@
1
- # frozen_string_literal: true
2
-
3
- # #Jamm API
4
- #
5
- # No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
- #
7
- # The version of the OpenAPI document: 1.0
8
- #
9
- # Generated by: https://openapi-generator.tech
10
- # Generator version: 7.9.0
11
- #
1
+ =begin
2
+ #Jamm API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 1.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.9.0
10
+
11
+ =end
12
12
 
13
13
  require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Api
17
- # Generic error type.
18
- class Error
19
- # Jamm defined error code.
20
- attr_accessor :code
21
-
22
- # Human readable error message.
23
- attr_accessor :message
17
+ class GetBankResponse
18
+ attr_accessor :bank
24
19
 
25
20
  # Attribute mapping from ruby-style variable name to JSON key.
26
21
  def self.attribute_map
27
22
  {
28
- :code => :code,
29
- :message => :message
23
+ :'bank' => :'bank'
30
24
  }
31
25
  end
32
26
 
@@ -38,40 +32,42 @@ module Api
38
32
  # Attribute type mapping.
39
33
  def self.openapi_types
40
34
  {
41
- :code => :String,
42
- :message => :String
35
+ :'bank' => :'Bank'
43
36
  }
44
37
  end
45
38
 
46
39
  # List of attributes with nullable: true
47
40
  def self.openapi_nullable
48
- Set.new([])
41
+ Set.new([
42
+ ])
49
43
  end
50
44
 
51
45
  # Initializes the object
52
46
  # @param [Hash] attributes Model attributes in the form of hash
53
47
  def initialize(attributes = {})
54
- raise ArgumentError, 'The input argument (attributes) must be a hash in `Api::Error` initialize method' unless attributes.is_a?(Hash)
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Api::GetBankResponse` initialize method"
50
+ end
55
51
 
56
52
  # check to see if the attribute exists and convert string to symbol for hash key
57
- attributes = attributes.each_with_object({}) do |(k, v), h|
58
- raise ArgumentError, "`#{k}` is not a valid attribute in `Api::Error`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect unless self.class.attribute_map.key?(k.to_sym)
59
-
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Api::GetBankResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
60
57
  h[k.to_sym] = v
61
- end
62
-
63
- self.code = attributes[:code] if attributes.key?(:code)
64
-
65
- return unless attributes.key?(:message)
58
+ }
66
59
 
67
- self.message = attributes[:message]
60
+ if attributes.key?(:'bank')
61
+ self.bank = attributes[:'bank']
62
+ end
68
63
  end
69
64
 
70
65
  # Show invalid properties with the reasons. Usually used together with valid?
71
66
  # @return Array for valid properties with the reasons
72
67
  def list_invalid_properties
73
68
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
74
- []
69
+ invalid_properties = Array.new
70
+ invalid_properties
75
71
  end
76
72
 
77
73
  # Check to see if the all the properties in the model are valid
@@ -83,24 +79,22 @@ module Api
83
79
 
84
80
  # Checks equality by comparing each attribute.
85
81
  # @param [Object] Object to be compared
86
- def ==(other)
87
- return true if equal?(other)
88
-
89
- self.class == other.class &&
90
- code == other.code &&
91
- message == other.message
82
+ def ==(o)
83
+ return true if self.equal?(o)
84
+ self.class == o.class &&
85
+ bank == o.bank
92
86
  end
93
87
 
94
88
  # @see the `==` method
95
89
  # @param [Object] Object to be compared
96
- def eql?(other)
97
- self == other
90
+ def eql?(o)
91
+ self == o
98
92
  end
99
93
 
100
94
  # Calculates hash code according to all attributes.
101
95
  # @return [Integer] Hash code
102
96
  def hash
103
- [code, message].hash
97
+ [bank].hash
104
98
  end
105
99
 
106
100
  # Builds the object from hash
@@ -108,18 +102,19 @@ module Api
108
102
  # @return [Object] Returns the model itself
109
103
  def self.build_from_hash(attributes)
110
104
  return nil unless attributes.is_a?(Hash)
111
-
112
105
  attributes = attributes.transform_keys(&:to_sym)
113
106
  transformed_hash = {}
114
107
  openapi_types.each_pair do |key, type|
115
108
  if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
116
- transformed_hash[key.to_s] = nil
109
+ transformed_hash["#{key}"] = nil
117
110
  elsif type =~ /\AArray<(.*)>/i
118
111
  # check to ensure the input is an array given that the attribute
119
112
  # is documented as an array but the input is not
120
- transformed_hash[key.to_s] = attributes[attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) } if attributes[attribute_map[key]].is_a?(Array)
113
+ if attributes[attribute_map[key]].is_a?(Array)
114
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
115
+ end
121
116
  elsif !attributes[attribute_map[key]].nil?
122
- transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
117
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
123
118
  end
124
119
  end
125
120
  new(transformed_hash)
@@ -185,7 +180,7 @@ module Api
185
180
  def to_hash
186
181
  hash = {}
187
182
  self.class.attribute_map.each_pair do |attr, param|
188
- value = send(attr)
183
+ value = self.send(attr)
189
184
  if value.nil?
190
185
  is_nullable = self.class.openapi_nullable.include?(attr)
191
186
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
@@ -213,5 +208,7 @@ module Api
213
208
  value
214
209
  end
215
210
  end
211
+
216
212
  end
213
+
217
214
  end