aws_sdk_gamelift/operation/create_alias/
_create_alias_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateAliasInput {
6    /// <p>A descriptive label that is associated with an alias. Alias names do not need to be unique.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>A human-readable description of the alias.</p>
9    pub description: ::std::option::Option<::std::string::String>,
10    /// <p>The routing configuration, including routing type and fleet target, for the alias.</p>
11    pub routing_strategy: ::std::option::Option<crate::types::RoutingStrategy>,
12    /// <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>
13    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
14}
15impl CreateAliasInput {
16    /// <p>A descriptive label that is associated with an alias. Alias names do not need to be unique.</p>
17    pub fn name(&self) -> ::std::option::Option<&str> {
18        self.name.as_deref()
19    }
20    /// <p>A human-readable description of the alias.</p>
21    pub fn description(&self) -> ::std::option::Option<&str> {
22        self.description.as_deref()
23    }
24    /// <p>The routing configuration, including routing type and fleet target, for the alias.</p>
25    pub fn routing_strategy(&self) -> ::std::option::Option<&crate::types::RoutingStrategy> {
26        self.routing_strategy.as_ref()
27    }
28    /// <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>
29    ///
30    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
31    pub fn tags(&self) -> &[crate::types::Tag] {
32        self.tags.as_deref().unwrap_or_default()
33    }
34}
35impl CreateAliasInput {
36    /// Creates a new builder-style object to manufacture [`CreateAliasInput`](crate::operation::create_alias::CreateAliasInput).
37    pub fn builder() -> crate::operation::create_alias::builders::CreateAliasInputBuilder {
38        crate::operation::create_alias::builders::CreateAliasInputBuilder::default()
39    }
40}
41
42/// A builder for [`CreateAliasInput`](crate::operation::create_alias::CreateAliasInput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct CreateAliasInputBuilder {
46    pub(crate) name: ::std::option::Option<::std::string::String>,
47    pub(crate) description: ::std::option::Option<::std::string::String>,
48    pub(crate) routing_strategy: ::std::option::Option<crate::types::RoutingStrategy>,
49    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
50}
51impl CreateAliasInputBuilder {
52    /// <p>A descriptive label that is associated with an alias. Alias names do not need to be unique.</p>
53    /// This field is required.
54    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55        self.name = ::std::option::Option::Some(input.into());
56        self
57    }
58    /// <p>A descriptive label that is associated with an alias. Alias names do not need to be unique.</p>
59    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60        self.name = input;
61        self
62    }
63    /// <p>A descriptive label that is associated with an alias. Alias names do not need to be unique.</p>
64    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
65        &self.name
66    }
67    /// <p>A human-readable description of the alias.</p>
68    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69        self.description = ::std::option::Option::Some(input.into());
70        self
71    }
72    /// <p>A human-readable description of the alias.</p>
73    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74        self.description = input;
75        self
76    }
77    /// <p>A human-readable description of the alias.</p>
78    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
79        &self.description
80    }
81    /// <p>The routing configuration, including routing type and fleet target, for the alias.</p>
82    /// This field is required.
83    pub fn routing_strategy(mut self, input: crate::types::RoutingStrategy) -> Self {
84        self.routing_strategy = ::std::option::Option::Some(input);
85        self
86    }
87    /// <p>The routing configuration, including routing type and fleet target, for the alias.</p>
88    pub fn set_routing_strategy(mut self, input: ::std::option::Option<crate::types::RoutingStrategy>) -> Self {
89        self.routing_strategy = input;
90        self
91    }
92    /// <p>The routing configuration, including routing type and fleet target, for the alias.</p>
93    pub fn get_routing_strategy(&self) -> &::std::option::Option<crate::types::RoutingStrategy> {
94        &self.routing_strategy
95    }
96    /// Appends an item to `tags`.
97    ///
98    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
99    ///
100    /// <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>
101    pub fn tags(mut self, input: crate::types::Tag) -> Self {
102        let mut v = self.tags.unwrap_or_default();
103        v.push(input);
104        self.tags = ::std::option::Option::Some(v);
105        self
106    }
107    /// <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>
108    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
109        self.tags = input;
110        self
111    }
112    /// <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>
113    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
114        &self.tags
115    }
116    /// Consumes the builder and constructs a [`CreateAliasInput`](crate::operation::create_alias::CreateAliasInput).
117    pub fn build(self) -> ::std::result::Result<crate::operation::create_alias::CreateAliasInput, ::aws_smithy_types::error::operation::BuildError> {
118        ::std::result::Result::Ok(crate::operation::create_alias::CreateAliasInput {
119            name: self.name,
120            description: self.description,
121            routing_strategy: self.routing_strategy,
122            tags: self.tags,
123        })
124    }
125}