Skip to main content

aws_sdk_backupgateway/types/
_vmware_to_aws_tag_mapping.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>This displays the mapping of VMware tags to the corresponding Amazon Web Services tags.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct VmwareToAwsTagMapping {
7    /// <p>The is the category of VMware.</p>
8    pub vmware_category: ::std::string::String,
9    /// <p>This is the user-defined name of a VMware tag.</p>
10    pub vmware_tag_name: ::std::string::String,
11    /// <p>The key part of the Amazon Web Services tag's key-value pair.</p>
12    pub aws_tag_key: ::std::string::String,
13    /// <p>The value part of the Amazon Web Services tag's key-value pair.</p>
14    pub aws_tag_value: ::std::string::String,
15}
16impl VmwareToAwsTagMapping {
17    /// <p>The is the category of VMware.</p>
18    pub fn vmware_category(&self) -> &str {
19        use std::ops::Deref;
20        self.vmware_category.deref()
21    }
22    /// <p>This is the user-defined name of a VMware tag.</p>
23    pub fn vmware_tag_name(&self) -> &str {
24        use std::ops::Deref;
25        self.vmware_tag_name.deref()
26    }
27    /// <p>The key part of the Amazon Web Services tag's key-value pair.</p>
28    pub fn aws_tag_key(&self) -> &str {
29        use std::ops::Deref;
30        self.aws_tag_key.deref()
31    }
32    /// <p>The value part of the Amazon Web Services tag's key-value pair.</p>
33    pub fn aws_tag_value(&self) -> &str {
34        use std::ops::Deref;
35        self.aws_tag_value.deref()
36    }
37}
38impl VmwareToAwsTagMapping {
39    /// Creates a new builder-style object to manufacture [`VmwareToAwsTagMapping`](crate::types::VmwareToAwsTagMapping).
40    pub fn builder() -> crate::types::builders::VmwareToAwsTagMappingBuilder {
41        crate::types::builders::VmwareToAwsTagMappingBuilder::default()
42    }
43}
44
45/// A builder for [`VmwareToAwsTagMapping`](crate::types::VmwareToAwsTagMapping).
46#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
47#[non_exhaustive]
48pub struct VmwareToAwsTagMappingBuilder {
49    pub(crate) vmware_category: ::std::option::Option<::std::string::String>,
50    pub(crate) vmware_tag_name: ::std::option::Option<::std::string::String>,
51    pub(crate) aws_tag_key: ::std::option::Option<::std::string::String>,
52    pub(crate) aws_tag_value: ::std::option::Option<::std::string::String>,
53}
54impl VmwareToAwsTagMappingBuilder {
55    /// <p>The is the category of VMware.</p>
56    /// This field is required.
57    pub fn vmware_category(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
58        self.vmware_category = ::std::option::Option::Some(input.into());
59        self
60    }
61    /// <p>The is the category of VMware.</p>
62    pub fn set_vmware_category(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
63        self.vmware_category = input;
64        self
65    }
66    /// <p>The is the category of VMware.</p>
67    pub fn get_vmware_category(&self) -> &::std::option::Option<::std::string::String> {
68        &self.vmware_category
69    }
70    /// <p>This is the user-defined name of a VMware tag.</p>
71    /// This field is required.
72    pub fn vmware_tag_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
73        self.vmware_tag_name = ::std::option::Option::Some(input.into());
74        self
75    }
76    /// <p>This is the user-defined name of a VMware tag.</p>
77    pub fn set_vmware_tag_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
78        self.vmware_tag_name = input;
79        self
80    }
81    /// <p>This is the user-defined name of a VMware tag.</p>
82    pub fn get_vmware_tag_name(&self) -> &::std::option::Option<::std::string::String> {
83        &self.vmware_tag_name
84    }
85    /// <p>The key part of the Amazon Web Services tag's key-value pair.</p>
86    /// This field is required.
87    pub fn aws_tag_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
88        self.aws_tag_key = ::std::option::Option::Some(input.into());
89        self
90    }
91    /// <p>The key part of the Amazon Web Services tag's key-value pair.</p>
92    pub fn set_aws_tag_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
93        self.aws_tag_key = input;
94        self
95    }
96    /// <p>The key part of the Amazon Web Services tag's key-value pair.</p>
97    pub fn get_aws_tag_key(&self) -> &::std::option::Option<::std::string::String> {
98        &self.aws_tag_key
99    }
100    /// <p>The value part of the Amazon Web Services tag's key-value pair.</p>
101    /// This field is required.
102    pub fn aws_tag_value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103        self.aws_tag_value = ::std::option::Option::Some(input.into());
104        self
105    }
106    /// <p>The value part of the Amazon Web Services tag's key-value pair.</p>
107    pub fn set_aws_tag_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108        self.aws_tag_value = input;
109        self
110    }
111    /// <p>The value part of the Amazon Web Services tag's key-value pair.</p>
112    pub fn get_aws_tag_value(&self) -> &::std::option::Option<::std::string::String> {
113        &self.aws_tag_value
114    }
115    /// Consumes the builder and constructs a [`VmwareToAwsTagMapping`](crate::types::VmwareToAwsTagMapping).
116    /// This method will fail if any of the following fields are not set:
117    /// - [`vmware_category`](crate::types::builders::VmwareToAwsTagMappingBuilder::vmware_category)
118    /// - [`vmware_tag_name`](crate::types::builders::VmwareToAwsTagMappingBuilder::vmware_tag_name)
119    /// - [`aws_tag_key`](crate::types::builders::VmwareToAwsTagMappingBuilder::aws_tag_key)
120    /// - [`aws_tag_value`](crate::types::builders::VmwareToAwsTagMappingBuilder::aws_tag_value)
121    pub fn build(self) -> ::std::result::Result<crate::types::VmwareToAwsTagMapping, ::aws_smithy_types::error::operation::BuildError> {
122        ::std::result::Result::Ok(crate::types::VmwareToAwsTagMapping {
123            vmware_category: self.vmware_category.ok_or_else(|| {
124                ::aws_smithy_types::error::operation::BuildError::missing_field(
125                    "vmware_category",
126                    "vmware_category was not specified but it is required when building VmwareToAwsTagMapping",
127                )
128            })?,
129            vmware_tag_name: self.vmware_tag_name.ok_or_else(|| {
130                ::aws_smithy_types::error::operation::BuildError::missing_field(
131                    "vmware_tag_name",
132                    "vmware_tag_name was not specified but it is required when building VmwareToAwsTagMapping",
133                )
134            })?,
135            aws_tag_key: self.aws_tag_key.ok_or_else(|| {
136                ::aws_smithy_types::error::operation::BuildError::missing_field(
137                    "aws_tag_key",
138                    "aws_tag_key was not specified but it is required when building VmwareToAwsTagMapping",
139                )
140            })?,
141            aws_tag_value: self.aws_tag_value.ok_or_else(|| {
142                ::aws_smithy_types::error::operation::BuildError::missing_field(
143                    "aws_tag_value",
144                    "aws_tag_value was not specified but it is required when building VmwareToAwsTagMapping",
145                )
146            })?,
147        })
148    }
149}