aws_sdk_omics/types/
_import_reference_job_item.rs

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