aws_sdk_dataexchange/operation/create_job/
_create_job_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateJobOutput {
6    /// <p>The ARN for the job.</p>
7    pub arn: ::std::option::Option<::std::string::String>,
8    /// <p>The date and time that the job was created, in ISO 8601 format.</p>
9    pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
10    /// <p>Details about the job.</p>
11    pub details: ::std::option::Option<crate::types::ResponseDetails>,
12    /// <p>The errors associated with jobs.</p>
13    pub errors: ::std::option::Option<::std::vec::Vec<crate::types::JobError>>,
14    /// <p>The unique identifier for the job.</p>
15    pub id: ::std::option::Option<::std::string::String>,
16    /// <p>The state of the job.</p>
17    pub state: ::std::option::Option<crate::types::State>,
18    /// <p>The job type.</p>
19    pub r#type: ::std::option::Option<crate::types::Type>,
20    /// <p>The date and time that the job was last updated, in ISO 8601 format.</p>
21    pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
22    _request_id: Option<String>,
23}
24impl CreateJobOutput {
25    /// <p>The ARN for the job.</p>
26    pub fn arn(&self) -> ::std::option::Option<&str> {
27        self.arn.as_deref()
28    }
29    /// <p>The date and time that the job was created, in ISO 8601 format.</p>
30    pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
31        self.created_at.as_ref()
32    }
33    /// <p>Details about the job.</p>
34    pub fn details(&self) -> ::std::option::Option<&crate::types::ResponseDetails> {
35        self.details.as_ref()
36    }
37    /// <p>The errors associated with jobs.</p>
38    ///
39    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.errors.is_none()`.
40    pub fn errors(&self) -> &[crate::types::JobError] {
41        self.errors.as_deref().unwrap_or_default()
42    }
43    /// <p>The unique identifier for the job.</p>
44    pub fn id(&self) -> ::std::option::Option<&str> {
45        self.id.as_deref()
46    }
47    /// <p>The state of the job.</p>
48    pub fn state(&self) -> ::std::option::Option<&crate::types::State> {
49        self.state.as_ref()
50    }
51    /// <p>The job type.</p>
52    pub fn r#type(&self) -> ::std::option::Option<&crate::types::Type> {
53        self.r#type.as_ref()
54    }
55    /// <p>The date and time that the job was last updated, in ISO 8601 format.</p>
56    pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
57        self.updated_at.as_ref()
58    }
59}
60impl ::aws_types::request_id::RequestId for CreateJobOutput {
61    fn request_id(&self) -> Option<&str> {
62        self._request_id.as_deref()
63    }
64}
65impl CreateJobOutput {
66    /// Creates a new builder-style object to manufacture [`CreateJobOutput`](crate::operation::create_job::CreateJobOutput).
67    pub fn builder() -> crate::operation::create_job::builders::CreateJobOutputBuilder {
68        crate::operation::create_job::builders::CreateJobOutputBuilder::default()
69    }
70}
71
72/// A builder for [`CreateJobOutput`](crate::operation::create_job::CreateJobOutput).
73#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
74#[non_exhaustive]
75pub struct CreateJobOutputBuilder {
76    pub(crate) arn: ::std::option::Option<::std::string::String>,
77    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
78    pub(crate) details: ::std::option::Option<crate::types::ResponseDetails>,
79    pub(crate) errors: ::std::option::Option<::std::vec::Vec<crate::types::JobError>>,
80    pub(crate) id: ::std::option::Option<::std::string::String>,
81    pub(crate) state: ::std::option::Option<crate::types::State>,
82    pub(crate) r#type: ::std::option::Option<crate::types::Type>,
83    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
84    _request_id: Option<String>,
85}
86impl CreateJobOutputBuilder {
87    /// <p>The ARN for the job.</p>
88    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89        self.arn = ::std::option::Option::Some(input.into());
90        self
91    }
92    /// <p>The ARN for the job.</p>
93    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94        self.arn = input;
95        self
96    }
97    /// <p>The ARN for the job.</p>
98    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
99        &self.arn
100    }
101    /// <p>The date and time that the job was created, in ISO 8601 format.</p>
102    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
103        self.created_at = ::std::option::Option::Some(input);
104        self
105    }
106    /// <p>The date and time that the job was created, in ISO 8601 format.</p>
107    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
108        self.created_at = input;
109        self
110    }
111    /// <p>The date and time that the job was created, in ISO 8601 format.</p>
112    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
113        &self.created_at
114    }
115    /// <p>Details about the job.</p>
116    pub fn details(mut self, input: crate::types::ResponseDetails) -> Self {
117        self.details = ::std::option::Option::Some(input);
118        self
119    }
120    /// <p>Details about the job.</p>
121    pub fn set_details(mut self, input: ::std::option::Option<crate::types::ResponseDetails>) -> Self {
122        self.details = input;
123        self
124    }
125    /// <p>Details about the job.</p>
126    pub fn get_details(&self) -> &::std::option::Option<crate::types::ResponseDetails> {
127        &self.details
128    }
129    /// Appends an item to `errors`.
130    ///
131    /// To override the contents of this collection use [`set_errors`](Self::set_errors).
132    ///
133    /// <p>The errors associated with jobs.</p>
134    pub fn errors(mut self, input: crate::types::JobError) -> Self {
135        let mut v = self.errors.unwrap_or_default();
136        v.push(input);
137        self.errors = ::std::option::Option::Some(v);
138        self
139    }
140    /// <p>The errors associated with jobs.</p>
141    pub fn set_errors(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::JobError>>) -> Self {
142        self.errors = input;
143        self
144    }
145    /// <p>The errors associated with jobs.</p>
146    pub fn get_errors(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::JobError>> {
147        &self.errors
148    }
149    /// <p>The unique identifier for the job.</p>
150    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151        self.id = ::std::option::Option::Some(input.into());
152        self
153    }
154    /// <p>The unique identifier for the job.</p>
155    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156        self.id = input;
157        self
158    }
159    /// <p>The unique identifier for the job.</p>
160    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
161        &self.id
162    }
163    /// <p>The state of the job.</p>
164    pub fn state(mut self, input: crate::types::State) -> Self {
165        self.state = ::std::option::Option::Some(input);
166        self
167    }
168    /// <p>The state of the job.</p>
169    pub fn set_state(mut self, input: ::std::option::Option<crate::types::State>) -> Self {
170        self.state = input;
171        self
172    }
173    /// <p>The state of the job.</p>
174    pub fn get_state(&self) -> &::std::option::Option<crate::types::State> {
175        &self.state
176    }
177    /// <p>The job type.</p>
178    pub fn r#type(mut self, input: crate::types::Type) -> Self {
179        self.r#type = ::std::option::Option::Some(input);
180        self
181    }
182    /// <p>The job type.</p>
183    pub fn set_type(mut self, input: ::std::option::Option<crate::types::Type>) -> Self {
184        self.r#type = input;
185        self
186    }
187    /// <p>The job type.</p>
188    pub fn get_type(&self) -> &::std::option::Option<crate::types::Type> {
189        &self.r#type
190    }
191    /// <p>The date and time that the job was last updated, in ISO 8601 format.</p>
192    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
193        self.updated_at = ::std::option::Option::Some(input);
194        self
195    }
196    /// <p>The date and time that the job was last updated, in ISO 8601 format.</p>
197    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
198        self.updated_at = input;
199        self
200    }
201    /// <p>The date and time that the job was last updated, in ISO 8601 format.</p>
202    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
203        &self.updated_at
204    }
205    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
206        self._request_id = Some(request_id.into());
207        self
208    }
209
210    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
211        self._request_id = request_id;
212        self
213    }
214    /// Consumes the builder and constructs a [`CreateJobOutput`](crate::operation::create_job::CreateJobOutput).
215    pub fn build(self) -> crate::operation::create_job::CreateJobOutput {
216        crate::operation::create_job::CreateJobOutput {
217            arn: self.arn,
218            created_at: self.created_at,
219            details: self.details,
220            errors: self.errors,
221            id: self.id,
222            state: self.state,
223            r#type: self.r#type,
224            updated_at: self.updated_at,
225            _request_id: self._request_id,
226        }
227    }
228}