aws_sdk_gamelift/operation/create_location/_create_location_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 CreateLocationInput {
6 /// <p>A descriptive name for the custom location.</p>
7 pub location_name: ::std::option::Option<::std::string::String>,
8 /// <p>A list of labels to assign to the new 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 Rareference</i>.</p>
9 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
10}
11impl CreateLocationInput {
12 /// <p>A descriptive name for the custom location.</p>
13 pub fn location_name(&self) -> ::std::option::Option<&str> {
14 self.location_name.as_deref()
15 }
16 /// <p>A list of labels to assign to the new 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 Rareference</i>.</p>
17 ///
18 /// 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()`.
19 pub fn tags(&self) -> &[crate::types::Tag] {
20 self.tags.as_deref().unwrap_or_default()
21 }
22}
23impl CreateLocationInput {
24 /// Creates a new builder-style object to manufacture [`CreateLocationInput`](crate::operation::create_location::CreateLocationInput).
25 pub fn builder() -> crate::operation::create_location::builders::CreateLocationInputBuilder {
26 crate::operation::create_location::builders::CreateLocationInputBuilder::default()
27 }
28}
29
30/// A builder for [`CreateLocationInput`](crate::operation::create_location::CreateLocationInput).
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct CreateLocationInputBuilder {
34 pub(crate) location_name: ::std::option::Option<::std::string::String>,
35 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
36}
37impl CreateLocationInputBuilder {
38 /// <p>A descriptive name for the custom location.</p>
39 /// This field is required.
40 pub fn location_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
41 self.location_name = ::std::option::Option::Some(input.into());
42 self
43 }
44 /// <p>A descriptive name for the custom location.</p>
45 pub fn set_location_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
46 self.location_name = input;
47 self
48 }
49 /// <p>A descriptive name for the custom location.</p>
50 pub fn get_location_name(&self) -> &::std::option::Option<::std::string::String> {
51 &self.location_name
52 }
53 /// Appends an item to `tags`.
54 ///
55 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
56 ///
57 /// <p>A list of labels to assign to the new 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 Rareference</i>.</p>
58 pub fn tags(mut self, input: crate::types::Tag) -> Self {
59 let mut v = self.tags.unwrap_or_default();
60 v.push(input);
61 self.tags = ::std::option::Option::Some(v);
62 self
63 }
64 /// <p>A list of labels to assign to the new 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 Rareference</i>.</p>
65 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
66 self.tags = input;
67 self
68 }
69 /// <p>A list of labels to assign to the new 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 Rareference</i>.</p>
70 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
71 &self.tags
72 }
73 /// Consumes the builder and constructs a [`CreateLocationInput`](crate::operation::create_location::CreateLocationInput).
74 pub fn build(
75 self,
76 ) -> ::std::result::Result<crate::operation::create_location::CreateLocationInput, ::aws_smithy_types::error::operation::BuildError> {
77 ::std::result::Result::Ok(crate::operation::create_location::CreateLocationInput {
78 location_name: self.location_name,
79 tags: self.tags,
80 })
81 }
82}