vpndetection 4.0.1 → 5.0.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 (55) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +20 -0
  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 +3 -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 +4 -4
  14. data/lib/vpndetection/configuration.rb +1 -1
  15. data/lib/vpndetection/models/account_create_apikey_request.rb +177 -0
  16. data/lib/vpndetection/models/account_created_apikey.rb +257 -0
  17. data/lib/vpndetection/models/account_org.rb +183 -0
  18. data/lib/vpndetection/models/account_org_ref.rb +164 -0
  19. data/lib/vpndetection/models/account_org_wrap.rb +190 -0
  20. data/lib/vpndetection/models/account_rc.rb +165 -0
  21. data/lib/vpndetection/models/account_revealed_apikey.rb +191 -0
  22. data/lib/vpndetection/models/account_user.rb +182 -0
  23. data/lib/vpndetection/models/apikey_detail.rb +307 -0
  24. data/lib/vpndetection/models/apikey_list.rb +192 -0
  25. data/lib/vpndetection/models/class_detail.rb +1 -1
  26. data/lib/vpndetection/models/database.rb +1 -1
  27. data/lib/vpndetection/models/database_checksums_response.rb +1 -1
  28. data/lib/vpndetection/models/database_format.rb +1 -1
  29. data/lib/vpndetection/models/database_format_size.rb +2 -2
  30. data/lib/vpndetection/models/database_list.rb +1 -1
  31. data/lib/vpndetection/models/database_metadata.rb +1 -1
  32. data/lib/vpndetection/models/database_metadata_column.rb +1 -1
  33. data/lib/vpndetection/models/database_version.rb +1 -1
  34. data/lib/vpndetection/models/db_checksums.rb +1 -1
  35. data/lib/vpndetection/models/device_authorization.rb +281 -0
  36. data/lib/vpndetection/models/download.rb +2 -2
  37. data/lib/vpndetection/models/download_list.rb +1 -1
  38. data/lib/vpndetection/models/{account_me.rb → entitlement.rb} +7 -7
  39. data/lib/vpndetection/models/{account_apikey.rb → entitlement_apikey.rb} +4 -4
  40. data/lib/vpndetection/models/{account_error.rb → entitlement_error.rb} +4 -4
  41. data/lib/vpndetection/models/{account_plan.rb → entitlement_plan.rb} +4 -4
  42. data/lib/vpndetection/models/{account_usage.rb → entitlement_usage.rb} +4 -4
  43. data/lib/vpndetection/models/error_envelope.rb +1 -1
  44. data/lib/vpndetection/models/identity.rb +245 -0
  45. data/lib/vpndetection/models/lookup_error.rb +1 -1
  46. data/lib/vpndetection/models/lookup_response.rb +1 -1
  47. data/lib/vpndetection/models/oauth_error.rb +173 -0
  48. data/lib/vpndetection/models/oauth_metadata.rb +288 -0
  49. data/lib/vpndetection/models/proxy_detail.rb +1 -1
  50. data/lib/vpndetection/models/standing.rb +1 -1
  51. data/lib/vpndetection/models/token_response.rb +235 -0
  52. data/lib/vpndetection/models/vpn_detail.rb +1 -1
  53. data/lib/vpndetection/transport.rb +5 -5
  54. data/lib/vpndetection/version.rb +1 -1
  55. metadata +25 -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: aa0cdfbbc74c41bcfe5ecb123df7dc02f4d9255229d5b96764cd3046f290004a
4
+ data.tar.gz: 540b91db33957765bed48ab55b3cacc10dab5b55fa8d8a91d51ad21a3cee86de
5
5
  SHA512:
6
- metadata.gz: 7b65573bf40eed189922a26a7131225bf1ba805a671404dd506a23d948e4ca98b2b4bf774dbeb3bcffdc1b7821fad819c3d9d19e75dbcf8ab46470c4a8a2f26d
7
- data.tar.gz: c9685a07643394cd7eef10034b740fb119bf1d16d89be927baf80f8db342e99fb0aa5ba073614196ba31d32e84c4e3ddebdf594e9d919afac193e38c78326e1b
6
+ metadata.gz: 020525503bb0410d9c9a79b04230b6ce2956798813583d7dee1dd4f92c3f00cee496a273a5d8a4db240a1661d19674d939e8c0ceb9a2949669c2793eb3170a97
7
+ data.tar.gz: c0071cc728e2a67f3da1e6c33974ef223bc46e8b96057ea4a013909f408fc781246ba9ec4216ec35bd34001428d004f0d7709ea9957dac2689398b8c27349e15
data/README.md CHANGED
@@ -48,6 +48,26 @@ 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
73
  You can do batch lookups with a list, which parallelizes requests for you efficiently:
@@ -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