aws_sdk_bedrockagent/operation/create_flow/
_create_flow_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)]
5pub struct CreateFlowOutput {
6    /// <p>The name of the flow.</p>
7    pub name: ::std::string::String,
8    /// <p>The description of the flow.</p>
9    pub description: ::std::option::Option<::std::string::String>,
10    /// <p>The Amazon Resource Name (ARN) of the service role with permissions to create a flow. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/flows-permissions.html">Create a service role for flows in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p>
11    pub execution_role_arn: ::std::string::String,
12    /// <p>The Amazon Resource Name (ARN) of the KMS key that you encrypted the flow with.</p>
13    pub customer_encryption_key_arn: ::std::option::Option<::std::string::String>,
14    /// <p>The unique identifier of the flow.</p>
15    pub id: ::std::string::String,
16    /// <p>The Amazon Resource Name (ARN) of the flow.</p>
17    pub arn: ::std::string::String,
18    /// <p>The status of the flow. When you submit this request, the status will be <code>NotPrepared</code>. If creation fails, the status becomes <code>Failed</code>.</p>
19    pub status: crate::types::FlowStatus,
20    /// <p>The time at which the flow was created.</p>
21    pub created_at: ::aws_smithy_types::DateTime,
22    /// <p>The time at which the flow was last updated.</p>
23    pub updated_at: ::aws_smithy_types::DateTime,
24    /// <p>The version of the flow. When you create a flow, the version created is the <code>DRAFT</code> version.</p>
25    pub version: ::std::string::String,
26    /// <p>A definition of the nodes and connections between nodes in the flow.</p>
27    pub definition: ::std::option::Option<crate::types::FlowDefinition>,
28    _request_id: Option<String>,
29}
30impl CreateFlowOutput {
31    /// <p>The name of the flow.</p>
32    pub fn name(&self) -> &str {
33        use std::ops::Deref;
34        self.name.deref()
35    }
36    /// <p>The description of the flow.</p>
37    pub fn description(&self) -> ::std::option::Option<&str> {
38        self.description.as_deref()
39    }
40    /// <p>The Amazon Resource Name (ARN) of the service role with permissions to create a flow. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/flows-permissions.html">Create a service role for flows in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p>
41    pub fn execution_role_arn(&self) -> &str {
42        use std::ops::Deref;
43        self.execution_role_arn.deref()
44    }
45    /// <p>The Amazon Resource Name (ARN) of the KMS key that you encrypted the flow with.</p>
46    pub fn customer_encryption_key_arn(&self) -> ::std::option::Option<&str> {
47        self.customer_encryption_key_arn.as_deref()
48    }
49    /// <p>The unique identifier of the flow.</p>
50    pub fn id(&self) -> &str {
51        use std::ops::Deref;
52        self.id.deref()
53    }
54    /// <p>The Amazon Resource Name (ARN) of the flow.</p>
55    pub fn arn(&self) -> &str {
56        use std::ops::Deref;
57        self.arn.deref()
58    }
59    /// <p>The status of the flow. When you submit this request, the status will be <code>NotPrepared</code>. If creation fails, the status becomes <code>Failed</code>.</p>
60    pub fn status(&self) -> &crate::types::FlowStatus {
61        &self.status
62    }
63    /// <p>The time at which the flow was created.</p>
64    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
65        &self.created_at
66    }
67    /// <p>The time at which the flow was last updated.</p>
68    pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
69        &self.updated_at
70    }
71    /// <p>The version of the flow. When you create a flow, the version created is the <code>DRAFT</code> version.</p>
72    pub fn version(&self) -> &str {
73        use std::ops::Deref;
74        self.version.deref()
75    }
76    /// <p>A definition of the nodes and connections between nodes in the flow.</p>
77    pub fn definition(&self) -> ::std::option::Option<&crate::types::FlowDefinition> {
78        self.definition.as_ref()
79    }
80}
81impl ::std::fmt::Debug for CreateFlowOutput {
82    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
83        let mut formatter = f.debug_struct("CreateFlowOutput");
84        formatter.field("name", &self.name);
85        formatter.field("description", &self.description);
86        formatter.field("execution_role_arn", &self.execution_role_arn);
87        formatter.field("customer_encryption_key_arn", &self.customer_encryption_key_arn);
88        formatter.field("id", &self.id);
89        formatter.field("arn", &self.arn);
90        formatter.field("status", &self.status);
91        formatter.field("created_at", &self.created_at);
92        formatter.field("updated_at", &self.updated_at);
93        formatter.field("version", &self.version);
94        formatter.field("definition", &"*** Sensitive Data Redacted ***");
95        formatter.field("_request_id", &self._request_id);
96        formatter.finish()
97    }
98}
99impl ::aws_types::request_id::RequestId for CreateFlowOutput {
100    fn request_id(&self) -> Option<&str> {
101        self._request_id.as_deref()
102    }
103}
104impl CreateFlowOutput {
105    /// Creates a new builder-style object to manufacture [`CreateFlowOutput`](crate::operation::create_flow::CreateFlowOutput).
106    pub fn builder() -> crate::operation::create_flow::builders::CreateFlowOutputBuilder {
107        crate::operation::create_flow::builders::CreateFlowOutputBuilder::default()
108    }
109}
110
111/// A builder for [`CreateFlowOutput`](crate::operation::create_flow::CreateFlowOutput).
112#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
113#[non_exhaustive]
114pub struct CreateFlowOutputBuilder {
115    pub(crate) name: ::std::option::Option<::std::string::String>,
116    pub(crate) description: ::std::option::Option<::std::string::String>,
117    pub(crate) execution_role_arn: ::std::option::Option<::std::string::String>,
118    pub(crate) customer_encryption_key_arn: ::std::option::Option<::std::string::String>,
119    pub(crate) id: ::std::option::Option<::std::string::String>,
120    pub(crate) arn: ::std::option::Option<::std::string::String>,
121    pub(crate) status: ::std::option::Option<crate::types::FlowStatus>,
122    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
123    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
124    pub(crate) version: ::std::option::Option<::std::string::String>,
125    pub(crate) definition: ::std::option::Option<crate::types::FlowDefinition>,
126    _request_id: Option<String>,
127}
128impl CreateFlowOutputBuilder {
129    /// <p>The name of the flow.</p>
130    /// This field is required.
131    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132        self.name = ::std::option::Option::Some(input.into());
133        self
134    }
135    /// <p>The name of the flow.</p>
136    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137        self.name = input;
138        self
139    }
140    /// <p>The name of the flow.</p>
141    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
142        &self.name
143    }
144    /// <p>The description of the flow.</p>
145    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146        self.description = ::std::option::Option::Some(input.into());
147        self
148    }
149    /// <p>The description of the flow.</p>
150    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151        self.description = input;
152        self
153    }
154    /// <p>The description of the flow.</p>
155    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
156        &self.description
157    }
158    /// <p>The Amazon Resource Name (ARN) of the service role with permissions to create a flow. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/flows-permissions.html">Create a service role for flows in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p>
159    /// This field is required.
160    pub fn execution_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
161        self.execution_role_arn = ::std::option::Option::Some(input.into());
162        self
163    }
164    /// <p>The Amazon Resource Name (ARN) of the service role with permissions to create a flow. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/flows-permissions.html">Create a service role for flows in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p>
165    pub fn set_execution_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
166        self.execution_role_arn = input;
167        self
168    }
169    /// <p>The Amazon Resource Name (ARN) of the service role with permissions to create a flow. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/flows-permissions.html">Create a service role for flows in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p>
170    pub fn get_execution_role_arn(&self) -> &::std::option::Option<::std::string::String> {
171        &self.execution_role_arn
172    }
173    /// <p>The Amazon Resource Name (ARN) of the KMS key that you encrypted the flow with.</p>
174    pub fn customer_encryption_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
175        self.customer_encryption_key_arn = ::std::option::Option::Some(input.into());
176        self
177    }
178    /// <p>The Amazon Resource Name (ARN) of the KMS key that you encrypted the flow with.</p>
179    pub fn set_customer_encryption_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
180        self.customer_encryption_key_arn = input;
181        self
182    }
183    /// <p>The Amazon Resource Name (ARN) of the KMS key that you encrypted the flow with.</p>
184    pub fn get_customer_encryption_key_arn(&self) -> &::std::option::Option<::std::string::String> {
185        &self.customer_encryption_key_arn
186    }
187    /// <p>The unique identifier of the flow.</p>
188    /// This field is required.
189    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
190        self.id = ::std::option::Option::Some(input.into());
191        self
192    }
193    /// <p>The unique identifier of the flow.</p>
194    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
195        self.id = input;
196        self
197    }
198    /// <p>The unique identifier of the flow.</p>
199    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
200        &self.id
201    }
202    /// <p>The Amazon Resource Name (ARN) of the flow.</p>
203    /// This field is required.
204    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
205        self.arn = ::std::option::Option::Some(input.into());
206        self
207    }
208    /// <p>The Amazon Resource Name (ARN) of the flow.</p>
209    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
210        self.arn = input;
211        self
212    }
213    /// <p>The Amazon Resource Name (ARN) of the flow.</p>
214    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
215        &self.arn
216    }
217    /// <p>The status of the flow. When you submit this request, the status will be <code>NotPrepared</code>. If creation fails, the status becomes <code>Failed</code>.</p>
218    /// This field is required.
219    pub fn status(mut self, input: crate::types::FlowStatus) -> Self {
220        self.status = ::std::option::Option::Some(input);
221        self
222    }
223    /// <p>The status of the flow. When you submit this request, the status will be <code>NotPrepared</code>. If creation fails, the status becomes <code>Failed</code>.</p>
224    pub fn set_status(mut self, input: ::std::option::Option<crate::types::FlowStatus>) -> Self {
225        self.status = input;
226        self
227    }
228    /// <p>The status of the flow. When you submit this request, the status will be <code>NotPrepared</code>. If creation fails, the status becomes <code>Failed</code>.</p>
229    pub fn get_status(&self) -> &::std::option::Option<crate::types::FlowStatus> {
230        &self.status
231    }
232    /// <p>The time at which the flow was created.</p>
233    /// This field is required.
234    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
235        self.created_at = ::std::option::Option::Some(input);
236        self
237    }
238    /// <p>The time at which the flow was created.</p>
239    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
240        self.created_at = input;
241        self
242    }
243    /// <p>The time at which the flow was created.</p>
244    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
245        &self.created_at
246    }
247    /// <p>The time at which the flow was last updated.</p>
248    /// This field is required.
249    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
250        self.updated_at = ::std::option::Option::Some(input);
251        self
252    }
253    /// <p>The time at which the flow was last updated.</p>
254    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
255        self.updated_at = input;
256        self
257    }
258    /// <p>The time at which the flow was last updated.</p>
259    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
260        &self.updated_at
261    }
262    /// <p>The version of the flow. When you create a flow, the version created is the <code>DRAFT</code> version.</p>
263    /// This field is required.
264    pub fn version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
265        self.version = ::std::option::Option::Some(input.into());
266        self
267    }
268    /// <p>The version of the flow. When you create a flow, the version created is the <code>DRAFT</code> version.</p>
269    pub fn set_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
270        self.version = input;
271        self
272    }
273    /// <p>The version of the flow. When you create a flow, the version created is the <code>DRAFT</code> version.</p>
274    pub fn get_version(&self) -> &::std::option::Option<::std::string::String> {
275        &self.version
276    }
277    /// <p>A definition of the nodes and connections between nodes in the flow.</p>
278    pub fn definition(mut self, input: crate::types::FlowDefinition) -> Self {
279        self.definition = ::std::option::Option::Some(input);
280        self
281    }
282    /// <p>A definition of the nodes and connections between nodes in the flow.</p>
283    pub fn set_definition(mut self, input: ::std::option::Option<crate::types::FlowDefinition>) -> Self {
284        self.definition = input;
285        self
286    }
287    /// <p>A definition of the nodes and connections between nodes in the flow.</p>
288    pub fn get_definition(&self) -> &::std::option::Option<crate::types::FlowDefinition> {
289        &self.definition
290    }
291    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
292        self._request_id = Some(request_id.into());
293        self
294    }
295
296    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
297        self._request_id = request_id;
298        self
299    }
300    /// Consumes the builder and constructs a [`CreateFlowOutput`](crate::operation::create_flow::CreateFlowOutput).
301    /// This method will fail if any of the following fields are not set:
302    /// - [`name`](crate::operation::create_flow::builders::CreateFlowOutputBuilder::name)
303    /// - [`execution_role_arn`](crate::operation::create_flow::builders::CreateFlowOutputBuilder::execution_role_arn)
304    /// - [`id`](crate::operation::create_flow::builders::CreateFlowOutputBuilder::id)
305    /// - [`arn`](crate::operation::create_flow::builders::CreateFlowOutputBuilder::arn)
306    /// - [`status`](crate::operation::create_flow::builders::CreateFlowOutputBuilder::status)
307    /// - [`created_at`](crate::operation::create_flow::builders::CreateFlowOutputBuilder::created_at)
308    /// - [`updated_at`](crate::operation::create_flow::builders::CreateFlowOutputBuilder::updated_at)
309    /// - [`version`](crate::operation::create_flow::builders::CreateFlowOutputBuilder::version)
310    pub fn build(self) -> ::std::result::Result<crate::operation::create_flow::CreateFlowOutput, ::aws_smithy_types::error::operation::BuildError> {
311        ::std::result::Result::Ok(crate::operation::create_flow::CreateFlowOutput {
312            name: self.name.ok_or_else(|| {
313                ::aws_smithy_types::error::operation::BuildError::missing_field(
314                    "name",
315                    "name was not specified but it is required when building CreateFlowOutput",
316                )
317            })?,
318            description: self.description,
319            execution_role_arn: self.execution_role_arn.ok_or_else(|| {
320                ::aws_smithy_types::error::operation::BuildError::missing_field(
321                    "execution_role_arn",
322                    "execution_role_arn was not specified but it is required when building CreateFlowOutput",
323                )
324            })?,
325            customer_encryption_key_arn: self.customer_encryption_key_arn,
326            id: self.id.ok_or_else(|| {
327                ::aws_smithy_types::error::operation::BuildError::missing_field(
328                    "id",
329                    "id was not specified but it is required when building CreateFlowOutput",
330                )
331            })?,
332            arn: self.arn.ok_or_else(|| {
333                ::aws_smithy_types::error::operation::BuildError::missing_field(
334                    "arn",
335                    "arn was not specified but it is required when building CreateFlowOutput",
336                )
337            })?,
338            status: self.status.ok_or_else(|| {
339                ::aws_smithy_types::error::operation::BuildError::missing_field(
340                    "status",
341                    "status was not specified but it is required when building CreateFlowOutput",
342                )
343            })?,
344            created_at: self.created_at.ok_or_else(|| {
345                ::aws_smithy_types::error::operation::BuildError::missing_field(
346                    "created_at",
347                    "created_at was not specified but it is required when building CreateFlowOutput",
348                )
349            })?,
350            updated_at: self.updated_at.ok_or_else(|| {
351                ::aws_smithy_types::error::operation::BuildError::missing_field(
352                    "updated_at",
353                    "updated_at was not specified but it is required when building CreateFlowOutput",
354                )
355            })?,
356            version: self.version.ok_or_else(|| {
357                ::aws_smithy_types::error::operation::BuildError::missing_field(
358                    "version",
359                    "version was not specified but it is required when building CreateFlowOutput",
360                )
361            })?,
362            definition: self.definition,
363            _request_id: self._request_id,
364        })
365    }
366}
367impl ::std::fmt::Debug for CreateFlowOutputBuilder {
368    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
369        let mut formatter = f.debug_struct("CreateFlowOutputBuilder");
370        formatter.field("name", &self.name);
371        formatter.field("description", &self.description);
372        formatter.field("execution_role_arn", &self.execution_role_arn);
373        formatter.field("customer_encryption_key_arn", &self.customer_encryption_key_arn);
374        formatter.field("id", &self.id);
375        formatter.field("arn", &self.arn);
376        formatter.field("status", &self.status);
377        formatter.field("created_at", &self.created_at);
378        formatter.field("updated_at", &self.updated_at);
379        formatter.field("version", &self.version);
380        formatter.field("definition", &"*** Sensitive Data Redacted ***");
381        formatter.field("_request_id", &self._request_id);
382        formatter.finish()
383    }
384}