aws_sdk_bedrockagent/operation/update_agent/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_agent::_update_agent_output::UpdateAgentOutputBuilder;
3
4pub use crate::operation::update_agent::_update_agent_input::UpdateAgentInputBuilder;
5
6impl crate::operation::update_agent::builders::UpdateAgentInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::update_agent::UpdateAgentOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::update_agent::UpdateAgentError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.update_agent();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `UpdateAgent`.
24///
25/// <p>Updates the configuration of an agent.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateAgentFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::update_agent::builders::UpdateAgentInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::update_agent::UpdateAgentOutput,
35 crate::operation::update_agent::UpdateAgentError,
36 > for UpdateAgentFluentBuilder
37{
38 fn send(
39 self,
40 config_override: crate::config::Builder,
41 ) -> crate::client::customize::internal::BoxFuture<
42 crate::client::customize::internal::SendResult<
43 crate::operation::update_agent::UpdateAgentOutput,
44 crate::operation::update_agent::UpdateAgentError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl UpdateAgentFluentBuilder {
51 /// Creates a new `UpdateAgentFluentBuilder`.
52 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53 Self {
54 handle,
55 inner: ::std::default::Default::default(),
56 config_override: ::std::option::Option::None,
57 }
58 }
59 /// Access the UpdateAgent as a reference.
60 pub fn as_input(&self) -> &crate::operation::update_agent::builders::UpdateAgentInputBuilder {
61 &self.inner
62 }
63 /// Sends the request and returns the response.
64 ///
65 /// If an error occurs, an `SdkError` will be returned with additional details that
66 /// can be matched against.
67 ///
68 /// By default, any retryable failures will be retried twice. Retry behavior
69 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70 /// set when configuring the client.
71 pub async fn send(
72 self,
73 ) -> ::std::result::Result<
74 crate::operation::update_agent::UpdateAgentOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::update_agent::UpdateAgentError,
77 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78 >,
79 > {
80 let input = self
81 .inner
82 .build()
83 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84 let runtime_plugins = crate::operation::update_agent::UpdateAgent::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::update_agent::UpdateAgent::orchestrate(&runtime_plugins, input).await
90 }
91
92 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93 pub fn customize(
94 self,
95 ) -> crate::client::customize::CustomizableOperation<
96 crate::operation::update_agent::UpdateAgentOutput,
97 crate::operation::update_agent::UpdateAgentError,
98 Self,
99 > {
100 crate::client::customize::CustomizableOperation::new(self)
101 }
102 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103 self.set_config_override(::std::option::Option::Some(config_override.into()));
104 self
105 }
106
107 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108 self.config_override = config_override;
109 self
110 }
111 /// <p>The unique identifier of the agent.</p>
112 pub fn agent_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113 self.inner = self.inner.agent_id(input.into());
114 self
115 }
116 /// <p>The unique identifier of the agent.</p>
117 pub fn set_agent_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118 self.inner = self.inner.set_agent_id(input);
119 self
120 }
121 /// <p>The unique identifier of the agent.</p>
122 pub fn get_agent_id(&self) -> &::std::option::Option<::std::string::String> {
123 self.inner.get_agent_id()
124 }
125 /// <p>Specifies a new name for the agent.</p>
126 pub fn agent_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127 self.inner = self.inner.agent_name(input.into());
128 self
129 }
130 /// <p>Specifies a new name for the agent.</p>
131 pub fn set_agent_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132 self.inner = self.inner.set_agent_name(input);
133 self
134 }
135 /// <p>Specifies a new name for the agent.</p>
136 pub fn get_agent_name(&self) -> &::std::option::Option<::std::string::String> {
137 self.inner.get_agent_name()
138 }
139 /// <p>Specifies new instructions that tell the agent what it should do and how it should interact with users.</p>
140 pub fn instruction(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141 self.inner = self.inner.instruction(input.into());
142 self
143 }
144 /// <p>Specifies new instructions that tell the agent what it should do and how it should interact with users.</p>
145 pub fn set_instruction(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146 self.inner = self.inner.set_instruction(input);
147 self
148 }
149 /// <p>Specifies new instructions that tell the agent what it should do and how it should interact with users.</p>
150 pub fn get_instruction(&self) -> &::std::option::Option<::std::string::String> {
151 self.inner.get_instruction()
152 }
153 /// <p>The identifier for the model that you want to be used for orchestration by the agent you create.</p>
154 /// <p>The <code>modelId</code> to provide depends on the type of model or throughput that you use:</p>
155 /// <ul>
156 /// <li>
157 /// <p>If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns">Amazon Bedrock base model IDs (on-demand throughput)</a> in the Amazon Bedrock User Guide.</p></li>
158 /// <li>
159 /// <p>If you use an inference profile, specify the inference profile ID or its ARN. For a list of inference profile IDs, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html">Supported Regions and models for cross-region inference</a> in the Amazon Bedrock User Guide.</p></li>
160 /// <li>
161 /// <p>If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html">Run inference using a Provisioned Throughput</a> in the Amazon Bedrock User Guide.</p></li>
162 /// <li>
163 /// <p>If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p></li>
164 /// <li>
165 /// <p>If you use an <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html">imported model</a>, specify the ARN of the imported model. You can get the model ARN from a successful call to <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateModelImportJob.html">CreateModelImportJob</a> or from the Imported models page in the Amazon Bedrock console.</p></li>
166 /// </ul>
167 pub fn foundation_model(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
168 self.inner = self.inner.foundation_model(input.into());
169 self
170 }
171 /// <p>The identifier for the model that you want to be used for orchestration by the agent you create.</p>
172 /// <p>The <code>modelId</code> to provide depends on the type of model or throughput that you use:</p>
173 /// <ul>
174 /// <li>
175 /// <p>If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns">Amazon Bedrock base model IDs (on-demand throughput)</a> in the Amazon Bedrock User Guide.</p></li>
176 /// <li>
177 /// <p>If you use an inference profile, specify the inference profile ID or its ARN. For a list of inference profile IDs, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html">Supported Regions and models for cross-region inference</a> in the Amazon Bedrock User Guide.</p></li>
178 /// <li>
179 /// <p>If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html">Run inference using a Provisioned Throughput</a> in the Amazon Bedrock User Guide.</p></li>
180 /// <li>
181 /// <p>If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p></li>
182 /// <li>
183 /// <p>If you use an <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html">imported model</a>, specify the ARN of the imported model. You can get the model ARN from a successful call to <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateModelImportJob.html">CreateModelImportJob</a> or from the Imported models page in the Amazon Bedrock console.</p></li>
184 /// </ul>
185 pub fn set_foundation_model(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
186 self.inner = self.inner.set_foundation_model(input);
187 self
188 }
189 /// <p>The identifier for the model that you want to be used for orchestration by the agent you create.</p>
190 /// <p>The <code>modelId</code> to provide depends on the type of model or throughput that you use:</p>
191 /// <ul>
192 /// <li>
193 /// <p>If you use a base model, specify the model ID or its ARN. For a list of model IDs for base models, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-ids.html#model-ids-arns">Amazon Bedrock base model IDs (on-demand throughput)</a> in the Amazon Bedrock User Guide.</p></li>
194 /// <li>
195 /// <p>If you use an inference profile, specify the inference profile ID or its ARN. For a list of inference profile IDs, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/cross-region-inference-support.html">Supported Regions and models for cross-region inference</a> in the Amazon Bedrock User Guide.</p></li>
196 /// <li>
197 /// <p>If you use a provisioned model, specify the ARN of the Provisioned Throughput. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-use.html">Run inference using a Provisioned Throughput</a> in the Amazon Bedrock User Guide.</p></li>
198 /// <li>
199 /// <p>If you use a custom model, first purchase Provisioned Throughput for it. Then specify the ARN of the resulting provisioned model. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-use.html">Use a custom model in Amazon Bedrock</a> in the Amazon Bedrock User Guide.</p></li>
200 /// <li>
201 /// <p>If you use an <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/model-customization-import-model.html">imported model</a>, specify the ARN of the imported model. You can get the model ARN from a successful call to <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CreateModelImportJob.html">CreateModelImportJob</a> or from the Imported models page in the Amazon Bedrock console.</p></li>
202 /// </ul>
203 pub fn get_foundation_model(&self) -> &::std::option::Option<::std::string::String> {
204 self.inner.get_foundation_model()
205 }
206 /// <p>Specifies a new description of the agent.</p>
207 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
208 self.inner = self.inner.description(input.into());
209 self
210 }
211 /// <p>Specifies a new description of the agent.</p>
212 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
213 self.inner = self.inner.set_description(input);
214 self
215 }
216 /// <p>Specifies a new description of the agent.</p>
217 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
218 self.inner.get_description()
219 }
220 /// <p>Specifies the type of orchestration strategy for the agent. This is set to <code>DEFAULT</code> orchestration type, by default.</p>
221 pub fn orchestration_type(mut self, input: crate::types::OrchestrationType) -> Self {
222 self.inner = self.inner.orchestration_type(input);
223 self
224 }
225 /// <p>Specifies the type of orchestration strategy for the agent. This is set to <code>DEFAULT</code> orchestration type, by default.</p>
226 pub fn set_orchestration_type(mut self, input: ::std::option::Option<crate::types::OrchestrationType>) -> Self {
227 self.inner = self.inner.set_orchestration_type(input);
228 self
229 }
230 /// <p>Specifies the type of orchestration strategy for the agent. This is set to <code>DEFAULT</code> orchestration type, by default.</p>
231 pub fn get_orchestration_type(&self) -> &::std::option::Option<crate::types::OrchestrationType> {
232 self.inner.get_orchestration_type()
233 }
234 /// <p>Contains details of the custom orchestration configured for the agent.</p>
235 pub fn custom_orchestration(mut self, input: crate::types::CustomOrchestration) -> Self {
236 self.inner = self.inner.custom_orchestration(input);
237 self
238 }
239 /// <p>Contains details of the custom orchestration configured for the agent.</p>
240 pub fn set_custom_orchestration(mut self, input: ::std::option::Option<crate::types::CustomOrchestration>) -> Self {
241 self.inner = self.inner.set_custom_orchestration(input);
242 self
243 }
244 /// <p>Contains details of the custom orchestration configured for the agent.</p>
245 pub fn get_custom_orchestration(&self) -> &::std::option::Option<crate::types::CustomOrchestration> {
246 self.inner.get_custom_orchestration()
247 }
248 /// <p>The number of seconds for which Amazon Bedrock keeps information about a user's conversation with the agent.</p>
249 /// <p>A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and Amazon Bedrock deletes any data provided before the timeout.</p>
250 pub fn idle_session_ttl_in_seconds(mut self, input: i32) -> Self {
251 self.inner = self.inner.idle_session_ttl_in_seconds(input);
252 self
253 }
254 /// <p>The number of seconds for which Amazon Bedrock keeps information about a user's conversation with the agent.</p>
255 /// <p>A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and Amazon Bedrock deletes any data provided before the timeout.</p>
256 pub fn set_idle_session_ttl_in_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
257 self.inner = self.inner.set_idle_session_ttl_in_seconds(input);
258 self
259 }
260 /// <p>The number of seconds for which Amazon Bedrock keeps information about a user's conversation with the agent.</p>
261 /// <p>A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and Amazon Bedrock deletes any data provided before the timeout.</p>
262 pub fn get_idle_session_ttl_in_seconds(&self) -> &::std::option::Option<i32> {
263 self.inner.get_idle_session_ttl_in_seconds()
264 }
265 /// <p>The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the agent.</p>
266 pub fn agent_resource_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
267 self.inner = self.inner.agent_resource_role_arn(input.into());
268 self
269 }
270 /// <p>The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the agent.</p>
271 pub fn set_agent_resource_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
272 self.inner = self.inner.set_agent_resource_role_arn(input);
273 self
274 }
275 /// <p>The Amazon Resource Name (ARN) of the IAM role with permissions to invoke API operations on the agent.</p>
276 pub fn get_agent_resource_role_arn(&self) -> &::std::option::Option<::std::string::String> {
277 self.inner.get_agent_resource_role_arn()
278 }
279 /// <p>The Amazon Resource Name (ARN) of the KMS key with which to encrypt the agent.</p>
280 pub fn customer_encryption_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
281 self.inner = self.inner.customer_encryption_key_arn(input.into());
282 self
283 }
284 /// <p>The Amazon Resource Name (ARN) of the KMS key with which to encrypt the agent.</p>
285 pub fn set_customer_encryption_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
286 self.inner = self.inner.set_customer_encryption_key_arn(input);
287 self
288 }
289 /// <p>The Amazon Resource Name (ARN) of the KMS key with which to encrypt the agent.</p>
290 pub fn get_customer_encryption_key_arn(&self) -> &::std::option::Option<::std::string::String> {
291 self.inner.get_customer_encryption_key_arn()
292 }
293 /// <p>Contains configurations to override prompts in different parts of an agent sequence. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html">Advanced prompts</a>.</p>
294 pub fn prompt_override_configuration(mut self, input: crate::types::PromptOverrideConfiguration) -> Self {
295 self.inner = self.inner.prompt_override_configuration(input);
296 self
297 }
298 /// <p>Contains configurations to override prompts in different parts of an agent sequence. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html">Advanced prompts</a>.</p>
299 pub fn set_prompt_override_configuration(mut self, input: ::std::option::Option<crate::types::PromptOverrideConfiguration>) -> Self {
300 self.inner = self.inner.set_prompt_override_configuration(input);
301 self
302 }
303 /// <p>Contains configurations to override prompts in different parts of an agent sequence. For more information, see <a href="https://docs.aws.amazon.com/bedrock/latest/userguide/advanced-prompts.html">Advanced prompts</a>.</p>
304 pub fn get_prompt_override_configuration(&self) -> &::std::option::Option<crate::types::PromptOverrideConfiguration> {
305 self.inner.get_prompt_override_configuration()
306 }
307 /// <p>The unique Guardrail configuration assigned to the agent when it is updated.</p>
308 pub fn guardrail_configuration(mut self, input: crate::types::GuardrailConfiguration) -> Self {
309 self.inner = self.inner.guardrail_configuration(input);
310 self
311 }
312 /// <p>The unique Guardrail configuration assigned to the agent when it is updated.</p>
313 pub fn set_guardrail_configuration(mut self, input: ::std::option::Option<crate::types::GuardrailConfiguration>) -> Self {
314 self.inner = self.inner.set_guardrail_configuration(input);
315 self
316 }
317 /// <p>The unique Guardrail configuration assigned to the agent when it is updated.</p>
318 pub fn get_guardrail_configuration(&self) -> &::std::option::Option<crate::types::GuardrailConfiguration> {
319 self.inner.get_guardrail_configuration()
320 }
321 /// <p>Specifies the new memory configuration for the agent.</p>
322 pub fn memory_configuration(mut self, input: crate::types::MemoryConfiguration) -> Self {
323 self.inner = self.inner.memory_configuration(input);
324 self
325 }
326 /// <p>Specifies the new memory configuration for the agent.</p>
327 pub fn set_memory_configuration(mut self, input: ::std::option::Option<crate::types::MemoryConfiguration>) -> Self {
328 self.inner = self.inner.set_memory_configuration(input);
329 self
330 }
331 /// <p>Specifies the new memory configuration for the agent.</p>
332 pub fn get_memory_configuration(&self) -> &::std::option::Option<crate::types::MemoryConfiguration> {
333 self.inner.get_memory_configuration()
334 }
335 /// <p>The agent's collaboration role.</p>
336 pub fn agent_collaboration(mut self, input: crate::types::AgentCollaboration) -> Self {
337 self.inner = self.inner.agent_collaboration(input);
338 self
339 }
340 /// <p>The agent's collaboration role.</p>
341 pub fn set_agent_collaboration(mut self, input: ::std::option::Option<crate::types::AgentCollaboration>) -> Self {
342 self.inner = self.inner.set_agent_collaboration(input);
343 self
344 }
345 /// <p>The agent's collaboration role.</p>
346 pub fn get_agent_collaboration(&self) -> &::std::option::Option<crate::types::AgentCollaboration> {
347 self.inner.get_agent_collaboration()
348 }
349}