pub struct UsageReport {
pub api_key_name: String,
pub since: DateTime<Utc>,
pub until: DateTime<Utc>,
pub daily: Vec<UsageBucket>,
pub bundle_builds: Option<BundleBuildUsage>,
pub pricing: Option<UsagePricing>,
/* private fields */
}Expand description
Response body of GET /usage.
since is the start of the UTC day it falls in, so it may precede the
requested value.
Fields§
§api_key_name: String§since: DateTime<Utc>§until: DateTime<Utc>§daily: Vec<UsageBucket>One bucket per UTC day in (since, until], ordered and gapless: an idle
day is present with zero counts, and a session ending on a midnight
belongs to the bucket that midnight closes. The series sums to
sessions and compute; it is empty only from a server predating it.
bundle_builds: Option<BundleBuildUsage>Present only for keys with the build_bundle feature.
pricing: Option<UsagePricing>Implementations§
Source§impl UsageReport
impl UsageReport
Sourcepub fn new(
api_key_name: String,
since: DateTime<Utc>,
until: DateTime<Utc>,
daily: Vec<UsageBucket>,
bundle_builds: Option<BundleBuildUsage>,
pricing: Option<UsagePricing>,
) -> Self
pub fn new( api_key_name: String, since: DateTime<Utc>, until: DateTime<Utc>, daily: Vec<UsageBucket>, bundle_builds: Option<BundleBuildUsage>, pricing: Option<UsagePricing>, ) -> Self
Folds the totals from daily, which is the only way to set them.
Sourcepub fn sessions(&self) -> SessionCounts
pub fn sessions(&self) -> SessionCounts
The sum over daily, except on a response from a server predating it,
where it is the total that server reported for the whole window.
Sourcepub fn compute(&self) -> ComputeTotals
pub fn compute(&self) -> ComputeTotals
The sum over daily, except on a response from a server predating it,
where it is the total that server reported for the whole window.