aws-sdk-codecommit 1.99.0

AWS SDK for AWS CodeCommit
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::merge_pull_request_by_fast_forward::_merge_pull_request_by_fast_forward_input::MergePullRequestByFastForwardInputBuilder;

pub use crate::operation::merge_pull_request_by_fast_forward::_merge_pull_request_by_fast_forward_output::MergePullRequestByFastForwardOutputBuilder;

impl crate::operation::merge_pull_request_by_fast_forward::builders::MergePullRequestByFastForwardInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::merge_pull_request_by_fast_forward::MergePullRequestByFastForwardOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::merge_pull_request_by_fast_forward::MergePullRequestByFastForwardError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.merge_pull_request_by_fast_forward();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `MergePullRequestByFastForward`.
///
/// <p>Attempts to merge the source commit of a pull request into the specified destination branch for that pull request at the specified commit using the fast-forward merge strategy. If the merge is successful, it closes the pull request.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct MergePullRequestByFastForwardFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::merge_pull_request_by_fast_forward::builders::MergePullRequestByFastForwardInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::merge_pull_request_by_fast_forward::MergePullRequestByFastForwardOutput,
        crate::operation::merge_pull_request_by_fast_forward::MergePullRequestByFastForwardError,
    > for MergePullRequestByFastForwardFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::merge_pull_request_by_fast_forward::MergePullRequestByFastForwardOutput,
            crate::operation::merge_pull_request_by_fast_forward::MergePullRequestByFastForwardError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl MergePullRequestByFastForwardFluentBuilder {
    /// Creates a new `MergePullRequestByFastForwardFluentBuilder`.
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: ::std::default::Default::default(),
            config_override: ::std::option::Option::None,
        }
    }
    /// Access the MergePullRequestByFastForward as a reference.
    pub fn as_input(&self) -> &crate::operation::merge_pull_request_by_fast_forward::builders::MergePullRequestByFastForwardInputBuilder {
        &self.inner
    }
    /// Sends the request and returns the response.
    ///
    /// If an error occurs, an `SdkError` will be returned with additional details that
    /// can be matched against.
    ///
    /// By default, any retryable failures will be retried twice. Retry behavior
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
    /// set when configuring the client.
    pub async fn send(
        self,
    ) -> ::std::result::Result<
        crate::operation::merge_pull_request_by_fast_forward::MergePullRequestByFastForwardOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::merge_pull_request_by_fast_forward::MergePullRequestByFastForwardError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let input = self
            .inner
            .build()
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
        let runtime_plugins = crate::operation::merge_pull_request_by_fast_forward::MergePullRequestByFastForward::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::merge_pull_request_by_fast_forward::MergePullRequestByFastForward::orchestrate(&runtime_plugins, input).await
    }

    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
    pub fn customize(
        self,
    ) -> crate::client::customize::CustomizableOperation<
        crate::operation::merge_pull_request_by_fast_forward::MergePullRequestByFastForwardOutput,
        crate::operation::merge_pull_request_by_fast_forward::MergePullRequestByFastForwardError,
        Self,
    > {
        crate::client::customize::CustomizableOperation::new(self)
    }
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
        self.set_config_override(::std::option::Option::Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        self
    }
    /// <p>The system-generated ID of the pull request. To get this ID, use <code>ListPullRequests</code>.</p>
    pub fn pull_request_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.pull_request_id(input.into());
        self
    }
    /// <p>The system-generated ID of the pull request. To get this ID, use <code>ListPullRequests</code>.</p>
    pub fn set_pull_request_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_pull_request_id(input);
        self
    }
    /// <p>The system-generated ID of the pull request. To get this ID, use <code>ListPullRequests</code>.</p>
    pub fn get_pull_request_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_pull_request_id()
    }
    /// <p>The name of the repository where the pull request was created.</p>
    pub fn repository_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.repository_name(input.into());
        self
    }
    /// <p>The name of the repository where the pull request was created.</p>
    pub fn set_repository_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_repository_name(input);
        self
    }
    /// <p>The name of the repository where the pull request was created.</p>
    pub fn get_repository_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_repository_name()
    }
    /// <p>The full commit ID of the original or updated commit in the pull request source branch. Pass this value if you want an exception thrown if the current commit ID of the tip of the source branch does not match this commit ID.</p>
    pub fn source_commit_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.source_commit_id(input.into());
        self
    }
    /// <p>The full commit ID of the original or updated commit in the pull request source branch. Pass this value if you want an exception thrown if the current commit ID of the tip of the source branch does not match this commit ID.</p>
    pub fn set_source_commit_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_source_commit_id(input);
        self
    }
    /// <p>The full commit ID of the original or updated commit in the pull request source branch. Pass this value if you want an exception thrown if the current commit ID of the tip of the source branch does not match this commit ID.</p>
    pub fn get_source_commit_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_source_commit_id()
    }
}