
com.amazonaws.services.codecommit.model.CreateApprovalRuleTemplateRequest Maven / Gradle / Ivy
/*
* Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.codecommit.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class CreateApprovalRuleTemplateRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The name of the approval rule template. Provide descriptive names, because this name is applied to the approval
* rules created automatically in associated repositories.
*
*/
private String approvalRuleTemplateName;
/**
*
* The content of the approval rule that is created on pull requests in associated repositories. If you specify one
* or more destination references (branches), approval rules are created in an associated repository only if their
* destination references (branches) match those specified in the template.
*
*
*
* When you create the content of the approval rule template, you can specify approvers in an approval pool in one
* of two ways:
*
*
* -
*
* CodeCommitApprovers: This option only requires an AWS account and a resource. It can be used for both IAM
* users and federated access users whose name matches the provided resource name. This is a very powerful option
* that offers a great deal of flexibility. For example, if you specify the AWS account 123456789012 and
* Mary_Major, all of the following are counted as approvals coming from that user:
*
*
* -
*
* An IAM user in the account (arn:aws:iam::123456789012:user/Mary_Major)
*
*
* -
*
* A federated user identified in IAM as Mary_Major
* (arn:aws:sts::123456789012:federated-user/Mary_Major)
*
*
*
*
* This option does not recognize an active session of someone assuming the role of CodeCommitReview with a role
* session name of Mary_Major
* (arn:aws:sts::123456789012:assumed-role/CodeCommitReview/Mary_Major) unless you include a wildcard
* (*Mary_Major).
*
*
* -
*
* Fully qualified ARN: This option allows you to specify the fully qualified Amazon Resource Name (ARN) of
* the IAM user or role.
*
*
*
*
* For more information about IAM ARNs, wildcards, and formats, see IAM Identifiers in the
* IAM User Guide.
*
*
*/
private String approvalRuleTemplateContent;
/**
*
* The description of the approval rule template. Consider providing a description that explains what this template
* does and when it might be appropriate to associate it with repositories.
*
*/
private String approvalRuleTemplateDescription;
/**
*
* The name of the approval rule template. Provide descriptive names, because this name is applied to the approval
* rules created automatically in associated repositories.
*
*
* @param approvalRuleTemplateName
* The name of the approval rule template. Provide descriptive names, because this name is applied to the
* approval rules created automatically in associated repositories.
*/
public void setApprovalRuleTemplateName(String approvalRuleTemplateName) {
this.approvalRuleTemplateName = approvalRuleTemplateName;
}
/**
*
* The name of the approval rule template. Provide descriptive names, because this name is applied to the approval
* rules created automatically in associated repositories.
*
*
* @return The name of the approval rule template. Provide descriptive names, because this name is applied to the
* approval rules created automatically in associated repositories.
*/
public String getApprovalRuleTemplateName() {
return this.approvalRuleTemplateName;
}
/**
*
* The name of the approval rule template. Provide descriptive names, because this name is applied to the approval
* rules created automatically in associated repositories.
*
*
* @param approvalRuleTemplateName
* The name of the approval rule template. Provide descriptive names, because this name is applied to the
* approval rules created automatically in associated repositories.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateApprovalRuleTemplateRequest withApprovalRuleTemplateName(String approvalRuleTemplateName) {
setApprovalRuleTemplateName(approvalRuleTemplateName);
return this;
}
/**
*
* The content of the approval rule that is created on pull requests in associated repositories. If you specify one
* or more destination references (branches), approval rules are created in an associated repository only if their
* destination references (branches) match those specified in the template.
*
*
*
* When you create the content of the approval rule template, you can specify approvers in an approval pool in one
* of two ways:
*
*
* -
*
* CodeCommitApprovers: This option only requires an AWS account and a resource. It can be used for both IAM
* users and federated access users whose name matches the provided resource name. This is a very powerful option
* that offers a great deal of flexibility. For example, if you specify the AWS account 123456789012 and
* Mary_Major, all of the following are counted as approvals coming from that user:
*
*
* -
*
* An IAM user in the account (arn:aws:iam::123456789012:user/Mary_Major)
*
*
* -
*
* A federated user identified in IAM as Mary_Major
* (arn:aws:sts::123456789012:federated-user/Mary_Major)
*
*
*
*
* This option does not recognize an active session of someone assuming the role of CodeCommitReview with a role
* session name of Mary_Major
* (arn:aws:sts::123456789012:assumed-role/CodeCommitReview/Mary_Major) unless you include a wildcard
* (*Mary_Major).
*
*
* -
*
* Fully qualified ARN: This option allows you to specify the fully qualified Amazon Resource Name (ARN) of
* the IAM user or role.
*
*
*
*
* For more information about IAM ARNs, wildcards, and formats, see IAM Identifiers in the
* IAM User Guide.
*
*
*
* @param approvalRuleTemplateContent
* The content of the approval rule that is created on pull requests in associated repositories. If you
* specify one or more destination references (branches), approval rules are created in an associated
* repository only if their destination references (branches) match those specified in the template.
*
*
* When you create the content of the approval rule template, you can specify approvers in an approval pool
* in one of two ways:
*
*
* -
*
* CodeCommitApprovers: This option only requires an AWS account and a resource. It can be used for
* both IAM users and federated access users whose name matches the provided resource name. This is a very
* powerful option that offers a great deal of flexibility. For example, if you specify the AWS account
* 123456789012 and Mary_Major, all of the following are counted as approvals coming from that
* user:
*
*
* -
*
* An IAM user in the account (arn:aws:iam::123456789012:user/Mary_Major)
*
*
* -
*
* A federated user identified in IAM as Mary_Major
* (arn:aws:sts::123456789012:federated-user/Mary_Major)
*
*
*
*
* This option does not recognize an active session of someone assuming the role of CodeCommitReview with a
* role session name of Mary_Major
* (arn:aws:sts::123456789012:assumed-role/CodeCommitReview/Mary_Major) unless you include a
* wildcard (*Mary_Major).
*
*
* -
*
* Fully qualified ARN: This option allows you to specify the fully qualified Amazon Resource Name
* (ARN) of the IAM user or role.
*
*
*
*
* For more information about IAM ARNs, wildcards, and formats, see IAM Identifiers in
* the IAM User Guide.
*
*/
public void setApprovalRuleTemplateContent(String approvalRuleTemplateContent) {
this.approvalRuleTemplateContent = approvalRuleTemplateContent;
}
/**
*
* The content of the approval rule that is created on pull requests in associated repositories. If you specify one
* or more destination references (branches), approval rules are created in an associated repository only if their
* destination references (branches) match those specified in the template.
*
*
*
* When you create the content of the approval rule template, you can specify approvers in an approval pool in one
* of two ways:
*
*
* -
*
* CodeCommitApprovers: This option only requires an AWS account and a resource. It can be used for both IAM
* users and federated access users whose name matches the provided resource name. This is a very powerful option
* that offers a great deal of flexibility. For example, if you specify the AWS account 123456789012 and
* Mary_Major, all of the following are counted as approvals coming from that user:
*
*
* -
*
* An IAM user in the account (arn:aws:iam::123456789012:user/Mary_Major)
*
*
* -
*
* A federated user identified in IAM as Mary_Major
* (arn:aws:sts::123456789012:federated-user/Mary_Major)
*
*
*
*
* This option does not recognize an active session of someone assuming the role of CodeCommitReview with a role
* session name of Mary_Major
* (arn:aws:sts::123456789012:assumed-role/CodeCommitReview/Mary_Major) unless you include a wildcard
* (*Mary_Major).
*
*
* -
*
* Fully qualified ARN: This option allows you to specify the fully qualified Amazon Resource Name (ARN) of
* the IAM user or role.
*
*
*
*
* For more information about IAM ARNs, wildcards, and formats, see IAM Identifiers in the
* IAM User Guide.
*
*
*
* @return The content of the approval rule that is created on pull requests in associated repositories. If you
* specify one or more destination references (branches), approval rules are created in an associated
* repository only if their destination references (branches) match those specified in the template.
*
*
* When you create the content of the approval rule template, you can specify approvers in an approval pool
* in one of two ways:
*
*
* -
*
* CodeCommitApprovers: This option only requires an AWS account and a resource. It can be used for
* both IAM users and federated access users whose name matches the provided resource name. This is a very
* powerful option that offers a great deal of flexibility. For example, if you specify the AWS account
* 123456789012 and Mary_Major, all of the following are counted as approvals coming from that
* user:
*
*
* -
*
* An IAM user in the account (arn:aws:iam::123456789012:user/Mary_Major)
*
*
* -
*
* A federated user identified in IAM as Mary_Major
* (arn:aws:sts::123456789012:federated-user/Mary_Major)
*
*
*
*
* This option does not recognize an active session of someone assuming the role of CodeCommitReview with a
* role session name of Mary_Major
* (arn:aws:sts::123456789012:assumed-role/CodeCommitReview/Mary_Major) unless you include a
* wildcard (*Mary_Major).
*
*
* -
*
* Fully qualified ARN: This option allows you to specify the fully qualified Amazon Resource Name
* (ARN) of the IAM user or role.
*
*
*
*
* For more information about IAM ARNs, wildcards, and formats, see IAM Identifiers in
* the IAM User Guide.
*
*/
public String getApprovalRuleTemplateContent() {
return this.approvalRuleTemplateContent;
}
/**
*
* The content of the approval rule that is created on pull requests in associated repositories. If you specify one
* or more destination references (branches), approval rules are created in an associated repository only if their
* destination references (branches) match those specified in the template.
*
*
*
* When you create the content of the approval rule template, you can specify approvers in an approval pool in one
* of two ways:
*
*
* -
*
* CodeCommitApprovers: This option only requires an AWS account and a resource. It can be used for both IAM
* users and federated access users whose name matches the provided resource name. This is a very powerful option
* that offers a great deal of flexibility. For example, if you specify the AWS account 123456789012 and
* Mary_Major, all of the following are counted as approvals coming from that user:
*
*
* -
*
* An IAM user in the account (arn:aws:iam::123456789012:user/Mary_Major)
*
*
* -
*
* A federated user identified in IAM as Mary_Major
* (arn:aws:sts::123456789012:federated-user/Mary_Major)
*
*
*
*
* This option does not recognize an active session of someone assuming the role of CodeCommitReview with a role
* session name of Mary_Major
* (arn:aws:sts::123456789012:assumed-role/CodeCommitReview/Mary_Major) unless you include a wildcard
* (*Mary_Major).
*
*
* -
*
* Fully qualified ARN: This option allows you to specify the fully qualified Amazon Resource Name (ARN) of
* the IAM user or role.
*
*
*
*
* For more information about IAM ARNs, wildcards, and formats, see IAM Identifiers in the
* IAM User Guide.
*
*
*
* @param approvalRuleTemplateContent
* The content of the approval rule that is created on pull requests in associated repositories. If you
* specify one or more destination references (branches), approval rules are created in an associated
* repository only if their destination references (branches) match those specified in the template.
*
*
* When you create the content of the approval rule template, you can specify approvers in an approval pool
* in one of two ways:
*
*
* -
*
* CodeCommitApprovers: This option only requires an AWS account and a resource. It can be used for
* both IAM users and federated access users whose name matches the provided resource name. This is a very
* powerful option that offers a great deal of flexibility. For example, if you specify the AWS account
* 123456789012 and Mary_Major, all of the following are counted as approvals coming from that
* user:
*
*
* -
*
* An IAM user in the account (arn:aws:iam::123456789012:user/Mary_Major)
*
*
* -
*
* A federated user identified in IAM as Mary_Major
* (arn:aws:sts::123456789012:federated-user/Mary_Major)
*
*
*
*
* This option does not recognize an active session of someone assuming the role of CodeCommitReview with a
* role session name of Mary_Major
* (arn:aws:sts::123456789012:assumed-role/CodeCommitReview/Mary_Major) unless you include a
* wildcard (*Mary_Major).
*
*
* -
*
* Fully qualified ARN: This option allows you to specify the fully qualified Amazon Resource Name
* (ARN) of the IAM user or role.
*
*
*
*
* For more information about IAM ARNs, wildcards, and formats, see IAM Identifiers in
* the IAM User Guide.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateApprovalRuleTemplateRequest withApprovalRuleTemplateContent(String approvalRuleTemplateContent) {
setApprovalRuleTemplateContent(approvalRuleTemplateContent);
return this;
}
/**
*
* The description of the approval rule template. Consider providing a description that explains what this template
* does and when it might be appropriate to associate it with repositories.
*
*
* @param approvalRuleTemplateDescription
* The description of the approval rule template. Consider providing a description that explains what this
* template does and when it might be appropriate to associate it with repositories.
*/
public void setApprovalRuleTemplateDescription(String approvalRuleTemplateDescription) {
this.approvalRuleTemplateDescription = approvalRuleTemplateDescription;
}
/**
*
* The description of the approval rule template. Consider providing a description that explains what this template
* does and when it might be appropriate to associate it with repositories.
*
*
* @return The description of the approval rule template. Consider providing a description that explains what this
* template does and when it might be appropriate to associate it with repositories.
*/
public String getApprovalRuleTemplateDescription() {
return this.approvalRuleTemplateDescription;
}
/**
*
* The description of the approval rule template. Consider providing a description that explains what this template
* does and when it might be appropriate to associate it with repositories.
*
*
* @param approvalRuleTemplateDescription
* The description of the approval rule template. Consider providing a description that explains what this
* template does and when it might be appropriate to associate it with repositories.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateApprovalRuleTemplateRequest withApprovalRuleTemplateDescription(String approvalRuleTemplateDescription) {
setApprovalRuleTemplateDescription(approvalRuleTemplateDescription);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getApprovalRuleTemplateName() != null)
sb.append("ApprovalRuleTemplateName: ").append(getApprovalRuleTemplateName()).append(",");
if (getApprovalRuleTemplateContent() != null)
sb.append("ApprovalRuleTemplateContent: ").append(getApprovalRuleTemplateContent()).append(",");
if (getApprovalRuleTemplateDescription() != null)
sb.append("ApprovalRuleTemplateDescription: ").append(getApprovalRuleTemplateDescription());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateApprovalRuleTemplateRequest == false)
return false;
CreateApprovalRuleTemplateRequest other = (CreateApprovalRuleTemplateRequest) obj;
if (other.getApprovalRuleTemplateName() == null ^ this.getApprovalRuleTemplateName() == null)
return false;
if (other.getApprovalRuleTemplateName() != null && other.getApprovalRuleTemplateName().equals(this.getApprovalRuleTemplateName()) == false)
return false;
if (other.getApprovalRuleTemplateContent() == null ^ this.getApprovalRuleTemplateContent() == null)
return false;
if (other.getApprovalRuleTemplateContent() != null && other.getApprovalRuleTemplateContent().equals(this.getApprovalRuleTemplateContent()) == false)
return false;
if (other.getApprovalRuleTemplateDescription() == null ^ this.getApprovalRuleTemplateDescription() == null)
return false;
if (other.getApprovalRuleTemplateDescription() != null
&& other.getApprovalRuleTemplateDescription().equals(this.getApprovalRuleTemplateDescription()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getApprovalRuleTemplateName() == null) ? 0 : getApprovalRuleTemplateName().hashCode());
hashCode = prime * hashCode + ((getApprovalRuleTemplateContent() == null) ? 0 : getApprovalRuleTemplateContent().hashCode());
hashCode = prime * hashCode + ((getApprovalRuleTemplateDescription() == null) ? 0 : getApprovalRuleTemplateDescription().hashCode());
return hashCode;
}
@Override
public CreateApprovalRuleTemplateRequest clone() {
return (CreateApprovalRuleTemplateRequest) super.clone();
}
}