pub struct Params {
pub start_time: i64,
pub end_time: Option<i64>,
pub bucket_width: Option<BucketWidth>,
pub project_ids: Option<Vec<String>>,
pub user_ids: Option<Vec<String>>,
pub api_key_ids: Option<Vec<String>>,
pub models: Option<Vec<String>>,
pub group_by: Option<Vec<Item>>,
pub limit: Option<i64>,
pub page: Option<String>,
}
Fields§
§start_time: i64
Start time (Unix seconds) of the query time range, inclusive.
end_time: Option<i64>
End time (Unix seconds) of the query time range, exclusive.
bucket_width: Option<BucketWidth>
Width of each time bucket in response. Currently 1m
, 1h
and 1d
are supported, default to 1d
.
project_ids: Option<Vec<String>>
Return only usage for these projects.
user_ids: Option<Vec<String>>
Return only usage for these users.
api_key_ids: Option<Vec<String>>
Return only usage for these API keys.
models: Option<Vec<String>>
Return only usage for these models.
group_by: Option<Vec<Item>>
Group the usage data by the specified fields. Support fields include project_id
, user_id
, api_key_id
, model
or any combination of them.
limit: Option<i64>
Specifies the number of buckets to return.
bucket_width=1d
: default: 7, max: 31bucket_width=1h
: default: 24, max: 168bucket_width=1m
: default: 60, max: 1440
page: Option<String>
A cursor for use in pagination. Corresponding to the next_page
field from the previous response.
Implementations§
Source§impl Params
impl Params
Sourcepub fn builder() -> ParamsBuilder<((), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> ParamsBuilder<((), (), (), (), (), (), (), (), (), ())>
Create a builder for building Params
.
On the builder, call .start_time(...)
, .end_time(...)
(optional), .bucket_width(...)
(optional), .project_ids(...)
(optional), .user_ids(...)
(optional), .api_key_ids(...)
(optional), .models(...)
(optional), .group_by(...)
(optional), .limit(...)
(optional), .page(...)
(optional) to set the values of the fields.
Finally, call .build()
to create the instance of Params
.