Skip to content

list_api_keys

list_api_keys(
    branch_arn: BranchArn,
    *,
    config_overrides: Optional[AmplifyGen3ClientConfig] = None,
    status: Optional[ApiKeyStatus] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
) -> ListApiKeysResponse

Returns a list of the API keys for a branch. The response includes only the metadata for each key, not the key value. To get the value of a key, use GetApiKey.

Parameters:

  • branch_arn (BranchArn) –

    The Amazon Resource Name (ARN) of the branch to list the API keys for.

  • status (Optional[ApiKeyStatus], default: None ) –

    The status to filter by. If you specify a status, the response includes only the keys that have that status. If you omit this, the response includes keys in every status.

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

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

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

    The pagination token returned in a previous response, used to retrieve the next page of results.

Raises:

Source code in docs_src/capo_amplifygen3/_services/amplify_gen3.py
def list_api_keys(
    self,
    branch_arn: "capo_amplifygen3.types.branch_arn.BranchArn",
    *,
    config_overrides: Optional[AmplifyGen3ClientConfig] = None,
    status: Optional["capo_amplifygen3.types.api_key_status.ApiKeyStatus"] = None,
    max_results: Optional["capo_amplifygen3.types.max_results.MaxResults"] = None,
    next_token: Optional["capo_amplifygen3.types.next_token.NextToken"] = None,
) -> "capo_amplifygen3.types.list_api_keys_response.ListApiKeysResponse":
    """<p>Returns a list of the API keys for a branch. The response includes only the metadata for each key, not the key value. To get the value of a key, use GetApiKey.</p>

    Args:
        branch_arn: <p>The Amazon Resource Name (ARN) of the branch to list the API keys for.</p>
        status: <p>The status to filter by. If you specify a status, the response includes only the keys that have that status. If you omit this, the response includes keys in every status.</p>
        max_results: <p>The maximum number of results to return in a single response.</p>
        next_token: <p>The pagination token returned in a previous response, used to retrieve the next page of results.</p>

    Raises:
        capo_amplifygen3.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action.</p>
        capo_amplifygen3.errors.internal_server_exception.InternalServerException: <p>An internal error occurred. Retry the request.</p>
        capo_amplifygen3.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource was not found.</p>
        capo_amplifygen3.errors.throttling_exception.ThrottlingException: <p>The request was denied because the request rate exceeds the allowed limit.</p>
        capo_amplifygen3.errors.validation_exception.ValidationException: <p>The request contains invalid parameters or is otherwise malformed.</p>
        capo_amplifygen3.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_amplifygen3.types.list_api_keys_request.ListApiKeysRequest]",
    ) -> OperationResponse[
        "capo_amplifygen3.types.list_api_keys_response.ListApiKeysResponse"
    ]:
        import capo_amplifygen3._operations.omega.list_api_keys

        output, http_response = (
            capo_amplifygen3._operations.omega.list_api_keys.list_api_keys(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListApiKeys")
    )
    input_: capo_amplifygen3.types.list_api_keys_request.ListApiKeysRequest = {
        "branch_arn": branch_arn
    }
    if status is not None:
        input_["status"] = status
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output