Skip to main content

aws_sdk_codecommit/types/
_pull_request_source_reference_updated_event_metadata.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Information about an update to the source branch of a pull request.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct PullRequestSourceReferenceUpdatedEventMetadata {
7    /// <p>The name of the repository where the pull request was updated.</p>
8    pub repository_name: ::std::option::Option<::std::string::String>,
9    /// <p>The full commit ID of the commit in the destination branch that was the tip of the branch at the time the pull request was updated.</p>
10    pub before_commit_id: ::std::option::Option<::std::string::String>,
11    /// <p>The full commit ID of the commit in the source branch that was the tip of the branch at the time the pull request was updated.</p>
12    pub after_commit_id: ::std::option::Option<::std::string::String>,
13    /// <p>The commit ID of the most recent commit that the source branch and the destination branch have in common.</p>
14    pub merge_base: ::std::option::Option<::std::string::String>,
15}
16impl PullRequestSourceReferenceUpdatedEventMetadata {
17    /// <p>The name of the repository where the pull request was updated.</p>
18    pub fn repository_name(&self) -> ::std::option::Option<&str> {
19        self.repository_name.as_deref()
20    }
21    /// <p>The full commit ID of the commit in the destination branch that was the tip of the branch at the time the pull request was updated.</p>
22    pub fn before_commit_id(&self) -> ::std::option::Option<&str> {
23        self.before_commit_id.as_deref()
24    }
25    /// <p>The full commit ID of the commit in the source branch that was the tip of the branch at the time the pull request was updated.</p>
26    pub fn after_commit_id(&self) -> ::std::option::Option<&str> {
27        self.after_commit_id.as_deref()
28    }
29    /// <p>The commit ID of the most recent commit that the source branch and the destination branch have in common.</p>
30    pub fn merge_base(&self) -> ::std::option::Option<&str> {
31        self.merge_base.as_deref()
32    }
33}
34impl PullRequestSourceReferenceUpdatedEventMetadata {
35    /// Creates a new builder-style object to manufacture [`PullRequestSourceReferenceUpdatedEventMetadata`](crate::types::PullRequestSourceReferenceUpdatedEventMetadata).
36    pub fn builder() -> crate::types::builders::PullRequestSourceReferenceUpdatedEventMetadataBuilder {
37        crate::types::builders::PullRequestSourceReferenceUpdatedEventMetadataBuilder::default()
38    }
39}
40
41/// A builder for [`PullRequestSourceReferenceUpdatedEventMetadata`](crate::types::PullRequestSourceReferenceUpdatedEventMetadata).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct PullRequestSourceReferenceUpdatedEventMetadataBuilder {
45    pub(crate) repository_name: ::std::option::Option<::std::string::String>,
46    pub(crate) before_commit_id: ::std::option::Option<::std::string::String>,
47    pub(crate) after_commit_id: ::std::option::Option<::std::string::String>,
48    pub(crate) merge_base: ::std::option::Option<::std::string::String>,
49}
50impl PullRequestSourceReferenceUpdatedEventMetadataBuilder {
51    /// <p>The name of the repository where the pull request was updated.</p>
52    pub fn repository_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.repository_name = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The name of the repository where the pull request was updated.</p>
57    pub fn set_repository_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.repository_name = input;
59        self
60    }
61    /// <p>The name of the repository where the pull request was updated.</p>
62    pub fn get_repository_name(&self) -> &::std::option::Option<::std::string::String> {
63        &self.repository_name
64    }
65    /// <p>The full commit ID of the commit in the destination branch that was the tip of the branch at the time the pull request was updated.</p>
66    pub fn before_commit_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.before_commit_id = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// <p>The full commit ID of the commit in the destination branch that was the tip of the branch at the time the pull request was updated.</p>
71    pub fn set_before_commit_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.before_commit_id = input;
73        self
74    }
75    /// <p>The full commit ID of the commit in the destination branch that was the tip of the branch at the time the pull request was updated.</p>
76    pub fn get_before_commit_id(&self) -> &::std::option::Option<::std::string::String> {
77        &self.before_commit_id
78    }
79    /// <p>The full commit ID of the commit in the source branch that was the tip of the branch at the time the pull request was updated.</p>
80    pub fn after_commit_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.after_commit_id = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>The full commit ID of the commit in the source branch that was the tip of the branch at the time the pull request was updated.</p>
85    pub fn set_after_commit_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.after_commit_id = input;
87        self
88    }
89    /// <p>The full commit ID of the commit in the source branch that was the tip of the branch at the time the pull request was updated.</p>
90    pub fn get_after_commit_id(&self) -> &::std::option::Option<::std::string::String> {
91        &self.after_commit_id
92    }
93    /// <p>The commit ID of the most recent commit that the source branch and the destination branch have in common.</p>
94    pub fn merge_base(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95        self.merge_base = ::std::option::Option::Some(input.into());
96        self
97    }
98    /// <p>The commit ID of the most recent commit that the source branch and the destination branch have in common.</p>
99    pub fn set_merge_base(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100        self.merge_base = input;
101        self
102    }
103    /// <p>The commit ID of the most recent commit that the source branch and the destination branch have in common.</p>
104    pub fn get_merge_base(&self) -> &::std::option::Option<::std::string::String> {
105        &self.merge_base
106    }
107    /// Consumes the builder and constructs a [`PullRequestSourceReferenceUpdatedEventMetadata`](crate::types::PullRequestSourceReferenceUpdatedEventMetadata).
108    pub fn build(self) -> crate::types::PullRequestSourceReferenceUpdatedEventMetadata {
109        crate::types::PullRequestSourceReferenceUpdatedEventMetadata {
110            repository_name: self.repository_name,
111            before_commit_id: self.before_commit_id,
112            after_commit_id: self.after_commit_id,
113            merge_base: self.merge_base,
114        }
115    }
116}