aws_sdk_servicediscovery/operation/update_service/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_service::_update_service_output::UpdateServiceOutputBuilder;
3
4pub use crate::operation::update_service::_update_service_input::UpdateServiceInputBuilder;
5
6impl crate::operation::update_service::builders::UpdateServiceInputBuilder {
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::update_service::UpdateServiceOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::update_service::UpdateServiceError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.update_service();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `UpdateService`.
24///
25/// <p>Submits a request to perform the following operations:</p>
26/// <ul>
27/// <li>
28/// <p>Update the TTL setting for existing <code>DnsRecords</code> configurations</p></li>
29/// <li>
30/// <p>Add, update, or delete <code>HealthCheckConfig</code> for a specified service</p><note>
31/// <p>You can't add, update, or delete a <code>HealthCheckCustomConfig</code> configuration.</p>
32/// </note></li>
33/// </ul>
34/// <p>For public and private DNS namespaces, note the following:</p>
35/// <ul>
36/// <li>
37/// <p>If you omit any existing <code>DnsRecords</code> or <code>HealthCheckConfig</code> configurations from an <code>UpdateService</code> request, the configurations are deleted from the service.</p></li>
38/// <li>
39/// <p>If you omit an existing <code>HealthCheckCustomConfig</code> configuration from an <code>UpdateService</code> request, the configuration isn't deleted from the service.</p></li>
40/// </ul><note>
41/// <p>You can't call <code>UpdateService</code> and update settings in the following scenarios:</p>
42/// <ul>
43/// <li>
44/// <p>When the service is associated with an HTTP namespace</p></li>
45/// <li>
46/// <p>When the service is associated with a shared namespace and contains instances that were registered by Amazon Web Services accounts other than the account making the <code>UpdateService</code> call</p></li>
47/// </ul>
48/// </note>
49/// <p>When you update settings for a service, Cloud Map also updates the corresponding settings in all the records and health checks that were created by using the specified service.</p>
50#[derive(::std::clone::Clone, ::std::fmt::Debug)]
51pub struct UpdateServiceFluentBuilder {
52 handle: ::std::sync::Arc<crate::client::Handle>,
53 inner: crate::operation::update_service::builders::UpdateServiceInputBuilder,
54 config_override: ::std::option::Option<crate::config::Builder>,
55}
56impl
57 crate::client::customize::internal::CustomizableSend<
58 crate::operation::update_service::UpdateServiceOutput,
59 crate::operation::update_service::UpdateServiceError,
60 > for UpdateServiceFluentBuilder
61{
62 fn send(
63 self,
64 config_override: crate::config::Builder,
65 ) -> crate::client::customize::internal::BoxFuture<
66 crate::client::customize::internal::SendResult<
67 crate::operation::update_service::UpdateServiceOutput,
68 crate::operation::update_service::UpdateServiceError,
69 >,
70 > {
71 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
72 }
73}
74impl UpdateServiceFluentBuilder {
75 /// Creates a new `UpdateServiceFluentBuilder`.
76 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
77 Self {
78 handle,
79 inner: ::std::default::Default::default(),
80 config_override: ::std::option::Option::None,
81 }
82 }
83 /// Access the UpdateService as a reference.
84 pub fn as_input(&self) -> &crate::operation::update_service::builders::UpdateServiceInputBuilder {
85 &self.inner
86 }
87 /// Sends the request and returns the response.
88 ///
89 /// If an error occurs, an `SdkError` will be returned with additional details that
90 /// can be matched against.
91 ///
92 /// By default, any retryable failures will be retried twice. Retry behavior
93 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
94 /// set when configuring the client.
95 pub async fn send(
96 self,
97 ) -> ::std::result::Result<
98 crate::operation::update_service::UpdateServiceOutput,
99 ::aws_smithy_runtime_api::client::result::SdkError<
100 crate::operation::update_service::UpdateServiceError,
101 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
102 >,
103 > {
104 let input = self
105 .inner
106 .build()
107 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
108 let runtime_plugins = crate::operation::update_service::UpdateService::operation_runtime_plugins(
109 self.handle.runtime_plugins.clone(),
110 &self.handle.conf,
111 self.config_override,
112 );
113 crate::operation::update_service::UpdateService::orchestrate(&runtime_plugins, input).await
114 }
115
116 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
117 pub fn customize(
118 self,
119 ) -> crate::client::customize::CustomizableOperation<
120 crate::operation::update_service::UpdateServiceOutput,
121 crate::operation::update_service::UpdateServiceError,
122 Self,
123 > {
124 crate::client::customize::CustomizableOperation::new(self)
125 }
126 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
127 self.set_config_override(::std::option::Option::Some(config_override.into()));
128 self
129 }
130
131 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
132 self.config_override = config_override;
133 self
134 }
135 /// <p>The ID or Amazon Resource Name (ARN) of the service that you want to update. If the namespace associated with the service is shared with your Amazon Web Services account, specify the service ARN. For more information about shared namespaces, see <a href="https://docs.aws.amazon.com/cloud-map/latest/dg/sharing-namespaces.html">Cross-account Cloud Map namespace sharing</a> in the <i>Cloud Map Developer Guide</i></p>
136 pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137 self.inner = self.inner.id(input.into());
138 self
139 }
140 /// <p>The ID or Amazon Resource Name (ARN) of the service that you want to update. If the namespace associated with the service is shared with your Amazon Web Services account, specify the service ARN. For more information about shared namespaces, see <a href="https://docs.aws.amazon.com/cloud-map/latest/dg/sharing-namespaces.html">Cross-account Cloud Map namespace sharing</a> in the <i>Cloud Map Developer Guide</i></p>
141 pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142 self.inner = self.inner.set_id(input);
143 self
144 }
145 /// <p>The ID or Amazon Resource Name (ARN) of the service that you want to update. If the namespace associated with the service is shared with your Amazon Web Services account, specify the service ARN. For more information about shared namespaces, see <a href="https://docs.aws.amazon.com/cloud-map/latest/dg/sharing-namespaces.html">Cross-account Cloud Map namespace sharing</a> in the <i>Cloud Map Developer Guide</i></p>
146 pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
147 self.inner.get_id()
148 }
149 /// <p>A complex type that contains the new settings for the service. You can specify a maximum of 30 attributes (key-value pairs).</p>
150 pub fn service(mut self, input: crate::types::ServiceChange) -> Self {
151 self.inner = self.inner.service(input);
152 self
153 }
154 /// <p>A complex type that contains the new settings for the service. You can specify a maximum of 30 attributes (key-value pairs).</p>
155 pub fn set_service(mut self, input: ::std::option::Option<crate::types::ServiceChange>) -> Self {
156 self.inner = self.inner.set_service(input);
157 self
158 }
159 /// <p>A complex type that contains the new settings for the service. You can specify a maximum of 30 attributes (key-value pairs).</p>
160 pub fn get_service(&self) -> &::std::option::Option<crate::types::ServiceChange> {
161 self.inner.get_service()
162 }
163}