aws_sdk_gamelift/operation/create_matchmaking_rule_set/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_matchmaking_rule_set::_create_matchmaking_rule_set_output::CreateMatchmakingRuleSetOutputBuilder;
3
4pub use crate::operation::create_matchmaking_rule_set::_create_matchmaking_rule_set_input::CreateMatchmakingRuleSetInputBuilder;
5
6impl crate::operation::create_matchmaking_rule_set::builders::CreateMatchmakingRuleSetInputBuilder {
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_matchmaking_rule_set::CreateMatchmakingRuleSetOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_matchmaking_rule_set::CreateMatchmakingRuleSetError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_matchmaking_rule_set();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateMatchmakingRuleSet`.
24///
25/// <p><b>This API works with the following fleet types:</b> EC2, Anywhere, Container</p>
26/// <p>Creates a new rule set for FlexMatch matchmaking. A rule set describes the type of match to create, such as the number and size of teams. It also sets the parameters for acceptable player matches, such as minimum skill level or character type.</p>
27/// <p>To create a matchmaking rule set, provide unique rule set name and the rule set body in JSON format. Rule sets must be defined in the same Region as the matchmaking configuration they are used with.</p>
28/// <p>Since matchmaking rule sets cannot be edited, it is a good idea to check the rule set syntax using <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_ValidateMatchmakingRuleSet.html">ValidateMatchmakingRuleSet</a> before creating a new rule set.</p>
29/// <p><b>Learn more</b></p>
30/// <ul>
31/// <li>
32/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-rulesets.html">Build a rule set</a></p></li>
33/// <li>
34/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-configuration.html">Design a matchmaker</a></p></li>
35/// <li>
36/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/flexmatchguide/match-intro.html">Matchmaking with FlexMatch</a></p></li>
37/// </ul>
38#[derive(::std::clone::Clone, ::std::fmt::Debug)]
39pub struct CreateMatchmakingRuleSetFluentBuilder {
40    handle: ::std::sync::Arc<crate::client::Handle>,
41    inner: crate::operation::create_matchmaking_rule_set::builders::CreateMatchmakingRuleSetInputBuilder,
42    config_override: ::std::option::Option<crate::config::Builder>,
43}
44impl
45    crate::client::customize::internal::CustomizableSend<
46        crate::operation::create_matchmaking_rule_set::CreateMatchmakingRuleSetOutput,
47        crate::operation::create_matchmaking_rule_set::CreateMatchmakingRuleSetError,
48    > for CreateMatchmakingRuleSetFluentBuilder
49{
50    fn send(
51        self,
52        config_override: crate::config::Builder,
53    ) -> crate::client::customize::internal::BoxFuture<
54        crate::client::customize::internal::SendResult<
55            crate::operation::create_matchmaking_rule_set::CreateMatchmakingRuleSetOutput,
56            crate::operation::create_matchmaking_rule_set::CreateMatchmakingRuleSetError,
57        >,
58    > {
59        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
60    }
61}
62impl CreateMatchmakingRuleSetFluentBuilder {
63    /// Creates a new `CreateMatchmakingRuleSetFluentBuilder`.
64    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
65        Self {
66            handle,
67            inner: ::std::default::Default::default(),
68            config_override: ::std::option::Option::None,
69        }
70    }
71    /// Access the CreateMatchmakingRuleSet as a reference.
72    pub fn as_input(&self) -> &crate::operation::create_matchmaking_rule_set::builders::CreateMatchmakingRuleSetInputBuilder {
73        &self.inner
74    }
75    /// Sends the request and returns the response.
76    ///
77    /// If an error occurs, an `SdkError` will be returned with additional details that
78    /// can be matched against.
79    ///
80    /// By default, any retryable failures will be retried twice. Retry behavior
81    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
82    /// set when configuring the client.
83    pub async fn send(
84        self,
85    ) -> ::std::result::Result<
86        crate::operation::create_matchmaking_rule_set::CreateMatchmakingRuleSetOutput,
87        ::aws_smithy_runtime_api::client::result::SdkError<
88            crate::operation::create_matchmaking_rule_set::CreateMatchmakingRuleSetError,
89            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
90        >,
91    > {
92        let input = self
93            .inner
94            .build()
95            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
96        let runtime_plugins = crate::operation::create_matchmaking_rule_set::CreateMatchmakingRuleSet::operation_runtime_plugins(
97            self.handle.runtime_plugins.clone(),
98            &self.handle.conf,
99            self.config_override,
100        );
101        crate::operation::create_matchmaking_rule_set::CreateMatchmakingRuleSet::orchestrate(&runtime_plugins, input).await
102    }
103
104    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
105    pub fn customize(
106        self,
107    ) -> crate::client::customize::CustomizableOperation<
108        crate::operation::create_matchmaking_rule_set::CreateMatchmakingRuleSetOutput,
109        crate::operation::create_matchmaking_rule_set::CreateMatchmakingRuleSetError,
110        Self,
111    > {
112        crate::client::customize::CustomizableOperation::new(self)
113    }
114    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
115        self.set_config_override(::std::option::Option::Some(config_override.into()));
116        self
117    }
118
119    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
120        self.config_override = config_override;
121        self
122    }
123    /// <p>A unique identifier for the matchmaking rule set. A matchmaking configuration identifies the rule set it uses by this name value. Note that the rule set name is different from the optional <code>name</code> field in the rule set body.</p>
124    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125        self.inner = self.inner.name(input.into());
126        self
127    }
128    /// <p>A unique identifier for the matchmaking rule set. A matchmaking configuration identifies the rule set it uses by this name value. Note that the rule set name is different from the optional <code>name</code> field in the rule set body.</p>
129    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130        self.inner = self.inner.set_name(input);
131        self
132    }
133    /// <p>A unique identifier for the matchmaking rule set. A matchmaking configuration identifies the rule set it uses by this name value. Note that the rule set name is different from the optional <code>name</code> field in the rule set body.</p>
134    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
135        self.inner.get_name()
136    }
137    /// <p>A collection of matchmaking rules, formatted as a JSON string. Comments are not allowed in JSON, but most elements support a description field.</p>
138    pub fn rule_set_body(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
139        self.inner = self.inner.rule_set_body(input.into());
140        self
141    }
142    /// <p>A collection of matchmaking rules, formatted as a JSON string. Comments are not allowed in JSON, but most elements support a description field.</p>
143    pub fn set_rule_set_body(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
144        self.inner = self.inner.set_rule_set_body(input);
145        self
146    }
147    /// <p>A collection of matchmaking rules, formatted as a JSON string. Comments are not allowed in JSON, but most elements support a description field.</p>
148    pub fn get_rule_set_body(&self) -> &::std::option::Option<::std::string::String> {
149        self.inner.get_rule_set_body()
150    }
151    ///
152    /// Appends an item to `Tags`.
153    ///
154    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
155    ///
156    /// <p>A list of labels to assign to the new matchmaking rule set resource. Tags are developer-defined key-value pairs. Tagging Amazon Web Services resources are useful for resource management, access management and cost allocation. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html"> Tagging Amazon Web Services Resources</a> in the <i>Amazon Web Services General Reference</i>.</p>
157    pub fn tags(mut self, input: crate::types::Tag) -> Self {
158        self.inner = self.inner.tags(input);
159        self
160    }
161    /// <p>A list of labels to assign to the new matchmaking rule set resource. Tags are developer-defined key-value pairs. Tagging Amazon Web Services resources are useful for resource management, access management and cost allocation. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html"> Tagging Amazon Web Services Resources</a> in the <i>Amazon Web Services General Reference</i>.</p>
162    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
163        self.inner = self.inner.set_tags(input);
164        self
165    }
166    /// <p>A list of labels to assign to the new matchmaking rule set resource. Tags are developer-defined key-value pairs. Tagging Amazon Web Services resources are useful for resource management, access management and cost allocation. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html"> Tagging Amazon Web Services Resources</a> in the <i>Amazon Web Services General Reference</i>.</p>
167    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
168        self.inner.get_tags()
169    }
170}