Skip to content

put_approval_result async

put_approval_result(
    pipeline_name: PipelineName,
    stage_name: StageName,
    action_name: ActionName,
    result: ApprovalResult,
    token: ApprovalToken,
    *,
    config_overrides: Optional[AsyncCodePipelineClientConfig] = None,
) -> PutApprovalResultOutput

Provides the response to a manual approval request to CodePipeline. Valid responses include Approved and Rejected.

Parameters:

  • pipeline_name (PipelineName) –

    The name of the pipeline that contains the action.

  • stage_name (StageName) –

    The name of the stage that contains the action.

  • action_name (ActionName) –

    The name of the action for which approval is requested.

  • result (ApprovalResult) –

    Represents information about the result of the approval request.

  • token (ApprovalToken) –

    The system-generated token used to identify a unique approval request. The token for each open approval request can be obtained using the GetPipelineState action. It is used to validate that the approval request corresponding to this token is still valid.

    For a pipeline where the execution mode is set to PARALLEL, the token required to approve/reject an approval request as detailed above is not available. Instead, use the externalExecutionId in the response output from the ListActionExecutions action as the token in the approval request.

Raises:

Source code in docs_src/capo_codepipeline/_services/async_code_pipeline.py
async def put_approval_result(
    self,
    pipeline_name: "capo_codepipeline.types.pipeline_name.PipelineName",
    stage_name: "capo_codepipeline.types.stage_name.StageName",
    action_name: "capo_codepipeline.types.action_name.ActionName",
    result: "capo_codepipeline.types.approval_result.ApprovalResult",
    token: "capo_codepipeline.types.approval_token.ApprovalToken",
    *,
    config_overrides: Optional[AsyncCodePipelineClientConfig] = None,
) -> "capo_codepipeline.types.put_approval_result_output.PutApprovalResultOutput":
    """<p>Provides the response to a manual approval request to CodePipeline. Valid responses include Approved and Rejected.</p>

    Args:
        pipeline_name: <p>The name of the pipeline that contains the action. </p>
        stage_name: <p>The name of the stage that contains the action.</p>
        action_name: <p>The name of the action for which approval is requested.</p>
        result: <p>Represents information about the result of the approval request.</p>
        token: <p>The system-generated token used to identify a unique approval request. The token for each open approval request can be obtained using the <a>GetPipelineState</a> action. It is used to validate that the approval request corresponding to this token is still valid.</p> <important> <p>For a pipeline where the execution mode is set to PARALLEL, the token required to approve/reject an approval request as detailed above is not available. Instead, use the <code>externalExecutionId</code> in the response output from the <a>ListActionExecutions</a> action as the token in the approval request.</p> </important>

    Raises:
        capo_codepipeline.errors.action_not_found_exception.ActionNotFoundException: <p>The specified action cannot be found.</p>
        capo_codepipeline.errors.approval_already_completed_exception.ApprovalAlreadyCompletedException: <p>The approval action has already been approved or rejected.</p>
        capo_codepipeline.errors.invalid_approval_token_exception.InvalidApprovalTokenException: <p>The approval request already received a response or has expired.</p>
        capo_codepipeline.errors.pipeline_not_found_exception.PipelineNotFoundException: <p>The pipeline was specified in an invalid format or cannot be found.</p>
        capo_codepipeline.errors.stage_not_found_exception.StageNotFoundException: <p>The stage was specified in an invalid format or cannot be found.</p>
        capo_codepipeline.errors.validation_exception.ValidationException: <p>The validation was specified in an invalid format.</p>
        capo_codepipeline.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_codepipeline.types.put_approval_result_input.PutApprovalResultInput]",
    ) -> AsyncOperationResponse[
        "capo_codepipeline.types.put_approval_result_output.PutApprovalResultOutput"
    ]:
        import capo_codepipeline._operations.code_pipeline_20150709.put_approval_result

        (
            output,
            http_response,
        ) = await capo_codepipeline._operations.code_pipeline_20150709.put_approval_result.async_put_approval_result(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutApprovalResult")
    )
    input_: capo_codepipeline.types.put_approval_result_input.PutApprovalResultInput = {
        "pipeline_name": pipeline_name,
        "stage_name": stage_name,
        "action_name": action_name,
        "result": result,
        "token": token,
    }

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