Skip to main content

aws_sdk_lightsail/types/
_cloud_formation_stack_record_source_info.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Describes the source of a CloudFormation stack record (i.e., the export snapshot record).</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CloudFormationStackRecordSourceInfo {
7    /// <p>The Lightsail resource type (<code>ExportSnapshotRecord</code>).</p>
8    pub resource_type: ::std::option::Option<crate::types::CloudFormationStackRecordSourceType>,
9    /// <p>The name of the record.</p>
10    pub name: ::std::option::Option<::std::string::String>,
11    /// <p>The Amazon Resource Name (ARN) of the export snapshot record.</p>
12    pub arn: ::std::option::Option<::std::string::String>,
13}
14impl CloudFormationStackRecordSourceInfo {
15    /// <p>The Lightsail resource type (<code>ExportSnapshotRecord</code>).</p>
16    pub fn resource_type(&self) -> ::std::option::Option<&crate::types::CloudFormationStackRecordSourceType> {
17        self.resource_type.as_ref()
18    }
19    /// <p>The name of the record.</p>
20    pub fn name(&self) -> ::std::option::Option<&str> {
21        self.name.as_deref()
22    }
23    /// <p>The Amazon Resource Name (ARN) of the export snapshot record.</p>
24    pub fn arn(&self) -> ::std::option::Option<&str> {
25        self.arn.as_deref()
26    }
27}
28impl CloudFormationStackRecordSourceInfo {
29    /// Creates a new builder-style object to manufacture [`CloudFormationStackRecordSourceInfo`](crate::types::CloudFormationStackRecordSourceInfo).
30    pub fn builder() -> crate::types::builders::CloudFormationStackRecordSourceInfoBuilder {
31        crate::types::builders::CloudFormationStackRecordSourceInfoBuilder::default()
32    }
33}
34
35/// A builder for [`CloudFormationStackRecordSourceInfo`](crate::types::CloudFormationStackRecordSourceInfo).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct CloudFormationStackRecordSourceInfoBuilder {
39    pub(crate) resource_type: ::std::option::Option<crate::types::CloudFormationStackRecordSourceType>,
40    pub(crate) name: ::std::option::Option<::std::string::String>,
41    pub(crate) arn: ::std::option::Option<::std::string::String>,
42}
43impl CloudFormationStackRecordSourceInfoBuilder {
44    /// <p>The Lightsail resource type (<code>ExportSnapshotRecord</code>).</p>
45    pub fn resource_type(mut self, input: crate::types::CloudFormationStackRecordSourceType) -> Self {
46        self.resource_type = ::std::option::Option::Some(input);
47        self
48    }
49    /// <p>The Lightsail resource type (<code>ExportSnapshotRecord</code>).</p>
50    pub fn set_resource_type(mut self, input: ::std::option::Option<crate::types::CloudFormationStackRecordSourceType>) -> Self {
51        self.resource_type = input;
52        self
53    }
54    /// <p>The Lightsail resource type (<code>ExportSnapshotRecord</code>).</p>
55    pub fn get_resource_type(&self) -> &::std::option::Option<crate::types::CloudFormationStackRecordSourceType> {
56        &self.resource_type
57    }
58    /// <p>The name of the record.</p>
59    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60        self.name = ::std::option::Option::Some(input.into());
61        self
62    }
63    /// <p>The name of the record.</p>
64    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65        self.name = input;
66        self
67    }
68    /// <p>The name of the record.</p>
69    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
70        &self.name
71    }
72    /// <p>The Amazon Resource Name (ARN) of the export snapshot record.</p>
73    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
74        self.arn = ::std::option::Option::Some(input.into());
75        self
76    }
77    /// <p>The Amazon Resource Name (ARN) of the export snapshot record.</p>
78    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
79        self.arn = input;
80        self
81    }
82    /// <p>The Amazon Resource Name (ARN) of the export snapshot record.</p>
83    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
84        &self.arn
85    }
86    /// Consumes the builder and constructs a [`CloudFormationStackRecordSourceInfo`](crate::types::CloudFormationStackRecordSourceInfo).
87    pub fn build(self) -> crate::types::CloudFormationStackRecordSourceInfo {
88        crate::types::CloudFormationStackRecordSourceInfo {
89            resource_type: self.resource_type,
90            name: self.name,
91            arn: self.arn,
92        }
93    }
94}