class IbmCloudIam::IdentityOperationsApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/ibm_cloud_iam/api/identity_operations_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

create_api_key(create_api_key_request, opts = {}) click to toggle source

Create an API key Creates an API key for a UserID or service ID. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to.

@param create_api_key_request [CreateApiKeyRequest] Request to create an API key @param [Hash] opts the optional parameters @option opts [String] :authorization Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Please make sure that the provided token has the required authority for the request. @option opts [String] :entity_lock Indicates if the API key is locked for further write operations. False by default. (default to 'false') @return [ApiKey]

# File lib/ibm_cloud_iam/api/identity_operations_api.rb, line 29
def create_api_key(create_api_key_request, opts = {})
  data, _status_code, _headers = create_api_key_with_http_info(create_api_key_request, opts)
  data
end
create_api_key_with_http_info(create_api_key_request, opts = {}) click to toggle source

Create an API key Creates an API key for a UserID or service ID. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to.

@param create_api_key_request [CreateApiKeyRequest] Request to create an API key @param [Hash] opts the optional parameters @option opts [String] :authorization Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: &#39;No authorization header found&#39;. Please make sure that the provided token has the required authority for the request. @option opts [String] :entity_lock Indicates if the API key is locked for further write operations. False by default. @return [Array<(ApiKey, Integer, Hash)>] ApiKey data, response status code and response headers

# File lib/ibm_cloud_iam/api/identity_operations_api.rb, line 41
def create_api_key_with_http_info(create_api_key_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityOperationsApi.create_api_key ...'
  end
  # verify the required parameter 'create_api_key_request' is set
  if @api_client.config.client_side_validation && create_api_key_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_api_key_request' when calling IdentityOperationsApi.create_api_key"
  end
  # resource path
  local_var_path = '/v1/apikeys'

  # 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'])
  header_params[:'Authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?
  header_params[:'Entity-Lock'] = opts[:'entity_lock'] if !opts[:'entity_lock'].nil?

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

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

  # return_type
  return_type = opts[:return_type] || 'ApiKey' 

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

  new_options = opts.merge(
    :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: IdentityOperationsApi#create_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
create_service_id(create_service_id_request, opts = {}) click to toggle source

Create a service ID Creates a service ID for an IBM Cloud account. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to.

@param create_service_id_request [CreateServiceIdRequest] Request to create a service ID @param [Hash] opts the optional parameters @option opts [String] :authorization Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: &#39;No authorization header found&#39;. Please make sure that the provided token has the required authority for the request. @option opts [String] :entity_lock Indicates if the service ID is locked for further write operations. False by default. (default to 'false') @return [ServiceId]

# File lib/ibm_cloud_iam/api/identity_operations_api.rb, line 99
def create_service_id(create_service_id_request, opts = {})
  data, _status_code, _headers = create_service_id_with_http_info(create_service_id_request, opts)
  data
end
create_service_id_with_http_info(create_service_id_request, opts = {}) click to toggle source

Create a service ID Creates a service ID for an IBM Cloud account. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to.

@param create_service_id_request [CreateServiceIdRequest] Request to create a service ID @param [Hash] opts the optional parameters @option opts [String] :authorization Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: &#39;No authorization header found&#39;. Please make sure that the provided token has the required authority for the request. @option opts [String] :entity_lock Indicates if the service ID is locked for further write operations. False by default. @return [Array<(ServiceId, Integer, Hash)>] ServiceId data, response status code and response headers

# File lib/ibm_cloud_iam/api/identity_operations_api.rb, line 111
def create_service_id_with_http_info(create_service_id_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityOperationsApi.create_service_id ...'
  end
  # verify the required parameter 'create_service_id_request' is set
  if @api_client.config.client_side_validation && create_service_id_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_service_id_request' when calling IdentityOperationsApi.create_service_id"
  end
  # resource path
  local_var_path = '/v1/serviceids/'

  # 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'])
  header_params[:'Authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?
  header_params[:'Entity-Lock'] = opts[:'entity_lock'] if !opts[:'entity_lock'].nil?

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

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

  # return_type
  return_type = opts[:return_type] || 'ServiceId' 

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

  new_options = opts.merge(
    :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: IdentityOperationsApi#create_service_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_api_key(id, opts = {}) click to toggle source

Deletes an API key Deletes an API key. Existing tokens will remain valid until expired. Refresh tokens will not work any more for this API key. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to.

@param id [String] Unique ID of the API key. @param [Hash] opts the optional parameters @option opts [String] :authorization Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: &#39;No authorization header found&#39;. Please make sure that the provided token has the required authority for the request. @return [nil]

# File lib/ibm_cloud_iam/api/identity_operations_api.rb, line 168
def delete_api_key(id, opts = {})
  delete_api_key_with_http_info(id, opts)
  nil
end
delete_api_key_with_http_info(id, opts = {}) click to toggle source

Deletes an API key Deletes an API key. Existing tokens will remain valid until expired. Refresh tokens will not work any more for this API key. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to.

@param id [String] Unique ID of the API key. @param [Hash] opts the optional parameters @option opts [String] :authorization Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: &#39;No authorization header found&#39;. Please make sure that the provided token has the required authority for the request. @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/ibm_cloud_iam/api/identity_operations_api.rb, line 179
def delete_api_key_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityOperationsApi.delete_api_key ...'
  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 IdentityOperationsApi.delete_api_key"
  end
  # resource path
  local_var_path = '/v1/apikeys/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  header_params[:'Authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?

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

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

  # return_type
  return_type = opts[:return_type] 

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

  new_options = opts.merge(
    :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: IdentityOperationsApi#delete_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_service_id(id, opts = {}) click to toggle source

Deletes a service ID and associated API keys Deletes a service ID and all API keys associated to it. Before deleting the service ID, all associated API keys are deleted. In case a Delete Conflict (status code 409) a retry of the request may help as the service ID is only deleted if the associated API keys were successfully deleted before. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to.

@param id [String] Unique ID of the service ID. @param [Hash] opts the optional parameters @option opts [String] :authorization Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: &#39;No authorization header found&#39;. Please make sure that the provided token has the required authority for the request. @return [nil]

# File lib/ibm_cloud_iam/api/identity_operations_api.rb, line 231
def delete_service_id(id, opts = {})
  delete_service_id_with_http_info(id, opts)
  nil
end
delete_service_id_with_http_info(id, opts = {}) click to toggle source

Deletes a service ID and associated API keys Deletes a service ID and all API keys associated to it. Before deleting the service ID, all associated API keys are deleted. In case a Delete Conflict (status code 409) a retry of the request may help as the service ID is only deleted if the associated API keys were successfully deleted before. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to.

@param id [String] Unique ID of the service ID. @param [Hash] opts the optional parameters @option opts [String] :authorization Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: &#39;No authorization header found&#39;. Please make sure that the provided token has the required authority for the request. @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/ibm_cloud_iam/api/identity_operations_api.rb, line 242
def delete_service_id_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityOperationsApi.delete_service_id ...'
  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 IdentityOperationsApi.delete_service_id"
  end
  # resource path
  local_var_path = '/v1/serviceids/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  header_params[:'Authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?

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

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

  # return_type
  return_type = opts[:return_type] 

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

  new_options = opts.merge(
    :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: IdentityOperationsApi#delete_service_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_api_key(id, opts = {}) click to toggle source

Get details of an API key Returns the details of an API key. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to. In case of service IDs and their API keys, a user must be either an account owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs of the entity. @param id [String] Unique ID of the API key. @param [Hash] opts the optional parameters @option opts [Boolean] :include_history Defines if the entity history is included in the response. (default to false) @option opts [String] :authorization Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: &#39;No authorization header found&#39;. Please make sure that the provided token has the required authority for the request. @return [ApiKey]

# File lib/ibm_cloud_iam/api/identity_operations_api.rb, line 295
def get_api_key(id, opts = {})
  data, _status_code, _headers = get_api_key_with_http_info(id, opts)
  data
end
get_api_key_with_http_info(id, opts = {}) click to toggle source

Get details of an API key Returns the details of an API key. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to. In case of service IDs and their API keys, a user must be either an account owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs of the entity. @param id [String] Unique ID of the API key. @param [Hash] opts the optional parameters @option opts [Boolean] :include_history Defines if the entity history is included in the response. @option opts [String] :authorization Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: &#39;No authorization header found&#39;. Please make sure that the provided token has the required authority for the request. @return [Array<(ApiKey, Integer, Hash)>] ApiKey data, response status code and response headers

# File lib/ibm_cloud_iam/api/identity_operations_api.rb, line 307
def get_api_key_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityOperationsApi.get_api_key ...'
  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 IdentityOperationsApi.get_api_key"
  end
  # resource path
  local_var_path = '/v1/apikeys/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

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

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

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

  # return_type
  return_type = opts[:return_type] || 'ApiKey' 

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

  new_options = opts.merge(
    :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: IdentityOperationsApi#get_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_api_keys_details(opts = {}) click to toggle source

Get details of an API key by its value Returns the details of an API key by its value. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to.

@param [Hash] opts the optional parameters @option opts [String] :iam_api_key API key value. @option opts [Boolean] :include_history Defines if the entity history is included in the response (default to false) @option opts [String] :authorization Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: &#39;No authorization header found&#39;. Please make sure that the provided token has the required authority for the request. @return [ApiKey]

# File lib/ibm_cloud_iam/api/identity_operations_api.rb, line 363
def get_api_keys_details(opts = {})
  data, _status_code, _headers = get_api_keys_details_with_http_info(opts)
  data
end
get_api_keys_details_with_http_info(opts = {}) click to toggle source

Get details of an API key by its value Returns the details of an API key by its value. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to.

@param [Hash] opts the optional parameters @option opts [String] :iam_api_key API key value. @option opts [Boolean] :include_history Defines if the entity history is included in the response @option opts [String] :authorization Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: &#39;No authorization header found&#39;. Please make sure that the provided token has the required authority for the request. @return [Array<(ApiKey, Integer, Hash)>] ApiKey data, response status code and response headers

# File lib/ibm_cloud_iam/api/identity_operations_api.rb, line 375
def get_api_keys_details_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityOperationsApi.get_api_keys_details ...'
  end
  # resource path
  local_var_path = '/v1/apikeys/details'

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

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  header_params[:'IAM-ApiKey'] = opts[:'iam_api_key'] if !opts[:'iam_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[:body] 

  # return_type
  return_type = opts[:return_type] || 'ApiKey' 

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

  new_options = opts.merge(
    :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: IdentityOperationsApi#get_api_keys_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_service_id(id, opts = {}) click to toggle source

Get details of a service ID Returns the details of a service ID. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to.

@param id [String] Unique ID of the service ID. @param [Hash] opts the optional parameters @option opts [String] :authorization Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: &#39;No authorization header found&#39;. Please make sure that the provided token has the required authority for the request. @option opts [Boolean] :include_history Defines if the entity history is included in the response. (default to false) @return [ServiceId]

# File lib/ibm_cloud_iam/api/identity_operations_api.rb, line 428
def get_service_id(id, opts = {})
  data, _status_code, _headers = get_service_id_with_http_info(id, opts)
  data
end
get_service_id_with_http_info(id, opts = {}) click to toggle source

Get details of a service ID Returns the details of a service ID. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to.

@param id [String] Unique ID of the service ID. @param [Hash] opts the optional parameters @option opts [String] :authorization Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: &#39;No authorization header found&#39;. Please make sure that the provided token has the required authority for the request. @option opts [Boolean] :include_history Defines if the entity history is included in the response. @return [Array<(ServiceId, Integer, Hash)>] ServiceId data, response status code and response headers

# File lib/ibm_cloud_iam/api/identity_operations_api.rb, line 440
def get_service_id_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityOperationsApi.get_service_id ...'
  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 IdentityOperationsApi.get_service_id"
  end
  # resource path
  local_var_path = '/v1/serviceids/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

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

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

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

  # return_type
  return_type = opts[:return_type] || 'ServiceId' 

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

  new_options = opts.merge(
    :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: IdentityOperationsApi#get_service_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_api_keys(opts = {}) click to toggle source

Get API keys for a given service or user IAM ID and account ID Returns the list of API key details for a given service or user IAM ID and account ID. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to. In case of service IDs and their API keys, a user must be either an account owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs of the entity. @param [Hash] opts the optional parameters @option opts [String] :account_id Account ID of the API keys(s) to query. If a service IAM ID is specified in iam_id then account_id must match the account of the IAM ID. If a user IAM ID is specified in iam_id then then account_id must match the account of the Authorization token. @option opts [String] :iam_id IAM ID of the API key(s) to be queried. The IAM ID may be that of a user or a service. For a user IAM ID iam_id must match the Authorization token. @option opts [Integer] :pagesize Optional size of a single page. Default is 20 items per page. Valid range is 1 to 100. @option opts [String] :pagetoken Optional Prev or Next page token returned from a previous query execution. Default is start with first page. @option opts [String] :scope Optional parameter to define the scope of the queried API Keys. Can be &#39;entity&#39; (default) or &#39;account&#39;. (default to 'entity') @option opts [String] :type Optional parameter to filter the type of the queried API Keys. Can be &#39;user&#39; or &#39;serviceid&#39;. @option opts [String] :sort Optional sort property, valid values are name, description, created_at and created_by. If specified, the items are sorted by the value of this property. @option opts [String] :order Optional sort order, valid values are asc and desc. Default: asc. (default to 'asc') @option opts [Boolean] :include_history Defines if the entity history is included in the response. (default to false) @option opts [String] :authorization Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: &#39;No authorization header found&#39;. Please make sure that the provided token has the required authority for the request. @return [ApiKeyList]

# File lib/ibm_cloud_iam/api/identity_operations_api.rb, line 503
def list_api_keys(opts = {})
  data, _status_code, _headers = list_api_keys_with_http_info(opts)
  data
end
list_api_keys_with_http_info(opts = {}) click to toggle source

Get API keys for a given service or user IAM ID and account ID Returns the list of API key details for a given service or user IAM ID and account ID. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to. In case of service IDs and their API keys, a user must be either an account owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs of the entity. @param [Hash] opts the optional parameters @option opts [String] :account_id Account ID of the API keys(s) to query. If a service IAM ID is specified in iam_id then account_id must match the account of the IAM ID. If a user IAM ID is specified in iam_id then then account_id must match the account of the Authorization token. @option opts [String] :iam_id IAM ID of the API key(s) to be queried. The IAM ID may be that of a user or a service. For a user IAM ID iam_id must match the Authorization token. @option opts [Integer] :pagesize Optional size of a single page. Default is 20 items per page. Valid range is 1 to 100. @option opts [String] :pagetoken Optional Prev or Next page token returned from a previous query execution. Default is start with first page. @option opts [String] :scope Optional parameter to define the scope of the queried API Keys. Can be &#39;entity&#39; (default) or &#39;account&#39;. @option opts [String] :type Optional parameter to filter the type of the queried API Keys. Can be &#39;user&#39; or &#39;serviceid&#39;. @option opts [String] :sort Optional sort property, valid values are name, description, created_at and created_by. If specified, the items are sorted by the value of this property. @option opts [String] :order Optional sort order, valid values are asc and desc. Default: asc. @option opts [Boolean] :include_history Defines if the entity history is included in the response. @option opts [String] :authorization Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: &#39;No authorization header found&#39;. Please make sure that the provided token has the required authority for the request. @return [Array<(ApiKeyList, Integer, Hash)>] ApiKeyList data, response status code and response headers

# File lib/ibm_cloud_iam/api/identity_operations_api.rb, line 522
def list_api_keys_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityOperationsApi.list_api_keys ...'
  end
  allowable_values = ["entity", "account"]
  if @api_client.config.client_side_validation && opts[:'scope'] && !allowable_values.include?(opts[:'scope'])
    fail ArgumentError, "invalid value for \"scope\", must be one of #{allowable_values}"
  end
  allowable_values = ["user", "serviceid"]
  if @api_client.config.client_side_validation && opts[:'type'] && !allowable_values.include?(opts[:'type'])
    fail ArgumentError, "invalid value for \"type\", must be one of #{allowable_values}"
  end
  allowable_values = ["asc", "desc"]
  if @api_client.config.client_side_validation && opts[:'order'] && !allowable_values.include?(opts[:'order'])
    fail ArgumentError, "invalid value for \"order\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/apikeys'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'account_id'] = opts[:'account_id'] if !opts[:'account_id'].nil?
  query_params[:'iam_id'] = opts[:'iam_id'] if !opts[:'iam_id'].nil?
  query_params[:'pagesize'] = opts[:'pagesize'] if !opts[:'pagesize'].nil?
  query_params[:'pagetoken'] = opts[:'pagetoken'] if !opts[:'pagetoken'].nil?
  query_params[:'scope'] = opts[:'scope'] if !opts[:'scope'].nil?
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'include_history'] = opts[:'include_history'] if !opts[:'include_history'].nil?

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

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

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

  # return_type
  return_type = opts[:return_type] || 'ApiKeyList' 

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

  new_options = opts.merge(
    :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: IdentityOperationsApi#list_api_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_service_ids(opts = {}) click to toggle source

List service IDs Returns a list of service IDs. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to.

@param [Hash] opts the optional parameters @option opts [String] :account_id Account ID of the service ID(s) to query. This parameter is required (unless using a pagetoken). @option opts [String] :name Name of the service ID(s) to query. Optional.20 items per page. Valid range is 1 to 100. @option opts [Integer] :pagesize Optional size of a single page. Default is 20 items per page. Valid range is 1 to 100. @option opts [String] :pagetoken Optional Prev or Next page token returned from a previous query execution. Default is start with first page. @option opts [String] :sort Optional sort property, valid values are name, description, created_at and modified_at. If specified, the items are sorted by the value of this property. @option opts [String] :order Optional sort order, valid values are asc and desc. Default: asc. (default to 'asc') @option opts [Boolean] :include_history Defines if the entity history is included in the response (default to false) @option opts [String] :authorization Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: &#39;No authorization header found&#39;. Please make sure that the provided token has the required authority for the request. @return [ServiceIdList]

# File lib/ibm_cloud_iam/api/identity_operations_api.rb, line 599
def list_service_ids(opts = {})
  data, _status_code, _headers = list_service_ids_with_http_info(opts)
  data
end
list_service_ids_with_http_info(opts = {}) click to toggle source

List service IDs Returns a list of service IDs. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to.

@param [Hash] opts the optional parameters @option opts [String] :account_id Account ID of the service ID(s) to query. This parameter is required (unless using a pagetoken). @option opts [String] :name Name of the service ID(s) to query. Optional.20 items per page. Valid range is 1 to 100. @option opts [Integer] :pagesize Optional size of a single page. Default is 20 items per page. Valid range is 1 to 100. @option opts [String] :pagetoken Optional Prev or Next page token returned from a previous query execution. Default is start with first page. @option opts [String] :sort Optional sort property, valid values are name, description, created_at and modified_at. If specified, the items are sorted by the value of this property. @option opts [String] :order Optional sort order, valid values are asc and desc. Default: asc. @option opts [Boolean] :include_history Defines if the entity history is included in the response @option opts [String] :authorization Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: &#39;No authorization header found&#39;. Please make sure that the provided token has the required authority for the request. @return [Array<(ServiceIdList, Integer, Hash)>] ServiceIdList data, response status code and response headers

# File lib/ibm_cloud_iam/api/identity_operations_api.rb, line 616
def list_service_ids_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityOperationsApi.list_service_ids ...'
  end
  allowable_values = ["asc", "desc"]
  if @api_client.config.client_side_validation && opts[:'order'] && !allowable_values.include?(opts[:'order'])
    fail ArgumentError, "invalid value for \"order\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/serviceids/'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'account_id'] = opts[:'account_id'] if !opts[:'account_id'].nil?
  query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
  query_params[:'pagesize'] = opts[:'pagesize'] if !opts[:'pagesize'].nil?
  query_params[:'pagetoken'] = opts[:'pagetoken'] if !opts[:'pagetoken'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'include_history'] = opts[:'include_history'] if !opts[:'include_history'].nil?

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

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

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

  # return_type
  return_type = opts[:return_type] || 'ServiceIdList' 

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

  new_options = opts.merge(
    :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: IdentityOperationsApi#list_service_ids\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
lock_api_key(id, opts = {}) click to toggle source

Lock the API key Locks an API key by ID. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to. In case of service IDs and their API keys, a user must be either an account owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs of the entity. @param id [String] Unique ID of the API key. @param [Hash] opts the optional parameters @option opts [String] :authorization Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: &#39;No authorization header found&#39;. Please make sure that the provided token has the required authority for the request. @return [nil]

# File lib/ibm_cloud_iam/api/identity_operations_api.rb, line 677
def lock_api_key(id, opts = {})
  lock_api_key_with_http_info(id, opts)
  nil
end
lock_api_key_with_http_info(id, opts = {}) click to toggle source

Lock the API key Locks an API key by ID. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to. In case of service IDs and their API keys, a user must be either an account owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs of the entity. @param id [String] Unique ID of the API key. @param [Hash] opts the optional parameters @option opts [String] :authorization Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: &#39;No authorization header found&#39;. Please make sure that the provided token has the required authority for the request. @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/ibm_cloud_iam/api/identity_operations_api.rb, line 688
def lock_api_key_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityOperationsApi.lock_api_key ...'
  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 IdentityOperationsApi.lock_api_key"
  end
  # resource path
  local_var_path = '/v1/apikeys/{id}/lock'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  header_params[:'Authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?

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

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

  # return_type
  return_type = opts[:return_type] 

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

  new_options = opts.merge(
    :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: IdentityOperationsApi#lock_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
lock_service_id(id, opts = {}) click to toggle source

Lock the service ID Locks a service ID by ID. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to. In case of service IDs and their API keys, a user must be either an account owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs of the entity. @param id [String] Unique ID of the service ID. @param [Hash] opts the optional parameters @option opts [String] :authorization Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: &#39;No authorization header found&#39;. Please make sure that the provided token has the required authority for the request. @return [nil]

# File lib/ibm_cloud_iam/api/identity_operations_api.rb, line 740
def lock_service_id(id, opts = {})
  lock_service_id_with_http_info(id, opts)
  nil
end
lock_service_id_with_http_info(id, opts = {}) click to toggle source

Lock the service ID Locks a service ID by ID. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to. In case of service IDs and their API keys, a user must be either an account owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs of the entity. @param id [String] Unique ID of the service ID. @param [Hash] opts the optional parameters @option opts [String] :authorization Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: &#39;No authorization header found&#39;. Please make sure that the provided token has the required authority for the request. @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/ibm_cloud_iam/api/identity_operations_api.rb, line 751
def lock_service_id_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityOperationsApi.lock_service_id ...'
  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 IdentityOperationsApi.lock_service_id"
  end
  # resource path
  local_var_path = '/v1/serviceids/{id}/lock'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  header_params[:'Authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?

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

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

  # return_type
  return_type = opts[:return_type] 

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

  new_options = opts.merge(
    :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: IdentityOperationsApi#lock_service_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
unlock_api_key(id, opts = {}) click to toggle source

Unlock the API key Unlocks an API key by ID. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to. In case of service IDs and their API keys, a user must be either an account owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs of the entity. @param id [String] Unique ID of the API key. @param [Hash] opts the optional parameters @option opts [String] :authorization Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: &#39;No authorization header found&#39;. Please make sure that the provided token has the required authority for the request. @return [nil]

# File lib/ibm_cloud_iam/api/identity_operations_api.rb, line 803
def unlock_api_key(id, opts = {})
  unlock_api_key_with_http_info(id, opts)
  nil
end
unlock_api_key_with_http_info(id, opts = {}) click to toggle source

Unlock the API key Unlocks an API key by ID. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to. In case of service IDs and their API keys, a user must be either an account owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs of the entity. @param id [String] Unique ID of the API key. @param [Hash] opts the optional parameters @option opts [String] :authorization Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: &#39;No authorization header found&#39;. Please make sure that the provided token has the required authority for the request. @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/ibm_cloud_iam/api/identity_operations_api.rb, line 814
def unlock_api_key_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityOperationsApi.unlock_api_key ...'
  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 IdentityOperationsApi.unlock_api_key"
  end
  # resource path
  local_var_path = '/v1/apikeys/{id}/lock'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  header_params[:'Authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?

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

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

  # return_type
  return_type = opts[:return_type] 

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

  new_options = opts.merge(
    :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: IdentityOperationsApi#unlock_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
unlock_service_id(id, opts = {}) click to toggle source

Unlock the service ID Unlocks a service ID by ID. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to. In case of service IDs and their API keys, a user must be either an account owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs of the entity. @param id [String] Unique ID of the service ID. @param [Hash] opts the optional parameters @option opts [String] :authorization Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: &#39;No authorization header found&#39;. Please make sure that the provided token has the required authority for the request. @return [nil]

# File lib/ibm_cloud_iam/api/identity_operations_api.rb, line 866
def unlock_service_id(id, opts = {})
  unlock_service_id_with_http_info(id, opts)
  nil
end
unlock_service_id_with_http_info(id, opts = {}) click to toggle source

Unlock the service ID Unlocks a service ID by ID. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to. In case of service IDs and their API keys, a user must be either an account owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs of the entity. @param id [String] Unique ID of the service ID. @param [Hash] opts the optional parameters @option opts [String] :authorization Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: &#39;No authorization header found&#39;. Please make sure that the provided token has the required authority for the request. @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers

# File lib/ibm_cloud_iam/api/identity_operations_api.rb, line 877
def unlock_service_id_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityOperationsApi.unlock_service_id ...'
  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 IdentityOperationsApi.unlock_service_id"
  end
  # resource path
  local_var_path = '/v1/serviceids/{id}/lock'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  header_params[:'Authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?

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

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

  # return_type
  return_type = opts[:return_type] 

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

  new_options = opts.merge(
    :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: IdentityOperationsApi#unlock_service_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_api_key(id, if_match, update_api_key_request, opts = {}) click to toggle source

Updates an API key Updates properties of an API key. This does NOT affect existing access tokens. Their token content will stay unchanged until the access token is refreshed. To update an API key, pass the property to be modified. To delete one property's value, pass the property with an empty value "".Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to.

@param id [String] Unique ID of the API key to be updated. @param if_match [String] Version of the API key to be updated. Specify the version that you retrieved when reading the API key. This value helps identifying parallel usage of this API. Pass * to indicate to update any version available. This might result in stale updates. @param update_api_key_request [UpdateApiKeyRequest] Request to update an API key @param [Hash] opts the optional parameters @option opts [String] :authorization Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: &#39;No authorization header found&#39;. Please make sure that the provided token has the required authority for the request. @return [ApiKey]

# File lib/ibm_cloud_iam/api/identity_operations_api.rb, line 931
def update_api_key(id, if_match, update_api_key_request, opts = {})
  data, _status_code, _headers = update_api_key_with_http_info(id, if_match, update_api_key_request, opts)
  data
end
update_api_key_with_http_info(id, if_match, update_api_key_request, opts = {}) click to toggle source

Updates an API key Updates properties of an API key. This does NOT affect existing access tokens. Their token content will stay unchanged until the access token is refreshed. To update an API key, pass the property to be modified. To delete one property&#39;s value, pass the property with an empty value "&quot;.Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to.

@param id [String] Unique ID of the API key to be updated. @param if_match [String] Version of the API key to be updated. Specify the version that you retrieved when reading the API key. This value helps identifying parallel usage of this API. Pass * to indicate to update any version available. This might result in stale updates. @param update_api_key_request [UpdateApiKeyRequest] Request to update an API key @param [Hash] opts the optional parameters @option opts [String] :authorization Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: &#39;No authorization header found&#39;. Please make sure that the provided token has the required authority for the request. @return [Array<(ApiKey, Integer, Hash)>] ApiKey data, response status code and response headers

# File lib/ibm_cloud_iam/api/identity_operations_api.rb, line 944
def update_api_key_with_http_info(id, if_match, update_api_key_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityOperationsApi.update_api_key ...'
  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 IdentityOperationsApi.update_api_key"
  end
  # verify the required parameter 'if_match' is set
  if @api_client.config.client_side_validation && if_match.nil?
    fail ArgumentError, "Missing the required parameter 'if_match' when calling IdentityOperationsApi.update_api_key"
  end
  # verify the required parameter 'update_api_key_request' is set
  if @api_client.config.client_side_validation && update_api_key_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_api_key_request' when calling IdentityOperationsApi.update_api_key"
  end
  # resource path
  local_var_path = '/v1/apikeys/{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'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'If-Match'] = if_match
  header_params[:'Authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?

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

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

  # return_type
  return_type = opts[:return_type] || 'ApiKey' 

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

  new_options = opts.merge(
    :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: IdentityOperationsApi#update_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
update_service_id(id, if_match, update_service_id_request, opts = {}) click to toggle source

Update service ID Updates properties of a service ID. This does NOT affect existing access tokens. Their token content will stay unchanged until the access token is refreshed. To update a service ID, pass the property to be modified. To delete one property's value, pass the property with an empty value "".Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to.

@param id [String] Unique ID of the service ID to be updated. @param if_match [String] Version of the service ID to be updated. Specify the version that you retrieved as entity_tag (ETag header) when reading the service ID. This value helps identifying parallel usage of this API. Pass * to indicate to update any version available. This might result in stale updates. @param update_service_id_request [UpdateServiceIdRequest] Request to update a service ID @param [Hash] opts the optional parameters @option opts [String] :authorization Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: &#39;No authorization header found&#39;. Please make sure that the provided token has the required authority for the request. @return [ServiceId]

# File lib/ibm_cloud_iam/api/identity_operations_api.rb, line 1011
def update_service_id(id, if_match, update_service_id_request, opts = {})
  data, _status_code, _headers = update_service_id_with_http_info(id, if_match, update_service_id_request, opts)
  data
end
update_service_id_with_http_info(id, if_match, update_service_id_request, opts = {}) click to toggle source

Update service ID Updates properties of a service ID. This does NOT affect existing access tokens. Their token content will stay unchanged until the access token is refreshed. To update a service ID, pass the property to be modified. To delete one property&#39;s value, pass the property with an empty value "&quot;.Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to.

@param id [String] Unique ID of the service ID to be updated. @param if_match [String] Version of the service ID to be updated. Specify the version that you retrieved as entity_tag (ETag header) when reading the service ID. This value helps identifying parallel usage of this API. Pass * to indicate to update any version available. This might result in stale updates. @param update_service_id_request [UpdateServiceIdRequest] Request to update a service ID @param [Hash] opts the optional parameters @option opts [String] :authorization Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: &#39;No authorization header found&#39;. Please make sure that the provided token has the required authority for the request. @return [Array<(ServiceId, Integer, Hash)>] ServiceId data, response status code and response headers

# File lib/ibm_cloud_iam/api/identity_operations_api.rb, line 1024
def update_service_id_with_http_info(id, if_match, update_service_id_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IdentityOperationsApi.update_service_id ...'
  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 IdentityOperationsApi.update_service_id"
  end
  # verify the required parameter 'if_match' is set
  if @api_client.config.client_side_validation && if_match.nil?
    fail ArgumentError, "Missing the required parameter 'if_match' when calling IdentityOperationsApi.update_service_id"
  end
  # verify the required parameter 'update_service_id_request' is set
  if @api_client.config.client_side_validation && update_service_id_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_service_id_request' when calling IdentityOperationsApi.update_service_id"
  end
  # resource path
  local_var_path = '/v1/serviceids/{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'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
  header_params[:'If-Match'] = if_match
  header_params[:'Authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?

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

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

  # return_type
  return_type = opts[:return_type] || 'ServiceId' 

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

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