#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ReservedInstancesListing {
pub client_token: ::std::option::Option<::std::string::String>,
pub create_date: ::std::option::Option<::aws_smithy_types::DateTime>,
pub instance_counts: ::std::option::Option<::std::vec::Vec<crate::types::InstanceCount>>,
pub price_schedules: ::std::option::Option<::std::vec::Vec<crate::types::PriceSchedule>>,
pub reserved_instances_id: ::std::option::Option<::std::string::String>,
pub reserved_instances_listing_id: ::std::option::Option<::std::string::String>,
pub status: ::std::option::Option<crate::types::ListingStatus>,
pub status_message: ::std::option::Option<::std::string::String>,
pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
pub update_date: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl ReservedInstancesListing {
pub fn client_token(&self) -> ::std::option::Option<&str> {
self.client_token.as_deref()
}
pub fn create_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.create_date.as_ref()
}
pub fn instance_counts(&self) -> ::std::option::Option<&[crate::types::InstanceCount]> {
self.instance_counts.as_deref()
}
pub fn price_schedules(&self) -> ::std::option::Option<&[crate::types::PriceSchedule]> {
self.price_schedules.as_deref()
}
pub fn reserved_instances_id(&self) -> ::std::option::Option<&str> {
self.reserved_instances_id.as_deref()
}
pub fn reserved_instances_listing_id(&self) -> ::std::option::Option<&str> {
self.reserved_instances_listing_id.as_deref()
}
pub fn status(&self) -> ::std::option::Option<&crate::types::ListingStatus> {
self.status.as_ref()
}
pub fn status_message(&self) -> ::std::option::Option<&str> {
self.status_message.as_deref()
}
pub fn tags(&self) -> ::std::option::Option<&[crate::types::Tag]> {
self.tags.as_deref()
}
pub fn update_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.update_date.as_ref()
}
}
impl ReservedInstancesListing {
pub fn builder() -> crate::types::builders::ReservedInstancesListingBuilder {
crate::types::builders::ReservedInstancesListingBuilder::default()
}
}
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct ReservedInstancesListingBuilder {
pub(crate) client_token: ::std::option::Option<::std::string::String>,
pub(crate) create_date: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) instance_counts: ::std::option::Option<::std::vec::Vec<crate::types::InstanceCount>>,
pub(crate) price_schedules: ::std::option::Option<::std::vec::Vec<crate::types::PriceSchedule>>,
pub(crate) reserved_instances_id: ::std::option::Option<::std::string::String>,
pub(crate) reserved_instances_listing_id: ::std::option::Option<::std::string::String>,
pub(crate) status: ::std::option::Option<crate::types::ListingStatus>,
pub(crate) status_message: ::std::option::Option<::std::string::String>,
pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
pub(crate) update_date: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl ReservedInstancesListingBuilder {
pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.client_token = ::std::option::Option::Some(input.into());
self
}
pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.client_token = input;
self
}
pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
&self.client_token
}
pub fn create_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.create_date = ::std::option::Option::Some(input);
self
}
pub fn set_create_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.create_date = input;
self
}
pub fn get_create_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.create_date
}
pub fn instance_counts(mut self, input: crate::types::InstanceCount) -> Self {
let mut v = self.instance_counts.unwrap_or_default();
v.push(input);
self.instance_counts = ::std::option::Option::Some(v);
self
}
pub fn set_instance_counts(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::InstanceCount>>) -> Self {
self.instance_counts = input;
self
}
pub fn get_instance_counts(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InstanceCount>> {
&self.instance_counts
}
pub fn price_schedules(mut self, input: crate::types::PriceSchedule) -> Self {
let mut v = self.price_schedules.unwrap_or_default();
v.push(input);
self.price_schedules = ::std::option::Option::Some(v);
self
}
pub fn set_price_schedules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PriceSchedule>>) -> Self {
self.price_schedules = input;
self
}
pub fn get_price_schedules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PriceSchedule>> {
&self.price_schedules
}
pub fn reserved_instances_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.reserved_instances_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_reserved_instances_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.reserved_instances_id = input;
self
}
pub fn get_reserved_instances_id(&self) -> &::std::option::Option<::std::string::String> {
&self.reserved_instances_id
}
pub fn reserved_instances_listing_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.reserved_instances_listing_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_reserved_instances_listing_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.reserved_instances_listing_id = input;
self
}
pub fn get_reserved_instances_listing_id(&self) -> &::std::option::Option<::std::string::String> {
&self.reserved_instances_listing_id
}
pub fn status(mut self, input: crate::types::ListingStatus) -> Self {
self.status = ::std::option::Option::Some(input);
self
}
pub fn set_status(mut self, input: ::std::option::Option<crate::types::ListingStatus>) -> Self {
self.status = input;
self
}
pub fn get_status(&self) -> &::std::option::Option<crate::types::ListingStatus> {
&self.status
}
pub fn status_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.status_message = ::std::option::Option::Some(input.into());
self
}
pub fn set_status_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.status_message = input;
self
}
pub fn get_status_message(&self) -> &::std::option::Option<::std::string::String> {
&self.status_message
}
pub fn tags(mut self, input: crate::types::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = ::std::option::Option::Some(v);
self
}
pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
self.tags = input;
self
}
pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
&self.tags
}
pub fn update_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.update_date = ::std::option::Option::Some(input);
self
}
pub fn set_update_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.update_date = input;
self
}
pub fn get_update_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.update_date
}
pub fn build(self) -> crate::types::ReservedInstancesListing {
crate::types::ReservedInstancesListing {
client_token: self.client_token,
create_date: self.create_date,
instance_counts: self.instance_counts,
price_schedules: self.price_schedules,
reserved_instances_id: self.reserved_instances_id,
reserved_instances_listing_id: self.reserved_instances_listing_id,
status: self.status,
status_message: self.status_message,
tags: self.tags,
update_date: self.update_date,
}
}
}