aws_sdk_bedrockagent/operation/create_flow/
_create_flow_input.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 CreateFlowInput {
6    /// <p>A name for the flow.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>A description for 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 and manage 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::option::Option<::std::string::String>,
12    /// <p>The Amazon Resource Name (ARN) of the KMS key to encrypt the flow.</p>
13    pub customer_encryption_key_arn: ::std::option::Option<::std::string::String>,
14    /// <p>A definition of the nodes and connections between nodes in the flow.</p>
15    pub definition: ::std::option::Option<crate::types::FlowDefinition>,
16    /// <p>A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
17    pub client_token: ::std::option::Option<::std::string::String>,
18    /// <p>Any tags that you want to attach to the flow. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/tagging.html">Tagging resources in Amazon Bedrock</a>.</p>
19    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
20}
21impl CreateFlowInput {
22    /// <p>A name for the flow.</p>
23    pub fn name(&self) -> ::std::option::Option<&str> {
24        self.name.as_deref()
25    }
26    /// <p>A description for the flow.</p>
27    pub fn description(&self) -> ::std::option::Option<&str> {
28        self.description.as_deref()
29    }
30    /// <p>The Amazon Resource Name (ARN) of the service role with permissions to create and manage 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>
31    pub fn execution_role_arn(&self) -> ::std::option::Option<&str> {
32        self.execution_role_arn.as_deref()
33    }
34    /// <p>The Amazon Resource Name (ARN) of the KMS key to encrypt the flow.</p>
35    pub fn customer_encryption_key_arn(&self) -> ::std::option::Option<&str> {
36        self.customer_encryption_key_arn.as_deref()
37    }
38    /// <p>A definition of the nodes and connections between nodes in the flow.</p>
39    pub fn definition(&self) -> ::std::option::Option<&crate::types::FlowDefinition> {
40        self.definition.as_ref()
41    }
42    /// <p>A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
43    pub fn client_token(&self) -> ::std::option::Option<&str> {
44        self.client_token.as_deref()
45    }
46    /// <p>Any tags that you want to attach to the flow. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/tagging.html">Tagging resources in Amazon Bedrock</a>.</p>
47    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
48        self.tags.as_ref()
49    }
50}
51impl ::std::fmt::Debug for CreateFlowInput {
52    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
53        let mut formatter = f.debug_struct("CreateFlowInput");
54        formatter.field("name", &self.name);
55        formatter.field("description", &self.description);
56        formatter.field("execution_role_arn", &self.execution_role_arn);
57        formatter.field("customer_encryption_key_arn", &self.customer_encryption_key_arn);
58        formatter.field("definition", &"*** Sensitive Data Redacted ***");
59        formatter.field("client_token", &self.client_token);
60        formatter.field("tags", &self.tags);
61        formatter.finish()
62    }
63}
64impl CreateFlowInput {
65    /// Creates a new builder-style object to manufacture [`CreateFlowInput`](crate::operation::create_flow::CreateFlowInput).
66    pub fn builder() -> crate::operation::create_flow::builders::CreateFlowInputBuilder {
67        crate::operation::create_flow::builders::CreateFlowInputBuilder::default()
68    }
69}
70
71/// A builder for [`CreateFlowInput`](crate::operation::create_flow::CreateFlowInput).
72#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
73#[non_exhaustive]
74pub struct CreateFlowInputBuilder {
75    pub(crate) name: ::std::option::Option<::std::string::String>,
76    pub(crate) description: ::std::option::Option<::std::string::String>,
77    pub(crate) execution_role_arn: ::std::option::Option<::std::string::String>,
78    pub(crate) customer_encryption_key_arn: ::std::option::Option<::std::string::String>,
79    pub(crate) definition: ::std::option::Option<crate::types::FlowDefinition>,
80    pub(crate) client_token: ::std::option::Option<::std::string::String>,
81    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
82}
83impl CreateFlowInputBuilder {
84    /// <p>A name for the flow.</p>
85    /// This field is required.
86    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
87        self.name = ::std::option::Option::Some(input.into());
88        self
89    }
90    /// <p>A name for the flow.</p>
91    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
92        self.name = input;
93        self
94    }
95    /// <p>A name for the flow.</p>
96    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
97        &self.name
98    }
99    /// <p>A description for the flow.</p>
100    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
101        self.description = ::std::option::Option::Some(input.into());
102        self
103    }
104    /// <p>A description for the flow.</p>
105    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
106        self.description = input;
107        self
108    }
109    /// <p>A description for the flow.</p>
110    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
111        &self.description
112    }
113    /// <p>The Amazon Resource Name (ARN) of the service role with permissions to create and manage 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>
114    /// This field is required.
115    pub fn execution_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116        self.execution_role_arn = ::std::option::Option::Some(input.into());
117        self
118    }
119    /// <p>The Amazon Resource Name (ARN) of the service role with permissions to create and manage 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>
120    pub fn set_execution_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121        self.execution_role_arn = input;
122        self
123    }
124    /// <p>The Amazon Resource Name (ARN) of the service role with permissions to create and manage 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>
125    pub fn get_execution_role_arn(&self) -> &::std::option::Option<::std::string::String> {
126        &self.execution_role_arn
127    }
128    /// <p>The Amazon Resource Name (ARN) of the KMS key to encrypt the flow.</p>
129    pub fn customer_encryption_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130        self.customer_encryption_key_arn = ::std::option::Option::Some(input.into());
131        self
132    }
133    /// <p>The Amazon Resource Name (ARN) of the KMS key to encrypt the flow.</p>
134    pub fn set_customer_encryption_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135        self.customer_encryption_key_arn = input;
136        self
137    }
138    /// <p>The Amazon Resource Name (ARN) of the KMS key to encrypt the flow.</p>
139    pub fn get_customer_encryption_key_arn(&self) -> &::std::option::Option<::std::string::String> {
140        &self.customer_encryption_key_arn
141    }
142    /// <p>A definition of the nodes and connections between nodes in the flow.</p>
143    pub fn definition(mut self, input: crate::types::FlowDefinition) -> Self {
144        self.definition = ::std::option::Option::Some(input);
145        self
146    }
147    /// <p>A definition of the nodes and connections between nodes in the flow.</p>
148    pub fn set_definition(mut self, input: ::std::option::Option<crate::types::FlowDefinition>) -> Self {
149        self.definition = input;
150        self
151    }
152    /// <p>A definition of the nodes and connections between nodes in the flow.</p>
153    pub fn get_definition(&self) -> &::std::option::Option<crate::types::FlowDefinition> {
154        &self.definition
155    }
156    /// <p>A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
157    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
158        self.client_token = ::std::option::Option::Some(input.into());
159        self
160    }
161    /// <p>A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
162    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
163        self.client_token = input;
164        self
165    }
166    /// <p>A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Ensuring idempotency</a>.</p>
167    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
168        &self.client_token
169    }
170    /// Adds a key-value pair to `tags`.
171    ///
172    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
173    ///
174    /// <p>Any tags that you want to attach to the flow. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/tagging.html">Tagging resources in Amazon Bedrock</a>.</p>
175    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
176        let mut hash_map = self.tags.unwrap_or_default();
177        hash_map.insert(k.into(), v.into());
178        self.tags = ::std::option::Option::Some(hash_map);
179        self
180    }
181    /// <p>Any tags that you want to attach to the flow. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/tagging.html">Tagging resources in Amazon Bedrock</a>.</p>
182    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
183        self.tags = input;
184        self
185    }
186    /// <p>Any tags that you want to attach to the flow. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/tagging.html">Tagging resources in Amazon Bedrock</a>.</p>
187    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
188        &self.tags
189    }
190    /// Consumes the builder and constructs a [`CreateFlowInput`](crate::operation::create_flow::CreateFlowInput).
191    pub fn build(self) -> ::std::result::Result<crate::operation::create_flow::CreateFlowInput, ::aws_smithy_types::error::operation::BuildError> {
192        ::std::result::Result::Ok(crate::operation::create_flow::CreateFlowInput {
193            name: self.name,
194            description: self.description,
195            execution_role_arn: self.execution_role_arn,
196            customer_encryption_key_arn: self.customer_encryption_key_arn,
197            definition: self.definition,
198            client_token: self.client_token,
199            tags: self.tags,
200        })
201    }
202}
203impl ::std::fmt::Debug for CreateFlowInputBuilder {
204    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
205        let mut formatter = f.debug_struct("CreateFlowInputBuilder");
206        formatter.field("name", &self.name);
207        formatter.field("description", &self.description);
208        formatter.field("execution_role_arn", &self.execution_role_arn);
209        formatter.field("customer_encryption_key_arn", &self.customer_encryption_key_arn);
210        formatter.field("definition", &"*** Sensitive Data Redacted ***");
211        formatter.field("client_token", &self.client_token);
212        formatter.field("tags", &self.tags);
213        formatter.finish()
214    }
215}