aws_sdk_bedrockagentruntime/operation/invoke_flow/
_invoke_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, ::std::fmt::Debug)]
5pub struct InvokeFlowInput {
6    /// <p>The unique identifier of the flow.</p>
7    pub flow_identifier: ::std::option::Option<::std::string::String>,
8    /// <p>The unique identifier of the flow alias.</p>
9    pub flow_alias_identifier: ::std::option::Option<::std::string::String>,
10    /// <p>A list of objects, each containing information about an input into the flow.</p>
11    pub inputs: ::std::option::Option<::std::vec::Vec<crate::types::FlowInput>>,
12    /// <p>Specifies whether to return the trace for the flow or not. Traces track inputs and outputs for nodes in the flow. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html">Track each step in your prompt flow by viewing its trace in Amazon Bedrock</a>.</p>
13    pub enable_trace: ::std::option::Option<bool>,
14    /// <p>Model performance settings for the request.</p>
15    pub model_performance_configuration: ::std::option::Option<crate::types::ModelPerformanceConfiguration>,
16    /// <p>The unique identifier for the current flow execution. If you don't provide a value, Amazon Bedrock creates the identifier for you.</p>
17    pub execution_id: ::std::option::Option<::std::string::String>,
18}
19impl InvokeFlowInput {
20    /// <p>The unique identifier of the flow.</p>
21    pub fn flow_identifier(&self) -> ::std::option::Option<&str> {
22        self.flow_identifier.as_deref()
23    }
24    /// <p>The unique identifier of the flow alias.</p>
25    pub fn flow_alias_identifier(&self) -> ::std::option::Option<&str> {
26        self.flow_alias_identifier.as_deref()
27    }
28    /// <p>A list of objects, each containing information about an input into the flow.</p>
29    ///
30    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.inputs.is_none()`.
31    pub fn inputs(&self) -> &[crate::types::FlowInput] {
32        self.inputs.as_deref().unwrap_or_default()
33    }
34    /// <p>Specifies whether to return the trace for the flow or not. Traces track inputs and outputs for nodes in the flow. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html">Track each step in your prompt flow by viewing its trace in Amazon Bedrock</a>.</p>
35    pub fn enable_trace(&self) -> ::std::option::Option<bool> {
36        self.enable_trace
37    }
38    /// <p>Model performance settings for the request.</p>
39    pub fn model_performance_configuration(&self) -> ::std::option::Option<&crate::types::ModelPerformanceConfiguration> {
40        self.model_performance_configuration.as_ref()
41    }
42    /// <p>The unique identifier for the current flow execution. If you don't provide a value, Amazon Bedrock creates the identifier for you.</p>
43    pub fn execution_id(&self) -> ::std::option::Option<&str> {
44        self.execution_id.as_deref()
45    }
46}
47impl InvokeFlowInput {
48    /// Creates a new builder-style object to manufacture [`InvokeFlowInput`](crate::operation::invoke_flow::InvokeFlowInput).
49    pub fn builder() -> crate::operation::invoke_flow::builders::InvokeFlowInputBuilder {
50        crate::operation::invoke_flow::builders::InvokeFlowInputBuilder::default()
51    }
52}
53
54/// A builder for [`InvokeFlowInput`](crate::operation::invoke_flow::InvokeFlowInput).
55#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
56#[non_exhaustive]
57pub struct InvokeFlowInputBuilder {
58    pub(crate) flow_identifier: ::std::option::Option<::std::string::String>,
59    pub(crate) flow_alias_identifier: ::std::option::Option<::std::string::String>,
60    pub(crate) inputs: ::std::option::Option<::std::vec::Vec<crate::types::FlowInput>>,
61    pub(crate) enable_trace: ::std::option::Option<bool>,
62    pub(crate) model_performance_configuration: ::std::option::Option<crate::types::ModelPerformanceConfiguration>,
63    pub(crate) execution_id: ::std::option::Option<::std::string::String>,
64}
65impl InvokeFlowInputBuilder {
66    /// <p>The unique identifier of the flow.</p>
67    /// This field is required.
68    pub fn flow_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69        self.flow_identifier = ::std::option::Option::Some(input.into());
70        self
71    }
72    /// <p>The unique identifier of the flow.</p>
73    pub fn set_flow_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74        self.flow_identifier = input;
75        self
76    }
77    /// <p>The unique identifier of the flow.</p>
78    pub fn get_flow_identifier(&self) -> &::std::option::Option<::std::string::String> {
79        &self.flow_identifier
80    }
81    /// <p>The unique identifier of the flow alias.</p>
82    /// This field is required.
83    pub fn flow_alias_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84        self.flow_alias_identifier = ::std::option::Option::Some(input.into());
85        self
86    }
87    /// <p>The unique identifier of the flow alias.</p>
88    pub fn set_flow_alias_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89        self.flow_alias_identifier = input;
90        self
91    }
92    /// <p>The unique identifier of the flow alias.</p>
93    pub fn get_flow_alias_identifier(&self) -> &::std::option::Option<::std::string::String> {
94        &self.flow_alias_identifier
95    }
96    /// Appends an item to `inputs`.
97    ///
98    /// To override the contents of this collection use [`set_inputs`](Self::set_inputs).
99    ///
100    /// <p>A list of objects, each containing information about an input into the flow.</p>
101    pub fn inputs(mut self, input: crate::types::FlowInput) -> Self {
102        let mut v = self.inputs.unwrap_or_default();
103        v.push(input);
104        self.inputs = ::std::option::Option::Some(v);
105        self
106    }
107    /// <p>A list of objects, each containing information about an input into the flow.</p>
108    pub fn set_inputs(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FlowInput>>) -> Self {
109        self.inputs = input;
110        self
111    }
112    /// <p>A list of objects, each containing information about an input into the flow.</p>
113    pub fn get_inputs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FlowInput>> {
114        &self.inputs
115    }
116    /// <p>Specifies whether to return the trace for the flow or not. Traces track inputs and outputs for nodes in the flow. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html">Track each step in your prompt flow by viewing its trace in Amazon Bedrock</a>.</p>
117    pub fn enable_trace(mut self, input: bool) -> Self {
118        self.enable_trace = ::std::option::Option::Some(input);
119        self
120    }
121    /// <p>Specifies whether to return the trace for the flow or not. Traces track inputs and outputs for nodes in the flow. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html">Track each step in your prompt flow by viewing its trace in Amazon Bedrock</a>.</p>
122    pub fn set_enable_trace(mut self, input: ::std::option::Option<bool>) -> Self {
123        self.enable_trace = input;
124        self
125    }
126    /// <p>Specifies whether to return the trace for the flow or not. Traces track inputs and outputs for nodes in the flow. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/flows-trace.html">Track each step in your prompt flow by viewing its trace in Amazon Bedrock</a>.</p>
127    pub fn get_enable_trace(&self) -> &::std::option::Option<bool> {
128        &self.enable_trace
129    }
130    /// <p>Model performance settings for the request.</p>
131    pub fn model_performance_configuration(mut self, input: crate::types::ModelPerformanceConfiguration) -> Self {
132        self.model_performance_configuration = ::std::option::Option::Some(input);
133        self
134    }
135    /// <p>Model performance settings for the request.</p>
136    pub fn set_model_performance_configuration(mut self, input: ::std::option::Option<crate::types::ModelPerformanceConfiguration>) -> Self {
137        self.model_performance_configuration = input;
138        self
139    }
140    /// <p>Model performance settings for the request.</p>
141    pub fn get_model_performance_configuration(&self) -> &::std::option::Option<crate::types::ModelPerformanceConfiguration> {
142        &self.model_performance_configuration
143    }
144    /// <p>The unique identifier for the current flow execution. If you don't provide a value, Amazon Bedrock creates the identifier for you.</p>
145    pub fn execution_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146        self.execution_id = ::std::option::Option::Some(input.into());
147        self
148    }
149    /// <p>The unique identifier for the current flow execution. If you don't provide a value, Amazon Bedrock creates the identifier for you.</p>
150    pub fn set_execution_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151        self.execution_id = input;
152        self
153    }
154    /// <p>The unique identifier for the current flow execution. If you don't provide a value, Amazon Bedrock creates the identifier for you.</p>
155    pub fn get_execution_id(&self) -> &::std::option::Option<::std::string::String> {
156        &self.execution_id
157    }
158    /// Consumes the builder and constructs a [`InvokeFlowInput`](crate::operation::invoke_flow::InvokeFlowInput).
159    pub fn build(self) -> ::std::result::Result<crate::operation::invoke_flow::InvokeFlowInput, ::aws_smithy_types::error::operation::BuildError> {
160        ::std::result::Result::Ok(crate::operation::invoke_flow::InvokeFlowInput {
161            flow_identifier: self.flow_identifier,
162            flow_alias_identifier: self.flow_alias_identifier,
163            inputs: self.inputs,
164            enable_trace: self.enable_trace,
165            model_performance_configuration: self.model_performance_configuration,
166            execution_id: self.execution_id,
167        })
168    }
169}