Skip to main content

aws_sdk_cloudformation/types/
_resource_identifier_summary.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Describes the target resources of a specific type in your import template (for example, all <code>AWS::S3::Bucket</code> resources) and the properties you can provide during the import to identify resources of that type.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ResourceIdentifierSummary {
7    /// <p>The template resource type of the target resources, such as <code>AWS::S3::Bucket</code>.</p>
8    pub resource_type: ::std::option::Option<::std::string::String>,
9    /// <p>The logical IDs of the target resources of the specified <code>ResourceType</code>, as defined in the import template.</p>
10    pub logical_resource_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
11    /// <p>The resource properties you can provide during the import to identify your target resources. For example, <code>BucketName</code> is a possible identifier property for <code>AWS::S3::Bucket</code> resources.</p>
12    pub resource_identifiers: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
13}
14impl ResourceIdentifierSummary {
15    /// <p>The template resource type of the target resources, such as <code>AWS::S3::Bucket</code>.</p>
16    pub fn resource_type(&self) -> ::std::option::Option<&str> {
17        self.resource_type.as_deref()
18    }
19    /// <p>The logical IDs of the target resources of the specified <code>ResourceType</code>, as defined in the import template.</p>
20    ///
21    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.logical_resource_ids.is_none()`.
22    pub fn logical_resource_ids(&self) -> &[::std::string::String] {
23        self.logical_resource_ids.as_deref().unwrap_or_default()
24    }
25    /// <p>The resource properties you can provide during the import to identify your target resources. For example, <code>BucketName</code> is a possible identifier property for <code>AWS::S3::Bucket</code> resources.</p>
26    ///
27    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.resource_identifiers.is_none()`.
28    pub fn resource_identifiers(&self) -> &[::std::string::String] {
29        self.resource_identifiers.as_deref().unwrap_or_default()
30    }
31}
32impl ResourceIdentifierSummary {
33    /// Creates a new builder-style object to manufacture [`ResourceIdentifierSummary`](crate::types::ResourceIdentifierSummary).
34    pub fn builder() -> crate::types::builders::ResourceIdentifierSummaryBuilder {
35        crate::types::builders::ResourceIdentifierSummaryBuilder::default()
36    }
37}
38
39/// A builder for [`ResourceIdentifierSummary`](crate::types::ResourceIdentifierSummary).
40#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
41#[non_exhaustive]
42pub struct ResourceIdentifierSummaryBuilder {
43    pub(crate) resource_type: ::std::option::Option<::std::string::String>,
44    pub(crate) logical_resource_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
45    pub(crate) resource_identifiers: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
46}
47impl ResourceIdentifierSummaryBuilder {
48    /// <p>The template resource type of the target resources, such as <code>AWS::S3::Bucket</code>.</p>
49    pub fn resource_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
50        self.resource_type = ::std::option::Option::Some(input.into());
51        self
52    }
53    /// <p>The template resource type of the target resources, such as <code>AWS::S3::Bucket</code>.</p>
54    pub fn set_resource_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
55        self.resource_type = input;
56        self
57    }
58    /// <p>The template resource type of the target resources, such as <code>AWS::S3::Bucket</code>.</p>
59    pub fn get_resource_type(&self) -> &::std::option::Option<::std::string::String> {
60        &self.resource_type
61    }
62    /// Appends an item to `logical_resource_ids`.
63    ///
64    /// To override the contents of this collection use [`set_logical_resource_ids`](Self::set_logical_resource_ids).
65    ///
66    /// <p>The logical IDs of the target resources of the specified <code>ResourceType</code>, as defined in the import template.</p>
67    pub fn logical_resource_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68        let mut v = self.logical_resource_ids.unwrap_or_default();
69        v.push(input.into());
70        self.logical_resource_ids = ::std::option::Option::Some(v);
71        self
72    }
73    /// <p>The logical IDs of the target resources of the specified <code>ResourceType</code>, as defined in the import template.</p>
74    pub fn set_logical_resource_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
75        self.logical_resource_ids = input;
76        self
77    }
78    /// <p>The logical IDs of the target resources of the specified <code>ResourceType</code>, as defined in the import template.</p>
79    pub fn get_logical_resource_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
80        &self.logical_resource_ids
81    }
82    /// Appends an item to `resource_identifiers`.
83    ///
84    /// To override the contents of this collection use [`set_resource_identifiers`](Self::set_resource_identifiers).
85    ///
86    /// <p>The resource properties you can provide during the import to identify your target resources. For example, <code>BucketName</code> is a possible identifier property for <code>AWS::S3::Bucket</code> resources.</p>
87    pub fn resource_identifiers(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
88        let mut v = self.resource_identifiers.unwrap_or_default();
89        v.push(input.into());
90        self.resource_identifiers = ::std::option::Option::Some(v);
91        self
92    }
93    /// <p>The resource properties you can provide during the import to identify your target resources. For example, <code>BucketName</code> is a possible identifier property for <code>AWS::S3::Bucket</code> resources.</p>
94    pub fn set_resource_identifiers(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
95        self.resource_identifiers = input;
96        self
97    }
98    /// <p>The resource properties you can provide during the import to identify your target resources. For example, <code>BucketName</code> is a possible identifier property for <code>AWS::S3::Bucket</code> resources.</p>
99    pub fn get_resource_identifiers(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
100        &self.resource_identifiers
101    }
102    /// Consumes the builder and constructs a [`ResourceIdentifierSummary`](crate::types::ResourceIdentifierSummary).
103    pub fn build(self) -> crate::types::ResourceIdentifierSummary {
104        crate::types::ResourceIdentifierSummary {
105            resource_type: self.resource_type,
106            logical_resource_ids: self.logical_resource_ids,
107            resource_identifiers: self.resource_identifiers,
108        }
109    }
110}