Skip to content

delete_git_hub_account_token async

delete_git_hub_account_token(
    *,
    config_overrides: Optional[AsyncCodeDeployClientConfig] = None,
    token_name: Optional[GitHubAccountTokenName] = None,
) -> DeleteGitHubAccountTokenOutput

Deletes a GitHub account connection.

Parameters:

Raises:

Source code in docs_src/capo_codedeploy/_services/async_code_deploy.py
async def delete_git_hub_account_token(
    self,
    *,
    config_overrides: Optional[AsyncCodeDeployClientConfig] = None,
    token_name: Optional[
        "capo_codedeploy.types.git_hub_account_token_name.GitHubAccountTokenName"
    ] = None,
) -> "capo_codedeploy.types.delete_git_hub_account_token_output.DeleteGitHubAccountTokenOutput":
    """<p>Deletes a GitHub account connection.</p>

    Args:
        token_name: <p>The name of the GitHub account connection to delete.</p>

    Raises:
        capo_codedeploy.errors.git_hub_account_token_does_not_exist_exception.GitHubAccountTokenDoesNotExistException: <p>No GitHub account connection exists with the named specified in the call.</p>
        capo_codedeploy.errors.git_hub_account_token_name_required_exception.GitHubAccountTokenNameRequiredException: <p>The call is missing a required GitHub account connection name.</p>
        capo_codedeploy.errors.invalid_git_hub_account_token_name_exception.InvalidGitHubAccountTokenNameException: <p>The format of the specified GitHub account connection name is invalid.</p>
        capo_codedeploy.errors.operation_not_supported_exception.OperationNotSupportedException: <p>The API used does not support the deployment.</p>
        capo_codedeploy.errors.resource_validation_exception.ResourceValidationException: <p>The specified resource could not be validated.</p>
        capo_codedeploy.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_codedeploy.types.delete_git_hub_account_token_input.DeleteGitHubAccountTokenInput]",
    ) -> AsyncOperationResponse[
        "capo_codedeploy.types.delete_git_hub_account_token_output.DeleteGitHubAccountTokenOutput"
    ]:
        import capo_codedeploy._operations.code_deploy_20141006.delete_git_hub_account_token

        (
            output,
            http_response,
        ) = await capo_codedeploy._operations.code_deploy_20141006.delete_git_hub_account_token.async_delete_git_hub_account_token(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteGitHubAccountToken")
    )
    input_: capo_codedeploy.types.delete_git_hub_account_token_input.DeleteGitHubAccountTokenInput = {}
    if token_name is not None:
        input_["token_name"] = token_name

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