Files
sdk/model_link_total_view.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 LinkTotalView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &LinkTotalView{}
// LinkTotalView struct for LinkTotalView
type LinkTotalView struct {
// Confidence says how real the row's numbers are.
Confidence *string `json:"confidence,omitempty"`
// CostCents is the period's spend in cents, in the row's own ledger.
CostCents *int64 `json:"costCents,omitempty"`
// Provider is the provider the row totals.
Provider *string `json:"provider,omitempty"`
// Requests is the period's request count.
Requests *int64 `json:"requests,omitempty"`
// Scope is whose usage the row measures: user or org.
Scope *string `json:"scope,omitempty"`
// Source is whose meter the row came from: account or hanzo.
Source *string `json:"source,omitempty"`
// Tokens is the period's total token count.
Tokens *int64 `json:"tokens,omitempty"`
// UsedPct is the plan consumption percentage, on the account side.
UsedPct *float64 `json:"usedPct,omitempty"`
// Window is the window class the row totals, on the account side.
Window *string `json:"window,omitempty"`
// Windows is how many window instances the row folds.
Windows *int64 `json:"windows,omitempty"`
AdditionalProperties map[string]interface{}
}
type _LinkTotalView LinkTotalView
// NewLinkTotalView instantiates a new LinkTotalView 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 NewLinkTotalView() *LinkTotalView {
this := LinkTotalView{}
return &this
}
// NewLinkTotalViewWithDefaults instantiates a new LinkTotalView 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 NewLinkTotalViewWithDefaults() *LinkTotalView {
this := LinkTotalView{}
return &this
}
// GetConfidence returns the Confidence field value if set, zero value otherwise.
func (o *LinkTotalView) 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 *LinkTotalView) 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 *LinkTotalView) 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 *LinkTotalView) SetConfidence(v string) {
o.Confidence = &v
}
// GetCostCents returns the CostCents field value if set, zero value otherwise.
func (o *LinkTotalView) 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 *LinkTotalView) 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 *LinkTotalView) 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 *LinkTotalView) SetCostCents(v int64) {
o.CostCents = &v
}
// GetProvider returns the Provider field value if set, zero value otherwise.
func (o *LinkTotalView) 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 *LinkTotalView) 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 *LinkTotalView) 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 *LinkTotalView) SetProvider(v string) {
o.Provider = &v
}
// GetRequests returns the Requests field value if set, zero value otherwise.
func (o *LinkTotalView) 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 *LinkTotalView) 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 *LinkTotalView) 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 *LinkTotalView) SetRequests(v int64) {
o.Requests = &v
}
// GetScope returns the Scope field value if set, zero value otherwise.
func (o *LinkTotalView) 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 *LinkTotalView) 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 *LinkTotalView) 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 *LinkTotalView) SetScope(v string) {
o.Scope = &v
}
// GetSource returns the Source field value if set, zero value otherwise.
func (o *LinkTotalView) 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 *LinkTotalView) 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 *LinkTotalView) 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 *LinkTotalView) SetSource(v string) {
o.Source = &v
}
// GetTokens returns the Tokens field value if set, zero value otherwise.
func (o *LinkTotalView) GetTokens() int64 {
if o == nil || IsNil(o.Tokens) {
var ret int64
return ret
}
return *o.Tokens
}
// GetTokensOk returns a tuple with the Tokens field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LinkTotalView) GetTokensOk() (*int64, bool) {
if o == nil || IsNil(o.Tokens) {
return nil, false
}
return o.Tokens, true
}
// HasTokens returns a boolean if a field has been set.
func (o *LinkTotalView) HasTokens() bool {
if o != nil && !IsNil(o.Tokens) {
return true
}
return false
}
// SetTokens gets a reference to the given int64 and assigns it to the Tokens field.
func (o *LinkTotalView) SetTokens(v int64) {
o.Tokens = &v
}
// GetUsedPct returns the UsedPct field value if set, zero value otherwise.
func (o *LinkTotalView) 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 *LinkTotalView) 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 *LinkTotalView) 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 *LinkTotalView) SetUsedPct(v float64) {
o.UsedPct = &v
}
// GetWindow returns the Window field value if set, zero value otherwise.
func (o *LinkTotalView) 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 *LinkTotalView) 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 *LinkTotalView) 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 *LinkTotalView) SetWindow(v string) {
o.Window = &v
}
// GetWindows returns the Windows field value if set, zero value otherwise.
func (o *LinkTotalView) GetWindows() int64 {
if o == nil || IsNil(o.Windows) {
var ret int64
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 *LinkTotalView) GetWindowsOk() (*int64, 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 *LinkTotalView) HasWindows() bool {
if o != nil && !IsNil(o.Windows) {
return true
}
return false
}
// SetWindows gets a reference to the given int64 and assigns it to the Windows field.
func (o *LinkTotalView) SetWindows(v int64) {
o.Windows = &v
}
func (o LinkTotalView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o LinkTotalView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Confidence) {
toSerialize["confidence"] = o.Confidence
}
if !IsNil(o.CostCents) {
toSerialize["costCents"] = o.CostCents
}
if !IsNil(o.Provider) {
toSerialize["provider"] = o.Provider
}
if !IsNil(o.Requests) {
toSerialize["requests"] = o.Requests
}
if !IsNil(o.Scope) {
toSerialize["scope"] = o.Scope
}
if !IsNil(o.Source) {
toSerialize["source"] = o.Source
}
if !IsNil(o.Tokens) {
toSerialize["tokens"] = o.Tokens
}
if !IsNil(o.UsedPct) {
toSerialize["usedPct"] = o.UsedPct
}
if !IsNil(o.Window) {
toSerialize["window"] = o.Window
}
if !IsNil(o.Windows) {
toSerialize["windows"] = o.Windows
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *LinkTotalView) UnmarshalJSON(data []byte) (err error) {
varLinkTotalView := _LinkTotalView{}
err = json.Unmarshal(data, &varLinkTotalView)
if err != nil {
return err
}
*o = LinkTotalView(varLinkTotalView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "confidence")
delete(additionalProperties, "costCents")
delete(additionalProperties, "provider")
delete(additionalProperties, "requests")
delete(additionalProperties, "scope")
delete(additionalProperties, "source")
delete(additionalProperties, "tokens")
delete(additionalProperties, "usedPct")
delete(additionalProperties, "window")
delete(additionalProperties, "windows")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableLinkTotalView struct {
value *LinkTotalView
isSet bool
}
func (v NullableLinkTotalView) Get() *LinkTotalView {
return v.value
}
func (v *NullableLinkTotalView) Set(val *LinkTotalView) {
v.value = val
v.isSet = true
}
func (v NullableLinkTotalView) IsSet() bool {
return v.isSet
}
func (v *NullableLinkTotalView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableLinkTotalView(val *LinkTotalView) *NullableLinkTotalView {
return &NullableLinkTotalView{value: val, isSet: true}
}
func (v NullableLinkTotalView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableLinkTotalView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}