jamm 1.3.0 → 1.4.1

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/jamm.gemspec +1 -1
  4. data/lib/jamm/api/api/customer_api.rb +82 -52
  5. data/lib/jamm/api/api/healthcheck_api.rb +18 -15
  6. data/lib/jamm/api/api/payment_api.rb +113 -62
  7. data/lib/jamm/api/api/webhook_service_api.rb +41 -28
  8. data/lib/jamm/api/api_client.rb +74 -66
  9. data/lib/jamm/api/api_error.rb +16 -16
  10. data/lib/jamm/api/configuration.rb +42 -34
  11. data/lib/jamm/api/models/apiv1_error.rb +56 -44
  12. data/lib/jamm/api/models/apiv1_status.rb +57 -47
  13. data/lib/jamm/api/models/customer_service_update_customer_body.rb +107 -69
  14. data/lib/jamm/api/models/googlerpc_status.rb +61 -45
  15. data/lib/jamm/api/models/protobuf_any.rb +42 -35
  16. data/lib/jamm/api/models/v1_add_charge_request.rb +59 -44
  17. data/lib/jamm/api/models/v1_add_charge_response.rb +59 -44
  18. data/lib/jamm/api/models/v1_bank.rb +150 -95
  19. data/lib/jamm/api/models/v1_bank_assets.rb +60 -47
  20. data/lib/jamm/api/models/v1_bank_branch.rb +83 -56
  21. data/lib/jamm/api/models/v1_bank_information.rb +71 -51
  22. data/lib/jamm/api/models/v1_bank_quota.rb +99 -64
  23. data/lib/jamm/api/models/v1_bank_scheduled_maintenance_period.rb +75 -52
  24. data/lib/jamm/api/models/v1_buyer.rb +104 -76
  25. data/lib/jamm/api/models/v1_charge.rb +67 -52
  26. data/lib/jamm/api/models/v1_charge_message.rb +151 -93
  27. data/lib/jamm/api/models/v1_charge_message_status.rb +17 -18
  28. data/lib/jamm/api/models/v1_charge_result.rb +152 -93
  29. data/lib/jamm/api/models/v1_contract.rb +64 -52
  30. data/lib/jamm/api/models/v1_contract_message.rb +67 -48
  31. data/lib/jamm/api/models/v1_contract_status.rb +20 -21
  32. data/lib/jamm/api/models/v1_create_contract_with_charge_request.rb +59 -44
  33. data/lib/jamm/api/models/v1_create_contract_with_charge_response.rb +67 -48
  34. data/lib/jamm/api/models/v1_create_contract_without_charge_request.rb +51 -40
  35. data/lib/jamm/api/models/v1_create_contract_without_charge_response.rb +59 -44
  36. data/lib/jamm/api/models/v1_create_customer_request.rb +42 -35
  37. data/lib/jamm/api/models/v1_create_customer_response.rb +42 -35
  38. data/lib/jamm/api/models/v1_customer.rb +91 -60
  39. data/lib/jamm/api/models/v1_delete_customer_response.rb +42 -35
  40. data/lib/jamm/api/models/v1_deposit_type.rb +14 -15
  41. data/lib/jamm/api/models/v1_error_detail.rb +57 -44
  42. data/lib/jamm/api/models/v1_error_response.rb +46 -38
  43. data/lib/jamm/api/models/v1_error_type.rb +30 -31
  44. data/lib/jamm/api/models/v1_event_type.rb +20 -21
  45. data/lib/jamm/api/models/v1_get_bank_response.rb +42 -35
  46. data/lib/jamm/api/models/v1_get_branch_response.rb +42 -35
  47. data/lib/jamm/api/models/v1_get_branches_response.rb +44 -36
  48. data/lib/jamm/api/models/v1_get_charge_response.rb +51 -40
  49. data/lib/jamm/api/models/v1_get_charges_response.rb +60 -45
  50. data/lib/jamm/api/models/v1_get_contract_response.rb +51 -40
  51. data/lib/jamm/api/models/v1_get_customer_response.rb +42 -35
  52. data/lib/jamm/api/models/v1_get_major_banks_response.rb +59 -44
  53. data/lib/jamm/api/models/v1_initial_charge.rb +61 -48
  54. data/lib/jamm/api/models/v1_kyc_status.rb +16 -17
  55. data/lib/jamm/api/models/v1_merchant.rb +51 -40
  56. data/lib/jamm/api/models/v1_merchant_customer.rb +51 -40
  57. data/lib/jamm/api/models/v1_merchant_webhook_message.rb +75 -57
  58. data/lib/jamm/api/models/v1_message_response.rb +67 -48
  59. data/lib/jamm/api/models/v1_off_session_payment_request.rb +51 -40
  60. data/lib/jamm/api/models/v1_off_session_payment_response.rb +51 -40
  61. data/lib/jamm/api/models/v1_on_session_payment_data.rb +67 -48
  62. data/lib/jamm/api/models/v1_on_session_payment_error.rb +55 -45
  63. data/lib/jamm/api/models/v1_on_session_payment_error_code.rb +21 -22
  64. data/lib/jamm/api/models/v1_on_session_payment_request.rb +67 -48
  65. data/lib/jamm/api/models/v1_on_session_payment_response.rb +59 -44
  66. data/lib/jamm/api/models/v1_pagination.rb +51 -40
  67. data/lib/jamm/api/models/v1_payment_authorization_status.rb +14 -15
  68. data/lib/jamm/api/models/v1_payment_link.rb +57 -44
  69. data/lib/jamm/api/models/v1_ping_response.rb +42 -35
  70. data/lib/jamm/api/models/v1_search_banks_response.rb +44 -36
  71. data/lib/jamm/api/models/v1_search_branches_response.rb +44 -36
  72. data/lib/jamm/api/models/v1_update_customer_response.rb +42 -35
  73. data/lib/jamm/api/models/v1_url.rb +48 -39
  74. data/lib/jamm/api/models/v1_user_account_message.rb +67 -48
  75. data/lib/jamm/api/models/v1_withdraw_request.rb +51 -40
  76. data/lib/jamm/api/models/v1_withdraw_response.rb +51 -40
  77. data/lib/jamm/api/version.rb +11 -11
  78. data/lib/jamm/api.rb +10 -10
  79. data/lib/jamm/charge.rb +12 -0
  80. data/lib/jamm/deprecation.rb +13 -0
  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 +5 -3
@@ -1,29 +1,35 @@
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 ContractMessage
18
- attr_accessor :customer, :created_at, :activated_at, :merchant_name
18
+ attr_accessor :customer
19
+
20
+ attr_accessor :created_at
21
+
22
+ attr_accessor :activated_at
23
+
24
+ attr_accessor :merchant_name
19
25
 
20
26
  # Attribute mapping from ruby-style variable name to JSON key.
21
27
  def self.attribute_map
22
28
  {
23
- :customer => :customer,
24
- :created_at => :createdAt,
25
- :activated_at => :activatedAt,
26
- :merchant_name => :merchantName
29
+ :'customer' => :'customer',
30
+ :'created_at' => :'createdAt',
31
+ :'activated_at' => :'activatedAt',
32
+ :'merchant_name' => :'merchantName'
27
33
  }
28
34
  end
29
35
 
@@ -35,46 +41,57 @@ module Api
35
41
  # Attribute type mapping.
36
42
  def self.openapi_types
37
43
  {
38
- :customer => :String,
39
- :created_at => :String,
40
- :activated_at => :String,
41
- :merchant_name => :String
44
+ :'customer' => :'String',
45
+ :'created_at' => :'String',
46
+ :'activated_at' => :'String',
47
+ :'merchant_name' => :'String'
42
48
  }
43
49
  end
44
50
 
45
51
  # List of attributes with nullable: true
46
52
  def self.openapi_nullable
47
- Set.new([])
53
+ Set.new([
54
+ ])
48
55
  end
49
56
 
50
57
  # Initializes the object
51
58
  # @param [Hash] attributes Model attributes in the form of hash
52
59
  def initialize(attributes = {})
53
- raise ArgumentError, 'The input argument (attributes) must be a hash in `Api::ContractMessage` initialize method' unless attributes.is_a?(Hash)
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Api::ContractMessage` initialize method"
62
+ end
54
63
 
55
64
  # 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::ContractMessage`. 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
-
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!self.class.attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Api::ContractMessage`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
68
+ end
59
69
  h[k.to_sym] = v
60
- end
61
-
62
- self.customer = attributes[:customer] if attributes.key?(:customer)
70
+ }
63
71
 
64
- self.created_at = attributes[:created_at] if attributes.key?(:created_at)
72
+ if attributes.key?(:'customer')
73
+ self.customer = attributes[:'customer']
74
+ end
65
75
 
66
- self.activated_at = attributes[:activated_at] if attributes.key?(:activated_at)
76
+ if attributes.key?(:'created_at')
77
+ self.created_at = attributes[:'created_at']
78
+ end
67
79
 
68
- return unless attributes.key?(:merchant_name)
80
+ if attributes.key?(:'activated_at')
81
+ self.activated_at = attributes[:'activated_at']
82
+ end
69
83
 
70
- self.merchant_name = attributes[:merchant_name]
84
+ if attributes.key?(:'merchant_name')
85
+ self.merchant_name = attributes[:'merchant_name']
86
+ end
71
87
  end
72
88
 
73
89
  # Show invalid properties with the reasons. Usually used together with valid?
74
90
  # @return Array for valid properties with the reasons
75
91
  def list_invalid_properties
76
92
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
77
- []
93
+ invalid_properties = Array.new
94
+ invalid_properties
78
95
  end
79
96
 
80
97
  # Check to see if the all the properties in the model are valid
@@ -86,20 +103,19 @@ module Api
86
103
 
87
104
  # Checks equality by comparing each attribute.
88
105
  # @param [Object] Object to be compared
89
- def ==(other)
90
- return true if equal?(other)
91
-
92
- self.class == other.class &&
93
- customer == other.customer &&
94
- created_at == other.created_at &&
95
- activated_at == other.activated_at &&
96
- merchant_name == other.merchant_name
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ customer == o.customer &&
110
+ created_at == o.created_at &&
111
+ activated_at == o.activated_at &&
112
+ merchant_name == o.merchant_name
97
113
  end
98
114
 
99
115
  # @see the `==` method
100
116
  # @param [Object] Object to be compared
101
- def eql?(other)
102
- self == other
117
+ def eql?(o)
118
+ self == o
103
119
  end
104
120
 
105
121
  # Calculates hash code according to all attributes.
@@ -113,18 +129,19 @@ module Api
113
129
  # @return [Object] Returns the model itself
114
130
  def self.build_from_hash(attributes)
115
131
  return nil unless attributes.is_a?(Hash)
116
-
117
132
  attributes = attributes.transform_keys(&:to_sym)
118
133
  transformed_hash = {}
119
134
  openapi_types.each_pair do |key, type|
120
135
  if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
121
- transformed_hash[key.to_s] = nil
136
+ transformed_hash["#{key}"] = nil
122
137
  elsif type =~ /\AArray<(.*)>/i
123
138
  # check to ensure the input is an array given that the attribute
124
139
  # 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)
140
+ if attributes[attribute_map[key]].is_a?(Array)
141
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
142
+ end
126
143
  elsif !attributes[attribute_map[key]].nil?
127
- transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
144
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
128
145
  end
129
146
  end
130
147
  new(transformed_hash)
@@ -190,7 +207,7 @@ module Api
190
207
  def to_hash
191
208
  hash = {}
192
209
  self.class.attribute_map.each_pair do |attr, param|
193
- value = send(attr)
210
+ value = self.send(attr)
194
211
  if value.nil?
195
212
  is_nullable = self.class.openapi_nullable.include?(attr)
196
213
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
@@ -218,5 +235,7 @@ module Api
218
235
  value
219
236
  end
220
237
  end
238
+
221
239
  end
240
+
222
241
  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 ContractStatus
18
- UNSPECIFIED = 'CONTRACT_STATUS_UNSPECIFIED'
19
- INITIAL = 'CONTRACT_STATUS_INITIAL'
20
- APPROVED = 'CONTRACT_STATUS_APPROVED'
21
- ACTIVATED = 'CONTRACT_STATUS_ACTIVATED'
22
- WAITING_EKYC = 'CONTRACT_STATUS_WAITING_EKYC'
23
- EXPIRED = 'CONTRACT_STATUS_EXPIRED'
24
- DEACTIVATED = 'CONTRACT_STATUS_DEACTIVATED'
25
- CANCELLED = 'CONTRACT_STATUS_CANCELLED'
26
- PENDING_CHARGE = 'CONTRACT_STATUS_PENDING_CHARGE'
18
+ UNSPECIFIED = "CONTRACT_STATUS_UNSPECIFIED".freeze
19
+ INITIAL = "CONTRACT_STATUS_INITIAL".freeze
20
+ APPROVED = "CONTRACT_STATUS_APPROVED".freeze
21
+ ACTIVATED = "CONTRACT_STATUS_ACTIVATED".freeze
22
+ WAITING_EKYC = "CONTRACT_STATUS_WAITING_EKYC".freeze
23
+ EXPIRED = "CONTRACT_STATUS_EXPIRED".freeze
24
+ DEACTIVATED = "CONTRACT_STATUS_DEACTIVATED".freeze
25
+ CANCELLED = "CONTRACT_STATUS_CANCELLED".freeze
26
+ PENDING_CHARGE = "CONTRACT_STATUS_PENDING_CHARGE".freeze
27
27
 
28
28
  def self.all_vars
29
29
  @all_vars ||= [UNSPECIFIED, INITIAL, APPROVED, ACTIVATED, WAITING_EKYC, EXPIRED, DEACTIVATED, CANCELLED, PENDING_CHARGE].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 ContractStatus.all_vars.include?(value)
44
-
45
44
  raise "Invalid ENUM value #{value} for class #ContractStatus"
46
45
  end
47
46
  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,14 +16,18 @@ require 'time'
16
16
  module Api
17
17
  # Request message for creating a new contract with an immediate initial charge. This combines contract creation and charging in a single operation.
18
18
  class CreateContractWithChargeRequest
19
- attr_accessor :buyer, :charge, :redirect
19
+ attr_accessor :buyer
20
+
21
+ attr_accessor :charge
22
+
23
+ attr_accessor :redirect
20
24
 
21
25
  # Attribute mapping from ruby-style variable name to JSON key.
22
26
  def self.attribute_map
23
27
  {
24
- :buyer => :buyer,
25
- :charge => :charge,
26
- :redirect => :redirect
28
+ :'buyer' => :'buyer',
29
+ :'charge' => :'charge',
30
+ :'redirect' => :'redirect'
27
31
  }
28
32
  end
29
33
 
@@ -35,43 +39,52 @@ module Api
35
39
  # Attribute type mapping.
36
40
  def self.openapi_types
37
41
  {
38
- :buyer => :Buyer,
39
- :charge => :InitialCharge,
40
- :redirect => :URL
42
+ :'buyer' => :'Buyer',
43
+ :'charge' => :'InitialCharge',
44
+ :'redirect' => :'URL'
41
45
  }
42
46
  end
43
47
 
44
48
  # List of attributes with nullable: true
45
49
  def self.openapi_nullable
46
- Set.new([])
50
+ Set.new([
51
+ ])
47
52
  end
48
53
 
49
54
  # Initializes the object
50
55
  # @param [Hash] attributes Model attributes in the form of hash
51
56
  def initialize(attributes = {})
52
- raise ArgumentError, 'The input argument (attributes) must be a hash in `Api::CreateContractWithChargeRequest` initialize method' unless attributes.is_a?(Hash)
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Api::CreateContractWithChargeRequest` initialize method"
59
+ end
53
60
 
54
61
  # check to see if the attribute exists and convert string to symbol for hash key
55
- attributes = attributes.each_with_object({}) do |(k, v), h|
56
- raise ArgumentError, "`#{k}` is not a valid attribute in `Api::CreateContractWithChargeRequest`. 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)
57
-
62
+ attributes = attributes.each_with_object({}) { |(k, v), h|
63
+ if (!self.class.attribute_map.key?(k.to_sym))
64
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Api::CreateContractWithChargeRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
65
+ end
58
66
  h[k.to_sym] = v
59
- end
60
-
61
- self.buyer = attributes[:buyer] if attributes.key?(:buyer)
67
+ }
62
68
 
63
- self.charge = attributes[:charge] if attributes.key?(:charge)
69
+ if attributes.key?(:'buyer')
70
+ self.buyer = attributes[:'buyer']
71
+ end
64
72
 
65
- return unless attributes.key?(:redirect)
73
+ if attributes.key?(:'charge')
74
+ self.charge = attributes[:'charge']
75
+ end
66
76
 
67
- self.redirect = attributes[:redirect]
77
+ if attributes.key?(:'redirect')
78
+ self.redirect = attributes[:'redirect']
79
+ end
68
80
  end
69
81
 
70
82
  # Show invalid properties with the reasons. Usually used together with valid?
71
83
  # @return Array for valid properties with the reasons
72
84
  def list_invalid_properties
73
85
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
74
- []
86
+ invalid_properties = Array.new
87
+ invalid_properties
75
88
  end
76
89
 
77
90
  # Check to see if the all the properties in the model are valid
@@ -83,19 +96,18 @@ module Api
83
96
 
84
97
  # Checks equality by comparing each attribute.
85
98
  # @param [Object] Object to be compared
86
- def ==(other)
87
- return true if equal?(other)
88
-
89
- self.class == other.class &&
90
- buyer == other.buyer &&
91
- charge == other.charge &&
92
- redirect == other.redirect
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ buyer == o.buyer &&
103
+ charge == o.charge &&
104
+ redirect == o.redirect
93
105
  end
94
106
 
95
107
  # @see the `==` method
96
108
  # @param [Object] Object to be compared
97
- def eql?(other)
98
- self == other
109
+ def eql?(o)
110
+ self == o
99
111
  end
100
112
 
101
113
  # Calculates hash code according to all attributes.
@@ -109,18 +121,19 @@ module Api
109
121
  # @return [Object] Returns the model itself
110
122
  def self.build_from_hash(attributes)
111
123
  return nil unless attributes.is_a?(Hash)
112
-
113
124
  attributes = attributes.transform_keys(&:to_sym)
114
125
  transformed_hash = {}
115
126
  openapi_types.each_pair do |key, type|
116
127
  if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
117
- transformed_hash[key.to_s] = nil
128
+ transformed_hash["#{key}"] = nil
118
129
  elsif type =~ /\AArray<(.*)>/i
119
130
  # check to ensure the input is an array given that the attribute
120
131
  # is documented as an array but the input is not
121
- 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)
132
+ if attributes[attribute_map[key]].is_a?(Array)
133
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
134
+ end
122
135
  elsif !attributes[attribute_map[key]].nil?
123
- transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
136
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
124
137
  end
125
138
  end
126
139
  new(transformed_hash)
@@ -186,7 +199,7 @@ module Api
186
199
  def to_hash
187
200
  hash = {}
188
201
  self.class.attribute_map.each_pair do |attr, param|
189
- value = send(attr)
202
+ value = self.send(attr)
190
203
  if value.nil?
191
204
  is_nullable = self.class.openapi_nullable.include?(attr)
192
205
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
@@ -214,5 +227,7 @@ module Api
214
227
  value
215
228
  end
216
229
  end
230
+
217
231
  end
232
+
218
233
  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,15 +16,21 @@ require 'time'
16
16
  module Api
17
17
  # Response message after successfully creating a contract with an initial charge. Contains all information about the created contract, charge, customer, and payment link for further interactions.
18
18
  class CreateContractWithChargeResponse
19
- attr_accessor :contract, :charge, :customer, :payment_link
19
+ attr_accessor :contract
20
+
21
+ attr_accessor :charge
22
+
23
+ attr_accessor :customer
24
+
25
+ attr_accessor :payment_link
20
26
 
21
27
  # Attribute mapping from ruby-style variable name to JSON key.
22
28
  def self.attribute_map
23
29
  {
24
- :contract => :contract,
25
- :charge => :charge,
26
- :customer => :customer,
27
- :payment_link => :paymentLink
30
+ :'contract' => :'contract',
31
+ :'charge' => :'charge',
32
+ :'customer' => :'customer',
33
+ :'payment_link' => :'paymentLink'
28
34
  }
29
35
  end
30
36
 
@@ -36,46 +42,57 @@ module Api
36
42
  # Attribute type mapping.
37
43
  def self.openapi_types
38
44
  {
39
- :contract => :Contract,
40
- :charge => :Charge,
41
- :customer => :Customer,
42
- :payment_link => :PaymentLink
45
+ :'contract' => :'Contract',
46
+ :'charge' => :'Charge',
47
+ :'customer' => :'Customer',
48
+ :'payment_link' => :'PaymentLink'
43
49
  }
44
50
  end
45
51
 
46
52
  # List of attributes with nullable: true
47
53
  def self.openapi_nullable
48
- Set.new([])
54
+ Set.new([
55
+ ])
49
56
  end
50
57
 
51
58
  # Initializes the object
52
59
  # @param [Hash] attributes Model attributes in the form of hash
53
60
  def initialize(attributes = {})
54
- raise ArgumentError, 'The input argument (attributes) must be a hash in `Api::CreateContractWithChargeResponse` initialize method' unless attributes.is_a?(Hash)
61
+ if (!attributes.is_a?(Hash))
62
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Api::CreateContractWithChargeResponse` initialize method"
63
+ end
55
64
 
56
65
  # 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::CreateContractWithChargeResponse`. 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
-
66
+ attributes = attributes.each_with_object({}) { |(k, v), h|
67
+ if (!self.class.attribute_map.key?(k.to_sym))
68
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Api::CreateContractWithChargeResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
69
+ end
60
70
  h[k.to_sym] = v
61
- end
62
-
63
- self.contract = attributes[:contract] if attributes.key?(:contract)
71
+ }
64
72
 
65
- self.charge = attributes[:charge] if attributes.key?(:charge)
73
+ if attributes.key?(:'contract')
74
+ self.contract = attributes[:'contract']
75
+ end
66
76
 
67
- self.customer = attributes[:customer] if attributes.key?(:customer)
77
+ if attributes.key?(:'charge')
78
+ self.charge = attributes[:'charge']
79
+ end
68
80
 
69
- return unless attributes.key?(:payment_link)
81
+ if attributes.key?(:'customer')
82
+ self.customer = attributes[:'customer']
83
+ end
70
84
 
71
- self.payment_link = attributes[:payment_link]
85
+ if attributes.key?(:'payment_link')
86
+ self.payment_link = attributes[:'payment_link']
87
+ end
72
88
  end
73
89
 
74
90
  # Show invalid properties with the reasons. Usually used together with valid?
75
91
  # @return Array for valid properties with the reasons
76
92
  def list_invalid_properties
77
93
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
78
- []
94
+ invalid_properties = Array.new
95
+ invalid_properties
79
96
  end
80
97
 
81
98
  # Check to see if the all the properties in the model are valid
@@ -87,20 +104,19 @@ module Api
87
104
 
88
105
  # Checks equality by comparing each attribute.
89
106
  # @param [Object] Object to be compared
90
- def ==(other)
91
- return true if equal?(other)
92
-
93
- self.class == other.class &&
94
- contract == other.contract &&
95
- charge == other.charge &&
96
- customer == other.customer &&
97
- payment_link == other.payment_link
107
+ def ==(o)
108
+ return true if self.equal?(o)
109
+ self.class == o.class &&
110
+ contract == o.contract &&
111
+ charge == o.charge &&
112
+ customer == o.customer &&
113
+ payment_link == o.payment_link
98
114
  end
99
115
 
100
116
  # @see the `==` method
101
117
  # @param [Object] Object to be compared
102
- def eql?(other)
103
- self == other
118
+ def eql?(o)
119
+ self == o
104
120
  end
105
121
 
106
122
  # Calculates hash code according to all attributes.
@@ -114,18 +130,19 @@ module Api
114
130
  # @return [Object] Returns the model itself
115
131
  def self.build_from_hash(attributes)
116
132
  return nil unless attributes.is_a?(Hash)
117
-
118
133
  attributes = attributes.transform_keys(&:to_sym)
119
134
  transformed_hash = {}
120
135
  openapi_types.each_pair do |key, type|
121
136
  if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
122
- transformed_hash[key.to_s] = nil
137
+ transformed_hash["#{key}"] = nil
123
138
  elsif type =~ /\AArray<(.*)>/i
124
139
  # check to ensure the input is an array given that the attribute
125
140
  # is documented as an array but the input is not
126
- 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)
141
+ if attributes[attribute_map[key]].is_a?(Array)
142
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
143
+ end
127
144
  elsif !attributes[attribute_map[key]].nil?
128
- transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
145
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
129
146
  end
130
147
  end
131
148
  new(transformed_hash)
@@ -191,7 +208,7 @@ module Api
191
208
  def to_hash
192
209
  hash = {}
193
210
  self.class.attribute_map.each_pair do |attr, param|
194
- value = send(attr)
211
+ value = self.send(attr)
195
212
  if value.nil?
196
213
  is_nullable = self.class.openapi_nullable.include?(attr)
197
214
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
@@ -219,5 +236,7 @@ module Api
219
236
  value
220
237
  end
221
238
  end
239
+
222
240
  end
241
+
223
242
  end