lib/oci/identity/identity_client.rb
# Lists the MFA TOTP devices for the specified user. The returned object contains the device's OCID, but not
# the seed. The seed is returned only upon creation or when the IAM service regenerates the MFA seed for the device.
#
# @param [String] user_id The OCID of the user.
# @param [Hash] opts the optional parameters
# @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
#   retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
# @option opts [String] :page The value of the `opc-next-page` response header from the previous \"List\" call.
#
# @option opts [Integer] :limit The maximum number of items to return in a paginated \"List\" call.
#
# @option opts [String] :sort_by The field to sort by. You can provide one sort order (`sortOrder`). Default order for
#   TIMECREATED is descending. Default order for NAME is ascending. The NAME
#   sort order is case sensitive.
#
#   **Note:** In general, some \"List\" operations (for example, `ListInstances`) let you
#   optionally filter by Availability Domain if the scope of the resource type is within a
#   single Availability Domain. If you call one of these \"List\" operations without specifying
#   an Availability Domain, the resources are grouped by Availability Domain, then sorted.
#
#   Allowed values are: TIMECREATED, NAME
# @option opts [String] :sort_order The sort order to use, either ascending (`ASC`) or descending (`DESC`). The NAME sort order
#   is case sensitive.
#
#   Allowed values are: ASC, DESC
# @return [Response] A Response object with data of type Array<{OCI::Identity::Models::MfaTotpDeviceSummary MfaTotpDeviceSummary}>
# @note Click [here](https://docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/identity/list_mfa_totp_devices.rb.html) to see an example of how to use list_mfa_totp_devices API.
Lists the MFA TOTP devices for the specified user. The returned object contains the device's OCID, but not
the seed. The seed is returned only upon creation or when the IAM service regenerates the MFA seed for the device.
Lists the MFA TOTP devices for the specified user . The returned object contains the device ' s OCID but not the seed . The seed is returned only upon creation or when the IAM service regenerates the MFA seed for the device .
def list_mfa_totp_devices(user_id, opts = {})
      logger.debug 'Calling operation IdentityClient#list_mfa_totp_devices.' if logger
      raise "Missing the required parameter 'user_id' when calling list_mfa_totp_devices." if user_id.nil?
      if opts[:sort_by] && !%w[TIMECREATED NAME].include?(opts[:sort_by])
        raise 'Invalid value for "sort_by", must be one of TIMECREATED, NAME.'
      end
      if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order])
        raise 'Invalid value for "sort_order", must be one of ASC, DESC.'
      end
      raise "Parameter value for 'user_id' must not be blank" if OCI::Internal::Util.blank_string?(user_id)
      path = '/users/{userId}/mfaTotpDevices'.sub('{userId}', user_id.to_s)
      operation_signing_strategy = :standard
      query_params = {}
      query_params[:page] = opts[:page] if opts[:page]
      query_params[:limit] = opts[:limit] if opts[:limit]
      query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
      query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
      header_params = {}
      header_params[:accept] = 'application/json'
      header_params[:'content-type'] = 'application/json'
      post_body = nil
      OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'IdentityClient#list_mfa_totp_devices') do
        @api_client.call_api(
          :GET,
          path,
          endpoint,
          header_params: header_params,
          query_params: query_params,
          operation_signing_strategy: operation_signing_strategy,
          body: post_body,
          return_type: 'Array<OCI::Identity::Models::MfaTotpDeviceSummary>'
        )
      end
    end
def list_mfa_totp_devices ( user_id , opts = { } ) logger . debug 'Calling operation IdentityClient#list_mfa_totp_devices.' if logger raise "Missing the required parameter 'user_id' when calling list_mfa_totp_devices." if user_id . nil? if opts [ :sort_by ] && ! %w[ TIMECREATED NAME ] . include? ( opts [ :sort_by ] ) raise 'Invalid value for "sort_by", must be one of TIMECREATED, NAME.' end if opts [ :sort_order ] && ! %w[ ASC DESC ] . include? ( opts [ :sort_order ] ) raise 'Invalid value for "sort_order", must be one of ASC, DESC.' end raise "Parameter value for 'user_id' must not be blank" if OCI :: Internal :: Util . blank_string? ( user_id ) path = '/users/{userId}/mfaTotpDevices' . sub ( '{userId}' , user_id . to_s ) operation_signing_strategy = :standard query_params = { } query_params [ :page ] = opts [ :page ] if opts [ :page ] query_params [ :limit ] = opts [ :limit ] if opts [ :limit ] query_params [ :sortBy ] = opts [ :sort_by ] if opts [ :sort_by ] query_params [ :sortOrder ] = opts [ :sort_order ] if opts [ :sort_order ] header_params = { } header_params [ :accept ] = 'application/json' header_params [ :' content-type ' ] = 'application/json' post_body = nil OCI :: Retry . make_retrying_call ( applicable_retry_config ( opts ) , call_name : 'IdentityClient#list_mfa_totp_devices' ) do @api_client . call_api ( :GET , path , endpoint , header_params : header_params , query_params : query_params , operation_signing_strategy : operation_signing_strategy , body : post_body , return_type : 'Array<OCI::Identity::Models::MfaTotpDeviceSummary>' ) end end
Lists the MFA TOTP devices for the specified user.
Lists the MFA TOTP devices for the specified user .
# rubocop:disable Style/NegatedIf # Query Params # Header Params # rubocop:enable Style/NegatedIf # rubocop:disable Metrics/BlockLength # rubocop:enable Metrics/BlockLength
A Response object with data of type Array<{OCI::Identity::Models::MfaTotpDeviceSummary MfaTotpDeviceSummary}>
A Response object with data of type Array< { OCI :: Identity :: Models :: MfaTotpDeviceSummary MfaTotpDeviceSummary } >
Response
user_id
<not_specific>
opts
:sort_order The sort order to use, either ascending (`ASC`) or descending (`DESC`). The NAME sort order is case sensitive. Allowed values are: ASC, DESC
: sort_order The sort order to use either ascending ( ` ASC ` ) or descending ( ` DESC ` ) . The NAME sort order is case sensitive . Allowed values are : ASC DESC
<not_specific>
opts the optional parameters
opts the optional parameters
note
Click [here] to see an example of how to use list_mfa_totp_devices API.
Click [ here ] to see an example of how to use list_mfa_totp_devices API .