Skip to content

list_users async

list_users(
    server_id: ServerId,
    *,
    config_overrides: Optional[AsyncTransferClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListUsersResponse

Lists the users for a file transfer protocol-enabled server that you specify by passing the ServerId parameter.

Parameters:

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

    Specifies the number of users to return as a response to the ListUsers request.

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

    If there are additional results from the ListUsers call, a NextToken parameter is returned in the output. You can then pass the NextToken to a subsequent ListUsers command, to continue listing additional users.

  • server_id (ServerId) –

    A system-assigned unique identifier for a server that has users assigned to it.

Raises:

Source code in docs_src/capo_transfer/_services/async_transfer.py
async def list_users(
    self,
    server_id: "capo_transfer.types.server_id.ServerId",
    *,
    config_overrides: Optional[AsyncTransferClientConfig] = None,
    max_results: Optional["capo_transfer.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_transfer.types.next_token.NextToken"] = None,
) -> "capo_transfer.types.list_users_response.ListUsersResponse":
    """<p>Lists the users for a file transfer protocol-enabled server that you specify by passing the <code>ServerId</code> parameter.</p>

    Args:
        max_results: <p>Specifies the number of users to return as a response to the <code>ListUsers</code> request.</p>
        next_token: <p>If there are additional results from the <code>ListUsers</code> call, a <code>NextToken</code> parameter is returned in the output. You can then pass the <code>NextToken</code> to a subsequent <code>ListUsers</code> command, to continue listing additional users.</p>
        server_id: <p>A system-assigned unique identifier for a server that has users assigned to it.</p>

    Raises:
        capo_transfer.errors.internal_service_error.InternalServiceError: <p>This exception is thrown when an error occurs in the Transfer Family service.</p>
        capo_transfer.errors.invalid_next_token_exception.InvalidNextTokenException: <p>The <code>NextToken</code> parameter that was passed is invalid.</p>
        capo_transfer.errors.invalid_request_exception.InvalidRequestException: <p>This exception is thrown when the client submits a malformed request.</p>
        capo_transfer.errors.resource_not_found_exception.ResourceNotFoundException: <p>This exception is thrown when a resource is not found by the Amazon Web ServicesTransfer Family service.</p>
        capo_transfer.errors.service_unavailable_exception.ServiceUnavailableException: <p>The request has failed because the Amazon Web ServicesTransfer Family service is not available.</p>
        capo_transfer.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_transfer.types.list_users_request.ListUsersRequest]",
    ) -> AsyncOperationResponse[
        "capo_transfer.types.list_users_response.ListUsersResponse"
    ]:
        import capo_transfer._operations.transfer_service.list_users

        (
            output,
            http_response,
        ) = await capo_transfer._operations.transfer_service.list_users.async_list_users(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListUsers")
    )
    input_: capo_transfer.types.list_users_request.ListUsersRequest = {
        "server_id": server_id
    }
    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