aws-sdk-codegurureviewer 1.98.0

AWS SDK for Amazon CodeGuru Reviewer
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateCodeReviewInput {
    /// <p>The name of the code review. The name of each code review in your Amazon Web Services account must be unique.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The Amazon Resource Name (ARN) of the <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociation.html">RepositoryAssociation</a> object. You can retrieve this ARN by calling <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListRepositoryAssociations.html">ListRepositoryAssociations</a>.</p>
    /// <p>A code review can only be created on an associated repository. This is the ARN of the associated repository.</p>
    pub repository_association_arn: ::std::option::Option<::std::string::String>,
    /// <p>The type of code review to create. This is specified using a <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReviewType.html">CodeReviewType</a> object. You can create a code review only of type <code>RepositoryAnalysis</code>.</p>
    pub r#type: ::std::option::Option<crate::types::CodeReviewType>,
    /// <p>Amazon CodeGuru Reviewer uses this value to prevent the accidental creation of duplicate code reviews if there are failures and retries.</p>
    pub client_request_token: ::std::option::Option<::std::string::String>,
}
impl CreateCodeReviewInput {
    /// <p>The name of the code review. The name of each code review in your Amazon Web Services account must be unique.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The Amazon Resource Name (ARN) of the <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociation.html">RepositoryAssociation</a> object. You can retrieve this ARN by calling <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListRepositoryAssociations.html">ListRepositoryAssociations</a>.</p>
    /// <p>A code review can only be created on an associated repository. This is the ARN of the associated repository.</p>
    pub fn repository_association_arn(&self) -> ::std::option::Option<&str> {
        self.repository_association_arn.as_deref()
    }
    /// <p>The type of code review to create. This is specified using a <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReviewType.html">CodeReviewType</a> object. You can create a code review only of type <code>RepositoryAnalysis</code>.</p>
    pub fn r#type(&self) -> ::std::option::Option<&crate::types::CodeReviewType> {
        self.r#type.as_ref()
    }
    /// <p>Amazon CodeGuru Reviewer uses this value to prevent the accidental creation of duplicate code reviews if there are failures and retries.</p>
    pub fn client_request_token(&self) -> ::std::option::Option<&str> {
        self.client_request_token.as_deref()
    }
}
impl CreateCodeReviewInput {
    /// Creates a new builder-style object to manufacture [`CreateCodeReviewInput`](crate::operation::create_code_review::CreateCodeReviewInput).
    pub fn builder() -> crate::operation::create_code_review::builders::CreateCodeReviewInputBuilder {
        crate::operation::create_code_review::builders::CreateCodeReviewInputBuilder::default()
    }
}

/// A builder for [`CreateCodeReviewInput`](crate::operation::create_code_review::CreateCodeReviewInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateCodeReviewInputBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) repository_association_arn: ::std::option::Option<::std::string::String>,
    pub(crate) r#type: ::std::option::Option<crate::types::CodeReviewType>,
    pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
}
impl CreateCodeReviewInputBuilder {
    /// <p>The name of the code review. The name of each code review in your Amazon Web Services account must be unique.</p>
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the code review. The name of each code review in your Amazon Web Services account must be unique.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the code review. The name of each code review in your Amazon Web Services account must be unique.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The Amazon Resource Name (ARN) of the <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociation.html">RepositoryAssociation</a> object. You can retrieve this ARN by calling <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListRepositoryAssociations.html">ListRepositoryAssociations</a>.</p>
    /// <p>A code review can only be created on an associated repository. This is the ARN of the associated repository.</p>
    /// This field is required.
    pub fn repository_association_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.repository_association_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociation.html">RepositoryAssociation</a> object. You can retrieve this ARN by calling <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListRepositoryAssociations.html">ListRepositoryAssociations</a>.</p>
    /// <p>A code review can only be created on an associated repository. This is the ARN of the associated repository.</p>
    pub fn set_repository_association_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.repository_association_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociation.html">RepositoryAssociation</a> object. You can retrieve this ARN by calling <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_ListRepositoryAssociations.html">ListRepositoryAssociations</a>.</p>
    /// <p>A code review can only be created on an associated repository. This is the ARN of the associated repository.</p>
    pub fn get_repository_association_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.repository_association_arn
    }
    /// <p>The type of code review to create. This is specified using a <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReviewType.html">CodeReviewType</a> object. You can create a code review only of type <code>RepositoryAnalysis</code>.</p>
    /// This field is required.
    pub fn r#type(mut self, input: crate::types::CodeReviewType) -> Self {
        self.r#type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of code review to create. This is specified using a <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReviewType.html">CodeReviewType</a> object. You can create a code review only of type <code>RepositoryAnalysis</code>.</p>
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::CodeReviewType>) -> Self {
        self.r#type = input;
        self
    }
    /// <p>The type of code review to create. This is specified using a <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_CodeReviewType.html">CodeReviewType</a> object. You can create a code review only of type <code>RepositoryAnalysis</code>.</p>
    pub fn get_type(&self) -> &::std::option::Option<crate::types::CodeReviewType> {
        &self.r#type
    }
    /// <p>Amazon CodeGuru Reviewer uses this value to prevent the accidental creation of duplicate code reviews if there are failures and retries.</p>
    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_request_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Amazon CodeGuru Reviewer uses this value to prevent the accidental creation of duplicate code reviews if there are failures and retries.</p>
    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_request_token = input;
        self
    }
    /// <p>Amazon CodeGuru Reviewer uses this value to prevent the accidental creation of duplicate code reviews if there are failures and retries.</p>
    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_request_token
    }
    /// Consumes the builder and constructs a [`CreateCodeReviewInput`](crate::operation::create_code_review::CreateCodeReviewInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_code_review::CreateCodeReviewInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_code_review::CreateCodeReviewInput {
            name: self.name,
            repository_association_arn: self.repository_association_arn,
            r#type: self.r#type,
            client_request_token: self.client_request_token,
        })
    }
}