#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Script {
pub script_location: ::std::string::String,
pub r#type: crate::types::ScriptType,
}
impl Script {
pub fn script_location(&self) -> &str {
use std::ops::Deref;
self.script_location.deref()
}
pub fn r#type(&self) -> &crate::types::ScriptType {
&self.r#type
}
}
impl Script {
pub fn builder() -> crate::types::builders::ScriptBuilder {
crate::types::builders::ScriptBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ScriptBuilder {
pub(crate) script_location: ::std::option::Option<::std::string::String>,
pub(crate) r#type: ::std::option::Option<crate::types::ScriptType>,
}
impl ScriptBuilder {
pub fn script_location(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.script_location = ::std::option::Option::Some(input.into());
self
}
pub fn set_script_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.script_location = input;
self
}
pub fn get_script_location(&self) -> &::std::option::Option<::std::string::String> {
&self.script_location
}
pub fn r#type(mut self, input: crate::types::ScriptType) -> Self {
self.r#type = ::std::option::Option::Some(input);
self
}
pub fn set_type(mut self, input: ::std::option::Option<crate::types::ScriptType>) -> Self {
self.r#type = input;
self
}
pub fn get_type(&self) -> &::std::option::Option<crate::types::ScriptType> {
&self.r#type
}
pub fn build(self) -> ::std::result::Result<crate::types::Script, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Script {
script_location: self.script_location.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"script_location",
"script_location was not specified but it is required when building Script",
)
})?,
r#type: self.r#type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"r#type",
"r#type was not specified but it is required when building Script",
)
})?,
})
}
}