mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
193 lines
5.4 KiB
Go
193 lines
5.4 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 UsageUsageAnalyticsAccess type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &UsageUsageAnalyticsAccess{}
|
|
|
|
// UsageUsageAnalyticsAccess struct for UsageUsageAnalyticsAccess
|
|
type UsageUsageAnalyticsAccess struct {
|
|
// Access is what that plan grants.
|
|
Access *UsageUsageAnalyticsGrant `json:"access,omitempty"`
|
|
// Plan echoes the plan id that was resolved, exactly as it was asked for.
|
|
Plan *string `json:"plan,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _UsageUsageAnalyticsAccess UsageUsageAnalyticsAccess
|
|
|
|
// NewUsageUsageAnalyticsAccess instantiates a new UsageUsageAnalyticsAccess 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 NewUsageUsageAnalyticsAccess() *UsageUsageAnalyticsAccess {
|
|
this := UsageUsageAnalyticsAccess{}
|
|
return &this
|
|
}
|
|
|
|
// NewUsageUsageAnalyticsAccessWithDefaults instantiates a new UsageUsageAnalyticsAccess 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 NewUsageUsageAnalyticsAccessWithDefaults() *UsageUsageAnalyticsAccess {
|
|
this := UsageUsageAnalyticsAccess{}
|
|
return &this
|
|
}
|
|
|
|
// GetAccess returns the Access field value if set, zero value otherwise.
|
|
func (o *UsageUsageAnalyticsAccess) GetAccess() UsageUsageAnalyticsGrant {
|
|
if o == nil || IsNil(o.Access) {
|
|
var ret UsageUsageAnalyticsGrant
|
|
return ret
|
|
}
|
|
return *o.Access
|
|
}
|
|
|
|
// GetAccessOk returns a tuple with the Access field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UsageUsageAnalyticsAccess) GetAccessOk() (*UsageUsageAnalyticsGrant, bool) {
|
|
if o == nil || IsNil(o.Access) {
|
|
return nil, false
|
|
}
|
|
return o.Access, true
|
|
}
|
|
|
|
// HasAccess returns a boolean if a field has been set.
|
|
func (o *UsageUsageAnalyticsAccess) HasAccess() bool {
|
|
if o != nil && !IsNil(o.Access) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetAccess gets a reference to the given UsageUsageAnalyticsGrant and assigns it to the Access field.
|
|
func (o *UsageUsageAnalyticsAccess) SetAccess(v UsageUsageAnalyticsGrant) {
|
|
o.Access = &v
|
|
}
|
|
|
|
// GetPlan returns the Plan field value if set, zero value otherwise.
|
|
func (o *UsageUsageAnalyticsAccess) 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 *UsageUsageAnalyticsAccess) 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 *UsageUsageAnalyticsAccess) 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 *UsageUsageAnalyticsAccess) SetPlan(v string) {
|
|
o.Plan = &v
|
|
}
|
|
|
|
func (o UsageUsageAnalyticsAccess) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o UsageUsageAnalyticsAccess) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Access) {
|
|
toSerialize["access"] = o.Access
|
|
}
|
|
if !IsNil(o.Plan) {
|
|
toSerialize["plan"] = o.Plan
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *UsageUsageAnalyticsAccess) UnmarshalJSON(data []byte) (err error) {
|
|
varUsageUsageAnalyticsAccess := _UsageUsageAnalyticsAccess{}
|
|
|
|
err = json.Unmarshal(data, &varUsageUsageAnalyticsAccess)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = UsageUsageAnalyticsAccess(varUsageUsageAnalyticsAccess)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "access")
|
|
delete(additionalProperties, "plan")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableUsageUsageAnalyticsAccess struct {
|
|
value *UsageUsageAnalyticsAccess
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableUsageUsageAnalyticsAccess) Get() *UsageUsageAnalyticsAccess {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableUsageUsageAnalyticsAccess) Set(val *UsageUsageAnalyticsAccess) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableUsageUsageAnalyticsAccess) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableUsageUsageAnalyticsAccess) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableUsageUsageAnalyticsAccess(val *UsageUsageAnalyticsAccess) *NullableUsageUsageAnalyticsAccess {
|
|
return &NullableUsageUsageAnalyticsAccess{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableUsageUsageAnalyticsAccess) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableUsageUsageAnalyticsAccess) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|