vgs_api_client 0.0.1.alpha202305302134 → 0.0.1.alpha202306021830
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/VERSION +1 -1
- data/api.yaml +21 -86
- data/lib/openapi_client/api/aliases_api.rb +9 -33
- data/lib/openapi_client/api_client.rb +1 -1
- data/lib/openapi_client/models/alias_format.rb +0 -3
- data/lib/openapi_client/models/create_aliases_request.rb +1 -1
- data/lib/openapi_client/models/create_aliases_request_new.rb +5 -1
- data/lib/openapi_client/models/create_aliases_request_reference.rb +5 -1
- data/lib/openapi_client/models/{alias_dto.rb → model_alias.rb} +3 -4
- data/lib/openapi_client/models/revealed_data.rb +1 -2
- data/lib/openapi_client/version.rb +1 -1
- data/lib/openapi_client.rb +1 -3
- data/lib/version.rb +1 -1
- data/lib/vgs_api_client.rb +1 -1
- data/scripts/assemble/run.sh +1 -1
- data/scripts/test/run.sh +1 -1
- metadata +3 -5
- data/lib/openapi_client/api/default_api.rb +0 -86
- data/lib/openapi_client/models/batch_aliases_request.rb +0 -264
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 202ee25ab57921678ee2647ef2bfc1cc0b0a747437a1ec2c2283fc2458002664
|
4
|
+
data.tar.gz: 9884a1c0f38bb0feee80b5aab3ca8742e25e03e516db2a34abe0aa83dd94979b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ca0495b73b9ee454aed0d4c301c397c1b9825f500b17dafe729d6696509ea44123280386000c06180c91878adf93a991808aff0db8b6bacba32b2ddc8f25a0e
|
7
|
+
data.tar.gz: 6369b070acef3e63fc8ea29db1d49eda36a28845fe1bec3c99f98bad2ded956947f82eb9a1fbc72305d6f539ceb9c757c78d1a87dd20c9f60ae05d1028b1474e
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.1.
|
1
|
+
0.0.1.alpha202306021830
|
data/api.yaml
CHANGED
@@ -201,7 +201,7 @@ paths:
|
|
201
201
|
manager or drop us a line at
|
202
202
|
[support@verygoodsecurity.com](mailto:support@verygoodsecurity.com).
|
203
203
|
parameters:
|
204
|
-
- name:
|
204
|
+
- name: q
|
205
205
|
in: query
|
206
206
|
required: true
|
207
207
|
description: Comma-separated list of aliases to reveal.
|
@@ -209,14 +209,6 @@ paths:
|
|
209
209
|
- "tok_sandbox_5UpnbMvaihRuRwz5QXwBFw,tok_sandbox_9ToiJHedw1nE1Jfx1qYYgz"
|
210
210
|
schema:
|
211
211
|
type: string
|
212
|
-
- name: storage
|
213
|
-
in: query
|
214
|
-
required: false
|
215
|
-
description: PERSISTENT or VOLATILE storage
|
216
|
-
example:
|
217
|
-
- "PERSISTENT"
|
218
|
-
schema:
|
219
|
-
type: string
|
220
212
|
responses:
|
221
213
|
'200':
|
222
214
|
description: OK
|
@@ -255,37 +247,12 @@ paths:
|
|
255
247
|
- lang: Shell
|
256
248
|
label: cURL
|
257
249
|
source: |
|
258
|
-
curl https://api.sandbox.verygoodvault.com/aliases?
|
250
|
+
curl https://api.sandbox.verygoodvault.com/aliases?q={{alias1}},{{alias2}} \
|
259
251
|
-u "$USERNAME:$PASSWORD"
|
260
252
|
|
261
|
-
/aliases/delete:
|
262
|
-
post:
|
263
|
-
summary: "POST aliases/delete"
|
264
|
-
operationId: "deleteAliases"
|
265
|
-
requestBody:
|
266
|
-
content:
|
267
|
-
application/json:
|
268
|
-
schema:
|
269
|
-
$ref: "#/components/schemas/BatchAliasesRequest"
|
270
|
-
required: true
|
271
|
-
responses:
|
272
|
-
"204":
|
273
|
-
description: "No Content"
|
274
|
-
"404":
|
275
|
-
description: "Not Found"
|
276
|
-
x-codeSamples:
|
277
|
-
- lang: Shell
|
278
|
-
label: cURL
|
279
|
-
source: |
|
280
|
-
curl -v https://api.sandbox.verygoodvault.com/aliases/delete -d \
|
281
|
-
'{"storage":"VOLATILE","data":["tok_whjuj6F8r3f2KeCpY7RPCE"]}' \
|
282
|
-
-H 'Content-Type: application/json' \
|
283
|
-
-u "$USERNAME:$PASSWORD"
|
284
|
-
|
285
253
|
/aliases/{alias}:
|
286
254
|
parameters:
|
287
255
|
- $ref: '#/components/parameters/alias'
|
288
|
-
- $ref: '#/components/parameters/storage'
|
289
256
|
get:
|
290
257
|
operationId: revealAlias
|
291
258
|
tags:
|
@@ -300,7 +267,6 @@ paths:
|
|
300
267
|
[support@verygoodsecurity.com](mailto:support@verygoodsecurity.com).
|
301
268
|
parameters:
|
302
269
|
- $ref: '#/components/parameters/alias'
|
303
|
-
- $ref: '#/components/parameters/storage'
|
304
270
|
responses:
|
305
271
|
'200':
|
306
272
|
description: OK
|
@@ -322,7 +288,7 @@ paths:
|
|
322
288
|
- lang: Shell
|
323
289
|
label: cURL
|
324
290
|
source: |
|
325
|
-
curl https://api.sandbox.verygoodvault.com/aliases/{{alias}}
|
291
|
+
curl https://api.sandbox.verygoodvault.com/aliases/{{alias}} \
|
326
292
|
-u "$USERNAME:$PASSWORD"
|
327
293
|
put:
|
328
294
|
operationId: updateAlias
|
@@ -366,7 +332,6 @@ paths:
|
|
366
332
|
Removes a single alias.
|
367
333
|
parameters:
|
368
334
|
- $ref: '#/components/parameters/alias'
|
369
|
-
- $ref: '#/components/parameters/storage'
|
370
335
|
responses:
|
371
336
|
'204':
|
372
337
|
description: No Content
|
@@ -376,7 +341,7 @@ paths:
|
|
376
341
|
- lang: Shell
|
377
342
|
label: cURL
|
378
343
|
source: |
|
379
|
-
curl https://api.sandbox.verygoodvault.com/aliases/{{alias}}
|
344
|
+
curl https://api.sandbox.verygoodvault.com/aliases/{{alias}} \
|
380
345
|
-X DELETE \
|
381
346
|
-u "$USERNAME:$PASSWORD"
|
382
347
|
|
@@ -400,16 +365,6 @@ components:
|
|
400
365
|
schema:
|
401
366
|
type: string
|
402
367
|
example: tok_sandbox_bhtsCwFUzoJMw9rWUfEV5e
|
403
|
-
storage:
|
404
|
-
name: "storage"
|
405
|
-
in: "query"
|
406
|
-
required: false
|
407
|
-
schema:
|
408
|
-
type: "string"
|
409
|
-
enum:
|
410
|
-
- "PERSISTENT"
|
411
|
-
- "VOLATILE"
|
412
|
-
default: "PERSISTENT"
|
413
368
|
|
414
369
|
responses:
|
415
370
|
ApiErrorsResponse:
|
@@ -459,14 +414,13 @@ components:
|
|
459
414
|
aliases:
|
460
415
|
type: "array"
|
461
416
|
items:
|
462
|
-
$ref: '#/components/schemas/
|
417
|
+
$ref: '#/components/schemas/Alias'
|
463
418
|
description: List of aliases associated with the value.
|
464
419
|
created_at:
|
465
420
|
type: "string"
|
466
421
|
format: "date-time"
|
467
422
|
description: Creation time, in UTC.
|
468
423
|
example: "2019-05-15T12:30:45Z"
|
469
|
-
nullable: true
|
470
424
|
storage:
|
471
425
|
type: string
|
472
426
|
enum:
|
@@ -478,7 +432,7 @@ components:
|
|
478
432
|
|
479
433
|
VOLATILE results in data being persisted into an in-memory data store for one hour which is required for PCI compliant storage of card security code data.
|
480
434
|
|
481
|
-
|
435
|
+
Alias:
|
482
436
|
type: "object"
|
483
437
|
properties:
|
484
438
|
alias:
|
@@ -487,48 +441,27 @@ components:
|
|
487
441
|
description: Opaque string used to substitute the raw value.
|
488
442
|
format:
|
489
443
|
$ref: '#/components/schemas/AliasFormat'
|
490
|
-
nullable: true
|
491
444
|
|
492
445
|
AliasFormat:
|
493
446
|
type: string
|
494
447
|
enum:
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
- "RAW_UUID"
|
508
|
-
- "UUID"
|
509
|
-
- "VGS_FIXED_LEN_GENERIC"
|
448
|
+
- FPE_ACC_NUM_T_FOUR
|
449
|
+
- FPE_ALPHANUMERIC_ACC_NUM_T_FOUR
|
450
|
+
- FPE_SIX_T_FOUR
|
451
|
+
- FPE_SSN_T_FOUR
|
452
|
+
- FPE_T_FOUR
|
453
|
+
- GENERIC_T_FOUR
|
454
|
+
- NON_LUHN_FPE_ALPHANUMERIC
|
455
|
+
- NUM_LENGTH_PRESERVING
|
456
|
+
- PFPT
|
457
|
+
- RAW_UUID
|
458
|
+
- UUID
|
459
|
+
- VGS_FIXED_LEN_GENERIC
|
510
460
|
description: |
|
511
461
|
Format of the generated alias string.
|
512
462
|
|
513
463
|
See [Alias Formats](#section/Introduction/Alias-Formats) for details.
|
514
464
|
example: UUID
|
515
|
-
nullable: true
|
516
|
-
|
517
|
-
BatchAliasesRequest:
|
518
|
-
type: "object"
|
519
|
-
properties:
|
520
|
-
data:
|
521
|
-
type: "array"
|
522
|
-
items:
|
523
|
-
type: "string"
|
524
|
-
storage:
|
525
|
-
type: "string"
|
526
|
-
enum:
|
527
|
-
- "PERSISTENT"
|
528
|
-
- "VOLATILE"
|
529
|
-
description: |
|
530
|
-
Format for batch requests (limit 20)
|
531
|
-
example: '{"data":["123-13123-1232"],"storage":"PERSISTENT"}'
|
532
465
|
|
533
466
|
CreateAliasesRequest:
|
534
467
|
type: object
|
@@ -536,7 +469,9 @@ components:
|
|
536
469
|
data:
|
537
470
|
type: array
|
538
471
|
items:
|
539
|
-
|
472
|
+
oneOf:
|
473
|
+
- $ref: '#/components/schemas/CreateAliasesRequestNew'
|
474
|
+
- $ref: '#/components/schemas/CreateAliasesRequestReference'
|
540
475
|
minItems: 1
|
541
476
|
maxItems: 20
|
542
477
|
required:
|
@@ -87,7 +87,6 @@ module VgsApiClient
|
|
87
87
|
# Removes a single alias.
|
88
88
|
# @param _alias [String] Alias to operate on.
|
89
89
|
# @param [Hash] opts the optional parameters
|
90
|
-
# @option opts [String] :storage (default to 'PERSISTENT')
|
91
90
|
# @return [nil]
|
92
91
|
def delete_alias(_alias, opts = {})
|
93
92
|
delete_alias_with_http_info(_alias, opts)
|
@@ -98,7 +97,6 @@ module VgsApiClient
|
|
98
97
|
# Removes a single alias.
|
99
98
|
# @param _alias [String] Alias to operate on.
|
100
99
|
# @param [Hash] opts the optional parameters
|
101
|
-
# @option opts [String] :storage
|
102
100
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
103
101
|
def delete_alias_with_http_info(_alias, opts = {})
|
104
102
|
if @api_client.config.debugging
|
@@ -108,16 +106,11 @@ module VgsApiClient
|
|
108
106
|
if @api_client.config.client_side_validation && _alias.nil?
|
109
107
|
fail ArgumentError, "Missing the required parameter '_alias' when calling AliasesApi.delete_alias"
|
110
108
|
end
|
111
|
-
allowable_values = ["PERSISTENT", "VOLATILE"]
|
112
|
-
if @api_client.config.client_side_validation && opts[:'storage'] && !allowable_values.include?(opts[:'storage'])
|
113
|
-
fail ArgumentError, "invalid value for \"storage\", must be one of #{allowable_values}"
|
114
|
-
end
|
115
109
|
# resource path
|
116
110
|
local_var_path = '/aliases/{alias}'.sub('{' + 'alias' + '}', CGI.escape(_alias.to_s))
|
117
111
|
|
118
112
|
# query parameters
|
119
113
|
query_params = opts[:query_params] || {}
|
120
|
-
query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
|
121
114
|
|
122
115
|
# header parameters
|
123
116
|
header_params = opts[:header_params] || {}
|
@@ -157,7 +150,6 @@ module VgsApiClient
|
|
157
150
|
# Retrieves a stored value along with its aliases. **NOTE:** This endpoint may expose sensitive data. Therefore, it is disabled by default. To enable it, please contact your VGS account manager or drop us a line at [support@verygoodsecurity.com](mailto:support@verygoodsecurity.com).
|
158
151
|
# @param _alias [String] Alias to operate on.
|
159
152
|
# @param [Hash] opts the optional parameters
|
160
|
-
# @option opts [String] :storage (default to 'PERSISTENT')
|
161
153
|
# @return [InlineResponse2001]
|
162
154
|
def reveal_alias(_alias, opts = {})
|
163
155
|
data, _status_code, _headers = reveal_alias_with_http_info(_alias, opts)
|
@@ -168,7 +160,6 @@ module VgsApiClient
|
|
168
160
|
# Retrieves a stored value along with its aliases. **NOTE:** This endpoint may expose sensitive data. Therefore, it is disabled by default. To enable it, please contact your VGS account manager or drop us a line at [support@verygoodsecurity.com](mailto:support@verygoodsecurity.com).
|
169
161
|
# @param _alias [String] Alias to operate on.
|
170
162
|
# @param [Hash] opts the optional parameters
|
171
|
-
# @option opts [String] :storage
|
172
163
|
# @return [Array<(InlineResponse2001, Integer, Hash)>] InlineResponse2001 data, response status code and response headers
|
173
164
|
def reveal_alias_with_http_info(_alias, opts = {})
|
174
165
|
if @api_client.config.debugging
|
@@ -178,16 +169,11 @@ module VgsApiClient
|
|
178
169
|
if @api_client.config.client_side_validation && _alias.nil?
|
179
170
|
fail ArgumentError, "Missing the required parameter '_alias' when calling AliasesApi.reveal_alias"
|
180
171
|
end
|
181
|
-
allowable_values = ["PERSISTENT", "VOLATILE"]
|
182
|
-
if @api_client.config.client_side_validation && opts[:'storage'] && !allowable_values.include?(opts[:'storage'])
|
183
|
-
fail ArgumentError, "invalid value for \"storage\", must be one of #{allowable_values}"
|
184
|
-
end
|
185
172
|
# resource path
|
186
173
|
local_var_path = '/aliases/{alias}'.sub('{' + 'alias' + '}', CGI.escape(_alias.to_s))
|
187
174
|
|
188
175
|
# query parameters
|
189
176
|
query_params = opts[:query_params] || {}
|
190
|
-
query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
|
191
177
|
|
192
178
|
# header parameters
|
193
179
|
header_params = opts[:header_params] || {}
|
@@ -225,36 +211,33 @@ module VgsApiClient
|
|
225
211
|
|
226
212
|
# Reveal multiple aliases
|
227
213
|
# Given a list of aliases, retrieves all associated values stored in the vault. **NOTE:** This endpoint may expose sensitive data. Therefore, it is disabled by default. To enable it, please contact your VGS account manager or drop us a line at [support@verygoodsecurity.com](mailto:support@verygoodsecurity.com).
|
228
|
-
# @param
|
214
|
+
# @param q [String] Comma-separated list of aliases to reveal.
|
229
215
|
# @param [Hash] opts the optional parameters
|
230
|
-
# @option opts [String] :storage PERSISTENT or VOLATILE storage
|
231
216
|
# @return [InlineResponse200]
|
232
|
-
def reveal_multiple_aliases(
|
233
|
-
data, _status_code, _headers = reveal_multiple_aliases_with_http_info(
|
217
|
+
def reveal_multiple_aliases(q, opts = {})
|
218
|
+
data, _status_code, _headers = reveal_multiple_aliases_with_http_info(q, opts)
|
234
219
|
data
|
235
220
|
end
|
236
221
|
|
237
222
|
# Reveal multiple aliases
|
238
223
|
# Given a list of aliases, retrieves all associated values stored in the vault. **NOTE:** This endpoint may expose sensitive data. Therefore, it is disabled by default. To enable it, please contact your VGS account manager or drop us a line at [support@verygoodsecurity.com](mailto:support@verygoodsecurity.com).
|
239
|
-
# @param
|
224
|
+
# @param q [String] Comma-separated list of aliases to reveal.
|
240
225
|
# @param [Hash] opts the optional parameters
|
241
|
-
# @option opts [String] :storage PERSISTENT or VOLATILE storage
|
242
226
|
# @return [Array<(InlineResponse200, Integer, Hash)>] InlineResponse200 data, response status code and response headers
|
243
|
-
def reveal_multiple_aliases_with_http_info(
|
227
|
+
def reveal_multiple_aliases_with_http_info(q, opts = {})
|
244
228
|
if @api_client.config.debugging
|
245
229
|
@api_client.config.logger.debug 'Calling API: AliasesApi.reveal_multiple_aliases ...'
|
246
230
|
end
|
247
|
-
# verify the required parameter '
|
248
|
-
if @api_client.config.client_side_validation &&
|
249
|
-
fail ArgumentError, "Missing the required parameter '
|
231
|
+
# verify the required parameter 'q' is set
|
232
|
+
if @api_client.config.client_side_validation && q.nil?
|
233
|
+
fail ArgumentError, "Missing the required parameter 'q' when calling AliasesApi.reveal_multiple_aliases"
|
250
234
|
end
|
251
235
|
# resource path
|
252
236
|
local_var_path = '/aliases'
|
253
237
|
|
254
238
|
# query parameters
|
255
239
|
query_params = opts[:query_params] || {}
|
256
|
-
query_params[:'
|
257
|
-
query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
|
240
|
+
query_params[:'q'] = q
|
258
241
|
|
259
242
|
# header parameters
|
260
243
|
header_params = opts[:header_params] || {}
|
@@ -294,7 +277,6 @@ module VgsApiClient
|
|
294
277
|
# Apply new classifiers to the value that the specified alias is associated with.
|
295
278
|
# @param _alias [String] Alias to operate on.
|
296
279
|
# @param [Hash] opts the optional parameters
|
297
|
-
# @option opts [String] :storage (default to 'PERSISTENT')
|
298
280
|
# @option opts [UpdateAliasRequest] :update_alias_request
|
299
281
|
# @return [nil]
|
300
282
|
def update_alias(_alias, opts = {})
|
@@ -306,7 +288,6 @@ module VgsApiClient
|
|
306
288
|
# Apply new classifiers to the value that the specified alias is associated with.
|
307
289
|
# @param _alias [String] Alias to operate on.
|
308
290
|
# @param [Hash] opts the optional parameters
|
309
|
-
# @option opts [String] :storage
|
310
291
|
# @option opts [UpdateAliasRequest] :update_alias_request
|
311
292
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
312
293
|
def update_alias_with_http_info(_alias, opts = {})
|
@@ -317,16 +298,11 @@ module VgsApiClient
|
|
317
298
|
if @api_client.config.client_side_validation && _alias.nil?
|
318
299
|
fail ArgumentError, "Missing the required parameter '_alias' when calling AliasesApi.update_alias"
|
319
300
|
end
|
320
|
-
allowable_values = ["PERSISTENT", "VOLATILE"]
|
321
|
-
if @api_client.config.client_side_validation && opts[:'storage'] && !allowable_values.include?(opts[:'storage'])
|
322
|
-
fail ArgumentError, "invalid value for \"storage\", must be one of #{allowable_values}"
|
323
|
-
end
|
324
301
|
# resource path
|
325
302
|
local_var_path = '/aliases/{alias}'.sub('{' + 'alias' + '}', CGI.escape(_alias.to_s))
|
326
303
|
|
327
304
|
# query parameters
|
328
305
|
query_params = opts[:query_params] || {}
|
329
|
-
query_params[:'storage'] = opts[:'storage'] if !opts[:'storage'].nil?
|
330
306
|
|
331
307
|
# header parameters
|
332
308
|
header_params = opts[:header_params] || {}
|
@@ -31,7 +31,7 @@ module VgsApiClient
|
|
31
31
|
# @option config [Configuration] Configuration for initializing the object, default to Configuration.default
|
32
32
|
def initialize(config = Configuration.default)
|
33
33
|
@config = config
|
34
|
-
@user_agent = "vgs-api-client/0.0.1.
|
34
|
+
@user_agent = "vgs-api-client/0.0.1.alpha202306021830/ruby"
|
35
35
|
@default_headers = {
|
36
36
|
'Content-Type' => 'application/json',
|
37
37
|
'User-Agent' => @user_agent
|
@@ -15,15 +15,12 @@ require 'time'
|
|
15
15
|
|
16
16
|
module VgsApiClient
|
17
17
|
class AliasFormat
|
18
|
-
ALPHANUMERIC_SIX_T_FOUR = "ALPHANUMERIC_SIX_T_FOUR".freeze
|
19
|
-
CUSTOM = "CUSTOM".freeze
|
20
18
|
FPE_ACC_NUM_T_FOUR = "FPE_ACC_NUM_T_FOUR".freeze
|
21
19
|
FPE_ALPHANUMERIC_ACC_NUM_T_FOUR = "FPE_ALPHANUMERIC_ACC_NUM_T_FOUR".freeze
|
22
20
|
FPE_SIX_T_FOUR = "FPE_SIX_T_FOUR".freeze
|
23
21
|
FPE_SSN_T_FOUR = "FPE_SSN_T_FOUR".freeze
|
24
22
|
FPE_T_FOUR = "FPE_T_FOUR".freeze
|
25
23
|
GENERIC_T_FOUR = "GENERIC_T_FOUR".freeze
|
26
|
-
JS = "JS".freeze
|
27
24
|
NON_LUHN_FPE_ALPHANUMERIC = "NON_LUHN_FPE_ALPHANUMERIC".freeze
|
28
25
|
NUM_LENGTH_PRESERVING = "NUM_LENGTH_PRESERVING".freeze
|
29
26
|
PFPT = "PFPT".freeze
|
@@ -76,7 +76,6 @@ module VgsApiClient
|
|
76
76
|
# List of attributes with nullable: true
|
77
77
|
def self.openapi_nullable
|
78
78
|
Set.new([
|
79
|
-
:'format',
|
80
79
|
])
|
81
80
|
end
|
82
81
|
|
@@ -120,6 +119,10 @@ module VgsApiClient
|
|
120
119
|
# @return Array for valid properties with the reasons
|
121
120
|
def list_invalid_properties
|
122
121
|
invalid_properties = Array.new
|
122
|
+
if @format.nil?
|
123
|
+
invalid_properties.push('invalid value for "format", format cannot be nil.')
|
124
|
+
end
|
125
|
+
|
123
126
|
if @value.nil?
|
124
127
|
invalid_properties.push('invalid value for "value", value cannot be nil.')
|
125
128
|
end
|
@@ -130,6 +133,7 @@ module VgsApiClient
|
|
130
133
|
# Check to see if the all the properties in the model are valid
|
131
134
|
# @return true if the model is valid
|
132
135
|
def valid?
|
136
|
+
return false if @format.nil?
|
133
137
|
storage_validator = EnumAttributeValidator.new('String', ["PERSISTENT", "VOLATILE"])
|
134
138
|
return false unless storage_validator.valid?(@storage)
|
135
139
|
return false if @value.nil?
|
@@ -44,7 +44,6 @@ module VgsApiClient
|
|
44
44
|
# List of attributes with nullable: true
|
45
45
|
def self.openapi_nullable
|
46
46
|
Set.new([
|
47
|
-
:'format'
|
48
47
|
])
|
49
48
|
end
|
50
49
|
|
@@ -80,6 +79,10 @@ module VgsApiClient
|
|
80
79
|
invalid_properties.push('invalid value for "_alias", _alias cannot be nil.')
|
81
80
|
end
|
82
81
|
|
82
|
+
if @format.nil?
|
83
|
+
invalid_properties.push('invalid value for "format", format cannot be nil.')
|
84
|
+
end
|
85
|
+
|
83
86
|
invalid_properties
|
84
87
|
end
|
85
88
|
|
@@ -87,6 +90,7 @@ module VgsApiClient
|
|
87
90
|
# @return true if the model is valid
|
88
91
|
def valid?
|
89
92
|
return false if @_alias.nil?
|
93
|
+
return false if @format.nil?
|
90
94
|
true
|
91
95
|
end
|
92
96
|
|
@@ -14,7 +14,7 @@ require 'date'
|
|
14
14
|
require 'time'
|
15
15
|
|
16
16
|
module VgsApiClient
|
17
|
-
class
|
17
|
+
class ModelAlias
|
18
18
|
# Opaque string used to substitute the raw value.
|
19
19
|
attr_accessor :_alias
|
20
20
|
|
@@ -44,7 +44,6 @@ module VgsApiClient
|
|
44
44
|
# List of attributes with nullable: true
|
45
45
|
def self.openapi_nullable
|
46
46
|
Set.new([
|
47
|
-
:'format'
|
48
47
|
])
|
49
48
|
end
|
50
49
|
|
@@ -52,13 +51,13 @@ module VgsApiClient
|
|
52
51
|
# @param [Hash] attributes Model attributes in the form of hash
|
53
52
|
def initialize(attributes = {})
|
54
53
|
if (!attributes.is_a?(Hash))
|
55
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `VgsApiClient::
|
54
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `VgsApiClient::ModelAlias` initialize method"
|
56
55
|
end
|
57
56
|
|
58
57
|
# check to see if the attribute exists and convert string to symbol for hash key
|
59
58
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
60
59
|
if (!self.class.attribute_map.key?(k.to_sym))
|
61
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `VgsApiClient::
|
60
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `VgsApiClient::ModelAlias`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
62
61
|
end
|
63
62
|
h[k.to_sym] = v
|
64
63
|
}
|
@@ -71,7 +71,7 @@ module VgsApiClient
|
|
71
71
|
# Attribute type mapping.
|
72
72
|
def self.openapi_types
|
73
73
|
{
|
74
|
-
:'aliases' => :'Array<
|
74
|
+
:'aliases' => :'Array<ModelAlias>',
|
75
75
|
:'classifiers' => :'Array<String>',
|
76
76
|
:'created_at' => :'Time',
|
77
77
|
:'storage' => :'String',
|
@@ -82,7 +82,6 @@ module VgsApiClient
|
|
82
82
|
# List of attributes with nullable: true
|
83
83
|
def self.openapi_nullable
|
84
84
|
Set.new([
|
85
|
-
:'created_at',
|
86
85
|
])
|
87
86
|
end
|
88
87
|
|
data/lib/openapi_client.rb
CHANGED
@@ -17,10 +17,8 @@ require 'openapi_client/version'
|
|
17
17
|
require 'openapi_client/configuration'
|
18
18
|
|
19
19
|
# Models
|
20
|
-
require 'openapi_client/models/alias_dto'
|
21
20
|
require 'openapi_client/models/alias_format'
|
22
21
|
require 'openapi_client/models/api_error'
|
23
|
-
require 'openapi_client/models/batch_aliases_request'
|
24
22
|
require 'openapi_client/models/create_aliases_request'
|
25
23
|
require 'openapi_client/models/create_aliases_request_new'
|
26
24
|
require 'openapi_client/models/create_aliases_request_reference'
|
@@ -28,13 +26,13 @@ require 'openapi_client/models/inline_response200'
|
|
28
26
|
require 'openapi_client/models/inline_response2001'
|
29
27
|
require 'openapi_client/models/inline_response201'
|
30
28
|
require 'openapi_client/models/inline_response_default'
|
29
|
+
require 'openapi_client/models/model_alias'
|
31
30
|
require 'openapi_client/models/revealed_data'
|
32
31
|
require 'openapi_client/models/update_alias_request'
|
33
32
|
require 'openapi_client/models/update_alias_request_data'
|
34
33
|
|
35
34
|
# APIs
|
36
35
|
require 'openapi_client/api/aliases_api'
|
37
|
-
require 'openapi_client/api/default_api'
|
38
36
|
|
39
37
|
module VgsApiClient
|
40
38
|
class << self
|
data/lib/version.rb
CHANGED
data/lib/vgs_api_client.rb
CHANGED
@@ -65,7 +65,7 @@ module VGS
|
|
65
65
|
def reveal(aliases)
|
66
66
|
begin
|
67
67
|
query = aliases.kind_of?(Array) ? aliases.join(",") : aliases
|
68
|
-
response = @aliases_api.reveal_multiple_aliases(
|
68
|
+
response = @aliases_api.reveal_multiple_aliases(q = query)
|
69
69
|
rescue Exception => e
|
70
70
|
raise map_exception("Failed to reveal aliases #{ aliases }", e)
|
71
71
|
else
|
data/scripts/assemble/run.sh
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
LIB_VERSION=${LIB_VERSION:-0.0.1.alpha$(date "+%Y%m%d%H%M")}
|
4
4
|
|
5
5
|
# fix version
|
6
|
-
grep -rl 0.0.1.
|
6
|
+
grep -rl 0.0.1.alpha202306021830 . | xargs sed -i "s/0.0.1.alpha202306021830/${LIB_VERSION}/g"
|
7
7
|
|
8
8
|
# build
|
9
9
|
gem build vgs_api_client.gemspec
|
data/scripts/test/run.sh
CHANGED
@@ -5,7 +5,7 @@ set -e
|
|
5
5
|
echo "Installing lib from local sources"
|
6
6
|
# fix version
|
7
7
|
VERSION=0.0.1.alpha$(date "+%Y%m%d%H%M")
|
8
|
-
grep -rl 0.0.1.
|
8
|
+
grep -rl 0.0.1.alpha202306021830 . | xargs sed -i "s/0.0.1.alpha202306021830/$VERSION/g"
|
9
9
|
|
10
10
|
bundle install
|
11
11
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vgs_api_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.1.
|
4
|
+
version: 0.0.1.alpha202306021830
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Very Good Security
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -68,14 +68,11 @@ files:
|
|
68
68
|
- docker-compose.yaml
|
69
69
|
- lib/openapi_client.rb
|
70
70
|
- lib/openapi_client/api/aliases_api.rb
|
71
|
-
- lib/openapi_client/api/default_api.rb
|
72
71
|
- lib/openapi_client/api_client.rb
|
73
72
|
- lib/openapi_client/api_error.rb
|
74
73
|
- lib/openapi_client/configuration.rb
|
75
|
-
- lib/openapi_client/models/alias_dto.rb
|
76
74
|
- lib/openapi_client/models/alias_format.rb
|
77
75
|
- lib/openapi_client/models/api_error.rb
|
78
|
-
- lib/openapi_client/models/batch_aliases_request.rb
|
79
76
|
- lib/openapi_client/models/create_aliases_request.rb
|
80
77
|
- lib/openapi_client/models/create_aliases_request_new.rb
|
81
78
|
- lib/openapi_client/models/create_aliases_request_reference.rb
|
@@ -83,6 +80,7 @@ files:
|
|
83
80
|
- lib/openapi_client/models/inline_response2001.rb
|
84
81
|
- lib/openapi_client/models/inline_response201.rb
|
85
82
|
- lib/openapi_client/models/inline_response_default.rb
|
83
|
+
- lib/openapi_client/models/model_alias.rb
|
86
84
|
- lib/openapi_client/models/revealed_data.rb
|
87
85
|
- lib/openapi_client/models/update_alias_request.rb
|
88
86
|
- lib/openapi_client/models/update_alias_request_data.rb
|
@@ -1,86 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#Vault HTTP API
|
3
|
-
|
4
|
-
#The VGS Vault HTTP API is used for storing, retrieving, and managing sensitive data (aka Tokenization) within a VGS Vault. The VGS API is organized around REST. Our API is built with a predictable resource-oriented structure, uses JSON-encoded requests and responses, follows standard HTTP verbs/responses, and uses industry standard authentication. ## What is VGS Storing sensitive data on your company’s infrastructure often comes with a heavy compliance burden. For instance, storing payments data yourself greatly increases the amount of work needed to become PCI compliant. It also increases your security risk in general. To combat this, companies will minimize the amount of sensitive information they have to handle or store. VGS provides multiple methods for minimizing the sensitive information that needs to be stored which allows customers to secure any type of data for any use-case. **Tokenization** is a method that focuses on securing the storage of data. This is the quickest way to get started and is free. [Get started with Tokenization](https://www.verygoodsecurity.com/docs/tokenization/getting-started). **Zero Data** is a unique method invented by VGS in 2016 that securely stores data like Tokenization, however it also removes the customer’s environment from PCI scope completely providing maximum security, and minimum compliance scope. [Get started with Zero Data](https://www.verygoodsecurity.com/docs/getting-started/before-you-start). Additionally, for scenarios where neither technology is a complete solution, for instance with legacy systems, VGS provides a compliance product which guarantees customers are able to meet their compliance needs no matter what may happen. [Get started with Control](https://www.verygoodsecurity.com/docs/control). ## Learn about Tokenization - [Create an Account for Free Tokenization](https://dashboard.verygoodsecurity.com/tokenization) - [Try a Tokenization Demo](https://www.verygoodsecurity.com/docs/tokenization/getting-started) - [Install a Tokenization SDK](https://www.verygoodsecurity.com/docs/tokenization/client-libraries) ### Authentication This API uses `Basic` authentication and is implemented using industry best practices to ensure the security of the connection. Read more about [Identity and Access Management at VGS](https://www.verygoodsecurity.com/docs/vault/the-platform/iam) Credentials to access the API can be generated on the [dashboard](https://dashboard.verygoodsecurity.com) by going to the Settings section of the vault of your choosing. [Docs » Guides » Access credentials](https://www.verygoodsecurity.com/docs/settings/access-credentials) ## Resource Limits ### Data Limits This API allows storing data up to 32MB in size. ### Rate Limiting The API allows up to 3,000 requests per minute. Requests are associated with the vault, regardless of the access credentials used to authenticate the request. Your current rate limit is included as HTTP headers in every API response: | Header Name | Description | |-------------------------|----------------------------------------------------------| | `x-ratelimit-remaining` | The number of requests remaining in the 1-minute window. | If you exceed the rate limit, the API will reject the request with HTTP [429 Too Many Requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429). ### Errors The API uses standard HTTP status codes to indicate whether the request succeeded or not. In case of failure, the response body will be JSON in a predefined format. For example, trying to create too many aliases at once results in the following response: ```json { \"errors\": [ { \"status\": 400, \"title\": \"Bad request\", \"detail\": \"Too many values (limit: 20)\", \"href\": \"https://api.sandbox.verygoodvault.com/aliases\" } ] } ```
|
5
|
-
|
6
|
-
The version of the OpenAPI document: 1.0.0
|
7
|
-
Contact: support@verygoodsecurity.com
|
8
|
-
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 5.4.0
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'cgi'
|
14
|
-
|
15
|
-
module VgsApiClient
|
16
|
-
class DefaultApi
|
17
|
-
attr_accessor :api_client
|
18
|
-
|
19
|
-
def initialize(api_client = ApiClient.default)
|
20
|
-
@api_client = api_client
|
21
|
-
end
|
22
|
-
# POST aliases/delete
|
23
|
-
# @param batch_aliases_request [BatchAliasesRequest]
|
24
|
-
# @param [Hash] opts the optional parameters
|
25
|
-
# @return [nil]
|
26
|
-
def delete_aliases(batch_aliases_request, opts = {})
|
27
|
-
delete_aliases_with_http_info(batch_aliases_request, opts)
|
28
|
-
nil
|
29
|
-
end
|
30
|
-
|
31
|
-
# POST aliases/delete
|
32
|
-
# @param batch_aliases_request [BatchAliasesRequest]
|
33
|
-
# @param [Hash] opts the optional parameters
|
34
|
-
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
35
|
-
def delete_aliases_with_http_info(batch_aliases_request, opts = {})
|
36
|
-
if @api_client.config.debugging
|
37
|
-
@api_client.config.logger.debug 'Calling API: DefaultApi.delete_aliases ...'
|
38
|
-
end
|
39
|
-
# verify the required parameter 'batch_aliases_request' is set
|
40
|
-
if @api_client.config.client_side_validation && batch_aliases_request.nil?
|
41
|
-
fail ArgumentError, "Missing the required parameter 'batch_aliases_request' when calling DefaultApi.delete_aliases"
|
42
|
-
end
|
43
|
-
# resource path
|
44
|
-
local_var_path = '/aliases/delete'
|
45
|
-
|
46
|
-
# query parameters
|
47
|
-
query_params = opts[:query_params] || {}
|
48
|
-
|
49
|
-
# header parameters
|
50
|
-
header_params = opts[:header_params] || {}
|
51
|
-
# HTTP header 'Content-Type'
|
52
|
-
content_type = @api_client.select_header_content_type(['application/json'])
|
53
|
-
if !content_type.nil?
|
54
|
-
header_params['Content-Type'] = content_type
|
55
|
-
end
|
56
|
-
|
57
|
-
# form parameters
|
58
|
-
form_params = opts[:form_params] || {}
|
59
|
-
|
60
|
-
# http body (model)
|
61
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(batch_aliases_request)
|
62
|
-
|
63
|
-
# return_type
|
64
|
-
return_type = opts[:debug_return_type]
|
65
|
-
|
66
|
-
# auth_names
|
67
|
-
auth_names = opts[:debug_auth_names] || ['basicAuth']
|
68
|
-
|
69
|
-
new_options = opts.merge(
|
70
|
-
:operation => :"DefaultApi.delete_aliases",
|
71
|
-
:header_params => header_params,
|
72
|
-
:query_params => query_params,
|
73
|
-
:form_params => form_params,
|
74
|
-
:body => post_body,
|
75
|
-
:auth_names => auth_names,
|
76
|
-
:return_type => return_type
|
77
|
-
)
|
78
|
-
|
79
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
80
|
-
if @api_client.config.debugging
|
81
|
-
@api_client.config.logger.debug "API called: DefaultApi#delete_aliases\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
82
|
-
end
|
83
|
-
return data, status_code, headers
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
@@ -1,264 +0,0 @@
|
|
1
|
-
=begin
|
2
|
-
#Vault HTTP API
|
3
|
-
|
4
|
-
#The VGS Vault HTTP API is used for storing, retrieving, and managing sensitive data (aka Tokenization) within a VGS Vault. The VGS API is organized around REST. Our API is built with a predictable resource-oriented structure, uses JSON-encoded requests and responses, follows standard HTTP verbs/responses, and uses industry standard authentication. ## What is VGS Storing sensitive data on your company’s infrastructure often comes with a heavy compliance burden. For instance, storing payments data yourself greatly increases the amount of work needed to become PCI compliant. It also increases your security risk in general. To combat this, companies will minimize the amount of sensitive information they have to handle or store. VGS provides multiple methods for minimizing the sensitive information that needs to be stored which allows customers to secure any type of data for any use-case. **Tokenization** is a method that focuses on securing the storage of data. This is the quickest way to get started and is free. [Get started with Tokenization](https://www.verygoodsecurity.com/docs/tokenization/getting-started). **Zero Data** is a unique method invented by VGS in 2016 that securely stores data like Tokenization, however it also removes the customer’s environment from PCI scope completely providing maximum security, and minimum compliance scope. [Get started with Zero Data](https://www.verygoodsecurity.com/docs/getting-started/before-you-start). Additionally, for scenarios where neither technology is a complete solution, for instance with legacy systems, VGS provides a compliance product which guarantees customers are able to meet their compliance needs no matter what may happen. [Get started with Control](https://www.verygoodsecurity.com/docs/control). ## Learn about Tokenization - [Create an Account for Free Tokenization](https://dashboard.verygoodsecurity.com/tokenization) - [Try a Tokenization Demo](https://www.verygoodsecurity.com/docs/tokenization/getting-started) - [Install a Tokenization SDK](https://www.verygoodsecurity.com/docs/tokenization/client-libraries) ### Authentication This API uses `Basic` authentication and is implemented using industry best practices to ensure the security of the connection. Read more about [Identity and Access Management at VGS](https://www.verygoodsecurity.com/docs/vault/the-platform/iam) Credentials to access the API can be generated on the [dashboard](https://dashboard.verygoodsecurity.com) by going to the Settings section of the vault of your choosing. [Docs » Guides » Access credentials](https://www.verygoodsecurity.com/docs/settings/access-credentials) ## Resource Limits ### Data Limits This API allows storing data up to 32MB in size. ### Rate Limiting The API allows up to 3,000 requests per minute. Requests are associated with the vault, regardless of the access credentials used to authenticate the request. Your current rate limit is included as HTTP headers in every API response: | Header Name | Description | |-------------------------|----------------------------------------------------------| | `x-ratelimit-remaining` | The number of requests remaining in the 1-minute window. | If you exceed the rate limit, the API will reject the request with HTTP [429 Too Many Requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429). ### Errors The API uses standard HTTP status codes to indicate whether the request succeeded or not. In case of failure, the response body will be JSON in a predefined format. For example, trying to create too many aliases at once results in the following response: ```json { \"errors\": [ { \"status\": 400, \"title\": \"Bad request\", \"detail\": \"Too many values (limit: 20)\", \"href\": \"https://api.sandbox.verygoodvault.com/aliases\" } ] } ```
|
5
|
-
|
6
|
-
The version of the OpenAPI document: 1.0.0
|
7
|
-
Contact: support@verygoodsecurity.com
|
8
|
-
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 5.4.0
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
require 'date'
|
14
|
-
require 'time'
|
15
|
-
|
16
|
-
module VgsApiClient
|
17
|
-
# Format for batch requests (limit 20)
|
18
|
-
class BatchAliasesRequest
|
19
|
-
attr_accessor :data
|
20
|
-
|
21
|
-
attr_accessor :storage
|
22
|
-
|
23
|
-
class EnumAttributeValidator
|
24
|
-
attr_reader :datatype
|
25
|
-
attr_reader :allowable_values
|
26
|
-
|
27
|
-
def initialize(datatype, allowable_values)
|
28
|
-
@allowable_values = allowable_values.map do |value|
|
29
|
-
case datatype.to_s
|
30
|
-
when /Integer/i
|
31
|
-
value.to_i
|
32
|
-
when /Float/i
|
33
|
-
value.to_f
|
34
|
-
else
|
35
|
-
value
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
def valid?(value)
|
41
|
-
!value || allowable_values.include?(value)
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
46
|
-
def self.attribute_map
|
47
|
-
{
|
48
|
-
:'data' => :'data',
|
49
|
-
:'storage' => :'storage'
|
50
|
-
}
|
51
|
-
end
|
52
|
-
|
53
|
-
# Returns all the JSON keys this model knows about
|
54
|
-
def self.acceptable_attributes
|
55
|
-
attribute_map.values
|
56
|
-
end
|
57
|
-
|
58
|
-
# Attribute type mapping.
|
59
|
-
def self.openapi_types
|
60
|
-
{
|
61
|
-
:'data' => :'Array<String>',
|
62
|
-
:'storage' => :'String'
|
63
|
-
}
|
64
|
-
end
|
65
|
-
|
66
|
-
# List of attributes with nullable: true
|
67
|
-
def self.openapi_nullable
|
68
|
-
Set.new([
|
69
|
-
])
|
70
|
-
end
|
71
|
-
|
72
|
-
# Initializes the object
|
73
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
74
|
-
def initialize(attributes = {})
|
75
|
-
if (!attributes.is_a?(Hash))
|
76
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `VgsApiClient::BatchAliasesRequest` initialize method"
|
77
|
-
end
|
78
|
-
|
79
|
-
# check to see if the attribute exists and convert string to symbol for hash key
|
80
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
81
|
-
if (!self.class.attribute_map.key?(k.to_sym))
|
82
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `VgsApiClient::BatchAliasesRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
83
|
-
end
|
84
|
-
h[k.to_sym] = v
|
85
|
-
}
|
86
|
-
|
87
|
-
if attributes.key?(:'data')
|
88
|
-
if (value = attributes[:'data']).is_a?(Array)
|
89
|
-
self.data = value
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
if attributes.key?(:'storage')
|
94
|
-
self.storage = attributes[:'storage']
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
|
-
# Show invalid properties with the reasons. Usually used together with valid?
|
99
|
-
# @return Array for valid properties with the reasons
|
100
|
-
def list_invalid_properties
|
101
|
-
invalid_properties = Array.new
|
102
|
-
invalid_properties
|
103
|
-
end
|
104
|
-
|
105
|
-
# Check to see if the all the properties in the model are valid
|
106
|
-
# @return true if the model is valid
|
107
|
-
def valid?
|
108
|
-
storage_validator = EnumAttributeValidator.new('String', ["PERSISTENT", "VOLATILE"])
|
109
|
-
return false unless storage_validator.valid?(@storage)
|
110
|
-
true
|
111
|
-
end
|
112
|
-
|
113
|
-
# Custom attribute writer method checking allowed values (enum).
|
114
|
-
# @param [Object] storage Object to be assigned
|
115
|
-
def storage=(storage)
|
116
|
-
validator = EnumAttributeValidator.new('String', ["PERSISTENT", "VOLATILE"])
|
117
|
-
unless validator.valid?(storage)
|
118
|
-
fail ArgumentError, "invalid value for \"storage\", must be one of #{validator.allowable_values}."
|
119
|
-
end
|
120
|
-
@storage = storage
|
121
|
-
end
|
122
|
-
|
123
|
-
# Checks equality by comparing each attribute.
|
124
|
-
# @param [Object] Object to be compared
|
125
|
-
def ==(o)
|
126
|
-
return true if self.equal?(o)
|
127
|
-
self.class == o.class &&
|
128
|
-
data == o.data &&
|
129
|
-
storage == o.storage
|
130
|
-
end
|
131
|
-
|
132
|
-
# @see the `==` method
|
133
|
-
# @param [Object] Object to be compared
|
134
|
-
def eql?(o)
|
135
|
-
self == o
|
136
|
-
end
|
137
|
-
|
138
|
-
# Calculates hash code according to all attributes.
|
139
|
-
# @return [Integer] Hash code
|
140
|
-
def hash
|
141
|
-
[data, storage].hash
|
142
|
-
end
|
143
|
-
|
144
|
-
# Builds the object from hash
|
145
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
146
|
-
# @return [Object] Returns the model itself
|
147
|
-
def self.build_from_hash(attributes)
|
148
|
-
new.build_from_hash(attributes)
|
149
|
-
end
|
150
|
-
|
151
|
-
# Builds the object from hash
|
152
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
153
|
-
# @return [Object] Returns the model itself
|
154
|
-
def build_from_hash(attributes)
|
155
|
-
return nil unless attributes.is_a?(Hash)
|
156
|
-
self.class.openapi_types.each_pair do |key, type|
|
157
|
-
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
158
|
-
self.send("#{key}=", nil)
|
159
|
-
elsif type =~ /\AArray<(.*)>/i
|
160
|
-
# check to ensure the input is an array given that the attribute
|
161
|
-
# is documented as an array but the input is not
|
162
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
163
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
164
|
-
end
|
165
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
166
|
-
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
167
|
-
end
|
168
|
-
end
|
169
|
-
|
170
|
-
self
|
171
|
-
end
|
172
|
-
|
173
|
-
# Deserializes the data based on type
|
174
|
-
# @param string type Data type
|
175
|
-
# @param string value Value to be deserialized
|
176
|
-
# @return [Object] Deserialized data
|
177
|
-
def _deserialize(type, value)
|
178
|
-
case type.to_sym
|
179
|
-
when :Time
|
180
|
-
Time.parse(value)
|
181
|
-
when :Date
|
182
|
-
Date.parse(value)
|
183
|
-
when :String
|
184
|
-
value.to_s
|
185
|
-
when :Integer
|
186
|
-
value.to_i
|
187
|
-
when :Float
|
188
|
-
value.to_f
|
189
|
-
when :Boolean
|
190
|
-
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
191
|
-
true
|
192
|
-
else
|
193
|
-
false
|
194
|
-
end
|
195
|
-
when :Object
|
196
|
-
# generic object (usually a Hash), return directly
|
197
|
-
value
|
198
|
-
when /\AArray<(?<inner_type>.+)>\z/
|
199
|
-
inner_type = Regexp.last_match[:inner_type]
|
200
|
-
value.map { |v| _deserialize(inner_type, v) }
|
201
|
-
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
202
|
-
k_type = Regexp.last_match[:k_type]
|
203
|
-
v_type = Regexp.last_match[:v_type]
|
204
|
-
{}.tap do |hash|
|
205
|
-
value.each do |k, v|
|
206
|
-
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
207
|
-
end
|
208
|
-
end
|
209
|
-
else # model
|
210
|
-
# models (e.g. Pet) or oneOf
|
211
|
-
klass = VgsApiClient.const_get(type)
|
212
|
-
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
213
|
-
end
|
214
|
-
end
|
215
|
-
|
216
|
-
# Returns the string representation of the object
|
217
|
-
# @return [String] String presentation of the object
|
218
|
-
def to_s
|
219
|
-
to_hash.to_s
|
220
|
-
end
|
221
|
-
|
222
|
-
# to_body is an alias to to_hash (backward compatibility)
|
223
|
-
# @return [Hash] Returns the object in the form of hash
|
224
|
-
def to_body
|
225
|
-
to_hash
|
226
|
-
end
|
227
|
-
|
228
|
-
# Returns the object in the form of hash
|
229
|
-
# @return [Hash] Returns the object in the form of hash
|
230
|
-
def to_hash
|
231
|
-
hash = {}
|
232
|
-
self.class.attribute_map.each_pair do |attr, param|
|
233
|
-
value = self.send(attr)
|
234
|
-
if value.nil?
|
235
|
-
is_nullable = self.class.openapi_nullable.include?(attr)
|
236
|
-
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
237
|
-
end
|
238
|
-
|
239
|
-
hash[param] = _to_hash(value)
|
240
|
-
end
|
241
|
-
hash
|
242
|
-
end
|
243
|
-
|
244
|
-
# Outputs non-array value in the form of hash
|
245
|
-
# For object, use to_hash. Otherwise, just return the value
|
246
|
-
# @param [Object] value Any valid value
|
247
|
-
# @return [Hash] Returns the value in the form of hash
|
248
|
-
def _to_hash(value)
|
249
|
-
if value.is_a?(Array)
|
250
|
-
value.compact.map { |v| _to_hash(v) }
|
251
|
-
elsif value.is_a?(Hash)
|
252
|
-
{}.tap do |hash|
|
253
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
254
|
-
end
|
255
|
-
elsif value.respond_to? :to_hash
|
256
|
-
value.to_hash
|
257
|
-
else
|
258
|
-
value
|
259
|
-
end
|
260
|
-
end
|
261
|
-
|
262
|
-
end
|
263
|
-
|
264
|
-
end
|