Skip to main content

RewardRecord

Struct RewardRecord 

Source
pub struct RewardRecord {
Show 23 fields pub reward_type: RewardType, pub reward_type_raw: Option<i32>, pub detail_kind: RewardDetailKind, pub record_id: String, pub activity_title: String, pub title: String, pub description: String, pub card_type: String, pub card_status: CouponStatus, pub card_status_raw: Option<i32>, pub prize_type: Option<i32>, pub amount: Option<Decimal>, pub currency: String, pub status: RewardStatus, pub status_raw: Option<i32>, pub deliver_status: RewardDeliverStatus, pub deliver_status_raw: Option<i32>, pub exit_status: i32, pub send_time: Option<OffsetDateTime>, pub start_time: Option<OffsetDateTime>, pub end_time: Option<OffsetDateTime>, pub effective_time: Option<OffsetDateTime>, pub receive_deadline: Option<OffsetDateTime>,
}
Expand description

A reward record from the reward center

The server nests the details in one of cash / card / prize; this type flattens them. Prize redemption secrets (coupon_secret), cash card codes (cash_card_code) and shipping contact details of prizes are intentionally not modelled.

Fields§

§reward_type: RewardType

Reward type: named after the detail object the server sent (cash, card or prize, checked in that order), or the server’s reward_type code when it sent no detail object

§reward_type_raw: Option<i32>

The server’s numeric code of reward_type, also when it is a code this SDK does not know (reward_type is then Unknown); None when the value is missing or is not a code

§detail_kind: RewardDetailKind

The detail object the fields below came from

§record_id: String

Record ID

§activity_title: String

Title of the activity that granted the reward

§title: String

Reward title

§description: String

Reward description

§card_type: String

Coupon type (coupon rewards), e.g. commission

§card_status: CouponStatus

Coupon status (coupon rewards; CouponStatus::Unknown otherwise)

§card_status_raw: Option<i32>

The server’s numeric code of card_status, also when it is a code this SDK does not know (card_status is then Unknown); None when the value is missing or is not a code

§prize_type: Option<i32>

Prize type code (gift rewards; 0 = physical goods), None when not set

§amount: Option<Decimal>

Amount

§currency: String

Currency

§status: RewardStatus

Reward status

§status_raw: Option<i32>

The server’s numeric code of status, also when it is a code this SDK does not know (status is then Unknown); None when the value is missing or is not a code

§deliver_status: RewardDeliverStatus

Delivery status (issued gift rewards only). The server uses both 9 and 11 for RewardDeliverStatus::AddressFilled; Self::deliver_status_raw tells them apart.

§deliver_status_raw: Option<i32>

The server’s numeric code of deliver_status (e.g. 11, which deliver_status reads as AddressFilled, like 9), also when it is a code this SDK does not know (deliver_status is then Unknown); None when the value is missing or is not a code

§exit_status: i32

Exit status code, as returned by the server

§send_time: Option<OffsetDateTime>

Time the reward was sent

§start_time: Option<OffsetDateTime>

Start time

§end_time: Option<OffsetDateTime>

End time

§effective_time: Option<OffsetDateTime>

Effective time

§receive_deadline: Option<OffsetDateTime>

Deadline to claim the reward

Trait Implementations§

Source§

impl Clone for RewardRecord

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RewardRecord

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RewardRecord

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for RewardRecord

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for RewardRecord

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more