mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
953 lines
26 KiB
Go
953 lines
26 KiB
Go
/*
|
||
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/.
|
||
|
||
API version: v1
|
||
*/
|
||
|
||
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
||
|
||
package hanzoai
|
||
|
||
import (
|
||
"encoding/json"
|
||
)
|
||
|
||
// checks if the UsageReportReq type satisfies the MappedNullable interface at compile time
|
||
var _ MappedNullable = &UsageReportReq{}
|
||
|
||
// UsageReportReq struct for UsageReportReq
|
||
type UsageReportReq struct {
|
||
// Account is the linked account the window was metered from.
|
||
Account *string `json:"account,omitempty"`
|
||
// CachedInputTokens is the prompt tokens the provider served from cache.
|
||
CachedInputTokens *int64 `json:"cachedInputTokens,omitempty"`
|
||
// Confidence says how much the counters below mean.
|
||
Confidence *string `json:"confidence,omitempty"`
|
||
// CostCents is what the window cost on the PROVIDER's own plan, in US cents.
|
||
CostCents *int64 `json:"costCents,omitempty"`
|
||
// CostLimitCents is the plan's spend ceiling for the window, in US cents.
|
||
CostLimitCents *int64 `json:"costLimitCents,omitempty"`
|
||
// Currency is the provider's currency when it is not US cents.
|
||
Currency *string `json:"currency,omitempty"`
|
||
// InputTokens is prompt tokens consumed in the window.
|
||
InputTokens *int64 `json:"inputTokens,omitempty"`
|
||
// Kind is subscription or apikey. Empty is accepted; anything else is refused.
|
||
Kind *string `json:"kind,omitempty"`
|
||
// Lane is the meter lane within the account.
|
||
Lane *string `json:"lane,omitempty"`
|
||
// Machine is the host whose meter read the window. Required on every sample.
|
||
Machine *string `json:"machine,omitempty"`
|
||
// OutputTokens is completion tokens produced in the window.
|
||
OutputTokens *int64 `json:"outputTokens,omitempty"`
|
||
// Plan is the subscription plan the account is on, as the provider names it.
|
||
Plan *string `json:"plan,omitempty"`
|
||
// Provider is the upstream the account belongs to, e.g. anthropic. Required on every sample.
|
||
Provider *string `json:"provider,omitempty"`
|
||
// Requests is how many requests the window covers.
|
||
Requests *int64 `json:"requests,omitempty"`
|
||
// ResetsAt is when the measured window rolls over, RFC3339.
|
||
ResetsAt *string `json:"resetsAt,omitempty"`
|
||
// Samples is the batch form: every lane a poller measured, in one call. When it is non-empty the top-level sample fields are ignored.
|
||
Samples []UsageSampleReq `json:"samples,omitempty"`
|
||
// Synthetic marks a window the meter inferred rather than read.
|
||
Synthetic *bool `json:"synthetic,omitempty"`
|
||
// TotalTokens is the window's total tokens.
|
||
TotalTokens *int64 `json:"totalTokens,omitempty"`
|
||
// UsedPct is how much of the window's allowance is consumed, 0–100.
|
||
UsedPct *float64 `json:"usedPct,omitempty"`
|
||
// Window is the window class: 6h, day, week or month. Required, and a class this surface does not know is refused rather than rewritten.
|
||
Window *string `json:"window,omitempty"`
|
||
// WindowMinutes is the window's real length in minutes, as the meter reports it.
|
||
WindowMinutes *int32 `json:"windowMinutes,omitempty"`
|
||
// WindowStart is when the measured window opened, RFC3339. This is how a backfill states WHICH window it measured; the server always owns the observation clock, so there is no timestamp field.
|
||
WindowStart *string `json:"windowStart,omitempty"`
|
||
AdditionalProperties map[string]interface{}
|
||
}
|
||
|
||
type _UsageReportReq UsageReportReq
|
||
|
||
// NewUsageReportReq instantiates a new UsageReportReq object
|
||
// This constructor will assign default values to properties that have it defined,
|
||
// and makes sure properties required by API are set, but the set of arguments
|
||
// will change when the set of required properties is changed
|
||
func NewUsageReportReq() *UsageReportReq {
|
||
this := UsageReportReq{}
|
||
return &this
|
||
}
|
||
|
||
// NewUsageReportReqWithDefaults instantiates a new UsageReportReq object
|
||
// This constructor will only assign default values to properties that have it defined,
|
||
// but it doesn't guarantee that properties required by API are set
|
||
func NewUsageReportReqWithDefaults() *UsageReportReq {
|
||
this := UsageReportReq{}
|
||
return &this
|
||
}
|
||
|
||
// GetAccount returns the Account field value if set, zero value otherwise.
|
||
func (o *UsageReportReq) GetAccount() string {
|
||
if o == nil || IsNil(o.Account) {
|
||
var ret string
|
||
return ret
|
||
}
|
||
return *o.Account
|
||
}
|
||
|
||
// GetAccountOk returns a tuple with the Account field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *UsageReportReq) GetAccountOk() (*string, bool) {
|
||
if o == nil || IsNil(o.Account) {
|
||
return nil, false
|
||
}
|
||
return o.Account, true
|
||
}
|
||
|
||
// HasAccount returns a boolean if a field has been set.
|
||
func (o *UsageReportReq) HasAccount() bool {
|
||
if o != nil && !IsNil(o.Account) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetAccount gets a reference to the given string and assigns it to the Account field.
|
||
func (o *UsageReportReq) SetAccount(v string) {
|
||
o.Account = &v
|
||
}
|
||
|
||
// GetCachedInputTokens returns the CachedInputTokens field value if set, zero value otherwise.
|
||
func (o *UsageReportReq) GetCachedInputTokens() int64 {
|
||
if o == nil || IsNil(o.CachedInputTokens) {
|
||
var ret int64
|
||
return ret
|
||
}
|
||
return *o.CachedInputTokens
|
||
}
|
||
|
||
// GetCachedInputTokensOk returns a tuple with the CachedInputTokens field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *UsageReportReq) GetCachedInputTokensOk() (*int64, bool) {
|
||
if o == nil || IsNil(o.CachedInputTokens) {
|
||
return nil, false
|
||
}
|
||
return o.CachedInputTokens, true
|
||
}
|
||
|
||
// HasCachedInputTokens returns a boolean if a field has been set.
|
||
func (o *UsageReportReq) HasCachedInputTokens() bool {
|
||
if o != nil && !IsNil(o.CachedInputTokens) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetCachedInputTokens gets a reference to the given int64 and assigns it to the CachedInputTokens field.
|
||
func (o *UsageReportReq) SetCachedInputTokens(v int64) {
|
||
o.CachedInputTokens = &v
|
||
}
|
||
|
||
// GetConfidence returns the Confidence field value if set, zero value otherwise.
|
||
func (o *UsageReportReq) GetConfidence() string {
|
||
if o == nil || IsNil(o.Confidence) {
|
||
var ret string
|
||
return ret
|
||
}
|
||
return *o.Confidence
|
||
}
|
||
|
||
// GetConfidenceOk returns a tuple with the Confidence field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *UsageReportReq) GetConfidenceOk() (*string, bool) {
|
||
if o == nil || IsNil(o.Confidence) {
|
||
return nil, false
|
||
}
|
||
return o.Confidence, true
|
||
}
|
||
|
||
// HasConfidence returns a boolean if a field has been set.
|
||
func (o *UsageReportReq) HasConfidence() bool {
|
||
if o != nil && !IsNil(o.Confidence) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetConfidence gets a reference to the given string and assigns it to the Confidence field.
|
||
func (o *UsageReportReq) SetConfidence(v string) {
|
||
o.Confidence = &v
|
||
}
|
||
|
||
// GetCostCents returns the CostCents field value if set, zero value otherwise.
|
||
func (o *UsageReportReq) GetCostCents() int64 {
|
||
if o == nil || IsNil(o.CostCents) {
|
||
var ret int64
|
||
return ret
|
||
}
|
||
return *o.CostCents
|
||
}
|
||
|
||
// GetCostCentsOk returns a tuple with the CostCents field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *UsageReportReq) GetCostCentsOk() (*int64, bool) {
|
||
if o == nil || IsNil(o.CostCents) {
|
||
return nil, false
|
||
}
|
||
return o.CostCents, true
|
||
}
|
||
|
||
// HasCostCents returns a boolean if a field has been set.
|
||
func (o *UsageReportReq) HasCostCents() bool {
|
||
if o != nil && !IsNil(o.CostCents) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetCostCents gets a reference to the given int64 and assigns it to the CostCents field.
|
||
func (o *UsageReportReq) SetCostCents(v int64) {
|
||
o.CostCents = &v
|
||
}
|
||
|
||
// GetCostLimitCents returns the CostLimitCents field value if set, zero value otherwise.
|
||
func (o *UsageReportReq) GetCostLimitCents() int64 {
|
||
if o == nil || IsNil(o.CostLimitCents) {
|
||
var ret int64
|
||
return ret
|
||
}
|
||
return *o.CostLimitCents
|
||
}
|
||
|
||
// GetCostLimitCentsOk returns a tuple with the CostLimitCents field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *UsageReportReq) GetCostLimitCentsOk() (*int64, bool) {
|
||
if o == nil || IsNil(o.CostLimitCents) {
|
||
return nil, false
|
||
}
|
||
return o.CostLimitCents, true
|
||
}
|
||
|
||
// HasCostLimitCents returns a boolean if a field has been set.
|
||
func (o *UsageReportReq) HasCostLimitCents() bool {
|
||
if o != nil && !IsNil(o.CostLimitCents) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetCostLimitCents gets a reference to the given int64 and assigns it to the CostLimitCents field.
|
||
func (o *UsageReportReq) SetCostLimitCents(v int64) {
|
||
o.CostLimitCents = &v
|
||
}
|
||
|
||
// GetCurrency returns the Currency field value if set, zero value otherwise.
|
||
func (o *UsageReportReq) GetCurrency() string {
|
||
if o == nil || IsNil(o.Currency) {
|
||
var ret string
|
||
return ret
|
||
}
|
||
return *o.Currency
|
||
}
|
||
|
||
// GetCurrencyOk returns a tuple with the Currency field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *UsageReportReq) GetCurrencyOk() (*string, bool) {
|
||
if o == nil || IsNil(o.Currency) {
|
||
return nil, false
|
||
}
|
||
return o.Currency, true
|
||
}
|
||
|
||
// HasCurrency returns a boolean if a field has been set.
|
||
func (o *UsageReportReq) HasCurrency() bool {
|
||
if o != nil && !IsNil(o.Currency) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetCurrency gets a reference to the given string and assigns it to the Currency field.
|
||
func (o *UsageReportReq) SetCurrency(v string) {
|
||
o.Currency = &v
|
||
}
|
||
|
||
// GetInputTokens returns the InputTokens field value if set, zero value otherwise.
|
||
func (o *UsageReportReq) GetInputTokens() int64 {
|
||
if o == nil || IsNil(o.InputTokens) {
|
||
var ret int64
|
||
return ret
|
||
}
|
||
return *o.InputTokens
|
||
}
|
||
|
||
// GetInputTokensOk returns a tuple with the InputTokens field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *UsageReportReq) GetInputTokensOk() (*int64, bool) {
|
||
if o == nil || IsNil(o.InputTokens) {
|
||
return nil, false
|
||
}
|
||
return o.InputTokens, true
|
||
}
|
||
|
||
// HasInputTokens returns a boolean if a field has been set.
|
||
func (o *UsageReportReq) HasInputTokens() bool {
|
||
if o != nil && !IsNil(o.InputTokens) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetInputTokens gets a reference to the given int64 and assigns it to the InputTokens field.
|
||
func (o *UsageReportReq) SetInputTokens(v int64) {
|
||
o.InputTokens = &v
|
||
}
|
||
|
||
// GetKind returns the Kind field value if set, zero value otherwise.
|
||
func (o *UsageReportReq) GetKind() string {
|
||
if o == nil || IsNil(o.Kind) {
|
||
var ret string
|
||
return ret
|
||
}
|
||
return *o.Kind
|
||
}
|
||
|
||
// GetKindOk returns a tuple with the Kind field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *UsageReportReq) GetKindOk() (*string, bool) {
|
||
if o == nil || IsNil(o.Kind) {
|
||
return nil, false
|
||
}
|
||
return o.Kind, true
|
||
}
|
||
|
||
// HasKind returns a boolean if a field has been set.
|
||
func (o *UsageReportReq) HasKind() bool {
|
||
if o != nil && !IsNil(o.Kind) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetKind gets a reference to the given string and assigns it to the Kind field.
|
||
func (o *UsageReportReq) SetKind(v string) {
|
||
o.Kind = &v
|
||
}
|
||
|
||
// GetLane returns the Lane field value if set, zero value otherwise.
|
||
func (o *UsageReportReq) GetLane() string {
|
||
if o == nil || IsNil(o.Lane) {
|
||
var ret string
|
||
return ret
|
||
}
|
||
return *o.Lane
|
||
}
|
||
|
||
// GetLaneOk returns a tuple with the Lane field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *UsageReportReq) GetLaneOk() (*string, bool) {
|
||
if o == nil || IsNil(o.Lane) {
|
||
return nil, false
|
||
}
|
||
return o.Lane, true
|
||
}
|
||
|
||
// HasLane returns a boolean if a field has been set.
|
||
func (o *UsageReportReq) HasLane() bool {
|
||
if o != nil && !IsNil(o.Lane) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetLane gets a reference to the given string and assigns it to the Lane field.
|
||
func (o *UsageReportReq) SetLane(v string) {
|
||
o.Lane = &v
|
||
}
|
||
|
||
// GetMachine returns the Machine field value if set, zero value otherwise.
|
||
func (o *UsageReportReq) GetMachine() string {
|
||
if o == nil || IsNil(o.Machine) {
|
||
var ret string
|
||
return ret
|
||
}
|
||
return *o.Machine
|
||
}
|
||
|
||
// GetMachineOk returns a tuple with the Machine field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *UsageReportReq) GetMachineOk() (*string, bool) {
|
||
if o == nil || IsNil(o.Machine) {
|
||
return nil, false
|
||
}
|
||
return o.Machine, true
|
||
}
|
||
|
||
// HasMachine returns a boolean if a field has been set.
|
||
func (o *UsageReportReq) HasMachine() bool {
|
||
if o != nil && !IsNil(o.Machine) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetMachine gets a reference to the given string and assigns it to the Machine field.
|
||
func (o *UsageReportReq) SetMachine(v string) {
|
||
o.Machine = &v
|
||
}
|
||
|
||
// GetOutputTokens returns the OutputTokens field value if set, zero value otherwise.
|
||
func (o *UsageReportReq) GetOutputTokens() int64 {
|
||
if o == nil || IsNil(o.OutputTokens) {
|
||
var ret int64
|
||
return ret
|
||
}
|
||
return *o.OutputTokens
|
||
}
|
||
|
||
// GetOutputTokensOk returns a tuple with the OutputTokens field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *UsageReportReq) GetOutputTokensOk() (*int64, bool) {
|
||
if o == nil || IsNil(o.OutputTokens) {
|
||
return nil, false
|
||
}
|
||
return o.OutputTokens, true
|
||
}
|
||
|
||
// HasOutputTokens returns a boolean if a field has been set.
|
||
func (o *UsageReportReq) HasOutputTokens() bool {
|
||
if o != nil && !IsNil(o.OutputTokens) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetOutputTokens gets a reference to the given int64 and assigns it to the OutputTokens field.
|
||
func (o *UsageReportReq) SetOutputTokens(v int64) {
|
||
o.OutputTokens = &v
|
||
}
|
||
|
||
// GetPlan returns the Plan field value if set, zero value otherwise.
|
||
func (o *UsageReportReq) GetPlan() string {
|
||
if o == nil || IsNil(o.Plan) {
|
||
var ret string
|
||
return ret
|
||
}
|
||
return *o.Plan
|
||
}
|
||
|
||
// GetPlanOk returns a tuple with the Plan field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *UsageReportReq) GetPlanOk() (*string, bool) {
|
||
if o == nil || IsNil(o.Plan) {
|
||
return nil, false
|
||
}
|
||
return o.Plan, true
|
||
}
|
||
|
||
// HasPlan returns a boolean if a field has been set.
|
||
func (o *UsageReportReq) HasPlan() bool {
|
||
if o != nil && !IsNil(o.Plan) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetPlan gets a reference to the given string and assigns it to the Plan field.
|
||
func (o *UsageReportReq) SetPlan(v string) {
|
||
o.Plan = &v
|
||
}
|
||
|
||
// GetProvider returns the Provider field value if set, zero value otherwise.
|
||
func (o *UsageReportReq) GetProvider() string {
|
||
if o == nil || IsNil(o.Provider) {
|
||
var ret string
|
||
return ret
|
||
}
|
||
return *o.Provider
|
||
}
|
||
|
||
// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *UsageReportReq) GetProviderOk() (*string, bool) {
|
||
if o == nil || IsNil(o.Provider) {
|
||
return nil, false
|
||
}
|
||
return o.Provider, true
|
||
}
|
||
|
||
// HasProvider returns a boolean if a field has been set.
|
||
func (o *UsageReportReq) HasProvider() bool {
|
||
if o != nil && !IsNil(o.Provider) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetProvider gets a reference to the given string and assigns it to the Provider field.
|
||
func (o *UsageReportReq) SetProvider(v string) {
|
||
o.Provider = &v
|
||
}
|
||
|
||
// GetRequests returns the Requests field value if set, zero value otherwise.
|
||
func (o *UsageReportReq) GetRequests() int64 {
|
||
if o == nil || IsNil(o.Requests) {
|
||
var ret int64
|
||
return ret
|
||
}
|
||
return *o.Requests
|
||
}
|
||
|
||
// GetRequestsOk returns a tuple with the Requests field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *UsageReportReq) GetRequestsOk() (*int64, bool) {
|
||
if o == nil || IsNil(o.Requests) {
|
||
return nil, false
|
||
}
|
||
return o.Requests, true
|
||
}
|
||
|
||
// HasRequests returns a boolean if a field has been set.
|
||
func (o *UsageReportReq) HasRequests() bool {
|
||
if o != nil && !IsNil(o.Requests) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetRequests gets a reference to the given int64 and assigns it to the Requests field.
|
||
func (o *UsageReportReq) SetRequests(v int64) {
|
||
o.Requests = &v
|
||
}
|
||
|
||
// GetResetsAt returns the ResetsAt field value if set, zero value otherwise.
|
||
func (o *UsageReportReq) GetResetsAt() string {
|
||
if o == nil || IsNil(o.ResetsAt) {
|
||
var ret string
|
||
return ret
|
||
}
|
||
return *o.ResetsAt
|
||
}
|
||
|
||
// GetResetsAtOk returns a tuple with the ResetsAt field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *UsageReportReq) GetResetsAtOk() (*string, bool) {
|
||
if o == nil || IsNil(o.ResetsAt) {
|
||
return nil, false
|
||
}
|
||
return o.ResetsAt, true
|
||
}
|
||
|
||
// HasResetsAt returns a boolean if a field has been set.
|
||
func (o *UsageReportReq) HasResetsAt() bool {
|
||
if o != nil && !IsNil(o.ResetsAt) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetResetsAt gets a reference to the given string and assigns it to the ResetsAt field.
|
||
func (o *UsageReportReq) SetResetsAt(v string) {
|
||
o.ResetsAt = &v
|
||
}
|
||
|
||
// GetSamples returns the Samples field value if set, zero value otherwise.
|
||
func (o *UsageReportReq) GetSamples() []UsageSampleReq {
|
||
if o == nil || IsNil(o.Samples) {
|
||
var ret []UsageSampleReq
|
||
return ret
|
||
}
|
||
return o.Samples
|
||
}
|
||
|
||
// GetSamplesOk returns a tuple with the Samples field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *UsageReportReq) GetSamplesOk() ([]UsageSampleReq, bool) {
|
||
if o == nil || IsNil(o.Samples) {
|
||
return nil, false
|
||
}
|
||
return o.Samples, true
|
||
}
|
||
|
||
// HasSamples returns a boolean if a field has been set.
|
||
func (o *UsageReportReq) HasSamples() bool {
|
||
if o != nil && !IsNil(o.Samples) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetSamples gets a reference to the given []UsageSampleReq and assigns it to the Samples field.
|
||
func (o *UsageReportReq) SetSamples(v []UsageSampleReq) {
|
||
o.Samples = v
|
||
}
|
||
|
||
// GetSynthetic returns the Synthetic field value if set, zero value otherwise.
|
||
func (o *UsageReportReq) GetSynthetic() bool {
|
||
if o == nil || IsNil(o.Synthetic) {
|
||
var ret bool
|
||
return ret
|
||
}
|
||
return *o.Synthetic
|
||
}
|
||
|
||
// GetSyntheticOk returns a tuple with the Synthetic field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *UsageReportReq) GetSyntheticOk() (*bool, bool) {
|
||
if o == nil || IsNil(o.Synthetic) {
|
||
return nil, false
|
||
}
|
||
return o.Synthetic, true
|
||
}
|
||
|
||
// HasSynthetic returns a boolean if a field has been set.
|
||
func (o *UsageReportReq) HasSynthetic() bool {
|
||
if o != nil && !IsNil(o.Synthetic) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetSynthetic gets a reference to the given bool and assigns it to the Synthetic field.
|
||
func (o *UsageReportReq) SetSynthetic(v bool) {
|
||
o.Synthetic = &v
|
||
}
|
||
|
||
// GetTotalTokens returns the TotalTokens field value if set, zero value otherwise.
|
||
func (o *UsageReportReq) GetTotalTokens() int64 {
|
||
if o == nil || IsNil(o.TotalTokens) {
|
||
var ret int64
|
||
return ret
|
||
}
|
||
return *o.TotalTokens
|
||
}
|
||
|
||
// GetTotalTokensOk returns a tuple with the TotalTokens field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *UsageReportReq) GetTotalTokensOk() (*int64, bool) {
|
||
if o == nil || IsNil(o.TotalTokens) {
|
||
return nil, false
|
||
}
|
||
return o.TotalTokens, true
|
||
}
|
||
|
||
// HasTotalTokens returns a boolean if a field has been set.
|
||
func (o *UsageReportReq) HasTotalTokens() bool {
|
||
if o != nil && !IsNil(o.TotalTokens) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetTotalTokens gets a reference to the given int64 and assigns it to the TotalTokens field.
|
||
func (o *UsageReportReq) SetTotalTokens(v int64) {
|
||
o.TotalTokens = &v
|
||
}
|
||
|
||
// GetUsedPct returns the UsedPct field value if set, zero value otherwise.
|
||
func (o *UsageReportReq) GetUsedPct() float64 {
|
||
if o == nil || IsNil(o.UsedPct) {
|
||
var ret float64
|
||
return ret
|
||
}
|
||
return *o.UsedPct
|
||
}
|
||
|
||
// GetUsedPctOk returns a tuple with the UsedPct field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *UsageReportReq) GetUsedPctOk() (*float64, bool) {
|
||
if o == nil || IsNil(o.UsedPct) {
|
||
return nil, false
|
||
}
|
||
return o.UsedPct, true
|
||
}
|
||
|
||
// HasUsedPct returns a boolean if a field has been set.
|
||
func (o *UsageReportReq) HasUsedPct() bool {
|
||
if o != nil && !IsNil(o.UsedPct) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetUsedPct gets a reference to the given float64 and assigns it to the UsedPct field.
|
||
func (o *UsageReportReq) SetUsedPct(v float64) {
|
||
o.UsedPct = &v
|
||
}
|
||
|
||
// GetWindow returns the Window field value if set, zero value otherwise.
|
||
func (o *UsageReportReq) GetWindow() string {
|
||
if o == nil || IsNil(o.Window) {
|
||
var ret string
|
||
return ret
|
||
}
|
||
return *o.Window
|
||
}
|
||
|
||
// GetWindowOk returns a tuple with the Window field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *UsageReportReq) GetWindowOk() (*string, bool) {
|
||
if o == nil || IsNil(o.Window) {
|
||
return nil, false
|
||
}
|
||
return o.Window, true
|
||
}
|
||
|
||
// HasWindow returns a boolean if a field has been set.
|
||
func (o *UsageReportReq) HasWindow() bool {
|
||
if o != nil && !IsNil(o.Window) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetWindow gets a reference to the given string and assigns it to the Window field.
|
||
func (o *UsageReportReq) SetWindow(v string) {
|
||
o.Window = &v
|
||
}
|
||
|
||
// GetWindowMinutes returns the WindowMinutes field value if set, zero value otherwise.
|
||
func (o *UsageReportReq) GetWindowMinutes() int32 {
|
||
if o == nil || IsNil(o.WindowMinutes) {
|
||
var ret int32
|
||
return ret
|
||
}
|
||
return *o.WindowMinutes
|
||
}
|
||
|
||
// GetWindowMinutesOk returns a tuple with the WindowMinutes field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *UsageReportReq) GetWindowMinutesOk() (*int32, bool) {
|
||
if o == nil || IsNil(o.WindowMinutes) {
|
||
return nil, false
|
||
}
|
||
return o.WindowMinutes, true
|
||
}
|
||
|
||
// HasWindowMinutes returns a boolean if a field has been set.
|
||
func (o *UsageReportReq) HasWindowMinutes() bool {
|
||
if o != nil && !IsNil(o.WindowMinutes) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetWindowMinutes gets a reference to the given int32 and assigns it to the WindowMinutes field.
|
||
func (o *UsageReportReq) SetWindowMinutes(v int32) {
|
||
o.WindowMinutes = &v
|
||
}
|
||
|
||
// GetWindowStart returns the WindowStart field value if set, zero value otherwise.
|
||
func (o *UsageReportReq) GetWindowStart() string {
|
||
if o == nil || IsNil(o.WindowStart) {
|
||
var ret string
|
||
return ret
|
||
}
|
||
return *o.WindowStart
|
||
}
|
||
|
||
// GetWindowStartOk returns a tuple with the WindowStart field value if set, nil otherwise
|
||
// and a boolean to check if the value has been set.
|
||
func (o *UsageReportReq) GetWindowStartOk() (*string, bool) {
|
||
if o == nil || IsNil(o.WindowStart) {
|
||
return nil, false
|
||
}
|
||
return o.WindowStart, true
|
||
}
|
||
|
||
// HasWindowStart returns a boolean if a field has been set.
|
||
func (o *UsageReportReq) HasWindowStart() bool {
|
||
if o != nil && !IsNil(o.WindowStart) {
|
||
return true
|
||
}
|
||
|
||
return false
|
||
}
|
||
|
||
// SetWindowStart gets a reference to the given string and assigns it to the WindowStart field.
|
||
func (o *UsageReportReq) SetWindowStart(v string) {
|
||
o.WindowStart = &v
|
||
}
|
||
|
||
func (o UsageReportReq) MarshalJSON() ([]byte, error) {
|
||
toSerialize, err := o.ToMap()
|
||
if err != nil {
|
||
return []byte{}, err
|
||
}
|
||
return json.Marshal(toSerialize)
|
||
}
|
||
|
||
func (o UsageReportReq) ToMap() (map[string]interface{}, error) {
|
||
toSerialize := map[string]interface{}{}
|
||
if !IsNil(o.Account) {
|
||
toSerialize["account"] = o.Account
|
||
}
|
||
if !IsNil(o.CachedInputTokens) {
|
||
toSerialize["cachedInputTokens"] = o.CachedInputTokens
|
||
}
|
||
if !IsNil(o.Confidence) {
|
||
toSerialize["confidence"] = o.Confidence
|
||
}
|
||
if !IsNil(o.CostCents) {
|
||
toSerialize["costCents"] = o.CostCents
|
||
}
|
||
if !IsNil(o.CostLimitCents) {
|
||
toSerialize["costLimitCents"] = o.CostLimitCents
|
||
}
|
||
if !IsNil(o.Currency) {
|
||
toSerialize["currency"] = o.Currency
|
||
}
|
||
if !IsNil(o.InputTokens) {
|
||
toSerialize["inputTokens"] = o.InputTokens
|
||
}
|
||
if !IsNil(o.Kind) {
|
||
toSerialize["kind"] = o.Kind
|
||
}
|
||
if !IsNil(o.Lane) {
|
||
toSerialize["lane"] = o.Lane
|
||
}
|
||
if !IsNil(o.Machine) {
|
||
toSerialize["machine"] = o.Machine
|
||
}
|
||
if !IsNil(o.OutputTokens) {
|
||
toSerialize["outputTokens"] = o.OutputTokens
|
||
}
|
||
if !IsNil(o.Plan) {
|
||
toSerialize["plan"] = o.Plan
|
||
}
|
||
if !IsNil(o.Provider) {
|
||
toSerialize["provider"] = o.Provider
|
||
}
|
||
if !IsNil(o.Requests) {
|
||
toSerialize["requests"] = o.Requests
|
||
}
|
||
if !IsNil(o.ResetsAt) {
|
||
toSerialize["resetsAt"] = o.ResetsAt
|
||
}
|
||
if !IsNil(o.Samples) {
|
||
toSerialize["samples"] = o.Samples
|
||
}
|
||
if !IsNil(o.Synthetic) {
|
||
toSerialize["synthetic"] = o.Synthetic
|
||
}
|
||
if !IsNil(o.TotalTokens) {
|
||
toSerialize["totalTokens"] = o.TotalTokens
|
||
}
|
||
if !IsNil(o.UsedPct) {
|
||
toSerialize["usedPct"] = o.UsedPct
|
||
}
|
||
if !IsNil(o.Window) {
|
||
toSerialize["window"] = o.Window
|
||
}
|
||
if !IsNil(o.WindowMinutes) {
|
||
toSerialize["windowMinutes"] = o.WindowMinutes
|
||
}
|
||
if !IsNil(o.WindowStart) {
|
||
toSerialize["windowStart"] = o.WindowStart
|
||
}
|
||
|
||
for key, value := range o.AdditionalProperties {
|
||
toSerialize[key] = value
|
||
}
|
||
|
||
return toSerialize, nil
|
||
}
|
||
|
||
func (o *UsageReportReq) UnmarshalJSON(data []byte) (err error) {
|
||
varUsageReportReq := _UsageReportReq{}
|
||
|
||
err = json.Unmarshal(data, &varUsageReportReq)
|
||
|
||
if err != nil {
|
||
return err
|
||
}
|
||
|
||
*o = UsageReportReq(varUsageReportReq)
|
||
|
||
additionalProperties := make(map[string]interface{})
|
||
|
||
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
||
delete(additionalProperties, "account")
|
||
delete(additionalProperties, "cachedInputTokens")
|
||
delete(additionalProperties, "confidence")
|
||
delete(additionalProperties, "costCents")
|
||
delete(additionalProperties, "costLimitCents")
|
||
delete(additionalProperties, "currency")
|
||
delete(additionalProperties, "inputTokens")
|
||
delete(additionalProperties, "kind")
|
||
delete(additionalProperties, "lane")
|
||
delete(additionalProperties, "machine")
|
||
delete(additionalProperties, "outputTokens")
|
||
delete(additionalProperties, "plan")
|
||
delete(additionalProperties, "provider")
|
||
delete(additionalProperties, "requests")
|
||
delete(additionalProperties, "resetsAt")
|
||
delete(additionalProperties, "samples")
|
||
delete(additionalProperties, "synthetic")
|
||
delete(additionalProperties, "totalTokens")
|
||
delete(additionalProperties, "usedPct")
|
||
delete(additionalProperties, "window")
|
||
delete(additionalProperties, "windowMinutes")
|
||
delete(additionalProperties, "windowStart")
|
||
o.AdditionalProperties = additionalProperties
|
||
}
|
||
|
||
return err
|
||
}
|
||
|
||
type NullableUsageReportReq struct {
|
||
value *UsageReportReq
|
||
isSet bool
|
||
}
|
||
|
||
func (v NullableUsageReportReq) Get() *UsageReportReq {
|
||
return v.value
|
||
}
|
||
|
||
func (v *NullableUsageReportReq) Set(val *UsageReportReq) {
|
||
v.value = val
|
||
v.isSet = true
|
||
}
|
||
|
||
func (v NullableUsageReportReq) IsSet() bool {
|
||
return v.isSet
|
||
}
|
||
|
||
func (v *NullableUsageReportReq) Unset() {
|
||
v.value = nil
|
||
v.isSet = false
|
||
}
|
||
|
||
func NewNullableUsageReportReq(val *UsageReportReq) *NullableUsageReportReq {
|
||
return &NullableUsageReportReq{value: val, isSet: true}
|
||
}
|
||
|
||
func (v NullableUsageReportReq) MarshalJSON() ([]byte, error) {
|
||
return json.Marshal(v.value)
|
||
}
|
||
|
||
func (v *NullableUsageReportReq) UnmarshalJSON(src []byte) error {
|
||
v.isSet = true
|
||
return json.Unmarshal(src, &v.value)
|
||
}
|