lib/oci/identity/identity_client.rb
def list_users(compartment_id, opts = {})
      logger.debug 'Calling operation IdentityClient#list_users.' if logger

      raise "Missing the required parameter 'compartment_id' when calling list_users." if compartment_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

      if opts[:lifecycle_state] && !OCI::Identity::Models::User::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state])
        raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Identity::Models::User::LIFECYCLE_STATE_ENUM.'
      end

      path = '/users/'
      operation_signing_strategy = :standard

      # rubocop:disable Style/NegatedIf
      # Query Params
      query_params = {}
      query_params[:compartmentId] = compartment_id
      query_params[:page] = opts[:page] if opts[:page]
      query_params[:limit] = opts[:limit] if opts[:limit]
      query_params[:identityProviderId] = opts[:identity_provider_id] if opts[:identity_provider_id]
      query_params[:externalIdentifier] = opts[:external_identifier] if opts[:external_identifier]
      query_params[:name] = opts[:name] if opts[:name]
      query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
      query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
      query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]

      # Header Params
      header_params = {}
      header_params[:accept] = 'application/json'
      header_params[:'content-type'] = 'application/json'
      # rubocop:enable Style/NegatedIf

      post_body = nil

      # rubocop:disable Metrics/BlockLength
      OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'IdentityClient#list_users') 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::User>'
        )
      end
      # rubocop:enable Metrics/BlockLength
    end
# Lists the users in your tenancy. You must specify your tenancy's OCID as the value for the
# compartment ID (remember that the tenancy is simply the root compartment).
# See [Where to Get the Tenancy's OCID and User's OCID](https://docs.cloud.oracle.com/Content/API/Concepts/apisigningkey.htm#five).
#
# @param [String] compartment_id The OCID of the compartment (remember that the tenancy is simply the root compartment).
#
# @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.
#    (default to 20)
# @option opts [String] :identity_provider_id The id of the identity provider.
#
# @option opts [String] :external_identifier The id of a user in the identity provider.
#
# @option opts [String] :name A filter to only return resources that match the given name exactly.
#
# @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
# @option opts [String] :lifecycle_state A filter to only return resources that match the given lifecycle state.  The state value is case-insensitive.
#
# @return [Response] A Response object with data of type Array<{OCI::Identity::Models::User User}>
# @note Click [here](https://docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/identity/list_users.rb.html) to see an example of how to use list_users API.
Lists the users in your tenancy. You must specify your tenancy's OCID as the value for the
compartment ID (remember that the tenancy is simply the root compartment).
See [Where to Get the Tenancy's OCID and User's OCID].
Lists the users in your tenancy . You must specify your tenancy ' s OCID as the value for the compartment ID ( remember that the tenancy is simply the root compartment ) . See [ Where to Get the Tenancy ' s OCID and User ' s OCID ] .
def list_users(compartment_id, opts = {})
      logger.debug 'Calling operation IdentityClient#list_users.' if logger
      raise "Missing the required parameter 'compartment_id' when calling list_users." if compartment_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
      if opts[:lifecycle_state] && !OCI::Identity::Models::User::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state])
        raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Identity::Models::User::LIFECYCLE_STATE_ENUM.'
      end
      path = '/users/'
      operation_signing_strategy = :standard
      query_params = {}
      query_params[:compartmentId] = compartment_id
      query_params[:page] = opts[:page] if opts[:page]
      query_params[:limit] = opts[:limit] if opts[:limit]
      query_params[:identityProviderId] = opts[:identity_provider_id] if opts[:identity_provider_id]
      query_params[:externalIdentifier] = opts[:external_identifier] if opts[:external_identifier]
      query_params[:name] = opts[:name] if opts[:name]
      query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
      query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
      query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
      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_users') 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::User>'
        )
      end
    end
def list_users ( compartment_id , opts = { } ) logger . debug 'Calling operation IdentityClient#list_users.' if logger raise "Missing the required parameter 'compartment_id' when calling list_users." if compartment_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 if opts [ :lifecycle_state ] && ! OCI :: Identity :: Models :: User :: LIFECYCLE_STATE_ENUM . include? ( opts [ :lifecycle_state ] ) raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Identity::Models::User::LIFECYCLE_STATE_ENUM.' end path = '/users/' operation_signing_strategy = :standard query_params = { } query_params [ :compartmentId ] = compartment_id query_params [ :page ] = opts [ :page ] if opts [ :page ] query_params [ :limit ] = opts [ :limit ] if opts [ :limit ] query_params [ :identityProviderId ] = opts [ :identity_provider_id ] if opts [ :identity_provider_id ] query_params [ :externalIdentifier ] = opts [ :external_identifier ] if opts [ :external_identifier ] query_params [ :name ] = opts [ :name ] if opts [ :name ] query_params [ :sortBy ] = opts [ :sort_by ] if opts [ :sort_by ] query_params [ :sortOrder ] = opts [ :sort_order ] if opts [ :sort_order ] query_params [ :lifecycleState ] = opts [ :lifecycle_state ] if opts [ :lifecycle_state ] 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_users' ) 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::User>' ) end end
Lists the users in your tenancy.
Lists the users in your tenancy .
# 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::User User}>
A Response object with data of type Array< { OCI :: Identity :: Models :: User User } >
Response
compartment_id
opts
:lifecycle_state A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
: lifecycle_state A filter to only return resources that match the given lifecycle state . The state value is case - insensitive .
opts the optional parameters
opts the optional parameters
note
Click [here] to see an example of how to use list_users API.
Click [ here ] to see an example of how to use list_users API .