1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Describes the target resource of an import operation.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ResourceToImport {
    /// <p>The type of resource to import into your stack, such as <code>AWS::S3::Bucket</code>. For a list of supported resource types, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resource-import-supported-resources.html">Resources that support import operations</a> in the <i>CloudFormation User Guide</i>.</p>
    pub resource_type: ::std::option::Option<::std::string::String>,
    /// <p>The logical ID of the target resource as specified in the template.</p>
    pub logical_resource_id: ::std::option::Option<::std::string::String>,
    /// <p>A key-value pair that identifies the target resource. The key is an identifier property (for example, <code>BucketName</code> for <code>AWS::S3::Bucket</code> resources) and the value is the actual property value (for example, <code>MyS3Bucket</code>).</p>
    pub resource_identifier: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl ResourceToImport {
    /// <p>The type of resource to import into your stack, such as <code>AWS::S3::Bucket</code>. For a list of supported resource types, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resource-import-supported-resources.html">Resources that support import operations</a> in the <i>CloudFormation User Guide</i>.</p>
    pub fn resource_type(&self) -> ::std::option::Option<&str> {
        self.resource_type.as_deref()
    }
    /// <p>The logical ID of the target resource as specified in the template.</p>
    pub fn logical_resource_id(&self) -> ::std::option::Option<&str> {
        self.logical_resource_id.as_deref()
    }
    /// <p>A key-value pair that identifies the target resource. The key is an identifier property (for example, <code>BucketName</code> for <code>AWS::S3::Bucket</code> resources) and the value is the actual property value (for example, <code>MyS3Bucket</code>).</p>
    pub fn resource_identifier(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.resource_identifier.as_ref()
    }
}
impl ResourceToImport {
    /// Creates a new builder-style object to manufacture [`ResourceToImport`](crate::types::ResourceToImport).
    pub fn builder() -> crate::types::builders::ResourceToImportBuilder {
        crate::types::builders::ResourceToImportBuilder::default()
    }
}

/// A builder for [`ResourceToImport`](crate::types::ResourceToImport).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct ResourceToImportBuilder {
    pub(crate) resource_type: ::std::option::Option<::std::string::String>,
    pub(crate) logical_resource_id: ::std::option::Option<::std::string::String>,
    pub(crate) resource_identifier: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl ResourceToImportBuilder {
    /// <p>The type of resource to import into your stack, such as <code>AWS::S3::Bucket</code>. For a list of supported resource types, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resource-import-supported-resources.html">Resources that support import operations</a> in the <i>CloudFormation User Guide</i>.</p>
    /// This field is required.
    pub fn resource_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.resource_type = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The type of resource to import into your stack, such as <code>AWS::S3::Bucket</code>. For a list of supported resource types, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resource-import-supported-resources.html">Resources that support import operations</a> in the <i>CloudFormation User Guide</i>.</p>
    pub fn set_resource_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.resource_type = input;
        self
    }
    /// <p>The type of resource to import into your stack, such as <code>AWS::S3::Bucket</code>. For a list of supported resource types, see <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resource-import-supported-resources.html">Resources that support import operations</a> in the <i>CloudFormation User Guide</i>.</p>
    pub fn get_resource_type(&self) -> &::std::option::Option<::std::string::String> {
        &self.resource_type
    }
    /// <p>The logical ID of the target resource as specified in the template.</p>
    /// This field is required.
    pub fn logical_resource_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.logical_resource_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The logical ID of the target resource as specified in the template.</p>
    pub fn set_logical_resource_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.logical_resource_id = input;
        self
    }
    /// <p>The logical ID of the target resource as specified in the template.</p>
    pub fn get_logical_resource_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.logical_resource_id
    }
    /// Adds a key-value pair to `resource_identifier`.
    ///
    /// To override the contents of this collection use [`set_resource_identifier`](Self::set_resource_identifier).
    ///
    /// <p>A key-value pair that identifies the target resource. The key is an identifier property (for example, <code>BucketName</code> for <code>AWS::S3::Bucket</code> resources) and the value is the actual property value (for example, <code>MyS3Bucket</code>).</p>
    pub fn resource_identifier(
        mut self,
        k: impl ::std::convert::Into<::std::string::String>,
        v: impl ::std::convert::Into<::std::string::String>,
    ) -> Self {
        let mut hash_map = self.resource_identifier.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.resource_identifier = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>A key-value pair that identifies the target resource. The key is an identifier property (for example, <code>BucketName</code> for <code>AWS::S3::Bucket</code> resources) and the value is the actual property value (for example, <code>MyS3Bucket</code>).</p>
    pub fn set_resource_identifier(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    ) -> Self {
        self.resource_identifier = input;
        self
    }
    /// <p>A key-value pair that identifies the target resource. The key is an identifier property (for example, <code>BucketName</code> for <code>AWS::S3::Bucket</code> resources) and the value is the actual property value (for example, <code>MyS3Bucket</code>).</p>
    pub fn get_resource_identifier(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.resource_identifier
    }
    /// Consumes the builder and constructs a [`ResourceToImport`](crate::types::ResourceToImport).
    pub fn build(self) -> crate::types::ResourceToImport {
        crate::types::ResourceToImport {
            resource_type: self.resource_type,
            logical_resource_id: self.logical_resource_id,
            resource_identifier: self.resource_identifier,
        }
    }
}