maytes-api-client-rb 0.1.6 → 0.2.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/docs/CheckoutFriend.md +26 -0
- data/docs/CheckoutFriendItem.md +20 -0
- data/docs/CheckoutFriends.md +20 -0
- data/docs/CreateCheckoutRequest.md +3 -1
- data/lib/maytes_api_client/models/checkout_friend.rb +314 -0
- data/lib/maytes_api_client/models/checkout_friend_item.rb +202 -0
- data/lib/maytes_api_client/models/checkout_friends.rb +216 -0
- data/lib/maytes_api_client/models/create_checkout422_response.rb +2 -2
- data/lib/maytes_api_client/models/create_checkout_request.rb +16 -5
- data/lib/maytes_api_client/version.rb +1 -1
- data/lib/maytes_api_client.rb +3 -0
- data/spec/models/checkout_friend_item_spec.rb +42 -0
- data/spec/models/checkout_friend_spec.rb +60 -0
- data/spec/models/checkout_friends_spec.rb +42 -0
- data/spec/models/create_checkout422_response_spec.rb +1 -1
- data/spec/models/create_checkout_request_spec.rb +6 -0
- metadata +50 -38
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e091ef0b96ca8dcd9adb2829adb2b27c7ee26a840e17281ade66a9c75382cc22
|
|
4
|
+
data.tar.gz: 2b99d78b0c4e3e89ac0bf3f480574c74686df2a04cb97c6b3983ea8456218f3d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0b55e42a06e13f00dfb7fc9929871d602f5f276a9b8f11ca9e3239c8bab9b32d8509d3abe06a88a2d3e16c82e6b5d39880bbf0ae3b55e9dbc6cf14e22eaa0567
|
|
7
|
+
data.tar.gz: 067eb16f09296a2311b4251e38232a9802d669caf5758248571c14feb9a551e63247dd7dd28c27a337a39e394ba69a2d6286e3381805219c4e19f4bcbebc8800
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# MaytesApiClient::CheckoutFriend
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **name** | **String** | | |
|
|
8
|
+
| **mobile** | **String** | E.164, e.g. +61412345678 | |
|
|
9
|
+
| **email** | **String** | | [optional] |
|
|
10
|
+
| **amount** | **Integer** | This friend’s share in minor units. Give it for every friend or for none. | [optional] |
|
|
11
|
+
| **items** | [**Array<CheckoutFriendItem>**](CheckoutFriendItem.md) | The cart lines this friend pays for (item_assignment only). Give it for every friend or for none. | [optional] |
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```ruby
|
|
16
|
+
require 'maytes_api_client'
|
|
17
|
+
|
|
18
|
+
instance = MaytesApiClient::CheckoutFriend.new(
|
|
19
|
+
name: null,
|
|
20
|
+
mobile: null,
|
|
21
|
+
email: null,
|
|
22
|
+
amount: null,
|
|
23
|
+
items: null
|
|
24
|
+
)
|
|
25
|
+
```
|
|
26
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# MaytesApiClient::CheckoutFriendItem
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **item_ref** | **String** | | |
|
|
8
|
+
| **quantity** | **Integer** | How many units of this line this friend pays for. Omit for the whole line. | [optional] |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'maytes_api_client'
|
|
14
|
+
|
|
15
|
+
instance = MaytesApiClient::CheckoutFriendItem.new(
|
|
16
|
+
item_ref: null,
|
|
17
|
+
quantity: null
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# MaytesApiClient::CheckoutFriends
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **count** | **Integer** | How many friends will split, not counting the customer. Give this or `people`. | [optional] |
|
|
8
|
+
| **people** | [**Array<CheckoutFriend>**](CheckoutFriend.md) | The friends, optionally with their shares. Give this or `count`. | [optional] |
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```ruby
|
|
13
|
+
require 'maytes_api_client'
|
|
14
|
+
|
|
15
|
+
instance = MaytesApiClient::CheckoutFriends.new(
|
|
16
|
+
count: null,
|
|
17
|
+
people: null
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
| **customer_data** | [**CustomerData**](CustomerData.md) | | [optional] |
|
|
19
19
|
| **metadata** | **Hash<String, Object>** | | [optional] |
|
|
20
20
|
| **allocation_model** | **String** | | [optional] |
|
|
21
|
+
| **friends** | [**CheckoutFriends**](CheckoutFriends.md) | Who the customer is expected to split with. Pre-fills their share and allocation screens; the customer can still change it. Personal data — send it only when you hold it. | [optional] |
|
|
21
22
|
|
|
22
23
|
## Example
|
|
23
24
|
|
|
@@ -38,7 +39,8 @@ instance = MaytesApiClient::CreateCheckoutRequest.new(
|
|
|
38
39
|
shipping_amount: null,
|
|
39
40
|
customer_data: null,
|
|
40
41
|
metadata: null,
|
|
41
|
-
allocation_model: null
|
|
42
|
+
allocation_model: null,
|
|
43
|
+
friends: null
|
|
42
44
|
)
|
|
43
45
|
```
|
|
44
46
|
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Maytes 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.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module MaytesApiClient
|
|
17
|
+
class CheckoutFriend < ApiModelBase
|
|
18
|
+
attr_accessor :name
|
|
19
|
+
|
|
20
|
+
# E.164, e.g. +61412345678
|
|
21
|
+
attr_accessor :mobile
|
|
22
|
+
|
|
23
|
+
attr_accessor :email
|
|
24
|
+
|
|
25
|
+
# This friend’s share in minor units. Give it for every friend or for none.
|
|
26
|
+
attr_accessor :amount
|
|
27
|
+
|
|
28
|
+
# The cart lines this friend pays for (item_assignment only). Give it for every friend or for none.
|
|
29
|
+
attr_accessor :items
|
|
30
|
+
|
|
31
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
32
|
+
def self.attribute_map
|
|
33
|
+
{
|
|
34
|
+
:'name' => :'name',
|
|
35
|
+
:'mobile' => :'mobile',
|
|
36
|
+
:'email' => :'email',
|
|
37
|
+
:'amount' => :'amount',
|
|
38
|
+
:'items' => :'items'
|
|
39
|
+
}
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Returns attribute mapping this model knows about
|
|
43
|
+
def self.acceptable_attribute_map
|
|
44
|
+
attribute_map
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Returns all the JSON keys this model knows about
|
|
48
|
+
def self.acceptable_attributes
|
|
49
|
+
acceptable_attribute_map.values
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Attribute type mapping.
|
|
53
|
+
def self.openapi_types
|
|
54
|
+
{
|
|
55
|
+
:'name' => :'String',
|
|
56
|
+
:'mobile' => :'String',
|
|
57
|
+
:'email' => :'String',
|
|
58
|
+
:'amount' => :'Integer',
|
|
59
|
+
:'items' => :'Array<CheckoutFriendItem>'
|
|
60
|
+
}
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# List of attributes with nullable: true
|
|
64
|
+
def self.openapi_nullable
|
|
65
|
+
Set.new([
|
|
66
|
+
:'email',
|
|
67
|
+
])
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Initializes the object
|
|
71
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
72
|
+
def initialize(attributes = {})
|
|
73
|
+
if (!attributes.is_a?(Hash))
|
|
74
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MaytesApiClient::CheckoutFriend` initialize method"
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
78
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
79
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
80
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
81
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MaytesApiClient::CheckoutFriend`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
82
|
+
end
|
|
83
|
+
h[k.to_sym] = v
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if attributes.key?(:'name')
|
|
87
|
+
self.name = attributes[:'name']
|
|
88
|
+
else
|
|
89
|
+
self.name = nil
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
if attributes.key?(:'mobile')
|
|
93
|
+
self.mobile = attributes[:'mobile']
|
|
94
|
+
else
|
|
95
|
+
self.mobile = nil
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
if attributes.key?(:'email')
|
|
99
|
+
self.email = attributes[:'email']
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
if attributes.key?(:'amount')
|
|
103
|
+
self.amount = attributes[:'amount']
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
if attributes.key?(:'items')
|
|
107
|
+
if (value = attributes[:'items']).is_a?(Array)
|
|
108
|
+
self.items = value
|
|
109
|
+
end
|
|
110
|
+
end
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
114
|
+
# @return Array for valid properties with the reasons
|
|
115
|
+
def list_invalid_properties
|
|
116
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
117
|
+
invalid_properties = Array.new
|
|
118
|
+
if @name.nil?
|
|
119
|
+
invalid_properties.push('invalid value for "name", name cannot be nil.')
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
if @name.to_s.length > 200
|
|
123
|
+
invalid_properties.push('invalid value for "name", the character length must be smaller than or equal to 200.')
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
if @name.to_s.length < 1
|
|
127
|
+
invalid_properties.push('invalid value for "name", the character length must be greater than or equal to 1.')
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
if @mobile.nil?
|
|
131
|
+
invalid_properties.push('invalid value for "mobile", mobile cannot be nil.')
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
if @mobile.to_s.length > 20
|
|
135
|
+
invalid_properties.push('invalid value for "mobile", the character length must be smaller than or equal to 20.')
|
|
136
|
+
end
|
|
137
|
+
|
|
138
|
+
if @mobile.to_s.length < 3
|
|
139
|
+
invalid_properties.push('invalid value for "mobile", the character length must be greater than or equal to 3.')
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
pattern = Regexp.new(/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/)
|
|
143
|
+
if !@email.nil? && @email !~ pattern
|
|
144
|
+
invalid_properties.push("invalid value for \"email\", must conform to the pattern #{pattern}.")
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
if !@amount.nil? && @amount <= 0
|
|
148
|
+
invalid_properties.push('invalid value for "amount", must be greater than 0.')
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
if !@items.nil? && @items.length < 1
|
|
152
|
+
invalid_properties.push('invalid value for "items", number of items must be greater than or equal to 1.')
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
invalid_properties
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
# Check to see if the all the properties in the model are valid
|
|
159
|
+
# @return true if the model is valid
|
|
160
|
+
def valid?
|
|
161
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
162
|
+
return false if @name.nil?
|
|
163
|
+
return false if @name.to_s.length > 200
|
|
164
|
+
return false if @name.to_s.length < 1
|
|
165
|
+
return false if @mobile.nil?
|
|
166
|
+
return false if @mobile.to_s.length > 20
|
|
167
|
+
return false if @mobile.to_s.length < 3
|
|
168
|
+
return false if !@email.nil? && @email !~ Regexp.new(/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/)
|
|
169
|
+
return false if !@amount.nil? && @amount <= 0
|
|
170
|
+
return false if !@items.nil? && @items.length < 1
|
|
171
|
+
true
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
# Custom attribute writer method with validation
|
|
175
|
+
# @param [Object] name Value to be assigned
|
|
176
|
+
def name=(name)
|
|
177
|
+
if name.nil?
|
|
178
|
+
fail ArgumentError, 'name cannot be nil'
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
if name.to_s.length > 200
|
|
182
|
+
fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 200.'
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
if name.to_s.length < 1
|
|
186
|
+
fail ArgumentError, 'invalid value for "name", the character length must be greater than or equal to 1.'
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
@name = name
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# Custom attribute writer method with validation
|
|
193
|
+
# @param [Object] mobile Value to be assigned
|
|
194
|
+
def mobile=(mobile)
|
|
195
|
+
if mobile.nil?
|
|
196
|
+
fail ArgumentError, 'mobile cannot be nil'
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
if mobile.to_s.length > 20
|
|
200
|
+
fail ArgumentError, 'invalid value for "mobile", the character length must be smaller than or equal to 20.'
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
if mobile.to_s.length < 3
|
|
204
|
+
fail ArgumentError, 'invalid value for "mobile", the character length must be greater than or equal to 3.'
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
@mobile = mobile
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# Custom attribute writer method with validation
|
|
211
|
+
# @param [Object] email Value to be assigned
|
|
212
|
+
def email=(email)
|
|
213
|
+
pattern = Regexp.new(/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/)
|
|
214
|
+
if !email.nil? && email !~ pattern
|
|
215
|
+
fail ArgumentError, "invalid value for \"email\", must conform to the pattern #{pattern}."
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
@email = email
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
# Custom attribute writer method with validation
|
|
222
|
+
# @param [Object] amount Value to be assigned
|
|
223
|
+
def amount=(amount)
|
|
224
|
+
if amount.nil?
|
|
225
|
+
fail ArgumentError, 'amount cannot be nil'
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
if amount <= 0
|
|
229
|
+
fail ArgumentError, 'invalid value for "amount", must be greater than 0.'
|
|
230
|
+
end
|
|
231
|
+
|
|
232
|
+
@amount = amount
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
# Custom attribute writer method with validation
|
|
236
|
+
# @param [Object] items Value to be assigned
|
|
237
|
+
def items=(items)
|
|
238
|
+
if items.nil?
|
|
239
|
+
fail ArgumentError, 'items cannot be nil'
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
if items.length < 1
|
|
243
|
+
fail ArgumentError, 'invalid value for "items", number of items must be greater than or equal to 1.'
|
|
244
|
+
end
|
|
245
|
+
|
|
246
|
+
@items = items
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
# Checks equality by comparing each attribute.
|
|
250
|
+
# @param [Object] Object to be compared
|
|
251
|
+
def ==(o)
|
|
252
|
+
return true if self.equal?(o)
|
|
253
|
+
self.class == o.class &&
|
|
254
|
+
name == o.name &&
|
|
255
|
+
mobile == o.mobile &&
|
|
256
|
+
email == o.email &&
|
|
257
|
+
amount == o.amount &&
|
|
258
|
+
items == o.items
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
# @see the `==` method
|
|
262
|
+
# @param [Object] Object to be compared
|
|
263
|
+
def eql?(o)
|
|
264
|
+
self == o
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
# Calculates hash code according to all attributes.
|
|
268
|
+
# @return [Integer] Hash code
|
|
269
|
+
def hash
|
|
270
|
+
[name, mobile, email, amount, items].hash
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
# Builds the object from hash
|
|
274
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
275
|
+
# @return [Object] Returns the model itself
|
|
276
|
+
def self.build_from_hash(attributes)
|
|
277
|
+
return nil unless attributes.is_a?(Hash)
|
|
278
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
279
|
+
transformed_hash = {}
|
|
280
|
+
openapi_types.each_pair do |key, type|
|
|
281
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
282
|
+
transformed_hash["#{key}"] = nil
|
|
283
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
284
|
+
# check to ensure the input is an array given that the attribute
|
|
285
|
+
# is documented as an array but the input is not
|
|
286
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
287
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
288
|
+
end
|
|
289
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
290
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
291
|
+
end
|
|
292
|
+
end
|
|
293
|
+
new(transformed_hash)
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
# Returns the object in the form of hash
|
|
297
|
+
# @return [Hash] Returns the object in the form of hash
|
|
298
|
+
def to_hash
|
|
299
|
+
hash = {}
|
|
300
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
301
|
+
value = self.send(attr)
|
|
302
|
+
if value.nil?
|
|
303
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
304
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
305
|
+
end
|
|
306
|
+
|
|
307
|
+
hash[param] = _to_hash(value)
|
|
308
|
+
end
|
|
309
|
+
hash
|
|
310
|
+
end
|
|
311
|
+
|
|
312
|
+
end
|
|
313
|
+
|
|
314
|
+
end
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Maytes 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.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module MaytesApiClient
|
|
17
|
+
class CheckoutFriendItem < ApiModelBase
|
|
18
|
+
attr_accessor :item_ref
|
|
19
|
+
|
|
20
|
+
# How many units of this line this friend pays for. Omit for the whole line.
|
|
21
|
+
attr_accessor :quantity
|
|
22
|
+
|
|
23
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
24
|
+
def self.attribute_map
|
|
25
|
+
{
|
|
26
|
+
:'item_ref' => :'item_ref',
|
|
27
|
+
:'quantity' => :'quantity'
|
|
28
|
+
}
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Returns attribute mapping this model knows about
|
|
32
|
+
def self.acceptable_attribute_map
|
|
33
|
+
attribute_map
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Returns all the JSON keys this model knows about
|
|
37
|
+
def self.acceptable_attributes
|
|
38
|
+
acceptable_attribute_map.values
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Attribute type mapping.
|
|
42
|
+
def self.openapi_types
|
|
43
|
+
{
|
|
44
|
+
:'item_ref' => :'String',
|
|
45
|
+
:'quantity' => :'Integer'
|
|
46
|
+
}
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# List of attributes with nullable: true
|
|
50
|
+
def self.openapi_nullable
|
|
51
|
+
Set.new([
|
|
52
|
+
])
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# Initializes the object
|
|
56
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
57
|
+
def initialize(attributes = {})
|
|
58
|
+
if (!attributes.is_a?(Hash))
|
|
59
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MaytesApiClient::CheckoutFriendItem` initialize method"
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
63
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
64
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
65
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
66
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MaytesApiClient::CheckoutFriendItem`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
67
|
+
end
|
|
68
|
+
h[k.to_sym] = v
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if attributes.key?(:'item_ref')
|
|
72
|
+
self.item_ref = attributes[:'item_ref']
|
|
73
|
+
else
|
|
74
|
+
self.item_ref = nil
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
if attributes.key?(:'quantity')
|
|
78
|
+
self.quantity = attributes[:'quantity']
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
83
|
+
# @return Array for valid properties with the reasons
|
|
84
|
+
def list_invalid_properties
|
|
85
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
86
|
+
invalid_properties = Array.new
|
|
87
|
+
if @item_ref.nil?
|
|
88
|
+
invalid_properties.push('invalid value for "item_ref", item_ref cannot be nil.')
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
if @item_ref.to_s.length < 1
|
|
92
|
+
invalid_properties.push('invalid value for "item_ref", the character length must be greater than or equal to 1.')
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if !@quantity.nil? && @quantity <= 0
|
|
96
|
+
invalid_properties.push('invalid value for "quantity", must be greater than 0.')
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
invalid_properties
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Check to see if the all the properties in the model are valid
|
|
103
|
+
# @return true if the model is valid
|
|
104
|
+
def valid?
|
|
105
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
106
|
+
return false if @item_ref.nil?
|
|
107
|
+
return false if @item_ref.to_s.length < 1
|
|
108
|
+
return false if !@quantity.nil? && @quantity <= 0
|
|
109
|
+
true
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Custom attribute writer method with validation
|
|
113
|
+
# @param [Object] item_ref Value to be assigned
|
|
114
|
+
def item_ref=(item_ref)
|
|
115
|
+
if item_ref.nil?
|
|
116
|
+
fail ArgumentError, 'item_ref cannot be nil'
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
if item_ref.to_s.length < 1
|
|
120
|
+
fail ArgumentError, 'invalid value for "item_ref", the character length must be greater than or equal to 1.'
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
@item_ref = item_ref
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
# Custom attribute writer method with validation
|
|
127
|
+
# @param [Object] quantity Value to be assigned
|
|
128
|
+
def quantity=(quantity)
|
|
129
|
+
if quantity.nil?
|
|
130
|
+
fail ArgumentError, 'quantity cannot be nil'
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
if quantity <= 0
|
|
134
|
+
fail ArgumentError, 'invalid value for "quantity", must be greater than 0.'
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
@quantity = quantity
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# Checks equality by comparing each attribute.
|
|
141
|
+
# @param [Object] Object to be compared
|
|
142
|
+
def ==(o)
|
|
143
|
+
return true if self.equal?(o)
|
|
144
|
+
self.class == o.class &&
|
|
145
|
+
item_ref == o.item_ref &&
|
|
146
|
+
quantity == o.quantity
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# @see the `==` method
|
|
150
|
+
# @param [Object] Object to be compared
|
|
151
|
+
def eql?(o)
|
|
152
|
+
self == o
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
# Calculates hash code according to all attributes.
|
|
156
|
+
# @return [Integer] Hash code
|
|
157
|
+
def hash
|
|
158
|
+
[item_ref, quantity].hash
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# Builds the object from hash
|
|
162
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
163
|
+
# @return [Object] Returns the model itself
|
|
164
|
+
def self.build_from_hash(attributes)
|
|
165
|
+
return nil unless attributes.is_a?(Hash)
|
|
166
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
167
|
+
transformed_hash = {}
|
|
168
|
+
openapi_types.each_pair do |key, type|
|
|
169
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
170
|
+
transformed_hash["#{key}"] = nil
|
|
171
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
172
|
+
# check to ensure the input is an array given that the attribute
|
|
173
|
+
# is documented as an array but the input is not
|
|
174
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
175
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
176
|
+
end
|
|
177
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
178
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
new(transformed_hash)
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# Returns the object in the form of hash
|
|
185
|
+
# @return [Hash] Returns the object in the form of hash
|
|
186
|
+
def to_hash
|
|
187
|
+
hash = {}
|
|
188
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
189
|
+
value = self.send(attr)
|
|
190
|
+
if value.nil?
|
|
191
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
192
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
hash[param] = _to_hash(value)
|
|
196
|
+
end
|
|
197
|
+
hash
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
end
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Maytes 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.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module MaytesApiClient
|
|
17
|
+
class CheckoutFriends < ApiModelBase
|
|
18
|
+
# How many friends will split, not counting the customer. Give this or `people`.
|
|
19
|
+
attr_accessor :count
|
|
20
|
+
|
|
21
|
+
# The friends, optionally with their shares. Give this or `count`.
|
|
22
|
+
attr_accessor :people
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
:'count' => :'count',
|
|
28
|
+
:'people' => :'people'
|
|
29
|
+
}
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Returns attribute mapping this model knows about
|
|
33
|
+
def self.acceptable_attribute_map
|
|
34
|
+
attribute_map
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Returns all the JSON keys this model knows about
|
|
38
|
+
def self.acceptable_attributes
|
|
39
|
+
acceptable_attribute_map.values
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Attribute type mapping.
|
|
43
|
+
def self.openapi_types
|
|
44
|
+
{
|
|
45
|
+
:'count' => :'Integer',
|
|
46
|
+
:'people' => :'Array<CheckoutFriend>'
|
|
47
|
+
}
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# List of attributes with nullable: true
|
|
51
|
+
def self.openapi_nullable
|
|
52
|
+
Set.new([
|
|
53
|
+
])
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# Initializes the object
|
|
57
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
58
|
+
def initialize(attributes = {})
|
|
59
|
+
if (!attributes.is_a?(Hash))
|
|
60
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `MaytesApiClient::CheckoutFriends` initialize method"
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
64
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
65
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
66
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
67
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `MaytesApiClient::CheckoutFriends`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
68
|
+
end
|
|
69
|
+
h[k.to_sym] = v
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if attributes.key?(:'count')
|
|
73
|
+
self.count = attributes[:'count']
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
if attributes.key?(:'people')
|
|
77
|
+
if (value = attributes[:'people']).is_a?(Array)
|
|
78
|
+
self.people = value
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
84
|
+
# @return Array for valid properties with the reasons
|
|
85
|
+
def list_invalid_properties
|
|
86
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
87
|
+
invalid_properties = Array.new
|
|
88
|
+
if !@count.nil? && @count > 50
|
|
89
|
+
invalid_properties.push('invalid value for "count", must be smaller than or equal to 50.')
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
if !@count.nil? && @count < 1
|
|
93
|
+
invalid_properties.push('invalid value for "count", must be greater than or equal to 1.')
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
if !@people.nil? && @people.length > 50
|
|
97
|
+
invalid_properties.push('invalid value for "people", number of items must be less than or equal to 50.')
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
if !@people.nil? && @people.length < 1
|
|
101
|
+
invalid_properties.push('invalid value for "people", number of items must be greater than or equal to 1.')
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
invalid_properties
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Check to see if the all the properties in the model are valid
|
|
108
|
+
# @return true if the model is valid
|
|
109
|
+
def valid?
|
|
110
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
111
|
+
return false if !@count.nil? && @count > 50
|
|
112
|
+
return false if !@count.nil? && @count < 1
|
|
113
|
+
return false if !@people.nil? && @people.length > 50
|
|
114
|
+
return false if !@people.nil? && @people.length < 1
|
|
115
|
+
true
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Custom attribute writer method with validation
|
|
119
|
+
# @param [Object] count Value to be assigned
|
|
120
|
+
def count=(count)
|
|
121
|
+
if count.nil?
|
|
122
|
+
fail ArgumentError, 'count cannot be nil'
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
if count > 50
|
|
126
|
+
fail ArgumentError, 'invalid value for "count", must be smaller than or equal to 50.'
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
if count < 1
|
|
130
|
+
fail ArgumentError, 'invalid value for "count", must be greater than or equal to 1.'
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
@count = count
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
# Custom attribute writer method with validation
|
|
137
|
+
# @param [Object] people Value to be assigned
|
|
138
|
+
def people=(people)
|
|
139
|
+
if people.nil?
|
|
140
|
+
fail ArgumentError, 'people cannot be nil'
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
if people.length > 50
|
|
144
|
+
fail ArgumentError, 'invalid value for "people", number of items must be less than or equal to 50.'
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
if people.length < 1
|
|
148
|
+
fail ArgumentError, 'invalid value for "people", number of items must be greater than or equal to 1.'
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
@people = people
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Checks equality by comparing each attribute.
|
|
155
|
+
# @param [Object] Object to be compared
|
|
156
|
+
def ==(o)
|
|
157
|
+
return true if self.equal?(o)
|
|
158
|
+
self.class == o.class &&
|
|
159
|
+
count == o.count &&
|
|
160
|
+
people == o.people
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# @see the `==` method
|
|
164
|
+
# @param [Object] Object to be compared
|
|
165
|
+
def eql?(o)
|
|
166
|
+
self == o
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Calculates hash code according to all attributes.
|
|
170
|
+
# @return [Integer] Hash code
|
|
171
|
+
def hash
|
|
172
|
+
[count, people].hash
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Builds the object from hash
|
|
176
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
177
|
+
# @return [Object] Returns the model itself
|
|
178
|
+
def self.build_from_hash(attributes)
|
|
179
|
+
return nil unless attributes.is_a?(Hash)
|
|
180
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
181
|
+
transformed_hash = {}
|
|
182
|
+
openapi_types.each_pair do |key, type|
|
|
183
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
184
|
+
transformed_hash["#{key}"] = nil
|
|
185
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
186
|
+
# check to ensure the input is an array given that the attribute
|
|
187
|
+
# is documented as an array but the input is not
|
|
188
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
189
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
190
|
+
end
|
|
191
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
192
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
193
|
+
end
|
|
194
|
+
end
|
|
195
|
+
new(transformed_hash)
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
# Returns the object in the form of hash
|
|
199
|
+
# @return [Hash] Returns the object in the form of hash
|
|
200
|
+
def to_hash
|
|
201
|
+
hash = {}
|
|
202
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
203
|
+
value = self.send(attr)
|
|
204
|
+
if value.nil?
|
|
205
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
206
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
hash[param] = _to_hash(value)
|
|
210
|
+
end
|
|
211
|
+
hash
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
end
|
|
@@ -156,7 +156,7 @@ module MaytesApiClient
|
|
|
156
156
|
return false if @message.nil?
|
|
157
157
|
return false if @error.nil?
|
|
158
158
|
return false if @code.nil?
|
|
159
|
-
code_validator = EnumAttributeValidator.new('String', ["invalid_amount", "amount_below_minimum", "invalid_amount_arithmetic", "currency_not_supported", "merchant_currency_mismatch", "merchant_not_configured"])
|
|
159
|
+
code_validator = EnumAttributeValidator.new('String', ["invalid_amount", "invalid_friends", "amount_below_minimum", "invalid_amount_arithmetic", "currency_not_supported", "merchant_currency_mismatch", "merchant_not_configured"])
|
|
160
160
|
return false unless code_validator.valid?(@code)
|
|
161
161
|
true
|
|
162
162
|
end
|
|
@@ -184,7 +184,7 @@ module MaytesApiClient
|
|
|
184
184
|
# Custom attribute writer method checking allowed values (enum).
|
|
185
185
|
# @param [Object] code Object to be assigned
|
|
186
186
|
def code=(code)
|
|
187
|
-
validator = EnumAttributeValidator.new('String', ["invalid_amount", "amount_below_minimum", "invalid_amount_arithmetic", "currency_not_supported", "merchant_currency_mismatch", "merchant_not_configured"])
|
|
187
|
+
validator = EnumAttributeValidator.new('String', ["invalid_amount", "invalid_friends", "amount_below_minimum", "invalid_amount_arithmetic", "currency_not_supported", "merchant_currency_mismatch", "merchant_not_configured"])
|
|
188
188
|
unless validator.valid?(code)
|
|
189
189
|
fail ArgumentError, "invalid value for \"code\", must be one of #{validator.allowable_values}."
|
|
190
190
|
end
|
|
@@ -43,6 +43,9 @@ module MaytesApiClient
|
|
|
43
43
|
|
|
44
44
|
attr_accessor :allocation_model
|
|
45
45
|
|
|
46
|
+
# Who the customer is expected to split with. Pre-fills their share and allocation screens; the customer can still change it. Personal data — send it only when you hold it.
|
|
47
|
+
attr_accessor :friends
|
|
48
|
+
|
|
46
49
|
class EnumAttributeValidator
|
|
47
50
|
attr_reader :datatype
|
|
48
51
|
attr_reader :allowable_values
|
|
@@ -81,7 +84,8 @@ module MaytesApiClient
|
|
|
81
84
|
:'shipping_amount' => :'shipping_amount',
|
|
82
85
|
:'customer_data' => :'customer_data',
|
|
83
86
|
:'metadata' => :'metadata',
|
|
84
|
-
:'allocation_model' => :'allocation_model'
|
|
87
|
+
:'allocation_model' => :'allocation_model',
|
|
88
|
+
:'friends' => :'friends'
|
|
85
89
|
}
|
|
86
90
|
end
|
|
87
91
|
|
|
@@ -111,7 +115,8 @@ module MaytesApiClient
|
|
|
111
115
|
:'shipping_amount' => :'Integer',
|
|
112
116
|
:'customer_data' => :'CustomerData',
|
|
113
117
|
:'metadata' => :'Hash<String, Object>',
|
|
114
|
-
:'allocation_model' => :'String'
|
|
118
|
+
:'allocation_model' => :'String',
|
|
119
|
+
:'friends' => :'CheckoutFriends'
|
|
115
120
|
}
|
|
116
121
|
end
|
|
117
122
|
|
|
@@ -126,7 +131,8 @@ module MaytesApiClient
|
|
|
126
131
|
:'shipping_amount',
|
|
127
132
|
:'customer_data',
|
|
128
133
|
:'metadata',
|
|
129
|
-
:'allocation_model'
|
|
134
|
+
:'allocation_model',
|
|
135
|
+
:'friends'
|
|
130
136
|
])
|
|
131
137
|
end
|
|
132
138
|
|
|
@@ -219,6 +225,10 @@ module MaytesApiClient
|
|
|
219
225
|
if attributes.key?(:'allocation_model')
|
|
220
226
|
self.allocation_model = attributes[:'allocation_model']
|
|
221
227
|
end
|
|
228
|
+
|
|
229
|
+
if attributes.key?(:'friends')
|
|
230
|
+
self.friends = attributes[:'friends']
|
|
231
|
+
end
|
|
222
232
|
end
|
|
223
233
|
|
|
224
234
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -385,7 +395,8 @@ module MaytesApiClient
|
|
|
385
395
|
shipping_amount == o.shipping_amount &&
|
|
386
396
|
customer_data == o.customer_data &&
|
|
387
397
|
metadata == o.metadata &&
|
|
388
|
-
allocation_model == o.allocation_model
|
|
398
|
+
allocation_model == o.allocation_model &&
|
|
399
|
+
friends == o.friends
|
|
389
400
|
end
|
|
390
401
|
|
|
391
402
|
# @see the `==` method
|
|
@@ -397,7 +408,7 @@ module MaytesApiClient
|
|
|
397
408
|
# Calculates hash code according to all attributes.
|
|
398
409
|
# @return [Integer] Hash code
|
|
399
410
|
def hash
|
|
400
|
-
[merchant_order_id, merchant_expires_at, total_amount, currency, return_url, cancel_url, items, fees, discounts, tax, shipping_amount, customer_data, metadata, allocation_model].hash
|
|
411
|
+
[merchant_order_id, merchant_expires_at, total_amount, currency, return_url, cancel_url, items, fees, discounts, tax, shipping_amount, customer_data, metadata, allocation_model, friends].hash
|
|
401
412
|
end
|
|
402
413
|
|
|
403
414
|
# Builds the object from hash
|
data/lib/maytes_api_client.rb
CHANGED
|
@@ -31,6 +31,9 @@ require 'maytes_api_client/models/checkout_captured'
|
|
|
31
31
|
require 'maytes_api_client/models/checkout_created'
|
|
32
32
|
require 'maytes_api_client/models/checkout_discount'
|
|
33
33
|
require 'maytes_api_client/models/checkout_fee'
|
|
34
|
+
require 'maytes_api_client/models/checkout_friend'
|
|
35
|
+
require 'maytes_api_client/models/checkout_friend_item'
|
|
36
|
+
require 'maytes_api_client/models/checkout_friends'
|
|
34
37
|
require 'maytes_api_client/models/create_checkout401_response'
|
|
35
38
|
require 'maytes_api_client/models/create_checkout409_response'
|
|
36
39
|
require 'maytes_api_client/models/create_checkout422_response'
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Maytes 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.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for MaytesApiClient::CheckoutFriendItem
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe MaytesApiClient::CheckoutFriendItem do
|
|
21
|
+
#let(:instance) { MaytesApiClient::CheckoutFriendItem.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of CheckoutFriendItem' do
|
|
24
|
+
it 'should create an instance of CheckoutFriendItem' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(MaytesApiClient::CheckoutFriendItem)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "item_ref"' do
|
|
31
|
+
it 'should work' do
|
|
32
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
describe 'test attribute "quantity"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
end
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Maytes 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.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for MaytesApiClient::CheckoutFriend
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe MaytesApiClient::CheckoutFriend do
|
|
21
|
+
#let(:instance) { MaytesApiClient::CheckoutFriend.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of CheckoutFriend' do
|
|
24
|
+
it 'should create an instance of CheckoutFriend' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(MaytesApiClient::CheckoutFriend)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "name"' do
|
|
31
|
+
it 'should work' do
|
|
32
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
describe 'test attribute "mobile"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
describe 'test attribute "email"' do
|
|
43
|
+
it 'should work' do
|
|
44
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
describe 'test attribute "amount"' do
|
|
49
|
+
it 'should work' do
|
|
50
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
describe 'test attribute "items"' do
|
|
55
|
+
it 'should work' do
|
|
56
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Maytes 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.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for MaytesApiClient::CheckoutFriends
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe MaytesApiClient::CheckoutFriends do
|
|
21
|
+
#let(:instance) { MaytesApiClient::CheckoutFriends.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of CheckoutFriends' do
|
|
24
|
+
it 'should create an instance of CheckoutFriends' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(MaytesApiClient::CheckoutFriends)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "count"' do
|
|
31
|
+
it 'should work' do
|
|
32
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
describe 'test attribute "people"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
end
|
|
@@ -42,7 +42,7 @@ describe MaytesApiClient::CreateCheckout422Response do
|
|
|
42
42
|
describe 'test attribute "code"' do
|
|
43
43
|
it 'should work' do
|
|
44
44
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
45
|
-
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["invalid_amount", "amount_below_minimum", "invalid_amount_arithmetic", "currency_not_supported", "merchant_currency_mismatch", "merchant_not_configured"])
|
|
45
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["invalid_amount", "invalid_friends", "amount_below_minimum", "invalid_amount_arithmetic", "currency_not_supported", "merchant_currency_mismatch", "merchant_not_configured"])
|
|
46
46
|
# validator.allowable_values.each do |value|
|
|
47
47
|
# expect { instance.code = value }.not_to raise_error
|
|
48
48
|
# end
|
|
@@ -115,4 +115,10 @@ describe MaytesApiClient::CreateCheckoutRequest do
|
|
|
115
115
|
end
|
|
116
116
|
end
|
|
117
117
|
|
|
118
|
+
describe 'test attribute "friends"' do
|
|
119
|
+
it 'should work' do
|
|
120
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
|
|
118
124
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: maytes-api-client-rb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Maytes
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-11-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: typhoeus
|
|
@@ -74,6 +74,9 @@ files:
|
|
|
74
74
|
- docs/CheckoutCreated.md
|
|
75
75
|
- docs/CheckoutDiscount.md
|
|
76
76
|
- docs/CheckoutFee.md
|
|
77
|
+
- docs/CheckoutFriend.md
|
|
78
|
+
- docs/CheckoutFriendItem.md
|
|
79
|
+
- docs/CheckoutFriends.md
|
|
77
80
|
- docs/CreateCheckout401Response.md
|
|
78
81
|
- docs/CreateCheckout409Response.md
|
|
79
82
|
- docs/CreateCheckout422Response.md
|
|
@@ -130,6 +133,9 @@ files:
|
|
|
130
133
|
- lib/maytes_api_client/models/checkout_created.rb
|
|
131
134
|
- lib/maytes_api_client/models/checkout_discount.rb
|
|
132
135
|
- lib/maytes_api_client/models/checkout_fee.rb
|
|
136
|
+
- lib/maytes_api_client/models/checkout_friend.rb
|
|
137
|
+
- lib/maytes_api_client/models/checkout_friend_item.rb
|
|
138
|
+
- lib/maytes_api_client/models/checkout_friends.rb
|
|
133
139
|
- lib/maytes_api_client/models/create_checkout401_response.rb
|
|
134
140
|
- lib/maytes_api_client/models/create_checkout409_response.rb
|
|
135
141
|
- lib/maytes_api_client/models/create_checkout422_response.rb
|
|
@@ -181,6 +187,9 @@ files:
|
|
|
181
187
|
- spec/models/checkout_created_spec.rb
|
|
182
188
|
- spec/models/checkout_discount_spec.rb
|
|
183
189
|
- spec/models/checkout_fee_spec.rb
|
|
190
|
+
- spec/models/checkout_friend_item_spec.rb
|
|
191
|
+
- spec/models/checkout_friend_spec.rb
|
|
192
|
+
- spec/models/checkout_friends_spec.rb
|
|
184
193
|
- spec/models/checkout_spec.rb
|
|
185
194
|
- spec/models/create_checkout401_response_spec.rb
|
|
186
195
|
- spec/models/create_checkout409_response_spec.rb
|
|
@@ -247,52 +256,55 @@ specification_version: 4
|
|
|
247
256
|
summary: Official Ruby client for the Maytes API
|
|
248
257
|
test_files:
|
|
249
258
|
- spec/api/default_api_spec.rb
|
|
250
|
-
- spec/models/
|
|
259
|
+
- spec/models/checkout_friends_spec.rb
|
|
260
|
+
- spec/models/health_response_spec.rb
|
|
261
|
+
- spec/models/digital_goods_custom_data_spec.rb
|
|
262
|
+
- spec/models/ticket_line_item_spec.rb
|
|
251
263
|
- spec/models/checkout_fee_spec.rb
|
|
264
|
+
- spec/models/create_checkout401_response_spec.rb
|
|
265
|
+
- spec/models/other_line_item_spec.rb
|
|
266
|
+
- spec/models/error_response_dto_spec.rb
|
|
267
|
+
- spec/models/checkout_friend_spec.rb
|
|
268
|
+
- spec/models/get_checkout404_response_spec.rb
|
|
269
|
+
- spec/models/cancel_checkout409_response_spec.rb
|
|
270
|
+
- spec/models/checkout_cancelled_spec.rb
|
|
252
271
|
- spec/models/create_checkout409_response_spec.rb
|
|
253
|
-
- spec/models/
|
|
254
|
-
- spec/models/
|
|
255
|
-
- spec/models/
|
|
272
|
+
- spec/models/checkout_discount_spec.rb
|
|
273
|
+
- spec/models/fee_spec.rb
|
|
274
|
+
- spec/models/ticket_seating_spec.rb
|
|
275
|
+
- spec/models/capture_checkout422_response_spec.rb
|
|
276
|
+
- spec/models/get_checkout_response_spec.rb
|
|
256
277
|
- spec/models/create_checkout_response_spec.rb
|
|
257
|
-
- spec/models/
|
|
258
|
-
- spec/models/
|
|
278
|
+
- spec/models/digital_goods_line_item_spec.rb
|
|
279
|
+
- spec/models/capture_checkout409_response_spec.rb
|
|
280
|
+
- spec/models/customer_data_spec.rb
|
|
259
281
|
- spec/models/service_custom_data_spec.rb
|
|
282
|
+
- spec/models/donation_line_item_spec.rb
|
|
260
283
|
- spec/models/checkout_created_spec.rb
|
|
261
|
-
- spec/models/
|
|
284
|
+
- spec/models/fee_breakdown_line_spec.rb
|
|
285
|
+
- spec/models/physical_goods_custom_data_spec.rb
|
|
286
|
+
- spec/models/o_auth_token_response_spec.rb
|
|
262
287
|
- spec/models/line_item_spec.rb
|
|
263
|
-
- spec/models/
|
|
288
|
+
- spec/models/o_auth_token_request_spec.rb
|
|
289
|
+
- spec/models/cancel_checkout_response_spec.rb
|
|
264
290
|
- spec/models/ticket_custom_data_spec.rb
|
|
265
|
-
- spec/models/
|
|
266
|
-
- spec/models/
|
|
291
|
+
- spec/models/capture_checkout_response_spec.rb
|
|
292
|
+
- spec/models/capture_checkout_request_spec.rb
|
|
293
|
+
- spec/models/cancel_checkout_request_spec.rb
|
|
294
|
+
- spec/models/checkout_spec.rb
|
|
295
|
+
- spec/models/get_settlement_response_spec.rb
|
|
296
|
+
- spec/models/refund_checkout409_response_spec.rb
|
|
297
|
+
- spec/models/checkout_friend_item_spec.rb
|
|
298
|
+
- spec/models/service_line_item_spec.rb
|
|
267
299
|
- spec/models/checkout_captured_spec.rb
|
|
268
300
|
- spec/models/create_refund_request_spec.rb
|
|
269
|
-
- spec/models/
|
|
270
|
-
- spec/models/cancel_checkout409_response_spec.rb
|
|
271
|
-
- spec/models/checkout_cancelled_spec.rb
|
|
272
|
-
- spec/models/fee_breakdown_line_spec.rb
|
|
273
|
-
- spec/models/ticket_seating_spec.rb
|
|
274
|
-
- spec/models/capture_checkout409_response_spec.rb
|
|
275
|
-
- spec/models/create_checkout401_response_spec.rb
|
|
276
|
-
- spec/models/ticket_line_item_spec.rb
|
|
277
|
-
- spec/models/o_auth_token_request_spec.rb
|
|
278
|
-
- spec/models/physical_goods_custom_data_spec.rb
|
|
279
|
-
- spec/models/service_line_item_spec.rb
|
|
280
|
-
- spec/models/capture_checkout_request_spec.rb
|
|
281
|
-
- spec/models/cancel_checkout_response_spec.rb
|
|
301
|
+
- spec/models/get_checkout422_response_spec.rb
|
|
282
302
|
- spec/models/food_beverage_line_item_spec.rb
|
|
283
|
-
- spec/models/
|
|
284
|
-
- spec/models/
|
|
285
|
-
- spec/models/digital_goods_line_item_spec.rb
|
|
303
|
+
- spec/models/settlement_spec.rb
|
|
304
|
+
- spec/models/list_settlements_response_spec.rb
|
|
286
305
|
- spec/models/physical_goods_line_item_spec.rb
|
|
287
|
-
- spec/models/
|
|
288
|
-
- spec/models/get_checkout422_response_spec.rb
|
|
289
|
-
- spec/models/refund_checkout402_response_spec.rb
|
|
290
|
-
- spec/models/get_checkout404_response_spec.rb
|
|
291
|
-
- spec/models/capture_checkout_response_spec.rb
|
|
292
|
-
- spec/models/tax_spec.rb
|
|
293
|
-
- spec/models/fee_spec.rb
|
|
294
|
-
- spec/models/digital_goods_custom_data_spec.rb
|
|
295
|
-
- spec/models/checkout_discount_spec.rb
|
|
296
|
-
- spec/models/capture_checkout422_response_spec.rb
|
|
306
|
+
- spec/models/create_checkout422_response_spec.rb
|
|
297
307
|
- spec/models/create_checkout_request_spec.rb
|
|
308
|
+
- spec/models/tax_spec.rb
|
|
309
|
+
- spec/models/refund_checkout402_response_spec.rb
|
|
298
310
|
- spec/spec_helper.rb
|