Skip to content

list_memberships async

list_memberships(
    application_id: ApplicationId,
    agent_space_id: AgentSpaceId,
    *,
    config_overrides: Optional[AsyncSecurityAgentClientConfig] = None,
    member_type: Optional[MembershipTypeFilter] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListMembershipsResponse

Returns a paginated list of membership summaries for the specified agent space within an application.

Parameters:

  • application_id (ApplicationId) –

    The unique identifier of the application that contains the agent space.

  • agent_space_id (AgentSpaceId) –

    The unique identifier of the agent space to list memberships for.

  • member_type (Optional[MembershipTypeFilter], default: None ) –

    Filter memberships by member type.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of results to return in a single call.

  • next_token (Optional[NextToken], default: None ) –

    A token to use for paginating results that are returned in the response. Set the value of this parameter to null for the first request. For subsequent calls, use the nextToken value returned from the previous request.

Raises:

Source code in docs_src/capo_securityagent/_services/async_security_agent.py
async def list_memberships(
    self,
    application_id: "capo_securityagent.types.application_id.ApplicationId",
    agent_space_id: "capo_securityagent.types.agent_space_id.AgentSpaceId",
    *,
    config_overrides: Optional[AsyncSecurityAgentClientConfig] = None,
    member_type: Optional[
        "capo_securityagent.types.membership_type_filter.MembershipTypeFilter"
    ] = None,
    max_results: Optional["capo_securityagent.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_securityagent.types.next_token.NextToken"] = None,
) -> "capo_securityagent.types.list_memberships_response.ListMembershipsResponse":
    """<p>Returns a paginated list of membership summaries for the specified agent space within an application.</p>

    Args:
        application_id: <p>The unique identifier of the application that contains the agent space.</p>
        agent_space_id: <p>The unique identifier of the agent space to list memberships for.</p>
        member_type: <p>Filter memberships by member type.</p>
        max_results: <p>The maximum number of results to return in a single call.</p>
        next_token: <p>A token to use for paginating results that are returned in the response. Set the value of this parameter to null for the first request. For subsequent calls, use the nextToken value returned from the previous request.</p>

    Raises:
        capo_securityagent.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_securityagent.types.list_memberships_request.ListMembershipsRequest]",
    ) -> AsyncOperationResponse[
        "capo_securityagent.types.list_memberships_response.ListMembershipsResponse"
    ]:
        import capo_securityagent._operations.security_agent.list_memberships

        (
            output,
            http_response,
        ) = await capo_securityagent._operations.security_agent.list_memberships.async_list_memberships(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListMemberships")
    )
    input_: capo_securityagent.types.list_memberships_request.ListMembershipsRequest = {
        "application_id": application_id,
        "agent_space_id": agent_space_id,
    }
    if member_type is not None:
        input_["member_type"] = member_type
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output