Contribution
One sponsorship (GitHub) or order (Open Collective), normalized.
On this page
One sponsorship (GitHub) or order (Open Collective), normalized.
use sponsorkit::Contribution;
pub struct Contribution {
pub id: String,
pub provider: Provider,
pub target: String,
pub sponsor: SponsorEntity,
pub via: Via,
pub kind: Kind,
pub frequency: Frequency,
pub status: Status,
pub amount: Money,
pub tier: Option<Tier>,
pub flags: Vec<Flag>,
pub private: bool,
pub started_at: Option<String>,
pub ended_at: Option<String>,
pub last_charged_at: Option<String>,
pub next_charge_at: Option<String>,
pub total_contributed: Option<Money>,
}Fields#
id#
pub id: StringJSON key: id
Stable id: con_<provider>_<22 chars>.
provider#
pub provider: ProviderJSON key: provider
The provider.
target#
pub target: StringJSON key: target
The target string, e.g. github:octocat.
sponsor#
pub sponsor: SponsorEntityJSON key: sponsor
Who pays.
via#
pub via: ViaJSON key: via
Direct or through an organization.
kind#
pub kind: KindJSON key: kind
Recurring or one-time.
frequency#
pub frequency: FrequencyJSON key: frequency
Charge frequency.
status#
pub status: StatusJSON key: status
Status.
amount#
pub amount: MoneyJSON key: amount
Amount per charge. GitHub hides some amounts; they are 0 USD with tier: None.
tier#
pub tier: Option<Tier>JSON key: tier
Tier, if any.
flags#
pub flags: Vec<Flag>JSON key: flags
Flags such as via_patreon.
private#
pub private: boolJSON key: private
Whether the provider marks it private / incognito.
started_at#
pub started_at: Option<String>JSON key: startedAt
ISO-8601 start time.
ended_at#
pub ended_at: Option<String>JSON key: endedAt
ISO-8601 end time.
last_charged_at#
pub last_charged_at: Option<String>JSON key: lastChargedAt
Last charge (Open Collective only).
next_charge_at#
pub next_charge_at: Option<String>JSON key: nextChargeAt
Next charge (Open Collective only).
total_contributed#
pub total_contributed: Option<Money>JSON key: totalContributed
Total contributed so far (Open Collective only).
Methods#
is_active#
pub fn is_active(&self) -> boolstatus == active.
Returns: bool
Trait implementations#
impl Clone for Contributionimpl Debug for Contributionimpl Eq for Contributionimpl PartialEq for Contributionimpl Serialize for Contributionimpl<'de> Deserialize<'de> for Contribution