aws-sdk-medialive 1.76.0

AWS SDK for AWS Elemental MediaLive
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// Reserved resources available for purchase
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Offering {
    /// Unique offering ARN, e.g. 'arn:aws:medialive:us-west-2:123456789012:offering:87654321'
    pub arn: ::std::option::Option<::std::string::String>,
    /// Currency code for usagePrice and fixedPrice in ISO-4217 format, e.g. 'USD'
    pub currency_code: ::std::option::Option<::std::string::String>,
    /// Lease duration, e.g. '12'
    pub duration: ::std::option::Option<i32>,
    /// Units for duration, e.g. 'MONTHS'
    pub duration_units: ::std::option::Option<crate::types::OfferingDurationUnits>,
    /// One-time charge for each reserved resource, e.g. '0.0' for a NO_UPFRONT offering
    pub fixed_price: ::std::option::Option<f64>,
    /// Offering description, e.g. 'HD AVC output at 10-20 Mbps, 30 fps, and standard VQ in US West (Oregon)'
    pub offering_description: ::std::option::Option<::std::string::String>,
    /// Unique offering ID, e.g. '87654321'
    pub offering_id: ::std::option::Option<::std::string::String>,
    /// Offering type, e.g. 'NO_UPFRONT'
    pub offering_type: ::std::option::Option<crate::types::OfferingType>,
    /// AWS region, e.g. 'us-west-2'
    pub region: ::std::option::Option<::std::string::String>,
    /// Resource configuration details
    pub resource_specification: ::std::option::Option<crate::types::ReservationResourceSpecification>,
    /// Recurring usage charge for each reserved resource, e.g. '157.0'
    pub usage_price: ::std::option::Option<f64>,
}
impl Offering {
    /// Unique offering ARN, e.g. 'arn:aws:medialive:us-west-2:123456789012:offering:87654321'
    pub fn arn(&self) -> ::std::option::Option<&str> {
        self.arn.as_deref()
    }
    /// Currency code for usagePrice and fixedPrice in ISO-4217 format, e.g. 'USD'
    pub fn currency_code(&self) -> ::std::option::Option<&str> {
        self.currency_code.as_deref()
    }
    /// Lease duration, e.g. '12'
    pub fn duration(&self) -> ::std::option::Option<i32> {
        self.duration
    }
    /// Units for duration, e.g. 'MONTHS'
    pub fn duration_units(&self) -> ::std::option::Option<&crate::types::OfferingDurationUnits> {
        self.duration_units.as_ref()
    }
    /// One-time charge for each reserved resource, e.g. '0.0' for a NO_UPFRONT offering
    pub fn fixed_price(&self) -> ::std::option::Option<f64> {
        self.fixed_price
    }
    /// Offering description, e.g. 'HD AVC output at 10-20 Mbps, 30 fps, and standard VQ in US West (Oregon)'
    pub fn offering_description(&self) -> ::std::option::Option<&str> {
        self.offering_description.as_deref()
    }
    /// Unique offering ID, e.g. '87654321'
    pub fn offering_id(&self) -> ::std::option::Option<&str> {
        self.offering_id.as_deref()
    }
    /// Offering type, e.g. 'NO_UPFRONT'
    pub fn offering_type(&self) -> ::std::option::Option<&crate::types::OfferingType> {
        self.offering_type.as_ref()
    }
    /// AWS region, e.g. 'us-west-2'
    pub fn region(&self) -> ::std::option::Option<&str> {
        self.region.as_deref()
    }
    /// Resource configuration details
    pub fn resource_specification(&self) -> ::std::option::Option<&crate::types::ReservationResourceSpecification> {
        self.resource_specification.as_ref()
    }
    /// Recurring usage charge for each reserved resource, e.g. '157.0'
    pub fn usage_price(&self) -> ::std::option::Option<f64> {
        self.usage_price
    }
}
impl Offering {
    /// Creates a new builder-style object to manufacture [`Offering`](crate::types::Offering).
    pub fn builder() -> crate::types::builders::OfferingBuilder {
        crate::types::builders::OfferingBuilder::default()
    }
}

/// A builder for [`Offering`](crate::types::Offering).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct OfferingBuilder {
    pub(crate) arn: ::std::option::Option<::std::string::String>,
    pub(crate) currency_code: ::std::option::Option<::std::string::String>,
    pub(crate) duration: ::std::option::Option<i32>,
    pub(crate) duration_units: ::std::option::Option<crate::types::OfferingDurationUnits>,
    pub(crate) fixed_price: ::std::option::Option<f64>,
    pub(crate) offering_description: ::std::option::Option<::std::string::String>,
    pub(crate) offering_id: ::std::option::Option<::std::string::String>,
    pub(crate) offering_type: ::std::option::Option<crate::types::OfferingType>,
    pub(crate) region: ::std::option::Option<::std::string::String>,
    pub(crate) resource_specification: ::std::option::Option<crate::types::ReservationResourceSpecification>,
    pub(crate) usage_price: ::std::option::Option<f64>,
}
impl OfferingBuilder {
    /// Unique offering ARN, e.g. 'arn:aws:medialive:us-west-2:123456789012:offering:87654321'
    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.arn = ::std::option::Option::Some(input.into());
        self
    }
    /// Unique offering ARN, e.g. 'arn:aws:medialive:us-west-2:123456789012:offering:87654321'
    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.arn = input;
        self
    }
    /// Unique offering ARN, e.g. 'arn:aws:medialive:us-west-2:123456789012:offering:87654321'
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    /// Currency code for usagePrice and fixedPrice in ISO-4217 format, e.g. 'USD'
    pub fn currency_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.currency_code = ::std::option::Option::Some(input.into());
        self
    }
    /// Currency code for usagePrice and fixedPrice in ISO-4217 format, e.g. 'USD'
    pub fn set_currency_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.currency_code = input;
        self
    }
    /// Currency code for usagePrice and fixedPrice in ISO-4217 format, e.g. 'USD'
    pub fn get_currency_code(&self) -> &::std::option::Option<::std::string::String> {
        &self.currency_code
    }
    /// Lease duration, e.g. '12'
    pub fn duration(mut self, input: i32) -> Self {
        self.duration = ::std::option::Option::Some(input);
        self
    }
    /// Lease duration, e.g. '12'
    pub fn set_duration(mut self, input: ::std::option::Option<i32>) -> Self {
        self.duration = input;
        self
    }
    /// Lease duration, e.g. '12'
    pub fn get_duration(&self) -> &::std::option::Option<i32> {
        &self.duration
    }
    /// Units for duration, e.g. 'MONTHS'
    pub fn duration_units(mut self, input: crate::types::OfferingDurationUnits) -> Self {
        self.duration_units = ::std::option::Option::Some(input);
        self
    }
    /// Units for duration, e.g. 'MONTHS'
    pub fn set_duration_units(mut self, input: ::std::option::Option<crate::types::OfferingDurationUnits>) -> Self {
        self.duration_units = input;
        self
    }
    /// Units for duration, e.g. 'MONTHS'
    pub fn get_duration_units(&self) -> &::std::option::Option<crate::types::OfferingDurationUnits> {
        &self.duration_units
    }
    /// One-time charge for each reserved resource, e.g. '0.0' for a NO_UPFRONT offering
    pub fn fixed_price(mut self, input: f64) -> Self {
        self.fixed_price = ::std::option::Option::Some(input);
        self
    }
    /// One-time charge for each reserved resource, e.g. '0.0' for a NO_UPFRONT offering
    pub fn set_fixed_price(mut self, input: ::std::option::Option<f64>) -> Self {
        self.fixed_price = input;
        self
    }
    /// One-time charge for each reserved resource, e.g. '0.0' for a NO_UPFRONT offering
    pub fn get_fixed_price(&self) -> &::std::option::Option<f64> {
        &self.fixed_price
    }
    /// Offering description, e.g. 'HD AVC output at 10-20 Mbps, 30 fps, and standard VQ in US West (Oregon)'
    pub fn offering_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.offering_description = ::std::option::Option::Some(input.into());
        self
    }
    /// Offering description, e.g. 'HD AVC output at 10-20 Mbps, 30 fps, and standard VQ in US West (Oregon)'
    pub fn set_offering_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.offering_description = input;
        self
    }
    /// Offering description, e.g. 'HD AVC output at 10-20 Mbps, 30 fps, and standard VQ in US West (Oregon)'
    pub fn get_offering_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.offering_description
    }
    /// Unique offering ID, e.g. '87654321'
    pub fn offering_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.offering_id = ::std::option::Option::Some(input.into());
        self
    }
    /// Unique offering ID, e.g. '87654321'
    pub fn set_offering_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.offering_id = input;
        self
    }
    /// Unique offering ID, e.g. '87654321'
    pub fn get_offering_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.offering_id
    }
    /// Offering type, e.g. 'NO_UPFRONT'
    pub fn offering_type(mut self, input: crate::types::OfferingType) -> Self {
        self.offering_type = ::std::option::Option::Some(input);
        self
    }
    /// Offering type, e.g. 'NO_UPFRONT'
    pub fn set_offering_type(mut self, input: ::std::option::Option<crate::types::OfferingType>) -> Self {
        self.offering_type = input;
        self
    }
    /// Offering type, e.g. 'NO_UPFRONT'
    pub fn get_offering_type(&self) -> &::std::option::Option<crate::types::OfferingType> {
        &self.offering_type
    }
    /// AWS region, e.g. 'us-west-2'
    pub fn region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.region = ::std::option::Option::Some(input.into());
        self
    }
    /// AWS region, e.g. 'us-west-2'
    pub fn set_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.region = input;
        self
    }
    /// AWS region, e.g. 'us-west-2'
    pub fn get_region(&self) -> &::std::option::Option<::std::string::String> {
        &self.region
    }
    /// Resource configuration details
    pub fn resource_specification(mut self, input: crate::types::ReservationResourceSpecification) -> Self {
        self.resource_specification = ::std::option::Option::Some(input);
        self
    }
    /// Resource configuration details
    pub fn set_resource_specification(mut self, input: ::std::option::Option<crate::types::ReservationResourceSpecification>) -> Self {
        self.resource_specification = input;
        self
    }
    /// Resource configuration details
    pub fn get_resource_specification(&self) -> &::std::option::Option<crate::types::ReservationResourceSpecification> {
        &self.resource_specification
    }
    /// Recurring usage charge for each reserved resource, e.g. '157.0'
    pub fn usage_price(mut self, input: f64) -> Self {
        self.usage_price = ::std::option::Option::Some(input);
        self
    }
    /// Recurring usage charge for each reserved resource, e.g. '157.0'
    pub fn set_usage_price(mut self, input: ::std::option::Option<f64>) -> Self {
        self.usage_price = input;
        self
    }
    /// Recurring usage charge for each reserved resource, e.g. '157.0'
    pub fn get_usage_price(&self) -> &::std::option::Option<f64> {
        &self.usage_price
    }
    /// Consumes the builder and constructs a [`Offering`](crate::types::Offering).
    pub fn build(self) -> crate::types::Offering {
        crate::types::Offering {
            arn: self.arn,
            currency_code: self.currency_code,
            duration: self.duration,
            duration_units: self.duration_units,
            fixed_price: self.fixed_price,
            offering_description: self.offering_description,
            offering_id: self.offering_id,
            offering_type: self.offering_type,
            region: self.region,
            resource_specification: self.resource_specification,
            usage_price: self.usage_price,
        }
    }
}