Class: Spatio::PersonalAccessTokensApi
- Inherits:
-
Object
- Object
- Spatio::PersonalAccessTokensApi
- Defined in:
- lib/spatio-sdk/api/personal_access_tokens_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_personal_access_token(create_pat_request, opts = {}) ⇒ CreatePATResponse
Create a new PAT.
-
#create_personal_access_token_with_http_info(create_pat_request, opts = {}) ⇒ Array<(CreatePATResponse, Integer, Hash)>
Create a new PAT.
-
#initialize(api_client = ApiClient.default) ⇒ PersonalAccessTokensApi
constructor
A new instance of PersonalAccessTokensApi.
-
#list_available_pat_scopes(opts = {}) ⇒ PATScopesResponse
List the scope strings PATs can be issued with.
-
#list_available_pat_scopes_with_http_info(opts = {}) ⇒ Array<(PATScopesResponse, Integer, Hash)>
List the scope strings PATs can be issued with.
-
#list_personal_access_tokens(opts = {}) ⇒ PATListResponse
List the caller’s personal access tokens (with available scopes).
-
#list_personal_access_tokens_with_http_info(opts = {}) ⇒ Array<(PATListResponse, Integer, Hash)>
List the caller's personal access tokens (with available scopes).
-
#revoke_personal_access_token(id, opts = {}) ⇒ nil
Revoke a PAT.
-
#revoke_personal_access_token_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Revoke a PAT.
-
#update_personal_access_token(id, update_pat_request, opts = {}) ⇒ PersonalAccessToken
Rename or re-describe a PAT (scopes are immutable).
-
#update_personal_access_token_with_http_info(id, update_pat_request, opts = {}) ⇒ Array<(PersonalAccessToken, Integer, Hash)>
Rename or re-describe a PAT (scopes are immutable).
- #workspace_create_pat(org, workspace, request_body, opts = {}) ⇒ Hash<String, Object>
-
#workspace_create_pat_with_http_info(org, workspace, request_body, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Hash<String, Object> data, response status code and response headers.
- #workspace_list_pats(org, workspace, opts = {}) ⇒ Hash<String, Object>
-
#workspace_list_pats_with_http_info(org, workspace, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Hash<String, Object> data, response status code and response headers.
- #workspace_revoke_pat(org, workspace, id, opts = {}) ⇒ nil
-
#workspace_revoke_pat_with_http_info(org, workspace, id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Nil, response status code and response headers.
- #workspace_update_pat(org, workspace, id, request_body, opts = {}) ⇒ Hash<String, Object>
-
#workspace_update_pat_with_http_info(org, workspace, id, request_body, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Hash<String, Object> data, response status code and response headers.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ PersonalAccessTokensApi
Returns a new instance of PersonalAccessTokensApi.
19 20 21 |
# File 'lib/spatio-sdk/api/personal_access_tokens_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/spatio-sdk/api/personal_access_tokens_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#create_personal_access_token(create_pat_request, opts = {}) ⇒ CreatePATResponse
Create a new PAT. The full token is returned only once on creation; the API never reveals the secret again.
26 27 28 29 |
# File 'lib/spatio-sdk/api/personal_access_tokens_api.rb', line 26 def create_personal_access_token(create_pat_request, opts = {}) data, _status_code, _headers = create_personal_access_token_with_http_info(create_pat_request, opts) data end |
#create_personal_access_token_with_http_info(create_pat_request, opts = {}) ⇒ Array<(CreatePATResponse, Integer, Hash)>
Create a new PAT. The full token is returned only once on creation; the API never reveals the secret again.
35 36 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 |
# File 'lib/spatio-sdk/api/personal_access_tokens_api.rb', line 35 def create_personal_access_token_with_http_info(create_pat_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PersonalAccessTokensApi.create_personal_access_token ...' end # verify the required parameter 'create_pat_request' is set if @api_client.config.client_side_validation && create_pat_request.nil? fail ArgumentError, "Missing the required parameter 'create_pat_request' when calling PersonalAccessTokensApi.create_personal_access_token" end # resource path local_var_path = '/v1/tokens' # 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(create_pat_request) # return_type return_type = opts[:debug_return_type] || 'CreatePATResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PersonalAccessTokensApi.create_personal_access_token", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PersonalAccessTokensApi#create_personal_access_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_available_pat_scopes(opts = {}) ⇒ PATScopesResponse
List the scope strings PATs can be issued with.
91 92 93 94 |
# File 'lib/spatio-sdk/api/personal_access_tokens_api.rb', line 91 def list_available_pat_scopes(opts = {}) data, _status_code, _headers = list_available_pat_scopes_with_http_info(opts) data end |
#list_available_pat_scopes_with_http_info(opts = {}) ⇒ Array<(PATScopesResponse, Integer, Hash)>
List the scope strings PATs can be issued with.
99 100 101 102 103 104 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 |
# File 'lib/spatio-sdk/api/personal_access_tokens_api.rb', line 99 def list_available_pat_scopes_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PersonalAccessTokensApi.list_available_pat_scopes ...' end # resource path local_var_path = '/v1/tokens/scopes' # 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] || 'PATScopesResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PersonalAccessTokensApi.list_available_pat_scopes", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PersonalAccessTokensApi#list_available_pat_scopes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_personal_access_tokens(opts = {}) ⇒ PATListResponse
List the caller’s personal access tokens (with available scopes).
146 147 148 149 |
# File 'lib/spatio-sdk/api/personal_access_tokens_api.rb', line 146 def list_personal_access_tokens(opts = {}) data, _status_code, _headers = list_personal_access_tokens_with_http_info(opts) data end |
#list_personal_access_tokens_with_http_info(opts = {}) ⇒ Array<(PATListResponse, Integer, Hash)>
List the caller's personal access tokens (with available scopes).
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 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 |
# File 'lib/spatio-sdk/api/personal_access_tokens_api.rb', line 154 def list_personal_access_tokens_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PersonalAccessTokensApi.list_personal_access_tokens ...' end # resource path local_var_path = '/v1/tokens' # 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] || 'PATListResponse' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PersonalAccessTokensApi.list_personal_access_tokens", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PersonalAccessTokensApi#list_personal_access_tokens\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#revoke_personal_access_token(id, opts = {}) ⇒ nil
Revoke a PAT.
202 203 204 205 |
# File 'lib/spatio-sdk/api/personal_access_tokens_api.rb', line 202 def revoke_personal_access_token(id, opts = {}) revoke_personal_access_token_with_http_info(id, opts) nil end |
#revoke_personal_access_token_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Revoke a PAT.
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 249 250 251 252 253 254 255 256 257 |
# File 'lib/spatio-sdk/api/personal_access_tokens_api.rb', line 211 def revoke_personal_access_token_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PersonalAccessTokensApi.revoke_personal_access_token ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling PersonalAccessTokensApi.revoke_personal_access_token" end # resource path local_var_path = '/v1/tokens/{id}'.sub('{id}', CGI.escape(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']) 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] # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PersonalAccessTokensApi.revoke_personal_access_token", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PersonalAccessTokensApi#revoke_personal_access_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_personal_access_token(id, update_pat_request, opts = {}) ⇒ PersonalAccessToken
Rename or re-describe a PAT (scopes are immutable).
264 265 266 267 |
# File 'lib/spatio-sdk/api/personal_access_tokens_api.rb', line 264 def update_personal_access_token(id, update_pat_request, opts = {}) data, _status_code, _headers = update_personal_access_token_with_http_info(id, update_pat_request, opts) data end |
#update_personal_access_token_with_http_info(id, update_pat_request, opts = {}) ⇒ Array<(PersonalAccessToken, Integer, Hash)>
Rename or re-describe a PAT (scopes are immutable).
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 |
# File 'lib/spatio-sdk/api/personal_access_tokens_api.rb', line 274 def update_personal_access_token_with_http_info(id, update_pat_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PersonalAccessTokensApi.update_personal_access_token ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling PersonalAccessTokensApi.update_personal_access_token" end # verify the required parameter 'update_pat_request' is set if @api_client.config.client_side_validation && update_pat_request.nil? fail ArgumentError, "Missing the required parameter 'update_pat_request' when calling PersonalAccessTokensApi.update_personal_access_token" end # resource path local_var_path = '/v1/tokens/{id}'.sub('{id}', CGI.escape(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']) 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(update_pat_request) # return_type return_type = opts[:debug_return_type] || 'PersonalAccessToken' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PersonalAccessTokensApi.update_personal_access_token", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PersonalAccessTokensApi#update_personal_access_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#workspace_create_pat(org, workspace, request_body, opts = {}) ⇒ Hash<String, Object>
336 337 338 339 |
# File 'lib/spatio-sdk/api/personal_access_tokens_api.rb', line 336 def workspace_create_pat(org, workspace, request_body, opts = {}) data, _status_code, _headers = workspace_create_pat_with_http_info(org, workspace, request_body, opts) data end |
#workspace_create_pat_with_http_info(org, workspace, request_body, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Returns Hash<String, Object> data, response status code and response headers.
346 347 348 349 350 351 352 353 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 |
# File 'lib/spatio-sdk/api/personal_access_tokens_api.rb', line 346 def workspace_create_pat_with_http_info(org, workspace, request_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PersonalAccessTokensApi.workspace_create_pat ...' end # verify the required parameter 'org' is set if @api_client.config.client_side_validation && org.nil? fail ArgumentError, "Missing the required parameter 'org' when calling PersonalAccessTokensApi.workspace_create_pat" end # verify the required parameter 'workspace' is set if @api_client.config.client_side_validation && workspace.nil? fail ArgumentError, "Missing the required parameter 'workspace' when calling PersonalAccessTokensApi.workspace_create_pat" end # verify the required parameter 'request_body' is set if @api_client.config.client_side_validation && request_body.nil? fail ArgumentError, "Missing the required parameter 'request_body' when calling PersonalAccessTokensApi.workspace_create_pat" end # resource path local_var_path = '/v1/organizations/{org}/workspaces/{workspace}/tokens'.sub('{org}', CGI.escape(org.to_s)).sub('{workspace}', CGI.escape(workspace.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'] # 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(request_body) # return_type return_type = opts[:debug_return_type] || 'Hash<String, Object>' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PersonalAccessTokensApi.workspace_create_pat", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PersonalAccessTokensApi#workspace_create_pat\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#workspace_list_pats(org, workspace, opts = {}) ⇒ Hash<String, Object>
411 412 413 414 |
# File 'lib/spatio-sdk/api/personal_access_tokens_api.rb', line 411 def workspace_list_pats(org, workspace, opts = {}) data, _status_code, _headers = workspace_list_pats_with_http_info(org, workspace, opts) data end |
#workspace_list_pats_with_http_info(org, workspace, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Returns Hash<String, Object> data, response status code and response headers.
420 421 422 423 424 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 470 |
# File 'lib/spatio-sdk/api/personal_access_tokens_api.rb', line 420 def workspace_list_pats_with_http_info(org, workspace, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PersonalAccessTokensApi.workspace_list_pats ...' end # verify the required parameter 'org' is set if @api_client.config.client_side_validation && org.nil? fail ArgumentError, "Missing the required parameter 'org' when calling PersonalAccessTokensApi.workspace_list_pats" end # verify the required parameter 'workspace' is set if @api_client.config.client_side_validation && workspace.nil? fail ArgumentError, "Missing the required parameter 'workspace' when calling PersonalAccessTokensApi.workspace_list_pats" end # resource path local_var_path = '/v1/organizations/{org}/workspaces/{workspace}/tokens'.sub('{org}', CGI.escape(org.to_s)).sub('{workspace}', CGI.escape(workspace.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] || 'Hash<String, Object>' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PersonalAccessTokensApi.workspace_list_pats", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PersonalAccessTokensApi#workspace_list_pats\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#workspace_revoke_pat(org, workspace, id, opts = {}) ⇒ nil
477 478 479 480 |
# File 'lib/spatio-sdk/api/personal_access_tokens_api.rb', line 477 def workspace_revoke_pat(org, workspace, id, opts = {}) workspace_revoke_pat_with_http_info(org, workspace, id, opts) nil end |
#workspace_revoke_pat_with_http_info(org, workspace, id, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Returns nil, response status code and response headers.
487 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 533 534 535 536 537 538 539 540 541 |
# File 'lib/spatio-sdk/api/personal_access_tokens_api.rb', line 487 def workspace_revoke_pat_with_http_info(org, workspace, id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PersonalAccessTokensApi.workspace_revoke_pat ...' end # verify the required parameter 'org' is set if @api_client.config.client_side_validation && org.nil? fail ArgumentError, "Missing the required parameter 'org' when calling PersonalAccessTokensApi.workspace_revoke_pat" end # verify the required parameter 'workspace' is set if @api_client.config.client_side_validation && workspace.nil? fail ArgumentError, "Missing the required parameter 'workspace' when calling PersonalAccessTokensApi.workspace_revoke_pat" end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling PersonalAccessTokensApi.workspace_revoke_pat" end # resource path local_var_path = '/v1/organizations/{org}/workspaces/{workspace}/tokens/{id}'.sub('{org}', CGI.escape(org.to_s)).sub('{workspace}', CGI.escape(workspace.to_s)).sub('{id}', CGI.escape(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']) 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] # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PersonalAccessTokensApi.workspace_revoke_pat", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PersonalAccessTokensApi#workspace_revoke_pat\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#workspace_update_pat(org, workspace, id, request_body, opts = {}) ⇒ Hash<String, Object>
549 550 551 552 |
# File 'lib/spatio-sdk/api/personal_access_tokens_api.rb', line 549 def workspace_update_pat(org, workspace, id, request_body, opts = {}) data, _status_code, _headers = workspace_update_pat_with_http_info(org, workspace, id, request_body, opts) data end |
#workspace_update_pat_with_http_info(org, workspace, id, request_body, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Returns Hash<String, Object> data, response status code and response headers.
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 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 |
# File 'lib/spatio-sdk/api/personal_access_tokens_api.rb', line 560 def workspace_update_pat_with_http_info(org, workspace, id, request_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: PersonalAccessTokensApi.workspace_update_pat ...' end # verify the required parameter 'org' is set if @api_client.config.client_side_validation && org.nil? fail ArgumentError, "Missing the required parameter 'org' when calling PersonalAccessTokensApi.workspace_update_pat" end # verify the required parameter 'workspace' is set if @api_client.config.client_side_validation && workspace.nil? fail ArgumentError, "Missing the required parameter 'workspace' when calling PersonalAccessTokensApi.workspace_update_pat" end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling PersonalAccessTokensApi.workspace_update_pat" end # verify the required parameter 'request_body' is set if @api_client.config.client_side_validation && request_body.nil? fail ArgumentError, "Missing the required parameter 'request_body' when calling PersonalAccessTokensApi.workspace_update_pat" end # resource path local_var_path = '/v1/organizations/{org}/workspaces/{workspace}/tokens/{id}'.sub('{org}', CGI.escape(org.to_s)).sub('{workspace}', CGI.escape(workspace.to_s)).sub('{id}', CGI.escape(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']) 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(request_body) # return_type return_type = opts[:debug_return_type] || 'Hash<String, Object>' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"PersonalAccessTokensApi.workspace_update_pat", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: PersonalAccessTokensApi#workspace_update_pat\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |