Skip to content

get_approval_rule_template async

get_approval_rule_template(
    approval_rule_template_name: ApprovalRuleTemplateName,
    *,
    config_overrides: Optional[AsyncCodeCommitClientConfig] = None,
) -> GetApprovalRuleTemplateOutput

Returns information about a specified approval rule template.

Parameters:

  • approval_rule_template_name (ApprovalRuleTemplateName) –

    The name of the approval rule template for which you want to get information.

Raises:

Source code in docs_src/capo_codecommit/_services/async_code_commit.py
async def get_approval_rule_template(
    self,
    approval_rule_template_name: "capo_codecommit.types.approval_rule_template_name.ApprovalRuleTemplateName",
    *,
    config_overrides: Optional[AsyncCodeCommitClientConfig] = None,
) -> "capo_codecommit.types.get_approval_rule_template_output.GetApprovalRuleTemplateOutput":
    """<p>Returns information about a specified approval rule template.</p>

    Args:
        approval_rule_template_name: <p>The name of the approval rule template for which you want to get information.</p>

    Raises:
        capo_codecommit.errors.approval_rule_template_does_not_exist_exception.ApprovalRuleTemplateDoesNotExistException: <p>The specified approval rule template does not exist. Verify that the name is correct and that you are signed in to the Amazon Web Services Region where the template was created, and then try again.</p>
        capo_codecommit.errors.approval_rule_template_name_required_exception.ApprovalRuleTemplateNameRequiredException: <p>An approval rule template name is required, but was not specified.</p>
        capo_codecommit.errors.invalid_approval_rule_template_name_exception.InvalidApprovalRuleTemplateNameException: <p>The name of the approval rule template is not valid. Template names must be between 1 and 100 valid characters in length. For more information about limits in CodeCommit, see <a href="https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html">Quotas</a> in the <i>CodeCommit User Guide</i>.</p>
        capo_codecommit.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_codecommit.types.get_approval_rule_template_input.GetApprovalRuleTemplateInput]",
    ) -> AsyncOperationResponse[
        "capo_codecommit.types.get_approval_rule_template_output.GetApprovalRuleTemplateOutput"
    ]:
        import capo_codecommit._operations.code_commit_20150413.get_approval_rule_template

        (
            output,
            http_response,
        ) = await capo_codecommit._operations.code_commit_20150413.get_approval_rule_template.async_get_approval_rule_template(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetApprovalRuleTemplate")
    )
    input_: capo_codecommit.types.get_approval_rule_template_input.GetApprovalRuleTemplateInput = {
        "approval_rule_template_name": approval_rule_template_name
    }

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