aws-sdk-medialive 0.26.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'
    #[doc(hidden)]
    pub arn: std::option::Option<std::string::String>,
    /// Currency code for usagePrice and fixedPrice in ISO-4217 format, e.g. 'USD'
    #[doc(hidden)]
    pub currency_code: std::option::Option<std::string::String>,
    /// Lease duration, e.g. '12'
    #[doc(hidden)]
    pub duration: i32,
    /// Units for duration, e.g. 'MONTHS'
    #[doc(hidden)]
    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
    #[doc(hidden)]
    pub fixed_price: f64,
    /// Offering description, e.g. 'HD AVC output at 10-20 Mbps, 30 fps, and standard VQ in US West (Oregon)'
    #[doc(hidden)]
    pub offering_description: std::option::Option<std::string::String>,
    /// Unique offering ID, e.g. '87654321'
    #[doc(hidden)]
    pub offering_id: std::option::Option<std::string::String>,
    /// Offering type, e.g. 'NO_UPFRONT'
    #[doc(hidden)]
    pub offering_type: std::option::Option<crate::types::OfferingType>,
    /// AWS region, e.g. 'us-west-2'
    #[doc(hidden)]
    pub region: std::option::Option<std::string::String>,
    /// Resource configuration details
    #[doc(hidden)]
    pub resource_specification: std::option::Option<crate::types::ReservationResourceSpecification>,
    /// Recurring usage charge for each reserved resource, e.g. '157.0'
    #[doc(hidden)]
    pub usage_price: 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) -> 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) -> 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) -> 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).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
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 Into<std::string::String>) -> Self {
        self.arn = 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
    }
    /// Currency code for usagePrice and fixedPrice in ISO-4217 format, e.g. 'USD'
    pub fn currency_code(mut self, input: impl Into<std::string::String>) -> Self {
        self.currency_code = 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
    }
    /// Lease duration, e.g. '12'
    pub fn duration(mut self, input: i32) -> Self {
        self.duration = Some(input);
        self
    }
    /// Lease duration, e.g. '12'
    pub fn set_duration(mut self, input: std::option::Option<i32>) -> Self {
        self.duration = input;
        self
    }
    /// Units for duration, e.g. 'MONTHS'
    pub fn duration_units(mut self, input: crate::types::OfferingDurationUnits) -> Self {
        self.duration_units = 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
    }
    /// 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 = 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
    }
    /// 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 Into<std::string::String>) -> Self {
        self.offering_description = 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
    }
    /// Unique offering ID, e.g. '87654321'
    pub fn offering_id(mut self, input: impl Into<std::string::String>) -> Self {
        self.offering_id = 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
    }
    /// Offering type, e.g. 'NO_UPFRONT'
    pub fn offering_type(mut self, input: crate::types::OfferingType) -> Self {
        self.offering_type = 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
    }
    /// AWS region, e.g. 'us-west-2'
    pub fn region(mut self, input: impl Into<std::string::String>) -> Self {
        self.region = 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
    }
    /// Resource configuration details
    pub fn resource_specification(
        mut self,
        input: crate::types::ReservationResourceSpecification,
    ) -> Self {
        self.resource_specification = 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
    }
    /// Recurring usage charge for each reserved resource, e.g. '157.0'
    pub fn usage_price(mut self, input: f64) -> Self {
        self.usage_price = 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
    }
    /// 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.unwrap_or_default(),
            duration_units: self.duration_units,
            fixed_price: self.fixed_price.unwrap_or_default(),
            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.unwrap_or_default(),
        }
    }
}