aws_sdk_resourcegroups/operation/update_group_query/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_group_query::_update_group_query_output::UpdateGroupQueryOutputBuilder;
3
4pub use crate::operation::update_group_query::_update_group_query_input::UpdateGroupQueryInputBuilder;
5
6impl crate::operation::update_group_query::builders::UpdateGroupQueryInputBuilder {
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_group_query::UpdateGroupQueryOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_group_query::UpdateGroupQueryError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_group_query();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateGroupQuery`.
24///
25/// <p>Updates the resource query of a group. For more information about resource queries, see <a href="https://docs.aws.amazon.com/ARG/latest/userguide/gettingstarted-query.html#gettingstarted-query-cli-tag">Create a tag-based group in Resource Groups</a>.</p>
26/// <p><b>Minimum permissions</b></p>
27/// <p>To run this command, you must have the following permissions:</p>
28/// <ul>
29/// <li>
30/// <p><code>resource-groups:UpdateGroupQuery</code></p></li>
31/// </ul>
32#[derive(::std::clone::Clone, ::std::fmt::Debug)]
33pub struct UpdateGroupQueryFluentBuilder {
34    handle: ::std::sync::Arc<crate::client::Handle>,
35    inner: crate::operation::update_group_query::builders::UpdateGroupQueryInputBuilder,
36    config_override: ::std::option::Option<crate::config::Builder>,
37}
38impl
39    crate::client::customize::internal::CustomizableSend<
40        crate::operation::update_group_query::UpdateGroupQueryOutput,
41        crate::operation::update_group_query::UpdateGroupQueryError,
42    > for UpdateGroupQueryFluentBuilder
43{
44    fn send(
45        self,
46        config_override: crate::config::Builder,
47    ) -> crate::client::customize::internal::BoxFuture<
48        crate::client::customize::internal::SendResult<
49            crate::operation::update_group_query::UpdateGroupQueryOutput,
50            crate::operation::update_group_query::UpdateGroupQueryError,
51        >,
52    > {
53        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
54    }
55}
56impl UpdateGroupQueryFluentBuilder {
57    /// Creates a new `UpdateGroupQueryFluentBuilder`.
58    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
59        Self {
60            handle,
61            inner: ::std::default::Default::default(),
62            config_override: ::std::option::Option::None,
63        }
64    }
65    /// Access the UpdateGroupQuery as a reference.
66    pub fn as_input(&self) -> &crate::operation::update_group_query::builders::UpdateGroupQueryInputBuilder {
67        &self.inner
68    }
69    /// Sends the request and returns the response.
70    ///
71    /// If an error occurs, an `SdkError` will be returned with additional details that
72    /// can be matched against.
73    ///
74    /// By default, any retryable failures will be retried twice. Retry behavior
75    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
76    /// set when configuring the client.
77    pub async fn send(
78        self,
79    ) -> ::std::result::Result<
80        crate::operation::update_group_query::UpdateGroupQueryOutput,
81        ::aws_smithy_runtime_api::client::result::SdkError<
82            crate::operation::update_group_query::UpdateGroupQueryError,
83            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
84        >,
85    > {
86        let input = self
87            .inner
88            .build()
89            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
90        let runtime_plugins = crate::operation::update_group_query::UpdateGroupQuery::operation_runtime_plugins(
91            self.handle.runtime_plugins.clone(),
92            &self.handle.conf,
93            self.config_override,
94        );
95        crate::operation::update_group_query::UpdateGroupQuery::orchestrate(&runtime_plugins, input).await
96    }
97
98    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
99    pub fn customize(
100        self,
101    ) -> crate::client::customize::CustomizableOperation<
102        crate::operation::update_group_query::UpdateGroupQueryOutput,
103        crate::operation::update_group_query::UpdateGroupQueryError,
104        Self,
105    > {
106        crate::client::customize::CustomizableOperation::new(self)
107    }
108    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
109        self.set_config_override(::std::option::Option::Some(config_override.into()));
110        self
111    }
112
113    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
114        self.config_override = config_override;
115        self
116    }
117    /// <p>Don't use this parameter. Use <code>Group</code> instead.</p>
118    #[deprecated(note = "This field is deprecated, use Group instead.")]
119    pub fn group_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.inner = self.inner.group_name(input.into());
121        self
122    }
123    /// <p>Don't use this parameter. Use <code>Group</code> instead.</p>
124    #[deprecated(note = "This field is deprecated, use Group instead.")]
125    pub fn set_group_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126        self.inner = self.inner.set_group_name(input);
127        self
128    }
129    /// <p>Don't use this parameter. Use <code>Group</code> instead.</p>
130    #[deprecated(note = "This field is deprecated, use Group instead.")]
131    pub fn get_group_name(&self) -> &::std::option::Option<::std::string::String> {
132        self.inner.get_group_name()
133    }
134    /// <p>The name or the Amazon resource name (ARN) of the resource group to query.</p>
135    pub fn group(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136        self.inner = self.inner.group(input.into());
137        self
138    }
139    /// <p>The name or the Amazon resource name (ARN) of the resource group to query.</p>
140    pub fn set_group(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
141        self.inner = self.inner.set_group(input);
142        self
143    }
144    /// <p>The name or the Amazon resource name (ARN) of the resource group to query.</p>
145    pub fn get_group(&self) -> &::std::option::Option<::std::string::String> {
146        self.inner.get_group()
147    }
148    /// <p>The resource query to determine which Amazon Web Services resources are members of this resource group.</p><note>
149    /// <p>A resource group can contain either a <code>Configuration</code> or a <code>ResourceQuery</code>, but not both.</p>
150    /// </note>
151    pub fn resource_query(mut self, input: crate::types::ResourceQuery) -> Self {
152        self.inner = self.inner.resource_query(input);
153        self
154    }
155    /// <p>The resource query to determine which Amazon Web Services resources are members of this resource group.</p><note>
156    /// <p>A resource group can contain either a <code>Configuration</code> or a <code>ResourceQuery</code>, but not both.</p>
157    /// </note>
158    pub fn set_resource_query(mut self, input: ::std::option::Option<crate::types::ResourceQuery>) -> Self {
159        self.inner = self.inner.set_resource_query(input);
160        self
161    }
162    /// <p>The resource query to determine which Amazon Web Services resources are members of this resource group.</p><note>
163    /// <p>A resource group can contain either a <code>Configuration</code> or a <code>ResourceQuery</code>, but not both.</p>
164    /// </note>
165    pub fn get_resource_query(&self) -> &::std::option::Option<crate::types::ResourceQuery> {
166        self.inner.get_resource_query()
167    }
168}