com.amazonaws.services.codegurureviewer.model.CreateCodeReviewRequest Maven / Gradle / Ivy
Show all versions of aws-java-sdk-codegurureviewer Show documentation
/*
* Copyright 2019-2024 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.codegurureviewer.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 CreateCodeReviewRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable {
/**
*
* The name of the code review. The name of each code review in your Amazon Web Services account must be unique.
*
*/
private String name;
/**
*
* The Amazon Resource Name (ARN) of the RepositoryAssociation object. You can retrieve this ARN by calling ListRepositoryAssociations.
*
*
* A code review can only be created on an associated repository. This is the ARN of the associated repository.
*
*/
private String repositoryAssociationArn;
/**
*
* The type of code review to create. This is specified using a CodeReviewType
* object. You can create a code review only of type RepositoryAnalysis
.
*
*/
private CodeReviewType type;
/**
*
* Amazon CodeGuru Reviewer uses this value to prevent the accidental creation of duplicate code reviews if there
* are failures and retries.
*
*/
private String clientRequestToken;
/**
*
* The name of the code review. The name of each code review in your Amazon Web Services account must be unique.
*
*
* @param name
* The name of the code review. The name of each code review in your Amazon Web Services account must be
* unique.
*/
public void setName(String name) {
this.name = name;
}
/**
*
* The name of the code review. The name of each code review in your Amazon Web Services account must be unique.
*
*
* @return The name of the code review. The name of each code review in your Amazon Web Services account must be
* unique.
*/
public String getName() {
return this.name;
}
/**
*
* The name of the code review. The name of each code review in your Amazon Web Services account must be unique.
*
*
* @param name
* The name of the code review. The name of each code review in your Amazon Web Services account must be
* unique.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCodeReviewRequest withName(String name) {
setName(name);
return this;
}
/**
*
* The Amazon Resource Name (ARN) of the RepositoryAssociation object. You can retrieve this ARN by calling ListRepositoryAssociations.
*
*
* A code review can only be created on an associated repository. This is the ARN of the associated repository.
*
*
* @param repositoryAssociationArn
* The Amazon Resource Name (ARN) of the RepositoryAssociation object. You can retrieve this ARN by calling ListRepositoryAssociations.
*
* A code review can only be created on an associated repository. This is the ARN of the associated
* repository.
*/
public void setRepositoryAssociationArn(String repositoryAssociationArn) {
this.repositoryAssociationArn = repositoryAssociationArn;
}
/**
*
* The Amazon Resource Name (ARN) of the RepositoryAssociation object. You can retrieve this ARN by calling ListRepositoryAssociations.
*
*
* A code review can only be created on an associated repository. This is the ARN of the associated repository.
*
*
* @return The Amazon Resource Name (ARN) of the RepositoryAssociation object. You can retrieve this ARN by calling ListRepositoryAssociations.
*
* A code review can only be created on an associated repository. This is the ARN of the associated
* repository.
*/
public String getRepositoryAssociationArn() {
return this.repositoryAssociationArn;
}
/**
*
* The Amazon Resource Name (ARN) of the RepositoryAssociation object. You can retrieve this ARN by calling ListRepositoryAssociations.
*
*
* A code review can only be created on an associated repository. This is the ARN of the associated repository.
*
*
* @param repositoryAssociationArn
* The Amazon Resource Name (ARN) of the RepositoryAssociation object. You can retrieve this ARN by calling ListRepositoryAssociations.
*
* A code review can only be created on an associated repository. This is the ARN of the associated
* repository.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCodeReviewRequest withRepositoryAssociationArn(String repositoryAssociationArn) {
setRepositoryAssociationArn(repositoryAssociationArn);
return this;
}
/**
*
* The type of code review to create. This is specified using a CodeReviewType
* object. You can create a code review only of type RepositoryAnalysis
.
*
*
* @param type
* The type of code review to create. This is specified using a CodeReviewType
* object. You can create a code review only of type RepositoryAnalysis
.
*/
public void setType(CodeReviewType type) {
this.type = type;
}
/**
*
* The type of code review to create. This is specified using a CodeReviewType
* object. You can create a code review only of type RepositoryAnalysis
.
*
*
* @return The type of code review to create. This is specified using a CodeReviewType object. You can create a code review only of type RepositoryAnalysis
.
*/
public CodeReviewType getType() {
return this.type;
}
/**
*
* The type of code review to create. This is specified using a CodeReviewType
* object. You can create a code review only of type RepositoryAnalysis
.
*
*
* @param type
* The type of code review to create. This is specified using a CodeReviewType
* object. You can create a code review only of type RepositoryAnalysis
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCodeReviewRequest withType(CodeReviewType type) {
setType(type);
return this;
}
/**
*
* Amazon CodeGuru Reviewer uses this value to prevent the accidental creation of duplicate code reviews if there
* are failures and retries.
*
*
* @param clientRequestToken
* Amazon CodeGuru Reviewer uses this value to prevent the accidental creation of duplicate code reviews if
* there are failures and retries.
*/
public void setClientRequestToken(String clientRequestToken) {
this.clientRequestToken = clientRequestToken;
}
/**
*
* Amazon CodeGuru Reviewer uses this value to prevent the accidental creation of duplicate code reviews if there
* are failures and retries.
*
*
* @return Amazon CodeGuru Reviewer uses this value to prevent the accidental creation of duplicate code reviews if
* there are failures and retries.
*/
public String getClientRequestToken() {
return this.clientRequestToken;
}
/**
*
* Amazon CodeGuru Reviewer uses this value to prevent the accidental creation of duplicate code reviews if there
* are failures and retries.
*
*
* @param clientRequestToken
* Amazon CodeGuru Reviewer uses this value to prevent the accidental creation of duplicate code reviews if
* there are failures and retries.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public CreateCodeReviewRequest withClientRequestToken(String clientRequestToken) {
setClientRequestToken(clientRequestToken);
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 (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getRepositoryAssociationArn() != null)
sb.append("RepositoryAssociationArn: ").append(getRepositoryAssociationArn()).append(",");
if (getType() != null)
sb.append("Type: ").append(getType()).append(",");
if (getClientRequestToken() != null)
sb.append("ClientRequestToken: ").append(getClientRequestToken());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof CreateCodeReviewRequest == false)
return false;
CreateCodeReviewRequest other = (CreateCodeReviewRequest) obj;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getRepositoryAssociationArn() == null ^ this.getRepositoryAssociationArn() == null)
return false;
if (other.getRepositoryAssociationArn() != null && other.getRepositoryAssociationArn().equals(this.getRepositoryAssociationArn()) == false)
return false;
if (other.getType() == null ^ this.getType() == null)
return false;
if (other.getType() != null && other.getType().equals(this.getType()) == false)
return false;
if (other.getClientRequestToken() == null ^ this.getClientRequestToken() == null)
return false;
if (other.getClientRequestToken() != null && other.getClientRequestToken().equals(this.getClientRequestToken()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getRepositoryAssociationArn() == null) ? 0 : getRepositoryAssociationArn().hashCode());
hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode());
hashCode = prime * hashCode + ((getClientRequestToken() == null) ? 0 : getClientRequestToken().hashCode());
return hashCode;
}
@Override
public CreateCodeReviewRequest clone() {
return (CreateCodeReviewRequest) super.clone();
}
}