aws_sdk_codegurureviewer/types/_source_code_type.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Specifies the source code that is analyzed in a code review.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct SourceCodeType {
7 /// <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>
8 pub commit_diff: ::std::option::Option<crate::types::CommitDiffSourceCodeType>,
9 /// <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>
10 pub repository_head: ::std::option::Option<crate::types::RepositoryHeadSourceCodeType>,
11 /// <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>
12 pub branch_diff: ::std::option::Option<crate::types::BranchDiffSourceCodeType>,
13 /// <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>
14 pub s3_bucket_repository: ::std::option::Option<crate::types::S3BucketRepository>,
15 /// <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>
16 pub request_metadata: ::std::option::Option<crate::types::RequestMetadata>,
17}
18impl SourceCodeType {
19 /// <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>
20 pub fn commit_diff(&self) -> ::std::option::Option<&crate::types::CommitDiffSourceCodeType> {
21 self.commit_diff.as_ref()
22 }
23 /// <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>
24 pub fn repository_head(&self) -> ::std::option::Option<&crate::types::RepositoryHeadSourceCodeType> {
25 self.repository_head.as_ref()
26 }
27 /// <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>
28 pub fn branch_diff(&self) -> ::std::option::Option<&crate::types::BranchDiffSourceCodeType> {
29 self.branch_diff.as_ref()
30 }
31 /// <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>
32 pub fn s3_bucket_repository(&self) -> ::std::option::Option<&crate::types::S3BucketRepository> {
33 self.s3_bucket_repository.as_ref()
34 }
35 /// <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>
36 pub fn request_metadata(&self) -> ::std::option::Option<&crate::types::RequestMetadata> {
37 self.request_metadata.as_ref()
38 }
39}
40impl SourceCodeType {
41 /// Creates a new builder-style object to manufacture [`SourceCodeType`](crate::types::SourceCodeType).
42 pub fn builder() -> crate::types::builders::SourceCodeTypeBuilder {
43 crate::types::builders::SourceCodeTypeBuilder::default()
44 }
45}
46
47/// A builder for [`SourceCodeType`](crate::types::SourceCodeType).
48#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
49#[non_exhaustive]
50pub struct SourceCodeTypeBuilder {
51 pub(crate) commit_diff: ::std::option::Option<crate::types::CommitDiffSourceCodeType>,
52 pub(crate) repository_head: ::std::option::Option<crate::types::RepositoryHeadSourceCodeType>,
53 pub(crate) branch_diff: ::std::option::Option<crate::types::BranchDiffSourceCodeType>,
54 pub(crate) s3_bucket_repository: ::std::option::Option<crate::types::S3BucketRepository>,
55 pub(crate) request_metadata: ::std::option::Option<crate::types::RequestMetadata>,
56}
57impl SourceCodeTypeBuilder {
58 /// <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>
59 pub fn commit_diff(mut self, input: crate::types::CommitDiffSourceCodeType) -> Self {
60 self.commit_diff = ::std::option::Option::Some(input);
61 self
62 }
63 /// <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>
64 pub fn set_commit_diff(mut self, input: ::std::option::Option<crate::types::CommitDiffSourceCodeType>) -> Self {
65 self.commit_diff = input;
66 self
67 }
68 /// <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>
69 pub fn get_commit_diff(&self) -> &::std::option::Option<crate::types::CommitDiffSourceCodeType> {
70 &self.commit_diff
71 }
72 /// <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>
73 pub fn repository_head(mut self, input: crate::types::RepositoryHeadSourceCodeType) -> Self {
74 self.repository_head = ::std::option::Option::Some(input);
75 self
76 }
77 /// <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>
78 pub fn set_repository_head(mut self, input: ::std::option::Option<crate::types::RepositoryHeadSourceCodeType>) -> Self {
79 self.repository_head = input;
80 self
81 }
82 /// <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>
83 pub fn get_repository_head(&self) -> &::std::option::Option<crate::types::RepositoryHeadSourceCodeType> {
84 &self.repository_head
85 }
86 /// <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>
87 pub fn branch_diff(mut self, input: crate::types::BranchDiffSourceCodeType) -> Self {
88 self.branch_diff = ::std::option::Option::Some(input);
89 self
90 }
91 /// <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>
92 pub fn set_branch_diff(mut self, input: ::std::option::Option<crate::types::BranchDiffSourceCodeType>) -> Self {
93 self.branch_diff = input;
94 self
95 }
96 /// <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>
97 pub fn get_branch_diff(&self) -> &::std::option::Option<crate::types::BranchDiffSourceCodeType> {
98 &self.branch_diff
99 }
100 /// <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>
101 pub fn s3_bucket_repository(mut self, input: crate::types::S3BucketRepository) -> Self {
102 self.s3_bucket_repository = ::std::option::Option::Some(input);
103 self
104 }
105 /// <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>
106 pub fn set_s3_bucket_repository(mut self, input: ::std::option::Option<crate::types::S3BucketRepository>) -> Self {
107 self.s3_bucket_repository = input;
108 self
109 }
110 /// <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>
111 pub fn get_s3_bucket_repository(&self) -> &::std::option::Option<crate::types::S3BucketRepository> {
112 &self.s3_bucket_repository
113 }
114 /// <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>
115 pub fn request_metadata(mut self, input: crate::types::RequestMetadata) -> Self {
116 self.request_metadata = ::std::option::Option::Some(input);
117 self
118 }
119 /// <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>
120 pub fn set_request_metadata(mut self, input: ::std::option::Option<crate::types::RequestMetadata>) -> Self {
121 self.request_metadata = input;
122 self
123 }
124 /// <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>
125 pub fn get_request_metadata(&self) -> &::std::option::Option<crate::types::RequestMetadata> {
126 &self.request_metadata
127 }
128 /// Consumes the builder and constructs a [`SourceCodeType`](crate::types::SourceCodeType).
129 pub fn build(self) -> crate::types::SourceCodeType {
130 crate::types::SourceCodeType {
131 commit_diff: self.commit_diff,
132 repository_head: self.repository_head,
133 branch_diff: self.branch_diff,
134 s3_bucket_repository: self.s3_bucket_repository,
135 request_metadata: self.request_metadata,
136 }
137 }
138}