aws_sdk_resourceexplorer2/operation/create_view/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_view::_create_view_output::CreateViewOutputBuilder;
3
4pub use crate::operation::create_view::_create_view_input::CreateViewInputBuilder;
5
6impl crate::operation::create_view::builders::CreateViewInputBuilder {
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_view::CreateViewOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_view::CreateViewError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_view();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateView`.
24///
25/// <p>Creates a view that users can query by using the <code>Search</code> operation. Results from queries that you make using this view include only resources that match the view's <code>Filters</code>. For more information about Amazon Web Services Resource Explorer views, see <a href="https://docs.aws.amazon.com/resource-explorer/latest/userguide/manage-views.html">Managing views</a> in the <i>Amazon Web Services Resource Explorer User Guide</i>.</p>
26/// <p>Only the principals with an IAM identity-based policy that grants <code>Allow</code> to the <code>Search</code> action on a <code>Resource</code> with the <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon resource name (ARN)</a> of this view can <code>Search</code> using views you create with this operation.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct CreateViewFluentBuilder {
29    handle: ::std::sync::Arc<crate::client::Handle>,
30    inner: crate::operation::create_view::builders::CreateViewInputBuilder,
31    config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34    crate::client::customize::internal::CustomizableSend<
35        crate::operation::create_view::CreateViewOutput,
36        crate::operation::create_view::CreateViewError,
37    > for CreateViewFluentBuilder
38{
39    fn send(
40        self,
41        config_override: crate::config::Builder,
42    ) -> crate::client::customize::internal::BoxFuture<
43        crate::client::customize::internal::SendResult<
44            crate::operation::create_view::CreateViewOutput,
45            crate::operation::create_view::CreateViewError,
46        >,
47    > {
48        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49    }
50}
51impl CreateViewFluentBuilder {
52    /// Creates a new `CreateViewFluentBuilder`.
53    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
54        Self {
55            handle,
56            inner: ::std::default::Default::default(),
57            config_override: ::std::option::Option::None,
58        }
59    }
60    /// Access the CreateView as a reference.
61    pub fn as_input(&self) -> &crate::operation::create_view::builders::CreateViewInputBuilder {
62        &self.inner
63    }
64    /// Sends the request and returns the response.
65    ///
66    /// If an error occurs, an `SdkError` will be returned with additional details that
67    /// can be matched against.
68    ///
69    /// By default, any retryable failures will be retried twice. Retry behavior
70    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
71    /// set when configuring the client.
72    pub async fn send(
73        self,
74    ) -> ::std::result::Result<
75        crate::operation::create_view::CreateViewOutput,
76        ::aws_smithy_runtime_api::client::result::SdkError<
77            crate::operation::create_view::CreateViewError,
78            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
79        >,
80    > {
81        let input = self
82            .inner
83            .build()
84            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
85        let runtime_plugins = crate::operation::create_view::CreateView::operation_runtime_plugins(
86            self.handle.runtime_plugins.clone(),
87            &self.handle.conf,
88            self.config_override,
89        );
90        crate::operation::create_view::CreateView::orchestrate(&runtime_plugins, input).await
91    }
92
93    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94    pub fn customize(
95        self,
96    ) -> crate::client::customize::CustomizableOperation<
97        crate::operation::create_view::CreateViewOutput,
98        crate::operation::create_view::CreateViewError,
99        Self,
100    > {
101        crate::client::customize::CustomizableOperation::new(self)
102    }
103    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104        self.set_config_override(::std::option::Option::Some(config_override.into()));
105        self
106    }
107
108    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109        self.config_override = config_override;
110        self
111    }
112    /// <p>This value helps ensure idempotency. Resource Explorer uses this value to prevent the accidental creation of duplicate versions. We recommend that you generate a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID-type value</a> to ensure the uniqueness of your views.</p>
113    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114        self.inner = self.inner.client_token(input.into());
115        self
116    }
117    /// <p>This value helps ensure idempotency. Resource Explorer uses this value to prevent the accidental creation of duplicate versions. We recommend that you generate a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID-type value</a> to ensure the uniqueness of your views.</p>
118    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119        self.inner = self.inner.set_client_token(input);
120        self
121    }
122    /// <p>This value helps ensure idempotency. Resource Explorer uses this value to prevent the accidental creation of duplicate versions. We recommend that you generate a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID-type value</a> to ensure the uniqueness of your views.</p>
123    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
124        self.inner.get_client_token()
125    }
126    /// <p>The name of the new view. This name appears in the list of views in Resource Explorer.</p>
127    /// <p>The name must be no more than 64 characters long, and can include letters, digits, and the dash (-) character. The name must be unique within its Amazon Web Services Region.</p>
128    pub fn view_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        self.inner = self.inner.view_name(input.into());
130        self
131    }
132    /// <p>The name of the new view. This name appears in the list of views in Resource Explorer.</p>
133    /// <p>The name must be no more than 64 characters long, and can include letters, digits, and the dash (-) character. The name must be unique within its Amazon Web Services Region.</p>
134    pub fn set_view_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135        self.inner = self.inner.set_view_name(input);
136        self
137    }
138    /// <p>The name of the new view. This name appears in the list of views in Resource Explorer.</p>
139    /// <p>The name must be no more than 64 characters long, and can include letters, digits, and the dash (-) character. The name must be unique within its Amazon Web Services Region.</p>
140    pub fn get_view_name(&self) -> &::std::option::Option<::std::string::String> {
141        self.inner.get_view_name()
142    }
143    ///
144    /// Appends an item to `IncludedProperties`.
145    ///
146    /// To override the contents of this collection use [`set_included_properties`](Self::set_included_properties).
147    ///
148    /// <p>Specifies optional fields that you want included in search results from this view. It is a list of objects that each describe a field to include.</p>
149    /// <p>The default is an empty list, with no optional fields included in the results.</p>
150    pub fn included_properties(mut self, input: crate::types::IncludedProperty) -> Self {
151        self.inner = self.inner.included_properties(input);
152        self
153    }
154    /// <p>Specifies optional fields that you want included in search results from this view. It is a list of objects that each describe a field to include.</p>
155    /// <p>The default is an empty list, with no optional fields included in the results.</p>
156    pub fn set_included_properties(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::IncludedProperty>>) -> Self {
157        self.inner = self.inner.set_included_properties(input);
158        self
159    }
160    /// <p>Specifies optional fields that you want included in search results from this view. It is a list of objects that each describe a field to include.</p>
161    /// <p>The default is an empty list, with no optional fields included in the results.</p>
162    pub fn get_included_properties(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::IncludedProperty>> {
163        self.inner.get_included_properties()
164    }
165    /// <p>The root ARN of the account, an organizational unit (OU), or an organization ARN. If left empty, the default is account.</p>
166    pub fn scope(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
167        self.inner = self.inner.scope(input.into());
168        self
169    }
170    /// <p>The root ARN of the account, an organizational unit (OU), or an organization ARN. If left empty, the default is account.</p>
171    pub fn set_scope(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
172        self.inner = self.inner.set_scope(input);
173        self
174    }
175    /// <p>The root ARN of the account, an organizational unit (OU), or an organization ARN. If left empty, the default is account.</p>
176    pub fn get_scope(&self) -> &::std::option::Option<::std::string::String> {
177        self.inner.get_scope()
178    }
179    /// <p>An array of strings that specify which resources are included in the results of queries made using this view. When you use this view in a <code>Search</code> operation, the filter string is combined with the search's <code>QueryString</code> parameter using a logical <code>AND</code> operator.</p>
180    /// <p>For information about the supported syntax, see <a href="https://docs.aws.amazon.com/resource-explorer/latest/userguide/using-search-query-syntax.html">Search query reference for Resource Explorer</a> in the <i>Amazon Web Services Resource Explorer User Guide</i>.</p><important>
181    /// <p>This query string in the context of this operation supports only <a href="https://docs.aws.amazon.com/resource-explorer/latest/userguide/using-search-query-syntax.html#query-syntax-filters">filter prefixes</a> with optional <a href="https://docs.aws.amazon.com/resource-explorer/latest/userguide/using-search-query-syntax.html#query-syntax-operators">operators</a>. It doesn't support free-form text. For example, the string <code>region:us* service:ec2 -tag:stage=prod</code> includes all Amazon EC2 resources in any Amazon Web Services Region that begins with the letters <code>us</code> and is <i>not</i> tagged with a key <code>Stage</code> that has the value <code>prod</code>.</p>
182    /// </important>
183    pub fn filters(mut self, input: crate::types::SearchFilter) -> Self {
184        self.inner = self.inner.filters(input);
185        self
186    }
187    /// <p>An array of strings that specify which resources are included in the results of queries made using this view. When you use this view in a <code>Search</code> operation, the filter string is combined with the search's <code>QueryString</code> parameter using a logical <code>AND</code> operator.</p>
188    /// <p>For information about the supported syntax, see <a href="https://docs.aws.amazon.com/resource-explorer/latest/userguide/using-search-query-syntax.html">Search query reference for Resource Explorer</a> in the <i>Amazon Web Services Resource Explorer User Guide</i>.</p><important>
189    /// <p>This query string in the context of this operation supports only <a href="https://docs.aws.amazon.com/resource-explorer/latest/userguide/using-search-query-syntax.html#query-syntax-filters">filter prefixes</a> with optional <a href="https://docs.aws.amazon.com/resource-explorer/latest/userguide/using-search-query-syntax.html#query-syntax-operators">operators</a>. It doesn't support free-form text. For example, the string <code>region:us* service:ec2 -tag:stage=prod</code> includes all Amazon EC2 resources in any Amazon Web Services Region that begins with the letters <code>us</code> and is <i>not</i> tagged with a key <code>Stage</code> that has the value <code>prod</code>.</p>
190    /// </important>
191    pub fn set_filters(mut self, input: ::std::option::Option<crate::types::SearchFilter>) -> Self {
192        self.inner = self.inner.set_filters(input);
193        self
194    }
195    /// <p>An array of strings that specify which resources are included in the results of queries made using this view. When you use this view in a <code>Search</code> operation, the filter string is combined with the search's <code>QueryString</code> parameter using a logical <code>AND</code> operator.</p>
196    /// <p>For information about the supported syntax, see <a href="https://docs.aws.amazon.com/resource-explorer/latest/userguide/using-search-query-syntax.html">Search query reference for Resource Explorer</a> in the <i>Amazon Web Services Resource Explorer User Guide</i>.</p><important>
197    /// <p>This query string in the context of this operation supports only <a href="https://docs.aws.amazon.com/resource-explorer/latest/userguide/using-search-query-syntax.html#query-syntax-filters">filter prefixes</a> with optional <a href="https://docs.aws.amazon.com/resource-explorer/latest/userguide/using-search-query-syntax.html#query-syntax-operators">operators</a>. It doesn't support free-form text. For example, the string <code>region:us* service:ec2 -tag:stage=prod</code> includes all Amazon EC2 resources in any Amazon Web Services Region that begins with the letters <code>us</code> and is <i>not</i> tagged with a key <code>Stage</code> that has the value <code>prod</code>.</p>
198    /// </important>
199    pub fn get_filters(&self) -> &::std::option::Option<crate::types::SearchFilter> {
200        self.inner.get_filters()
201    }
202    ///
203    /// Adds a key-value pair to `Tags`.
204    ///
205    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
206    ///
207    /// <p>Tag key and value pairs that are attached to the view.</p>
208    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
209        self.inner = self.inner.tags(k.into(), v.into());
210        self
211    }
212    /// <p>Tag key and value pairs that are attached to the view.</p>
213    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
214        self.inner = self.inner.set_tags(input);
215        self
216    }
217    /// <p>Tag key and value pairs that are attached to the view.</p>
218    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
219        self.inner.get_tags()
220    }
221}