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'
@@ -16,18 +16,30 @@ require 'time'
16
16
  module Api
17
17
  # Customer object.
18
18
  class Customer
19
- attr_accessor :id, :email, :activated, :status, :bank_information, :created_at, :updated_at
19
+ attr_accessor :id
20
+
21
+ attr_accessor :email
22
+
23
+ attr_accessor :activated
24
+
25
+ attr_accessor :status
26
+
27
+ attr_accessor :bank_information
28
+
29
+ attr_accessor :created_at
30
+
31
+ attr_accessor :updated_at
20
32
 
21
33
  # Attribute mapping from ruby-style variable name to JSON key.
22
34
  def self.attribute_map
23
35
  {
24
- :id => :id,
25
- :email => :email,
26
- :activated => :activated,
27
- :status => :status,
28
- :bank_information => :bankInformation,
29
- :created_at => :createdAt,
30
- :updated_at => :updatedAt
36
+ :'id' => :'id',
37
+ :'email' => :'email',
38
+ :'activated' => :'activated',
39
+ :'status' => :'status',
40
+ :'bank_information' => :'bankInformation',
41
+ :'created_at' => :'createdAt',
42
+ :'updated_at' => :'updatedAt'
31
43
  }
32
44
  end
33
45
 
@@ -39,55 +51,72 @@ module Api
39
51
  # Attribute type mapping.
40
52
  def self.openapi_types
41
53
  {
42
- :id => :String,
43
- :email => :String,
44
- :activated => :Boolean,
45
- :status => :Apiv1Status,
46
- :bank_information => :BankInformation,
47
- :created_at => :Time,
48
- :updated_at => :Time
54
+ :'id' => :'String',
55
+ :'email' => :'String',
56
+ :'activated' => :'Boolean',
57
+ :'status' => :'Apiv1Status',
58
+ :'bank_information' => :'BankInformation',
59
+ :'created_at' => :'Time',
60
+ :'updated_at' => :'Time'
49
61
  }
50
62
  end
51
63
 
52
64
  # List of attributes with nullable: true
53
65
  def self.openapi_nullable
54
- Set.new([])
66
+ Set.new([
67
+ ])
55
68
  end
56
69
 
57
70
  # Initializes the object
58
71
  # @param [Hash] attributes Model attributes in the form of hash
59
72
  def initialize(attributes = {})
60
- raise ArgumentError, 'The input argument (attributes) must be a hash in `Api::Customer` initialize method' unless attributes.is_a?(Hash)
73
+ if (!attributes.is_a?(Hash))
74
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Api::Customer` initialize method"
75
+ end
61
76
 
62
77
  # check to see if the attribute exists and convert string to symbol for hash key
63
- attributes = attributes.each_with_object({}) do |(k, v), h|
64
- raise ArgumentError, "`#{k}` is not a valid attribute in `Api::Customer`. 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)
65
-
78
+ attributes = attributes.each_with_object({}) { |(k, v), h|
79
+ if (!self.class.attribute_map.key?(k.to_sym))
80
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Api::Customer`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
81
+ end
66
82
  h[k.to_sym] = v
67
- end
68
-
69
- self.id = attributes[:id] if attributes.key?(:id)
83
+ }
70
84
 
71
- self.email = attributes[:email] if attributes.key?(:email)
85
+ if attributes.key?(:'id')
86
+ self.id = attributes[:'id']
87
+ end
72
88
 
73
- self.activated = attributes[:activated] if attributes.key?(:activated)
89
+ if attributes.key?(:'email')
90
+ self.email = attributes[:'email']
91
+ end
74
92
 
75
- self.status = attributes[:status] if attributes.key?(:status)
93
+ if attributes.key?(:'activated')
94
+ self.activated = attributes[:'activated']
95
+ end
76
96
 
77
- self.bank_information = attributes[:bank_information] if attributes.key?(:bank_information)
97
+ if attributes.key?(:'status')
98
+ self.status = attributes[:'status']
99
+ end
78
100
 
79
- self.created_at = attributes[:created_at] if attributes.key?(:created_at)
101
+ if attributes.key?(:'bank_information')
102
+ self.bank_information = attributes[:'bank_information']
103
+ end
80
104
 
81
- return unless attributes.key?(:updated_at)
105
+ if attributes.key?(:'created_at')
106
+ self.created_at = attributes[:'created_at']
107
+ end
82
108
 
83
- self.updated_at = attributes[:updated_at]
109
+ if attributes.key?(:'updated_at')
110
+ self.updated_at = attributes[:'updated_at']
111
+ end
84
112
  end
85
113
 
86
114
  # Show invalid properties with the reasons. Usually used together with valid?
87
115
  # @return Array for valid properties with the reasons
88
116
  def list_invalid_properties
89
117
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
90
- []
118
+ invalid_properties = Array.new
119
+ invalid_properties
91
120
  end
92
121
 
93
122
  # Check to see if the all the properties in the model are valid
@@ -99,23 +128,22 @@ module Api
99
128
 
100
129
  # Checks equality by comparing each attribute.
101
130
  # @param [Object] Object to be compared
102
- def ==(other)
103
- return true if equal?(other)
104
-
105
- self.class == other.class &&
106
- id == other.id &&
107
- email == other.email &&
108
- activated == other.activated &&
109
- status == other.status &&
110
- bank_information == other.bank_information &&
111
- created_at == other.created_at &&
112
- updated_at == other.updated_at
131
+ def ==(o)
132
+ return true if self.equal?(o)
133
+ self.class == o.class &&
134
+ id == o.id &&
135
+ email == o.email &&
136
+ activated == o.activated &&
137
+ status == o.status &&
138
+ bank_information == o.bank_information &&
139
+ created_at == o.created_at &&
140
+ updated_at == o.updated_at
113
141
  end
114
142
 
115
143
  # @see the `==` method
116
144
  # @param [Object] Object to be compared
117
- def eql?(other)
118
- self == other
145
+ def eql?(o)
146
+ self == o
119
147
  end
120
148
 
121
149
  # Calculates hash code according to all attributes.
@@ -129,18 +157,19 @@ module Api
129
157
  # @return [Object] Returns the model itself
130
158
  def self.build_from_hash(attributes)
131
159
  return nil unless attributes.is_a?(Hash)
132
-
133
160
  attributes = attributes.transform_keys(&:to_sym)
134
161
  transformed_hash = {}
135
162
  openapi_types.each_pair do |key, type|
136
163
  if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
137
- transformed_hash[key.to_s] = nil
164
+ transformed_hash["#{key}"] = nil
138
165
  elsif type =~ /\AArray<(.*)>/i
139
166
  # check to ensure the input is an array given that the attribute
140
167
  # is documented as an array but the input is not
141
- 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)
168
+ if attributes[attribute_map[key]].is_a?(Array)
169
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
170
+ end
142
171
  elsif !attributes[attribute_map[key]].nil?
143
- transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
172
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
144
173
  end
145
174
  end
146
175
  new(transformed_hash)
@@ -206,7 +235,7 @@ module Api
206
235
  def to_hash
207
236
  hash = {}
208
237
  self.class.attribute_map.each_pair do |attr, param|
209
- value = send(attr)
238
+ value = self.send(attr)
210
239
  if value.nil?
211
240
  is_nullable = self.class.openapi_nullable.include?(attr)
212
241
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
@@ -234,5 +263,7 @@ module Api
234
263
  value
235
264
  end
236
265
  end
266
+
237
267
  end
268
+
238
269
  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'
@@ -20,7 +20,7 @@ module Api
20
20
  # Attribute mapping from ruby-style variable name to JSON key.
21
21
  def self.attribute_map
22
22
  {
23
- :accepted => :accepted
23
+ :'accepted' => :'accepted'
24
24
  }
25
25
  end
26
26
 
@@ -32,37 +32,42 @@ module Api
32
32
  # Attribute type mapping.
33
33
  def self.openapi_types
34
34
  {
35
- :accepted => :Boolean
35
+ :'accepted' => :'Boolean'
36
36
  }
37
37
  end
38
38
 
39
39
  # List of attributes with nullable: true
40
40
  def self.openapi_nullable
41
- Set.new([])
41
+ Set.new([
42
+ ])
42
43
  end
43
44
 
44
45
  # Initializes the object
45
46
  # @param [Hash] attributes Model attributes in the form of hash
46
47
  def initialize(attributes = {})
47
- raise ArgumentError, 'The input argument (attributes) must be a hash in `Api::DeleteCustomerResponse` initialize method' unless attributes.is_a?(Hash)
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Api::DeleteCustomerResponse` initialize method"
50
+ end
48
51
 
49
52
  # check to see if the attribute exists and convert string to symbol for hash key
50
- attributes = attributes.each_with_object({}) do |(k, v), h|
51
- raise ArgumentError, "`#{k}` is not a valid attribute in `Api::DeleteCustomerResponse`. 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)
52
-
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Api::DeleteCustomerResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
53
57
  h[k.to_sym] = v
54
- end
55
-
56
- return unless attributes.key?(:accepted)
58
+ }
57
59
 
58
- self.accepted = attributes[:accepted]
60
+ if attributes.key?(:'accepted')
61
+ self.accepted = attributes[:'accepted']
62
+ end
59
63
  end
60
64
 
61
65
  # Show invalid properties with the reasons. Usually used together with valid?
62
66
  # @return Array for valid properties with the reasons
63
67
  def list_invalid_properties
64
68
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
65
- []
69
+ invalid_properties = Array.new
70
+ invalid_properties
66
71
  end
67
72
 
68
73
  # Check to see if the all the properties in the model are valid
@@ -74,17 +79,16 @@ module Api
74
79
 
75
80
  # Checks equality by comparing each attribute.
76
81
  # @param [Object] Object to be compared
77
- def ==(other)
78
- return true if equal?(other)
79
-
80
- self.class == other.class &&
81
- accepted == other.accepted
82
+ def ==(o)
83
+ return true if self.equal?(o)
84
+ self.class == o.class &&
85
+ accepted == o.accepted
82
86
  end
83
87
 
84
88
  # @see the `==` method
85
89
  # @param [Object] Object to be compared
86
- def eql?(other)
87
- self == other
90
+ def eql?(o)
91
+ self == o
88
92
  end
89
93
 
90
94
  # Calculates hash code according to all attributes.
@@ -98,18 +102,19 @@ module Api
98
102
  # @return [Object] Returns the model itself
99
103
  def self.build_from_hash(attributes)
100
104
  return nil unless attributes.is_a?(Hash)
101
-
102
105
  attributes = attributes.transform_keys(&:to_sym)
103
106
  transformed_hash = {}
104
107
  openapi_types.each_pair do |key, type|
105
108
  if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
106
- transformed_hash[key.to_s] = nil
109
+ transformed_hash["#{key}"] = nil
107
110
  elsif type =~ /\AArray<(.*)>/i
108
111
  # check to ensure the input is an array given that the attribute
109
112
  # is documented as an array but the input is not
110
- 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)
113
+ if attributes[attribute_map[key]].is_a?(Array)
114
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
115
+ end
111
116
  elsif !attributes[attribute_map[key]].nil?
112
- transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
117
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
113
118
  end
114
119
  end
115
120
  new(transformed_hash)
@@ -175,7 +180,7 @@ module Api
175
180
  def to_hash
176
181
  hash = {}
177
182
  self.class.attribute_map.each_pair do |attr, param|
178
- value = send(attr)
183
+ value = self.send(attr)
179
184
  if value.nil?
180
185
  is_nullable = self.class.openapi_nullable.include?(attr)
181
186
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
@@ -203,5 +208,7 @@ module Api
203
208
  value
204
209
  end
205
210
  end
211
+
206
212
  end
213
+
207
214
  end
@@ -1,23 +1,23 @@
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 DepositType
18
- UNSPECIFIED = 'DEPOSIT_TYPE_UNSPECIFIED'
19
- SAVINGS = 'DEPOSIT_TYPE_SAVINGS'
20
- CHECKING = 'DEPOSIT_TYPE_CHECKING'
18
+ UNSPECIFIED = "DEPOSIT_TYPE_UNSPECIFIED".freeze
19
+ SAVINGS = "DEPOSIT_TYPE_SAVINGS".freeze
20
+ CHECKING = "DEPOSIT_TYPE_CHECKING".freeze
21
21
 
22
22
  def self.all_vars
23
23
  @all_vars ||= [UNSPECIFIED, SAVINGS, CHECKING].freeze
@@ -35,7 +35,6 @@ module Api
35
35
  # @return [String] The enum value
36
36
  def build_from_hash(value)
37
37
  return value if DepositType.all_vars.include?(value)
38
-
39
38
  raise "Invalid ENUM value #{value} for class #DepositType"
40
39
  end
41
40
  end
@@ -1,31 +1,33 @@
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 ErrorDetail
18
- attr_accessor :type, :debug
18
+ attr_accessor :type
19
19
 
20
20
  # Base64 encoded value of the message.
21
21
  attr_accessor :value
22
22
 
23
+ attr_accessor :debug
24
+
23
25
  # Attribute mapping from ruby-style variable name to JSON key.
24
26
  def self.attribute_map
25
27
  {
26
- :type => :type,
27
- :value => :value,
28
- :debug => :debug
28
+ :'type' => :'type',
29
+ :'value' => :'value',
30
+ :'debug' => :'debug'
29
31
  }
30
32
  end
31
33
 
@@ -37,43 +39,52 @@ module Api
37
39
  # Attribute type mapping.
38
40
  def self.openapi_types
39
41
  {
40
- :type => :String,
41
- :value => :String,
42
- :debug => :String
42
+ :'type' => :'String',
43
+ :'value' => :'String',
44
+ :'debug' => :'String'
43
45
  }
44
46
  end
45
47
 
46
48
  # List of attributes with nullable: true
47
49
  def self.openapi_nullable
48
- Set.new([])
50
+ Set.new([
51
+ ])
49
52
  end
50
53
 
51
54
  # Initializes the object
52
55
  # @param [Hash] attributes Model attributes in the form of hash
53
56
  def initialize(attributes = {})
54
- raise ArgumentError, 'The input argument (attributes) must be a hash in `Api::ErrorDetail` 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::ErrorDetail` initialize method"
59
+ end
55
60
 
56
61
  # 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::ErrorDetail`. 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
-
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::ErrorDetail`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
65
+ end
60
66
  h[k.to_sym] = v
61
- end
62
-
63
- self.type = attributes[:type] if attributes.key?(:type)
67
+ }
64
68
 
65
- self.value = attributes[:value] if attributes.key?(:value)
69
+ if attributes.key?(:'type')
70
+ self.type = attributes[:'type']
71
+ end
66
72
 
67
- return unless attributes.key?(:debug)
73
+ if attributes.key?(:'value')
74
+ self.value = attributes[:'value']
75
+ end
68
76
 
69
- self.debug = attributes[:debug]
77
+ if attributes.key?(:'debug')
78
+ self.debug = attributes[:'debug']
79
+ end
70
80
  end
71
81
 
72
82
  # Show invalid properties with the reasons. Usually used together with valid?
73
83
  # @return Array for valid properties with the reasons
74
84
  def list_invalid_properties
75
85
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
76
- []
86
+ invalid_properties = Array.new
87
+ invalid_properties
77
88
  end
78
89
 
79
90
  # Check to see if the all the properties in the model are valid
@@ -85,19 +96,18 @@ module Api
85
96
 
86
97
  # Checks equality by comparing each attribute.
87
98
  # @param [Object] Object to be compared
88
- def ==(other)
89
- return true if equal?(other)
90
-
91
- self.class == other.class &&
92
- type == other.type &&
93
- value == other.value &&
94
- debug == other.debug
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ type == o.type &&
103
+ value == o.value &&
104
+ debug == o.debug
95
105
  end
96
106
 
97
107
  # @see the `==` method
98
108
  # @param [Object] Object to be compared
99
- def eql?(other)
100
- self == other
109
+ def eql?(o)
110
+ self == o
101
111
  end
102
112
 
103
113
  # Calculates hash code according to all attributes.
@@ -111,18 +121,19 @@ module Api
111
121
  # @return [Object] Returns the model itself
112
122
  def self.build_from_hash(attributes)
113
123
  return nil unless attributes.is_a?(Hash)
114
-
115
124
  attributes = attributes.transform_keys(&:to_sym)
116
125
  transformed_hash = {}
117
126
  openapi_types.each_pair do |key, type|
118
127
  if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
119
- transformed_hash[key.to_s] = nil
128
+ transformed_hash["#{key}"] = nil
120
129
  elsif type =~ /\AArray<(.*)>/i
121
130
  # check to ensure the input is an array given that the attribute
122
131
  # is documented as an array but the input is not
123
- 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
124
135
  elsif !attributes[attribute_map[key]].nil?
125
- transformed_hash[key.to_s] = _deserialize(type, attributes[attribute_map[key]])
136
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
126
137
  end
127
138
  end
128
139
  new(transformed_hash)
@@ -188,7 +199,7 @@ module Api
188
199
  def to_hash
189
200
  hash = {}
190
201
  self.class.attribute_map.each_pair do |attr, param|
191
- value = send(attr)
202
+ value = self.send(attr)
192
203
  if value.nil?
193
204
  is_nullable = self.class.openapi_nullable.include?(attr)
194
205
  next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
@@ -216,5 +227,7 @@ module Api
216
227
  value
217
228
  end
218
229
  end
230
+
219
231
  end
232
+
220
233
  end