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.

/// Input for GetEntitlementDecision.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetEntitlementDecisionInput {
    /// The ID of the app.
    pub app_id: ::std::option::Option<::std::string::String>,
    /// An opaque identifier that you assign to an end user. Do not include personally identifiable or otherwise sensitive data in this value.
    pub user_id: ::std::option::Option<::std::string::String>,
    /// The type of action the user is attempting, used to determine the applicable plan capability and quota. Use the same event type you will send on the event.
    pub event_type: ::std::option::Option<::std::string::String>,
    /// The environment of the app that this operation applies to. Specify live to use the live app, or sandbox to use the app's isolated test environment.
    pub scope: ::std::option::Option<crate::types::RequestScope>,
    /// The number of units the pending action will consume, as a non-negative decimal string (the same Quantity shape PutEvent uses). Send the real amount if known, otherwise your best upper estimate (for example a request's max tokens). Used when a metric counts events or sums or maxes the event quantity itself. The decision is DENY when usage already reached the limit, or when folding this event in would push it past (SUM and COUNT add the increment; MAX takes the larger of current usage and the increment).
    pub quantity: ::std::option::Option<::std::string::String>,
    /// The same event properties you will send on the event. Each metric's filter is applied to them, and a summed or maxed field value is read from them. Omit them or send {} when the event has none; a metric that sums or maxes a property then rejects the check, as PutEvent rejects the event. Do not include personally identifiable or otherwise sensitive data in these values.
    pub properties: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl GetEntitlementDecisionInput {
    /// The ID of the app.
    pub fn app_id(&self) -> ::std::option::Option<&str> {
        self.app_id.as_deref()
    }
    /// An opaque identifier that you assign to an end user. Do not include personally identifiable or otherwise sensitive data in this value.
    pub fn user_id(&self) -> ::std::option::Option<&str> {
        self.user_id.as_deref()
    }
    /// The type of action the user is attempting, used to determine the applicable plan capability and quota. Use the same event type you will send on the event.
    pub fn event_type(&self) -> ::std::option::Option<&str> {
        self.event_type.as_deref()
    }
    /// The environment of the app that this operation applies to. Specify live to use the live app, or sandbox to use the app's isolated test environment.
    pub fn scope(&self) -> ::std::option::Option<&crate::types::RequestScope> {
        self.scope.as_ref()
    }
    /// The number of units the pending action will consume, as a non-negative decimal string (the same Quantity shape PutEvent uses). Send the real amount if known, otherwise your best upper estimate (for example a request's max tokens). Used when a metric counts events or sums or maxes the event quantity itself. The decision is DENY when usage already reached the limit, or when folding this event in would push it past (SUM and COUNT add the increment; MAX takes the larger of current usage and the increment).
    pub fn quantity(&self) -> ::std::option::Option<&str> {
        self.quantity.as_deref()
    }
    /// The same event properties you will send on the event. Each metric's filter is applied to them, and a summed or maxed field value is read from them. Omit them or send {} when the event has none; a metric that sums or maxes a property then rejects the check, as PutEvent rejects the event. Do not include personally identifiable or otherwise sensitive data in these values.
    pub fn properties(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.properties.as_ref()
    }
}
impl GetEntitlementDecisionInput {
    /// Creates a new builder-style object to manufacture [`GetEntitlementDecisionInput`](crate::operation::get_entitlement_decision::GetEntitlementDecisionInput).
    pub fn builder() -> crate::operation::get_entitlement_decision::builders::GetEntitlementDecisionInputBuilder {
        crate::operation::get_entitlement_decision::builders::GetEntitlementDecisionInputBuilder::default()
    }
}

/// A builder for [`GetEntitlementDecisionInput`](crate::operation::get_entitlement_decision::GetEntitlementDecisionInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetEntitlementDecisionInputBuilder {
    pub(crate) app_id: ::std::option::Option<::std::string::String>,
    pub(crate) user_id: ::std::option::Option<::std::string::String>,
    pub(crate) event_type: ::std::option::Option<::std::string::String>,
    pub(crate) scope: ::std::option::Option<crate::types::RequestScope>,
    pub(crate) quantity: ::std::option::Option<::std::string::String>,
    pub(crate) properties: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl GetEntitlementDecisionInputBuilder {
    /// The ID of the app.
    /// This field is required.
    pub fn app_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.app_id = ::std::option::Option::Some(input.into());
        self
    }
    /// The ID of the app.
    pub fn set_app_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.app_id = input;
        self
    }
    /// The ID of the app.
    pub fn get_app_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.app_id
    }
    /// An opaque identifier that you assign to an end user. Do not include personally identifiable or otherwise sensitive data in this value.
    /// This field is required.
    pub fn user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.user_id = ::std::option::Option::Some(input.into());
        self
    }
    /// An opaque identifier that you assign to an end user. Do not include personally identifiable or otherwise sensitive data in this value.
    pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.user_id = input;
        self
    }
    /// An opaque identifier that you assign to an end user. Do not include personally identifiable or otherwise sensitive data in this value.
    pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.user_id
    }
    /// The type of action the user is attempting, used to determine the applicable plan capability and quota. Use the same event type you will send on the event.
    /// This field is required.
    pub fn event_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.event_type = ::std::option::Option::Some(input.into());
        self
    }
    /// The type of action the user is attempting, used to determine the applicable plan capability and quota. Use the same event type you will send on the event.
    pub fn set_event_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.event_type = input;
        self
    }
    /// The type of action the user is attempting, used to determine the applicable plan capability and quota. Use the same event type you will send on the event.
    pub fn get_event_type(&self) -> &::std::option::Option<::std::string::String> {
        &self.event_type
    }
    /// The environment of the app that this operation applies to. Specify live to use the live app, or sandbox to use the app's isolated test environment.
    /// This field is required.
    pub fn scope(mut self, input: crate::types::RequestScope) -> Self {
        self.scope = ::std::option::Option::Some(input);
        self
    }
    /// The environment of the app that this operation applies to. Specify live to use the live app, or sandbox to use the app's isolated test environment.
    pub fn set_scope(mut self, input: ::std::option::Option<crate::types::RequestScope>) -> Self {
        self.scope = input;
        self
    }
    /// The environment of the app that this operation applies to. Specify live to use the live app, or sandbox to use the app's isolated test environment.
    pub fn get_scope(&self) -> &::std::option::Option<crate::types::RequestScope> {
        &self.scope
    }
    /// The number of units the pending action will consume, as a non-negative decimal string (the same Quantity shape PutEvent uses). Send the real amount if known, otherwise your best upper estimate (for example a request's max tokens). Used when a metric counts events or sums or maxes the event quantity itself. The decision is DENY when usage already reached the limit, or when folding this event in would push it past (SUM and COUNT add the increment; MAX takes the larger of current usage and the increment).
    /// This field is required.
    pub fn quantity(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.quantity = ::std::option::Option::Some(input.into());
        self
    }
    /// The number of units the pending action will consume, as a non-negative decimal string (the same Quantity shape PutEvent uses). Send the real amount if known, otherwise your best upper estimate (for example a request's max tokens). Used when a metric counts events or sums or maxes the event quantity itself. The decision is DENY when usage already reached the limit, or when folding this event in would push it past (SUM and COUNT add the increment; MAX takes the larger of current usage and the increment).
    pub fn set_quantity(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.quantity = input;
        self
    }
    /// The number of units the pending action will consume, as a non-negative decimal string (the same Quantity shape PutEvent uses). Send the real amount if known, otherwise your best upper estimate (for example a request's max tokens). Used when a metric counts events or sums or maxes the event quantity itself. The decision is DENY when usage already reached the limit, or when folding this event in would push it past (SUM and COUNT add the increment; MAX takes the larger of current usage and the increment).
    pub fn get_quantity(&self) -> &::std::option::Option<::std::string::String> {
        &self.quantity
    }
    /// Adds a key-value pair to `properties`.
    ///
    /// To override the contents of this collection use [`set_properties`](Self::set_properties).
    ///
    /// The same event properties you will send on the event. Each metric's filter is applied to them, and a summed or maxed field value is read from them. Omit them or send {} when the event has none; a metric that sums or maxes a property then rejects the check, as PutEvent rejects the event. Do not include personally identifiable or otherwise sensitive data in these values.
    pub fn properties(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.properties.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.properties = ::std::option::Option::Some(hash_map);
        self
    }
    /// The same event properties you will send on the event. Each metric's filter is applied to them, and a summed or maxed field value is read from them. Omit them or send {} when the event has none; a metric that sums or maxes a property then rejects the check, as PutEvent rejects the event. Do not include personally identifiable or otherwise sensitive data in these values.
    pub fn set_properties(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.properties = input;
        self
    }
    /// The same event properties you will send on the event. Each metric's filter is applied to them, and a summed or maxed field value is read from them. Omit them or send {} when the event has none; a metric that sums or maxes a property then rejects the check, as PutEvent rejects the event. Do not include personally identifiable or otherwise sensitive data in these values.
    pub fn get_properties(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.properties
    }
    /// Consumes the builder and constructs a [`GetEntitlementDecisionInput`](crate::operation::get_entitlement_decision::GetEntitlementDecisionInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::get_entitlement_decision::GetEntitlementDecisionInput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::get_entitlement_decision::GetEntitlementDecisionInput {
            app_id: self.app_id,
            user_id: self.user_id,
            event_type: self.event_type,
            scope: self.scope,
            quantity: self.quantity,
            properties: self.properties,
        })
    }
}