aws-sdk-appmonetization 1.0.0

AWS SDK for AWS App Monetization
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct PutCustomChargesOutput {
    /// The billing period the service assigned these charges to, resolved from the user's current subscription. The caller supplies no window; this reports where the charges landed.
    pub billing_period_start_at: ::aws_smithy_types::DateTime,
    /// End of the assigned billing period.
    pub billing_period_end_at: ::aws_smithy_types::DateTime,
    _request_id: Option<String>,
}
impl PutCustomChargesOutput {
    /// The billing period the service assigned these charges to, resolved from the user's current subscription. The caller supplies no window; this reports where the charges landed.
    pub fn billing_period_start_at(&self) -> &::aws_smithy_types::DateTime {
        &self.billing_period_start_at
    }
    /// End of the assigned billing period.
    pub fn billing_period_end_at(&self) -> &::aws_smithy_types::DateTime {
        &self.billing_period_end_at
    }
}
impl ::aws_types::request_id::RequestId for PutCustomChargesOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl PutCustomChargesOutput {
    /// Creates a new builder-style object to manufacture [`PutCustomChargesOutput`](crate::operation::put_custom_charges::PutCustomChargesOutput).
    pub fn builder() -> crate::operation::put_custom_charges::builders::PutCustomChargesOutputBuilder {
        crate::operation::put_custom_charges::builders::PutCustomChargesOutputBuilder::default()
    }
}

/// A builder for [`PutCustomChargesOutput`](crate::operation::put_custom_charges::PutCustomChargesOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PutCustomChargesOutputBuilder {
    pub(crate) billing_period_start_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) billing_period_end_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl PutCustomChargesOutputBuilder {
    /// The billing period the service assigned these charges to, resolved from the user's current subscription. The caller supplies no window; this reports where the charges landed.
    /// This field is required.
    pub fn billing_period_start_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.billing_period_start_at = ::std::option::Option::Some(input);
        self
    }
    /// The billing period the service assigned these charges to, resolved from the user's current subscription. The caller supplies no window; this reports where the charges landed.
    pub fn set_billing_period_start_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.billing_period_start_at = input;
        self
    }
    /// The billing period the service assigned these charges to, resolved from the user's current subscription. The caller supplies no window; this reports where the charges landed.
    pub fn get_billing_period_start_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.billing_period_start_at
    }
    /// End of the assigned billing period.
    /// This field is required.
    pub fn billing_period_end_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.billing_period_end_at = ::std::option::Option::Some(input);
        self
    }
    /// End of the assigned billing period.
    pub fn set_billing_period_end_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.billing_period_end_at = input;
        self
    }
    /// End of the assigned billing period.
    pub fn get_billing_period_end_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.billing_period_end_at
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`PutCustomChargesOutput`](crate::operation::put_custom_charges::PutCustomChargesOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`billing_period_start_at`](crate::operation::put_custom_charges::builders::PutCustomChargesOutputBuilder::billing_period_start_at)
    /// - [`billing_period_end_at`](crate::operation::put_custom_charges::builders::PutCustomChargesOutputBuilder::billing_period_end_at)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::put_custom_charges::PutCustomChargesOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::put_custom_charges::PutCustomChargesOutput {
            billing_period_start_at: self.billing_period_start_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "billing_period_start_at",
                    "billing_period_start_at was not specified but it is required when building PutCustomChargesOutput",
                )
            })?,
            billing_period_end_at: self.billing_period_end_at.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "billing_period_end_at",
                    "billing_period_end_at was not specified but it is required when building PutCustomChargesOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}