vpndetection 4.0.1 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +24 -4
  3. data/lib/vpndetection/api/account_wire_api.rb +16 -16
  4. data/lib/vpndetection/api/api_keys_wire_api.rb +336 -0
  5. data/lib/vpndetection/api/authorization_wire_api.rb +421 -0
  6. data/lib/vpndetection/api/database_wire_api.rb +1 -1
  7. data/lib/vpndetection/api/entitlement_wire_api.rb +79 -0
  8. data/lib/vpndetection/api/lookup_wire_api.rb +71 -3
  9. data/lib/vpndetection/api/organization_wire_api.rb +136 -0
  10. data/lib/vpndetection/api_client.rb +1 -1
  11. data/lib/vpndetection/api_error.rb +1 -1
  12. data/lib/vpndetection/api_model_base.rb +1 -1
  13. data/lib/vpndetection/client.rb +57 -26
  14. data/lib/vpndetection/configuration.rb +1 -1
  15. data/lib/vpndetection/errors.rb +7 -0
  16. data/lib/vpndetection/models/account_create_apikey_request.rb +177 -0
  17. data/lib/vpndetection/models/account_created_apikey.rb +257 -0
  18. data/lib/vpndetection/models/account_org.rb +183 -0
  19. data/lib/vpndetection/models/account_org_ref.rb +164 -0
  20. data/lib/vpndetection/models/account_org_wrap.rb +190 -0
  21. data/lib/vpndetection/models/account_rc.rb +165 -0
  22. data/lib/vpndetection/models/account_revealed_apikey.rb +191 -0
  23. data/lib/vpndetection/models/account_user.rb +182 -0
  24. data/lib/vpndetection/models/apikey_detail.rb +307 -0
  25. data/lib/vpndetection/models/apikey_list.rb +192 -0
  26. data/lib/vpndetection/models/batch_lookup_error.rb +193 -0
  27. data/lib/vpndetection/models/batch_lookup_request.rb +185 -0
  28. data/lib/vpndetection/models/batch_lookup_response.rb +196 -0
  29. data/lib/vpndetection/models/class_detail.rb +1 -1
  30. data/lib/vpndetection/models/database.rb +1 -1
  31. data/lib/vpndetection/models/database_checksums_response.rb +1 -1
  32. data/lib/vpndetection/models/database_format.rb +1 -1
  33. data/lib/vpndetection/models/database_format_size.rb +2 -2
  34. data/lib/vpndetection/models/database_list.rb +1 -1
  35. data/lib/vpndetection/models/database_metadata.rb +1 -1
  36. data/lib/vpndetection/models/database_metadata_column.rb +1 -1
  37. data/lib/vpndetection/models/database_version.rb +1 -1
  38. data/lib/vpndetection/models/db_checksums.rb +1 -1
  39. data/lib/vpndetection/models/device_authorization.rb +281 -0
  40. data/lib/vpndetection/models/download.rb +2 -2
  41. data/lib/vpndetection/models/download_list.rb +1 -1
  42. data/lib/vpndetection/models/{account_me.rb → entitlement.rb} +7 -7
  43. data/lib/vpndetection/models/{account_apikey.rb → entitlement_apikey.rb} +4 -4
  44. data/lib/vpndetection/models/{account_error.rb → entitlement_error.rb} +4 -4
  45. data/lib/vpndetection/models/{account_plan.rb → entitlement_plan.rb} +4 -4
  46. data/lib/vpndetection/models/{account_usage.rb → entitlement_usage.rb} +4 -4
  47. data/lib/vpndetection/models/error_envelope.rb +1 -1
  48. data/lib/vpndetection/models/identity.rb +245 -0
  49. data/lib/vpndetection/models/lookup_error.rb +1 -1
  50. data/lib/vpndetection/models/lookup_response.rb +1 -1
  51. data/lib/vpndetection/models/oauth_error.rb +173 -0
  52. data/lib/vpndetection/models/oauth_metadata.rb +288 -0
  53. data/lib/vpndetection/models/proxy_detail.rb +1 -1
  54. data/lib/vpndetection/models/standing.rb +1 -1
  55. data/lib/vpndetection/models/token_response.rb +235 -0
  56. data/lib/vpndetection/models/vpn_detail.rb +1 -1
  57. data/lib/vpndetection/transport.rb +28 -5
  58. data/lib/vpndetection/version.rb +1 -1
  59. metadata +28 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 164314052bfd32f74acb272ff59c077ab1a841395c9818954ea83f6b167464ce
4
- data.tar.gz: e41ccca025ec996d64861e26ba7fc6c3bbcca85628d9c402dedc35f372f96f6d
3
+ metadata.gz: 6d5875418fd7eb25808f8708537f8a17008502cf24bf3ffcd808595f95f5d8d4
4
+ data.tar.gz: c695e3f997ddb7284324f8c990a910083b183bb6d379046c27258bd4ceeb09d4
5
5
  SHA512:
6
- metadata.gz: 7b65573bf40eed189922a26a7131225bf1ba805a671404dd506a23d948e4ca98b2b4bf774dbeb3bcffdc1b7821fad819c3d9d19e75dbcf8ab46470c4a8a2f26d
7
- data.tar.gz: c9685a07643394cd7eef10034b740fb119bf1d16d89be927baf80f8db342e99fb0aa5ba073614196ba31d32e84c4e3ddebdf594e9d919afac193e38c78326e1b
6
+ metadata.gz: c69b0dad9c16c852b58d98faf6356a1f19704126f9963605afd002b7b186b7fdec26511219a68a7d111b4e4e718ca2a5a1415f01121046b0fe67a81bc20d8b6e
7
+ data.tar.gz: 2bc760ccdcf01d2ca3bb02489e4d12dc390af9e077bc35904d0147b24c4761f99632715c9b6c9ae2789cd48041191e644498681e059251ebe4476719e98a83c7
data/README.md CHANGED
@@ -48,9 +48,29 @@ result.is_hosting # => true
48
48
  result.hosting['provider'] # => "M247"
49
49
  ```
50
50
 
51
+ ### Your own address
52
+
53
+ ```ruby
54
+ result = client.my_ip
55
+ result.ip # => the address we saw this call come from
56
+ ```
57
+
58
+ Same answer `lookup` would give for that address, and the same cost against your allowance. It is deliberately not cached: which address you are is the whole question, and a machine that moves between networks would otherwise be told where it used to be.
59
+
60
+ ### Your plan and usage
61
+
62
+ ```ruby
63
+ acct = client.my_entitlement
64
+ acct.plan.key # => "max"
65
+ acct.usage.requests # => 580
66
+ acct.usage.window_end # => when the allowance resets
67
+ ```
68
+
69
+ Usage counts against the anniversary of your subscription, not the calendar month and not the billing period, and it is the same number a lookup is gated on. `hard_limit` is `nil` on an uncapped plan, which is not the same as zero.
70
+
51
71
  ### Batch lookup
52
72
 
53
- You can do batch lookups with a list, which parallelizes requests for you efficiently:
73
+ Look up many addresses at once. Bogons and cached answers are handled locally, and everything else goes to the batch endpoint in chunks of up to 1000 addresses, in parallel:
54
74
 
55
75
  ```ruby
56
76
  results = client.lookup_batch(['45.83.91.1', '8.8.8.8', '1.1.1.1'])
@@ -64,12 +84,12 @@ results.each do |ip, result|
64
84
  end
65
85
  ```
66
86
 
67
- Results are keyed by address, so duplicates in your list collapse into a single request and one address failing never loses the rest.
87
+ Results are keyed by address, in the order you first listed each one, so duplicates in your list collapse into a single entry and one address failing never loses the rest: it carries its error as its value, with the status the API would have given that address on its own.
68
88
 
69
- Concurrency and other variables are configurable per-call:
89
+ How many chunks are in flight at once, and how many times a failed chunk is retried, are configurable per call:
70
90
 
71
91
  ```ruby
72
- results = client.lookup_batch(many_ips, concurrency: 32, retries: 4)
92
+ results = client.lookup_batch(many_ips, concurrency: 4, retries: 4)
73
93
  ```
74
94
 
75
95
  ### Caching
@@ -3,7 +3,7 @@
3
3
 
4
4
  #The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
5
5
 
6
- The version of the OpenAPI document: 2026.09.13
6
+ The version of the OpenAPI document: 2026.09.15
7
7
  Contact: support@vpndetection.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -19,25 +19,25 @@ module VPNDetection
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
- # Your key, plan and usage
23
- # Answers what the presented key is, what plan is behind it, and what has been spent against that plan's allowance in the current window.
22
+ # Identity
23
+ # The identity behind this credential: what it is, the organization it is scoped to, and the scopes it currently holds. `user` is present for an OAuth token and ABSENT for an API key, which has an organization but no person behind it. `credential.kind` says which you are holding, so a client can branch without guessing from a missing field. Narrower than what the console shows its own user on purpose: an integration needs a name to display and an organization to address, not a profile. The `scopes` array is what the credential may do RIGHT NOW, so a client can render its own capabilities rather than discovering them from a 403.
24
24
  # @param [Hash] opts the optional parameters
25
- # @return [AccountMe]
26
- def account_me(opts = {})
27
- data, _status_code, _headers = account_me_with_http_info(opts)
25
+ # @return [Identity]
26
+ def account_identity(opts = {})
27
+ data, _status_code, _headers = account_identity_with_http_info(opts)
28
28
  data
29
29
  end
30
30
 
31
- # Your key, plan and usage
32
- # Answers what the presented key is, what plan is behind it, and what has been spent against that plan's allowance in the current window.
31
+ # Identity
32
+ # The identity behind this credential: what it is, the organization it is scoped to, and the scopes it currently holds. `user` is present for an OAuth token and ABSENT for an API key, which has an organization but no person behind it. `credential.kind` says which you are holding, so a client can branch without guessing from a missing field. Narrower than what the console shows its own user on purpose: an integration needs a name to display and an organization to address, not a profile. The `scopes` array is what the credential may do RIGHT NOW, so a client can render its own capabilities rather than discovering them from a 403.
33
33
  # @param [Hash] opts the optional parameters
34
- # @return [Array<(AccountMe, Integer, Hash)>] AccountMe data, response status code and response headers
35
- def account_me_with_http_info(opts = {})
34
+ # @return [Array<(Identity, Integer, Hash)>] Identity data, response status code and response headers
35
+ def account_identity_with_http_info(opts = {})
36
36
  if @api_client.config.debugging
37
- @api_client.config.logger.debug 'Calling API: AccountWireApi.account_me ...'
37
+ @api_client.config.logger.debug 'Calling API: AccountWireApi.account_identity ...'
38
38
  end
39
39
  # resource path
40
- local_var_path = '/api/v1/account/me'
40
+ local_var_path = '/api/v1/iam/identity'
41
41
 
42
42
  # query parameters
43
43
  query_params = opts[:query_params] || {}
@@ -54,13 +54,13 @@ module VPNDetection
54
54
  post_body = opts[:debug_body]
55
55
 
56
56
  # return_type
57
- return_type = opts[:debug_return_type] || 'AccountMe'
57
+ return_type = opts[:debug_return_type] || 'Identity'
58
58
 
59
59
  # auth_names
60
- auth_names = opts[:debug_auth_names] || ['apiKeyQuery', 'bearerAuth', 'apiKeyHeader']
60
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
61
61
 
62
62
  new_options = opts.merge(
63
- :operation => :"AccountWireApi.account_me",
63
+ :operation => :"AccountWireApi.account_identity",
64
64
  :header_params => header_params,
65
65
  :query_params => query_params,
66
66
  :form_params => form_params,
@@ -71,7 +71,7 @@ module VPNDetection
71
71
 
72
72
  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
73
73
  if @api_client.config.debugging
74
- @api_client.config.logger.debug "API called: AccountWireApi#account_me\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
74
+ @api_client.config.logger.debug "API called: AccountWireApi#account_identity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
75
75
  end
76
76
  return data, status_code, headers
77
77
  end
@@ -0,0 +1,336 @@
1
+ =begin
2
+ #VPNDetection API
3
+
4
+ #The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
5
+
6
+ The version of the OpenAPI document: 2026.09.15
7
+ Contact: support@vpndetection.io
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.25.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module VPNDetection
16
+ class APIKeysWireApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create
23
+ # Creates a key and returns its secret. This is the ONLY response that ever carries the secret, and only because this is the moment it comes into existence. Store it now.
24
+ # @param account_create_apikey_request [AccountCreateApikeyRequest]
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [AccountCreatedApikey]
27
+ def account_create_apikey(account_create_apikey_request, opts = {})
28
+ data, _status_code, _headers = account_create_apikey_with_http_info(account_create_apikey_request, opts)
29
+ data
30
+ end
31
+
32
+ # Create
33
+ # Creates a key and returns its secret. This is the ONLY response that ever carries the secret, and only because this is the moment it comes into existence. Store it now.
34
+ # @param account_create_apikey_request [AccountCreateApikeyRequest]
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(AccountCreatedApikey, Integer, Hash)>] AccountCreatedApikey data, response status code and response headers
37
+ def account_create_apikey_with_http_info(account_create_apikey_request, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: APIKeysWireApi.account_create_apikey ...'
40
+ end
41
+ # verify the required parameter 'account_create_apikey_request' is set
42
+ if @api_client.config.client_side_validation && account_create_apikey_request.nil?
43
+ fail ArgumentError, "Missing the required parameter 'account_create_apikey_request' when calling APIKeysWireApi.account_create_apikey"
44
+ end
45
+ # resource path
46
+ local_var_path = '/api/v1/iam/apikeys'
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
55
+ # HTTP header 'Content-Type'
56
+ content_type = @api_client.select_header_content_type(['application/json'])
57
+ if !content_type.nil?
58
+ header_params['Content-Type'] = content_type
59
+ end
60
+
61
+ # form parameters
62
+ form_params = opts[:form_params] || {}
63
+
64
+ # http body (model)
65
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(account_create_apikey_request)
66
+
67
+ # return_type
68
+ return_type = opts[:debug_return_type] || 'AccountCreatedApikey'
69
+
70
+ # auth_names
71
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
72
+
73
+ new_options = opts.merge(
74
+ :operation => :"APIKeysWireApi.account_create_apikey",
75
+ :header_params => header_params,
76
+ :query_params => query_params,
77
+ :form_params => form_params,
78
+ :body => post_body,
79
+ :auth_names => auth_names,
80
+ :return_type => return_type
81
+ )
82
+
83
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
84
+ if @api_client.config.debugging
85
+ @api_client.config.logger.debug "API called: APIKeysWireApi#account_create_apikey\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
86
+ end
87
+ return data, status_code, headers
88
+ end
89
+
90
+ # List
91
+ # Metadata only. A key's secret is never in a list - not here and not in the console - because a list is the response that ends up in logs, caches and support tickets. `retrievable` says whether the secret could still be read back at all. A key issued before this product stored secrets recoverably was never kept, so `reveal` will refuse it permanently; rotating produces one that can be read.
92
+ # @param [Hash] opts the optional parameters
93
+ # @return [ApikeyList]
94
+ def account_list_apikeys(opts = {})
95
+ data, _status_code, _headers = account_list_apikeys_with_http_info(opts)
96
+ data
97
+ end
98
+
99
+ # List
100
+ # Metadata only. A key&#39;s secret is never in a list - not here and not in the console - because a list is the response that ends up in logs, caches and support tickets. &#x60;retrievable&#x60; says whether the secret could still be read back at all. A key issued before this product stored secrets recoverably was never kept, so &#x60;reveal&#x60; will refuse it permanently; rotating produces one that can be read.
101
+ # @param [Hash] opts the optional parameters
102
+ # @return [Array<(ApikeyList, Integer, Hash)>] ApikeyList data, response status code and response headers
103
+ def account_list_apikeys_with_http_info(opts = {})
104
+ if @api_client.config.debugging
105
+ @api_client.config.logger.debug 'Calling API: APIKeysWireApi.account_list_apikeys ...'
106
+ end
107
+ # resource path
108
+ local_var_path = '/api/v1/iam/apikeys'
109
+
110
+ # query parameters
111
+ query_params = opts[:query_params] || {}
112
+
113
+ # header parameters
114
+ header_params = opts[:header_params] || {}
115
+ # HTTP header 'Accept' (if needed)
116
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
117
+
118
+ # form parameters
119
+ form_params = opts[:form_params] || {}
120
+
121
+ # http body (model)
122
+ post_body = opts[:debug_body]
123
+
124
+ # return_type
125
+ return_type = opts[:debug_return_type] || 'ApikeyList'
126
+
127
+ # auth_names
128
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
129
+
130
+ new_options = opts.merge(
131
+ :operation => :"APIKeysWireApi.account_list_apikeys",
132
+ :header_params => header_params,
133
+ :query_params => query_params,
134
+ :form_params => form_params,
135
+ :body => post_body,
136
+ :auth_names => auth_names,
137
+ :return_type => return_type
138
+ )
139
+
140
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
141
+ if @api_client.config.debugging
142
+ @api_client.config.logger.debug "API called: APIKeysWireApi#account_list_apikeys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
143
+ end
144
+ return data, status_code, headers
145
+ end
146
+
147
+ # Reveal
148
+ # Returns an existing key's secret. Its own scope rather than part of `apikeys.manage`, because the two are different acts: rotating replaces a secret you never see, while this hands one over. Refused with `NOT_RETRIEVABLE` for a key issued before this product stored secrets recoverably - that secret was never kept, so no retry will ever produce it. Rotate the key instead.
149
+ # @param id [String] The key&#39;s id, as returned by the list endpoint. Never the key itself.
150
+ # @param [Hash] opts the optional parameters
151
+ # @return [AccountRevealedApikey]
152
+ def account_reveal_apikey(id, opts = {})
153
+ data, _status_code, _headers = account_reveal_apikey_with_http_info(id, opts)
154
+ data
155
+ end
156
+
157
+ # Reveal
158
+ # Returns an existing key&#39;s secret. Its own scope rather than part of &#x60;apikeys.manage&#x60;, because the two are different acts: rotating replaces a secret you never see, while this hands one over. Refused with &#x60;NOT_RETRIEVABLE&#x60; for a key issued before this product stored secrets recoverably - that secret was never kept, so no retry will ever produce it. Rotate the key instead.
159
+ # @param id [String] The key&#39;s id, as returned by the list endpoint. Never the key itself.
160
+ # @param [Hash] opts the optional parameters
161
+ # @return [Array<(AccountRevealedApikey, Integer, Hash)>] AccountRevealedApikey data, response status code and response headers
162
+ def account_reveal_apikey_with_http_info(id, opts = {})
163
+ if @api_client.config.debugging
164
+ @api_client.config.logger.debug 'Calling API: APIKeysWireApi.account_reveal_apikey ...'
165
+ end
166
+ # verify the required parameter 'id' is set
167
+ if @api_client.config.client_side_validation && id.nil?
168
+ fail ArgumentError, "Missing the required parameter 'id' when calling APIKeysWireApi.account_reveal_apikey"
169
+ end
170
+ # resource path
171
+ local_var_path = '/api/v1/iam/apikeys/{id}/reveal'.sub('{id}', CGI.escape(id.to_s))
172
+
173
+ # query parameters
174
+ query_params = opts[:query_params] || {}
175
+
176
+ # header parameters
177
+ header_params = opts[:header_params] || {}
178
+ # HTTP header 'Accept' (if needed)
179
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
180
+
181
+ # form parameters
182
+ form_params = opts[:form_params] || {}
183
+
184
+ # http body (model)
185
+ post_body = opts[:debug_body]
186
+
187
+ # return_type
188
+ return_type = opts[:debug_return_type] || 'AccountRevealedApikey'
189
+
190
+ # auth_names
191
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
192
+
193
+ new_options = opts.merge(
194
+ :operation => :"APIKeysWireApi.account_reveal_apikey",
195
+ :header_params => header_params,
196
+ :query_params => query_params,
197
+ :form_params => form_params,
198
+ :body => post_body,
199
+ :auth_names => auth_names,
200
+ :return_type => return_type
201
+ )
202
+
203
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
204
+ if @api_client.config.debugging
205
+ @api_client.config.logger.debug "API called: APIKeysWireApi#account_reveal_apikey\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
206
+ end
207
+ return data, status_code, headers
208
+ end
209
+
210
+ # Revoke
211
+ # Stops the key working. Revocation is soft: the key stays listed with a `revoked_at`, because the organization still owns whatever it did while it was alive.
212
+ # @param id [String] The key&#39;s id, as returned by the list endpoint. Never the key itself.
213
+ # @param [Hash] opts the optional parameters
214
+ # @return [AccountRc]
215
+ def account_revoke_apikey(id, opts = {})
216
+ data, _status_code, _headers = account_revoke_apikey_with_http_info(id, opts)
217
+ data
218
+ end
219
+
220
+ # Revoke
221
+ # Stops the key working. Revocation is soft: the key stays listed with a &#x60;revoked_at&#x60;, because the organization still owns whatever it did while it was alive.
222
+ # @param id [String] The key&#39;s id, as returned by the list endpoint. Never the key itself.
223
+ # @param [Hash] opts the optional parameters
224
+ # @return [Array<(AccountRc, Integer, Hash)>] AccountRc data, response status code and response headers
225
+ def account_revoke_apikey_with_http_info(id, opts = {})
226
+ if @api_client.config.debugging
227
+ @api_client.config.logger.debug 'Calling API: APIKeysWireApi.account_revoke_apikey ...'
228
+ end
229
+ # verify the required parameter 'id' is set
230
+ if @api_client.config.client_side_validation && id.nil?
231
+ fail ArgumentError, "Missing the required parameter 'id' when calling APIKeysWireApi.account_revoke_apikey"
232
+ end
233
+ # resource path
234
+ local_var_path = '/api/v1/iam/apikeys/{id}/revoke'.sub('{id}', CGI.escape(id.to_s))
235
+
236
+ # query parameters
237
+ query_params = opts[:query_params] || {}
238
+
239
+ # header parameters
240
+ header_params = opts[:header_params] || {}
241
+ # HTTP header 'Accept' (if needed)
242
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
243
+
244
+ # form parameters
245
+ form_params = opts[:form_params] || {}
246
+
247
+ # http body (model)
248
+ post_body = opts[:debug_body]
249
+
250
+ # return_type
251
+ return_type = opts[:debug_return_type] || 'AccountRc'
252
+
253
+ # auth_names
254
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
255
+
256
+ new_options = opts.merge(
257
+ :operation => :"APIKeysWireApi.account_revoke_apikey",
258
+ :header_params => header_params,
259
+ :query_params => query_params,
260
+ :form_params => form_params,
261
+ :body => post_body,
262
+ :auth_names => auth_names,
263
+ :return_type => return_type
264
+ )
265
+
266
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
267
+ if @api_client.config.debugging
268
+ @api_client.config.logger.debug "API called: APIKeysWireApi#account_revoke_apikey\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
269
+ end
270
+ return data, status_code, headers
271
+ end
272
+
273
+ # Rotate
274
+ # Replaces the secret behind a key, keeping its id, name and settings. The previous secret stops working immediately.
275
+ # @param id [String] The key&#39;s id, as returned by the list endpoint. Never the key itself.
276
+ # @param [Hash] opts the optional parameters
277
+ # @return [AccountCreatedApikey]
278
+ def account_rotate_apikey(id, opts = {})
279
+ data, _status_code, _headers = account_rotate_apikey_with_http_info(id, opts)
280
+ data
281
+ end
282
+
283
+ # Rotate
284
+ # Replaces the secret behind a key, keeping its id, name and settings. The previous secret stops working immediately.
285
+ # @param id [String] The key&#39;s id, as returned by the list endpoint. Never the key itself.
286
+ # @param [Hash] opts the optional parameters
287
+ # @return [Array<(AccountCreatedApikey, Integer, Hash)>] AccountCreatedApikey data, response status code and response headers
288
+ def account_rotate_apikey_with_http_info(id, opts = {})
289
+ if @api_client.config.debugging
290
+ @api_client.config.logger.debug 'Calling API: APIKeysWireApi.account_rotate_apikey ...'
291
+ end
292
+ # verify the required parameter 'id' is set
293
+ if @api_client.config.client_side_validation && id.nil?
294
+ fail ArgumentError, "Missing the required parameter 'id' when calling APIKeysWireApi.account_rotate_apikey"
295
+ end
296
+ # resource path
297
+ local_var_path = '/api/v1/iam/apikeys/{id}/rotate'.sub('{id}', CGI.escape(id.to_s))
298
+
299
+ # query parameters
300
+ query_params = opts[:query_params] || {}
301
+
302
+ # header parameters
303
+ header_params = opts[:header_params] || {}
304
+ # HTTP header 'Accept' (if needed)
305
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
306
+
307
+ # form parameters
308
+ form_params = opts[:form_params] || {}
309
+
310
+ # http body (model)
311
+ post_body = opts[:debug_body]
312
+
313
+ # return_type
314
+ return_type = opts[:debug_return_type] || 'AccountCreatedApikey'
315
+
316
+ # auth_names
317
+ auth_names = opts[:debug_auth_names] || ['bearerAuth']
318
+
319
+ new_options = opts.merge(
320
+ :operation => :"APIKeysWireApi.account_rotate_apikey",
321
+ :header_params => header_params,
322
+ :query_params => query_params,
323
+ :form_params => form_params,
324
+ :body => post_body,
325
+ :auth_names => auth_names,
326
+ :return_type => return_type
327
+ )
328
+
329
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
330
+ if @api_client.config.debugging
331
+ @api_client.config.logger.debug "API called: APIKeysWireApi#account_rotate_apikey\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
332
+ end
333
+ return data, status_code, headers
334
+ end
335
+ end
336
+ end