aws_sdk_gamelift/operation/update_script/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_script::_update_script_output::UpdateScriptOutputBuilder;
3
4pub use crate::operation::update_script::_update_script_input::UpdateScriptInputBuilder;
5
6impl crate::operation::update_script::builders::UpdateScriptInputBuilder {
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_script::UpdateScriptOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_script::UpdateScriptError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_script();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateScript`.
24///
25/// <p><b>This API works with the following fleet types:</b> EC2</p>
26/// <p>Updates Realtime script metadata and content.</p>
27/// <p>To update script metadata, specify the script ID and provide updated name and/or version values.</p>
28/// <p>To update script content, provide an updated zip file by pointing to either a local file or an Amazon S3 bucket location. You can use either method regardless of how the original script was uploaded. Use the <i>Version</i> parameter to track updates to the script.</p>
29/// <p>If the call is successful, the updated metadata is stored in the script record and a revised script is uploaded to the Amazon GameLift Servers service. Once the script is updated and acquired by a fleet instance, the new version is used for all new game sessions.</p>
30/// <p><b>Learn more</b></p>
31/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/realtime-intro.html">Amazon GameLift Servers Amazon GameLift Servers Realtime</a></p>
32/// <p><b>Related actions</b></p>
33/// <p><a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets">All APIs by task</a></p>
34#[derive(::std::clone::Clone, ::std::fmt::Debug)]
35pub struct UpdateScriptFluentBuilder {
36    handle: ::std::sync::Arc<crate::client::Handle>,
37    inner: crate::operation::update_script::builders::UpdateScriptInputBuilder,
38    config_override: ::std::option::Option<crate::config::Builder>,
39}
40impl
41    crate::client::customize::internal::CustomizableSend<
42        crate::operation::update_script::UpdateScriptOutput,
43        crate::operation::update_script::UpdateScriptError,
44    > for UpdateScriptFluentBuilder
45{
46    fn send(
47        self,
48        config_override: crate::config::Builder,
49    ) -> crate::client::customize::internal::BoxFuture<
50        crate::client::customize::internal::SendResult<
51            crate::operation::update_script::UpdateScriptOutput,
52            crate::operation::update_script::UpdateScriptError,
53        >,
54    > {
55        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
56    }
57}
58impl UpdateScriptFluentBuilder {
59    /// Creates a new `UpdateScriptFluentBuilder`.
60    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
61        Self {
62            handle,
63            inner: ::std::default::Default::default(),
64            config_override: ::std::option::Option::None,
65        }
66    }
67    /// Access the UpdateScript as a reference.
68    pub fn as_input(&self) -> &crate::operation::update_script::builders::UpdateScriptInputBuilder {
69        &self.inner
70    }
71    /// Sends the request and returns the response.
72    ///
73    /// If an error occurs, an `SdkError` will be returned with additional details that
74    /// can be matched against.
75    ///
76    /// By default, any retryable failures will be retried twice. Retry behavior
77    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
78    /// set when configuring the client.
79    pub async fn send(
80        self,
81    ) -> ::std::result::Result<
82        crate::operation::update_script::UpdateScriptOutput,
83        ::aws_smithy_runtime_api::client::result::SdkError<
84            crate::operation::update_script::UpdateScriptError,
85            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
86        >,
87    > {
88        let input = self
89            .inner
90            .build()
91            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
92        let runtime_plugins = crate::operation::update_script::UpdateScript::operation_runtime_plugins(
93            self.handle.runtime_plugins.clone(),
94            &self.handle.conf,
95            self.config_override,
96        );
97        crate::operation::update_script::UpdateScript::orchestrate(&runtime_plugins, input).await
98    }
99
100    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
101    pub fn customize(
102        self,
103    ) -> crate::client::customize::CustomizableOperation<
104        crate::operation::update_script::UpdateScriptOutput,
105        crate::operation::update_script::UpdateScriptError,
106        Self,
107    > {
108        crate::client::customize::CustomizableOperation::new(self)
109    }
110    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
111        self.set_config_override(::std::option::Option::Some(config_override.into()));
112        self
113    }
114
115    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
116        self.config_override = config_override;
117        self
118    }
119    /// <p>A unique identifier for the Realtime script to update. You can use either the script ID or ARN value.</p>
120    pub fn script_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.inner = self.inner.script_id(input.into());
122        self
123    }
124    /// <p>A unique identifier for the Realtime script to update. You can use either the script ID or ARN value.</p>
125    pub fn set_script_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126        self.inner = self.inner.set_script_id(input);
127        self
128    }
129    /// <p>A unique identifier for the Realtime script to update. You can use either the script ID or ARN value.</p>
130    pub fn get_script_id(&self) -> &::std::option::Option<::std::string::String> {
131        self.inner.get_script_id()
132    }
133    /// <p>A descriptive label that is associated with a script. Script names do not need to be unique.</p>
134    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.inner = self.inner.name(input.into());
136        self
137    }
138    /// <p>A descriptive label that is associated with a script. Script names do not need to be unique.</p>
139    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140        self.inner = self.inner.set_name(input);
141        self
142    }
143    /// <p>A descriptive label that is associated with a script. Script names do not need to be unique.</p>
144    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
145        self.inner.get_name()
146    }
147    /// <p>Version information that is associated with a build or script. Version strings do not need to be unique.</p>
148    pub fn version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149        self.inner = self.inner.version(input.into());
150        self
151    }
152    /// <p>Version information that is associated with a build or script. Version strings do not need to be unique.</p>
153    pub fn set_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154        self.inner = self.inner.set_version(input);
155        self
156    }
157    /// <p>Version information that is associated with a build or script. Version strings do not need to be unique.</p>
158    pub fn get_version(&self) -> &::std::option::Option<::std::string::String> {
159        self.inner.get_version()
160    }
161    /// <p>The location of the Amazon S3 bucket where a zipped file containing your Realtime scripts is stored. The storage location must specify the Amazon S3 bucket name, the zip file name (the "key"), and a role ARN that allows Amazon GameLift Servers to access the Amazon S3 storage location. The S3 bucket must be in the same Region where you want to create a new script. By default, Amazon GameLift Servers uploads the latest version of the zip file; if you have S3 object versioning turned on, you can use the <code>ObjectVersion</code> parameter to specify an earlier version.</p>
162    pub fn storage_location(mut self, input: crate::types::S3Location) -> Self {
163        self.inner = self.inner.storage_location(input);
164        self
165    }
166    /// <p>The location of the Amazon S3 bucket where a zipped file containing your Realtime scripts is stored. The storage location must specify the Amazon S3 bucket name, the zip file name (the "key"), and a role ARN that allows Amazon GameLift Servers to access the Amazon S3 storage location. The S3 bucket must be in the same Region where you want to create a new script. By default, Amazon GameLift Servers uploads the latest version of the zip file; if you have S3 object versioning turned on, you can use the <code>ObjectVersion</code> parameter to specify an earlier version.</p>
167    pub fn set_storage_location(mut self, input: ::std::option::Option<crate::types::S3Location>) -> Self {
168        self.inner = self.inner.set_storage_location(input);
169        self
170    }
171    /// <p>The location of the Amazon S3 bucket where a zipped file containing your Realtime scripts is stored. The storage location must specify the Amazon S3 bucket name, the zip file name (the "key"), and a role ARN that allows Amazon GameLift Servers to access the Amazon S3 storage location. The S3 bucket must be in the same Region where you want to create a new script. By default, Amazon GameLift Servers uploads the latest version of the zip file; if you have S3 object versioning turned on, you can use the <code>ObjectVersion</code> parameter to specify an earlier version.</p>
172    pub fn get_storage_location(&self) -> &::std::option::Option<crate::types::S3Location> {
173        self.inner.get_storage_location()
174    }
175    /// <p>A data object containing your Realtime scripts and dependencies as a zip file. The zip file can have one or multiple files. Maximum size of a zip file is 5 MB.</p>
176    /// <p>When using the Amazon Web Services CLI tool to create a script, this parameter is set to the zip file name. It must be prepended with the string "fileb://" to indicate that the file data is a binary object. For example: <code>--zip-file fileb://myRealtimeScript.zip</code>.</p>
177    pub fn zip_file(mut self, input: ::aws_smithy_types::Blob) -> Self {
178        self.inner = self.inner.zip_file(input);
179        self
180    }
181    /// <p>A data object containing your Realtime scripts and dependencies as a zip file. The zip file can have one or multiple files. Maximum size of a zip file is 5 MB.</p>
182    /// <p>When using the Amazon Web Services CLI tool to create a script, this parameter is set to the zip file name. It must be prepended with the string "fileb://" to indicate that the file data is a binary object. For example: <code>--zip-file fileb://myRealtimeScript.zip</code>.</p>
183    pub fn set_zip_file(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
184        self.inner = self.inner.set_zip_file(input);
185        self
186    }
187    /// <p>A data object containing your Realtime scripts and dependencies as a zip file. The zip file can have one or multiple files. Maximum size of a zip file is 5 MB.</p>
188    /// <p>When using the Amazon Web Services CLI tool to create a script, this parameter is set to the zip file name. It must be prepended with the string "fileb://" to indicate that the file data is a binary object. For example: <code>--zip-file fileb://myRealtimeScript.zip</code>.</p>
189    pub fn get_zip_file(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
190        self.inner.get_zip_file()
191    }
192}