Class: IonoscloudContainerRegistry::TokensApi

Inherits:
Object
  • Object
show all
Defined in:
lib/ionoscloud-container-registry/api/tokens_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ TokensApi

Returns a new instance of TokensApi.



19
20
21
# File 'lib/ionoscloud-container-registry/api/tokens_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/ionoscloud-container-registry/api/tokens_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#registries_tokens_delete(registry_id, token_id, opts = {}) ⇒ nil

Delete token

Parameters:

  • registry_id (String)

    The unique ID of the registry

  • token_id (String)

    The unique ID of the token

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

    the optional parameters

Returns:

  • (nil)


27
28
29
30
# File 'lib/ionoscloud-container-registry/api/tokens_api.rb', line 27

def registries_tokens_delete(registry_id, token_id, opts = {})
  registries_tokens_delete_with_http_info(registry_id, token_id, opts)
  nil
end

#registries_tokens_delete_with_http_info(registry_id, token_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete token

Parameters:

  • registry_id (String)

    The unique ID of the registry

  • token_id (String)

    The unique ID of the token

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

    the optional parameters

Returns:

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

    nil, 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
89
90
91
92
93
94
95
96
97
# File 'lib/ionoscloud-container-registry/api/tokens_api.rb', line 37

def registries_tokens_delete_with_http_info(registry_id, token_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TokensApi.registries_tokens_delete ...'
  end
  # verify the required parameter 'registry_id' is set
  if @api_client.config.client_side_validation && registry_id.nil?
    fail ArgumentError, "Missing the required parameter 'registry_id' when calling TokensApi.registries_tokens_delete"
  end
  pattern = Regexp.new(/^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$/)
  if @api_client.config.client_side_validation && registry_id !~ pattern
    fail ArgumentError, "invalid value for 'registry_id' when calling TokensApi.registries_tokens_delete, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'token_id' is set
  if @api_client.config.client_side_validation && token_id.nil?
    fail ArgumentError, "Missing the required parameter 'token_id' when calling TokensApi.registries_tokens_delete"
  end
  pattern = Regexp.new(/^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$/)
  if @api_client.config.client_side_validation && token_id !~ pattern
    fail ArgumentError, "invalid value for 'token_id' when calling TokensApi.registries_tokens_delete, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/registries/{registryId}/tokens/{tokenId}'.sub('{' + 'registryId' + '}', CGI.escape(registry_id.to_s)).sub('{' + 'tokenId' + '}', CGI.escape(token_id.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'])

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

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

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']

  new_options = opts.merge(
    :operation => :"TokensApi.registries_tokens_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: TokensApi#registries_tokens_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#registries_tokens_find_by_id(registry_id, token_id, opts = {}) ⇒ TokenResponse

Get token information Gets all information for a specific token used to access a container registry

Parameters:

  • registry_id (String)

    The unique ID of the registry

  • token_id (String)

    The unique ID of the token

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

    the optional parameters

Returns:



105
106
107
108
# File 'lib/ionoscloud-container-registry/api/tokens_api.rb', line 105

def registries_tokens_find_by_id(registry_id, token_id, opts = {})
  data, _status_code, _headers = registries_tokens_find_by_id_with_http_info(registry_id, token_id, opts)
  data
end

#registries_tokens_find_by_id_with_http_info(registry_id, token_id, opts = {}) ⇒ Array<(TokenResponse, Integer, Hash)>

Get token information Gets all information for a specific token used to access a container registry

Parameters:

  • registry_id (String)

    The unique ID of the registry

  • token_id (String)

    The unique ID of the token

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

    the optional parameters

Returns:

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

    TokenResponse data, response status code and response headers



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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/ionoscloud-container-registry/api/tokens_api.rb', line 116

def registries_tokens_find_by_id_with_http_info(registry_id, token_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TokensApi.registries_tokens_find_by_id ...'
  end
  # verify the required parameter 'registry_id' is set
  if @api_client.config.client_side_validation && registry_id.nil?
    fail ArgumentError, "Missing the required parameter 'registry_id' when calling TokensApi.registries_tokens_find_by_id"
  end
  pattern = Regexp.new(/^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$/)
  if @api_client.config.client_side_validation && registry_id !~ pattern
    fail ArgumentError, "invalid value for 'registry_id' when calling TokensApi.registries_tokens_find_by_id, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'token_id' is set
  if @api_client.config.client_side_validation && token_id.nil?
    fail ArgumentError, "Missing the required parameter 'token_id' when calling TokensApi.registries_tokens_find_by_id"
  end
  pattern = Regexp.new(/^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$/)
  if @api_client.config.client_side_validation && token_id !~ pattern
    fail ArgumentError, "invalid value for 'token_id' when calling TokensApi.registries_tokens_find_by_id, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/registries/{registryId}/tokens/{tokenId}'.sub('{' + 'registryId' + '}', CGI.escape(registry_id.to_s)).sub('{' + 'tokenId' + '}', CGI.escape(token_id.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'])

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']

  new_options = opts.merge(
    :operation => :"TokensApi.registries_tokens_find_by_id",
    :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: TokensApi#registries_tokens_find_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#registries_tokens_get(registry_id, opts = {}) ⇒ TokensResponse

List all tokens for the container registry

Parameters:

  • registry_id (String)

    The unique ID of the registry

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

    the optional parameters

Options Hash (opts):

  • :offset (String)

    The first element (from the complete list of the elements) to include in the response (used together with limit for pagination) (default to ‘0’)

  • :limit (String)

    The maximum number of elements to return (used together with offset for pagination) (default to ‘100’)

Returns:



184
185
186
187
# File 'lib/ionoscloud-container-registry/api/tokens_api.rb', line 184

def registries_tokens_get(registry_id, opts = {})
  data, _status_code, _headers = registries_tokens_get_with_http_info(registry_id, opts)
  data
end

#registries_tokens_get_with_http_info(registry_id, opts = {}) ⇒ Array<(TokensResponse, Integer, Hash)>

List all tokens for the container registry

Parameters:

  • registry_id (String)

    The unique ID of the registry

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

    the optional parameters

Options Hash (opts):

  • :offset (String)

    The first element (from the complete list of the elements) to include in the response (used together with limit for pagination)

  • :limit (String)

    The maximum number of elements to return (used together with offset for pagination)

Returns:

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

    TokensResponse data, response status code and response headers



195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# File 'lib/ionoscloud-container-registry/api/tokens_api.rb', line 195

def registries_tokens_get_with_http_info(registry_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TokensApi.registries_tokens_get ...'
  end
  # verify the required parameter 'registry_id' is set
  if @api_client.config.client_side_validation && registry_id.nil?
    fail ArgumentError, "Missing the required parameter 'registry_id' when calling TokensApi.registries_tokens_get"
  end
  pattern = Regexp.new(/^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$/)
  if @api_client.config.client_side_validation && registry_id !~ pattern
    fail ArgumentError, "invalid value for 'registry_id' when calling TokensApi.registries_tokens_get, must conform to the pattern #{pattern}."
  end

  # resource path
  local_var_path = '/registries/{registryId}/tokens'.sub('{' + 'registryId' + '}', CGI.escape(registry_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?

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

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']

  new_options = opts.merge(
    :operation => :"TokensApi.registries_tokens_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: TokensApi#registries_tokens_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#registries_tokens_patch(registry_id, token_id, patch_token_input, opts = {}) ⇒ TokenResponse

Update token Update token properties, for example: - change status to ‘enabled’ or ‘disabled’ - change expiry date

Parameters:

  • registry_id (String)

    The unique ID of the registry

  • token_id (String)

    The unique ID of the token

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

    the optional parameters

Returns:



257
258
259
260
# File 'lib/ionoscloud-container-registry/api/tokens_api.rb', line 257

def registries_tokens_patch(registry_id, token_id, patch_token_input, opts = {})
  data, _status_code, _headers = registries_tokens_patch_with_http_info(registry_id, token_id, patch_token_input, opts)
  data
end

#registries_tokens_patch_with_http_info(registry_id, token_id, patch_token_input, opts = {}) ⇒ Array<(TokenResponse, Integer, Hash)>

Update token Update token properties, for example: - change status to &#39;enabled&#39; or &#39;disabled&#39; - change expiry date

Parameters:

  • registry_id (String)

    The unique ID of the registry

  • token_id (String)

    The unique ID of the token

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

    the optional parameters

Returns:

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

    TokenResponse data, response status code and response headers



269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
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
# File 'lib/ionoscloud-container-registry/api/tokens_api.rb', line 269

def registries_tokens_patch_with_http_info(registry_id, token_id, patch_token_input, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TokensApi.registries_tokens_patch ...'
  end
  # verify the required parameter 'registry_id' is set
  if @api_client.config.client_side_validation && registry_id.nil?
    fail ArgumentError, "Missing the required parameter 'registry_id' when calling TokensApi.registries_tokens_patch"
  end
  pattern = Regexp.new(/^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$/)
  if @api_client.config.client_side_validation && registry_id !~ pattern
    fail ArgumentError, "invalid value for 'registry_id' when calling TokensApi.registries_tokens_patch, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'token_id' is set
  if @api_client.config.client_side_validation && token_id.nil?
    fail ArgumentError, "Missing the required parameter 'token_id' when calling TokensApi.registries_tokens_patch"
  end
  pattern = Regexp.new(/^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$/)
  if @api_client.config.client_side_validation && token_id !~ pattern
    fail ArgumentError, "invalid value for 'token_id' when calling TokensApi.registries_tokens_patch, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'patch_token_input' is set
  if @api_client.config.client_side_validation && patch_token_input.nil?
    fail ArgumentError, "Missing the required parameter 'patch_token_input' when calling TokensApi.registries_tokens_patch"
  end
  # resource path
  local_var_path = '/registries/{registryId}/tokens/{tokenId}'.sub('{' + 'registryId' + '}', CGI.escape(registry_id.to_s)).sub('{' + 'tokenId' + '}', CGI.escape(token_id.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'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']

  new_options = opts.merge(
    :operation => :"TokensApi.registries_tokens_patch",
    :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(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TokensApi#registries_tokens_patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#registries_tokens_post(registry_id, post_token_input, opts = {}) ⇒ PostTokenOutput

Create token Create a token - password is only available once in the POST response

Parameters:

  • registry_id (String)

    The unique ID of the registry

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

    the optional parameters

Returns:



343
344
345
346
# File 'lib/ionoscloud-container-registry/api/tokens_api.rb', line 343

def registries_tokens_post(registry_id, post_token_input, opts = {})
  data, _status_code, _headers = registries_tokens_post_with_http_info(registry_id, post_token_input, opts)
  data
end

#registries_tokens_post_with_http_info(registry_id, post_token_input, opts = {}) ⇒ Array<(PostTokenOutput, Integer, Hash)>

Create token Create a token - password is only available once in the POST response

Parameters:

  • registry_id (String)

    The unique ID of the registry

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

    the optional parameters

Returns:

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

    PostTokenOutput data, response status code and response headers



354
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
407
408
409
410
411
# File 'lib/ionoscloud-container-registry/api/tokens_api.rb', line 354

def registries_tokens_post_with_http_info(registry_id, post_token_input, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TokensApi.registries_tokens_post ...'
  end
  # verify the required parameter 'registry_id' is set
  if @api_client.config.client_side_validation && registry_id.nil?
    fail ArgumentError, "Missing the required parameter 'registry_id' when calling TokensApi.registries_tokens_post"
  end
  pattern = Regexp.new(/^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$/)
  if @api_client.config.client_side_validation && registry_id !~ pattern
    fail ArgumentError, "invalid value for 'registry_id' when calling TokensApi.registries_tokens_post, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'post_token_input' is set
  if @api_client.config.client_side_validation && post_token_input.nil?
    fail ArgumentError, "Missing the required parameter 'post_token_input' when calling TokensApi.registries_tokens_post"
  end
  # resource path
  local_var_path = '/registries/{registryId}/tokens'.sub('{' + 'registryId' + '}', CGI.escape(registry_id.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'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']

  new_options = opts.merge(
    :operation => :"TokensApi.registries_tokens_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: TokensApi#registries_tokens_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#registries_tokens_put(registry_id, token_id, put_token_input, opts = {}) ⇒ PutTokenOutput

Create or replace token Create/replace a token - password is only available once in the create response - "name" cannot be changed

Parameters:

  • registry_id (String)

    The unique ID of the registry

  • token_id (String)

    The unique ID of the token

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

    the optional parameters

Returns:



420
421
422
423
# File 'lib/ionoscloud-container-registry/api/tokens_api.rb', line 420

def registries_tokens_put(registry_id, token_id, put_token_input, opts = {})
  data, _status_code, _headers = registries_tokens_put_with_http_info(registry_id, token_id, put_token_input, opts)
  data
end

#registries_tokens_put_with_http_info(registry_id, token_id, put_token_input, opts = {}) ⇒ Array<(PutTokenOutput, Integer, Hash)>

Create or replace token Create/replace a token - password is only available once in the create response - &quot;name&quot; cannot be changed

Parameters:

  • registry_id (String)

    The unique ID of the registry

  • token_id (String)

    The unique ID of the token

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

    the optional parameters

Returns:

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

    PutTokenOutput data, response status code and response headers



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
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
# File 'lib/ionoscloud-container-registry/api/tokens_api.rb', line 432

def registries_tokens_put_with_http_info(registry_id, token_id, put_token_input, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TokensApi.registries_tokens_put ...'
  end
  # verify the required parameter 'registry_id' is set
  if @api_client.config.client_side_validation && registry_id.nil?
    fail ArgumentError, "Missing the required parameter 'registry_id' when calling TokensApi.registries_tokens_put"
  end
  pattern = Regexp.new(/^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$/)
  if @api_client.config.client_side_validation && registry_id !~ pattern
    fail ArgumentError, "invalid value for 'registry_id' when calling TokensApi.registries_tokens_put, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'token_id' is set
  if @api_client.config.client_side_validation && token_id.nil?
    fail ArgumentError, "Missing the required parameter 'token_id' when calling TokensApi.registries_tokens_put"
  end
  pattern = Regexp.new(/^[0-9a-fA-F]{8}-([0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}$/)
  if @api_client.config.client_side_validation && token_id !~ pattern
    fail ArgumentError, "invalid value for 'token_id' when calling TokensApi.registries_tokens_put, must conform to the pattern #{pattern}."
  end

  # verify the required parameter 'put_token_input' is set
  if @api_client.config.client_side_validation && put_token_input.nil?
    fail ArgumentError, "Missing the required parameter 'put_token_input' when calling TokensApi.registries_tokens_put"
  end
  # resource path
  local_var_path = '/registries/{registryId}/tokens/{tokenId}'.sub('{' + 'registryId' + '}', CGI.escape(registry_id.to_s)).sub('{' + 'tokenId' + '}', CGI.escape(token_id.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'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

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

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

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

  # auth_names
  auth_names = opts[:debug_auth_names] || ['basicAuth', 'tokenAuth']

  new_options = opts.merge(
    :operation => :"TokensApi.registries_tokens_put",
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TokensApi#registries_tokens_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end