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,243 @@
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
+ # See Google Spreadsheet for more information: https://docs.google.com/spreadsheets/d/1sxklqXzTGt-E7FgXB801d12Az8pbpZgs/edit?gid=1684227518#gid=1684227518
18
+ class BankQuota
19
+ attr_accessor :offline_purchase_limit_per_charge_with_kyc, :offline_purchase_limit_per_charge_without_kyc, :offline_purchase_limit_per_day_with_kyc, :offline_purchase_limit_per_day_without_kyc, :subscription_purchase_limit_per_charge_with_kyc, :subscription_purchase_limit_per_charge_without_kyc, :subscription_purchase_limit_per_day_with_kyc, :subscription_purchase_limit_per_day_without_kyc
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :offline_purchase_limit_per_charge_with_kyc => :offlinePurchaseLimitPerChargeWithKyc,
25
+ :offline_purchase_limit_per_charge_without_kyc => :offlinePurchaseLimitPerChargeWithoutKyc,
26
+ :offline_purchase_limit_per_day_with_kyc => :offlinePurchaseLimitPerDayWithKyc,
27
+ :offline_purchase_limit_per_day_without_kyc => :offlinePurchaseLimitPerDayWithoutKyc,
28
+ :subscription_purchase_limit_per_charge_with_kyc => :subscriptionPurchaseLimitPerChargeWithKyc,
29
+ :subscription_purchase_limit_per_charge_without_kyc => :subscriptionPurchaseLimitPerChargeWithoutKyc,
30
+ :subscription_purchase_limit_per_day_with_kyc => :subscriptionPurchaseLimitPerDayWithKyc,
31
+ :subscription_purchase_limit_per_day_without_kyc => :subscriptionPurchaseLimitPerDayWithoutKyc
32
+ }
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :offline_purchase_limit_per_charge_with_kyc => :Integer,
44
+ :offline_purchase_limit_per_charge_without_kyc => :Integer,
45
+ :offline_purchase_limit_per_day_with_kyc => :Integer,
46
+ :offline_purchase_limit_per_day_without_kyc => :Integer,
47
+ :subscription_purchase_limit_per_charge_with_kyc => :Integer,
48
+ :subscription_purchase_limit_per_charge_without_kyc => :Integer,
49
+ :subscription_purchase_limit_per_day_with_kyc => :Integer,
50
+ :subscription_purchase_limit_per_day_without_kyc => :Integer
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::BankQuota` 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::BankQuota`. 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.offline_purchase_limit_per_charge_with_kyc = attributes[:offline_purchase_limit_per_charge_with_kyc] if attributes.key?(:offline_purchase_limit_per_charge_with_kyc)
72
+
73
+ self.offline_purchase_limit_per_charge_without_kyc = attributes[:offline_purchase_limit_per_charge_without_kyc] if attributes.key?(:offline_purchase_limit_per_charge_without_kyc)
74
+
75
+ self.offline_purchase_limit_per_day_with_kyc = attributes[:offline_purchase_limit_per_day_with_kyc] if attributes.key?(:offline_purchase_limit_per_day_with_kyc)
76
+
77
+ self.offline_purchase_limit_per_day_without_kyc = attributes[:offline_purchase_limit_per_day_without_kyc] if attributes.key?(:offline_purchase_limit_per_day_without_kyc)
78
+
79
+ self.subscription_purchase_limit_per_charge_with_kyc = attributes[:subscription_purchase_limit_per_charge_with_kyc] if attributes.key?(:subscription_purchase_limit_per_charge_with_kyc)
80
+
81
+ self.subscription_purchase_limit_per_charge_without_kyc = attributes[:subscription_purchase_limit_per_charge_without_kyc] if attributes.key?(:subscription_purchase_limit_per_charge_without_kyc)
82
+
83
+ self.subscription_purchase_limit_per_day_with_kyc = attributes[:subscription_purchase_limit_per_day_with_kyc] if attributes.key?(:subscription_purchase_limit_per_day_with_kyc)
84
+
85
+ return unless attributes.key?(:subscription_purchase_limit_per_day_without_kyc)
86
+
87
+ self.subscription_purchase_limit_per_day_without_kyc = attributes[:subscription_purchase_limit_per_day_without_kyc]
88
+ end
89
+
90
+ # Show invalid properties with the reasons. Usually used together with valid?
91
+ # @return Array for valid properties with the reasons
92
+ def list_invalid_properties
93
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
94
+ []
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 ==(other)
107
+ return true if equal?(other)
108
+
109
+ self.class == other.class &&
110
+ offline_purchase_limit_per_charge_with_kyc == other.offline_purchase_limit_per_charge_with_kyc &&
111
+ offline_purchase_limit_per_charge_without_kyc == other.offline_purchase_limit_per_charge_without_kyc &&
112
+ offline_purchase_limit_per_day_with_kyc == other.offline_purchase_limit_per_day_with_kyc &&
113
+ offline_purchase_limit_per_day_without_kyc == other.offline_purchase_limit_per_day_without_kyc &&
114
+ subscription_purchase_limit_per_charge_with_kyc == other.subscription_purchase_limit_per_charge_with_kyc &&
115
+ subscription_purchase_limit_per_charge_without_kyc == other.subscription_purchase_limit_per_charge_without_kyc &&
116
+ subscription_purchase_limit_per_day_with_kyc == other.subscription_purchase_limit_per_day_with_kyc &&
117
+ subscription_purchase_limit_per_day_without_kyc == other.subscription_purchase_limit_per_day_without_kyc
118
+ end
119
+
120
+ # @see the `==` method
121
+ # @param [Object] Object to be compared
122
+ def eql?(other)
123
+ self == other
124
+ end
125
+
126
+ # Calculates hash code according to all attributes.
127
+ # @return [Integer] Hash code
128
+ def hash
129
+ [offline_purchase_limit_per_charge_with_kyc, offline_purchase_limit_per_charge_without_kyc, offline_purchase_limit_per_day_with_kyc, offline_purchase_limit_per_day_without_kyc, subscription_purchase_limit_per_charge_with_kyc, subscription_purchase_limit_per_charge_without_kyc, subscription_purchase_limit_per_day_with_kyc, subscription_purchase_limit_per_day_without_kyc].hash
130
+ end
131
+
132
+ # Builds the object from hash
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ # @return [Object] Returns the model itself
135
+ def self.build_from_hash(attributes)
136
+ return nil unless attributes.is_a?(Hash)
137
+
138
+ attributes = attributes.transform_keys(&:to_sym)
139
+ transformed_hash = {}
140
+ openapi_types.each_pair do |key, type|
141
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
142
+ transformed_hash[key.to_s] = nil
143
+ elsif type =~ /\AArray<(.*)>/i
144
+ # check to ensure the input is an array given that the attribute
145
+ # is documented as an array but the input is not
146
+ 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)
147
+ elsif !attributes[attribute_map[key]].nil?
148
+ transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
149
+ end
150
+ end
151
+ new(transformed_hash)
152
+ end
153
+
154
+ # Deserializes the data based on type
155
+ # @param string type Data type
156
+ # @param string value Value to be deserialized
157
+ # @return [Object] Deserialized data
158
+ def self._deserialize(type, value)
159
+ case type.to_sym
160
+ when :Time
161
+ Time.parse(value)
162
+ when :Date
163
+ Date.parse(value)
164
+ when :String
165
+ value.to_s
166
+ when :Integer
167
+ value.to_i
168
+ when :Float
169
+ value.to_f
170
+ when :Boolean
171
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
172
+ true
173
+ else
174
+ false
175
+ end
176
+ when :Object
177
+ # generic object (usually a Hash), return directly
178
+ value
179
+ when /\AArray<(?<inner_type>.+)>\z/
180
+ inner_type = Regexp.last_match[:inner_type]
181
+ value.map { |v| _deserialize(inner_type, v) }
182
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
183
+ k_type = Regexp.last_match[:k_type]
184
+ v_type = Regexp.last_match[:v_type]
185
+ {}.tap do |hash|
186
+ value.each do |k, v|
187
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
188
+ end
189
+ end
190
+ else # model
191
+ # models (e.g. Pet) or oneOf
192
+ klass = Api.const_get(type)
193
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
194
+ end
195
+ end
196
+
197
+ # Returns the string representation of the object
198
+ # @return [String] String presentation of the object
199
+ def to_s
200
+ to_hash.to_s
201
+ end
202
+
203
+ # to_body is an alias to to_hash (backward compatibility)
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_body
206
+ to_hash
207
+ end
208
+
209
+ # Returns the object in the form of hash
210
+ # @return [Hash] Returns the object in the form of hash
211
+ def to_hash
212
+ hash = {}
213
+ self.class.attribute_map.each_pair do |attr, param|
214
+ value = send(attr)
215
+ if value.nil?
216
+ is_nullable = self.class.openapi_nullable.include?(attr)
217
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
218
+ end
219
+
220
+ hash[param] = _to_hash(value)
221
+ end
222
+ hash
223
+ end
224
+
225
+ # Outputs non-array value in the form of hash
226
+ # For object, use to_hash. Otherwise, just return the value
227
+ # @param [Object] value Any valid value
228
+ # @return [Hash] Returns the value in the form of hash
229
+ def _to_hash(value)
230
+ if value.is_a?(Array)
231
+ value.compact.map { |v| _to_hash(v) }
232
+ elsif value.is_a?(Hash)
233
+ {}.tap do |hash|
234
+ value.each { |k, v| hash[k] = _to_hash(v) }
235
+ end
236
+ elsif value.respond_to? :to_hash
237
+ value.to_hash
238
+ else
239
+ value
240
+ end
241
+ end
242
+ end
243
+ end
@@ -0,0 +1,227 @@
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 BankScheduledMaintenancePeriod
18
+ attr_accessor :bank_code, :start_at_jst, :end_at_jst, :start_at_utc, :end_at_utc
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :bank_code => :bankCode,
24
+ :start_at_jst => :startAtJst,
25
+ :end_at_jst => :endAtJst,
26
+ :start_at_utc => :startAtUtc,
27
+ :end_at_utc => :endAtUtc
28
+ }
29
+ end
30
+
31
+ # Returns all the JSON keys this model knows about
32
+ def self.acceptable_attributes
33
+ attribute_map.values
34
+ end
35
+
36
+ # Attribute type mapping.
37
+ def self.openapi_types
38
+ {
39
+ :bank_code => :String,
40
+ :start_at_jst => :String,
41
+ :end_at_jst => :String,
42
+ :start_at_utc => :String,
43
+ :end_at_utc => :String
44
+ }
45
+ end
46
+
47
+ # List of attributes with nullable: true
48
+ def self.openapi_nullable
49
+ Set.new([])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ raise ArgumentError, 'The input argument (attributes) must be a hash in `Api::BankScheduledMaintenancePeriod` initialize method' unless attributes.is_a?(Hash)
56
+
57
+ # check to see if the attribute exists and convert string to symbol for hash key
58
+ attributes = attributes.each_with_object({}) do |(k, v), h|
59
+ raise ArgumentError, "`#{k}` is not a valid attribute in `Api::BankScheduledMaintenancePeriod`. 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)
60
+
61
+ h[k.to_sym] = v
62
+ end
63
+
64
+ self.bank_code = attributes[:bank_code] if attributes.key?(:bank_code)
65
+
66
+ self.start_at_jst = attributes[:start_at_jst] if attributes.key?(:start_at_jst)
67
+
68
+ self.end_at_jst = attributes[:end_at_jst] if attributes.key?(:end_at_jst)
69
+
70
+ self.start_at_utc = attributes[:start_at_utc] if attributes.key?(:start_at_utc)
71
+
72
+ return unless attributes.key?(:end_at_utc)
73
+
74
+ self.end_at_utc = attributes[:end_at_utc]
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properties with the reasons
79
+ def list_invalid_properties
80
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
81
+ []
82
+ end
83
+
84
+ # Check to see if the all the properties in the model are valid
85
+ # @return true if the model is valid
86
+ def valid?
87
+ warn '[DEPRECATED] the `valid?` method is obsolete'
88
+ true
89
+ end
90
+
91
+ # Checks equality by comparing each attribute.
92
+ # @param [Object] Object to be compared
93
+ def ==(other)
94
+ return true if equal?(other)
95
+
96
+ self.class == other.class &&
97
+ bank_code == other.bank_code &&
98
+ start_at_jst == other.start_at_jst &&
99
+ end_at_jst == other.end_at_jst &&
100
+ start_at_utc == other.start_at_utc &&
101
+ end_at_utc == other.end_at_utc
102
+ end
103
+
104
+ # @see the `==` method
105
+ # @param [Object] Object to be compared
106
+ def eql?(other)
107
+ self == other
108
+ end
109
+
110
+ # Calculates hash code according to all attributes.
111
+ # @return [Integer] Hash code
112
+ def hash
113
+ [bank_code, start_at_jst, end_at_jst, start_at_utc, end_at_utc].hash
114
+ end
115
+
116
+ # Builds the object from hash
117
+ # @param [Hash] attributes Model attributes in the form of hash
118
+ # @return [Object] Returns the model itself
119
+ def self.build_from_hash(attributes)
120
+ return nil unless attributes.is_a?(Hash)
121
+
122
+ attributes = attributes.transform_keys(&:to_sym)
123
+ transformed_hash = {}
124
+ openapi_types.each_pair do |key, type|
125
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
126
+ transformed_hash[key.to_s] = nil
127
+ elsif type =~ /\AArray<(.*)>/i
128
+ # check to ensure the input is an array given that the attribute
129
+ # is documented as an array but the input is not
130
+ 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)
131
+ elsif !attributes[attribute_map[key]].nil?
132
+ transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
133
+ end
134
+ end
135
+ new(transformed_hash)
136
+ end
137
+
138
+ # Deserializes the data based on type
139
+ # @param string type Data type
140
+ # @param string value Value to be deserialized
141
+ # @return [Object] Deserialized data
142
+ def self._deserialize(type, value)
143
+ case type.to_sym
144
+ when :Time
145
+ Time.parse(value)
146
+ when :Date
147
+ Date.parse(value)
148
+ when :String
149
+ value.to_s
150
+ when :Integer
151
+ value.to_i
152
+ when :Float
153
+ value.to_f
154
+ when :Boolean
155
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
156
+ true
157
+ else
158
+ false
159
+ end
160
+ when :Object
161
+ # generic object (usually a Hash), return directly
162
+ value
163
+ when /\AArray<(?<inner_type>.+)>\z/
164
+ inner_type = Regexp.last_match[:inner_type]
165
+ value.map { |v| _deserialize(inner_type, v) }
166
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
167
+ k_type = Regexp.last_match[:k_type]
168
+ v_type = Regexp.last_match[:v_type]
169
+ {}.tap do |hash|
170
+ value.each do |k, v|
171
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
172
+ end
173
+ end
174
+ else # model
175
+ # models (e.g. Pet) or oneOf
176
+ klass = Api.const_get(type)
177
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
178
+ end
179
+ end
180
+
181
+ # Returns the string representation of the object
182
+ # @return [String] String presentation of the object
183
+ def to_s
184
+ to_hash.to_s
185
+ end
186
+
187
+ # to_body is an alias to to_hash (backward compatibility)
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_body
190
+ to_hash
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash
196
+ hash = {}
197
+ self.class.attribute_map.each_pair do |attr, param|
198
+ value = send(attr)
199
+ if value.nil?
200
+ is_nullable = self.class.openapi_nullable.include?(attr)
201
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
202
+ end
203
+
204
+ hash[param] = _to_hash(value)
205
+ end
206
+ hash
207
+ end
208
+
209
+ # Outputs non-array value in the form of hash
210
+ # For object, use to_hash. Otherwise, just return the value
211
+ # @param [Object] value Any valid value
212
+ # @return [Hash] Returns the value in the form of hash
213
+ def _to_hash(value)
214
+ if value.is_a?(Array)
215
+ value.compact.map { |v| _to_hash(v) }
216
+ elsif value.is_a?(Hash)
217
+ {}.tap do |hash|
218
+ value.each { |k, v| hash[k] = _to_hash(v) }
219
+ end
220
+ elsif value.respond_to? :to_hash
221
+ value.to_hash
222
+ else
223
+ value
224
+ end
225
+ end
226
+ end
227
+ end
@@ -79,7 +79,7 @@ module Api
79
79
  :processed_at => :String,
80
80
  :created_at => :String,
81
81
  :updated_at => :String,
82
- :error => :Error
82
+ :error => :Apiv1Error
83
83
  }
84
84
  end
85
85
 
@@ -0,0 +1,42 @@
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 DepositType
18
+ UNSPECIFIED = 'DEPOSIT_TYPE_UNSPECIFIED'
19
+ SAVINGS = 'DEPOSIT_TYPE_SAVINGS'
20
+ CHECKING = 'DEPOSIT_TYPE_CHECKING'
21
+
22
+ def self.all_vars
23
+ @all_vars ||= [UNSPECIFIED, SAVINGS, CHECKING].freeze
24
+ end
25
+
26
+ # Builds the enum from string
27
+ # @param [String] The enum value in the form of the string
28
+ # @return [String] The enum value
29
+ def self.build_from_hash(value)
30
+ new.build_from_hash(value)
31
+ end
32
+
33
+ # Builds the enum from string
34
+ # @param [String] The enum value in the form of the string
35
+ # @return [String] The enum value
36
+ def build_from_hash(value)
37
+ return value if DepositType.all_vars.include?(value)
38
+
39
+ raise "Invalid ENUM value #{value} for class #DepositType"
40
+ end
41
+ end
42
+ end