mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
231 lines
6.7 KiB
Go
231 lines
6.7 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 UsageUsageAnalyticsGrant type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &UsageUsageAnalyticsGrant{}
|
|
|
|
// UsageUsageAnalyticsGrant struct for UsageUsageAnalyticsGrant
|
|
type UsageUsageAnalyticsGrant struct {
|
|
// Datastore is whether the plan may read GET /v1/usage/analytics at all. The free floor is false, and that is what a catalog outage resolves to.
|
|
Datastore *bool `json:"datastore,omitempty"`
|
|
// Export is whether the plan may export the analytics it can read.
|
|
Export *bool `json:"export,omitempty"`
|
|
// RetentionDays is how far back the plan may read. GET /v1/usage/analytics clamps a custom window's start to this, so an older `start` returns the clamped window rather than an error.
|
|
RetentionDays *int64 `json:"retentionDays,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _UsageUsageAnalyticsGrant UsageUsageAnalyticsGrant
|
|
|
|
// NewUsageUsageAnalyticsGrant instantiates a new UsageUsageAnalyticsGrant 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 NewUsageUsageAnalyticsGrant() *UsageUsageAnalyticsGrant {
|
|
this := UsageUsageAnalyticsGrant{}
|
|
return &this
|
|
}
|
|
|
|
// NewUsageUsageAnalyticsGrantWithDefaults instantiates a new UsageUsageAnalyticsGrant 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 NewUsageUsageAnalyticsGrantWithDefaults() *UsageUsageAnalyticsGrant {
|
|
this := UsageUsageAnalyticsGrant{}
|
|
return &this
|
|
}
|
|
|
|
// GetDatastore returns the Datastore field value if set, zero value otherwise.
|
|
func (o *UsageUsageAnalyticsGrant) GetDatastore() bool {
|
|
if o == nil || IsNil(o.Datastore) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Datastore
|
|
}
|
|
|
|
// GetDatastoreOk returns a tuple with the Datastore field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UsageUsageAnalyticsGrant) GetDatastoreOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Datastore) {
|
|
return nil, false
|
|
}
|
|
return o.Datastore, true
|
|
}
|
|
|
|
// HasDatastore returns a boolean if a field has been set.
|
|
func (o *UsageUsageAnalyticsGrant) HasDatastore() bool {
|
|
if o != nil && !IsNil(o.Datastore) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetDatastore gets a reference to the given bool and assigns it to the Datastore field.
|
|
func (o *UsageUsageAnalyticsGrant) SetDatastore(v bool) {
|
|
o.Datastore = &v
|
|
}
|
|
|
|
// GetExport returns the Export field value if set, zero value otherwise.
|
|
func (o *UsageUsageAnalyticsGrant) 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 *UsageUsageAnalyticsGrant) 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 *UsageUsageAnalyticsGrant) 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 *UsageUsageAnalyticsGrant) SetExport(v bool) {
|
|
o.Export = &v
|
|
}
|
|
|
|
// GetRetentionDays returns the RetentionDays field value if set, zero value otherwise.
|
|
func (o *UsageUsageAnalyticsGrant) 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 *UsageUsageAnalyticsGrant) 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 *UsageUsageAnalyticsGrant) 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 *UsageUsageAnalyticsGrant) SetRetentionDays(v int64) {
|
|
o.RetentionDays = &v
|
|
}
|
|
|
|
func (o UsageUsageAnalyticsGrant) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o UsageUsageAnalyticsGrant) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Datastore) {
|
|
toSerialize["datastore"] = o.Datastore
|
|
}
|
|
if !IsNil(o.Export) {
|
|
toSerialize["export"] = o.Export
|
|
}
|
|
if !IsNil(o.RetentionDays) {
|
|
toSerialize["retentionDays"] = o.RetentionDays
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *UsageUsageAnalyticsGrant) UnmarshalJSON(data []byte) (err error) {
|
|
varUsageUsageAnalyticsGrant := _UsageUsageAnalyticsGrant{}
|
|
|
|
err = json.Unmarshal(data, &varUsageUsageAnalyticsGrant)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = UsageUsageAnalyticsGrant(varUsageUsageAnalyticsGrant)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "datastore")
|
|
delete(additionalProperties, "export")
|
|
delete(additionalProperties, "retentionDays")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableUsageUsageAnalyticsGrant struct {
|
|
value *UsageUsageAnalyticsGrant
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableUsageUsageAnalyticsGrant) Get() *UsageUsageAnalyticsGrant {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableUsageUsageAnalyticsGrant) Set(val *UsageUsageAnalyticsGrant) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableUsageUsageAnalyticsGrant) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableUsageUsageAnalyticsGrant) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableUsageUsageAnalyticsGrant(val *UsageUsageAnalyticsGrant) *NullableUsageUsageAnalyticsGrant {
|
|
return &NullableUsageUsageAnalyticsGrant{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableUsageUsageAnalyticsGrant) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableUsageUsageAnalyticsGrant) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|