vgs_api_client 0.0.21 → 0.0.26

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +27 -27
  3. data/docker-compose.yaml +3 -6
  4. data/docs/AliasFormat.md +2 -2
  5. data/docs/AliasesApi.md +23 -23
  6. data/docs/ApiError.md +2 -2
  7. data/docs/CreateAliasesRequest.md +2 -2
  8. data/docs/CreateAliasesRequestExisting.md +2 -2
  9. data/docs/CreateAliasesRequestNew.md +2 -2
  10. data/docs/InlineResponse200.md +2 -2
  11. data/docs/InlineResponse2001.md +2 -2
  12. data/docs/InlineResponse201.md +2 -2
  13. data/docs/InlineResponseDefault.md +2 -2
  14. data/docs/ModelAlias.md +2 -2
  15. data/docs/RevealedData.md +2 -2
  16. data/docs/UpdateAliasRequest.md +2 -2
  17. data/docs/UpdateAliasRequestData.md +2 -2
  18. data/git_push.sh +4 -3
  19. data/lib/vgs_api_client/api/aliases_api.rb +4 -10
  20. data/lib/vgs_api_client/api_client.rb +7 -7
  21. data/lib/vgs_api_client/api_error.rb +2 -2
  22. data/lib/vgs_api_client/configuration.rb +3 -4
  23. data/lib/vgs_api_client/models/alias_format.rb +2 -2
  24. data/lib/vgs_api_client/models/api_error.rb +5 -5
  25. data/lib/vgs_api_client/models/create_aliases_request.rb +5 -33
  26. data/lib/vgs_api_client/models/create_aliases_request_existing.rb +5 -5
  27. data/lib/vgs_api_client/models/create_aliases_request_new.rb +5 -5
  28. data/lib/vgs_api_client/models/inline_response200.rb +5 -5
  29. data/lib/vgs_api_client/models/inline_response2001.rb +5 -29
  30. data/lib/vgs_api_client/models/inline_response201.rb +5 -5
  31. data/lib/vgs_api_client/models/inline_response_default.rb +5 -20
  32. data/lib/vgs_api_client/models/model_alias.rb +5 -5
  33. data/lib/vgs_api_client/models/revealed_data.rb +5 -5
  34. data/lib/vgs_api_client/models/update_alias_request.rb +5 -5
  35. data/lib/vgs_api_client/models/update_alias_request_data.rb +5 -5
  36. data/lib/vgs_api_client/version.rb +3 -3
  37. data/lib/vgs_api_client.rb +3 -3
  38. data/{docker → publish}/Dockerfile +1 -1
  39. data/{docker → publish}/build_and_publish.sh +3 -1
  40. data/spec/api/aliases_api_spec.rb +11 -52
  41. data/spec/api/test_api_spec.rb +137 -0
  42. data/spec/api_client_spec.rb +32 -32
  43. data/spec/configuration_spec.rb +4 -4
  44. data/spec/models/alias_format_spec.rb +4 -4
  45. data/spec/models/api_error_spec.rb +4 -4
  46. data/spec/models/create_aliases_request_existing_spec.rb +4 -4
  47. data/spec/models/create_aliases_request_new_spec.rb +4 -4
  48. data/spec/models/create_aliases_request_spec.rb +4 -4
  49. data/spec/models/inline_response2001_spec.rb +4 -4
  50. data/spec/models/inline_response200_spec.rb +4 -4
  51. data/spec/models/inline_response201_spec.rb +4 -4
  52. data/spec/models/inline_response_default_spec.rb +4 -4
  53. data/spec/models/model_alias_spec.rb +4 -4
  54. data/spec/models/revealed_data_spec.rb +4 -4
  55. data/spec/models/update_alias_request_data_spec.rb +4 -4
  56. data/spec/models/update_alias_request_spec.rb +4 -4
  57. data/spec/spec_helper.rb +1 -1
  58. data/test/Dockerfile +16 -0
  59. data/vgs_api_client.gemspec +2 -2
  60. metadata +7 -6
  61. data/Gemfile.lock +0 -70
  62. data/docker/Dockerfile.test +0 -5
@@ -6,14 +6,14 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: support@verygoodsecurity.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.0.0-SNAPSHOT
9
+ OpenAPI Generator version: 5.0.1-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
13
13
  require 'date'
14
14
  require 'time'
15
15
 
16
- module VgsapiClient
16
+ module VgsApiClient
17
17
  class UpdateAliasRequestData
18
18
  # List of tags to classify the value with.
19
19
  attr_accessor :classifiers
@@ -47,13 +47,13 @@ module VgsapiClient
47
47
  # @param [Hash] attributes Model attributes in the form of hash
48
48
  def initialize(attributes = {})
49
49
  if (!attributes.is_a?(Hash))
50
- fail ArgumentError, "The input argument (attributes) must be a hash in `VgsapiClient::UpdateAliasRequestData` initialize method"
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `VgsApiClient::UpdateAliasRequestData` initialize method"
51
51
  end
52
52
 
53
53
  # check to see if the attribute exists and convert string to symbol for hash key
54
54
  attributes = attributes.each_with_object({}) { |(k, v), h|
55
55
  if (!self.class.attribute_map.key?(k.to_sym))
56
- fail ArgumentError, "`#{k}` is not a valid attribute in `VgsapiClient::UpdateAliasRequestData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `VgsApiClient::UpdateAliasRequestData`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
57
  end
58
58
  h[k.to_sym] = v
59
59
  }
@@ -170,7 +170,7 @@ module VgsapiClient
170
170
  end
171
171
  else # model
172
172
  # models (e.g. Pet) or oneOf
173
- klass = VgsapiClient.const_get(type)
173
+ klass = VgsApiClient.const_get(type)
174
174
  klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
175
175
  end
176
176
  end
@@ -6,10 +6,10 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: support@verygoodsecurity.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.0.0-SNAPSHOT
9
+ OpenAPI Generator version: 5.0.1-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
13
- module VgsapiClient
14
- VERSION = '0.0.21'
13
+ module VgsApiClient
14
+ VERSION = '0.0.26'
15
15
  end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: support@verygoodsecurity.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.0.0-SNAPSHOT
9
+ OpenAPI Generator version: 5.0.1-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
@@ -34,10 +34,10 @@ require 'vgs_api_client/models/update_alias_request_data'
34
34
  # APIs
35
35
  require 'vgs_api_client/api/aliases_api'
36
36
 
37
- module VgsapiClient
37
+ module VgsApiClient
38
38
  class << self
39
39
  # Customize default settings for the SDK using block.
40
- # VgsapiClient.configure do |config|
40
+ # VgsApiClient.configure do |config|
41
41
  # config.username = "xxx"
42
42
  # config.password = "xxx"
43
43
  # end
@@ -8,4 +8,4 @@ ENV LIB_VERSION=$LIB_VERSION
8
8
 
9
9
  WORKDIR /src
10
10
 
11
- ENTRYPOINT ["sh", "docker/build_and_publish.sh"]
11
+ ENTRYPOINT ["sh", "publish/build_and_publish.sh"]
@@ -1,5 +1,7 @@
1
1
  #!/bin/sh
2
2
 
3
+ grep -rl 0.0.26 . | xargs sed -i "s/0.0.26/${LIB_VERSION}/g"
4
+
3
5
  # Build
4
6
  gem build vgs_api_client.gemspec
5
7
 
@@ -8,4 +10,4 @@ mkdir ~/.gem
8
10
  echo ":rubygems_api_key: ${GEM_VGS_PUBLISH_TOKEN}" > ~/.gem/credentials
9
11
  chmod 0600 ~/.gem/credentials
10
12
 
11
- gem push vgs_api_client-${LIB_VERSION}.gem
13
+ gem push vgs_api_client-${LIB_VERSION}.gem
@@ -13,28 +13,13 @@ OpenAPI Generator version: 5.0.1-SNAPSHOT
13
13
  require 'spec_helper'
14
14
  require 'json'
15
15
 
16
- # Unit tests for VgsapiClient::AliasesApi
16
+ # Unit tests for VgsApiClient::AliasesApi
17
17
  # Automatically generated by openapi-generator (https://openapi-generator.tech)
18
18
  # Please update as you see appropriate
19
19
  describe 'AliasesApi' do
20
- before(:all) do
21
- # run before all tests
22
- VgsapiClient.configure do |config|
23
- config.username = "US8X3DSEC1MyCACn6RpJL8LT"
24
- config.password = "02ceadd3-273a-4e98-9005-5daa28a0f6d2"
25
- end
26
- @api_instance = VgsapiClient::AliasesApi.new
27
- @create_aliases_request = VgsapiClient::CreateAliasesRequest.new
28
- @create_aliases_request_new = VgsapiClient::CreateAliasesRequestNew.new
29
- @create_aliases_request_new.format = VgsapiClient::AliasFormat.build_from_hash("UUID")
30
- @create_aliases_request_new.classifiers = ["bank-account"]
31
- @create_aliases_request_new.value = "122105155"
32
- @create_aliases_request_new2 = VgsapiClient::CreateAliasesRequestNew.new
33
- @create_aliases_request_new2.format = VgsapiClient::AliasFormat.build_from_hash("UUID")
34
- @create_aliases_request_new2.classifiers = ["bank-account"]
35
- @create_aliases_request_new2.value = "122105156"
36
- @create_aliases_request.data = [@create_aliases_request_new, @create_aliases_request_new2]
37
- @aliases = Array.new
20
+ before do
21
+ # run before each test
22
+ @api_instance = VgsApiClient::AliasesApi.new
38
23
  end
39
24
 
40
25
  after do
@@ -43,7 +28,7 @@ describe 'AliasesApi' do
43
28
 
44
29
  describe 'test an instance of AliasesApi' do
45
30
  it 'should create an instance of AliasesApi' do
46
- expect(@api_instance).to be_instance_of(VgsapiClient::AliasesApi)
31
+ expect(@api_instance).to be_instance_of(VgsApiClient::AliasesApi)
47
32
  end
48
33
  end
49
34
 
@@ -54,17 +39,8 @@ describe 'AliasesApi' do
54
39
  # @option opts [CreateAliasesRequest] :create_aliases_request
55
40
  # @return [InlineResponse201]
56
41
  describe 'create_aliases test' do
57
- it 'should return aliases' do
42
+ it 'should work' do
58
43
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
59
- opts = {}
60
- opts[:create_aliases_request] = @create_aliases_request.to_hash
61
- api_response = @api_instance.create_aliases(opts)
62
- api_response.data.each do |el|
63
- el.aliases.each do |cur_alias|
64
- expect(cur_alias._alias).to match('tok_sandbox_.+')
65
- @aliases.push(cur_alias._alias)
66
- end
67
- end
68
44
  end
69
45
  end
70
46
 
@@ -87,26 +63,20 @@ describe 'AliasesApi' do
87
63
  # @param [Hash] opts the optional parameters
88
64
  # @return [InlineResponse2001]
89
65
  describe 'reveal_alias test' do
90
- it 'should return the original value' do
66
+ it 'should work' do
91
67
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
92
- api_response = @api_instance.reveal_alias(@aliases.first, {})
93
- expect(api_response.data[0].value).to eq "122105155"
94
68
  end
95
69
  end
96
70
 
97
71
  # unit tests for reveal_multiple_aliases
98
72
  # Reveal multiple aliases
99
- # 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).
100
- # @param q Comma-separated list of aliases to reveal.
73
+ # Given a comma separated aliases string, 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).
74
+ # @param q Comma-separated aliases string
101
75
  # @param [Hash] opts the optional parameters
102
76
  # @return [InlineResponse200]
103
- # need to fix line258 as query_params[:'q'] = q.join(',')
104
77
  describe 'reveal_multiple_aliases test' do
105
- it 'should return original values' do
78
+ it 'should work' do
106
79
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
107
- api_response = @api_instance.reveal_multiple_aliases(@aliases.join(','))
108
- expect(api_response.data[@aliases[0]].value).to eq "122105155"
109
- expect(api_response.data[@aliases[1]].value).to eq "122105156"
110
80
  end
111
81
  end
112
82
 
@@ -116,21 +86,10 @@ describe 'AliasesApi' do
116
86
  # @param _alias Alias to operate on.
117
87
  # @param [Hash] opts the optional parameters
118
88
  # @option opts [UpdateAliasRequest] :update_alias_request
119
- # @return _status_code
120
- # need to fix update_alias to return status code
89
+ # @return [nil]
121
90
  describe 'update_alias test' do
122
91
  it 'should work' do
123
92
  # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
124
- update_alias_request = VgsapiClient::UpdateAliasRequest.new
125
- update_alias_request_data = VgsapiClient::UpdateAliasRequestData.new
126
- update_alias_request_data.classifiers = ["bank-account", "test-tag"]
127
- update_alias_request.data = update_alias_request_data
128
-
129
- opts = {}
130
- opts[:update_alias_request] = update_alias_request.to_hash
131
- api_response = @api_instance.update_alias(@aliases.first, opts)
132
- # puts api_response
133
- expect(api_response).to be nil
134
93
  end
135
94
  end
136
95
 
@@ -0,0 +1,137 @@
1
+ =begin
2
+ #Vault HTTP API
3
+
4
+ #Storing, retrieving, and managing sensitive data within a VGS organization. **NOTE:** _The Vault API is intended only for environments that are already PCI-compliant. If you want to use this API, but are not yet PCI-compliant, you can use [VGS Collect](https://www.verygoodsecurity.com/docs/vgs-collect/what-is-it) or VGS Proxy with [Inbound Routes](https://www.verygoodsecurity.com/docs/getting-started/quick-integration#securing-inbound-connection) to quickly and seamlessly achieve compliance._ Looking for the old version of the API? Find it [here](https://www.verygoodsecurity.com/docs/api/1/vault). # Introduction Each encrypted value stored in a VGS vault has one or multiple _aliases_ associated with it. These aliases are fully opaque and retain no information about the underlying data. The user may safely store aliases without compromising data security. **NOTE:** The API works with persistent storage only. Unlike volatile storage, this means that the data is stored permanently, without any implicit TTL. Aliases are not valuable on their own. However, they can be used to decrypt the associated value and pass it to another service via the [forward proxy](https://www.verygoodsecurity.com/docs/guides/outbound-connection). ## Alias Formats Each alias corresponds to a certain format. There are several alias formats suitable for different kinds of sensitive data. For example, `UUID` produces a random Base58-encoded UUID string with an environment-dependent prefix: ``` tok_sandbox_bhtsCwFUzoJMw9rWUfEV5e ``` This format is generic and suitable for any kind of data. The tables below contain descriptions of all alias formats recognized by the API. ### Generic Formats | Value | Description | |-------------------------|-------------------------------------------------------| | `NUM_LENGTH_PRESERVING` | Length-Preserving, Numeric | | `RAW_UUID` | UUID | | `UUID` | UUID (Prefixed, Base58-Encoded) | | `GENERIC_T_FOUR` | UUID (Prefixed, Base58-Encoded, Last four preserving) | ### Account Number Formats | Value | Description | |-----------------------------------|--------------------------------------| | `FPE_ACC_NUM_T_FOUR` | Length-Preserving, Numeric (A4) | | `FPE_ALPHANUMERIC_ACC_NUM_T_FOUR` | Length-Preserving, Alphanumeric (A4) | ### Payment Card Formats | Value | Description | |------------------|---------------------------------------------| | `FPE_SIX_T_FOUR` | Format-Preserving, Luhn Valid (6T4) | | `FPE_T_FOUR` | Format-Preserving, Luhn Valid (T4) | | `PFPT` | Prefixed, Luhn Valid, 19-Digit Fixed Length | ### SSN Formats | Value | Description | |------------------|------------------------| | `FPE_SSN_T_FOUR` | Format-Preserving (A4) | # 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) # 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.0.1-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'spec_helper'
14
+ require 'json'
15
+
16
+ # Unit tests for VgsapiClient::AliasesApi
17
+ # Automatically generated by openapi-generator (https://openapi-generator.tech)
18
+ # Please update as you see appropriate
19
+ describe 'AliasesApi' do
20
+ before(:all) do
21
+ # run before all tests
22
+ VgsapiClient.configure do |config|
23
+ config.username = "US8X3DSEC1MyCACn6RpJL8LT"
24
+ config.password = "02ceadd3-273a-4e98-9005-5daa28a0f6d2"
25
+ end
26
+ @api_instance = VgsapiClient::AliasesApi.new
27
+ @create_aliases_request = VgsapiClient::CreateAliasesRequest.new
28
+ @create_aliases_request_new = VgsapiClient::CreateAliasesRequestNew.new
29
+ @create_aliases_request_new.format = VgsapiClient::AliasFormat.build_from_hash("UUID")
30
+ @create_aliases_request_new.classifiers = ["bank-account"]
31
+ @create_aliases_request_new.value = "122105155"
32
+ @create_aliases_request_new2 = VgsapiClient::CreateAliasesRequestNew.new
33
+ @create_aliases_request_new2.format = VgsapiClient::AliasFormat.build_from_hash("UUID")
34
+ @create_aliases_request_new2.classifiers = ["bank-account"]
35
+ @create_aliases_request_new2.value = "122105156"
36
+ @create_aliases_request.data = [@create_aliases_request_new, @create_aliases_request_new2]
37
+ @aliases = Array.new
38
+ end
39
+
40
+ after do
41
+ # run after each test
42
+ end
43
+
44
+ describe 'test an instance of AliasesApi' do
45
+ it 'should create an instance of AliasesApi' do
46
+ expect(@api_instance).to be_instance_of(VgsapiClient::AliasesApi)
47
+ end
48
+ end
49
+
50
+ # unit tests for create_aliases
51
+ # Create aliases
52
+ # 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.
53
+ # @param [Hash] opts the optional parameters
54
+ # @option opts [CreateAliasesRequest] :create_aliases_request
55
+ # @return [InlineResponse201]
56
+ describe 'create_aliases test' do
57
+ it 'should return aliases' do
58
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
59
+ opts = {}
60
+ opts[:create_aliases_request] = @create_aliases_request.to_hash
61
+ api_response = @api_instance.create_aliases(opts)
62
+ api_response.data.each do |el|
63
+ el.aliases.each do |cur_alias|
64
+ expect(cur_alias._alias).to match('tok_sandbox_.+')
65
+ @aliases.push(cur_alias._alias)
66
+ end
67
+ end
68
+ end
69
+ end
70
+
71
+ # unit tests for delete_alias
72
+ # Delete alias
73
+ # Removes a single alias.
74
+ # @param _alias Alias to operate on.
75
+ # @param [Hash] opts the optional parameters
76
+ # @return [nil]
77
+ describe 'delete_alias test' do
78
+ it 'should work' do
79
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
80
+ end
81
+ end
82
+
83
+ # unit tests for reveal_alias
84
+ # Reveal single alias
85
+ # 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).
86
+ # @param _alias Alias to operate on.
87
+ # @param [Hash] opts the optional parameters
88
+ # @return [InlineResponse2001]
89
+ describe 'reveal_alias test' do
90
+ it 'should return the original value' do
91
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
92
+ api_response = @api_instance.reveal_alias(@aliases.first, {})
93
+ expect(api_response.data[0].value).to eq "122105155"
94
+ end
95
+ end
96
+
97
+ # unit tests for reveal_multiple_aliases
98
+ # Reveal multiple aliases
99
+ # 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).
100
+ # @param q Comma-separated list of aliases to reveal.
101
+ # @param [Hash] opts the optional parameters
102
+ # @return [InlineResponse200]
103
+ # need to fix line258 as query_params[:'q'] = q.join(',')
104
+ describe 'reveal_multiple_aliases test' do
105
+ it 'should return original values' do
106
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
107
+ api_response = @api_instance.reveal_multiple_aliases(@aliases.join(','))
108
+ expect(api_response.data[@aliases[0]].value).to eq "122105155"
109
+ expect(api_response.data[@aliases[1]].value).to eq "122105156"
110
+ end
111
+ end
112
+
113
+ # unit tests for update_alias
114
+ # Update data classifiers
115
+ # Apply new classifiers to the value that the specified alias is associated with.
116
+ # @param _alias Alias to operate on.
117
+ # @param [Hash] opts the optional parameters
118
+ # @option opts [UpdateAliasRequest] :update_alias_request
119
+ # @return _status_code
120
+ # need to fix update_alias to return status code
121
+ describe 'update_alias test' do
122
+ it 'should work' do
123
+ # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
124
+ update_alias_request = VgsapiClient::UpdateAliasRequest.new
125
+ update_alias_request_data = VgsapiClient::UpdateAliasRequestData.new
126
+ update_alias_request_data.classifiers = ["bank-account", "test-tag"]
127
+ update_alias_request.data = update_alias_request_data
128
+
129
+ opts = {}
130
+ opts[:update_alias_request] = update_alias_request.to_hash
131
+ api_response = @api_instance.update_alias(@aliases.first, opts)
132
+ # puts api_response
133
+ expect(api_response).to be nil
134
+ end
135
+ end
136
+
137
+ end
@@ -6,57 +6,57 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: support@verygoodsecurity.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.0.0-SNAPSHOT
9
+ OpenAPI Generator version: 5.0.1-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
13
13
  require 'spec_helper'
14
14
 
15
- describe VgsapiClient::ApiClient do
15
+ describe VgsApiClient::ApiClient do
16
16
  context 'initialization' do
17
17
  context 'URL stuff' do
18
18
  context 'host' do
19
19
  it 'removes http from host' do
20
- VgsapiClient.configure { |c| c.host = 'http://example.com' }
21
- expect(VgsapiClient::Configuration.default.host).to eq('example.com')
20
+ VgsApiClient.configure { |c| c.host = 'http://example.com' }
21
+ expect(VgsApiClient::Configuration.default.host).to eq('example.com')
22
22
  end
23
23
 
24
24
  it 'removes https from host' do
25
- VgsapiClient.configure { |c| c.host = 'https://wookiee.com' }
26
- expect(VgsapiClient::ApiClient.default.config.host).to eq('wookiee.com')
25
+ VgsApiClient.configure { |c| c.host = 'https://wookiee.com' }
26
+ expect(VgsApiClient::ApiClient.default.config.host).to eq('wookiee.com')
27
27
  end
28
28
 
29
29
  it 'removes trailing path from host' do
30
- VgsapiClient.configure { |c| c.host = 'hobo.com/v4' }
31
- expect(VgsapiClient::Configuration.default.host).to eq('hobo.com')
30
+ VgsApiClient.configure { |c| c.host = 'hobo.com/v4' }
31
+ expect(VgsApiClient::Configuration.default.host).to eq('hobo.com')
32
32
  end
33
33
  end
34
34
 
35
35
  context 'base_path' do
36
36
  it "prepends a slash to base_path" do
37
- VgsapiClient.configure { |c| c.base_path = 'v4/dog' }
38
- expect(VgsapiClient::Configuration.default.base_path).to eq('/v4/dog')
37
+ VgsApiClient.configure { |c| c.base_path = 'v4/dog' }
38
+ expect(VgsApiClient::Configuration.default.base_path).to eq('/v4/dog')
39
39
  end
40
40
 
41
41
  it "doesn't prepend a slash if one is already there" do
42
- VgsapiClient.configure { |c| c.base_path = '/v4/dog' }
43
- expect(VgsapiClient::Configuration.default.base_path).to eq('/v4/dog')
42
+ VgsApiClient.configure { |c| c.base_path = '/v4/dog' }
43
+ expect(VgsApiClient::Configuration.default.base_path).to eq('/v4/dog')
44
44
  end
45
45
 
46
46
  it "ends up as a blank string if nil" do
47
- VgsapiClient.configure { |c| c.base_path = nil }
48
- expect(VgsapiClient::Configuration.default.base_path).to eq('')
47
+ VgsApiClient.configure { |c| c.base_path = nil }
48
+ expect(VgsApiClient::Configuration.default.base_path).to eq('')
49
49
  end
50
50
  end
51
51
  end
52
52
  end
53
53
 
54
54
  describe 'params_encoding in #build_request' do
55
- let(:config) { VgsapiClient::Configuration.new }
56
- let(:api_client) { VgsapiClient::ApiClient.new(config) }
55
+ let(:config) { VgsApiClient::Configuration.new }
56
+ let(:api_client) { VgsApiClient::ApiClient.new(config) }
57
57
 
58
58
  it 'defaults to nil' do
59
- expect(VgsapiClient::Configuration.default.params_encoding).to eq(nil)
59
+ expect(VgsApiClient::Configuration.default.params_encoding).to eq(nil)
60
60
  expect(config.params_encoding).to eq(nil)
61
61
 
62
62
  request = api_client.build_request(:get, '/test')
@@ -71,11 +71,11 @@ describe VgsapiClient::ApiClient do
71
71
  end
72
72
 
73
73
  describe 'timeout in #build_request' do
74
- let(:config) { VgsapiClient::Configuration.new }
75
- let(:api_client) { VgsapiClient::ApiClient.new(config) }
74
+ let(:config) { VgsApiClient::Configuration.new }
75
+ let(:api_client) { VgsApiClient::ApiClient.new(config) }
76
76
 
77
77
  it 'defaults to 0' do
78
- expect(VgsapiClient::Configuration.default.timeout).to eq(0)
78
+ expect(VgsApiClient::Configuration.default.timeout).to eq(0)
79
79
  expect(config.timeout).to eq(0)
80
80
 
81
81
  request = api_client.build_request(:get, '/test')
@@ -91,7 +91,7 @@ describe VgsapiClient::ApiClient do
91
91
 
92
92
  describe '#deserialize' do
93
93
  it "handles Array<Integer>" do
94
- api_client = VgsapiClient::ApiClient.new
94
+ api_client = VgsApiClient::ApiClient.new
95
95
  headers = { 'Content-Type' => 'application/json' }
96
96
  response = double('response', headers: headers, body: '[12, 34]')
97
97
  data = api_client.deserialize(response, 'Array<Integer>')
@@ -100,7 +100,7 @@ describe VgsapiClient::ApiClient do
100
100
  end
101
101
 
102
102
  it 'handles Array<Array<Integer>>' do
103
- api_client = VgsapiClient::ApiClient.new
103
+ api_client = VgsApiClient::ApiClient.new
104
104
  headers = { 'Content-Type' => 'application/json' }
105
105
  response = double('response', headers: headers, body: '[[12, 34], [56]]')
106
106
  data = api_client.deserialize(response, 'Array<Array<Integer>>')
@@ -109,7 +109,7 @@ describe VgsapiClient::ApiClient do
109
109
  end
110
110
 
111
111
  it 'handles Hash<String, String>' do
112
- api_client = VgsapiClient::ApiClient.new
112
+ api_client = VgsApiClient::ApiClient.new
113
113
  headers = { 'Content-Type' => 'application/json' }
114
114
  response = double('response', headers: headers, body: '{"message": "Hello"}')
115
115
  data = api_client.deserialize(response, 'Hash<String, String>')
@@ -121,8 +121,8 @@ describe VgsapiClient::ApiClient do
121
121
  describe "#object_to_hash" do
122
122
  it 'ignores nils and includes empty arrays' do
123
123
  # uncomment below to test object_to_hash for model
124
- # api_client = VgsapiClient::ApiClient.new
125
- # _model = VgsapiClient::ModelName.new
124
+ # api_client = VgsApiClient::ApiClient.new
125
+ # _model = VgsApiClient::ModelName.new
126
126
  # update the model attribute below
127
127
  # _model.id = 1
128
128
  # update the expected value (hash) below
@@ -133,7 +133,7 @@ describe VgsapiClient::ApiClient do
133
133
 
134
134
  describe '#build_collection_param' do
135
135
  let(:param) { ['aa', 'bb', 'cc'] }
136
- let(:api_client) { VgsapiClient::ApiClient.new }
136
+ let(:api_client) { VgsApiClient::ApiClient.new }
137
137
 
138
138
  it 'works for csv' do
139
139
  expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc')
@@ -161,7 +161,7 @@ describe VgsapiClient::ApiClient do
161
161
  end
162
162
 
163
163
  describe '#json_mime?' do
164
- let(:api_client) { VgsapiClient::ApiClient.new }
164
+ let(:api_client) { VgsApiClient::ApiClient.new }
165
165
 
166
166
  it 'works' do
167
167
  expect(api_client.json_mime?(nil)).to eq false
@@ -178,7 +178,7 @@ describe VgsapiClient::ApiClient do
178
178
  end
179
179
 
180
180
  describe '#select_header_accept' do
181
- let(:api_client) { VgsapiClient::ApiClient.new }
181
+ let(:api_client) { VgsApiClient::ApiClient.new }
182
182
 
183
183
  it 'works' do
184
184
  expect(api_client.select_header_accept(nil)).to be_nil
@@ -194,11 +194,11 @@ describe VgsapiClient::ApiClient do
194
194
  end
195
195
 
196
196
  describe '#select_header_content_type' do
197
- let(:api_client) { VgsapiClient::ApiClient.new }
197
+ let(:api_client) { VgsApiClient::ApiClient.new }
198
198
 
199
199
  it 'works' do
200
- expect(api_client.select_header_content_type(nil)).to be_nil
201
- expect(api_client.select_header_content_type([])).to be_nil
200
+ expect(api_client.select_header_content_type(nil)).to eq('application/json')
201
+ expect(api_client.select_header_content_type([])).to eq('application/json')
202
202
 
203
203
  expect(api_client.select_header_content_type(['application/json'])).to eq('application/json')
204
204
  expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
@@ -209,7 +209,7 @@ describe VgsapiClient::ApiClient do
209
209
  end
210
210
 
211
211
  describe '#sanitize_filename' do
212
- let(:api_client) { VgsapiClient::ApiClient.new }
212
+ let(:api_client) { VgsApiClient::ApiClient.new }
213
213
 
214
214
  it 'works' do
215
215
  expect(api_client.sanitize_filename('sun')).to eq('sun')
@@ -6,20 +6,20 @@
6
6
  The version of the OpenAPI document: 1.0.0
7
7
  Contact: support@verygoodsecurity.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 6.0.0-SNAPSHOT
9
+ OpenAPI Generator version: 5.0.1-SNAPSHOT
10
10
 
11
11
  =end
12
12
 
13
13
  require 'spec_helper'
14
14
 
15
- describe VgsapiClient::Configuration do
16
- let(:config) { VgsapiClient::Configuration.default }
15
+ describe VgsApiClient::Configuration do
16
+ let(:config) { VgsApiClient::Configuration.default }
17
17
 
18
18
  before(:each) do
19
19
  # uncomment below to setup host and base_path
20
20
  # require 'URI'
21
21
  # uri = URI.parse("https://api.sandbox.verygoodvault.com")
22
- # VgsapiClient.configure do |c|
22
+ # VgsApiClient.configure do |c|
23
23
  # c.host = uri.host
24
24
  # c.base_path = uri.path
25
25
  # end
@@ -14,15 +14,15 @@ require 'spec_helper'
14
14
  require 'json'
15
15
  require 'date'
16
16
 
17
- # Unit tests for VgsapiClient::AliasFormat
17
+ # Unit tests for VgsApiClient::AliasFormat
18
18
  # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
19
  # Please update as you see appropriate
20
- describe VgsapiClient::AliasFormat do
21
- let(:instance) { VgsapiClient::AliasFormat.new }
20
+ describe VgsApiClient::AliasFormat do
21
+ let(:instance) { VgsApiClient::AliasFormat.new }
22
22
 
23
23
  describe 'test an instance of AliasFormat' do
24
24
  it 'should create an instance of AliasFormat' do
25
- expect(instance).to be_instance_of(VgsapiClient::AliasFormat)
25
+ expect(instance).to be_instance_of(VgsApiClient::AliasFormat)
26
26
  end
27
27
  end
28
28
  end
@@ -14,15 +14,15 @@ require 'spec_helper'
14
14
  require 'json'
15
15
  require 'date'
16
16
 
17
- # Unit tests for VgsapiClient::ApiError
17
+ # Unit tests for VgsApiClient::ApiError
18
18
  # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
19
  # Please update as you see appropriate
20
- describe VgsapiClient::ApiError do
21
- let(:instance) { VgsapiClient::ApiError.new }
20
+ describe VgsApiClient::ApiError do
21
+ let(:instance) { VgsApiClient::ApiError.new }
22
22
 
23
23
  describe 'test an instance of ApiError' do
24
24
  it 'should create an instance of ApiError' do
25
- expect(instance).to be_instance_of(VgsapiClient::ApiError)
25
+ expect(instance).to be_instance_of(VgsApiClient::ApiError)
26
26
  end
27
27
  end
28
28
  describe 'test attribute "detail"' do
@@ -14,15 +14,15 @@ require 'spec_helper'
14
14
  require 'json'
15
15
  require 'date'
16
16
 
17
- # Unit tests for VgsapiClient::CreateAliasesRequestExisting
17
+ # Unit tests for VgsApiClient::CreateAliasesRequestExisting
18
18
  # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
19
  # Please update as you see appropriate
20
- describe VgsapiClient::CreateAliasesRequestExisting do
21
- let(:instance) { VgsapiClient::CreateAliasesRequestExisting.new }
20
+ describe VgsApiClient::CreateAliasesRequestExisting do
21
+ let(:instance) { VgsApiClient::CreateAliasesRequestExisting.new }
22
22
 
23
23
  describe 'test an instance of CreateAliasesRequestExisting' do
24
24
  it 'should create an instance of CreateAliasesRequestExisting' do
25
- expect(instance).to be_instance_of(VgsapiClient::CreateAliasesRequestExisting)
25
+ expect(instance).to be_instance_of(VgsApiClient::CreateAliasesRequestExisting)
26
26
  end
27
27
  end
28
28
  describe 'test attribute "_alias"' do
@@ -14,15 +14,15 @@ require 'spec_helper'
14
14
  require 'json'
15
15
  require 'date'
16
16
 
17
- # Unit tests for VgsapiClient::CreateAliasesRequestNew
17
+ # Unit tests for VgsApiClient::CreateAliasesRequestNew
18
18
  # Automatically generated by openapi-generator (https://openapi-generator.tech)
19
19
  # Please update as you see appropriate
20
- describe VgsapiClient::CreateAliasesRequestNew do
21
- let(:instance) { VgsapiClient::CreateAliasesRequestNew.new }
20
+ describe VgsApiClient::CreateAliasesRequestNew do
21
+ let(:instance) { VgsApiClient::CreateAliasesRequestNew.new }
22
22
 
23
23
  describe 'test an instance of CreateAliasesRequestNew' do
24
24
  it 'should create an instance of CreateAliasesRequestNew' do
25
- expect(instance).to be_instance_of(VgsapiClient::CreateAliasesRequestNew)
25
+ expect(instance).to be_instance_of(VgsApiClient::CreateAliasesRequestNew)
26
26
  end
27
27
  end
28
28
  describe 'test attribute "classifiers"' do