aws_sdk_gamelift/operation/create_alias/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_alias::_create_alias_output::CreateAliasOutputBuilder;
3
4pub use crate::operation::create_alias::_create_alias_input::CreateAliasInputBuilder;
5
6impl crate::operation::create_alias::builders::CreateAliasInputBuilder {
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_alias::CreateAliasOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_alias::CreateAliasError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_alias();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateAlias`.
24///
25/// <p><b>This API works with the following fleet types:</b> EC2, Anywhere, Container</p>
26/// <p>Creates an alias for a fleet. In most situations, you can use an alias ID in place of a fleet ID. An alias provides a level of abstraction for a fleet that is useful when redirecting player traffic from one fleet to another, such as when updating your game build.</p>
27/// <p>Amazon GameLift Servers supports two types of routing strategies for aliases: simple and terminal. A simple alias points to an active fleet. A terminal alias is used to display messaging or link to a URL instead of routing players to an active fleet. For example, you might use a terminal alias when a game version is no longer supported and you want to direct players to an upgrade site.</p>
28/// <p>To create a fleet alias, specify an alias name, routing strategy, and optional description. Each simple alias can point to only one fleet, but a fleet can have multiple aliases. If successful, a new alias record is returned, including an alias ID and an ARN. You can reassign an alias to another fleet by calling <code>UpdateAlias</code>.</p>
29/// <p><b>Related actions</b></p>
30/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets">All APIs by task</a></p>
31#[derive(::std::clone::Clone, ::std::fmt::Debug)]
32pub struct CreateAliasFluentBuilder {
33    handle: ::std::sync::Arc<crate::client::Handle>,
34    inner: crate::operation::create_alias::builders::CreateAliasInputBuilder,
35    config_override: ::std::option::Option<crate::config::Builder>,
36}
37impl
38    crate::client::customize::internal::CustomizableSend<
39        crate::operation::create_alias::CreateAliasOutput,
40        crate::operation::create_alias::CreateAliasError,
41    > for CreateAliasFluentBuilder
42{
43    fn send(
44        self,
45        config_override: crate::config::Builder,
46    ) -> crate::client::customize::internal::BoxFuture<
47        crate::client::customize::internal::SendResult<
48            crate::operation::create_alias::CreateAliasOutput,
49            crate::operation::create_alias::CreateAliasError,
50        >,
51    > {
52        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
53    }
54}
55impl CreateAliasFluentBuilder {
56    /// Creates a new `CreateAliasFluentBuilder`.
57    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
58        Self {
59            handle,
60            inner: ::std::default::Default::default(),
61            config_override: ::std::option::Option::None,
62        }
63    }
64    /// Access the CreateAlias as a reference.
65    pub fn as_input(&self) -> &crate::operation::create_alias::builders::CreateAliasInputBuilder {
66        &self.inner
67    }
68    /// Sends the request and returns the response.
69    ///
70    /// If an error occurs, an `SdkError` will be returned with additional details that
71    /// can be matched against.
72    ///
73    /// By default, any retryable failures will be retried twice. Retry behavior
74    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
75    /// set when configuring the client.
76    pub async fn send(
77        self,
78    ) -> ::std::result::Result<
79        crate::operation::create_alias::CreateAliasOutput,
80        ::aws_smithy_runtime_api::client::result::SdkError<
81            crate::operation::create_alias::CreateAliasError,
82            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
83        >,
84    > {
85        let input = self
86            .inner
87            .build()
88            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
89        let runtime_plugins = crate::operation::create_alias::CreateAlias::operation_runtime_plugins(
90            self.handle.runtime_plugins.clone(),
91            &self.handle.conf,
92            self.config_override,
93        );
94        crate::operation::create_alias::CreateAlias::orchestrate(&runtime_plugins, input).await
95    }
96
97    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
98    pub fn customize(
99        self,
100    ) -> crate::client::customize::CustomizableOperation<
101        crate::operation::create_alias::CreateAliasOutput,
102        crate::operation::create_alias::CreateAliasError,
103        Self,
104    > {
105        crate::client::customize::CustomizableOperation::new(self)
106    }
107    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
108        self.set_config_override(::std::option::Option::Some(config_override.into()));
109        self
110    }
111
112    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
113        self.config_override = config_override;
114        self
115    }
116    /// <p>A descriptive label that is associated with an alias. Alias names do not need to be unique.</p>
117    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118        self.inner = self.inner.name(input.into());
119        self
120    }
121    /// <p>A descriptive label that is associated with an alias. Alias names do not need to be unique.</p>
122    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
123        self.inner = self.inner.set_name(input);
124        self
125    }
126    /// <p>A descriptive label that is associated with an alias. Alias names do not need to be unique.</p>
127    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
128        self.inner.get_name()
129    }
130    /// <p>A human-readable description of the alias.</p>
131    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132        self.inner = self.inner.description(input.into());
133        self
134    }
135    /// <p>A human-readable description of the alias.</p>
136    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137        self.inner = self.inner.set_description(input);
138        self
139    }
140    /// <p>A human-readable description of the alias.</p>
141    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
142        self.inner.get_description()
143    }
144    /// <p>The routing configuration, including routing type and fleet target, for the alias.</p>
145    pub fn routing_strategy(mut self, input: crate::types::RoutingStrategy) -> Self {
146        self.inner = self.inner.routing_strategy(input);
147        self
148    }
149    /// <p>The routing configuration, including routing type and fleet target, for the alias.</p>
150    pub fn set_routing_strategy(mut self, input: ::std::option::Option<crate::types::RoutingStrategy>) -> Self {
151        self.inner = self.inner.set_routing_strategy(input);
152        self
153    }
154    /// <p>The routing configuration, including routing type and fleet target, for the alias.</p>
155    pub fn get_routing_strategy(&self) -> &::std::option::Option<crate::types::RoutingStrategy> {
156        self.inner.get_routing_strategy()
157    }
158    ///
159    /// Appends an item to `Tags`.
160    ///
161    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
162    ///
163    /// <p>A list of labels to assign to the new alias resource. Tags are developer-defined key-value pairs. Tagging Amazon Web Services resources are useful for resource management, access management and cost allocation. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html"> Tagging Amazon Web Services Resources</a> in the <i>Amazon Web Services General Reference</i>.</p>
164    pub fn tags(mut self, input: crate::types::Tag) -> Self {
165        self.inner = self.inner.tags(input);
166        self
167    }
168    /// <p>A list of labels to assign to the new alias resource. Tags are developer-defined key-value pairs. Tagging Amazon Web Services resources are useful for resource management, access management and cost allocation. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html"> Tagging Amazon Web Services Resources</a> in the <i>Amazon Web Services General Reference</i>.</p>
169    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
170        self.inner = self.inner.set_tags(input);
171        self
172    }
173    /// <p>A list of labels to assign to the new alias resource. Tags are developer-defined key-value pairs. Tagging Amazon Web Services resources are useful for resource management, access management and cost allocation. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html"> Tagging Amazon Web Services Resources</a> in the <i>Amazon Web Services General Reference</i>.</p>
174    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
175        self.inner.get_tags()
176    }
177}