jamm 1.2.1 → 1.3.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 (35) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/lib/jamm/api/api/payment_api.rb +61 -0
  4. data/lib/jamm/api/api/webhook_service_api.rb +59 -0
  5. data/lib/jamm/api/models/{v1_error.rb → apiv1_error.rb} +18 -9
  6. data/lib/jamm/api/models/v1_bank.rb +295 -0
  7. data/lib/jamm/api/models/v1_bank_assets.rb +231 -0
  8. data/lib/jamm/api/models/v1_bank_branch.rb +232 -0
  9. data/lib/jamm/api/models/v1_bank_information.rb +35 -7
  10. data/lib/jamm/api/models/v1_bank_quota.rb +243 -0
  11. data/lib/jamm/api/models/v1_bank_scheduled_maintenance_period.rb +227 -0
  12. data/lib/jamm/api/models/v1_charge_message.rb +1 -1
  13. data/lib/jamm/api/models/v1_deposit_type.rb +42 -0
  14. data/lib/jamm/api/models/v1_error_detail.rb +220 -0
  15. data/lib/jamm/api/models/v1_error_response.rb +230 -0
  16. data/lib/jamm/api/models/v1_error_type.rb +58 -0
  17. data/lib/jamm/api/models/v1_event_type.rb +2 -1
  18. data/lib/jamm/api/models/v1_get_bank_response.rb +207 -0
  19. data/lib/jamm/api/models/v1_get_branch_response.rb +207 -0
  20. data/lib/jamm/api/models/v1_get_branches_response.rb +208 -0
  21. data/lib/jamm/api/models/v1_get_major_banks_response.rb +217 -0
  22. data/lib/jamm/api/models/v1_message_response.rb +12 -7
  23. data/lib/jamm/api/models/v1_on_session_payment_data.rb +222 -0
  24. data/lib/jamm/api/models/v1_on_session_payment_error.rb +237 -0
  25. data/lib/jamm/api/models/v1_on_session_payment_error_code.rb +49 -0
  26. data/lib/jamm/api/models/v1_on_session_payment_request.rb +223 -0
  27. data/lib/jamm/api/models/v1_on_session_payment_response.rb +218 -0
  28. data/lib/jamm/api/models/v1_search_banks_response.rb +208 -0
  29. data/lib/jamm/api/models/v1_search_branches_response.rb +208 -0
  30. data/lib/jamm/api/models/v1_user_account_message.rb +223 -0
  31. data/lib/jamm/api.rb +22 -1
  32. data/lib/jamm/customer.rb +0 -2
  33. data/lib/jamm/errors.rb +27 -1
  34. data/lib/jamm/version.rb +1 -1
  35. metadata +24 -3
@@ -0,0 +1,217 @@
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
+ #
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Api
17
+ class GetMajorBanksResponse
18
+ attr_accessor :mizuho, :mufg, :smbc
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :mizuho => :mizuho,
24
+ :mufg => :mufg,
25
+ :smbc => :smbc
26
+ }
27
+ end
28
+
29
+ # Returns all the JSON keys this model knows about
30
+ def self.acceptable_attributes
31
+ attribute_map.values
32
+ end
33
+
34
+ # Attribute type mapping.
35
+ def self.openapi_types
36
+ {
37
+ :mizuho => :Bank,
38
+ :mufg => :Bank,
39
+ :smbc => :Bank
40
+ }
41
+ end
42
+
43
+ # List of attributes with nullable: true
44
+ def self.openapi_nullable
45
+ Set.new([])
46
+ end
47
+
48
+ # Initializes the object
49
+ # @param [Hash] attributes Model attributes in the form of hash
50
+ def initialize(attributes = {})
51
+ raise ArgumentError, 'The input argument (attributes) must be a hash in `Api::GetMajorBanksResponse` initialize method' unless attributes.is_a?(Hash)
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) do |(k, v), h|
55
+ raise ArgumentError, "`#{k}` is not a valid attribute in `Api::GetMajorBanksResponse`. 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)
56
+
57
+ h[k.to_sym] = v
58
+ end
59
+
60
+ self.mizuho = attributes[:mizuho] if attributes.key?(:mizuho)
61
+
62
+ self.mufg = attributes[:mufg] if attributes.key?(:mufg)
63
+
64
+ return unless attributes.key?(:smbc)
65
+
66
+ self.smbc = attributes[:smbc]
67
+ end
68
+
69
+ # Show invalid properties with the reasons. Usually used together with valid?
70
+ # @return Array for valid properties with the reasons
71
+ def list_invalid_properties
72
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
73
+ []
74
+ end
75
+
76
+ # Check to see if the all the properties in the model are valid
77
+ # @return true if the model is valid
78
+ def valid?
79
+ warn '[DEPRECATED] the `valid?` method is obsolete'
80
+ true
81
+ end
82
+
83
+ # Checks equality by comparing each attribute.
84
+ # @param [Object] Object to be compared
85
+ def ==(other)
86
+ return true if equal?(other)
87
+
88
+ self.class == other.class &&
89
+ mizuho == other.mizuho &&
90
+ mufg == other.mufg &&
91
+ smbc == other.smbc
92
+ end
93
+
94
+ # @see the `==` method
95
+ # @param [Object] Object to be compared
96
+ def eql?(other)
97
+ self == other
98
+ end
99
+
100
+ # Calculates hash code according to all attributes.
101
+ # @return [Integer] Hash code
102
+ def hash
103
+ [mizuho, mufg, smbc].hash
104
+ end
105
+
106
+ # Builds the object from hash
107
+ # @param [Hash] attributes Model attributes in the form of hash
108
+ # @return [Object] Returns the model itself
109
+ def self.build_from_hash(attributes)
110
+ return nil unless attributes.is_a?(Hash)
111
+
112
+ attributes = attributes.transform_keys(&:to_sym)
113
+ transformed_hash = {}
114
+ openapi_types.each_pair do |key, type|
115
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
116
+ transformed_hash[key.to_s] = nil
117
+ elsif type =~ /\AArray<(.*)>/i
118
+ # check to ensure the input is an array given that the attribute
119
+ # 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)
121
+ elsif !attributes[attribute_map[key]].nil?
122
+ transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
123
+ end
124
+ end
125
+ new(transformed_hash)
126
+ end
127
+
128
+ # Deserializes the data based on type
129
+ # @param string type Data type
130
+ # @param string value Value to be deserialized
131
+ # @return [Object] Deserialized data
132
+ def self._deserialize(type, value)
133
+ case type.to_sym
134
+ when :Time
135
+ Time.parse(value)
136
+ when :Date
137
+ Date.parse(value)
138
+ when :String
139
+ value.to_s
140
+ when :Integer
141
+ value.to_i
142
+ when :Float
143
+ value.to_f
144
+ when :Boolean
145
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
146
+ true
147
+ else
148
+ false
149
+ end
150
+ when :Object
151
+ # generic object (usually a Hash), return directly
152
+ value
153
+ when /\AArray<(?<inner_type>.+)>\z/
154
+ inner_type = Regexp.last_match[:inner_type]
155
+ value.map { |v| _deserialize(inner_type, v) }
156
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
157
+ k_type = Regexp.last_match[:k_type]
158
+ v_type = Regexp.last_match[:v_type]
159
+ {}.tap do |hash|
160
+ value.each do |k, v|
161
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
162
+ end
163
+ end
164
+ else # model
165
+ # models (e.g. Pet) or oneOf
166
+ klass = Api.const_get(type)
167
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
168
+ end
169
+ end
170
+
171
+ # Returns the string representation of the object
172
+ # @return [String] String presentation of the object
173
+ def to_s
174
+ to_hash.to_s
175
+ end
176
+
177
+ # to_body is an alias to to_hash (backward compatibility)
178
+ # @return [Hash] Returns the object in the form of hash
179
+ def to_body
180
+ to_hash
181
+ end
182
+
183
+ # Returns the object in the form of hash
184
+ # @return [Hash] Returns the object in the form of hash
185
+ def to_hash
186
+ hash = {}
187
+ self.class.attribute_map.each_pair do |attr, param|
188
+ value = send(attr)
189
+ if value.nil?
190
+ is_nullable = self.class.openapi_nullable.include?(attr)
191
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
192
+ end
193
+
194
+ hash[param] = _to_hash(value)
195
+ end
196
+ hash
197
+ end
198
+
199
+ # Outputs non-array value in the form of hash
200
+ # For object, use to_hash. Otherwise, just return the value
201
+ # @param [Object] value Any valid value
202
+ # @return [Hash] Returns the value in the form of hash
203
+ def _to_hash(value)
204
+ if value.is_a?(Array)
205
+ value.compact.map { |v| _to_hash(v) }
206
+ elsif value.is_a?(Hash)
207
+ {}.tap do |hash|
208
+ value.each { |k, v| hash[k] = _to_hash(v) }
209
+ end
210
+ elsif value.respond_to? :to_hash
211
+ value.to_hash
212
+ else
213
+ value
214
+ end
215
+ end
216
+ end
217
+ end
@@ -15,14 +15,15 @@ require 'time'
15
15
 
16
16
  module Api
17
17
  class MessageResponse
18
- attr_accessor :merchant_webhook_message, :charge_message, :contract_message
18
+ attr_accessor :merchant_webhook_message, :charge_message, :contract_message, :user_account_message
19
19
 
20
20
  # Attribute mapping from ruby-style variable name to JSON key.
21
21
  def self.attribute_map
22
22
  {
23
23
  :merchant_webhook_message => :merchantWebhookMessage,
24
24
  :charge_message => :chargeMessage,
25
- :contract_message => :contractMessage
25
+ :contract_message => :contractMessage,
26
+ :user_account_message => :userAccountMessage
26
27
  }
27
28
  end
28
29
 
@@ -36,7 +37,8 @@ module Api
36
37
  {
37
38
  :merchant_webhook_message => :MerchantWebhookMessage,
38
39
  :charge_message => :ChargeMessage,
39
- :contract_message => :ContractMessage
40
+ :contract_message => :ContractMessage,
41
+ :user_account_message => :UserAccountMessage
40
42
  }
41
43
  end
42
44
 
@@ -61,9 +63,11 @@ module Api
61
63
 
62
64
  self.charge_message = attributes[:charge_message] if attributes.key?(:charge_message)
63
65
 
64
- return unless attributes.key?(:contract_message)
66
+ self.contract_message = attributes[:contract_message] if attributes.key?(:contract_message)
65
67
 
66
- self.contract_message = attributes[:contract_message]
68
+ return unless attributes.key?(:user_account_message)
69
+
70
+ self.user_account_message = attributes[:user_account_message]
67
71
  end
68
72
 
69
73
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -88,7 +92,8 @@ module Api
88
92
  self.class == other.class &&
89
93
  merchant_webhook_message == other.merchant_webhook_message &&
90
94
  charge_message == other.charge_message &&
91
- contract_message == other.contract_message
95
+ contract_message == other.contract_message &&
96
+ user_account_message == other.user_account_message
92
97
  end
93
98
 
94
99
  # @see the `==` method
@@ -100,7 +105,7 @@ module Api
100
105
  # Calculates hash code according to all attributes.
101
106
  # @return [Integer] Hash code
102
107
  def hash
103
- [merchant_webhook_message, charge_message, contract_message].hash
108
+ [merchant_webhook_message, charge_message, contract_message, user_account_message].hash
104
109
  end
105
110
 
106
111
  # Builds the object from hash
@@ -0,0 +1,222 @@
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
+ #
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Api
17
+ class OnSessionPaymentData
18
+ attr_accessor :contract, :charge, :customer, :payment_link
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :contract => :contract,
24
+ :charge => :charge,
25
+ :customer => :customer,
26
+ :payment_link => :paymentLink
27
+ }
28
+ end
29
+
30
+ # Returns all the JSON keys this model knows about
31
+ def self.acceptable_attributes
32
+ attribute_map.values
33
+ end
34
+
35
+ # Attribute type mapping.
36
+ def self.openapi_types
37
+ {
38
+ :contract => :Contract,
39
+ :charge => :Charge,
40
+ :customer => :Customer,
41
+ :payment_link => :PaymentLink
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([])
48
+ end
49
+
50
+ # Initializes the object
51
+ # @param [Hash] attributes Model attributes in the form of hash
52
+ def initialize(attributes = {})
53
+ raise ArgumentError, 'The input argument (attributes) must be a hash in `Api::OnSessionPaymentData` initialize method' unless attributes.is_a?(Hash)
54
+
55
+ # check to see if the attribute exists and convert string to symbol for hash key
56
+ attributes = attributes.each_with_object({}) do |(k, v), h|
57
+ raise ArgumentError, "`#{k}` is not a valid attribute in `Api::OnSessionPaymentData`. 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)
58
+
59
+ h[k.to_sym] = v
60
+ end
61
+
62
+ self.contract = attributes[:contract] if attributes.key?(:contract)
63
+
64
+ self.charge = attributes[:charge] if attributes.key?(:charge)
65
+
66
+ self.customer = attributes[:customer] if attributes.key?(:customer)
67
+
68
+ return unless attributes.key?(:payment_link)
69
+
70
+ self.payment_link = attributes[:payment_link]
71
+ end
72
+
73
+ # Show invalid properties with the reasons. Usually used together with valid?
74
+ # @return Array for valid properties with the reasons
75
+ def list_invalid_properties
76
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
+ []
78
+ end
79
+
80
+ # Check to see if the all the properties in the model are valid
81
+ # @return true if the model is valid
82
+ def valid?
83
+ warn '[DEPRECATED] the `valid?` method is obsolete'
84
+ true
85
+ end
86
+
87
+ # Checks equality by comparing each attribute.
88
+ # @param [Object] Object to be compared
89
+ def ==(other)
90
+ return true if equal?(other)
91
+
92
+ self.class == other.class &&
93
+ contract == other.contract &&
94
+ charge == other.charge &&
95
+ customer == other.customer &&
96
+ payment_link == other.payment_link
97
+ end
98
+
99
+ # @see the `==` method
100
+ # @param [Object] Object to be compared
101
+ def eql?(other)
102
+ self == other
103
+ end
104
+
105
+ # Calculates hash code according to all attributes.
106
+ # @return [Integer] Hash code
107
+ def hash
108
+ [contract, charge, customer, payment_link].hash
109
+ end
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def self.build_from_hash(attributes)
115
+ return nil unless attributes.is_a?(Hash)
116
+
117
+ attributes = attributes.transform_keys(&:to_sym)
118
+ transformed_hash = {}
119
+ openapi_types.each_pair do |key, type|
120
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
121
+ transformed_hash[key.to_s] = nil
122
+ elsif type =~ /\AArray<(.*)>/i
123
+ # check to ensure the input is an array given that the attribute
124
+ # is documented as an array but the input is not
125
+ 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)
126
+ elsif !attributes[attribute_map[key]].nil?
127
+ transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
128
+ end
129
+ end
130
+ new(transformed_hash)
131
+ end
132
+
133
+ # Deserializes the data based on type
134
+ # @param string type Data type
135
+ # @param string value Value to be deserialized
136
+ # @return [Object] Deserialized data
137
+ def self._deserialize(type, value)
138
+ case type.to_sym
139
+ when :Time
140
+ Time.parse(value)
141
+ when :Date
142
+ Date.parse(value)
143
+ when :String
144
+ value.to_s
145
+ when :Integer
146
+ value.to_i
147
+ when :Float
148
+ value.to_f
149
+ when :Boolean
150
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
151
+ true
152
+ else
153
+ false
154
+ end
155
+ when :Object
156
+ # generic object (usually a Hash), return directly
157
+ value
158
+ when /\AArray<(?<inner_type>.+)>\z/
159
+ inner_type = Regexp.last_match[:inner_type]
160
+ value.map { |v| _deserialize(inner_type, v) }
161
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
162
+ k_type = Regexp.last_match[:k_type]
163
+ v_type = Regexp.last_match[:v_type]
164
+ {}.tap do |hash|
165
+ value.each do |k, v|
166
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
167
+ end
168
+ end
169
+ else # model
170
+ # models (e.g. Pet) or oneOf
171
+ klass = Api.const_get(type)
172
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
173
+ end
174
+ end
175
+
176
+ # Returns the string representation of the object
177
+ # @return [String] String presentation of the object
178
+ def to_s
179
+ to_hash.to_s
180
+ end
181
+
182
+ # to_body is an alias to to_hash (backward compatibility)
183
+ # @return [Hash] Returns the object in the form of hash
184
+ def to_body
185
+ to_hash
186
+ end
187
+
188
+ # Returns the object in the form of hash
189
+ # @return [Hash] Returns the object in the form of hash
190
+ def to_hash
191
+ hash = {}
192
+ self.class.attribute_map.each_pair do |attr, param|
193
+ value = send(attr)
194
+ if value.nil?
195
+ is_nullable = self.class.openapi_nullable.include?(attr)
196
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
197
+ end
198
+
199
+ hash[param] = _to_hash(value)
200
+ end
201
+ hash
202
+ end
203
+
204
+ # Outputs non-array value in the form of hash
205
+ # For object, use to_hash. Otherwise, just return the value
206
+ # @param [Object] value Any valid value
207
+ # @return [Hash] Returns the value in the form of hash
208
+ def _to_hash(value)
209
+ if value.is_a?(Array)
210
+ value.compact.map { |v| _to_hash(v) }
211
+ elsif value.is_a?(Hash)
212
+ {}.tap do |hash|
213
+ value.each { |k, v| hash[k] = _to_hash(v) }
214
+ end
215
+ elsif value.respond_to? :to_hash
216
+ value.to_hash
217
+ else
218
+ value
219
+ end
220
+ end
221
+ end
222
+ end