aws_sdk_novaact/operation/create_act/
_create_act_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 CreateActInput {
6    /// <p>The name of the workflow definition containing the session.</p>
7    pub workflow_definition_name: ::std::option::Option<::std::string::String>,
8    /// <p>The unique identifier of the workflow run containing the session.</p>
9    pub workflow_run_id: ::std::option::Option<::std::string::String>,
10    /// <p>The unique identifier of the session to create the act in.</p>
11    pub session_id: ::std::option::Option<::std::string::String>,
12    /// <p>The task description that defines what the act should accomplish.</p>
13    pub task: ::std::option::Option<::std::string::String>,
14    /// <p>A list of tool specifications that the act can invoke to complete its task.</p>
15    pub tool_specs: ::std::option::Option<::std::vec::Vec<crate::types::ToolSpec>>,
16    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
17    pub client_token: ::std::option::Option<::std::string::String>,
18}
19impl CreateActInput {
20    /// <p>The name of the workflow definition containing the session.</p>
21    pub fn workflow_definition_name(&self) -> ::std::option::Option<&str> {
22        self.workflow_definition_name.as_deref()
23    }
24    /// <p>The unique identifier of the workflow run containing the session.</p>
25    pub fn workflow_run_id(&self) -> ::std::option::Option<&str> {
26        self.workflow_run_id.as_deref()
27    }
28    /// <p>The unique identifier of the session to create the act in.</p>
29    pub fn session_id(&self) -> ::std::option::Option<&str> {
30        self.session_id.as_deref()
31    }
32    /// <p>The task description that defines what the act should accomplish.</p>
33    pub fn task(&self) -> ::std::option::Option<&str> {
34        self.task.as_deref()
35    }
36    /// <p>A list of tool specifications that the act can invoke to complete its task.</p>
37    ///
38    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tool_specs.is_none()`.
39    pub fn tool_specs(&self) -> &[crate::types::ToolSpec] {
40        self.tool_specs.as_deref().unwrap_or_default()
41    }
42    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
43    pub fn client_token(&self) -> ::std::option::Option<&str> {
44        self.client_token.as_deref()
45    }
46}
47impl ::std::fmt::Debug for CreateActInput {
48    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
49        let mut formatter = f.debug_struct("CreateActInput");
50        formatter.field("workflow_definition_name", &self.workflow_definition_name);
51        formatter.field("workflow_run_id", &self.workflow_run_id);
52        formatter.field("session_id", &self.session_id);
53        formatter.field("task", &"*** Sensitive Data Redacted ***");
54        formatter.field("tool_specs", &self.tool_specs);
55        formatter.field("client_token", &self.client_token);
56        formatter.finish()
57    }
58}
59impl CreateActInput {
60    /// Creates a new builder-style object to manufacture [`CreateActInput`](crate::operation::create_act::CreateActInput).
61    pub fn builder() -> crate::operation::create_act::builders::CreateActInputBuilder {
62        crate::operation::create_act::builders::CreateActInputBuilder::default()
63    }
64}
65
66/// A builder for [`CreateActInput`](crate::operation::create_act::CreateActInput).
67#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
68#[non_exhaustive]
69pub struct CreateActInputBuilder {
70    pub(crate) workflow_definition_name: ::std::option::Option<::std::string::String>,
71    pub(crate) workflow_run_id: ::std::option::Option<::std::string::String>,
72    pub(crate) session_id: ::std::option::Option<::std::string::String>,
73    pub(crate) task: ::std::option::Option<::std::string::String>,
74    pub(crate) tool_specs: ::std::option::Option<::std::vec::Vec<crate::types::ToolSpec>>,
75    pub(crate) client_token: ::std::option::Option<::std::string::String>,
76}
77impl CreateActInputBuilder {
78    /// <p>The name of the workflow definition containing the session.</p>
79    /// This field is required.
80    pub fn workflow_definition_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.workflow_definition_name = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>The name of the workflow definition containing the session.</p>
85    pub fn set_workflow_definition_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.workflow_definition_name = input;
87        self
88    }
89    /// <p>The name of the workflow definition containing the session.</p>
90    pub fn get_workflow_definition_name(&self) -> &::std::option::Option<::std::string::String> {
91        &self.workflow_definition_name
92    }
93    /// <p>The unique identifier of the workflow run containing the session.</p>
94    /// This field is required.
95    pub fn workflow_run_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96        self.workflow_run_id = ::std::option::Option::Some(input.into());
97        self
98    }
99    /// <p>The unique identifier of the workflow run containing the session.</p>
100    pub fn set_workflow_run_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
101        self.workflow_run_id = input;
102        self
103    }
104    /// <p>The unique identifier of the workflow run containing the session.</p>
105    pub fn get_workflow_run_id(&self) -> &::std::option::Option<::std::string::String> {
106        &self.workflow_run_id
107    }
108    /// <p>The unique identifier of the session to create the act in.</p>
109    /// This field is required.
110    pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111        self.session_id = ::std::option::Option::Some(input.into());
112        self
113    }
114    /// <p>The unique identifier of the session to create the act in.</p>
115    pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116        self.session_id = input;
117        self
118    }
119    /// <p>The unique identifier of the session to create the act in.</p>
120    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
121        &self.session_id
122    }
123    /// <p>The task description that defines what the act should accomplish.</p>
124    /// This field is required.
125    pub fn task(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
126        self.task = ::std::option::Option::Some(input.into());
127        self
128    }
129    /// <p>The task description that defines what the act should accomplish.</p>
130    pub fn set_task(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131        self.task = input;
132        self
133    }
134    /// <p>The task description that defines what the act should accomplish.</p>
135    pub fn get_task(&self) -> &::std::option::Option<::std::string::String> {
136        &self.task
137    }
138    /// Appends an item to `tool_specs`.
139    ///
140    /// To override the contents of this collection use [`set_tool_specs`](Self::set_tool_specs).
141    ///
142    /// <p>A list of tool specifications that the act can invoke to complete its task.</p>
143    pub fn tool_specs(mut self, input: crate::types::ToolSpec) -> Self {
144        let mut v = self.tool_specs.unwrap_or_default();
145        v.push(input);
146        self.tool_specs = ::std::option::Option::Some(v);
147        self
148    }
149    /// <p>A list of tool specifications that the act can invoke to complete its task.</p>
150    pub fn set_tool_specs(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ToolSpec>>) -> Self {
151        self.tool_specs = input;
152        self
153    }
154    /// <p>A list of tool specifications that the act can invoke to complete its task.</p>
155    pub fn get_tool_specs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ToolSpec>> {
156        &self.tool_specs
157    }
158    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
159    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160        self.client_token = ::std::option::Option::Some(input.into());
161        self
162    }
163    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
164    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
165        self.client_token = input;
166        self
167    }
168    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
169    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
170        &self.client_token
171    }
172    /// Consumes the builder and constructs a [`CreateActInput`](crate::operation::create_act::CreateActInput).
173    pub fn build(self) -> ::std::result::Result<crate::operation::create_act::CreateActInput, ::aws_smithy_types::error::operation::BuildError> {
174        ::std::result::Result::Ok(crate::operation::create_act::CreateActInput {
175            workflow_definition_name: self.workflow_definition_name,
176            workflow_run_id: self.workflow_run_id,
177            session_id: self.session_id,
178            task: self.task,
179            tool_specs: self.tool_specs,
180            client_token: self.client_token,
181        })
182    }
183}
184impl ::std::fmt::Debug for CreateActInputBuilder {
185    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
186        let mut formatter = f.debug_struct("CreateActInputBuilder");
187        formatter.field("workflow_definition_name", &self.workflow_definition_name);
188        formatter.field("workflow_run_id", &self.workflow_run_id);
189        formatter.field("session_id", &self.session_id);
190        formatter.field("task", &"*** Sensitive Data Redacted ***");
191        formatter.field("tool_specs", &self.tool_specs);
192        formatter.field("client_token", &self.client_token);
193        formatter.finish()
194    }
195}