aws_sdk_context/operation/start_task/_start_task_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 StartTaskInput {
6 /// <p>The agent context, as an ID or ARN.</p>
7 pub agent_context_id: ::std::option::Option<::std::string::String>,
8 /// <p>A unique, case-sensitive identifier that you provide to ensure that the request completes no more than one time. The token is scoped to your account and the agent context. If you reuse a token on the same agent context with different parameters, the request fails with <code>ValidationException</code>.</p>
9 pub client_token: ::std::option::Option<::std::string::String>,
10 /// <p>A description of the task. Up to 1,024 characters, with no control characters.</p>
11 pub description: ::std::option::Option<::std::string::String>,
12 /// <p>What the task imports. Set exactly one member. The member that you set determines the task's <code>type</code>.</p>
13 pub input_configuration: ::std::option::Option<crate::types::TaskInputConfiguration>,
14 /// <p>Who can see the content that the task adds to the agent context. AWS Context supports only one entry: <code>ALLOW</code> with <code>principalId</code> <code>*</code>, so that every reader of the agent context can see it. If you omit it or send no entries, AWS Context uses that entry. If you name any other principal, include a <code>DENY</code> entry, or send more than one entry, the request fails with <code>ValidationException</code>, and no task is started.</p>
15 pub access_control_config: ::std::option::Option<crate::types::AccessControlConfig>,
16}
17impl StartTaskInput {
18 /// <p>The agent context, as an ID or ARN.</p>
19 pub fn agent_context_id(&self) -> ::std::option::Option<&str> {
20 self.agent_context_id.as_deref()
21 }
22 /// <p>A unique, case-sensitive identifier that you provide to ensure that the request completes no more than one time. The token is scoped to your account and the agent context. If you reuse a token on the same agent context with different parameters, the request fails with <code>ValidationException</code>.</p>
23 pub fn client_token(&self) -> ::std::option::Option<&str> {
24 self.client_token.as_deref()
25 }
26 /// <p>A description of the task. Up to 1,024 characters, with no control characters.</p>
27 pub fn description(&self) -> ::std::option::Option<&str> {
28 self.description.as_deref()
29 }
30 /// <p>What the task imports. Set exactly one member. The member that you set determines the task's <code>type</code>.</p>
31 pub fn input_configuration(&self) -> ::std::option::Option<&crate::types::TaskInputConfiguration> {
32 self.input_configuration.as_ref()
33 }
34 /// <p>Who can see the content that the task adds to the agent context. AWS Context supports only one entry: <code>ALLOW</code> with <code>principalId</code> <code>*</code>, so that every reader of the agent context can see it. If you omit it or send no entries, AWS Context uses that entry. If you name any other principal, include a <code>DENY</code> entry, or send more than one entry, the request fails with <code>ValidationException</code>, and no task is started.</p>
35 pub fn access_control_config(&self) -> ::std::option::Option<&crate::types::AccessControlConfig> {
36 self.access_control_config.as_ref()
37 }
38}
39impl ::std::fmt::Debug for StartTaskInput {
40 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
41 let mut formatter = f.debug_struct("StartTaskInput");
42 formatter.field("agent_context_id", &self.agent_context_id);
43 formatter.field("client_token", &self.client_token);
44 formatter.field("description", &"*** Sensitive Data Redacted ***");
45 formatter.field("input_configuration", &self.input_configuration);
46 formatter.field("access_control_config", &self.access_control_config);
47 formatter.finish()
48 }
49}
50impl StartTaskInput {
51 /// Creates a new builder-style object to manufacture [`StartTaskInput`](crate::operation::start_task::StartTaskInput).
52 pub fn builder() -> crate::operation::start_task::builders::StartTaskInputBuilder {
53 crate::operation::start_task::builders::StartTaskInputBuilder::default()
54 }
55}
56
57/// A builder for [`StartTaskInput`](crate::operation::start_task::StartTaskInput).
58#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
59#[non_exhaustive]
60pub struct StartTaskInputBuilder {
61 pub(crate) agent_context_id: ::std::option::Option<::std::string::String>,
62 pub(crate) client_token: ::std::option::Option<::std::string::String>,
63 pub(crate) description: ::std::option::Option<::std::string::String>,
64 pub(crate) input_configuration: ::std::option::Option<crate::types::TaskInputConfiguration>,
65 pub(crate) access_control_config: ::std::option::Option<crate::types::AccessControlConfig>,
66}
67impl StartTaskInputBuilder {
68 /// <p>The agent context, as an ID or ARN.</p>
69 /// This field is required.
70 pub fn agent_context_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
71 self.agent_context_id = ::std::option::Option::Some(input.into());
72 self
73 }
74 /// <p>The agent context, as an ID or ARN.</p>
75 pub fn set_agent_context_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
76 self.agent_context_id = input;
77 self
78 }
79 /// <p>The agent context, as an ID or ARN.</p>
80 pub fn get_agent_context_id(&self) -> &::std::option::Option<::std::string::String> {
81 &self.agent_context_id
82 }
83 /// <p>A unique, case-sensitive identifier that you provide to ensure that the request completes no more than one time. The token is scoped to your account and the agent context. If you reuse a token on the same agent context with different parameters, the request fails with <code>ValidationException</code>.</p>
84 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
85 self.client_token = ::std::option::Option::Some(input.into());
86 self
87 }
88 /// <p>A unique, case-sensitive identifier that you provide to ensure that the request completes no more than one time. The token is scoped to your account and the agent context. If you reuse a token on the same agent context with different parameters, the request fails with <code>ValidationException</code>.</p>
89 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
90 self.client_token = input;
91 self
92 }
93 /// <p>A unique, case-sensitive identifier that you provide to ensure that the request completes no more than one time. The token is scoped to your account and the agent context. If you reuse a token on the same agent context with different parameters, the request fails with <code>ValidationException</code>.</p>
94 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
95 &self.client_token
96 }
97 /// <p>A description of the task. Up to 1,024 characters, with no control characters.</p>
98 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
99 self.description = ::std::option::Option::Some(input.into());
100 self
101 }
102 /// <p>A description of the task. Up to 1,024 characters, with no control characters.</p>
103 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
104 self.description = input;
105 self
106 }
107 /// <p>A description of the task. Up to 1,024 characters, with no control characters.</p>
108 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
109 &self.description
110 }
111 /// <p>What the task imports. Set exactly one member. The member that you set determines the task's <code>type</code>.</p>
112 /// This field is required.
113 pub fn input_configuration(mut self, input: crate::types::TaskInputConfiguration) -> Self {
114 self.input_configuration = ::std::option::Option::Some(input);
115 self
116 }
117 /// <p>What the task imports. Set exactly one member. The member that you set determines the task's <code>type</code>.</p>
118 pub fn set_input_configuration(mut self, input: ::std::option::Option<crate::types::TaskInputConfiguration>) -> Self {
119 self.input_configuration = input;
120 self
121 }
122 /// <p>What the task imports. Set exactly one member. The member that you set determines the task's <code>type</code>.</p>
123 pub fn get_input_configuration(&self) -> &::std::option::Option<crate::types::TaskInputConfiguration> {
124 &self.input_configuration
125 }
126 /// <p>Who can see the content that the task adds to the agent context. AWS Context supports only one entry: <code>ALLOW</code> with <code>principalId</code> <code>*</code>, so that every reader of the agent context can see it. If you omit it or send no entries, AWS Context uses that entry. If you name any other principal, include a <code>DENY</code> entry, or send more than one entry, the request fails with <code>ValidationException</code>, and no task is started.</p>
127 pub fn access_control_config(mut self, input: crate::types::AccessControlConfig) -> Self {
128 self.access_control_config = ::std::option::Option::Some(input);
129 self
130 }
131 /// <p>Who can see the content that the task adds to the agent context. AWS Context supports only one entry: <code>ALLOW</code> with <code>principalId</code> <code>*</code>, so that every reader of the agent context can see it. If you omit it or send no entries, AWS Context uses that entry. If you name any other principal, include a <code>DENY</code> entry, or send more than one entry, the request fails with <code>ValidationException</code>, and no task is started.</p>
132 pub fn set_access_control_config(mut self, input: ::std::option::Option<crate::types::AccessControlConfig>) -> Self {
133 self.access_control_config = input;
134 self
135 }
136 /// <p>Who can see the content that the task adds to the agent context. AWS Context supports only one entry: <code>ALLOW</code> with <code>principalId</code> <code>*</code>, so that every reader of the agent context can see it. If you omit it or send no entries, AWS Context uses that entry. If you name any other principal, include a <code>DENY</code> entry, or send more than one entry, the request fails with <code>ValidationException</code>, and no task is started.</p>
137 pub fn get_access_control_config(&self) -> &::std::option::Option<crate::types::AccessControlConfig> {
138 &self.access_control_config
139 }
140 /// Consumes the builder and constructs a [`StartTaskInput`](crate::operation::start_task::StartTaskInput).
141 pub fn build(self) -> ::std::result::Result<crate::operation::start_task::StartTaskInput, ::aws_smithy_types::error::operation::BuildError> {
142 ::std::result::Result::Ok(crate::operation::start_task::StartTaskInput {
143 agent_context_id: self.agent_context_id,
144 client_token: self.client_token,
145 description: self.description,
146 input_configuration: self.input_configuration,
147 access_control_config: self.access_control_config,
148 })
149 }
150}
151impl ::std::fmt::Debug for StartTaskInputBuilder {
152 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
153 let mut formatter = f.debug_struct("StartTaskInputBuilder");
154 formatter.field("agent_context_id", &self.agent_context_id);
155 formatter.field("client_token", &self.client_token);
156 formatter.field("description", &"*** Sensitive Data Redacted ***");
157 formatter.field("input_configuration", &self.input_configuration);
158 formatter.field("access_control_config", &self.access_control_config);
159 formatter.finish()
160 }
161}