Files
sdk/model_usage_dash_resp.go

497 lines
13 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 UsageDashResp type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &UsageDashResp{}
// UsageDashResp struct for UsageDashResp
type UsageDashResp struct {
// Account is the linked account that was asked about, when one was named.
Account *string `json:"account,omitempty"`
// Available is false when the warehouse could not be read. That means \"no answer\", NOT \"no usage\" — the two lists below are then empty for a reason.
Available *bool `json:"available,omitempty"`
// Current is the newest window instance of each lane — the dash headline.
Current []UsageUsageWindowView `json:"current,omitempty"`
// From is the inclusive start of that window, RFC3339 UTC.
From *string `json:"from,omitempty"`
// Provider is the upstream that was asked about, echoed back.
Provider *string `json:"provider,omitempty"`
// Range is the window that was served: 1h, 24h, 7d or 30d.
Range *string `json:"range,omitempty"`
// Scope says whose rows these are: the caller's own linked accounts.
Scope *string `json:"scope,omitempty"`
// Source names the meter of record — the provider's own login, not Hanzo.
Source *string `json:"source,omitempty"`
// To is the exclusive end of that window, RFC3339 UTC.
To *string `json:"to,omitempty"`
// Windows is every instance in range, newest first — the history behind it.
Windows []UsageUsageWindowView `json:"windows,omitempty"`
AdditionalProperties map[string]interface{}
}
type _UsageDashResp UsageDashResp
// NewUsageDashResp instantiates a new UsageDashResp 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 NewUsageDashResp() *UsageDashResp {
this := UsageDashResp{}
return &this
}
// NewUsageDashRespWithDefaults instantiates a new UsageDashResp 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 NewUsageDashRespWithDefaults() *UsageDashResp {
this := UsageDashResp{}
return &this
}
// GetAccount returns the Account field value if set, zero value otherwise.
func (o *UsageDashResp) 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 *UsageDashResp) 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 *UsageDashResp) 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 *UsageDashResp) SetAccount(v string) {
o.Account = &v
}
// GetAvailable returns the Available field value if set, zero value otherwise.
func (o *UsageDashResp) GetAvailable() bool {
if o == nil || IsNil(o.Available) {
var ret bool
return ret
}
return *o.Available
}
// GetAvailableOk returns a tuple with the Available field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UsageDashResp) GetAvailableOk() (*bool, bool) {
if o == nil || IsNil(o.Available) {
return nil, false
}
return o.Available, true
}
// HasAvailable returns a boolean if a field has been set.
func (o *UsageDashResp) HasAvailable() bool {
if o != nil && !IsNil(o.Available) {
return true
}
return false
}
// SetAvailable gets a reference to the given bool and assigns it to the Available field.
func (o *UsageDashResp) SetAvailable(v bool) {
o.Available = &v
}
// GetCurrent returns the Current field value if set, zero value otherwise.
func (o *UsageDashResp) GetCurrent() []UsageUsageWindowView {
if o == nil || IsNil(o.Current) {
var ret []UsageUsageWindowView
return ret
}
return o.Current
}
// GetCurrentOk returns a tuple with the Current field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UsageDashResp) GetCurrentOk() ([]UsageUsageWindowView, bool) {
if o == nil || IsNil(o.Current) {
return nil, false
}
return o.Current, true
}
// HasCurrent returns a boolean if a field has been set.
func (o *UsageDashResp) HasCurrent() bool {
if o != nil && !IsNil(o.Current) {
return true
}
return false
}
// SetCurrent gets a reference to the given []UsageUsageWindowView and assigns it to the Current field.
func (o *UsageDashResp) SetCurrent(v []UsageUsageWindowView) {
o.Current = v
}
// GetFrom returns the From field value if set, zero value otherwise.
func (o *UsageDashResp) GetFrom() string {
if o == nil || IsNil(o.From) {
var ret string
return ret
}
return *o.From
}
// GetFromOk returns a tuple with the From field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UsageDashResp) GetFromOk() (*string, bool) {
if o == nil || IsNil(o.From) {
return nil, false
}
return o.From, true
}
// HasFrom returns a boolean if a field has been set.
func (o *UsageDashResp) HasFrom() bool {
if o != nil && !IsNil(o.From) {
return true
}
return false
}
// SetFrom gets a reference to the given string and assigns it to the From field.
func (o *UsageDashResp) SetFrom(v string) {
o.From = &v
}
// GetProvider returns the Provider field value if set, zero value otherwise.
func (o *UsageDashResp) 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 *UsageDashResp) 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 *UsageDashResp) 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 *UsageDashResp) SetProvider(v string) {
o.Provider = &v
}
// GetRange returns the Range field value if set, zero value otherwise.
func (o *UsageDashResp) GetRange() string {
if o == nil || IsNil(o.Range) {
var ret string
return ret
}
return *o.Range
}
// GetRangeOk returns a tuple with the Range field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UsageDashResp) GetRangeOk() (*string, bool) {
if o == nil || IsNil(o.Range) {
return nil, false
}
return o.Range, true
}
// HasRange returns a boolean if a field has been set.
func (o *UsageDashResp) HasRange() bool {
if o != nil && !IsNil(o.Range) {
return true
}
return false
}
// SetRange gets a reference to the given string and assigns it to the Range field.
func (o *UsageDashResp) SetRange(v string) {
o.Range = &v
}
// GetScope returns the Scope field value if set, zero value otherwise.
func (o *UsageDashResp) GetScope() string {
if o == nil || IsNil(o.Scope) {
var ret string
return ret
}
return *o.Scope
}
// GetScopeOk returns a tuple with the Scope field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UsageDashResp) GetScopeOk() (*string, bool) {
if o == nil || IsNil(o.Scope) {
return nil, false
}
return o.Scope, true
}
// HasScope returns a boolean if a field has been set.
func (o *UsageDashResp) HasScope() bool {
if o != nil && !IsNil(o.Scope) {
return true
}
return false
}
// SetScope gets a reference to the given string and assigns it to the Scope field.
func (o *UsageDashResp) SetScope(v string) {
o.Scope = &v
}
// GetSource returns the Source field value if set, zero value otherwise.
func (o *UsageDashResp) GetSource() string {
if o == nil || IsNil(o.Source) {
var ret string
return ret
}
return *o.Source
}
// GetSourceOk returns a tuple with the Source field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UsageDashResp) GetSourceOk() (*string, bool) {
if o == nil || IsNil(o.Source) {
return nil, false
}
return o.Source, true
}
// HasSource returns a boolean if a field has been set.
func (o *UsageDashResp) HasSource() bool {
if o != nil && !IsNil(o.Source) {
return true
}
return false
}
// SetSource gets a reference to the given string and assigns it to the Source field.
func (o *UsageDashResp) SetSource(v string) {
o.Source = &v
}
// GetTo returns the To field value if set, zero value otherwise.
func (o *UsageDashResp) GetTo() string {
if o == nil || IsNil(o.To) {
var ret string
return ret
}
return *o.To
}
// GetToOk returns a tuple with the To field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UsageDashResp) GetToOk() (*string, bool) {
if o == nil || IsNil(o.To) {
return nil, false
}
return o.To, true
}
// HasTo returns a boolean if a field has been set.
func (o *UsageDashResp) HasTo() bool {
if o != nil && !IsNil(o.To) {
return true
}
return false
}
// SetTo gets a reference to the given string and assigns it to the To field.
func (o *UsageDashResp) SetTo(v string) {
o.To = &v
}
// GetWindows returns the Windows field value if set, zero value otherwise.
func (o *UsageDashResp) GetWindows() []UsageUsageWindowView {
if o == nil || IsNil(o.Windows) {
var ret []UsageUsageWindowView
return ret
}
return o.Windows
}
// GetWindowsOk returns a tuple with the Windows field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UsageDashResp) GetWindowsOk() ([]UsageUsageWindowView, bool) {
if o == nil || IsNil(o.Windows) {
return nil, false
}
return o.Windows, true
}
// HasWindows returns a boolean if a field has been set.
func (o *UsageDashResp) HasWindows() bool {
if o != nil && !IsNil(o.Windows) {
return true
}
return false
}
// SetWindows gets a reference to the given []UsageUsageWindowView and assigns it to the Windows field.
func (o *UsageDashResp) SetWindows(v []UsageUsageWindowView) {
o.Windows = v
}
func (o UsageDashResp) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o UsageDashResp) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Account) {
toSerialize["account"] = o.Account
}
if !IsNil(o.Available) {
toSerialize["available"] = o.Available
}
if !IsNil(o.Current) {
toSerialize["current"] = o.Current
}
if !IsNil(o.From) {
toSerialize["from"] = o.From
}
if !IsNil(o.Provider) {
toSerialize["provider"] = o.Provider
}
if !IsNil(o.Range) {
toSerialize["range"] = o.Range
}
if !IsNil(o.Scope) {
toSerialize["scope"] = o.Scope
}
if !IsNil(o.Source) {
toSerialize["source"] = o.Source
}
if !IsNil(o.To) {
toSerialize["to"] = o.To
}
if !IsNil(o.Windows) {
toSerialize["windows"] = o.Windows
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *UsageDashResp) UnmarshalJSON(data []byte) (err error) {
varUsageDashResp := _UsageDashResp{}
err = json.Unmarshal(data, &varUsageDashResp)
if err != nil {
return err
}
*o = UsageDashResp(varUsageDashResp)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "account")
delete(additionalProperties, "available")
delete(additionalProperties, "current")
delete(additionalProperties, "from")
delete(additionalProperties, "provider")
delete(additionalProperties, "range")
delete(additionalProperties, "scope")
delete(additionalProperties, "source")
delete(additionalProperties, "to")
delete(additionalProperties, "windows")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableUsageDashResp struct {
value *UsageDashResp
isSet bool
}
func (v NullableUsageDashResp) Get() *UsageDashResp {
return v.value
}
func (v *NullableUsageDashResp) Set(val *UsageDashResp) {
v.value = val
v.isSet = true
}
func (v NullableUsageDashResp) IsSet() bool {
return v.isSet
}
func (v *NullableUsageDashResp) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableUsageDashResp(val *UsageDashResp) *NullableUsageDashResp {
return &NullableUsageDashResp{value: val, isSet: true}
}
func (v NullableUsageDashResp) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableUsageDashResp) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}