Class: MailSafePro::APIKeysApi

Inherits:
Object
  • Object
show all
Defined in:
lib/mailsafepro/api/api_keys_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ APIKeysApi

Returns a new instance of APIKeysApi.



19
20
21
# File 'lib/mailsafepro/api/api_keys_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/mailsafepro/api/api_keys_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_api_key_api_keys_post(api_key_create_request, opts = {}) ⇒ Object

Create Api Key Create a new API key with atomic transaction. Generates cryptographically secure API keys with proper scoping based on user’s current plan. Enforces maximum key limits.

Parameters:

  • api_key_create_request (APIKeyCreateRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


27
28
29
30
# File 'lib/mailsafepro/api/api_keys_api.rb', line 27

def create_api_key_api_keys_post(api_key_create_request, opts = {})
  data, _status_code, _headers = create_api_key_api_keys_post_with_http_info(api_key_create_request, opts)
  data
end

#create_api_key_api_keys_post_0(api_key_create_request, opts = {}) ⇒ Object

Create Api Key Create a new API key with atomic transaction. Generates cryptographically secure API keys with proper scoping based on user’s current plan. Enforces maximum key limits.

Parameters:

  • api_key_create_request (APIKeyCreateRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


95
96
97
98
# File 'lib/mailsafepro/api/api_keys_api.rb', line 95

def create_api_key_api_keys_post_0(api_key_create_request, opts = {})
  data, _status_code, _headers = create_api_key_api_keys_post_0_with_http_info(api_key_create_request, opts)
  data
end

#create_api_key_api_keys_post_0_with_http_info(api_key_create_request, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Create Api Key Create a new API key with atomic transaction. Generates cryptographically secure API keys with proper scoping based on user&#39;s current plan. Enforces maximum key limits.

Parameters:

  • api_key_create_request (APIKeyCreateRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/mailsafepro/api/api_keys_api.rb', line 105

def create_api_key_api_keys_post_0_with_http_info(api_key_create_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.create_api_key_api_keys_post_0 ...'
  end
  # verify the required parameter 'api_key_create_request' is set
  if @api_client.config.client_side_validation && api_key_create_request.nil?
    fail ArgumentError, "Missing the required parameter 'api_key_create_request' when calling APIKeysApi.create_api_key_api_keys_post_0"
  end
  # resource path
  local_var_path = '/api-keys'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(api_key_create_request)

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Bearer']

  new_options = opts.merge(
    :operation => :"APIKeysApi.create_api_key_api_keys_post_0",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#create_api_key_api_keys_post_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_api_key_api_keys_post_with_http_info(api_key_create_request, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Create Api Key Create a new API key with atomic transaction. Generates cryptographically secure API keys with proper scoping based on user&#39;s current plan. Enforces maximum key limits.

Parameters:

  • api_key_create_request (APIKeyCreateRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/mailsafepro/api/api_keys_api.rb', line 37

def create_api_key_api_keys_post_with_http_info(api_key_create_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.create_api_key_api_keys_post ...'
  end
  # verify the required parameter 'api_key_create_request' is set
  if @api_client.config.client_side_validation && api_key_create_request.nil?
    fail ArgumentError, "Missing the required parameter 'api_key_create_request' when calling APIKeysApi.create_api_key_api_keys_post"
  end
  # resource path
  local_var_path = '/api-keys'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(api_key_create_request)

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Bearer']

  new_options = opts.merge(
    :operation => :"APIKeysApi.create_api_key_api_keys_post",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#create_api_key_api_keys_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#force_sync_api_keys_force_sync_post(opts = {}) ⇒ Object

Force Sync Force synchronization of user data with rate limiting. Synchronizes API keys with current plan and clears relevant caches. Limited to one sync per 5 minutes per user.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


162
163
164
165
# File 'lib/mailsafepro/api/api_keys_api.rb', line 162

def force_sync_api_keys_force_sync_post(opts = {})
  data, _status_code, _headers = force_sync_api_keys_force_sync_post_with_http_info(opts)
  data
end

#force_sync_api_keys_force_sync_post_0(opts = {}) ⇒ Object

Force Sync Force synchronization of user data with rate limiting. Synchronizes API keys with current plan and clears relevant caches. Limited to one sync per 5 minutes per user.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


219
220
221
222
# File 'lib/mailsafepro/api/api_keys_api.rb', line 219

def force_sync_api_keys_force_sync_post_0(opts = {})
  data, _status_code, _headers = force_sync_api_keys_force_sync_post_0_with_http_info(opts)
  data
end

#force_sync_api_keys_force_sync_post_0_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Force Sync Force synchronization of user data with rate limiting. Synchronizes API keys with current plan and clears relevant caches. Limited to one sync per 5 minutes per user.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
# File 'lib/mailsafepro/api/api_keys_api.rb', line 228

def force_sync_api_keys_force_sync_post_0_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.force_sync_api_keys_force_sync_post_0 ...'
  end
  # resource path
  local_var_path = '/api-keys/force-sync'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Bearer']

  new_options = opts.merge(
    :operation => :"APIKeysApi.force_sync_api_keys_force_sync_post_0",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#force_sync_api_keys_force_sync_post_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#force_sync_api_keys_force_sync_post_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Force Sync Force synchronization of user data with rate limiting. Synchronizes API keys with current plan and clears relevant caches. Limited to one sync per 5 minutes per user.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
# File 'lib/mailsafepro/api/api_keys_api.rb', line 171

def force_sync_api_keys_force_sync_post_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.force_sync_api_keys_force_sync_post ...'
  end
  # resource path
  local_var_path = '/api-keys/force-sync'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Bearer']

  new_options = opts.merge(
    :operation => :"APIKeysApi.force_sync_api_keys_force_sync_post",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#force_sync_api_keys_force_sync_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_api_key_value_api_keys_key_hash_value_get(key_hash, opts = {}) ⇒ Object

Get Api Key Value Retrieve API key metadata (security-safe). Returns key information without exposing the actual key value. Used for key management and verification purposes.

Parameters:

  • key_hash (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


277
278
279
280
# File 'lib/mailsafepro/api/api_keys_api.rb', line 277

def get_api_key_value_api_keys_key_hash_value_get(key_hash, opts = {})
  data, _status_code, _headers = get_api_key_value_api_keys_key_hash_value_get_with_http_info(key_hash, opts)
  data
end

#get_api_key_value_api_keys_key_hash_value_get_0(key_hash, opts = {}) ⇒ Object

Get Api Key Value Retrieve API key metadata (security-safe). Returns key information without exposing the actual key value. Used for key management and verification purposes.

Parameters:

  • key_hash (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


345
346
347
348
# File 'lib/mailsafepro/api/api_keys_api.rb', line 345

def get_api_key_value_api_keys_key_hash_value_get_0(key_hash, opts = {})
  data, _status_code, _headers = get_api_key_value_api_keys_key_hash_value_get_0_with_http_info(key_hash, opts)
  data
end

#get_api_key_value_api_keys_key_hash_value_get_0_with_http_info(key_hash, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Get Api Key Value Retrieve API key metadata (security-safe). Returns key information without exposing the actual key value. Used for key management and verification purposes.

Parameters:

  • key_hash (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
# File 'lib/mailsafepro/api/api_keys_api.rb', line 355

def get_api_key_value_api_keys_key_hash_value_get_0_with_http_info(key_hash, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.get_api_key_value_api_keys_key_hash_value_get_0 ...'
  end
  # verify the required parameter 'key_hash' is set
  if @api_client.config.client_side_validation && key_hash.nil?
    fail ArgumentError, "Missing the required parameter 'key_hash' when calling APIKeysApi.get_api_key_value_api_keys_key_hash_value_get_0"
  end
  pattern = Regexp.new(/^[a-f0-9]{64}$/)
  if @api_client.config.client_side_validation && key_hash !~ pattern
    fail ArgumentError, "invalid value for 'key_hash' when calling APIKeysApi.get_api_key_value_api_keys_key_hash_value_get_0, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/api-keys/{key_hash}/value'.sub('{' + 'key_hash' + '}', CGI.escape(key_hash.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Bearer']

  new_options = opts.merge(
    :operation => :"APIKeysApi.get_api_key_value_api_keys_key_hash_value_get_0",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#get_api_key_value_api_keys_key_hash_value_get_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_api_key_value_api_keys_key_hash_value_get_with_http_info(key_hash, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Get Api Key Value Retrieve API key metadata (security-safe). Returns key information without exposing the actual key value. Used for key management and verification purposes.

Parameters:

  • key_hash (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
# File 'lib/mailsafepro/api/api_keys_api.rb', line 287

def get_api_key_value_api_keys_key_hash_value_get_with_http_info(key_hash, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.get_api_key_value_api_keys_key_hash_value_get ...'
  end
  # verify the required parameter 'key_hash' is set
  if @api_client.config.client_side_validation && key_hash.nil?
    fail ArgumentError, "Missing the required parameter 'key_hash' when calling APIKeysApi.get_api_key_value_api_keys_key_hash_value_get"
  end
  pattern = Regexp.new(/^[a-f0-9]{64}$/)
  if @api_client.config.client_side_validation && key_hash !~ pattern
    fail ArgumentError, "invalid value for 'key_hash' when calling APIKeysApi.get_api_key_value_api_keys_key_hash_value_get, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/api-keys/{key_hash}/value'.sub('{' + 'key_hash' + '}', CGI.escape(key_hash.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Bearer']

  new_options = opts.merge(
    :operation => :"APIKeysApi.get_api_key_value_api_keys_key_hash_value_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#get_api_key_value_api_keys_key_hash_value_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_api_keys_usage_get(opts = {}) ⇒ Object

Get Usage Get current API usage statistics. Returns usage count, limits, and remaining requests for today. Works with both API keys and JWT tokens.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_api_key (String)
  • :authorization (String)

Returns:

  • (Object)


414
415
416
417
# File 'lib/mailsafepro/api/api_keys_api.rb', line 414

def get_usage_api_keys_usage_get(opts = {})
  data, _status_code, _headers = get_usage_api_keys_usage_get_with_http_info(opts)
  data
end

#get_usage_api_keys_usage_get_0(opts = {}) ⇒ Object

Get Usage Get current API usage statistics. Returns usage count, limits, and remaining requests for today. Works with both API keys and JWT tokens.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_api_key (String)
  • :authorization (String)

Returns:

  • (Object)


477
478
479
480
# File 'lib/mailsafepro/api/api_keys_api.rb', line 477

def get_usage_api_keys_usage_get_0(opts = {})
  data, _status_code, _headers = get_usage_api_keys_usage_get_0_with_http_info(opts)
  data
end

#get_usage_api_keys_usage_get_0_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Get Usage Get current API usage statistics. Returns usage count, limits, and remaining requests for today. Works with both API keys and JWT tokens.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_api_key (String)
  • :authorization (String)

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
# File 'lib/mailsafepro/api/api_keys_api.rb', line 488

def get_usage_api_keys_usage_get_0_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.get_usage_api_keys_usage_get_0 ...'
  end
  # resource path
  local_var_path = '/api-keys/usage'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'X-API-Key'] = opts[:'x_api_key'] if !opts[:'x_api_key'].nil?
  header_params[:'authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"APIKeysApi.get_usage_api_keys_usage_get_0",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#get_usage_api_keys_usage_get_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_usage_api_keys_usage_get_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Get Usage Get current API usage statistics. Returns usage count, limits, and remaining requests for today. Works with both API keys and JWT tokens.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :x_api_key (String)
  • :authorization (String)

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
# File 'lib/mailsafepro/api/api_keys_api.rb', line 425

def get_usage_api_keys_usage_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.get_usage_api_keys_usage_get ...'
  end
  # resource path
  local_var_path = '/api-keys/usage'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  header_params[:'X-API-Key'] = opts[:'x_api_key'] if !opts[:'x_api_key'].nil?
  header_params[:'authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"APIKeysApi.get_usage_api_keys_usage_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#get_usage_api_keys_usage_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_api_keys_api_keys_get(opts = {}) ⇒ APIKeyListResponse

List Api Keys List all API keys for current user with consistent IDs. Returns comprehensive key metadata including status, scopes, and usage information. Handles corrupted key data gracefully.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



538
539
540
541
# File 'lib/mailsafepro/api/api_keys_api.rb', line 538

def list_api_keys_api_keys_get(opts = {})
  data, _status_code, _headers = list_api_keys_api_keys_get_with_http_info(opts)
  data
end

#list_api_keys_api_keys_get_0(opts = {}) ⇒ APIKeyListResponse

List Api Keys List all API keys for current user with consistent IDs. Returns comprehensive key metadata including status, scopes, and usage information. Handles corrupted key data gracefully.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



595
596
597
598
# File 'lib/mailsafepro/api/api_keys_api.rb', line 595

def list_api_keys_api_keys_get_0(opts = {})
  data, _status_code, _headers = list_api_keys_api_keys_get_0_with_http_info(opts)
  data
end

#list_api_keys_api_keys_get_0_with_http_info(opts = {}) ⇒ Array<(APIKeyListResponse, Integer, Hash)>

List Api Keys List all API keys for current user with consistent IDs. Returns comprehensive key metadata including status, scopes, and usage information. Handles corrupted key data gracefully.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(APIKeyListResponse, Integer, Hash)>)

    APIKeyListResponse data, response status code and response headers



604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
# File 'lib/mailsafepro/api/api_keys_api.rb', line 604

def list_api_keys_api_keys_get_0_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.list_api_keys_api_keys_get_0 ...'
  end
  # resource path
  local_var_path = '/api-keys'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'APIKeyListResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Bearer']

  new_options = opts.merge(
    :operation => :"APIKeysApi.list_api_keys_api_keys_get_0",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#list_api_keys_api_keys_get_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_api_keys_api_keys_get_with_http_info(opts = {}) ⇒ Array<(APIKeyListResponse, Integer, Hash)>

List Api Keys List all API keys for current user with consistent IDs. Returns comprehensive key metadata including status, scopes, and usage information. Handles corrupted key data gracefully.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(APIKeyListResponse, Integer, Hash)>)

    APIKeyListResponse data, response status code and response headers



547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
# File 'lib/mailsafepro/api/api_keys_api.rb', line 547

def list_api_keys_api_keys_get_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.list_api_keys_api_keys_get ...'
  end
  # resource path
  local_var_path = '/api-keys'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'APIKeyListResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Bearer']

  new_options = opts.merge(
    :operation => :"APIKeysApi.list_api_keys_api_keys_get",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#list_api_keys_api_keys_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#repair_user_data_endpoint_api_keys_repair_data_post(opts = {}) ⇒ Hash<String, String>

Repair User Data Endpoint Emergency data repair endpoint - ADMINISTRATORS ONLY WARNING: Critical operation; relies on admin scope verification at runtime.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Hash<String, String>)


652
653
654
655
# File 'lib/mailsafepro/api/api_keys_api.rb', line 652

def repair_user_data_endpoint_api_keys_repair_data_post(opts = {})
  data, _status_code, _headers = repair_user_data_endpoint_api_keys_repair_data_post_with_http_info(opts)
  data
end

#repair_user_data_endpoint_api_keys_repair_data_post_0(opts = {}) ⇒ Hash<String, String>

Repair User Data Endpoint Emergency data repair endpoint - ADMINISTRATORS ONLY WARNING: Critical operation; relies on admin scope verification at runtime.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Hash<String, String>)


709
710
711
712
# File 'lib/mailsafepro/api/api_keys_api.rb', line 709

def repair_user_data_endpoint_api_keys_repair_data_post_0(opts = {})
  data, _status_code, _headers = repair_user_data_endpoint_api_keys_repair_data_post_0_with_http_info(opts)
  data
end

#repair_user_data_endpoint_api_keys_repair_data_post_0_with_http_info(opts = {}) ⇒ Array<(Hash<String, String>, Integer, Hash)>

Repair User Data Endpoint Emergency data repair endpoint - ADMINISTRATORS ONLY WARNING: Critical operation; relies on admin scope verification at runtime.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Hash<String, String>, Integer, Hash)>)

    Hash<String, String> data, response status code and response headers



718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
# File 'lib/mailsafepro/api/api_keys_api.rb', line 718

def repair_user_data_endpoint_api_keys_repair_data_post_0_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.repair_user_data_endpoint_api_keys_repair_data_post_0 ...'
  end
  # resource path
  local_var_path = '/api-keys/repair-data'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, String>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Bearer']

  new_options = opts.merge(
    :operation => :"APIKeysApi.repair_user_data_endpoint_api_keys_repair_data_post_0",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#repair_user_data_endpoint_api_keys_repair_data_post_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#repair_user_data_endpoint_api_keys_repair_data_post_with_http_info(opts = {}) ⇒ Array<(Hash<String, String>, Integer, Hash)>

Repair User Data Endpoint Emergency data repair endpoint - ADMINISTRATORS ONLY WARNING: Critical operation; relies on admin scope verification at runtime.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Hash<String, String>, Integer, Hash)>)

    Hash<String, String> data, response status code and response headers



661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
# File 'lib/mailsafepro/api/api_keys_api.rb', line 661

def repair_user_data_endpoint_api_keys_repair_data_post_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.repair_user_data_endpoint_api_keys_repair_data_post ...'
  end
  # resource path
  local_var_path = '/api-keys/repair-data'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, String>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Bearer']

  new_options = opts.merge(
    :operation => :"APIKeysApi.repair_user_data_endpoint_api_keys_repair_data_post",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#repair_user_data_endpoint_api_keys_repair_data_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#revoke_api_key_api_keys_key_hash_revoke_delete(key_hash, opts = {}) ⇒ Object

Revoke Api Key Revoke an API key with atomic transaction. Immediately invalidates the key and removes it from active sets. Provides audit trail for security compliance.

Parameters:

  • key_hash (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


767
768
769
770
# File 'lib/mailsafepro/api/api_keys_api.rb', line 767

def revoke_api_key_api_keys_key_hash_revoke_delete(key_hash, opts = {})
  data, _status_code, _headers = revoke_api_key_api_keys_key_hash_revoke_delete_with_http_info(key_hash, opts)
  data
end

#revoke_api_key_api_keys_key_hash_revoke_delete_0(key_hash, opts = {}) ⇒ Object

Revoke Api Key Revoke an API key with atomic transaction. Immediately invalidates the key and removes it from active sets. Provides audit trail for security compliance.

Parameters:

  • key_hash (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


835
836
837
838
# File 'lib/mailsafepro/api/api_keys_api.rb', line 835

def revoke_api_key_api_keys_key_hash_revoke_delete_0(key_hash, opts = {})
  data, _status_code, _headers = revoke_api_key_api_keys_key_hash_revoke_delete_0_with_http_info(key_hash, opts)
  data
end

#revoke_api_key_api_keys_key_hash_revoke_delete_0_with_http_info(key_hash, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Revoke Api Key Revoke an API key with atomic transaction. Immediately invalidates the key and removes it from active sets. Provides audit trail for security compliance.

Parameters:

  • key_hash (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
# File 'lib/mailsafepro/api/api_keys_api.rb', line 845

def revoke_api_key_api_keys_key_hash_revoke_delete_0_with_http_info(key_hash, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.revoke_api_key_api_keys_key_hash_revoke_delete_0 ...'
  end
  # verify the required parameter 'key_hash' is set
  if @api_client.config.client_side_validation && key_hash.nil?
    fail ArgumentError, "Missing the required parameter 'key_hash' when calling APIKeysApi.revoke_api_key_api_keys_key_hash_revoke_delete_0"
  end
  pattern = Regexp.new(/^[a-f0-9]{64}$/)
  if @api_client.config.client_side_validation && key_hash !~ pattern
    fail ArgumentError, "invalid value for 'key_hash' when calling APIKeysApi.revoke_api_key_api_keys_key_hash_revoke_delete_0, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/api-keys/{key_hash}/revoke'.sub('{' + 'key_hash' + '}', CGI.escape(key_hash.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Bearer']

  new_options = opts.merge(
    :operation => :"APIKeysApi.revoke_api_key_api_keys_key_hash_revoke_delete_0",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#revoke_api_key_api_keys_key_hash_revoke_delete_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#revoke_api_key_api_keys_key_hash_revoke_delete_with_http_info(key_hash, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Revoke Api Key Revoke an API key with atomic transaction. Immediately invalidates the key and removes it from active sets. Provides audit trail for security compliance.

Parameters:

  • key_hash (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
# File 'lib/mailsafepro/api/api_keys_api.rb', line 777

def revoke_api_key_api_keys_key_hash_revoke_delete_with_http_info(key_hash, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.revoke_api_key_api_keys_key_hash_revoke_delete ...'
  end
  # verify the required parameter 'key_hash' is set
  if @api_client.config.client_side_validation && key_hash.nil?
    fail ArgumentError, "Missing the required parameter 'key_hash' when calling APIKeysApi.revoke_api_key_api_keys_key_hash_revoke_delete"
  end
  pattern = Regexp.new(/^[a-f0-9]{64}$/)
  if @api_client.config.client_side_validation && key_hash !~ pattern
    fail ArgumentError, "invalid value for 'key_hash' when calling APIKeysApi.revoke_api_key_api_keys_key_hash_revoke_delete, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/api-keys/{key_hash}/revoke'.sub('{' + 'key_hash' + '}', CGI.escape(key_hash.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Bearer']

  new_options = opts.merge(
    :operation => :"APIKeysApi.revoke_api_key_api_keys_key_hash_revoke_delete",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#revoke_api_key_api_keys_key_hash_revoke_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#rotate_api_key_api_keys_key_hash_rotate_post(key_hash, opts = {}) ⇒ Object

Rotate Api Key Rotate API key with grace period. Generates a new key while keeping the old one active for 7 days to allow for smooth transition in client applications.

Parameters:

  • key_hash (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


903
904
905
906
# File 'lib/mailsafepro/api/api_keys_api.rb', line 903

def rotate_api_key_api_keys_key_hash_rotate_post(key_hash, opts = {})
  data, _status_code, _headers = rotate_api_key_api_keys_key_hash_rotate_post_with_http_info(key_hash, opts)
  data
end

#rotate_api_key_api_keys_key_hash_rotate_post_0(key_hash, opts = {}) ⇒ Object

Rotate Api Key Rotate API key with grace period. Generates a new key while keeping the old one active for 7 days to allow for smooth transition in client applications.

Parameters:

  • key_hash (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


971
972
973
974
# File 'lib/mailsafepro/api/api_keys_api.rb', line 971

def rotate_api_key_api_keys_key_hash_rotate_post_0(key_hash, opts = {})
  data, _status_code, _headers = rotate_api_key_api_keys_key_hash_rotate_post_0_with_http_info(key_hash, opts)
  data
end

#rotate_api_key_api_keys_key_hash_rotate_post_0_with_http_info(key_hash, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Rotate Api Key Rotate API key with grace period. Generates a new key while keeping the old one active for 7 days to allow for smooth transition in client applications.

Parameters:

  • key_hash (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
# File 'lib/mailsafepro/api/api_keys_api.rb', line 981

def rotate_api_key_api_keys_key_hash_rotate_post_0_with_http_info(key_hash, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.rotate_api_key_api_keys_key_hash_rotate_post_0 ...'
  end
  # verify the required parameter 'key_hash' is set
  if @api_client.config.client_side_validation && key_hash.nil?
    fail ArgumentError, "Missing the required parameter 'key_hash' when calling APIKeysApi.rotate_api_key_api_keys_key_hash_rotate_post_0"
  end
  pattern = Regexp.new(/^[a-f0-9]{64}$/)
  if @api_client.config.client_side_validation && key_hash !~ pattern
    fail ArgumentError, "invalid value for 'key_hash' when calling APIKeysApi.rotate_api_key_api_keys_key_hash_rotate_post_0, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/api-keys/{key_hash}/rotate'.sub('{' + 'key_hash' + '}', CGI.escape(key_hash.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Bearer']

  new_options = opts.merge(
    :operation => :"APIKeysApi.rotate_api_key_api_keys_key_hash_rotate_post_0",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#rotate_api_key_api_keys_key_hash_rotate_post_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#rotate_api_key_api_keys_key_hash_rotate_post_with_http_info(key_hash, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Rotate Api Key Rotate API key with grace period. Generates a new key while keeping the old one active for 7 days to allow for smooth transition in client applications.

Parameters:

  • key_hash (String)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
# File 'lib/mailsafepro/api/api_keys_api.rb', line 913

def rotate_api_key_api_keys_key_hash_rotate_post_with_http_info(key_hash, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.rotate_api_key_api_keys_key_hash_rotate_post ...'
  end
  # verify the required parameter 'key_hash' is set
  if @api_client.config.client_side_validation && key_hash.nil?
    fail ArgumentError, "Missing the required parameter 'key_hash' when calling APIKeysApi.rotate_api_key_api_keys_key_hash_rotate_post"
  end
  pattern = Regexp.new(/^[a-f0-9]{64}$/)
  if @api_client.config.client_side_validation && key_hash !~ pattern
    fail ArgumentError, "invalid value for 'key_hash' when calling APIKeysApi.rotate_api_key_api_keys_key_hash_rotate_post, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/api-keys/{key_hash}/rotate'.sub('{' + 'key_hash' + '}', CGI.escape(key_hash.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Bearer']

  new_options = opts.merge(
    :operation => :"APIKeysApi.rotate_api_key_api_keys_key_hash_rotate_post",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#rotate_api_key_api_keys_key_hash_rotate_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#sync_plan_keys_api_keys_sync_plan_keys_post(opts = {}) ⇒ Object

Sync Plan Keys Synchronize current plan with all user API keys. Ensures all existing keys have the correct scopes and permissions based on the user’s current subscription plan.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


1038
1039
1040
1041
# File 'lib/mailsafepro/api/api_keys_api.rb', line 1038

def sync_plan_keys_api_keys_sync_plan_keys_post(opts = {})
  data, _status_code, _headers = sync_plan_keys_api_keys_sync_plan_keys_post_with_http_info(opts)
  data
end

#sync_plan_keys_api_keys_sync_plan_keys_post_0(opts = {}) ⇒ Object

Sync Plan Keys Synchronize current plan with all user API keys. Ensures all existing keys have the correct scopes and permissions based on the user’s current subscription plan.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Object)


1095
1096
1097
1098
# File 'lib/mailsafepro/api/api_keys_api.rb', line 1095

def sync_plan_keys_api_keys_sync_plan_keys_post_0(opts = {})
  data, _status_code, _headers = sync_plan_keys_api_keys_sync_plan_keys_post_0_with_http_info(opts)
  data
end

#sync_plan_keys_api_keys_sync_plan_keys_post_0_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Sync Plan Keys Synchronize current plan with all user API keys. Ensures all existing keys have the correct scopes and permissions based on the user&#39;s current subscription plan.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
# File 'lib/mailsafepro/api/api_keys_api.rb', line 1104

def sync_plan_keys_api_keys_sync_plan_keys_post_0_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.sync_plan_keys_api_keys_sync_plan_keys_post_0 ...'
  end
  # resource path
  local_var_path = '/api-keys/sync-plan-keys'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Bearer']

  new_options = opts.merge(
    :operation => :"APIKeysApi.sync_plan_keys_api_keys_sync_plan_keys_post_0",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#sync_plan_keys_api_keys_sync_plan_keys_post_0\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#sync_plan_keys_api_keys_sync_plan_keys_post_with_http_info(opts = {}) ⇒ Array<(Object, Integer, Hash)>

Sync Plan Keys Synchronize current plan with all user API keys. Ensures all existing keys have the correct scopes and permissions based on the user&#39;s current subscription plan.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
# File 'lib/mailsafepro/api/api_keys_api.rb', line 1047

def sync_plan_keys_api_keys_sync_plan_keys_post_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: APIKeysApi.sync_plan_keys_api_keys_sync_plan_keys_post ...'
  end
  # resource path
  local_var_path = '/api-keys/sync-plan-keys'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Bearer']

  new_options = opts.merge(
    :operation => :"APIKeysApi.sync_plan_keys_api_keys_sync_plan_keys_post",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: APIKeysApi#sync_plan_keys_api_keys_sync_plan_keys_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end