aws_sdk_context/operation/create_agent_context/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_agent_context::_create_agent_context_input::CreateAgentContextInputBuilder;
3
4pub use crate::operation::create_agent_context::_create_agent_context_output::CreateAgentContextOutputBuilder;
5
6impl crate::operation::create_agent_context::builders::CreateAgentContextInputBuilder {
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::create_agent_context::CreateAgentContextOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_agent_context::CreateAgentContextError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_agent_context();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateAgentContext`.
24///
25/// <p>Creates an agent context over one or more connections. Creation is asynchronous. GetAgentContext returns its status.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateAgentContextFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::create_agent_context::builders::CreateAgentContextInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::create_agent_context::CreateAgentContextOutput,
35 crate::operation::create_agent_context::CreateAgentContextError,
36 > for CreateAgentContextFluentBuilder
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::create_agent_context::CreateAgentContextOutput,
44 crate::operation::create_agent_context::CreateAgentContextError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl CreateAgentContextFluentBuilder {
51 /// Creates a new `CreateAgentContextFluentBuilder`.
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 CreateAgentContext as a reference.
60 pub fn as_input(&self) -> &crate::operation::create_agent_context::builders::CreateAgentContextInputBuilder {
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::create_agent_context::CreateAgentContextOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::create_agent_context::CreateAgentContextError,
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::create_agent_context::CreateAgentContext::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::create_agent_context::CreateAgentContext::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::create_agent_context::CreateAgentContextOutput,
97 crate::operation::create_agent_context::CreateAgentContextError,
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>Client idempotency token. The AWS SDKs generate one when it is absent. An identical request with the same token returns the existing agent context. The same token with a different request returns ValidationException. <code>trustedIdentitySources</code> with the same entries in another order is the same request.</p>
112 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113 self.inner = self.inner.client_token(input.into());
114 self
115 }
116 /// <p>Client idempotency token. The AWS SDKs generate one when it is absent. An identical request with the same token returns the existing agent context. The same token with a different request returns ValidationException. <code>trustedIdentitySources</code> with the same entries in another order is the same request.</p>
117 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118 self.inner = self.inner.set_client_token(input);
119 self
120 }
121 /// <p>Client idempotency token. The AWS SDKs generate one when it is absent. An identical request with the same token returns the existing agent context. The same token with a different request returns ValidationException. <code>trustedIdentitySources</code> with the same entries in another order is the same request.</p>
122 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
123 self.inner.get_client_token()
124 }
125 /// <p>Optional. The name of the agent context. If you omit it, the name is <code>default</code>. You can change it later with UpdateAgentContext.</p>
126 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127 self.inner = self.inner.name(input.into());
128 self
129 }
130 /// <p>Optional. The name of the agent context. If you omit it, the name is <code>default</code>. You can change it later with UpdateAgentContext.</p>
131 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132 self.inner = self.inner.set_name(input);
133 self
134 }
135 /// <p>Optional. The name of the agent context. If you omit it, the name is <code>default</code>. You can change it later with UpdateAgentContext.</p>
136 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
137 self.inner.get_name()
138 }
139 /// <p>Optional human-readable description of the agent context. An empty string is the same as none.</p>
140 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141 self.inner = self.inner.description(input.into());
142 self
143 }
144 /// <p>Optional human-readable description of the agent context. An empty string is the same as none.</p>
145 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146 self.inner = self.inner.set_description(input);
147 self
148 }
149 /// <p>Optional human-readable description of the agent context. An empty string is the same as none.</p>
150 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
151 self.inner.get_description()
152 }
153 ///
154 /// Appends an item to `connectionMappings`.
155 ///
156 /// To override the contents of this collection use [`set_connection_mappings`](Self::set_connection_mappings).
157 ///
158 /// <p>The connection mappings for this agent context, up to 20. CreateAgentContext requires at least one: an empty list returns <code>ValidationException</code>. Each entry binds a connection to one or more ontologies, optionally scoped by a data filter, extraction depth, and path segments. Each referenced connection must exist, be owned by your account, and be <code>ACTIVE</code>. Order is significant. When several connections reach the same AWS Glue Data Catalog table, AWS Context tries the connection mapped first, with its own access, and then the next.</p>
159 pub fn connection_mappings(mut self, input: crate::types::ConnectionMapping) -> Self {
160 self.inner = self.inner.connection_mappings(input);
161 self
162 }
163 /// <p>The connection mappings for this agent context, up to 20. CreateAgentContext requires at least one: an empty list returns <code>ValidationException</code>. Each entry binds a connection to one or more ontologies, optionally scoped by a data filter, extraction depth, and path segments. Each referenced connection must exist, be owned by your account, and be <code>ACTIVE</code>. Order is significant. When several connections reach the same AWS Glue Data Catalog table, AWS Context tries the connection mapped first, with its own access, and then the next.</p>
164 pub fn set_connection_mappings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ConnectionMapping>>) -> Self {
165 self.inner = self.inner.set_connection_mappings(input);
166 self
167 }
168 /// <p>The connection mappings for this agent context, up to 20. CreateAgentContext requires at least one: an empty list returns <code>ValidationException</code>. Each entry binds a connection to one or more ontologies, optionally scoped by a data filter, extraction depth, and path segments. Each referenced connection must exist, be owned by your account, and be <code>ACTIVE</code>. Order is significant. When several connections reach the same AWS Glue Data Catalog table, AWS Context tries the connection mapped first, with its own access, and then the next.</p>
169 pub fn get_connection_mappings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ConnectionMapping>> {
170 self.inner.get_connection_mappings()
171 }
172 /// <p>The agent context's trace analysis settings. Optional. You can change it with UpdateAgentContext.</p>
173 pub fn trace_analysis_config(mut self, input: crate::types::TraceAnalysisConfig) -> Self {
174 self.inner = self.inner.trace_analysis_config(input);
175 self
176 }
177 /// <p>The agent context's trace analysis settings. Optional. You can change it with UpdateAgentContext.</p>
178 pub fn set_trace_analysis_config(mut self, input: ::std::option::Option<crate::types::TraceAnalysisConfig>) -> Self {
179 self.inner = self.inner.set_trace_analysis_config(input);
180 self
181 }
182 /// <p>The agent context's trace analysis settings. Optional. You can change it with UpdateAgentContext.</p>
183 pub fn get_trace_analysis_config(&self) -> &::std::option::Option<crate::types::TraceAnalysisConfig> {
184 self.inner.get_trace_analysis_config()
185 }
186 /// <p>Optional workforce sign-in settings. A config with <code>signInUrl</code> turns sign-in on (<code>status</code> defaults to ENABLED). <code>status</code> ENABLED without <code>signInUrl</code> is a ValidationException. You can change it with UpdateAgentContext.</p>
187 pub fn workforce_sign_in_config(mut self, input: crate::types::WorkforceSignInConfig) -> Self {
188 self.inner = self.inner.workforce_sign_in_config(input);
189 self
190 }
191 /// <p>Optional workforce sign-in settings. A config with <code>signInUrl</code> turns sign-in on (<code>status</code> defaults to ENABLED). <code>status</code> ENABLED without <code>signInUrl</code> is a ValidationException. You can change it with UpdateAgentContext.</p>
192 pub fn set_workforce_sign_in_config(mut self, input: ::std::option::Option<crate::types::WorkforceSignInConfig>) -> Self {
193 self.inner = self.inner.set_workforce_sign_in_config(input);
194 self
195 }
196 /// <p>Optional workforce sign-in settings. A config with <code>signInUrl</code> turns sign-in on (<code>status</code> defaults to ENABLED). <code>status</code> ENABLED without <code>signInUrl</code> is a ValidationException. You can change it with UpdateAgentContext.</p>
197 pub fn get_workforce_sign_in_config(&self) -> &::std::option::Option<crate::types::WorkforceSignInConfig> {
198 self.inner.get_workforce_sign_in_config()
199 }
200 /// <p>Optional entity resolution settings. When the config or its <code>status</code> is absent, <code>status</code> reads ENABLED. You can change it with UpdateAgentContext.</p>
201 pub fn entity_resolution_config(mut self, input: crate::types::EntityResolutionConfig) -> Self {
202 self.inner = self.inner.entity_resolution_config(input);
203 self
204 }
205 /// <p>Optional entity resolution settings. When the config or its <code>status</code> is absent, <code>status</code> reads ENABLED. You can change it with UpdateAgentContext.</p>
206 pub fn set_entity_resolution_config(mut self, input: ::std::option::Option<crate::types::EntityResolutionConfig>) -> Self {
207 self.inner = self.inner.set_entity_resolution_config(input);
208 self
209 }
210 /// <p>Optional entity resolution settings. When the config or its <code>status</code> is absent, <code>status</code> reads ENABLED. You can change it with UpdateAgentContext.</p>
211 pub fn get_entity_resolution_config(&self) -> &::std::option::Option<crate::types::EntityResolutionConfig> {
212 self.inner.get_entity_resolution_config()
213 }
214 ///
215 /// Appends an item to `trustedIdentitySources`.
216 ///
217 /// To override the contents of this collection use [`set_trusted_identity_sources`](Self::set_trusted_identity_sources).
218 ///
219 /// <p>Optional identity sources to trust in addition to your account. At most 100 unique entries, each with exactly one member. Order is not significant. An empty list and an absent member are the same value: only your account is trusted. You can change it with UpdateAgentContext.</p>
220 pub fn trusted_identity_sources(mut self, input: crate::types::TrustedIdentitySource) -> Self {
221 self.inner = self.inner.trusted_identity_sources(input);
222 self
223 }
224 /// <p>Optional identity sources to trust in addition to your account. At most 100 unique entries, each with exactly one member. Order is not significant. An empty list and an absent member are the same value: only your account is trusted. You can change it with UpdateAgentContext.</p>
225 pub fn set_trusted_identity_sources(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TrustedIdentitySource>>) -> Self {
226 self.inner = self.inner.set_trusted_identity_sources(input);
227 self
228 }
229 /// <p>Optional identity sources to trust in addition to your account. At most 100 unique entries, each with exactly one member. Order is not significant. An empty list and an absent member are the same value: only your account is trusted. You can change it with UpdateAgentContext.</p>
230 pub fn get_trusted_identity_sources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TrustedIdentitySource>> {
231 self.inner.get_trusted_identity_sources()
232 }
233 ///
234 /// Adds a key-value pair to `tags`.
235 ///
236 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
237 ///
238 /// <p>Tags to add to the agent context when you create it: up to 200 in the request, of which at most 50 can be user tags. Keys can't start with <code>aws:</code>. To add tags, you also need <code>context:TagResource</code> permission on the new agent context. If you specify more than 50 user tags, the request fails with <code>ServiceQuotaExceededException</code>, as on TagResource. If an AWS Organizations tag policy refuses a tag, the request fails with <code>ValidationException</code>.</p>
239 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
240 self.inner = self.inner.tags(k.into(), v.into());
241 self
242 }
243 /// <p>Tags to add to the agent context when you create it: up to 200 in the request, of which at most 50 can be user tags. Keys can't start with <code>aws:</code>. To add tags, you also need <code>context:TagResource</code> permission on the new agent context. If you specify more than 50 user tags, the request fails with <code>ServiceQuotaExceededException</code>, as on TagResource. If an AWS Organizations tag policy refuses a tag, the request fails with <code>ValidationException</code>.</p>
244 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
245 self.inner = self.inner.set_tags(input);
246 self
247 }
248 /// <p>Tags to add to the agent context when you create it: up to 200 in the request, of which at most 50 can be user tags. Keys can't start with <code>aws:</code>. To add tags, you also need <code>context:TagResource</code> permission on the new agent context. If you specify more than 50 user tags, the request fails with <code>ServiceQuotaExceededException</code>, as on TagResource. If an AWS Organizations tag policy refuses a tag, the request fails with <code>ValidationException</code>.</p>
249 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
250 self.inner.get_tags()
251 }
252 ///
253 /// Appends an item to `curationPolicyIds`.
254 ///
255 /// To override the contents of this collection use [`set_curation_policy_ids`](Self::set_curation_policy_ids).
256 ///
257 /// <p>Curation policies to associate with the new agent context, as IDs or ARNs, instead of the default curation policies. If you omit it or the list is empty, AWS Context associates the default curation policies. Each policy must be <code>ACTIVE</code> and owned by your account, and you need <code>context:AssociateCurationPolicy</code> permission on each. AWS Context checks both again on a <code>clientToken</code> retry. If a policy doesn't exist, the request fails with <code>ResourceNotFoundException</code>. If one has been deleted, it fails with <code>ConflictException</code>. Change the policies later with AssociateCurationPolicy and DisassociateCurationPolicy.</p>
258 pub fn curation_policy_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
259 self.inner = self.inner.curation_policy_ids(input.into());
260 self
261 }
262 /// <p>Curation policies to associate with the new agent context, as IDs or ARNs, instead of the default curation policies. If you omit it or the list is empty, AWS Context associates the default curation policies. Each policy must be <code>ACTIVE</code> and owned by your account, and you need <code>context:AssociateCurationPolicy</code> permission on each. AWS Context checks both again on a <code>clientToken</code> retry. If a policy doesn't exist, the request fails with <code>ResourceNotFoundException</code>. If one has been deleted, it fails with <code>ConflictException</code>. Change the policies later with AssociateCurationPolicy and DisassociateCurationPolicy.</p>
263 pub fn set_curation_policy_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
264 self.inner = self.inner.set_curation_policy_ids(input);
265 self
266 }
267 /// <p>Curation policies to associate with the new agent context, as IDs or ARNs, instead of the default curation policies. If you omit it or the list is empty, AWS Context associates the default curation policies. Each policy must be <code>ACTIVE</code> and owned by your account, and you need <code>context:AssociateCurationPolicy</code> permission on each. AWS Context checks both again on a <code>clientToken</code> retry. If a policy doesn't exist, the request fails with <code>ResourceNotFoundException</code>. If one has been deleted, it fails with <code>ConflictException</code>. Change the policies later with AssociateCurationPolicy and DisassociateCurationPolicy.</p>
268 pub fn get_curation_policy_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
269 self.inner.get_curation_policy_ids()
270 }
271}