aws_sdk_codeartifact/operation/get_repository_endpoint/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_repository_endpoint::_get_repository_endpoint_output::GetRepositoryEndpointOutputBuilder;
3
4pub use crate::operation::get_repository_endpoint::_get_repository_endpoint_input::GetRepositoryEndpointInputBuilder;
5
6impl crate::operation::get_repository_endpoint::builders::GetRepositoryEndpointInputBuilder {
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::get_repository_endpoint::GetRepositoryEndpointOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_repository_endpoint::GetRepositoryEndpointError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_repository_endpoint();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetRepositoryEndpoint`.
24///
25/// <p>Returns the endpoint of a repository for a specific package format. A repository has one endpoint for each package format:</p>
26/// <ul>
27/// <li>
28/// <p><code>cargo</code></p></li>
29/// <li>
30/// <p><code>generic</code></p></li>
31/// <li>
32/// <p><code>maven</code></p></li>
33/// <li>
34/// <p><code>npm</code></p></li>
35/// <li>
36/// <p><code>nuget</code></p></li>
37/// <li>
38/// <p><code>pypi</code></p></li>
39/// <li>
40/// <p><code>ruby</code></p></li>
41/// <li>
42/// <p><code>swift</code></p></li>
43/// </ul>
44#[derive(::std::clone::Clone, ::std::fmt::Debug)]
45pub struct GetRepositoryEndpointFluentBuilder {
46    handle: ::std::sync::Arc<crate::client::Handle>,
47    inner: crate::operation::get_repository_endpoint::builders::GetRepositoryEndpointInputBuilder,
48    config_override: ::std::option::Option<crate::config::Builder>,
49}
50impl
51    crate::client::customize::internal::CustomizableSend<
52        crate::operation::get_repository_endpoint::GetRepositoryEndpointOutput,
53        crate::operation::get_repository_endpoint::GetRepositoryEndpointError,
54    > for GetRepositoryEndpointFluentBuilder
55{
56    fn send(
57        self,
58        config_override: crate::config::Builder,
59    ) -> crate::client::customize::internal::BoxFuture<
60        crate::client::customize::internal::SendResult<
61            crate::operation::get_repository_endpoint::GetRepositoryEndpointOutput,
62            crate::operation::get_repository_endpoint::GetRepositoryEndpointError,
63        >,
64    > {
65        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
66    }
67}
68impl GetRepositoryEndpointFluentBuilder {
69    /// Creates a new `GetRepositoryEndpointFluentBuilder`.
70    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
71        Self {
72            handle,
73            inner: ::std::default::Default::default(),
74            config_override: ::std::option::Option::None,
75        }
76    }
77    /// Access the GetRepositoryEndpoint as a reference.
78    pub fn as_input(&self) -> &crate::operation::get_repository_endpoint::builders::GetRepositoryEndpointInputBuilder {
79        &self.inner
80    }
81    /// Sends the request and returns the response.
82    ///
83    /// If an error occurs, an `SdkError` will be returned with additional details that
84    /// can be matched against.
85    ///
86    /// By default, any retryable failures will be retried twice. Retry behavior
87    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
88    /// set when configuring the client.
89    pub async fn send(
90        self,
91    ) -> ::std::result::Result<
92        crate::operation::get_repository_endpoint::GetRepositoryEndpointOutput,
93        ::aws_smithy_runtime_api::client::result::SdkError<
94            crate::operation::get_repository_endpoint::GetRepositoryEndpointError,
95            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
96        >,
97    > {
98        let input = self
99            .inner
100            .build()
101            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
102        let runtime_plugins = crate::operation::get_repository_endpoint::GetRepositoryEndpoint::operation_runtime_plugins(
103            self.handle.runtime_plugins.clone(),
104            &self.handle.conf,
105            self.config_override,
106        );
107        crate::operation::get_repository_endpoint::GetRepositoryEndpoint::orchestrate(&runtime_plugins, input).await
108    }
109
110    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
111    pub fn customize(
112        self,
113    ) -> crate::client::customize::CustomizableOperation<
114        crate::operation::get_repository_endpoint::GetRepositoryEndpointOutput,
115        crate::operation::get_repository_endpoint::GetRepositoryEndpointError,
116        Self,
117    > {
118        crate::client::customize::CustomizableOperation::new(self)
119    }
120    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
121        self.set_config_override(::std::option::Option::Some(config_override.into()));
122        self
123    }
124
125    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
126        self.config_override = config_override;
127        self
128    }
129    /// <p>The name of the domain that contains the repository.</p>
130    pub fn domain(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131        self.inner = self.inner.domain(input.into());
132        self
133    }
134    /// <p>The name of the domain that contains the repository.</p>
135    pub fn set_domain(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.inner = self.inner.set_domain(input);
137        self
138    }
139    /// <p>The name of the domain that contains the repository.</p>
140    pub fn get_domain(&self) -> &::std::option::Option<::std::string::String> {
141        self.inner.get_domain()
142    }
143    /// <p>The 12-digit account number of the Amazon Web Services account that owns the domain that contains the repository. It does not include dashes or spaces.</p>
144    pub fn domain_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145        self.inner = self.inner.domain_owner(input.into());
146        self
147    }
148    /// <p>The 12-digit account number of the Amazon Web Services account that owns the domain that contains the repository. It does not include dashes or spaces.</p>
149    pub fn set_domain_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150        self.inner = self.inner.set_domain_owner(input);
151        self
152    }
153    /// <p>The 12-digit account number of the Amazon Web Services account that owns the domain that contains the repository. It does not include dashes or spaces.</p>
154    pub fn get_domain_owner(&self) -> &::std::option::Option<::std::string::String> {
155        self.inner.get_domain_owner()
156    }
157    /// <p>The name of the repository.</p>
158    pub fn repository(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159        self.inner = self.inner.repository(input.into());
160        self
161    }
162    /// <p>The name of the repository.</p>
163    pub fn set_repository(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164        self.inner = self.inner.set_repository(input);
165        self
166    }
167    /// <p>The name of the repository.</p>
168    pub fn get_repository(&self) -> &::std::option::Option<::std::string::String> {
169        self.inner.get_repository()
170    }
171    /// <p>Returns which endpoint of a repository to return. A repository has one endpoint for each package format.</p>
172    pub fn format(mut self, input: crate::types::PackageFormat) -> Self {
173        self.inner = self.inner.format(input);
174        self
175    }
176    /// <p>Returns which endpoint of a repository to return. A repository has one endpoint for each package format.</p>
177    pub fn set_format(mut self, input: ::std::option::Option<crate::types::PackageFormat>) -> Self {
178        self.inner = self.inner.set_format(input);
179        self
180    }
181    /// <p>Returns which endpoint of a repository to return. A repository has one endpoint for each package format.</p>
182    pub fn get_format(&self) -> &::std::option::Option<crate::types::PackageFormat> {
183        self.inner.get_format()
184    }
185    /// <p>A string that specifies the type of endpoint.</p>
186    pub fn endpoint_type(mut self, input: crate::types::EndpointType) -> Self {
187        self.inner = self.inner.endpoint_type(input);
188        self
189    }
190    /// <p>A string that specifies the type of endpoint.</p>
191    pub fn set_endpoint_type(mut self, input: ::std::option::Option<crate::types::EndpointType>) -> Self {
192        self.inner = self.inner.set_endpoint_type(input);
193        self
194    }
195    /// <p>A string that specifies the type of endpoint.</p>
196    pub fn get_endpoint_type(&self) -> &::std::option::Option<crate::types::EndpointType> {
197        self.inner.get_endpoint_type()
198    }
199}