aws_sdk_evidently/types/
_ref_resource.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A structure that contains information about one experiment or launch that uses the specified segment.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct RefResource {
7    /// <p>The name of the experiment or launch.</p>
8    pub name: ::std::string::String,
9    /// <p>Specifies whether the resource that this structure contains information about is an experiment or a launch.</p>
10    pub r#type: ::std::string::String,
11    /// <p>The ARN of the experiment or launch.</p>
12    pub arn: ::std::option::Option<::std::string::String>,
13    /// <p>The status of the experiment or launch.</p>
14    pub status: ::std::option::Option<::std::string::String>,
15    /// <p>The day and time that this experiment or launch started.</p>
16    pub start_time: ::std::option::Option<::std::string::String>,
17    /// <p>The day and time that this experiment or launch ended.</p>
18    pub end_time: ::std::option::Option<::std::string::String>,
19    /// <p>The day and time that this experiment or launch was most recently updated.</p>
20    pub last_updated_on: ::std::option::Option<::std::string::String>,
21}
22impl RefResource {
23    /// <p>The name of the experiment or launch.</p>
24    pub fn name(&self) -> &str {
25        use std::ops::Deref;
26        self.name.deref()
27    }
28    /// <p>Specifies whether the resource that this structure contains information about is an experiment or a launch.</p>
29    pub fn r#type(&self) -> &str {
30        use std::ops::Deref;
31        self.r#type.deref()
32    }
33    /// <p>The ARN of the experiment or launch.</p>
34    pub fn arn(&self) -> ::std::option::Option<&str> {
35        self.arn.as_deref()
36    }
37    /// <p>The status of the experiment or launch.</p>
38    pub fn status(&self) -> ::std::option::Option<&str> {
39        self.status.as_deref()
40    }
41    /// <p>The day and time that this experiment or launch started.</p>
42    pub fn start_time(&self) -> ::std::option::Option<&str> {
43        self.start_time.as_deref()
44    }
45    /// <p>The day and time that this experiment or launch ended.</p>
46    pub fn end_time(&self) -> ::std::option::Option<&str> {
47        self.end_time.as_deref()
48    }
49    /// <p>The day and time that this experiment or launch was most recently updated.</p>
50    pub fn last_updated_on(&self) -> ::std::option::Option<&str> {
51        self.last_updated_on.as_deref()
52    }
53}
54impl RefResource {
55    /// Creates a new builder-style object to manufacture [`RefResource`](crate::types::RefResource).
56    pub fn builder() -> crate::types::builders::RefResourceBuilder {
57        crate::types::builders::RefResourceBuilder::default()
58    }
59}
60
61/// A builder for [`RefResource`](crate::types::RefResource).
62#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
63#[non_exhaustive]
64pub struct RefResourceBuilder {
65    pub(crate) name: ::std::option::Option<::std::string::String>,
66    pub(crate) r#type: ::std::option::Option<::std::string::String>,
67    pub(crate) arn: ::std::option::Option<::std::string::String>,
68    pub(crate) status: ::std::option::Option<::std::string::String>,
69    pub(crate) start_time: ::std::option::Option<::std::string::String>,
70    pub(crate) end_time: ::std::option::Option<::std::string::String>,
71    pub(crate) last_updated_on: ::std::option::Option<::std::string::String>,
72}
73impl RefResourceBuilder {
74    /// <p>The name of the experiment or launch.</p>
75    /// This field is required.
76    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
77        self.name = ::std::option::Option::Some(input.into());
78        self
79    }
80    /// <p>The name of the experiment or launch.</p>
81    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
82        self.name = input;
83        self
84    }
85    /// <p>The name of the experiment or launch.</p>
86    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
87        &self.name
88    }
89    /// <p>Specifies whether the resource that this structure contains information about is an experiment or a launch.</p>
90    /// This field is required.
91    pub fn r#type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
92        self.r#type = ::std::option::Option::Some(input.into());
93        self
94    }
95    /// <p>Specifies whether the resource that this structure contains information about is an experiment or a launch.</p>
96    pub fn set_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
97        self.r#type = input;
98        self
99    }
100    /// <p>Specifies whether the resource that this structure contains information about is an experiment or a launch.</p>
101    pub fn get_type(&self) -> &::std::option::Option<::std::string::String> {
102        &self.r#type
103    }
104    /// <p>The ARN of the experiment or launch.</p>
105    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
106        self.arn = ::std::option::Option::Some(input.into());
107        self
108    }
109    /// <p>The ARN of the experiment or launch.</p>
110    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
111        self.arn = input;
112        self
113    }
114    /// <p>The ARN of the experiment or launch.</p>
115    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
116        &self.arn
117    }
118    /// <p>The status of the experiment or launch.</p>
119    pub fn status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.status = ::std::option::Option::Some(input.into());
121        self
122    }
123    /// <p>The status of the experiment or launch.</p>
124    pub fn set_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125        self.status = input;
126        self
127    }
128    /// <p>The status of the experiment or launch.</p>
129    pub fn get_status(&self) -> &::std::option::Option<::std::string::String> {
130        &self.status
131    }
132    /// <p>The day and time that this experiment or launch started.</p>
133    pub fn start_time(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.start_time = ::std::option::Option::Some(input.into());
135        self
136    }
137    /// <p>The day and time that this experiment or launch started.</p>
138    pub fn set_start_time(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139        self.start_time = input;
140        self
141    }
142    /// <p>The day and time that this experiment or launch started.</p>
143    pub fn get_start_time(&self) -> &::std::option::Option<::std::string::String> {
144        &self.start_time
145    }
146    /// <p>The day and time that this experiment or launch ended.</p>
147    pub fn end_time(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.end_time = ::std::option::Option::Some(input.into());
149        self
150    }
151    /// <p>The day and time that this experiment or launch ended.</p>
152    pub fn set_end_time(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153        self.end_time = input;
154        self
155    }
156    /// <p>The day and time that this experiment or launch ended.</p>
157    pub fn get_end_time(&self) -> &::std::option::Option<::std::string::String> {
158        &self.end_time
159    }
160    /// <p>The day and time that this experiment or launch was most recently updated.</p>
161    pub fn last_updated_on(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
162        self.last_updated_on = ::std::option::Option::Some(input.into());
163        self
164    }
165    /// <p>The day and time that this experiment or launch was most recently updated.</p>
166    pub fn set_last_updated_on(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
167        self.last_updated_on = input;
168        self
169    }
170    /// <p>The day and time that this experiment or launch was most recently updated.</p>
171    pub fn get_last_updated_on(&self) -> &::std::option::Option<::std::string::String> {
172        &self.last_updated_on
173    }
174    /// Consumes the builder and constructs a [`RefResource`](crate::types::RefResource).
175    /// This method will fail if any of the following fields are not set:
176    /// - [`name`](crate::types::builders::RefResourceBuilder::name)
177    /// - [`r#type`](crate::types::builders::RefResourceBuilder::type)
178    pub fn build(self) -> ::std::result::Result<crate::types::RefResource, ::aws_smithy_types::error::operation::BuildError> {
179        ::std::result::Result::Ok(crate::types::RefResource {
180            name: self.name.ok_or_else(|| {
181                ::aws_smithy_types::error::operation::BuildError::missing_field(
182                    "name",
183                    "name was not specified but it is required when building RefResource",
184                )
185            })?,
186            r#type: self.r#type.ok_or_else(|| {
187                ::aws_smithy_types::error::operation::BuildError::missing_field(
188                    "r#type",
189                    "r#type was not specified but it is required when building RefResource",
190                )
191            })?,
192            arn: self.arn,
193            status: self.status,
194            start_time: self.start_time,
195            end_time: self.end_time,
196            last_updated_on: self.last_updated_on,
197        })
198    }
199}