jamm 1.3.0 → 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 (83) 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 +41 -28
  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 +56 -44
  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 +150 -95
  18. data/lib/jamm/api/models/v1_bank_assets.rb +60 -47
  19. data/lib/jamm/api/models/v1_bank_branch.rb +83 -56
  20. data/lib/jamm/api/models/v1_bank_information.rb +71 -51
  21. data/lib/jamm/api/models/v1_bank_quota.rb +99 -64
  22. data/lib/jamm/api/models/v1_bank_scheduled_maintenance_period.rb +75 -52
  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 +57 -44
  41. data/lib/jamm/api/models/v1_error_response.rb +46 -38
  42. data/lib/jamm/api/models/v1_error_type.rb +30 -31
  43. data/lib/jamm/api/models/v1_event_type.rb +20 -21
  44. data/lib/jamm/api/models/v1_get_bank_response.rb +42 -35
  45. data/lib/jamm/api/models/v1_get_branch_response.rb +42 -35
  46. data/lib/jamm/api/models/v1_get_branches_response.rb +44 -36
  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 +59 -44
  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 +44 -36
  70. data/lib/jamm/api/models/v1_search_branches_response.rb +44 -36
  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 +10 -10
  78. data/lib/jamm/charge.rb +12 -0
  79. data/lib/jamm/deprecation.rb +13 -0
  80. data/lib/jamm/payment.rb +61 -0
  81. data/lib/jamm/version.rb +1 -1
  82. data/lib/jamm.rb +2 -0
  83. metadata +4 -2
@@ -1,14 +1,14 @@
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'
@@ -31,10 +31,10 @@ module Api
31
31
  # Attribute mapping from ruby-style variable name to JSON key.
32
32
  def self.attribute_map
33
33
  {
34
- :price => :price,
35
- :description => :description,
36
- :metadata => :metadata,
37
- :expires_at => :expiresAt
34
+ :'price' => :'price',
35
+ :'description' => :'description',
36
+ :'metadata' => :'metadata',
37
+ :'expires_at' => :'expiresAt'
38
38
  }
39
39
  end
40
40
 
@@ -46,48 +46,59 @@ module Api
46
46
  # Attribute type mapping.
47
47
  def self.openapi_types
48
48
  {
49
- :price => :Integer,
50
- :description => :String,
51
- :metadata => :'Hash<String, String>',
52
- :expires_at => :Time
49
+ :'price' => :'Integer',
50
+ :'description' => :'String',
51
+ :'metadata' => :'Hash<String, String>',
52
+ :'expires_at' => :'Time'
53
53
  }
54
54
  end
55
55
 
56
56
  # List of attributes with nullable: true
57
57
  def self.openapi_nullable
58
- Set.new([])
58
+ Set.new([
59
+ ])
59
60
  end
60
61
 
61
62
  # Initializes the object
62
63
  # @param [Hash] attributes Model attributes in the form of hash
63
64
  def initialize(attributes = {})
64
- raise ArgumentError, 'The input argument (attributes) must be a hash in `Api::InitialCharge` initialize method' unless attributes.is_a?(Hash)
65
+ if (!attributes.is_a?(Hash))
66
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Api::InitialCharge` initialize method"
67
+ end
65
68
 
66
69
  # check to see if the attribute exists and convert string to symbol for hash key
67
- attributes = attributes.each_with_object({}) do |(k, v), h|
68
- raise ArgumentError, "`#{k}` is not a valid attribute in `Api::InitialCharge`. 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)
69
-
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!self.class.attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Api::InitialCharge`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
73
+ end
70
74
  h[k.to_sym] = v
71
- end
72
-
73
- self.price = attributes[:price] if attributes.key?(:price)
75
+ }
74
76
 
75
- self.description = attributes[:description] if attributes.key?(:description)
77
+ if attributes.key?(:'price')
78
+ self.price = attributes[:'price']
79
+ end
76
80
 
77
- if attributes.key?(:metadata) && (value = attributes[:metadata]).is_a?(Hash)
78
- self.metadata = value
81
+ if attributes.key?(:'description')
82
+ self.description = attributes[:'description']
79
83
  end
80
84
 
81
- return unless attributes.key?(:expires_at)
85
+ if attributes.key?(:'metadata')
86
+ if (value = attributes[:'metadata']).is_a?(Hash)
87
+ self.metadata = value
88
+ end
89
+ end
82
90
 
83
- self.expires_at = attributes[:expires_at]
91
+ if attributes.key?(:'expires_at')
92
+ self.expires_at = attributes[:'expires_at']
93
+ end
84
94
  end
85
95
 
86
96
  # Show invalid properties with the reasons. Usually used together with valid?
87
97
  # @return Array for valid properties with the reasons
88
98
  def list_invalid_properties
89
99
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
90
- []
100
+ invalid_properties = Array.new
101
+ invalid_properties
91
102
  end
92
103
 
93
104
  # Check to see if the all the properties in the model are valid
@@ -99,20 +110,19 @@ module Api
99
110
 
100
111
  # Checks equality by comparing each attribute.
101
112
  # @param [Object] Object to be compared
102
- def ==(other)
103
- return true if equal?(other)
104
-
105
- self.class == other.class &&
106
- price == other.price &&
107
- description == other.description &&
108
- metadata == other.metadata &&
109
- expires_at == other.expires_at
113
+ def ==(o)
114
+ return true if self.equal?(o)
115
+ self.class == o.class &&
116
+ price == o.price &&
117
+ description == o.description &&
118
+ metadata == o.metadata &&
119
+ expires_at == o.expires_at
110
120
  end
111
121
 
112
122
  # @see the `==` method
113
123
  # @param [Object] Object to be compared
114
- def eql?(other)
115
- self == other
124
+ def eql?(o)
125
+ self == o
116
126
  end
117
127
 
118
128
  # Calculates hash code according to all attributes.
@@ -126,18 +136,19 @@ module Api
126
136
  # @return [Object] Returns the model itself
127
137
  def self.build_from_hash(attributes)
128
138
  return nil unless attributes.is_a?(Hash)
129
-
130
139
  attributes = attributes.transform_keys(&:to_sym)
131
140
  transformed_hash = {}
132
141
  openapi_types.each_pair do |key, type|
133
142
  if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
134
- transformed_hash[key.to_s] = nil
143
+ transformed_hash["#{key}"] = nil
135
144
  elsif type =~ /\AArray<(.*)>/i
136
145
  # check to ensure the input is an array given that the attribute
137
146
  # is documented as an array but the input is not
138
- 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
+ if attributes[attribute_map[key]].is_a?(Array)
148
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
149
+ end
139
150
  elsif !attributes[attribute_map[key]].nil?
140
- transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
151
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
141
152
  end
142
153
  end
143
154
  new(transformed_hash)
@@ -203,7 +214,7 @@ module Api
203
214
  def to_hash
204
215
  hash = {}
205
216
  self.class.attribute_map.each_pair do |attr, param|
206
- value = send(attr)
217
+ value = self.send(attr)
207
218
  if value.nil?
208
219
  is_nullable = self.class.openapi_nullable.include?(attr)
209
220
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
@@ -231,5 +242,7 @@ module Api
231
242
  value
232
243
  end
233
244
  end
245
+
234
246
  end
247
+
235
248
  end
@@ -1,25 +1,25 @@
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 KycStatus
18
- UNSPECIFIED = 'KYC_STATUS_UNSPECIFIED'
19
- APPROVED = 'KYC_STATUS_APPROVED'
20
- NOT_SUBMITTED = 'KYC_STATUS_NOT_SUBMITTED'
21
- IN_REVIEW = 'KYC_STATUS_IN_REVIEW'
22
- DENIED = 'KYC_STATUS_DENIED'
18
+ UNSPECIFIED = "KYC_STATUS_UNSPECIFIED".freeze
19
+ APPROVED = "KYC_STATUS_APPROVED".freeze
20
+ NOT_SUBMITTED = "KYC_STATUS_NOT_SUBMITTED".freeze
21
+ IN_REVIEW = "KYC_STATUS_IN_REVIEW".freeze
22
+ DENIED = "KYC_STATUS_DENIED".freeze
23
23
 
24
24
  def self.all_vars
25
25
  @all_vars ||= [UNSPECIFIED, APPROVED, NOT_SUBMITTED, IN_REVIEW, DENIED].freeze
@@ -37,7 +37,6 @@ module Api
37
37
  # @return [String] The enum value
38
38
  def build_from_hash(value)
39
39
  return value if KycStatus.all_vars.include?(value)
40
-
41
40
  raise "Invalid ENUM value #{value} for class #KycStatus"
42
41
  end
43
42
  end
@@ -1,27 +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 Merchant
18
- attr_accessor :id, :name
18
+ attr_accessor :id
19
+
20
+ attr_accessor :name
19
21
 
20
22
  # Attribute mapping from ruby-style variable name to JSON key.
21
23
  def self.attribute_map
22
24
  {
23
- :id => :id,
24
- :name => :name
25
+ :'id' => :'id',
26
+ :'name' => :'name'
25
27
  }
26
28
  end
27
29
 
@@ -33,40 +35,47 @@ module Api
33
35
  # Attribute type mapping.
34
36
  def self.openapi_types
35
37
  {
36
- :id => :String,
37
- :name => :String
38
+ :'id' => :'String',
39
+ :'name' => :'String'
38
40
  }
39
41
  end
40
42
 
41
43
  # List of attributes with nullable: true
42
44
  def self.openapi_nullable
43
- Set.new([])
45
+ Set.new([
46
+ ])
44
47
  end
45
48
 
46
49
  # Initializes the object
47
50
  # @param [Hash] attributes Model attributes in the form of hash
48
51
  def initialize(attributes = {})
49
- raise ArgumentError, 'The input argument (attributes) must be a hash in `Api::Merchant` initialize method' unless attributes.is_a?(Hash)
52
+ if (!attributes.is_a?(Hash))
53
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Api::Merchant` initialize method"
54
+ end
50
55
 
51
56
  # check to see if the attribute exists and convert string to symbol for hash key
52
- attributes = attributes.each_with_object({}) do |(k, v), h|
53
- raise ArgumentError, "`#{k}` is not a valid attribute in `Api::Merchant`. 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)
54
-
57
+ attributes = attributes.each_with_object({}) { |(k, v), h|
58
+ if (!self.class.attribute_map.key?(k.to_sym))
59
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Api::Merchant`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
60
+ end
55
61
  h[k.to_sym] = v
56
- end
57
-
58
- self.id = attributes[:id] if attributes.key?(:id)
62
+ }
59
63
 
60
- return unless attributes.key?(:name)
64
+ if attributes.key?(:'id')
65
+ self.id = attributes[:'id']
66
+ end
61
67
 
62
- self.name = attributes[:name]
68
+ if attributes.key?(:'name')
69
+ self.name = attributes[:'name']
70
+ end
63
71
  end
64
72
 
65
73
  # Show invalid properties with the reasons. Usually used together with valid?
66
74
  # @return Array for valid properties with the reasons
67
75
  def list_invalid_properties
68
76
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
69
- []
77
+ invalid_properties = Array.new
78
+ invalid_properties
70
79
  end
71
80
 
72
81
  # Check to see if the all the properties in the model are valid
@@ -78,18 +87,17 @@ module Api
78
87
 
79
88
  # Checks equality by comparing each attribute.
80
89
  # @param [Object] Object to be compared
81
- def ==(other)
82
- return true if equal?(other)
83
-
84
- self.class == other.class &&
85
- id == other.id &&
86
- name == other.name
90
+ def ==(o)
91
+ return true if self.equal?(o)
92
+ self.class == o.class &&
93
+ id == o.id &&
94
+ name == o.name
87
95
  end
88
96
 
89
97
  # @see the `==` method
90
98
  # @param [Object] Object to be compared
91
- def eql?(other)
92
- self == other
99
+ def eql?(o)
100
+ self == o
93
101
  end
94
102
 
95
103
  # Calculates hash code according to all attributes.
@@ -103,18 +111,19 @@ module Api
103
111
  # @return [Object] Returns the model itself
104
112
  def self.build_from_hash(attributes)
105
113
  return nil unless attributes.is_a?(Hash)
106
-
107
114
  attributes = attributes.transform_keys(&:to_sym)
108
115
  transformed_hash = {}
109
116
  openapi_types.each_pair do |key, type|
110
117
  if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
111
- transformed_hash[key.to_s] = nil
118
+ transformed_hash["#{key}"] = nil
112
119
  elsif type =~ /\AArray<(.*)>/i
113
120
  # check to ensure the input is an array given that the attribute
114
121
  # is documented as an array but the input is not
115
- 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)
122
+ if attributes[attribute_map[key]].is_a?(Array)
123
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
124
+ end
116
125
  elsif !attributes[attribute_map[key]].nil?
117
- transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
126
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
118
127
  end
119
128
  end
120
129
  new(transformed_hash)
@@ -180,7 +189,7 @@ module Api
180
189
  def to_hash
181
190
  hash = {}
182
191
  self.class.attribute_map.each_pair do |attr, param|
183
- value = send(attr)
192
+ value = self.send(attr)
184
193
  if value.nil?
185
194
  is_nullable = self.class.openapi_nullable.include?(attr)
186
195
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
@@ -208,5 +217,7 @@ module Api
208
217
  value
209
218
  end
210
219
  end
220
+
211
221
  end
222
+
212
223
  end
@@ -1,14 +1,14 @@
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'
@@ -16,13 +16,15 @@ require 'time'
16
16
  module Api
17
17
  # MerchantCustomer represents a customer of merchant, associated in Jamm network.
18
18
  class MerchantCustomer
19
- attr_accessor :customer, :merchant
19
+ attr_accessor :customer
20
+
21
+ attr_accessor :merchant
20
22
 
21
23
  # Attribute mapping from ruby-style variable name to JSON key.
22
24
  def self.attribute_map
23
25
  {
24
- :customer => :customer,
25
- :merchant => :merchant
26
+ :'customer' => :'customer',
27
+ :'merchant' => :'merchant'
26
28
  }
27
29
  end
28
30
 
@@ -34,40 +36,47 @@ module Api
34
36
  # Attribute type mapping.
35
37
  def self.openapi_types
36
38
  {
37
- :customer => :Customer,
38
- :merchant => :Merchant
39
+ :'customer' => :'Customer',
40
+ :'merchant' => :'Merchant'
39
41
  }
40
42
  end
41
43
 
42
44
  # List of attributes with nullable: true
43
45
  def self.openapi_nullable
44
- Set.new([])
46
+ Set.new([
47
+ ])
45
48
  end
46
49
 
47
50
  # Initializes the object
48
51
  # @param [Hash] attributes Model attributes in the form of hash
49
52
  def initialize(attributes = {})
50
- raise ArgumentError, 'The input argument (attributes) must be a hash in `Api::MerchantCustomer` initialize method' unless attributes.is_a?(Hash)
53
+ if (!attributes.is_a?(Hash))
54
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Api::MerchantCustomer` initialize method"
55
+ end
51
56
 
52
57
  # check to see if the attribute exists and convert string to symbol for hash key
53
- attributes = attributes.each_with_object({}) do |(k, v), h|
54
- raise ArgumentError, "`#{k}` is not a valid attribute in `Api::MerchantCustomer`. 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)
55
-
58
+ attributes = attributes.each_with_object({}) { |(k, v), h|
59
+ if (!self.class.attribute_map.key?(k.to_sym))
60
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Api::MerchantCustomer`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
61
+ end
56
62
  h[k.to_sym] = v
57
- end
58
-
59
- self.customer = attributes[:customer] if attributes.key?(:customer)
63
+ }
60
64
 
61
- return unless attributes.key?(:merchant)
65
+ if attributes.key?(:'customer')
66
+ self.customer = attributes[:'customer']
67
+ end
62
68
 
63
- self.merchant = attributes[:merchant]
69
+ if attributes.key?(:'merchant')
70
+ self.merchant = attributes[:'merchant']
71
+ end
64
72
  end
65
73
 
66
74
  # Show invalid properties with the reasons. Usually used together with valid?
67
75
  # @return Array for valid properties with the reasons
68
76
  def list_invalid_properties
69
77
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
70
- []
78
+ invalid_properties = Array.new
79
+ invalid_properties
71
80
  end
72
81
 
73
82
  # Check to see if the all the properties in the model are valid
@@ -79,18 +88,17 @@ module Api
79
88
 
80
89
  # Checks equality by comparing each attribute.
81
90
  # @param [Object] Object to be compared
82
- def ==(other)
83
- return true if equal?(other)
84
-
85
- self.class == other.class &&
86
- customer == other.customer &&
87
- merchant == other.merchant
91
+ def ==(o)
92
+ return true if self.equal?(o)
93
+ self.class == o.class &&
94
+ customer == o.customer &&
95
+ merchant == o.merchant
88
96
  end
89
97
 
90
98
  # @see the `==` method
91
99
  # @param [Object] Object to be compared
92
- def eql?(other)
93
- self == other
100
+ def eql?(o)
101
+ self == o
94
102
  end
95
103
 
96
104
  # Calculates hash code according to all attributes.
@@ -104,18 +112,19 @@ module Api
104
112
  # @return [Object] Returns the model itself
105
113
  def self.build_from_hash(attributes)
106
114
  return nil unless attributes.is_a?(Hash)
107
-
108
115
  attributes = attributes.transform_keys(&:to_sym)
109
116
  transformed_hash = {}
110
117
  openapi_types.each_pair do |key, type|
111
118
  if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
112
- transformed_hash[key.to_s] = nil
119
+ transformed_hash["#{key}"] = nil
113
120
  elsif type =~ /\AArray<(.*)>/i
114
121
  # check to ensure the input is an array given that the attribute
115
122
  # is documented as an array but the input is not
116
- 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)
123
+ if attributes[attribute_map[key]].is_a?(Array)
124
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
125
+ end
117
126
  elsif !attributes[attribute_map[key]].nil?
118
- transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
127
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
119
128
  end
120
129
  end
121
130
  new(transformed_hash)
@@ -181,7 +190,7 @@ module Api
181
190
  def to_hash
182
191
  hash = {}
183
192
  self.class.attribute_map.each_pair do |attr, param|
184
- value = send(attr)
193
+ value = self.send(attr)
185
194
  if value.nil?
186
195
  is_nullable = self.class.openapi_nullable.include?(attr)
187
196
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
@@ -209,5 +218,7 @@ module Api
209
218
  value
210
219
  end
211
220
  end
221
+
212
222
  end
223
+
213
224
  end