pub struct RecordSubscriptionRequest {
pub subject: String,
pub product_id: String,
pub status: i32,
pub provider: String,
pub provider_customer_id: String,
pub provider_subscription_id: String,
pub current_period_end: Option<Timestamp>,
pub event_id: String,
pub client_operation_id: String,
pub provider_modified_at: Option<Timestamp>,
}Expand description
Records/updates a subject’s paid entitlement. A privilege-granting write —
weft gates it on the billing service account’s billing:write Right and
maps product_id → plan from checked-in, fail-closed config.
Fields§
§subject: String§product_id: String§status: i32§provider: String§provider_customer_id: String§provider_subscription_id: String§current_period_end: Option<Timestamp>§event_id: StringProvider webhook event id — the natural idempotency key for the upstream
billing event. Retained for handler-side dedup alongside the transport
client_operation_id.
client_operation_id: String§provider_modified_at: Option<Timestamp>Provider version stamp for the state this write carries: Polar’s
modified_at, falling back to created_at while the object has never
been mutated. Monotonically non-decreasing over the subscription’s
lifetime, so weft compares it against the stored stamp inside the upsert
and rejects writes older than what is already recorded — a delayed
order.paid can no longer undo a subscription.revoked. Absent means
unstamped: the write applies without an ordering check and preserves any
stamp already stored. Do not send current_period_end here; it is a
business date, not a version, and is unchanged across a
past_due -> active retry.
Implementations§
Source§impl RecordSubscriptionRequest
impl RecordSubscriptionRequest
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.
Trait Implementations§
Source§impl Clone for RecordSubscriptionRequest
impl Clone for RecordSubscriptionRequest
Source§fn clone(&self) -> RecordSubscriptionRequest
fn clone(&self) -> RecordSubscriptionRequest
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 RecordSubscriptionRequest
impl Debug for RecordSubscriptionRequest
Source§impl Default for RecordSubscriptionRequest
impl Default for RecordSubscriptionRequest
impl Eq for RecordSubscriptionRequest
Source§impl Hash for RecordSubscriptionRequest
impl Hash for RecordSubscriptionRequest
Source§impl Message for RecordSubscriptionRequest
impl Message for RecordSubscriptionRequest
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.