Files
sdk/model_usage_usage_analytics_view.go

421 lines
12 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 UsageUsageAnalyticsView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &UsageUsageAnalyticsView{}
// UsageUsageAnalyticsView struct for UsageUsageAnalyticsView
type UsageUsageAnalyticsView struct {
// End is the window's exclusive end, RFC3339 UTC.
End *string `json:"end,omitempty"`
// Export is whether the resolved plan allows exporting these rows.
Export *bool `json:"export,omitempty"`
// Plan echoes the plan id the entitlement was resolved from.
Plan *string `json:"plan,omitempty"`
// Providers is the per-provider roll-up over the window.
Providers *UsageProviderBreakdown `json:"providers,omitempty"`
// Range is the label that was ASKED for. A plan whose retention is shorter than that window is served the retention instead, so read start and end for the window the rows actually cover and retentionDays for the reason — on a clamped read the label is longer than what was served.
Range *string `json:"range,omitempty"`
// RetentionDays is how far back the resolved plan allows reading.
RetentionDays *int64 `json:"retentionDays,omitempty"`
// Scope is the tenant the rows were read under — the validated principal's org.
Scope *UsageUsageScope `json:"scope,omitempty"`
// Start is the window's inclusive start, RFC3339 UTC, AFTER the retention clamp — so it may be later than the start that was asked for.
Start *string `json:"start,omitempty"`
AdditionalProperties map[string]interface{}
}
type _UsageUsageAnalyticsView UsageUsageAnalyticsView
// NewUsageUsageAnalyticsView instantiates a new UsageUsageAnalyticsView 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 NewUsageUsageAnalyticsView() *UsageUsageAnalyticsView {
this := UsageUsageAnalyticsView{}
return &this
}
// NewUsageUsageAnalyticsViewWithDefaults instantiates a new UsageUsageAnalyticsView 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 NewUsageUsageAnalyticsViewWithDefaults() *UsageUsageAnalyticsView {
this := UsageUsageAnalyticsView{}
return &this
}
// GetEnd returns the End field value if set, zero value otherwise.
func (o *UsageUsageAnalyticsView) GetEnd() string {
if o == nil || IsNil(o.End) {
var ret string
return ret
}
return *o.End
}
// GetEndOk returns a tuple with the End field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UsageUsageAnalyticsView) GetEndOk() (*string, bool) {
if o == nil || IsNil(o.End) {
return nil, false
}
return o.End, true
}
// HasEnd returns a boolean if a field has been set.
func (o *UsageUsageAnalyticsView) HasEnd() bool {
if o != nil && !IsNil(o.End) {
return true
}
return false
}
// SetEnd gets a reference to the given string and assigns it to the End field.
func (o *UsageUsageAnalyticsView) SetEnd(v string) {
o.End = &v
}
// GetExport returns the Export field value if set, zero value otherwise.
func (o *UsageUsageAnalyticsView) GetExport() bool {
if o == nil || IsNil(o.Export) {
var ret bool
return ret
}
return *o.Export
}
// GetExportOk returns a tuple with the Export field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UsageUsageAnalyticsView) GetExportOk() (*bool, bool) {
if o == nil || IsNil(o.Export) {
return nil, false
}
return o.Export, true
}
// HasExport returns a boolean if a field has been set.
func (o *UsageUsageAnalyticsView) HasExport() bool {
if o != nil && !IsNil(o.Export) {
return true
}
return false
}
// SetExport gets a reference to the given bool and assigns it to the Export field.
func (o *UsageUsageAnalyticsView) SetExport(v bool) {
o.Export = &v
}
// GetPlan returns the Plan field value if set, zero value otherwise.
func (o *UsageUsageAnalyticsView) 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 *UsageUsageAnalyticsView) 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 *UsageUsageAnalyticsView) 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 *UsageUsageAnalyticsView) SetPlan(v string) {
o.Plan = &v
}
// GetProviders returns the Providers field value if set, zero value otherwise.
func (o *UsageUsageAnalyticsView) GetProviders() UsageProviderBreakdown {
if o == nil || IsNil(o.Providers) {
var ret UsageProviderBreakdown
return ret
}
return *o.Providers
}
// GetProvidersOk returns a tuple with the Providers field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UsageUsageAnalyticsView) GetProvidersOk() (*UsageProviderBreakdown, bool) {
if o == nil || IsNil(o.Providers) {
return nil, false
}
return o.Providers, true
}
// HasProviders returns a boolean if a field has been set.
func (o *UsageUsageAnalyticsView) HasProviders() bool {
if o != nil && !IsNil(o.Providers) {
return true
}
return false
}
// SetProviders gets a reference to the given UsageProviderBreakdown and assigns it to the Providers field.
func (o *UsageUsageAnalyticsView) SetProviders(v UsageProviderBreakdown) {
o.Providers = &v
}
// GetRange returns the Range field value if set, zero value otherwise.
func (o *UsageUsageAnalyticsView) 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 *UsageUsageAnalyticsView) 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 *UsageUsageAnalyticsView) 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 *UsageUsageAnalyticsView) SetRange(v string) {
o.Range = &v
}
// GetRetentionDays returns the RetentionDays field value if set, zero value otherwise.
func (o *UsageUsageAnalyticsView) GetRetentionDays() int64 {
if o == nil || IsNil(o.RetentionDays) {
var ret int64
return ret
}
return *o.RetentionDays
}
// GetRetentionDaysOk returns a tuple with the RetentionDays field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UsageUsageAnalyticsView) GetRetentionDaysOk() (*int64, bool) {
if o == nil || IsNil(o.RetentionDays) {
return nil, false
}
return o.RetentionDays, true
}
// HasRetentionDays returns a boolean if a field has been set.
func (o *UsageUsageAnalyticsView) HasRetentionDays() bool {
if o != nil && !IsNil(o.RetentionDays) {
return true
}
return false
}
// SetRetentionDays gets a reference to the given int64 and assigns it to the RetentionDays field.
func (o *UsageUsageAnalyticsView) SetRetentionDays(v int64) {
o.RetentionDays = &v
}
// GetScope returns the Scope field value if set, zero value otherwise.
func (o *UsageUsageAnalyticsView) GetScope() UsageUsageScope {
if o == nil || IsNil(o.Scope) {
var ret UsageUsageScope
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 *UsageUsageAnalyticsView) GetScopeOk() (*UsageUsageScope, 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 *UsageUsageAnalyticsView) HasScope() bool {
if o != nil && !IsNil(o.Scope) {
return true
}
return false
}
// SetScope gets a reference to the given UsageUsageScope and assigns it to the Scope field.
func (o *UsageUsageAnalyticsView) SetScope(v UsageUsageScope) {
o.Scope = &v
}
// GetStart returns the Start field value if set, zero value otherwise.
func (o *UsageUsageAnalyticsView) GetStart() string {
if o == nil || IsNil(o.Start) {
var ret string
return ret
}
return *o.Start
}
// GetStartOk returns a tuple with the Start field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UsageUsageAnalyticsView) GetStartOk() (*string, bool) {
if o == nil || IsNil(o.Start) {
return nil, false
}
return o.Start, true
}
// HasStart returns a boolean if a field has been set.
func (o *UsageUsageAnalyticsView) HasStart() bool {
if o != nil && !IsNil(o.Start) {
return true
}
return false
}
// SetStart gets a reference to the given string and assigns it to the Start field.
func (o *UsageUsageAnalyticsView) SetStart(v string) {
o.Start = &v
}
func (o UsageUsageAnalyticsView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o UsageUsageAnalyticsView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.End) {
toSerialize["end"] = o.End
}
if !IsNil(o.Export) {
toSerialize["export"] = o.Export
}
if !IsNil(o.Plan) {
toSerialize["plan"] = o.Plan
}
if !IsNil(o.Providers) {
toSerialize["providers"] = o.Providers
}
if !IsNil(o.Range) {
toSerialize["range"] = o.Range
}
if !IsNil(o.RetentionDays) {
toSerialize["retentionDays"] = o.RetentionDays
}
if !IsNil(o.Scope) {
toSerialize["scope"] = o.Scope
}
if !IsNil(o.Start) {
toSerialize["start"] = o.Start
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *UsageUsageAnalyticsView) UnmarshalJSON(data []byte) (err error) {
varUsageUsageAnalyticsView := _UsageUsageAnalyticsView{}
err = json.Unmarshal(data, &varUsageUsageAnalyticsView)
if err != nil {
return err
}
*o = UsageUsageAnalyticsView(varUsageUsageAnalyticsView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "end")
delete(additionalProperties, "export")
delete(additionalProperties, "plan")
delete(additionalProperties, "providers")
delete(additionalProperties, "range")
delete(additionalProperties, "retentionDays")
delete(additionalProperties, "scope")
delete(additionalProperties, "start")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableUsageUsageAnalyticsView struct {
value *UsageUsageAnalyticsView
isSet bool
}
func (v NullableUsageUsageAnalyticsView) Get() *UsageUsageAnalyticsView {
return v.value
}
func (v *NullableUsageUsageAnalyticsView) Set(val *UsageUsageAnalyticsView) {
v.value = val
v.isSet = true
}
func (v NullableUsageUsageAnalyticsView) IsSet() bool {
return v.isSet
}
func (v *NullableUsageUsageAnalyticsView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableUsageUsageAnalyticsView(val *UsageUsageAnalyticsView) *NullableUsageUsageAnalyticsView {
return &NullableUsageUsageAnalyticsView{value: val, isSet: true}
}
func (v NullableUsageUsageAnalyticsView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableUsageUsageAnalyticsView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}