1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
* Hanzo Cloud API
*
* The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
*
* The version of the OpenAPI document: v1
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct SelfRank {
/// CostCents is the caller's own spend in whole US cents. Always populated — your own spend is never withheld from you — so here 0 really does mean zero.
#[serde(rename = "costCents", skip_serializing_if = "Option::is_none")]
pub cost_cents: Option<i32>,
/// Handle is how the caller appears on this board: their chosen handle, falling back to their username, on a user board; their org id on the global board. Present even when unlisted — this is the caller looking at themselves.
#[serde(rename = "handle", skip_serializing_if = "Option::is_none")]
pub handle: Option<String>,
/// Listed says whether the caller is publicly visible on this board: opted in on a user board, org opted in (or the viewer is a platform admin) on the global one. False is the prompt to offer the opt-in, and explains an unranked global self.
#[serde(rename = "listed", skip_serializing_if = "Option::is_none")]
pub listed: Option<bool>,
/// Metric is whichever of the three values above the board was ranked by, so a client can compare the caller against the rows without re-reading the request. Metric <= 0 is exactly the case that leaves Ranked false.
#[serde(rename = "metric", skip_serializing_if = "Option::is_none")]
pub metric: Option<i32>,
/// OfTotal is the size of the universe Rank is out of — \"rank N of OfTotal\". On a user board that is the org's users with any usage in the window; on the global board it is every active org for a platform admin, and the count of opted-in orgs for everyone else.
#[serde(rename = "ofTotal", skip_serializing_if = "Option::is_none")]
pub of_total: Option<i32>,
/// Rank is the caller's 1-based standing, computed as (subjects whose windowed metric strictly exceeds the caller's) + 1. It is exact against the whole ranked universe, not just the returned page, so it can far exceed len(rows). Read it only when Ranked.
#[serde(rename = "rank", skip_serializing_if = "Option::is_none")]
pub rank: Option<i32>,
/// Ranked is false when the caller holds no position: they had no usage in the window, or (on the global board) their org has not opted into public listing and so is not ranked against a set it never joined. Rank is then 0 and means nothing.
#[serde(rename = "ranked", skip_serializing_if = "Option::is_none")]
pub ranked: Option<bool>,
/// Requests is the caller's own request count in the window, 0 if they were idle.
#[serde(rename = "requests", skip_serializing_if = "Option::is_none")]
pub requests: Option<i32>,
/// Tokens is the caller's own prompt+completion tokens in the window.
#[serde(rename = "tokens", skip_serializing_if = "Option::is_none")]
pub tokens: Option<i32>,
}
impl SelfRank {
pub fn new() -> SelfRank {
SelfRank {
cost_cents: None,
handle: None,
listed: None,
metric: None,
of_total: None,
rank: None,
ranked: None,
requests: None,
tokens: None,
}
}
}