pub struct UsageImagesParams {
pub start_time: i64,
pub end_time: Option<i64>,
pub bucket_width: Option<UsageImagesParamsBucketWidth>,
pub sources: Option<Vec<UsageImagesParamsSources>>,
pub sizes: Option<Vec<UsageImagesParamsSizes>>,
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<UsageImagesParamsGroupBy>>,
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<UsageImagesParamsBucketWidth>
Width of each time bucket in response. Currently 1m
, 1h
and 1d
are supported, default to 1d
.
sources: Option<Vec<UsageImagesParamsSources>>
Return only usages for these sources. Possible values are image.generation
, image.edit
, image.variation
or any combination of them.
sizes: Option<Vec<UsageImagesParamsSizes>>
Return only usages for these image sizes. Possible values are 256x256
, 512x512
, 1024x1024
, 1792x1792
, 1024x1792
or any combination of them.
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<UsageImagesParamsGroupBy>>
Group the usage data by the specified fields. Support fields include project_id
, user_id
, api_key_id
, model
, size
, source
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 UsageImagesParams
impl UsageImagesParams
Sourcepub fn builder() -> UsageImagesParamsBuilder<((), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> UsageImagesParamsBuilder<((), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building UsageImagesParams
.
On the builder, call .start_time(...)
, .end_time(...)
(optional), .bucket_width(...)
(optional), .sources(...)
(optional), .sizes(...)
(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 UsageImagesParams
.
Trait Implementations§
Source§impl Clone for UsageImagesParams
impl Clone for UsageImagesParams
Source§fn clone(&self) -> UsageImagesParams
fn clone(&self) -> UsageImagesParams
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more