vgs_api_client 0.0.1.dev202204182306

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +7 -0
  2. data/DEVELOPMENT.md +11 -0
  3. data/Gemfile +9 -0
  4. data/Gemfile.lock +70 -0
  5. data/LICENSE +11 -0
  6. data/RELEASE.md +15 -0
  7. data/Rakefile +10 -0
  8. data/docker-compose.yaml +32 -0
  9. data/lib/vgs.rb +82 -0
  10. data/lib/vgs_api_client/api/aliases_api.rb +346 -0
  11. data/lib/vgs_api_client/api_client.rb +390 -0
  12. data/lib/vgs_api_client/api_error.rb +57 -0
  13. data/lib/vgs_api_client/configuration.rb +286 -0
  14. data/lib/vgs_api_client/models/alias_format.rb +44 -0
  15. data/lib/vgs_api_client/models/api_error.rb +249 -0
  16. data/lib/vgs_api_client/models/create_aliases_request.rb +253 -0
  17. data/lib/vgs_api_client/models/create_aliases_request_new.rb +296 -0
  18. data/lib/vgs_api_client/models/create_aliases_request_reference.rb +238 -0
  19. data/lib/vgs_api_client/models/inline_response200.rb +220 -0
  20. data/lib/vgs_api_client/models/inline_response2001.rb +245 -0
  21. data/lib/vgs_api_client/models/inline_response201.rb +221 -0
  22. data/lib/vgs_api_client/models/inline_response_default.rb +236 -0
  23. data/lib/vgs_api_client/models/model_alias.rb +228 -0
  24. data/lib/vgs_api_client/models/revealed_data.rb +299 -0
  25. data/lib/vgs_api_client/models/update_alias_request.rb +223 -0
  26. data/lib/vgs_api_client/models/update_alias_request_data.rb +226 -0
  27. data/lib/vgs_api_client/version.rb +15 -0
  28. data/lib/vgs_api_client.rb +53 -0
  29. data/scripts/assemble/Dockerfile +5 -0
  30. data/scripts/assemble/run.sh +9 -0
  31. data/scripts/publish/Dockerfile +5 -0
  32. data/scripts/publish/run.sh +14 -0
  33. data/scripts/publish.sh +12 -0
  34. data/scripts/run-test-e2e.sh +13 -0
  35. data/scripts/run-test-local.sh +4 -0
  36. data/scripts/test/Dockerfile +10 -0
  37. data/scripts/test/run.sh +30 -0
  38. data/spec/api_client_spec.rb +226 -0
  39. data/spec/configuration_spec.rb +42 -0
  40. data/spec/spec_helper.rb +111 -0
  41. data/spec/test_api_spec.rb +97 -0
  42. data/vgs_api_client-0.0.1.dev202204181658.gem +0 -0
  43. data/vgs_api_client.gemspec +38 -0
  44. metadata +129 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: e20fcf11d76f43536add9dc0f03aa8de69940c5c583b2ab38b2012a95c46f878
4
+ data.tar.gz: 9e5b7290e69a630d091297337189b03c9ce76c655e3d5211b096eb231d342863
5
+ SHA512:
6
+ metadata.gz: 8e7a025a8003879611c5b90179b038770d933c3963aa87e480172fd480be62802d91ed8a79a74d8b8b2529674a42d82286bb0458354b8c937144557e8546bff0
7
+ data.tar.gz: 5b5d08c55d4d1dc5e92980fda86b1d6f1b7fe493f24f564a1abbb4defbfd7b08efd4383cabfa834d9ea87056e04754922652ae6b922fd2451496f0984a0849f2
data/DEVELOPMENT.md ADDED
@@ -0,0 +1,11 @@
1
+ # Development
2
+
3
+ ### Autogenerate code
4
+
5
+ This repository has code that is autogenerated. If you need to change it - change in source repo otherwise it might be overwritten.
6
+
7
+ ### Run tests
8
+
9
+ ```
10
+ ./scripts/run-tests.sh
11
+ ```
data/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ group :development, :test do
6
+ gem 'rake', '~> 13.0.1'
7
+ gem 'pry-byebug'
8
+ gem 'rubocop', '~> 0.66.0'
9
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,70 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ vgs_api_client (0.0.1.dev202204182306)
5
+ typhoeus (~> 1.0, >= 1.0.1)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ ast (2.4.2)
11
+ byebug (11.1.3)
12
+ coderay (1.1.3)
13
+ diff-lcs (1.5.0)
14
+ ethon (0.15.0)
15
+ ffi (>= 1.15.0)
16
+ ffi (1.15.5)
17
+ jaro_winkler (1.5.4)
18
+ method_source (1.0.0)
19
+ parallel (1.22.1)
20
+ parser (3.1.2.0)
21
+ ast (~> 2.4.1)
22
+ pry (0.13.1)
23
+ coderay (~> 1.1)
24
+ method_source (~> 1.0)
25
+ pry-byebug (3.9.0)
26
+ byebug (~> 11.0)
27
+ pry (~> 0.13.0)
28
+ psych (4.0.3)
29
+ stringio
30
+ rainbow (3.1.1)
31
+ rake (13.0.6)
32
+ rspec (3.11.0)
33
+ rspec-core (~> 3.11.0)
34
+ rspec-expectations (~> 3.11.0)
35
+ rspec-mocks (~> 3.11.0)
36
+ rspec-core (3.11.0)
37
+ rspec-support (~> 3.11.0)
38
+ rspec-expectations (3.11.0)
39
+ diff-lcs (>= 1.2.0, < 2.0)
40
+ rspec-support (~> 3.11.0)
41
+ rspec-mocks (3.11.1)
42
+ diff-lcs (>= 1.2.0, < 2.0)
43
+ rspec-support (~> 3.11.0)
44
+ rspec-support (3.11.0)
45
+ rubocop (0.66.0)
46
+ jaro_winkler (~> 1.5.1)
47
+ parallel (~> 1.10)
48
+ parser (>= 2.5, != 2.5.1.1)
49
+ psych (>= 3.1.0)
50
+ rainbow (>= 2.2.2, < 4.0)
51
+ ruby-progressbar (~> 1.7)
52
+ unicode-display_width (>= 1.4.0, < 1.6)
53
+ ruby-progressbar (1.11.0)
54
+ stringio (3.0.1)
55
+ typhoeus (1.4.0)
56
+ ethon (>= 0.9.0)
57
+ unicode-display_width (1.5.0)
58
+
59
+ PLATFORMS
60
+ aarch64-linux-musl
61
+
62
+ DEPENDENCIES
63
+ pry-byebug
64
+ rake (~> 13.0.1)
65
+ rspec (~> 3.6, >= 3.6.0)
66
+ rubocop (~> 0.66.0)
67
+ vgs_api_client!
68
+
69
+ BUNDLED WITH
70
+ 2.3.11
data/LICENSE ADDED
@@ -0,0 +1,11 @@
1
+ Copyright 2022, VERY GOOD SECURITY, Inc.
2
+
3
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4
+
5
+ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6
+
7
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
8
+
9
+ 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
10
+
11
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
data/RELEASE.md ADDED
@@ -0,0 +1,15 @@
1
+ # Release
2
+
3
+ In order to release version of new library you have to create github release.
4
+
5
+ ### Versioning
6
+
7
+ Libraries that have versions that follow SemVer versioning schema will be released.
8
+
9
+ ### Release
10
+
11
+ After creating tag CI will take care of publishing library to artifact repository.
12
+
13
+ ### Misc
14
+
15
+ In order to release new version of this library you have to have write permissions to this repo.
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ require "bundler/gem_tasks"
2
+
3
+ begin
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+ task default: :spec
8
+ rescue LoadError
9
+ # no rspec available
10
+ end
@@ -0,0 +1,32 @@
1
+ version: '3.7'
2
+
3
+ services:
4
+ assemble:
5
+ build:
6
+ context: .
7
+ dockerfile: scripts/assemble/Dockerfile
8
+ environment:
9
+ LIB_VERSION: ${LIB_VERSION}
10
+ volumes:
11
+ - ./:/vgs-api-client/
12
+ publish:
13
+ build:
14
+ context: .
15
+ dockerfile: scripts/publish/Dockerfile
16
+ environment:
17
+ ARTIFACT_REPOSITORY_TOKEN: ${ARTIFACT_REPOSITORY_TOKEN}
18
+ LIB_VERSION: ${LIB_VERSION}
19
+ volumes:
20
+ - ./:/vgs-api-client/
21
+ test:
22
+ build:
23
+ context: .
24
+ dockerfile: scripts/test/Dockerfile
25
+ environment:
26
+ VAULT_API_USERNAME: US7oyrzRGmaKqi3ET8eSsECS
27
+ VAULT_API_PASSWORD: c06cf6d1-a35e-439d-91d1-8bd04e5fd9e5
28
+ VAULT_API_BASE_URI: https://api.sandbox.verygoodvault.com
29
+ VAULT_API_VAULT_ID: tntkxfmsefj
30
+ TEST_AGAINST_PUBLISHED_LIB_VERSION: ${TEST_AGAINST_PUBLISHED_LIB_VERSION}
31
+ volumes:
32
+ - ./:/vgs-api-client/
data/lib/vgs.rb ADDED
@@ -0,0 +1,82 @@
1
+ module VGS
2
+ class VgsApiException < StandardError
3
+ end
4
+
5
+ class Aliases
6
+ def initialize(config)
7
+ @aliases_api = VgsApiClient::AliasesApi.new(VgsApiClient::ApiClient.new(config))
8
+ end
9
+
10
+ def redact(data)
11
+ begin
12
+ requests = data.map do |item|
13
+ VgsApiClient::CreateAliasesRequestNew.new(attributes = {
14
+ :format => VgsApiClient::AliasFormat.build_from_hash(item[:format]),
15
+ :classifiers => item[:classifiers],
16
+ :value => item[:value],
17
+ :storage => item[:storage]
18
+ })
19
+ end
20
+
21
+ create_aliases_request = VgsApiClient::CreateAliasesRequest.new(attributes = {
22
+ :data => requests
23
+ })
24
+ response = @aliases_api.create_aliases(opts = {
25
+ :create_aliases_request => create_aliases_request.to_hash
26
+ })
27
+
28
+ rescue
29
+ raise VgsApiException, "Failed to redact data #{ data }"
30
+ else
31
+ response.data
32
+ end
33
+
34
+ end
35
+
36
+ def reveal(aliases)
37
+ begin
38
+ query = aliases.kind_of?(Array) ? aliases.join(",") : aliases
39
+ response = @aliases_api.reveal_multiple_aliases(q = query)
40
+ rescue
41
+ raise VgsApiException, "Failed to reveal aliases #{ aliases }"
42
+ else
43
+ response.data
44
+ end
45
+ end
46
+
47
+ def delete(_alias)
48
+ begin
49
+ @aliases_api.delete_alias(_alias = _alias)
50
+ rescue
51
+ raise VgsApiException, "Failed to delete alias #{ _alias }"
52
+ end
53
+ end
54
+
55
+ def update(_alias, data)
56
+ begin
57
+ update_alias_request = VgsApiClient::UpdateAliasRequest.new(attributes = {
58
+ :data => VgsApiClient::UpdateAliasRequestData.new(attributes = {
59
+ :classifiers => data[:classifiers]
60
+ })
61
+ })
62
+ @aliases_api.update_alias(_alias = _alias, opts = {
63
+ :update_alias_request => update_alias_request.to_hash
64
+ })
65
+ rescue
66
+ raise VgsApiException, "Failed to update alias #{ _alias }"
67
+ end
68
+ end
69
+ end
70
+
71
+ def self.config(username, password, host = 'https://api.sandbox.verygoodvault.com')
72
+ raise ArgumentError, 'username is nil' if username.nil?
73
+ raise ArgumentError, 'password is nil' if password.nil?
74
+
75
+ config = VgsApiClient::Configuration.default
76
+ config.username = username
77
+ config.password = password
78
+ config.host = host
79
+ config
80
+ end
81
+
82
+ end
@@ -0,0 +1,346 @@
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. 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 AliasesApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create aliases
23
+ # Stores multiple values at once & returns their aliases. Alternatively, this endpoint may be used to associate additional (i.e. secondary) aliases with the same underlying data as the reference alias specified in the request body. **NOTE:** You cannot reference the same alias more than once in a single request.
24
+ # @param [Hash] opts the optional parameters
25
+ # @option opts [CreateAliasesRequest] :create_aliases_request
26
+ # @return [InlineResponse201]
27
+ def create_aliases(opts = {})
28
+ data, _status_code, _headers = create_aliases_with_http_info(opts)
29
+ data
30
+ end
31
+
32
+ # Create aliases
33
+ # Stores multiple values at once &amp; returns their aliases. Alternatively, this endpoint may be used to associate additional (i.e. secondary) aliases with the same underlying data as the reference alias specified in the request body. **NOTE:** You cannot reference the same alias more than once in a single request.
34
+ # @param [Hash] opts the optional parameters
35
+ # @option opts [CreateAliasesRequest] :create_aliases_request
36
+ # @return [Array<(InlineResponse201, Integer, Hash)>] InlineResponse201 data, response status code and response headers
37
+ def create_aliases_with_http_info(opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: AliasesApi.create_aliases ...'
40
+ end
41
+ # resource path
42
+ local_var_path = '/aliases'
43
+
44
+ # query parameters
45
+ query_params = opts[:query_params] || {}
46
+
47
+ # header parameters
48
+ header_params = opts[:header_params] || {}
49
+ # HTTP header 'Accept' (if needed)
50
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
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(opts[:'create_aliases_request'])
62
+
63
+ # return_type
64
+ return_type = opts[:debug_return_type] || 'InlineResponse201'
65
+
66
+ # auth_names
67
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
68
+
69
+ new_options = opts.merge(
70
+ :operation => :"AliasesApi.create_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: AliasesApi#create_aliases\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
82
+ end
83
+ return data, status_code, headers
84
+ end
85
+
86
+ # Delete alias
87
+ # Removes a single alias.
88
+ # @param _alias [String] Alias to operate on.
89
+ # @param [Hash] opts the optional parameters
90
+ # @return [nil]
91
+ def delete_alias(_alias, opts = {})
92
+ delete_alias_with_http_info(_alias, opts)
93
+ nil
94
+ end
95
+
96
+ # Delete alias
97
+ # Removes a single alias.
98
+ # @param _alias [String] Alias to operate on.
99
+ # @param [Hash] opts the optional parameters
100
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
101
+ def delete_alias_with_http_info(_alias, opts = {})
102
+ if @api_client.config.debugging
103
+ @api_client.config.logger.debug 'Calling API: AliasesApi.delete_alias ...'
104
+ end
105
+ # verify the required parameter '_alias' is set
106
+ if @api_client.config.client_side_validation && _alias.nil?
107
+ fail ArgumentError, "Missing the required parameter '_alias' when calling AliasesApi.delete_alias"
108
+ end
109
+ # resource path
110
+ local_var_path = '/aliases/{alias}'.sub('{' + 'alias' + '}', CGI.escape(_alias.to_s))
111
+
112
+ # query parameters
113
+ query_params = opts[:query_params] || {}
114
+
115
+ # header parameters
116
+ header_params = opts[:header_params] || {}
117
+ # HTTP header 'Accept' (if needed)
118
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
119
+
120
+ # form parameters
121
+ form_params = opts[:form_params] || {}
122
+
123
+ # http body (model)
124
+ post_body = opts[:debug_body]
125
+
126
+ # return_type
127
+ return_type = opts[:debug_return_type]
128
+
129
+ # auth_names
130
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
131
+
132
+ new_options = opts.merge(
133
+ :operation => :"AliasesApi.delete_alias",
134
+ :header_params => header_params,
135
+ :query_params => query_params,
136
+ :form_params => form_params,
137
+ :body => post_body,
138
+ :auth_names => auth_names,
139
+ :return_type => return_type
140
+ )
141
+
142
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
143
+ if @api_client.config.debugging
144
+ @api_client.config.logger.debug "API called: AliasesApi#delete_alias\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
145
+ end
146
+ return data, status_code, headers
147
+ end
148
+
149
+ # Reveal single alias
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).
151
+ # @param _alias [String] Alias to operate on.
152
+ # @param [Hash] opts the optional parameters
153
+ # @return [InlineResponse2001]
154
+ def reveal_alias(_alias, opts = {})
155
+ data, _status_code, _headers = reveal_alias_with_http_info(_alias, opts)
156
+ data
157
+ end
158
+
159
+ # Reveal single alias
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).
161
+ # @param _alias [String] Alias to operate on.
162
+ # @param [Hash] opts the optional parameters
163
+ # @return [Array<(InlineResponse2001, Integer, Hash)>] InlineResponse2001 data, response status code and response headers
164
+ def reveal_alias_with_http_info(_alias, opts = {})
165
+ if @api_client.config.debugging
166
+ @api_client.config.logger.debug 'Calling API: AliasesApi.reveal_alias ...'
167
+ end
168
+ # verify the required parameter '_alias' is set
169
+ if @api_client.config.client_side_validation && _alias.nil?
170
+ fail ArgumentError, "Missing the required parameter '_alias' when calling AliasesApi.reveal_alias"
171
+ end
172
+ # resource path
173
+ local_var_path = '/aliases/{alias}'.sub('{' + 'alias' + '}', CGI.escape(_alias.to_s))
174
+
175
+ # query parameters
176
+ query_params = opts[:query_params] || {}
177
+
178
+ # header parameters
179
+ header_params = opts[:header_params] || {}
180
+ # HTTP header 'Accept' (if needed)
181
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
182
+
183
+ # form parameters
184
+ form_params = opts[:form_params] || {}
185
+
186
+ # http body (model)
187
+ post_body = opts[:debug_body]
188
+
189
+ # return_type
190
+ return_type = opts[:debug_return_type] || 'InlineResponse2001'
191
+
192
+ # auth_names
193
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
194
+
195
+ new_options = opts.merge(
196
+ :operation => :"AliasesApi.reveal_alias",
197
+ :header_params => header_params,
198
+ :query_params => query_params,
199
+ :form_params => form_params,
200
+ :body => post_body,
201
+ :auth_names => auth_names,
202
+ :return_type => return_type
203
+ )
204
+
205
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
206
+ if @api_client.config.debugging
207
+ @api_client.config.logger.debug "API called: AliasesApi#reveal_alias\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
208
+ end
209
+ return data, status_code, headers
210
+ end
211
+
212
+ # Reveal multiple aliases
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).
214
+ # @param q [String] Comma-separated list of aliases to reveal.
215
+ # @param [Hash] opts the optional parameters
216
+ # @return [InlineResponse200]
217
+ def reveal_multiple_aliases(q, opts = {})
218
+ data, _status_code, _headers = reveal_multiple_aliases_with_http_info(q, opts)
219
+ data
220
+ end
221
+
222
+ # Reveal multiple aliases
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).
224
+ # @param q [String] Comma-separated list of aliases to reveal.
225
+ # @param [Hash] opts the optional parameters
226
+ # @return [Array<(InlineResponse200, Integer, Hash)>] InlineResponse200 data, response status code and response headers
227
+ def reveal_multiple_aliases_with_http_info(q, opts = {})
228
+ if @api_client.config.debugging
229
+ @api_client.config.logger.debug 'Calling API: AliasesApi.reveal_multiple_aliases ...'
230
+ end
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"
234
+ end
235
+ # resource path
236
+ local_var_path = '/aliases'
237
+
238
+ # query parameters
239
+ query_params = opts[:query_params] || {}
240
+ query_params[:'q'] = q
241
+
242
+ # header parameters
243
+ header_params = opts[:header_params] || {}
244
+ # HTTP header 'Accept' (if needed)
245
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
246
+
247
+ # form parameters
248
+ form_params = opts[:form_params] || {}
249
+
250
+ # http body (model)
251
+ post_body = opts[:debug_body]
252
+
253
+ # return_type
254
+ return_type = opts[:debug_return_type] || 'InlineResponse200'
255
+
256
+ # auth_names
257
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
258
+
259
+ new_options = opts.merge(
260
+ :operation => :"AliasesApi.reveal_multiple_aliases",
261
+ :header_params => header_params,
262
+ :query_params => query_params,
263
+ :form_params => form_params,
264
+ :body => post_body,
265
+ :auth_names => auth_names,
266
+ :return_type => return_type
267
+ )
268
+
269
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
270
+ if @api_client.config.debugging
271
+ @api_client.config.logger.debug "API called: AliasesApi#reveal_multiple_aliases\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
272
+ end
273
+ return data, status_code, headers
274
+ end
275
+
276
+ # Update data classifiers
277
+ # Apply new classifiers to the value that the specified alias is associated with.
278
+ # @param _alias [String] Alias to operate on.
279
+ # @param [Hash] opts the optional parameters
280
+ # @option opts [UpdateAliasRequest] :update_alias_request
281
+ # @return [nil]
282
+ def update_alias(_alias, opts = {})
283
+ update_alias_with_http_info(_alias, opts)
284
+ nil
285
+ end
286
+
287
+ # Update data classifiers
288
+ # Apply new classifiers to the value that the specified alias is associated with.
289
+ # @param _alias [String] Alias to operate on.
290
+ # @param [Hash] opts the optional parameters
291
+ # @option opts [UpdateAliasRequest] :update_alias_request
292
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
293
+ def update_alias_with_http_info(_alias, opts = {})
294
+ if @api_client.config.debugging
295
+ @api_client.config.logger.debug 'Calling API: AliasesApi.update_alias ...'
296
+ end
297
+ # verify the required parameter '_alias' is set
298
+ if @api_client.config.client_side_validation && _alias.nil?
299
+ fail ArgumentError, "Missing the required parameter '_alias' when calling AliasesApi.update_alias"
300
+ end
301
+ # resource path
302
+ local_var_path = '/aliases/{alias}'.sub('{' + 'alias' + '}', CGI.escape(_alias.to_s))
303
+
304
+ # query parameters
305
+ query_params = opts[:query_params] || {}
306
+
307
+ # header parameters
308
+ header_params = opts[:header_params] || {}
309
+ # HTTP header 'Accept' (if needed)
310
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
311
+ # HTTP header 'Content-Type'
312
+ content_type = @api_client.select_header_content_type(['application/json'])
313
+ if !content_type.nil?
314
+ header_params['Content-Type'] = content_type
315
+ end
316
+
317
+ # form parameters
318
+ form_params = opts[:form_params] || {}
319
+
320
+ # http body (model)
321
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'update_alias_request'])
322
+
323
+ # return_type
324
+ return_type = opts[:debug_return_type]
325
+
326
+ # auth_names
327
+ auth_names = opts[:debug_auth_names] || ['basicAuth']
328
+
329
+ new_options = opts.merge(
330
+ :operation => :"AliasesApi.update_alias",
331
+ :header_params => header_params,
332
+ :query_params => query_params,
333
+ :form_params => form_params,
334
+ :body => post_body,
335
+ :auth_names => auth_names,
336
+ :return_type => return_type
337
+ )
338
+
339
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
340
+ if @api_client.config.debugging
341
+ @api_client.config.logger.debug "API called: AliasesApi#update_alias\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
342
+ end
343
+ return data, status_code, headers
344
+ end
345
+ end
346
+ end