Files
sdk/model_plan_plan_entitlements.go

231 lines
6.5 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 PlanPlanEntitlements type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PlanPlanEntitlements{}
// PlanPlanEntitlements struct for PlanPlanEntitlements
type PlanPlanEntitlements struct {
Entitlements interface{} `json:"entitlements,omitempty"`
// ID is the plan id or slug that was resolved, as it was requested.
Id *string `json:"id,omitempty"`
// LicenseFeatures is the flat, sorted feature list a signed license carries, derived from the entitlements.
LicenseFeatures []string `json:"license_features,omitempty"`
AdditionalProperties map[string]interface{}
}
type _PlanPlanEntitlements PlanPlanEntitlements
// NewPlanPlanEntitlements instantiates a new PlanPlanEntitlements 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 NewPlanPlanEntitlements() *PlanPlanEntitlements {
this := PlanPlanEntitlements{}
return &this
}
// NewPlanPlanEntitlementsWithDefaults instantiates a new PlanPlanEntitlements 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 NewPlanPlanEntitlementsWithDefaults() *PlanPlanEntitlements {
this := PlanPlanEntitlements{}
return &this
}
// GetEntitlements returns the Entitlements field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *PlanPlanEntitlements) GetEntitlements() interface{} {
if o == nil {
var ret interface{}
return ret
}
return o.Entitlements
}
// GetEntitlementsOk returns a tuple with the Entitlements field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *PlanPlanEntitlements) GetEntitlementsOk() (*interface{}, bool) {
if o == nil || IsNil(o.Entitlements) {
return nil, false
}
return &o.Entitlements, true
}
// HasEntitlements returns a boolean if a field has been set.
func (o *PlanPlanEntitlements) HasEntitlements() bool {
if o != nil && !IsNil(o.Entitlements) {
return true
}
return false
}
// SetEntitlements gets a reference to the given interface{} and assigns it to the Entitlements field.
func (o *PlanPlanEntitlements) SetEntitlements(v interface{}) {
o.Entitlements = v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *PlanPlanEntitlements) GetId() string {
if o == nil || IsNil(o.Id) {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlanPlanEntitlements) GetIdOk() (*string, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *PlanPlanEntitlements) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *PlanPlanEntitlements) SetId(v string) {
o.Id = &v
}
// GetLicenseFeatures returns the LicenseFeatures field value if set, zero value otherwise.
func (o *PlanPlanEntitlements) GetLicenseFeatures() []string {
if o == nil || IsNil(o.LicenseFeatures) {
var ret []string
return ret
}
return o.LicenseFeatures
}
// GetLicenseFeaturesOk returns a tuple with the LicenseFeatures field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlanPlanEntitlements) GetLicenseFeaturesOk() ([]string, bool) {
if o == nil || IsNil(o.LicenseFeatures) {
return nil, false
}
return o.LicenseFeatures, true
}
// HasLicenseFeatures returns a boolean if a field has been set.
func (o *PlanPlanEntitlements) HasLicenseFeatures() bool {
if o != nil && !IsNil(o.LicenseFeatures) {
return true
}
return false
}
// SetLicenseFeatures gets a reference to the given []string and assigns it to the LicenseFeatures field.
func (o *PlanPlanEntitlements) SetLicenseFeatures(v []string) {
o.LicenseFeatures = v
}
func (o PlanPlanEntitlements) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PlanPlanEntitlements) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if o.Entitlements != nil {
toSerialize["entitlements"] = o.Entitlements
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.LicenseFeatures) {
toSerialize["license_features"] = o.LicenseFeatures
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *PlanPlanEntitlements) UnmarshalJSON(data []byte) (err error) {
varPlanPlanEntitlements := _PlanPlanEntitlements{}
err = json.Unmarshal(data, &varPlanPlanEntitlements)
if err != nil {
return err
}
*o = PlanPlanEntitlements(varPlanPlanEntitlements)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "entitlements")
delete(additionalProperties, "id")
delete(additionalProperties, "license_features")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullablePlanPlanEntitlements struct {
value *PlanPlanEntitlements
isSet bool
}
func (v NullablePlanPlanEntitlements) Get() *PlanPlanEntitlements {
return v.value
}
func (v *NullablePlanPlanEntitlements) Set(val *PlanPlanEntitlements) {
v.value = val
v.isSet = true
}
func (v NullablePlanPlanEntitlements) IsSet() bool {
return v.isSet
}
func (v *NullablePlanPlanEntitlements) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePlanPlanEntitlements(val *PlanPlanEntitlements) *NullablePlanPlanEntitlements {
return &NullablePlanPlanEntitlements{value: val, isSet: true}
}
func (v NullablePlanPlanEntitlements) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePlanPlanEntitlements) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}