aws_sdk_codecommit/operation/create_unreferenced_merge_commit/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_unreferenced_merge_commit::_create_unreferenced_merge_commit_output::CreateUnreferencedMergeCommitOutputBuilder;
3
4pub use crate::operation::create_unreferenced_merge_commit::_create_unreferenced_merge_commit_input::CreateUnreferencedMergeCommitInputBuilder;
5
6impl crate::operation::create_unreferenced_merge_commit::builders::CreateUnreferencedMergeCommitInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_unreferenced_merge_commit::CreateUnreferencedMergeCommitOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_unreferenced_merge_commit::CreateUnreferencedMergeCommitError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_unreferenced_merge_commit();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateUnreferencedMergeCommit`.
24///
25/// <p>Creates an unreferenced commit that represents the result of merging two branches using a specified merge strategy. This can help you determine the outcome of a potential merge. This API cannot be used with the fast-forward merge strategy because that strategy does not create a merge commit.</p><note>
26/// <p>This unreferenced merge commit can only be accessed using the GetCommit API or through git commands such as git fetch. To retrieve this commit, you must specify its commit ID or otherwise reference it.</p>
27/// </note>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct CreateUnreferencedMergeCommitFluentBuilder {
30    handle: ::std::sync::Arc<crate::client::Handle>,
31    inner: crate::operation::create_unreferenced_merge_commit::builders::CreateUnreferencedMergeCommitInputBuilder,
32    config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35    crate::client::customize::internal::CustomizableSend<
36        crate::operation::create_unreferenced_merge_commit::CreateUnreferencedMergeCommitOutput,
37        crate::operation::create_unreferenced_merge_commit::CreateUnreferencedMergeCommitError,
38    > for CreateUnreferencedMergeCommitFluentBuilder
39{
40    fn send(
41        self,
42        config_override: crate::config::Builder,
43    ) -> crate::client::customize::internal::BoxFuture<
44        crate::client::customize::internal::SendResult<
45            crate::operation::create_unreferenced_merge_commit::CreateUnreferencedMergeCommitOutput,
46            crate::operation::create_unreferenced_merge_commit::CreateUnreferencedMergeCommitError,
47        >,
48    > {
49        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50    }
51}
52impl CreateUnreferencedMergeCommitFluentBuilder {
53    /// Creates a new `CreateUnreferencedMergeCommitFluentBuilder`.
54    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
55        Self {
56            handle,
57            inner: ::std::default::Default::default(),
58            config_override: ::std::option::Option::None,
59        }
60    }
61    /// Access the CreateUnreferencedMergeCommit as a reference.
62    pub fn as_input(&self) -> &crate::operation::create_unreferenced_merge_commit::builders::CreateUnreferencedMergeCommitInputBuilder {
63        &self.inner
64    }
65    /// Sends the request and returns the response.
66    ///
67    /// If an error occurs, an `SdkError` will be returned with additional details that
68    /// can be matched against.
69    ///
70    /// By default, any retryable failures will be retried twice. Retry behavior
71    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72    /// set when configuring the client.
73    pub async fn send(
74        self,
75    ) -> ::std::result::Result<
76        crate::operation::create_unreferenced_merge_commit::CreateUnreferencedMergeCommitOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::create_unreferenced_merge_commit::CreateUnreferencedMergeCommitError,
79            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80        >,
81    > {
82        let input = self
83            .inner
84            .build()
85            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86        let runtime_plugins = crate::operation::create_unreferenced_merge_commit::CreateUnreferencedMergeCommit::operation_runtime_plugins(
87            self.handle.runtime_plugins.clone(),
88            &self.handle.conf,
89            self.config_override,
90        );
91        crate::operation::create_unreferenced_merge_commit::CreateUnreferencedMergeCommit::orchestrate(&runtime_plugins, input).await
92    }
93
94    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
95    pub fn customize(
96        self,
97    ) -> crate::client::customize::CustomizableOperation<
98        crate::operation::create_unreferenced_merge_commit::CreateUnreferencedMergeCommitOutput,
99        crate::operation::create_unreferenced_merge_commit::CreateUnreferencedMergeCommitError,
100        Self,
101    > {
102        crate::client::customize::CustomizableOperation::new(self)
103    }
104    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105        self.set_config_override(::std::option::Option::Some(config_override.into()));
106        self
107    }
108
109    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110        self.config_override = config_override;
111        self
112    }
113    /// <p>The name of the repository where you want to create the unreferenced merge commit.</p>
114    pub fn repository_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.inner = self.inner.repository_name(input.into());
116        self
117    }
118    /// <p>The name of the repository where you want to create the unreferenced merge commit.</p>
119    pub fn set_repository_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.inner = self.inner.set_repository_name(input);
121        self
122    }
123    /// <p>The name of the repository where you want to create the unreferenced merge commit.</p>
124    pub fn get_repository_name(&self) -> &::std::option::Option<::std::string::String> {
125        self.inner.get_repository_name()
126    }
127    /// <p>The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).</p>
128    pub fn source_commit_specifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        self.inner = self.inner.source_commit_specifier(input.into());
130        self
131    }
132    /// <p>The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).</p>
133    pub fn set_source_commit_specifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134        self.inner = self.inner.set_source_commit_specifier(input);
135        self
136    }
137    /// <p>The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).</p>
138    pub fn get_source_commit_specifier(&self) -> &::std::option::Option<::std::string::String> {
139        self.inner.get_source_commit_specifier()
140    }
141    /// <p>The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).</p>
142    pub fn destination_commit_specifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143        self.inner = self.inner.destination_commit_specifier(input.into());
144        self
145    }
146    /// <p>The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).</p>
147    pub fn set_destination_commit_specifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148        self.inner = self.inner.set_destination_commit_specifier(input);
149        self
150    }
151    /// <p>The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).</p>
152    pub fn get_destination_commit_specifier(&self) -> &::std::option::Option<::std::string::String> {
153        self.inner.get_destination_commit_specifier()
154    }
155    /// <p>The merge option or strategy you want to use to merge the code.</p>
156    pub fn merge_option(mut self, input: crate::types::MergeOptionTypeEnum) -> Self {
157        self.inner = self.inner.merge_option(input);
158        self
159    }
160    /// <p>The merge option or strategy you want to use to merge the code.</p>
161    pub fn set_merge_option(mut self, input: ::std::option::Option<crate::types::MergeOptionTypeEnum>) -> Self {
162        self.inner = self.inner.set_merge_option(input);
163        self
164    }
165    /// <p>The merge option or strategy you want to use to merge the code.</p>
166    pub fn get_merge_option(&self) -> &::std::option::Option<crate::types::MergeOptionTypeEnum> {
167        self.inner.get_merge_option()
168    }
169    /// <p>The level of conflict detail to use. If unspecified, the default FILE_LEVEL is used, which returns a not-mergeable result if the same file has differences in both branches. If LINE_LEVEL is specified, a conflict is considered not mergeable if the same file in both branches has differences on the same line.</p>
170    pub fn conflict_detail_level(mut self, input: crate::types::ConflictDetailLevelTypeEnum) -> Self {
171        self.inner = self.inner.conflict_detail_level(input);
172        self
173    }
174    /// <p>The level of conflict detail to use. If unspecified, the default FILE_LEVEL is used, which returns a not-mergeable result if the same file has differences in both branches. If LINE_LEVEL is specified, a conflict is considered not mergeable if the same file in both branches has differences on the same line.</p>
175    pub fn set_conflict_detail_level(mut self, input: ::std::option::Option<crate::types::ConflictDetailLevelTypeEnum>) -> Self {
176        self.inner = self.inner.set_conflict_detail_level(input);
177        self
178    }
179    /// <p>The level of conflict detail to use. If unspecified, the default FILE_LEVEL is used, which returns a not-mergeable result if the same file has differences in both branches. If LINE_LEVEL is specified, a conflict is considered not mergeable if the same file in both branches has differences on the same line.</p>
180    pub fn get_conflict_detail_level(&self) -> &::std::option::Option<crate::types::ConflictDetailLevelTypeEnum> {
181        self.inner.get_conflict_detail_level()
182    }
183    /// <p>Specifies which branch to use when resolving conflicts, or whether to attempt automatically merging two versions of a file. The default is NONE, which requires any conflicts to be resolved manually before the merge operation is successful.</p>
184    pub fn conflict_resolution_strategy(mut self, input: crate::types::ConflictResolutionStrategyTypeEnum) -> Self {
185        self.inner = self.inner.conflict_resolution_strategy(input);
186        self
187    }
188    /// <p>Specifies which branch to use when resolving conflicts, or whether to attempt automatically merging two versions of a file. The default is NONE, which requires any conflicts to be resolved manually before the merge operation is successful.</p>
189    pub fn set_conflict_resolution_strategy(mut self, input: ::std::option::Option<crate::types::ConflictResolutionStrategyTypeEnum>) -> Self {
190        self.inner = self.inner.set_conflict_resolution_strategy(input);
191        self
192    }
193    /// <p>Specifies which branch to use when resolving conflicts, or whether to attempt automatically merging two versions of a file. The default is NONE, which requires any conflicts to be resolved manually before the merge operation is successful.</p>
194    pub fn get_conflict_resolution_strategy(&self) -> &::std::option::Option<crate::types::ConflictResolutionStrategyTypeEnum> {
195        self.inner.get_conflict_resolution_strategy()
196    }
197    /// <p>The name of the author who created the unreferenced commit. This information is used as both the author and committer for the commit.</p>
198    pub fn author_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
199        self.inner = self.inner.author_name(input.into());
200        self
201    }
202    /// <p>The name of the author who created the unreferenced commit. This information is used as both the author and committer for the commit.</p>
203    pub fn set_author_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
204        self.inner = self.inner.set_author_name(input);
205        self
206    }
207    /// <p>The name of the author who created the unreferenced commit. This information is used as both the author and committer for the commit.</p>
208    pub fn get_author_name(&self) -> &::std::option::Option<::std::string::String> {
209        self.inner.get_author_name()
210    }
211    /// <p>The email address for the person who created the unreferenced commit.</p>
212    pub fn email(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
213        self.inner = self.inner.email(input.into());
214        self
215    }
216    /// <p>The email address for the person who created the unreferenced commit.</p>
217    pub fn set_email(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
218        self.inner = self.inner.set_email(input);
219        self
220    }
221    /// <p>The email address for the person who created the unreferenced commit.</p>
222    pub fn get_email(&self) -> &::std::option::Option<::std::string::String> {
223        self.inner.get_email()
224    }
225    /// <p>The commit message for the unreferenced commit.</p>
226    pub fn commit_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
227        self.inner = self.inner.commit_message(input.into());
228        self
229    }
230    /// <p>The commit message for the unreferenced commit.</p>
231    pub fn set_commit_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
232        self.inner = self.inner.set_commit_message(input);
233        self
234    }
235    /// <p>The commit message for the unreferenced commit.</p>
236    pub fn get_commit_message(&self) -> &::std::option::Option<::std::string::String> {
237        self.inner.get_commit_message()
238    }
239    /// <p>If the commit contains deletions, whether to keep a folder or folder structure if the changes leave the folders empty. If this is specified as true, a .gitkeep file is created for empty folders. The default is false.</p>
240    pub fn keep_empty_folders(mut self, input: bool) -> Self {
241        self.inner = self.inner.keep_empty_folders(input);
242        self
243    }
244    /// <p>If the commit contains deletions, whether to keep a folder or folder structure if the changes leave the folders empty. If this is specified as true, a .gitkeep file is created for empty folders. The default is false.</p>
245    pub fn set_keep_empty_folders(mut self, input: ::std::option::Option<bool>) -> Self {
246        self.inner = self.inner.set_keep_empty_folders(input);
247        self
248    }
249    /// <p>If the commit contains deletions, whether to keep a folder or folder structure if the changes leave the folders empty. If this is specified as true, a .gitkeep file is created for empty folders. The default is false.</p>
250    pub fn get_keep_empty_folders(&self) -> &::std::option::Option<bool> {
251        self.inner.get_keep_empty_folders()
252    }
253    /// <p>If AUTOMERGE is the conflict resolution strategy, a list of inputs to use when resolving conflicts during a merge.</p>
254    pub fn conflict_resolution(mut self, input: crate::types::ConflictResolution) -> Self {
255        self.inner = self.inner.conflict_resolution(input);
256        self
257    }
258    /// <p>If AUTOMERGE is the conflict resolution strategy, a list of inputs to use when resolving conflicts during a merge.</p>
259    pub fn set_conflict_resolution(mut self, input: ::std::option::Option<crate::types::ConflictResolution>) -> Self {
260        self.inner = self.inner.set_conflict_resolution(input);
261        self
262    }
263    /// <p>If AUTOMERGE is the conflict resolution strategy, a list of inputs to use when resolving conflicts during a merge.</p>
264    pub fn get_conflict_resolution(&self) -> &::std::option::Option<crate::types::ConflictResolution> {
265        self.inner.get_conflict_resolution()
266    }
267}