pub struct Entitlement {
pub plan: i32,
pub status: i32,
pub current_period_end: Option<Timestamp>,
pub billing_interval: Option<String>,
pub billing_interval_count: Option<i32>,
pub currency: Option<String>,
pub amount: Option<i64>,
pub provider_subscription_id: Option<String>,
}Expand description
The account-level entitlement applied for a subject.
Fields§
§plan: i32§status: i32§current_period_end: Option<Timestamp>§billing_interval: Option<String>Provider billing cadence copied from the subject’s subscription row: “day”, “week”, “month”, or “year”.
billing_interval_count: Option<i32>§currency: Option<String>ISO 4217 currency code normalized to lowercase.
amount: Option<i64>Subscription amount in the smallest unit of currency.
provider_subscription_id: Option<String>Opaque provider identifier for server-side subscription operations. This is not a credential or proof of ownership. A server using its organization token MUST re-bind this id to the authenticated subject before mutation.
Implementations§
Source§impl Entitlement
impl Entitlement
Sourcepub fn plan(&self) -> Plan
pub fn plan(&self) -> Plan
Returns the enum value of plan, or the default if the field is set to an invalid enum value.
Sourcepub fn status(&self) -> SubscriptionStatus
pub fn status(&self) -> SubscriptionStatus
Returns the enum value of status, or the default if the field is set to an invalid enum value.
Sourcepub fn set_status(&mut self, value: SubscriptionStatus)
pub fn set_status(&mut self, value: SubscriptionStatus)
Sets status to the provided enum value.
Sourcepub fn billing_interval(&self) -> &str
pub fn billing_interval(&self) -> &str
Returns the value of billing_interval, or the default value if billing_interval is unset.
Sourcepub fn billing_interval_count(&self) -> i32
pub fn billing_interval_count(&self) -> i32
Returns the value of billing_interval_count, or the default value if billing_interval_count is unset.
Sourcepub fn currency(&self) -> &str
pub fn currency(&self) -> &str
Returns the value of currency, or the default value if currency is unset.
Sourcepub fn amount(&self) -> i64
pub fn amount(&self) -> i64
Returns the value of amount, or the default value if amount is unset.
Sourcepub fn provider_subscription_id(&self) -> &str
pub fn provider_subscription_id(&self) -> &str
Returns the value of provider_subscription_id, or the default value if provider_subscription_id is unset.
Trait Implementations§
Source§impl Clone for Entitlement
impl Clone for Entitlement
Source§fn clone(&self) -> Entitlement
fn clone(&self) -> Entitlement
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Entitlement
impl Debug for Entitlement
Source§impl Default for Entitlement
impl Default for Entitlement
impl Eq for Entitlement
Source§impl Hash for Entitlement
impl Hash for Entitlement
Source§impl Message for Entitlement
impl Message for Entitlement
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.