#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Asset {
pub asset_id: ::std::string::String,
pub asset_type: ::std::string::String,
pub metadata: ::aws_smithy_types::Document,
pub version: i32,
pub created_at: ::aws_smithy_types::DateTime,
pub updated_at: ::aws_smithy_types::DateTime,
}
impl Asset {
pub fn asset_id(&self) -> &str {
use std::ops::Deref;
self.asset_id.deref()
}
pub fn asset_type(&self) -> &str {
use std::ops::Deref;
self.asset_type.deref()
}
pub fn metadata(&self) -> &::aws_smithy_types::Document {
&self.metadata
}
pub fn version(&self) -> i32 {
self.version
}
pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
&self.created_at
}
pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
&self.updated_at
}
}
impl Asset {
pub fn builder() -> crate::types::builders::AssetBuilder {
crate::types::builders::AssetBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct AssetBuilder {
pub(crate) asset_id: ::std::option::Option<::std::string::String>,
pub(crate) asset_type: ::std::option::Option<::std::string::String>,
pub(crate) metadata: ::std::option::Option<::aws_smithy_types::Document>,
pub(crate) version: ::std::option::Option<i32>,
pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl AssetBuilder {
pub fn asset_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.asset_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_asset_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.asset_id = input;
self
}
pub fn get_asset_id(&self) -> &::std::option::Option<::std::string::String> {
&self.asset_id
}
pub fn asset_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.asset_type = ::std::option::Option::Some(input.into());
self
}
pub fn set_asset_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.asset_type = input;
self
}
pub fn get_asset_type(&self) -> &::std::option::Option<::std::string::String> {
&self.asset_type
}
pub fn metadata(mut self, input: ::aws_smithy_types::Document) -> Self {
self.metadata = ::std::option::Option::Some(input);
self
}
pub fn set_metadata(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
self.metadata = input;
self
}
pub fn get_metadata(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
&self.metadata
}
pub fn version(mut self, input: i32) -> Self {
self.version = ::std::option::Option::Some(input);
self
}
pub fn set_version(mut self, input: ::std::option::Option<i32>) -> Self {
self.version = input;
self
}
pub fn get_version(&self) -> &::std::option::Option<i32> {
&self.version
}
pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.created_at = ::std::option::Option::Some(input);
self
}
pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.created_at = input;
self
}
pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.created_at
}
pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.updated_at = ::std::option::Option::Some(input);
self
}
pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.updated_at = input;
self
}
pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.updated_at
}
pub fn build(self) -> ::std::result::Result<crate::types::Asset, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Asset {
asset_id: self.asset_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"asset_id",
"asset_id was not specified but it is required when building Asset",
)
})?,
asset_type: self.asset_type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"asset_type",
"asset_type was not specified but it is required when building Asset",
)
})?,
metadata: self.metadata.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"metadata",
"metadata was not specified but it is required when building Asset",
)
})?,
version: self.version.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"version",
"version was not specified but it is required when building Asset",
)
})?,
created_at: self.created_at.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"created_at",
"created_at was not specified but it is required when building Asset",
)
})?,
updated_at: self.updated_at.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"updated_at",
"updated_at was not specified but it is required when building Asset",
)
})?,
})
}
}