lib/oci/identity/identity_client.rb
# Lists the `UserGroupMembership` objects in your tenancy. You must specify your tenancy's OCID
# as the value for the compartment ID
# (see [Where to Get the Tenancy's OCID and User's OCID](https://docs.cloud.oracle.com/Content/API/Concepts/apisigningkey.htm#five)).
# You must also then filter the list in one of these ways:
#
# - You can limit the results to just the memberships for a given user by specifying a `userId`.
# - Similarly, you can limit the results to just the memberships for a given group by specifying a `groupId`.
# - You can set both the `userId` and `groupId` to determine if the specified user is in the specified group.
# If the answer is no, the response is an empty list.
# - Although`userId` and `groupId` are not individually required, you must set one of them.
#
# @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] :user_id The OCID of the user.
# @option opts [String] :group_id The OCID of the group.
# @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)
# @return [Response] A Response object with data of type Array<{OCI::Identity::Models::UserGroupMembership UserGroupMembership}>
# @note Click [here](https://docs.cloud.oracle.com/en-us/iaas/tools/ruby-sdk-examples/latest/identity/list_user_group_memberships.rb.html) to see an example of how to use list_user_group_memberships API.
Lists the `UserGroupMembership` objects in your tenancy. You must specify your tenancy's OCID
as the value for the compartment ID
).
You must also then filter the list in one of these ways.

You can limit the results to just the memberships for a given user by specifying a `userId`.
Similarly, you can limit the results to just the memberships for a given group by specifying a `groupId`.
You can set both the `userId` and `groupId` to determine if the specified user is in the specified group.
If the answer is no, the response is an empty list.
Although`userId` and `groupId` are not individually required, you must set one of them.
Lists the ` UserGroupMembership ` objects in your tenancy . You must specify your tenancy ' s OCID as the value for the compartment ID ) . You must also then filter the list in one of these ways . You can limit the results to just the memberships for a given user by specifying a ` userId ` . Similarly you can limit the results to just the memberships for a given group by specifying a ` groupId ` . You can set both the ` userId ` and ` groupId ` to determine if the specified user is in the specified group . If the answer is no the response is an empty list . Although ` userId ` and ` groupId ` are not individually required you must set one of them .
def list_user_group_memberships(compartment_id, opts = {})
      logger.debug 'Calling operation IdentityClient#list_user_group_memberships.' if logger
      raise "Missing the required parameter 'compartment_id' when calling list_user_group_memberships." if compartment_id.nil?
      path = '/userGroupMemberships/'
      operation_signing_strategy = :standard
      query_params = {}
      query_params[:compartmentId] = compartment_id
      query_params[:userId] = opts[:user_id] if opts[:user_id]
      query_params[:groupId] = opts[:group_id] if opts[:group_id]
      query_params[:page] = opts[:page] if opts[:page]
      query_params[:limit] = opts[:limit] if opts[:limit]
      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_user_group_memberships') 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::UserGroupMembership>'
        )
      end
    end
def list_user_group_memberships ( compartment_id , opts = { } ) logger . debug 'Calling operation IdentityClient#list_user_group_memberships.' if logger raise "Missing the required parameter 'compartment_id' when calling list_user_group_memberships." if compartment_id . nil? path = '/userGroupMemberships/' operation_signing_strategy = :standard query_params = { } query_params [ :compartmentId ] = compartment_id query_params [ :userId ] = opts [ :user_id ] if opts [ :user_id ] query_params [ :groupId ] = opts [ :group_id ] if opts [ :group_id ] query_params [ :page ] = opts [ :page ] if opts [ :page ] query_params [ :limit ] = opts [ :limit ] if opts [ :limit ] 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_user_group_memberships' ) 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::UserGroupMembership>' ) end end
Lists the `UserGroupMembership` objects in your tenancy.
Lists the ` UserGroupMembership ` objects 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::UserGroupMembership UserGroupMembership}>
A Response object with data of type Array< { OCI :: Identity :: Models :: UserGroupMembership UserGroupMembership } >
Response
compartment_id
<not_specific>
opts
:limit The maximum number of items to return in a paginated \"List\" call. (default to 20)
: limit The maximum number of items to return in a paginated \ " List \ " call . ( default to 20 )
<not_specific>
opts the optional parameters
opts the optional parameters
note
Click [here] to see an example of how to use list_user_group_memberships API.
Click [ here ] to see an example of how to use list_user_group_memberships API .