jamm 1.2.2 → 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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/jamm/api/api/customer_api.rb +82 -52
- data/lib/jamm/api/api/healthcheck_api.rb +18 -15
- data/lib/jamm/api/api/payment_api.rb +113 -62
- data/lib/jamm/api/api/webhook_service_api.rb +91 -19
- data/lib/jamm/api/api_client.rb +74 -66
- data/lib/jamm/api/api_error.rb +16 -16
- data/lib/jamm/api/configuration.rb +42 -34
- data/lib/jamm/api/models/apiv1_error.rb +238 -0
- data/lib/jamm/api/models/apiv1_status.rb +57 -47
- data/lib/jamm/api/models/customer_service_update_customer_body.rb +107 -69
- data/lib/jamm/api/models/googlerpc_status.rb +61 -45
- data/lib/jamm/api/models/protobuf_any.rb +42 -35
- data/lib/jamm/api/models/v1_add_charge_request.rb +59 -44
- data/lib/jamm/api/models/v1_add_charge_response.rb +59 -44
- data/lib/jamm/api/models/v1_bank.rb +350 -0
- data/lib/jamm/api/models/v1_bank_assets.rb +244 -0
- data/lib/jamm/api/models/v1_bank_branch.rb +259 -0
- data/lib/jamm/api/models/v1_bank_information.rb +71 -51
- data/lib/jamm/api/models/v1_bank_quota.rb +278 -0
- data/lib/jamm/api/models/v1_bank_scheduled_maintenance_period.rb +250 -0
- data/lib/jamm/api/models/v1_buyer.rb +104 -76
- data/lib/jamm/api/models/v1_charge.rb +67 -52
- data/lib/jamm/api/models/v1_charge_message.rb +151 -93
- data/lib/jamm/api/models/v1_charge_message_status.rb +17 -18
- data/lib/jamm/api/models/v1_charge_result.rb +152 -93
- data/lib/jamm/api/models/v1_contract.rb +64 -52
- data/lib/jamm/api/models/v1_contract_message.rb +67 -48
- data/lib/jamm/api/models/v1_contract_status.rb +20 -21
- data/lib/jamm/api/models/v1_create_contract_with_charge_request.rb +59 -44
- data/lib/jamm/api/models/v1_create_contract_with_charge_response.rb +67 -48
- data/lib/jamm/api/models/v1_create_contract_without_charge_request.rb +51 -40
- data/lib/jamm/api/models/v1_create_contract_without_charge_response.rb +59 -44
- data/lib/jamm/api/models/v1_create_customer_request.rb +42 -35
- data/lib/jamm/api/models/v1_create_customer_response.rb +42 -35
- data/lib/jamm/api/models/v1_customer.rb +91 -60
- data/lib/jamm/api/models/v1_delete_customer_response.rb +42 -35
- data/lib/jamm/api/models/v1_deposit_type.rb +14 -15
- data/lib/jamm/api/models/v1_error_detail.rb +233 -0
- data/lib/jamm/api/models/v1_error_response.rb +238 -0
- data/lib/jamm/api/models/v1_error_type.rb +57 -0
- data/lib/jamm/api/models/v1_event_type.rb +20 -21
- data/lib/jamm/api/models/{v1_error.rb → v1_get_bank_response.rb} +45 -48
- data/lib/jamm/api/models/v1_get_branch_response.rb +214 -0
- data/lib/jamm/api/models/v1_get_branches_response.rb +216 -0
- data/lib/jamm/api/models/v1_get_charge_response.rb +51 -40
- data/lib/jamm/api/models/v1_get_charges_response.rb +60 -45
- data/lib/jamm/api/models/v1_get_contract_response.rb +51 -40
- data/lib/jamm/api/models/v1_get_customer_response.rb +42 -35
- data/lib/jamm/api/models/v1_get_major_banks_response.rb +232 -0
- data/lib/jamm/api/models/v1_initial_charge.rb +61 -48
- data/lib/jamm/api/models/v1_kyc_status.rb +16 -17
- data/lib/jamm/api/models/v1_merchant.rb +51 -40
- data/lib/jamm/api/models/v1_merchant_customer.rb +51 -40
- data/lib/jamm/api/models/v1_merchant_webhook_message.rb +75 -57
- data/lib/jamm/api/models/v1_message_response.rb +67 -48
- data/lib/jamm/api/models/v1_off_session_payment_request.rb +51 -40
- data/lib/jamm/api/models/v1_off_session_payment_response.rb +51 -40
- data/lib/jamm/api/models/v1_on_session_payment_data.rb +67 -48
- data/lib/jamm/api/models/v1_on_session_payment_error.rb +55 -45
- data/lib/jamm/api/models/v1_on_session_payment_error_code.rb +21 -22
- data/lib/jamm/api/models/v1_on_session_payment_request.rb +67 -48
- data/lib/jamm/api/models/v1_on_session_payment_response.rb +59 -44
- data/lib/jamm/api/models/v1_pagination.rb +51 -40
- data/lib/jamm/api/models/v1_payment_authorization_status.rb +14 -15
- data/lib/jamm/api/models/v1_payment_link.rb +57 -44
- data/lib/jamm/api/models/v1_ping_response.rb +42 -35
- data/lib/jamm/api/models/v1_search_banks_response.rb +216 -0
- data/lib/jamm/api/models/v1_search_branches_response.rb +216 -0
- data/lib/jamm/api/models/v1_update_customer_response.rb +42 -35
- data/lib/jamm/api/models/v1_url.rb +48 -39
- data/lib/jamm/api/models/v1_user_account_message.rb +67 -48
- data/lib/jamm/api/models/v1_withdraw_request.rb +51 -40
- data/lib/jamm/api/models/v1_withdraw_response.rb +51 -40
- data/lib/jamm/api/version.rb +11 -11
- data/lib/jamm/api.rb +25 -11
- data/lib/jamm/charge.rb +12 -0
- data/lib/jamm/deprecation.rb +13 -0
- data/lib/jamm/errors.rb +27 -1
- data/lib/jamm/payment.rb +61 -0
- data/lib/jamm/version.rb +1 -1
- data/lib/jamm.rb +2 -0
- metadata +19 -3
@@ -1,28 +1,32 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
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 GetChargesResponse
|
18
|
-
attr_accessor :charges
|
18
|
+
attr_accessor :charges
|
19
|
+
|
20
|
+
attr_accessor :customer
|
21
|
+
|
22
|
+
attr_accessor :pagination
|
19
23
|
|
20
24
|
# Attribute mapping from ruby-style variable name to JSON key.
|
21
25
|
def self.attribute_map
|
22
26
|
{
|
23
|
-
:charges => :charges,
|
24
|
-
:customer => :customer,
|
25
|
-
:pagination => :pagination
|
27
|
+
:'charges' => :'charges',
|
28
|
+
:'customer' => :'customer',
|
29
|
+
:'pagination' => :'pagination'
|
26
30
|
}
|
27
31
|
end
|
28
32
|
|
@@ -34,45 +38,54 @@ module Api
|
|
34
38
|
# Attribute type mapping.
|
35
39
|
def self.openapi_types
|
36
40
|
{
|
37
|
-
:charges => :'Array<ChargeResult>',
|
38
|
-
:customer => :Customer,
|
39
|
-
:pagination => :Pagination
|
41
|
+
:'charges' => :'Array<ChargeResult>',
|
42
|
+
:'customer' => :'Customer',
|
43
|
+
:'pagination' => :'Pagination'
|
40
44
|
}
|
41
45
|
end
|
42
46
|
|
43
47
|
# List of attributes with nullable: true
|
44
48
|
def self.openapi_nullable
|
45
|
-
Set.new([
|
49
|
+
Set.new([
|
50
|
+
])
|
46
51
|
end
|
47
52
|
|
48
53
|
# Initializes the object
|
49
54
|
# @param [Hash] attributes Model attributes in the form of hash
|
50
55
|
def initialize(attributes = {})
|
51
|
-
|
56
|
+
if (!attributes.is_a?(Hash))
|
57
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Api::GetChargesResponse` initialize method"
|
58
|
+
end
|
52
59
|
|
53
60
|
# check to see if the attribute exists and convert string to symbol for hash key
|
54
|
-
attributes = attributes.each_with_object({})
|
55
|
-
|
56
|
-
|
61
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
62
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
63
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Api::GetChargesResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
64
|
+
end
|
57
65
|
h[k.to_sym] = v
|
58
|
-
|
66
|
+
}
|
59
67
|
|
60
|
-
if attributes.key?(:charges)
|
61
|
-
|
68
|
+
if attributes.key?(:'charges')
|
69
|
+
if (value = attributes[:'charges']).is_a?(Array)
|
70
|
+
self.charges = value
|
71
|
+
end
|
62
72
|
end
|
63
73
|
|
64
|
-
|
65
|
-
|
66
|
-
|
74
|
+
if attributes.key?(:'customer')
|
75
|
+
self.customer = attributes[:'customer']
|
76
|
+
end
|
67
77
|
|
68
|
-
|
78
|
+
if attributes.key?(:'pagination')
|
79
|
+
self.pagination = attributes[:'pagination']
|
80
|
+
end
|
69
81
|
end
|
70
82
|
|
71
83
|
# Show invalid properties with the reasons. Usually used together with valid?
|
72
84
|
# @return Array for valid properties with the reasons
|
73
85
|
def list_invalid_properties
|
74
86
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
75
|
-
|
87
|
+
invalid_properties = Array.new
|
88
|
+
invalid_properties
|
76
89
|
end
|
77
90
|
|
78
91
|
# Check to see if the all the properties in the model are valid
|
@@ -84,19 +97,18 @@ module Api
|
|
84
97
|
|
85
98
|
# Checks equality by comparing each attribute.
|
86
99
|
# @param [Object] Object to be compared
|
87
|
-
def ==(
|
88
|
-
return true if equal?(
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
pagination == other.pagination
|
100
|
+
def ==(o)
|
101
|
+
return true if self.equal?(o)
|
102
|
+
self.class == o.class &&
|
103
|
+
charges == o.charges &&
|
104
|
+
customer == o.customer &&
|
105
|
+
pagination == o.pagination
|
94
106
|
end
|
95
107
|
|
96
108
|
# @see the `==` method
|
97
109
|
# @param [Object] Object to be compared
|
98
|
-
def eql?(
|
99
|
-
self ==
|
110
|
+
def eql?(o)
|
111
|
+
self == o
|
100
112
|
end
|
101
113
|
|
102
114
|
# Calculates hash code according to all attributes.
|
@@ -110,18 +122,19 @@ module Api
|
|
110
122
|
# @return [Object] Returns the model itself
|
111
123
|
def self.build_from_hash(attributes)
|
112
124
|
return nil unless attributes.is_a?(Hash)
|
113
|
-
|
114
125
|
attributes = attributes.transform_keys(&:to_sym)
|
115
126
|
transformed_hash = {}
|
116
127
|
openapi_types.each_pair do |key, type|
|
117
128
|
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
118
|
-
transformed_hash[key
|
129
|
+
transformed_hash["#{key}"] = nil
|
119
130
|
elsif type =~ /\AArray<(.*)>/i
|
120
131
|
# check to ensure the input is an array given that the attribute
|
121
132
|
# is documented as an array but the input is not
|
122
|
-
|
133
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
134
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
135
|
+
end
|
123
136
|
elsif !attributes[attribute_map[key]].nil?
|
124
|
-
transformed_hash[key
|
137
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
125
138
|
end
|
126
139
|
end
|
127
140
|
new(transformed_hash)
|
@@ -187,7 +200,7 @@ module Api
|
|
187
200
|
def to_hash
|
188
201
|
hash = {}
|
189
202
|
self.class.attribute_map.each_pair do |attr, param|
|
190
|
-
value = send(attr)
|
203
|
+
value = self.send(attr)
|
191
204
|
if value.nil?
|
192
205
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
193
206
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
@@ -215,5 +228,7 @@ module Api
|
|
215
228
|
value
|
216
229
|
end
|
217
230
|
end
|
231
|
+
|
218
232
|
end
|
233
|
+
|
219
234
|
end
|
@@ -1,27 +1,29 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
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 GetContractResponse
|
18
|
-
attr_accessor :customer
|
18
|
+
attr_accessor :customer
|
19
|
+
|
20
|
+
attr_accessor :contract
|
19
21
|
|
20
22
|
# Attribute mapping from ruby-style variable name to JSON key.
|
21
23
|
def self.attribute_map
|
22
24
|
{
|
23
|
-
:customer => :customer,
|
24
|
-
:contract => :contract
|
25
|
+
:'customer' => :'customer',
|
26
|
+
:'contract' => :'contract'
|
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
|
-
:customer => :MerchantCustomer,
|
37
|
-
:contract => :Contract
|
38
|
+
:'customer' => :'MerchantCustomer',
|
39
|
+
:'contract' => :'Contract'
|
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
|
-
|
52
|
+
if (!attributes.is_a?(Hash))
|
53
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Api::GetContractResponse` 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({})
|
53
|
-
|
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::GetContractResponse`. 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
|
-
|
57
|
-
|
58
|
-
self.customer = attributes[:customer] if attributes.key?(:customer)
|
62
|
+
}
|
59
63
|
|
60
|
-
|
64
|
+
if attributes.key?(:'customer')
|
65
|
+
self.customer = attributes[:'customer']
|
66
|
+
end
|
61
67
|
|
62
|
-
|
68
|
+
if attributes.key?(:'contract')
|
69
|
+
self.contract = attributes[:'contract']
|
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 ==(
|
82
|
-
return true if equal?(
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
contract == other.contract
|
90
|
+
def ==(o)
|
91
|
+
return true if self.equal?(o)
|
92
|
+
self.class == o.class &&
|
93
|
+
customer == o.customer &&
|
94
|
+
contract == o.contract
|
87
95
|
end
|
88
96
|
|
89
97
|
# @see the `==` method
|
90
98
|
# @param [Object] Object to be compared
|
91
|
-
def eql?(
|
92
|
-
self ==
|
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
|
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
|
-
|
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
|
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
|
-
|
2
|
-
|
3
|
-
|
4
|
-
#
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
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
|
-
:customer => :customer
|
23
|
+
:'customer' => :'customer'
|
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
|
-
:customer => :Customer
|
35
|
+
:'customer' => :'Customer'
|
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
|
-
|
48
|
+
if (!attributes.is_a?(Hash))
|
49
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Api::GetCustomerResponse` 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({})
|
51
|
-
|
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::GetCustomerResponse`. 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
|
-
|
55
|
-
|
56
|
-
return unless attributes.key?(:customer)
|
58
|
+
}
|
57
59
|
|
58
|
-
|
60
|
+
if attributes.key?(:'customer')
|
61
|
+
self.customer = attributes[:'customer']
|
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 ==(
|
78
|
-
return true if equal?(
|
79
|
-
|
80
|
-
|
81
|
-
customer == other.customer
|
82
|
+
def ==(o)
|
83
|
+
return true if self.equal?(o)
|
84
|
+
self.class == o.class &&
|
85
|
+
customer == o.customer
|
82
86
|
end
|
83
87
|
|
84
88
|
# @see the `==` method
|
85
89
|
# @param [Object] Object to be compared
|
86
|
-
def eql?(
|
87
|
-
self ==
|
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
|
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
|
-
|
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
|
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
|