aws_sdk_location/operation/update_route_calculator/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_route_calculator::_update_route_calculator_output::UpdateRouteCalculatorOutputBuilder;
3
4pub use crate::operation::update_route_calculator::_update_route_calculator_input::UpdateRouteCalculatorInputBuilder;
5
6impl crate::operation::update_route_calculator::builders::UpdateRouteCalculatorInputBuilder {
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_route_calculator::UpdateRouteCalculatorOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_route_calculator::UpdateRouteCalculatorError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_route_calculator();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateRouteCalculator`.
24///
25/// <important>
26/// <p>This operation is no longer current and may be deprecated in the future. We recommend you upgrade to the Routes API V2 unless you require Grab data.</p>
27/// <ul>
28/// <li>
29/// <p><code>UpdateRouteCalculator</code> is part of a previous Amazon Location Service Routes API (version 1) which has been superseded by a more intuitive, powerful, and complete API (version 2).</p></li>
30/// <li>
31/// <p>The Routes API version 2 has a simplified interface that can be used without creating or managing route calculator resources.</p></li>
32/// <li>
33/// <p>If you are using an Amazon Web Services SDK or the Amazon Web Services CLI, note that the Routes API version 2 is found under <code>geo-routes</code> or <code>geo_routes</code>, not under <code>location</code>.</p></li>
34/// <li>
35/// <p>Since Grab is not yet fully supported in Routes API version 2, we recommend you continue using API version 1 when using Grab.</p></li>
36/// <li>
37/// <p>Start your version 2 API journey with the Routes V2 <a href="/location/latest/APIReference/API_Operations_Amazon_Location_Service_Routes_V2.html">API Reference</a> or the <a href="/location/latest/developerguide/routes.html">Developer Guide</a>.</p></li>
38/// </ul>
39/// </important>
40/// <p>Updates the specified properties for a given route calculator resource.</p>
41#[derive(::std::clone::Clone, ::std::fmt::Debug)]
42pub struct UpdateRouteCalculatorFluentBuilder {
43    handle: ::std::sync::Arc<crate::client::Handle>,
44    inner: crate::operation::update_route_calculator::builders::UpdateRouteCalculatorInputBuilder,
45    config_override: ::std::option::Option<crate::config::Builder>,
46}
47impl
48    crate::client::customize::internal::CustomizableSend<
49        crate::operation::update_route_calculator::UpdateRouteCalculatorOutput,
50        crate::operation::update_route_calculator::UpdateRouteCalculatorError,
51    > for UpdateRouteCalculatorFluentBuilder
52{
53    fn send(
54        self,
55        config_override: crate::config::Builder,
56    ) -> crate::client::customize::internal::BoxFuture<
57        crate::client::customize::internal::SendResult<
58            crate::operation::update_route_calculator::UpdateRouteCalculatorOutput,
59            crate::operation::update_route_calculator::UpdateRouteCalculatorError,
60        >,
61    > {
62        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
63    }
64}
65impl UpdateRouteCalculatorFluentBuilder {
66    /// Creates a new `UpdateRouteCalculatorFluentBuilder`.
67    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
68        Self {
69            handle,
70            inner: ::std::default::Default::default(),
71            config_override: ::std::option::Option::None,
72        }
73    }
74    /// Access the UpdateRouteCalculator as a reference.
75    pub fn as_input(&self) -> &crate::operation::update_route_calculator::builders::UpdateRouteCalculatorInputBuilder {
76        &self.inner
77    }
78    /// Sends the request and returns the response.
79    ///
80    /// If an error occurs, an `SdkError` will be returned with additional details that
81    /// can be matched against.
82    ///
83    /// By default, any retryable failures will be retried twice. Retry behavior
84    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
85    /// set when configuring the client.
86    pub async fn send(
87        self,
88    ) -> ::std::result::Result<
89        crate::operation::update_route_calculator::UpdateRouteCalculatorOutput,
90        ::aws_smithy_runtime_api::client::result::SdkError<
91            crate::operation::update_route_calculator::UpdateRouteCalculatorError,
92            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
93        >,
94    > {
95        let input = self
96            .inner
97            .build()
98            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
99        let runtime_plugins = crate::operation::update_route_calculator::UpdateRouteCalculator::operation_runtime_plugins(
100            self.handle.runtime_plugins.clone(),
101            &self.handle.conf,
102            self.config_override,
103        );
104        crate::operation::update_route_calculator::UpdateRouteCalculator::orchestrate(&runtime_plugins, input).await
105    }
106
107    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
108    pub fn customize(
109        self,
110    ) -> crate::client::customize::CustomizableOperation<
111        crate::operation::update_route_calculator::UpdateRouteCalculatorOutput,
112        crate::operation::update_route_calculator::UpdateRouteCalculatorError,
113        Self,
114    > {
115        crate::client::customize::CustomizableOperation::new(self)
116    }
117    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
118        self.set_config_override(::std::option::Option::Some(config_override.into()));
119        self
120    }
121
122    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
123        self.config_override = config_override;
124        self
125    }
126    /// <p>The name of the route calculator resource to update.</p>
127    pub fn calculator_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128        self.inner = self.inner.calculator_name(input.into());
129        self
130    }
131    /// <p>The name of the route calculator resource to update.</p>
132    pub fn set_calculator_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
133        self.inner = self.inner.set_calculator_name(input);
134        self
135    }
136    /// <p>The name of the route calculator resource to update.</p>
137    pub fn get_calculator_name(&self) -> &::std::option::Option<::std::string::String> {
138        self.inner.get_calculator_name()
139    }
140    /// <p>No longer used. If included, the only allowed value is <code>RequestBasedUsage</code>.</p>
141    #[deprecated(note = "Deprecated. If included, the only allowed value is RequestBasedUsage.", since = "2022-02-01")]
142    pub fn pricing_plan(mut self, input: crate::types::PricingPlan) -> Self {
143        self.inner = self.inner.pricing_plan(input);
144        self
145    }
146    /// <p>No longer used. If included, the only allowed value is <code>RequestBasedUsage</code>.</p>
147    #[deprecated(note = "Deprecated. If included, the only allowed value is RequestBasedUsage.", since = "2022-02-01")]
148    pub fn set_pricing_plan(mut self, input: ::std::option::Option<crate::types::PricingPlan>) -> Self {
149        self.inner = self.inner.set_pricing_plan(input);
150        self
151    }
152    /// <p>No longer used. If included, the only allowed value is <code>RequestBasedUsage</code>.</p>
153    #[deprecated(note = "Deprecated. If included, the only allowed value is RequestBasedUsage.", since = "2022-02-01")]
154    pub fn get_pricing_plan(&self) -> &::std::option::Option<crate::types::PricingPlan> {
155        self.inner.get_pricing_plan()
156    }
157    /// <p>Updates the description for the route calculator resource.</p>
158    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159        self.inner = self.inner.description(input.into());
160        self
161    }
162    /// <p>Updates the description for the route calculator resource.</p>
163    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164        self.inner = self.inner.set_description(input);
165        self
166    }
167    /// <p>Updates the description for the route calculator resource.</p>
168    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
169        self.inner.get_description()
170    }
171}