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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/jamm.gemspec +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 +41 -28
- 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 +56 -44
- 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 +150 -95
- data/lib/jamm/api/models/v1_bank_assets.rb +60 -47
- data/lib/jamm/api/models/v1_bank_branch.rb +83 -56
- data/lib/jamm/api/models/v1_bank_information.rb +71 -51
- data/lib/jamm/api/models/v1_bank_quota.rb +99 -64
- data/lib/jamm/api/models/v1_bank_scheduled_maintenance_period.rb +75 -52
- 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 +57 -44
- data/lib/jamm/api/models/v1_error_response.rb +46 -38
- data/lib/jamm/api/models/v1_error_type.rb +30 -31
- data/lib/jamm/api/models/v1_event_type.rb +20 -21
- data/lib/jamm/api/models/v1_get_bank_response.rb +42 -35
- data/lib/jamm/api/models/v1_get_branch_response.rb +42 -35
- data/lib/jamm/api/models/v1_get_branches_response.rb +44 -36
- 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 +59 -44
- 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 +44 -36
- data/lib/jamm/api/models/v1_search_branches_response.rb +44 -36
- 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 +10 -10
- data/lib/jamm/charge.rb +12 -0
- data/lib/jamm/deprecation.rb +13 -0
- data/lib/jamm/payment.rb +61 -0
- data/lib/jamm/version.rb +1 -1
- data/lib/jamm.rb +2 -0
- metadata +5 -3
@@ -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'
|
@@ -22,10 +22,15 @@ module Api
|
|
22
22
|
# Signature of the message.
|
23
23
|
attr_accessor :signature
|
24
24
|
|
25
|
-
attr_accessor :event_type
|
25
|
+
attr_accessor :event_type
|
26
|
+
|
27
|
+
attr_accessor :content
|
28
|
+
|
29
|
+
attr_accessor :created_at
|
26
30
|
|
27
31
|
class EnumAttributeValidator
|
28
|
-
attr_reader :datatype
|
32
|
+
attr_reader :datatype
|
33
|
+
attr_reader :allowable_values
|
29
34
|
|
30
35
|
def initialize(datatype, allowable_values)
|
31
36
|
@allowable_values = allowable_values.map do |value|
|
@@ -48,11 +53,11 @@ module Api
|
|
48
53
|
# Attribute mapping from ruby-style variable name to JSON key.
|
49
54
|
def self.attribute_map
|
50
55
|
{
|
51
|
-
:id => :id,
|
52
|
-
:signature => :signature,
|
53
|
-
:event_type => :eventType,
|
54
|
-
:content => :content,
|
55
|
-
:created_at => :createdAt
|
56
|
+
:'id' => :'id',
|
57
|
+
:'signature' => :'signature',
|
58
|
+
:'event_type' => :'eventType',
|
59
|
+
:'content' => :'content',
|
60
|
+
:'created_at' => :'createdAt'
|
56
61
|
}
|
57
62
|
end
|
58
63
|
|
@@ -64,53 +69,64 @@ module Api
|
|
64
69
|
# Attribute type mapping.
|
65
70
|
def self.openapi_types
|
66
71
|
{
|
67
|
-
:id => :String,
|
68
|
-
:signature => :String,
|
69
|
-
:event_type => :EventType,
|
70
|
-
:content => :ProtobufAny,
|
71
|
-
:created_at => :Time
|
72
|
+
:'id' => :'String',
|
73
|
+
:'signature' => :'String',
|
74
|
+
:'event_type' => :'EventType',
|
75
|
+
:'content' => :'ProtobufAny',
|
76
|
+
:'created_at' => :'Time'
|
72
77
|
}
|
73
78
|
end
|
74
79
|
|
75
80
|
# List of attributes with nullable: true
|
76
81
|
def self.openapi_nullable
|
77
|
-
Set.new([
|
82
|
+
Set.new([
|
83
|
+
])
|
78
84
|
end
|
79
85
|
|
80
86
|
# Initializes the object
|
81
87
|
# @param [Hash] attributes Model attributes in the form of hash
|
82
88
|
def initialize(attributes = {})
|
83
|
-
|
89
|
+
if (!attributes.is_a?(Hash))
|
90
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Api::MerchantWebhookMessage` initialize method"
|
91
|
+
end
|
84
92
|
|
85
93
|
# check to see if the attribute exists and convert string to symbol for hash key
|
86
|
-
attributes = attributes.each_with_object({})
|
87
|
-
|
88
|
-
|
94
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
95
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
96
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Api::MerchantWebhookMessage`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
97
|
+
end
|
89
98
|
h[k.to_sym] = v
|
90
|
-
|
91
|
-
|
92
|
-
self.id = attributes[:id] if attributes.key?(:id)
|
99
|
+
}
|
93
100
|
|
94
|
-
|
101
|
+
if attributes.key?(:'id')
|
102
|
+
self.id = attributes[:'id']
|
103
|
+
end
|
95
104
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
'EVENT_TYPE_UNSPECIFIED'
|
100
|
-
end
|
105
|
+
if attributes.key?(:'signature')
|
106
|
+
self.signature = attributes[:'signature']
|
107
|
+
end
|
101
108
|
|
102
|
-
|
109
|
+
if attributes.key?(:'event_type')
|
110
|
+
self.event_type = attributes[:'event_type']
|
111
|
+
else
|
112
|
+
self.event_type = 'EVENT_TYPE_UNSPECIFIED'
|
113
|
+
end
|
103
114
|
|
104
|
-
|
115
|
+
if attributes.key?(:'content')
|
116
|
+
self.content = attributes[:'content']
|
117
|
+
end
|
105
118
|
|
106
|
-
|
119
|
+
if attributes.key?(:'created_at')
|
120
|
+
self.created_at = attributes[:'created_at']
|
121
|
+
end
|
107
122
|
end
|
108
123
|
|
109
124
|
# Show invalid properties with the reasons. Usually used together with valid?
|
110
125
|
# @return Array for valid properties with the reasons
|
111
126
|
def list_invalid_properties
|
112
127
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
113
|
-
|
128
|
+
invalid_properties = Array.new
|
129
|
+
invalid_properties
|
114
130
|
end
|
115
131
|
|
116
132
|
# Check to see if the all the properties in the model are valid
|
@@ -122,21 +138,20 @@ module Api
|
|
122
138
|
|
123
139
|
# Checks equality by comparing each attribute.
|
124
140
|
# @param [Object] Object to be compared
|
125
|
-
def ==(
|
126
|
-
return true if equal?(
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
created_at == other.created_at
|
141
|
+
def ==(o)
|
142
|
+
return true if self.equal?(o)
|
143
|
+
self.class == o.class &&
|
144
|
+
id == o.id &&
|
145
|
+
signature == o.signature &&
|
146
|
+
event_type == o.event_type &&
|
147
|
+
content == o.content &&
|
148
|
+
created_at == o.created_at
|
134
149
|
end
|
135
150
|
|
136
151
|
# @see the `==` method
|
137
152
|
# @param [Object] Object to be compared
|
138
|
-
def eql?(
|
139
|
-
self ==
|
153
|
+
def eql?(o)
|
154
|
+
self == o
|
140
155
|
end
|
141
156
|
|
142
157
|
# Calculates hash code according to all attributes.
|
@@ -150,18 +165,19 @@ module Api
|
|
150
165
|
# @return [Object] Returns the model itself
|
151
166
|
def self.build_from_hash(attributes)
|
152
167
|
return nil unless attributes.is_a?(Hash)
|
153
|
-
|
154
168
|
attributes = attributes.transform_keys(&:to_sym)
|
155
169
|
transformed_hash = {}
|
156
170
|
openapi_types.each_pair do |key, type|
|
157
171
|
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
158
|
-
transformed_hash[key
|
172
|
+
transformed_hash["#{key}"] = nil
|
159
173
|
elsif type =~ /\AArray<(.*)>/i
|
160
174
|
# check to ensure the input is an array given that the attribute
|
161
175
|
# is documented as an array but the input is not
|
162
|
-
|
176
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
177
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
178
|
+
end
|
163
179
|
elsif !attributes[attribute_map[key]].nil?
|
164
|
-
transformed_hash[key
|
180
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
165
181
|
end
|
166
182
|
end
|
167
183
|
new(transformed_hash)
|
@@ -227,7 +243,7 @@ module Api
|
|
227
243
|
def to_hash
|
228
244
|
hash = {}
|
229
245
|
self.class.attribute_map.each_pair do |attr, param|
|
230
|
-
value = send(attr)
|
246
|
+
value = self.send(attr)
|
231
247
|
if value.nil?
|
232
248
|
is_nullable = self.class.openapi_nullable.include?(attr)
|
233
249
|
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
@@ -255,5 +271,7 @@ module Api
|
|
255
271
|
value
|
256
272
|
end
|
257
273
|
end
|
274
|
+
|
258
275
|
end
|
276
|
+
|
259
277
|
end
|
@@ -1,29 +1,35 @@
|
|
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 MessageResponse
|
18
|
-
attr_accessor :merchant_webhook_message
|
18
|
+
attr_accessor :merchant_webhook_message
|
19
|
+
|
20
|
+
attr_accessor :charge_message
|
21
|
+
|
22
|
+
attr_accessor :contract_message
|
23
|
+
|
24
|
+
attr_accessor :user_account_message
|
19
25
|
|
20
26
|
# Attribute mapping from ruby-style variable name to JSON key.
|
21
27
|
def self.attribute_map
|
22
28
|
{
|
23
|
-
:merchant_webhook_message => :merchantWebhookMessage,
|
24
|
-
:charge_message => :chargeMessage,
|
25
|
-
:contract_message => :contractMessage,
|
26
|
-
:user_account_message => :userAccountMessage
|
29
|
+
:'merchant_webhook_message' => :'merchantWebhookMessage',
|
30
|
+
:'charge_message' => :'chargeMessage',
|
31
|
+
:'contract_message' => :'contractMessage',
|
32
|
+
:'user_account_message' => :'userAccountMessage'
|
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
|
-
:merchant_webhook_message => :MerchantWebhookMessage,
|
39
|
-
:charge_message => :ChargeMessage,
|
40
|
-
:contract_message => :ContractMessage,
|
41
|
-
:user_account_message => :UserAccountMessage
|
44
|
+
:'merchant_webhook_message' => :'MerchantWebhookMessage',
|
45
|
+
:'charge_message' => :'ChargeMessage',
|
46
|
+
:'contract_message' => :'ContractMessage',
|
47
|
+
:'user_account_message' => :'UserAccountMessage'
|
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
|
-
|
60
|
+
if (!attributes.is_a?(Hash))
|
61
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Api::MessageResponse` 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({})
|
57
|
-
|
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::MessageResponse`. 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
|
-
|
61
|
-
|
62
|
-
self.merchant_webhook_message = attributes[:merchant_webhook_message] if attributes.key?(:merchant_webhook_message)
|
70
|
+
}
|
63
71
|
|
64
|
-
|
72
|
+
if attributes.key?(:'merchant_webhook_message')
|
73
|
+
self.merchant_webhook_message = attributes[:'merchant_webhook_message']
|
74
|
+
end
|
65
75
|
|
66
|
-
|
76
|
+
if attributes.key?(:'charge_message')
|
77
|
+
self.charge_message = attributes[:'charge_message']
|
78
|
+
end
|
67
79
|
|
68
|
-
|
80
|
+
if attributes.key?(:'contract_message')
|
81
|
+
self.contract_message = attributes[:'contract_message']
|
82
|
+
end
|
69
83
|
|
70
|
-
|
84
|
+
if attributes.key?(:'user_account_message')
|
85
|
+
self.user_account_message = attributes[:'user_account_message']
|
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 ==(
|
90
|
-
return true if equal?(
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
user_account_message == other.user_account_message
|
106
|
+
def ==(o)
|
107
|
+
return true if self.equal?(o)
|
108
|
+
self.class == o.class &&
|
109
|
+
merchant_webhook_message == o.merchant_webhook_message &&
|
110
|
+
charge_message == o.charge_message &&
|
111
|
+
contract_message == o.contract_message &&
|
112
|
+
user_account_message == o.user_account_message
|
97
113
|
end
|
98
114
|
|
99
115
|
# @see the `==` method
|
100
116
|
# @param [Object] Object to be compared
|
101
|
-
def eql?(
|
102
|
-
self ==
|
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
|
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
|
-
|
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
|
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,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'
|
@@ -16,13 +16,15 @@ require 'time'
|
|
16
16
|
module Api
|
17
17
|
# This message represents a request to process a payment directly within the application. It contains the customer ID and charge details to be processed.
|
18
18
|
class OffSessionPaymentRequest
|
19
|
-
attr_accessor :customer
|
19
|
+
attr_accessor :customer
|
20
|
+
|
21
|
+
attr_accessor :charge
|
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
|
-
:charge => :charge
|
26
|
+
:'customer' => :'customer',
|
27
|
+
:'charge' => :'charge'
|
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 => :String,
|
38
|
-
:charge => :InitialCharge
|
39
|
+
:'customer' => :'String',
|
40
|
+
:'charge' => :'InitialCharge'
|
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
|
-
|
53
|
+
if (!attributes.is_a?(Hash))
|
54
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Api::OffSessionPaymentRequest` 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({})
|
54
|
-
|
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::OffSessionPaymentRequest`. 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
|
-
|
58
|
-
|
59
|
-
self.customer = attributes[:customer] if attributes.key?(:customer)
|
63
|
+
}
|
60
64
|
|
61
|
-
|
65
|
+
if attributes.key?(:'customer')
|
66
|
+
self.customer = attributes[:'customer']
|
67
|
+
end
|
62
68
|
|
63
|
-
|
69
|
+
if attributes.key?(:'charge')
|
70
|
+
self.charge = attributes[:'charge']
|
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 ==(
|
83
|
-
return true if equal?(
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
charge == other.charge
|
91
|
+
def ==(o)
|
92
|
+
return true if self.equal?(o)
|
93
|
+
self.class == o.class &&
|
94
|
+
customer == o.customer &&
|
95
|
+
charge == o.charge
|
88
96
|
end
|
89
97
|
|
90
98
|
# @see the `==` method
|
91
99
|
# @param [Object] Object to be compared
|
92
|
-
def eql?(
|
93
|
-
self ==
|
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
|
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
|
-
|
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
|
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
|