aws_sdk_gameliftstreams/operation/update_stream_group/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_stream_group::_update_stream_group_output::UpdateStreamGroupOutputBuilder;
3
4pub use crate::operation::update_stream_group::_update_stream_group_input::UpdateStreamGroupInputBuilder;
5
6impl crate::operation::update_stream_group::builders::UpdateStreamGroupInputBuilder {
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_stream_group::UpdateStreamGroupOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::update_stream_group::UpdateStreamGroupError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.update_stream_group();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `UpdateStreamGroup`.
24///
25/// <p>Updates the configuration settings for an Amazon GameLift Streams stream group resource. To update a stream group, it must be in <code>ACTIVE</code> status. You can change the description, the set of locations, and the requested capacity of a stream group per location. If you want to change the stream class, create a new stream group.</p>
26/// <p>Stream capacity represents the number of concurrent streams that can be active at a time. You set stream capacity per location, per stream group. There are two types of capacity, always-on and on-demand:</p>
27/// <ul>
28/// <li>
29/// <p><b>Always-on</b>: The streaming capacity that is allocated and ready to handle stream requests without delay. You pay for this capacity whether it's in use or not. Best for quickest time from streaming request to streaming session. Default is 1 (2 for high stream classes) when creating a stream group or adding a location.</p></li>
30/// <li>
31/// <p><b>On-demand</b>: The streaming capacity that Amazon GameLift Streams can allocate in response to stream requests, and then de-allocate when the session has terminated. This offers a cost control measure at the expense of a greater startup time (typically under 5 minutes). Default is 0 when creating a stream group or adding a location.</p></li>
32/// </ul>
33/// <p>Values for capacity must be whole number multiples of the tenancy value of the stream group's stream class.</p>
34/// <p>To update a stream group, specify the stream group's Amazon Resource Name (ARN) and provide the new values. If the request is successful, Amazon GameLift Streams returns the complete updated metadata for the stream group. Expired stream groups cannot be updated.</p>
35#[derive(::std::clone::Clone, ::std::fmt::Debug)]
36pub struct UpdateStreamGroupFluentBuilder {
37 handle: ::std::sync::Arc<crate::client::Handle>,
38 inner: crate::operation::update_stream_group::builders::UpdateStreamGroupInputBuilder,
39 config_override: ::std::option::Option<crate::config::Builder>,
40}
41impl
42 crate::client::customize::internal::CustomizableSend<
43 crate::operation::update_stream_group::UpdateStreamGroupOutput,
44 crate::operation::update_stream_group::UpdateStreamGroupError,
45 > for UpdateStreamGroupFluentBuilder
46{
47 fn send(
48 self,
49 config_override: crate::config::Builder,
50 ) -> crate::client::customize::internal::BoxFuture<
51 crate::client::customize::internal::SendResult<
52 crate::operation::update_stream_group::UpdateStreamGroupOutput,
53 crate::operation::update_stream_group::UpdateStreamGroupError,
54 >,
55 > {
56 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
57 }
58}
59impl UpdateStreamGroupFluentBuilder {
60 /// Creates a new `UpdateStreamGroupFluentBuilder`.
61 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
62 Self {
63 handle,
64 inner: ::std::default::Default::default(),
65 config_override: ::std::option::Option::None,
66 }
67 }
68 /// Access the UpdateStreamGroup as a reference.
69 pub fn as_input(&self) -> &crate::operation::update_stream_group::builders::UpdateStreamGroupInputBuilder {
70 &self.inner
71 }
72 /// Sends the request and returns the response.
73 ///
74 /// If an error occurs, an `SdkError` will be returned with additional details that
75 /// can be matched against.
76 ///
77 /// By default, any retryable failures will be retried twice. Retry behavior
78 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
79 /// set when configuring the client.
80 pub async fn send(
81 self,
82 ) -> ::std::result::Result<
83 crate::operation::update_stream_group::UpdateStreamGroupOutput,
84 ::aws_smithy_runtime_api::client::result::SdkError<
85 crate::operation::update_stream_group::UpdateStreamGroupError,
86 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
87 >,
88 > {
89 let input = self
90 .inner
91 .build()
92 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
93 let runtime_plugins = crate::operation::update_stream_group::UpdateStreamGroup::operation_runtime_plugins(
94 self.handle.runtime_plugins.clone(),
95 &self.handle.conf,
96 self.config_override,
97 );
98 crate::operation::update_stream_group::UpdateStreamGroup::orchestrate(&runtime_plugins, input).await
99 }
100
101 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
102 pub fn customize(
103 self,
104 ) -> crate::client::customize::CustomizableOperation<
105 crate::operation::update_stream_group::UpdateStreamGroupOutput,
106 crate::operation::update_stream_group::UpdateStreamGroupError,
107 Self,
108 > {
109 crate::client::customize::CustomizableOperation::new(self)
110 }
111 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
112 self.set_config_override(::std::option::Option::Some(config_override.into()));
113 self
114 }
115
116 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
117 self.config_override = config_override;
118 self
119 }
120 /// <p>An <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html">Amazon Resource Name (ARN)</a> or ID that uniquely identifies the stream group resource. Example ARN: <code>arn:aws:gameliftstreams:us-west-2:111122223333:streamgroup/sg-1AB2C3De4</code>. Example ID: <code>sg-1AB2C3De4</code>.</p>
121 pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122 self.inner = self.inner.identifier(input.into());
123 self
124 }
125 /// <p>An <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html">Amazon Resource Name (ARN)</a> or ID that uniquely identifies the stream group resource. Example ARN: <code>arn:aws:gameliftstreams:us-west-2:111122223333:streamgroup/sg-1AB2C3De4</code>. Example ID: <code>sg-1AB2C3De4</code>.</p>
126 pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127 self.inner = self.inner.set_identifier(input);
128 self
129 }
130 /// <p>An <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html">Amazon Resource Name (ARN)</a> or ID that uniquely identifies the stream group resource. Example ARN: <code>arn:aws:gameliftstreams:us-west-2:111122223333:streamgroup/sg-1AB2C3De4</code>. Example ID: <code>sg-1AB2C3De4</code>.</p>
131 pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
132 self.inner.get_identifier()
133 }
134 ///
135 /// Appends an item to `LocationConfigurations`.
136 ///
137 /// To override the contents of this collection use [`set_location_configurations`](Self::set_location_configurations).
138 ///
139 /// <p>A set of one or more locations and the streaming capacity for each location.</p>
140 pub fn location_configurations(mut self, input: crate::types::LocationConfiguration) -> Self {
141 self.inner = self.inner.location_configurations(input);
142 self
143 }
144 /// <p>A set of one or more locations and the streaming capacity for each location.</p>
145 pub fn set_location_configurations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LocationConfiguration>>) -> Self {
146 self.inner = self.inner.set_location_configurations(input);
147 self
148 }
149 /// <p>A set of one or more locations and the streaming capacity for each location.</p>
150 pub fn get_location_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LocationConfiguration>> {
151 self.inner.get_location_configurations()
152 }
153 /// <p>A descriptive label for the stream group.</p>
154 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155 self.inner = self.inner.description(input.into());
156 self
157 }
158 /// <p>A descriptive label for the stream group.</p>
159 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160 self.inner = self.inner.set_description(input);
161 self
162 }
163 /// <p>A descriptive label for the stream group.</p>
164 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
165 self.inner.get_description()
166 }
167 /// <p>The unique identifier of the Amazon GameLift Streams application that you want to set as the default application in a stream group. The application that you specify must be in <code>READY</code> status. The default application is pre-cached on always-on compute resources, reducing stream startup times. Other applications are automatically cached as needed.</p>
168 /// <p>Note that this parameter only sets the default application in a stream group. To associate a new application to an existing stream group, you must use <a href="https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_AssociateApplications.html">AssociateApplications</a>.</p>
169 /// <p>When you switch default applications in a stream group, it can take up to a few hours for the new default application to be pre-cached.</p>
170 /// <p>This value is an <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html">Amazon Resource Name (ARN)</a> or ID that uniquely identifies the application resource. Example ARN: <code>arn:aws:gameliftstreams:us-west-2:111122223333:application/a-9ZY8X7Wv6</code>. Example ID: <code>a-9ZY8X7Wv6</code>.</p>
171 pub fn default_application_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172 self.inner = self.inner.default_application_identifier(input.into());
173 self
174 }
175 /// <p>The unique identifier of the Amazon GameLift Streams application that you want to set as the default application in a stream group. The application that you specify must be in <code>READY</code> status. The default application is pre-cached on always-on compute resources, reducing stream startup times. Other applications are automatically cached as needed.</p>
176 /// <p>Note that this parameter only sets the default application in a stream group. To associate a new application to an existing stream group, you must use <a href="https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_AssociateApplications.html">AssociateApplications</a>.</p>
177 /// <p>When you switch default applications in a stream group, it can take up to a few hours for the new default application to be pre-cached.</p>
178 /// <p>This value is an <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html">Amazon Resource Name (ARN)</a> or ID that uniquely identifies the application resource. Example ARN: <code>arn:aws:gameliftstreams:us-west-2:111122223333:application/a-9ZY8X7Wv6</code>. Example ID: <code>a-9ZY8X7Wv6</code>.</p>
179 pub fn set_default_application_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
180 self.inner = self.inner.set_default_application_identifier(input);
181 self
182 }
183 /// <p>The unique identifier of the Amazon GameLift Streams application that you want to set as the default application in a stream group. The application that you specify must be in <code>READY</code> status. The default application is pre-cached on always-on compute resources, reducing stream startup times. Other applications are automatically cached as needed.</p>
184 /// <p>Note that this parameter only sets the default application in a stream group. To associate a new application to an existing stream group, you must use <a href="https://docs.aws.amazon.com/gameliftstreams/latest/apireference/API_AssociateApplications.html">AssociateApplications</a>.</p>
185 /// <p>When you switch default applications in a stream group, it can take up to a few hours for the new default application to be pre-cached.</p>
186 /// <p>This value is an <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html">Amazon Resource Name (ARN)</a> or ID that uniquely identifies the application resource. Example ARN: <code>arn:aws:gameliftstreams:us-west-2:111122223333:application/a-9ZY8X7Wv6</code>. Example ID: <code>a-9ZY8X7Wv6</code>.</p>
187 pub fn get_default_application_identifier(&self) -> &::std::option::Option<::std::string::String> {
188 self.inner.get_default_application_identifier()
189 }
190}