// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Properties describing a Realtime script.</p>
/// <p> <b>Related actions</b> </p>
/// <p> <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets">All APIs by task</a> </p>
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct Script {
/// <p>A unique identifier for the Realtime script</p>
#[doc(hidden)]
pub script_id: std::option::Option<std::string::String>,
/// <p>The Amazon Resource Name (<a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html">ARN</a>) that is assigned to a GameLift script resource and uniquely identifies it. ARNs are unique across all Regions. In a GameLift script ARN, the resource ID matches the <i>ScriptId</i> value.</p>
#[doc(hidden)]
pub script_arn: std::option::Option<std::string::String>,
/// <p>A descriptive label that is associated with a script. Script names do not need to be unique.</p>
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
/// <p>Version information associated with a build or script. Version strings do not need to be unique.</p>
#[doc(hidden)]
pub version: std::option::Option<std::string::String>,
/// <p>The file size of the uploaded Realtime script, expressed in bytes. When files are uploaded from an S3 location, this value remains at "0".</p>
#[doc(hidden)]
pub size_on_disk: std::option::Option<i64>,
/// <p>A time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (for example <code>"1469498468.057"</code>).</p>
#[doc(hidden)]
pub creation_time: std::option::Option<aws_smithy_types::DateTime>,
/// <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 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 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>
#[doc(hidden)]
pub storage_location: std::option::Option<crate::types::S3Location>,
}
impl Script {
/// <p>A unique identifier for the Realtime script</p>
pub fn script_id(&self) -> std::option::Option<&str> {
self.script_id.as_deref()
}
/// <p>The Amazon Resource Name (<a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html">ARN</a>) that is assigned to a GameLift script resource and uniquely identifies it. ARNs are unique across all Regions. In a GameLift script ARN, the resource ID matches the <i>ScriptId</i> value.</p>
pub fn script_arn(&self) -> std::option::Option<&str> {
self.script_arn.as_deref()
}
/// <p>A descriptive label that is associated with a script. Script names do not need to be unique.</p>
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
/// <p>Version information associated with a build or script. Version strings do not need to be unique.</p>
pub fn version(&self) -> std::option::Option<&str> {
self.version.as_deref()
}
/// <p>The file size of the uploaded Realtime script, expressed in bytes. When files are uploaded from an S3 location, this value remains at "0".</p>
pub fn size_on_disk(&self) -> std::option::Option<i64> {
self.size_on_disk
}
/// <p>A time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (for example <code>"1469498468.057"</code>).</p>
pub fn creation_time(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.creation_time.as_ref()
}
/// <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 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 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>
pub fn storage_location(&self) -> std::option::Option<&crate::types::S3Location> {
self.storage_location.as_ref()
}
}
impl Script {
/// Creates a new builder-style object to manufacture [`Script`](crate::types::Script).
pub fn builder() -> crate::types::builders::ScriptBuilder {
crate::types::builders::ScriptBuilder::default()
}
}
/// A builder for [`Script`](crate::types::Script).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct ScriptBuilder {
pub(crate) script_id: std::option::Option<std::string::String>,
pub(crate) script_arn: std::option::Option<std::string::String>,
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) version: std::option::Option<std::string::String>,
pub(crate) size_on_disk: std::option::Option<i64>,
pub(crate) creation_time: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) storage_location: std::option::Option<crate::types::S3Location>,
}
impl ScriptBuilder {
/// <p>A unique identifier for the Realtime script</p>
pub fn script_id(mut self, input: impl Into<std::string::String>) -> Self {
self.script_id = Some(input.into());
self
}
/// <p>A unique identifier for the Realtime script</p>
pub fn set_script_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.script_id = input;
self
}
/// <p>The Amazon Resource Name (<a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html">ARN</a>) that is assigned to a GameLift script resource and uniquely identifies it. ARNs are unique across all Regions. In a GameLift script ARN, the resource ID matches the <i>ScriptId</i> value.</p>
pub fn script_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.script_arn = Some(input.into());
self
}
/// <p>The Amazon Resource Name (<a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html">ARN</a>) that is assigned to a GameLift script resource and uniquely identifies it. ARNs are unique across all Regions. In a GameLift script ARN, the resource ID matches the <i>ScriptId</i> value.</p>
pub fn set_script_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.script_arn = input;
self
}
/// <p>A descriptive label that is associated with a script. Script names do not need to be unique.</p>
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
/// <p>A descriptive label that is associated with a script. Script names do not need to be unique.</p>
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
/// <p>Version information associated with a build or script. Version strings do not need to be unique.</p>
pub fn version(mut self, input: impl Into<std::string::String>) -> Self {
self.version = Some(input.into());
self
}
/// <p>Version information associated with a build or script. Version strings do not need to be unique.</p>
pub fn set_version(mut self, input: std::option::Option<std::string::String>) -> Self {
self.version = input;
self
}
/// <p>The file size of the uploaded Realtime script, expressed in bytes. When files are uploaded from an S3 location, this value remains at "0".</p>
pub fn size_on_disk(mut self, input: i64) -> Self {
self.size_on_disk = Some(input);
self
}
/// <p>The file size of the uploaded Realtime script, expressed in bytes. When files are uploaded from an S3 location, this value remains at "0".</p>
pub fn set_size_on_disk(mut self, input: std::option::Option<i64>) -> Self {
self.size_on_disk = input;
self
}
/// <p>A time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (for example <code>"1469498468.057"</code>).</p>
pub fn creation_time(mut self, input: aws_smithy_types::DateTime) -> Self {
self.creation_time = Some(input);
self
}
/// <p>A time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (for example <code>"1469498468.057"</code>).</p>
pub fn set_creation_time(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.creation_time = input;
self
}
/// <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 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 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>
pub fn storage_location(mut self, input: crate::types::S3Location) -> Self {
self.storage_location = Some(input);
self
}
/// <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 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 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>
pub fn set_storage_location(
mut self,
input: std::option::Option<crate::types::S3Location>,
) -> Self {
self.storage_location = input;
self
}
/// Consumes the builder and constructs a [`Script`](crate::types::Script).
pub fn build(self) -> crate::types::Script {
crate::types::Script {
script_id: self.script_id,
script_arn: self.script_arn,
name: self.name,
version: self.version,
size_on_disk: self.size_on_disk,
creation_time: self.creation_time,
storage_location: self.storage_location,
}
}
}