1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Specifies the source code that is analyzed in a code review.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct SourceCodeType {
    /// <p>A <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType">SourceCodeType</a> that specifies a commit diff created by a pull request on an associated repository.</p>
    pub commit_diff: ::std::option::Option<crate::types::CommitDiffSourceCodeType>,
    /// <p>A <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType">SourceCodeType</a> that specifies the tip of a branch in an associated repository.</p>
    pub repository_head: ::std::option::Option<crate::types::RepositoryHeadSourceCodeType>,
    /// <p>A type of <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType">SourceCodeType</a> that specifies a source branch name and a destination branch name in an associated repository.</p>
    pub branch_diff: ::std::option::Option<crate::types::BranchDiffSourceCodeType>,
    /// <p>Information about an associated repository in an S3 bucket that includes its name and an <code>S3RepositoryDetails</code> object. The <code>S3RepositoryDetails</code> object includes the name of an S3 bucket, an S3 key for a source code .zip file, and an S3 key for a build artifacts .zip file. <code>S3BucketRepository</code> is required in <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType">SourceCodeType</a> for <code>S3BucketRepository</code> based code reviews.</p>
    pub s3_bucket_repository: ::std::option::Option<crate::types::S3BucketRepository>,
    /// <p>Metadata that is associated with a code review. This applies to any type of code review supported by CodeGuru Reviewer. The <code>RequestMetadaa</code> field captures any event metadata. For example, it might capture metadata associated with an event trigger, such as a push or a pull request.</p>
    pub request_metadata: ::std::option::Option<crate::types::RequestMetadata>,
}
impl SourceCodeType {
    /// <p>A <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType">SourceCodeType</a> that specifies a commit diff created by a pull request on an associated repository.</p>
    pub fn commit_diff(&self) -> ::std::option::Option<&crate::types::CommitDiffSourceCodeType> {
        self.commit_diff.as_ref()
    }
    /// <p>A <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType">SourceCodeType</a> that specifies the tip of a branch in an associated repository.</p>
    pub fn repository_head(&self) -> ::std::option::Option<&crate::types::RepositoryHeadSourceCodeType> {
        self.repository_head.as_ref()
    }
    /// <p>A type of <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType">SourceCodeType</a> that specifies a source branch name and a destination branch name in an associated repository.</p>
    pub fn branch_diff(&self) -> ::std::option::Option<&crate::types::BranchDiffSourceCodeType> {
        self.branch_diff.as_ref()
    }
    /// <p>Information about an associated repository in an S3 bucket that includes its name and an <code>S3RepositoryDetails</code> object. The <code>S3RepositoryDetails</code> object includes the name of an S3 bucket, an S3 key for a source code .zip file, and an S3 key for a build artifacts .zip file. <code>S3BucketRepository</code> is required in <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType">SourceCodeType</a> for <code>S3BucketRepository</code> based code reviews.</p>
    pub fn s3_bucket_repository(&self) -> ::std::option::Option<&crate::types::S3BucketRepository> {
        self.s3_bucket_repository.as_ref()
    }
    /// <p>Metadata that is associated with a code review. This applies to any type of code review supported by CodeGuru Reviewer. The <code>RequestMetadaa</code> field captures any event metadata. For example, it might capture metadata associated with an event trigger, such as a push or a pull request.</p>
    pub fn request_metadata(&self) -> ::std::option::Option<&crate::types::RequestMetadata> {
        self.request_metadata.as_ref()
    }
}
impl SourceCodeType {
    /// Creates a new builder-style object to manufacture [`SourceCodeType`](crate::types::SourceCodeType).
    pub fn builder() -> crate::types::builders::SourceCodeTypeBuilder {
        crate::types::builders::SourceCodeTypeBuilder::default()
    }
}

/// A builder for [`SourceCodeType`](crate::types::SourceCodeType).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct SourceCodeTypeBuilder {
    pub(crate) commit_diff: ::std::option::Option<crate::types::CommitDiffSourceCodeType>,
    pub(crate) repository_head: ::std::option::Option<crate::types::RepositoryHeadSourceCodeType>,
    pub(crate) branch_diff: ::std::option::Option<crate::types::BranchDiffSourceCodeType>,
    pub(crate) s3_bucket_repository: ::std::option::Option<crate::types::S3BucketRepository>,
    pub(crate) request_metadata: ::std::option::Option<crate::types::RequestMetadata>,
}
impl SourceCodeTypeBuilder {
    /// <p>A <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType">SourceCodeType</a> that specifies a commit diff created by a pull request on an associated repository.</p>
    pub fn commit_diff(mut self, input: crate::types::CommitDiffSourceCodeType) -> Self {
        self.commit_diff = ::std::option::Option::Some(input);
        self
    }
    /// <p>A <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType">SourceCodeType</a> that specifies a commit diff created by a pull request on an associated repository.</p>
    pub fn set_commit_diff(mut self, input: ::std::option::Option<crate::types::CommitDiffSourceCodeType>) -> Self {
        self.commit_diff = input;
        self
    }
    /// <p>A <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType">SourceCodeType</a> that specifies a commit diff created by a pull request on an associated repository.</p>
    pub fn get_commit_diff(&self) -> &::std::option::Option<crate::types::CommitDiffSourceCodeType> {
        &self.commit_diff
    }
    /// <p>A <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType">SourceCodeType</a> that specifies the tip of a branch in an associated repository.</p>
    pub fn repository_head(mut self, input: crate::types::RepositoryHeadSourceCodeType) -> Self {
        self.repository_head = ::std::option::Option::Some(input);
        self
    }
    /// <p>A <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType">SourceCodeType</a> that specifies the tip of a branch in an associated repository.</p>
    pub fn set_repository_head(mut self, input: ::std::option::Option<crate::types::RepositoryHeadSourceCodeType>) -> Self {
        self.repository_head = input;
        self
    }
    /// <p>A <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType">SourceCodeType</a> that specifies the tip of a branch in an associated repository.</p>
    pub fn get_repository_head(&self) -> &::std::option::Option<crate::types::RepositoryHeadSourceCodeType> {
        &self.repository_head
    }
    /// <p>A type of <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType">SourceCodeType</a> that specifies a source branch name and a destination branch name in an associated repository.</p>
    pub fn branch_diff(mut self, input: crate::types::BranchDiffSourceCodeType) -> Self {
        self.branch_diff = ::std::option::Option::Some(input);
        self
    }
    /// <p>A type of <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType">SourceCodeType</a> that specifies a source branch name and a destination branch name in an associated repository.</p>
    pub fn set_branch_diff(mut self, input: ::std::option::Option<crate::types::BranchDiffSourceCodeType>) -> Self {
        self.branch_diff = input;
        self
    }
    /// <p>A type of <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType">SourceCodeType</a> that specifies a source branch name and a destination branch name in an associated repository.</p>
    pub fn get_branch_diff(&self) -> &::std::option::Option<crate::types::BranchDiffSourceCodeType> {
        &self.branch_diff
    }
    /// <p>Information about an associated repository in an S3 bucket that includes its name and an <code>S3RepositoryDetails</code> object. The <code>S3RepositoryDetails</code> object includes the name of an S3 bucket, an S3 key for a source code .zip file, and an S3 key for a build artifacts .zip file. <code>S3BucketRepository</code> is required in <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType">SourceCodeType</a> for <code>S3BucketRepository</code> based code reviews.</p>
    pub fn s3_bucket_repository(mut self, input: crate::types::S3BucketRepository) -> Self {
        self.s3_bucket_repository = ::std::option::Option::Some(input);
        self
    }
    /// <p>Information about an associated repository in an S3 bucket that includes its name and an <code>S3RepositoryDetails</code> object. The <code>S3RepositoryDetails</code> object includes the name of an S3 bucket, an S3 key for a source code .zip file, and an S3 key for a build artifacts .zip file. <code>S3BucketRepository</code> is required in <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType">SourceCodeType</a> for <code>S3BucketRepository</code> based code reviews.</p>
    pub fn set_s3_bucket_repository(mut self, input: ::std::option::Option<crate::types::S3BucketRepository>) -> Self {
        self.s3_bucket_repository = input;
        self
    }
    /// <p>Information about an associated repository in an S3 bucket that includes its name and an <code>S3RepositoryDetails</code> object. The <code>S3RepositoryDetails</code> object includes the name of an S3 bucket, an S3 key for a source code .zip file, and an S3 key for a build artifacts .zip file. <code>S3BucketRepository</code> is required in <a href="https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_SourceCodeType">SourceCodeType</a> for <code>S3BucketRepository</code> based code reviews.</p>
    pub fn get_s3_bucket_repository(&self) -> &::std::option::Option<crate::types::S3BucketRepository> {
        &self.s3_bucket_repository
    }
    /// <p>Metadata that is associated with a code review. This applies to any type of code review supported by CodeGuru Reviewer. The <code>RequestMetadaa</code> field captures any event metadata. For example, it might capture metadata associated with an event trigger, such as a push or a pull request.</p>
    pub fn request_metadata(mut self, input: crate::types::RequestMetadata) -> Self {
        self.request_metadata = ::std::option::Option::Some(input);
        self
    }
    /// <p>Metadata that is associated with a code review. This applies to any type of code review supported by CodeGuru Reviewer. The <code>RequestMetadaa</code> field captures any event metadata. For example, it might capture metadata associated with an event trigger, such as a push or a pull request.</p>
    pub fn set_request_metadata(mut self, input: ::std::option::Option<crate::types::RequestMetadata>) -> Self {
        self.request_metadata = input;
        self
    }
    /// <p>Metadata that is associated with a code review. This applies to any type of code review supported by CodeGuru Reviewer. The <code>RequestMetadaa</code> field captures any event metadata. For example, it might capture metadata associated with an event trigger, such as a push or a pull request.</p>
    pub fn get_request_metadata(&self) -> &::std::option::Option<crate::types::RequestMetadata> {
        &self.request_metadata
    }
    /// Consumes the builder and constructs a [`SourceCodeType`](crate::types::SourceCodeType).
    pub fn build(self) -> crate::types::SourceCodeType {
        crate::types::SourceCodeType {
            commit_diff: self.commit_diff,
            repository_head: self.repository_head,
            branch_diff: self.branch_diff,
            s3_bucket_repository: self.s3_bucket_repository,
            request_metadata: self.request_metadata,
        }
    }
}