pub struct UsageModerationsParams {
pub start_time: i64,
pub end_time: Option<i64>,
pub bucket_width: Option<UsageModerationsParamsBucketWidth>,
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<UsageModerationsParamsGroupBy>>,
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<UsageModerationsParamsBucketWidth>
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<UsageModerationsParamsGroupBy>>
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 UsageModerationsParams
impl UsageModerationsParams
Sourcepub fn builder() -> UsageModerationsParamsBuilder<((), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> UsageModerationsParamsBuilder<((), (), (), (), (), (), (), (), (), ())>
Create a builder for building UsageModerationsParams
.
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 UsageModerationsParams
.
Trait Implementations§
Source§impl Clone for UsageModerationsParams
impl Clone for UsageModerationsParams
Source§fn clone(&self) -> UsageModerationsParams
fn clone(&self) -> UsageModerationsParams
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for UsageModerationsParams
impl Debug for UsageModerationsParams
Source§impl<'de> Deserialize<'de> for UsageModerationsParams
impl<'de> Deserialize<'de> for UsageModerationsParams
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for UsageModerationsParams
impl PartialEq for UsageModerationsParams
Source§fn eq(&self, other: &UsageModerationsParams) -> bool
fn eq(&self, other: &UsageModerationsParams) -> bool
self
and other
values to be equal, and is used by ==
.