UpdateApprovalRuleTemplateContentCommand

Updates the content of an approval rule template. You can change the number of required approvals, the membership of the approval rule, and whether an approval pool is defined.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { CodeCommitClient, UpdateApprovalRuleTemplateContentCommand } from "@aws-sdk/client-codecommit"; // ES Modules import
// const { CodeCommitClient, UpdateApprovalRuleTemplateContentCommand } = require("@aws-sdk/client-codecommit"); // CommonJS import
const client = new CodeCommitClient(config);
const input = { // UpdateApprovalRuleTemplateContentInput
  approvalRuleTemplateName: "STRING_VALUE", // required
  newRuleContent: "STRING_VALUE", // required
  existingRuleContentSha256: "STRING_VALUE",
};
const command = new UpdateApprovalRuleTemplateContentCommand(input);
const response = await client.send(command);
// { // UpdateApprovalRuleTemplateContentOutput
//   approvalRuleTemplate: { // ApprovalRuleTemplate
//     approvalRuleTemplateId: "STRING_VALUE",
//     approvalRuleTemplateName: "STRING_VALUE",
//     approvalRuleTemplateDescription: "STRING_VALUE",
//     approvalRuleTemplateContent: "STRING_VALUE",
//     ruleContentSha256: "STRING_VALUE",
//     lastModifiedDate: new Date("TIMESTAMP"),
//     creationDate: new Date("TIMESTAMP"),
//     lastModifiedUser: "STRING_VALUE",
//   },
// };

UpdateApprovalRuleTemplateContentCommand Input

Parameter
Type
Description
approvalRuleTemplateName
Required
string | undefined

The name of the approval rule template where you want to update the content of the rule.

newRuleContent
Required
string | undefined

The content that replaces the existing content of the rule. Content statements must be complete. You cannot provide only the changes.

existingRuleContentSha256
string | undefined

The SHA-256 hash signature for the content of the approval rule. You can retrieve this information by using GetPullRequest.

UpdateApprovalRuleTemplateContentCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
approvalRuleTemplate
Required
ApprovalRuleTemplate | undefined

Returns information about an approval rule template.

Throws

Name
Fault
Details
ApprovalRuleTemplateContentRequiredException
client

The content for the approval rule template is empty. You must provide some content for an approval rule template. The content cannot be null.

ApprovalRuleTemplateDoesNotExistException
client

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.

ApprovalRuleTemplateNameRequiredException
client

An approval rule template name is required, but was not specified.

InvalidApprovalRuleTemplateContentException
client

The content of the approval rule template is not valid.

InvalidApprovalRuleTemplateNameException
client

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 Quotas  in the CodeCommit User Guide.

InvalidRuleContentSha256Exception
client

The SHA-256 hash signature for the rule content is not valid.

CodeCommitServiceException
Base exception class for all service exceptions from CodeCommit service.