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,231 @@
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 BankAssets
18
+ attr_accessor :bank_code
19
+
20
+ # URL to the bank logo in small size. Fallback to default placeholder if bank logo is not available. The image format is web/iOS/Android compatible.
21
+ attr_accessor :logo_url_large
22
+
23
+ # URL to the bank logo in medium size. Fallback to default placeholder if bank logo is not available. The image format is web/iOS/Android compatible.
24
+ attr_accessor :logo_url_medium
25
+
26
+ # Contains URL to the terms of service of the bank. See Figma for more information: https://www.figma.com/design/7cabcqjzvKl9IwzvJCuQEW/Jamm-%CE%B2-UI-design?node-id=174-10898&t=oyEUrdVtFOMV9xut-4
27
+ attr_accessor :terms_url
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+ :bank_code => :bankCode,
33
+ :logo_url_large => :logoUrlLarge,
34
+ :logo_url_medium => :logoUrlMedium,
35
+ :terms_url => :termsUrl
36
+ }
37
+ end
38
+
39
+ # Returns all the JSON keys this model knows about
40
+ def self.acceptable_attributes
41
+ attribute_map.values
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :bank_code => :String,
48
+ :logo_url_large => :String,
49
+ :logo_url_medium => :String,
50
+ :terms_url => :String
51
+ }
52
+ end
53
+
54
+ # List of attributes with nullable: true
55
+ def self.openapi_nullable
56
+ Set.new([])
57
+ end
58
+
59
+ # Initializes the object
60
+ # @param [Hash] attributes Model attributes in the form of hash
61
+ def initialize(attributes = {})
62
+ raise ArgumentError, 'The input argument (attributes) must be a hash in `Api::BankAssets` initialize method' unless attributes.is_a?(Hash)
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) do |(k, v), h|
66
+ raise ArgumentError, "`#{k}` is not a valid attribute in `Api::BankAssets`. 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)
67
+
68
+ h[k.to_sym] = v
69
+ end
70
+
71
+ self.bank_code = attributes[:bank_code] if attributes.key?(:bank_code)
72
+
73
+ self.logo_url_large = attributes[:logo_url_large] if attributes.key?(:logo_url_large)
74
+
75
+ self.logo_url_medium = attributes[:logo_url_medium] if attributes.key?(:logo_url_medium)
76
+
77
+ return unless attributes.key?(:terms_url)
78
+
79
+ self.terms_url = attributes[:terms_url]
80
+ end
81
+
82
+ # Show invalid properties with the reasons. Usually used together with valid?
83
+ # @return Array for valid properties with the reasons
84
+ def list_invalid_properties
85
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
86
+ []
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ warn '[DEPRECATED] the `valid?` method is obsolete'
93
+ true
94
+ end
95
+
96
+ # Checks equality by comparing each attribute.
97
+ # @param [Object] Object to be compared
98
+ def ==(other)
99
+ return true if equal?(other)
100
+
101
+ self.class == other.class &&
102
+ bank_code == other.bank_code &&
103
+ logo_url_large == other.logo_url_large &&
104
+ logo_url_medium == other.logo_url_medium &&
105
+ terms_url == other.terms_url
106
+ end
107
+
108
+ # @see the `==` method
109
+ # @param [Object] Object to be compared
110
+ def eql?(other)
111
+ self == other
112
+ end
113
+
114
+ # Calculates hash code according to all attributes.
115
+ # @return [Integer] Hash code
116
+ def hash
117
+ [bank_code, logo_url_large, logo_url_medium, terms_url].hash
118
+ end
119
+
120
+ # Builds the object from hash
121
+ # @param [Hash] attributes Model attributes in the form of hash
122
+ # @return [Object] Returns the model itself
123
+ def self.build_from_hash(attributes)
124
+ return nil unless attributes.is_a?(Hash)
125
+
126
+ attributes = attributes.transform_keys(&:to_sym)
127
+ transformed_hash = {}
128
+ openapi_types.each_pair do |key, type|
129
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
130
+ transformed_hash[key.to_s] = nil
131
+ elsif type =~ /\AArray<(.*)>/i
132
+ # check to ensure the input is an array given that the attribute
133
+ # is documented as an array but the input is not
134
+ 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)
135
+ elsif !attributes[attribute_map[key]].nil?
136
+ transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
137
+ end
138
+ end
139
+ new(transformed_hash)
140
+ end
141
+
142
+ # Deserializes the data based on type
143
+ # @param string type Data type
144
+ # @param string value Value to be deserialized
145
+ # @return [Object] Deserialized data
146
+ def self._deserialize(type, value)
147
+ case type.to_sym
148
+ when :Time
149
+ Time.parse(value)
150
+ when :Date
151
+ Date.parse(value)
152
+ when :String
153
+ value.to_s
154
+ when :Integer
155
+ value.to_i
156
+ when :Float
157
+ value.to_f
158
+ when :Boolean
159
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
160
+ true
161
+ else
162
+ false
163
+ end
164
+ when :Object
165
+ # generic object (usually a Hash), return directly
166
+ value
167
+ when /\AArray<(?<inner_type>.+)>\z/
168
+ inner_type = Regexp.last_match[:inner_type]
169
+ value.map { |v| _deserialize(inner_type, v) }
170
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
171
+ k_type = Regexp.last_match[:k_type]
172
+ v_type = Regexp.last_match[:v_type]
173
+ {}.tap do |hash|
174
+ value.each do |k, v|
175
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
176
+ end
177
+ end
178
+ else # model
179
+ # models (e.g. Pet) or oneOf
180
+ klass = Api.const_get(type)
181
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
182
+ end
183
+ end
184
+
185
+ # Returns the string representation of the object
186
+ # @return [String] String presentation of the object
187
+ def to_s
188
+ to_hash.to_s
189
+ end
190
+
191
+ # to_body is an alias to to_hash (backward compatibility)
192
+ # @return [Hash] Returns the object in the form of hash
193
+ def to_body
194
+ to_hash
195
+ end
196
+
197
+ # Returns the object in the form of hash
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_hash
200
+ hash = {}
201
+ self.class.attribute_map.each_pair do |attr, param|
202
+ value = send(attr)
203
+ if value.nil?
204
+ is_nullable = self.class.openapi_nullable.include?(attr)
205
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
206
+ end
207
+
208
+ hash[param] = _to_hash(value)
209
+ end
210
+ hash
211
+ end
212
+
213
+ # Outputs non-array value in the form of hash
214
+ # For object, use to_hash. Otherwise, just return the value
215
+ # @param [Object] value Any valid value
216
+ # @return [Hash] Returns the value in the form of hash
217
+ def _to_hash(value)
218
+ if value.is_a?(Array)
219
+ value.compact.map { |v| _to_hash(v) }
220
+ elsif value.is_a?(Hash)
221
+ {}.tap do |hash|
222
+ value.each { |k, v| hash[k] = _to_hash(v) }
223
+ end
224
+ elsif value.respond_to? :to_hash
225
+ value.to_hash
226
+ else
227
+ value
228
+ end
229
+ end
230
+ end
231
+ end
@@ -0,0 +1,232 @@
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 BankBranch
18
+ attr_accessor :bank_code, :branch_code, :name, :name_katakana, :name_hiragana, :name_alphabet
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :bank_code => :bankCode,
24
+ :branch_code => :branchCode,
25
+ :name => :name,
26
+ :name_katakana => :nameKatakana,
27
+ :name_hiragana => :nameHiragana,
28
+ :name_alphabet => :nameAlphabet
29
+ }
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :bank_code => :String,
41
+ :branch_code => :String,
42
+ :name => :String,
43
+ :name_katakana => :String,
44
+ :name_hiragana => :String,
45
+ :name_alphabet => :String
46
+ }
47
+ end
48
+
49
+ # List of attributes with nullable: true
50
+ def self.openapi_nullable
51
+ Set.new([])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ raise ArgumentError, 'The input argument (attributes) must be a hash in `Api::BankBranch` initialize method' unless attributes.is_a?(Hash)
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ attributes = attributes.each_with_object({}) do |(k, v), h|
61
+ raise ArgumentError, "`#{k}` is not a valid attribute in `Api::BankBranch`. 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)
62
+
63
+ h[k.to_sym] = v
64
+ end
65
+
66
+ self.bank_code = attributes[:bank_code] if attributes.key?(:bank_code)
67
+
68
+ self.branch_code = attributes[:branch_code] if attributes.key?(:branch_code)
69
+
70
+ self.name = attributes[:name] if attributes.key?(:name)
71
+
72
+ self.name_katakana = attributes[:name_katakana] if attributes.key?(:name_katakana)
73
+
74
+ self.name_hiragana = attributes[:name_hiragana] if attributes.key?(:name_hiragana)
75
+
76
+ return unless attributes.key?(:name_alphabet)
77
+
78
+ self.name_alphabet = attributes[:name_alphabet]
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
85
+ []
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ warn '[DEPRECATED] the `valid?` method is obsolete'
92
+ true
93
+ end
94
+
95
+ # Checks equality by comparing each attribute.
96
+ # @param [Object] Object to be compared
97
+ def ==(other)
98
+ return true if equal?(other)
99
+
100
+ self.class == other.class &&
101
+ bank_code == other.bank_code &&
102
+ branch_code == other.branch_code &&
103
+ name == other.name &&
104
+ name_katakana == other.name_katakana &&
105
+ name_hiragana == other.name_hiragana &&
106
+ name_alphabet == other.name_alphabet
107
+ end
108
+
109
+ # @see the `==` method
110
+ # @param [Object] Object to be compared
111
+ def eql?(other)
112
+ self == other
113
+ end
114
+
115
+ # Calculates hash code according to all attributes.
116
+ # @return [Integer] Hash code
117
+ def hash
118
+ [bank_code, branch_code, name, name_katakana, name_hiragana, name_alphabet].hash
119
+ end
120
+
121
+ # Builds the object from hash
122
+ # @param [Hash] attributes Model attributes in the form of hash
123
+ # @return [Object] Returns the model itself
124
+ def self.build_from_hash(attributes)
125
+ return nil unless attributes.is_a?(Hash)
126
+
127
+ attributes = attributes.transform_keys(&:to_sym)
128
+ transformed_hash = {}
129
+ openapi_types.each_pair do |key, type|
130
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
131
+ transformed_hash[key.to_s] = nil
132
+ elsif type =~ /\AArray<(.*)>/i
133
+ # check to ensure the input is an array given that the attribute
134
+ # is documented as an array but the input is not
135
+ 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)
136
+ elsif !attributes[attribute_map[key]].nil?
137
+ transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
138
+ end
139
+ end
140
+ new(transformed_hash)
141
+ end
142
+
143
+ # Deserializes the data based on type
144
+ # @param string type Data type
145
+ # @param string value Value to be deserialized
146
+ # @return [Object] Deserialized data
147
+ def self._deserialize(type, value)
148
+ case type.to_sym
149
+ when :Time
150
+ Time.parse(value)
151
+ when :Date
152
+ Date.parse(value)
153
+ when :String
154
+ value.to_s
155
+ when :Integer
156
+ value.to_i
157
+ when :Float
158
+ value.to_f
159
+ when :Boolean
160
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
161
+ true
162
+ else
163
+ false
164
+ end
165
+ when :Object
166
+ # generic object (usually a Hash), return directly
167
+ value
168
+ when /\AArray<(?<inner_type>.+)>\z/
169
+ inner_type = Regexp.last_match[:inner_type]
170
+ value.map { |v| _deserialize(inner_type, v) }
171
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
172
+ k_type = Regexp.last_match[:k_type]
173
+ v_type = Regexp.last_match[:v_type]
174
+ {}.tap do |hash|
175
+ value.each do |k, v|
176
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
177
+ end
178
+ end
179
+ else # model
180
+ # models (e.g. Pet) or oneOf
181
+ klass = Api.const_get(type)
182
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
183
+ end
184
+ end
185
+
186
+ # Returns the string representation of the object
187
+ # @return [String] String presentation of the object
188
+ def to_s
189
+ to_hash.to_s
190
+ end
191
+
192
+ # to_body is an alias to to_hash (backward compatibility)
193
+ # @return [Hash] Returns the object in the form of hash
194
+ def to_body
195
+ to_hash
196
+ end
197
+
198
+ # Returns the object in the form of hash
199
+ # @return [Hash] Returns the object in the form of hash
200
+ def to_hash
201
+ hash = {}
202
+ self.class.attribute_map.each_pair do |attr, param|
203
+ value = send(attr)
204
+ if value.nil?
205
+ is_nullable = self.class.openapi_nullable.include?(attr)
206
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
207
+ end
208
+
209
+ hash[param] = _to_hash(value)
210
+ end
211
+ hash
212
+ end
213
+
214
+ # Outputs non-array value in the form of hash
215
+ # For object, use to_hash. Otherwise, just return the value
216
+ # @param [Object] value Any valid value
217
+ # @return [Hash] Returns the value in the form of hash
218
+ def _to_hash(value)
219
+ if value.is_a?(Array)
220
+ value.compact.map { |v| _to_hash(v) }
221
+ elsif value.is_a?(Hash)
222
+ {}.tap do |hash|
223
+ value.each { |k, v| hash[k] = _to_hash(v) }
224
+ end
225
+ elsif value.respond_to? :to_hash
226
+ value.to_hash
227
+ else
228
+ value
229
+ end
230
+ end
231
+ end
232
+ end
@@ -15,14 +15,36 @@ require 'time'
15
15
 
16
16
  module Api
17
17
  class BankInformation
18
- attr_accessor :account_number, :bank_name, :branch_name
18
+ attr_accessor :account_number, :bank_name, :branch_name, :deposit_type
19
+
20
+ class EnumAttributeValidator
21
+ attr_reader :datatype, :allowable_values
22
+
23
+ def initialize(datatype, allowable_values)
24
+ @allowable_values = allowable_values.map do |value|
25
+ case datatype.to_s
26
+ when /Integer/i
27
+ value.to_i
28
+ when /Float/i
29
+ value.to_f
30
+ else
31
+ value
32
+ end
33
+ end
34
+ end
35
+
36
+ def valid?(value)
37
+ !value || allowable_values.include?(value)
38
+ end
39
+ end
19
40
 
20
41
  # Attribute mapping from ruby-style variable name to JSON key.
21
42
  def self.attribute_map
22
43
  {
23
44
  :account_number => :accountNumber,
24
45
  :bank_name => :bankName,
25
- :branch_name => :branchName
46
+ :branch_name => :branchName,
47
+ :deposit_type => :depositType
26
48
  }
27
49
  end
28
50
 
@@ -36,7 +58,8 @@ module Api
36
58
  {
37
59
  :account_number => :String,
38
60
  :bank_name => :String,
39
- :branch_name => :String
61
+ :branch_name => :String,
62
+ :deposit_type => :DepositType
40
63
  }
41
64
  end
42
65
 
@@ -61,9 +84,13 @@ module Api
61
84
 
62
85
  self.bank_name = attributes[:bank_name] if attributes.key?(:bank_name)
63
86
 
64
- return unless attributes.key?(:branch_name)
87
+ self.branch_name = attributes[:branch_name] if attributes.key?(:branch_name)
65
88
 
66
- self.branch_name = attributes[:branch_name]
89
+ self.deposit_type = if attributes.key?(:deposit_type)
90
+ attributes[:deposit_type]
91
+ else
92
+ 'DEPOSIT_TYPE_UNSPECIFIED'
93
+ end
67
94
  end
68
95
 
69
96
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -88,7 +115,8 @@ module Api
88
115
  self.class == other.class &&
89
116
  account_number == other.account_number &&
90
117
  bank_name == other.bank_name &&
91
- branch_name == other.branch_name
118
+ branch_name == other.branch_name &&
119
+ deposit_type == other.deposit_type
92
120
  end
93
121
 
94
122
  # @see the `==` method
@@ -100,7 +128,7 @@ module Api
100
128
  # Calculates hash code according to all attributes.
101
129
  # @return [Integer] Hash code
102
130
  def hash
103
- [account_number, bank_name, branch_name].hash
131
+ [account_number, bank_name, branch_name, deposit_type].hash
104
132
  end
105
133
 
106
134
  # Builds the object from hash