Files
sdk/model_entitlement_projection_view.go

193 lines
5.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 EntitlementProjectionView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &EntitlementProjectionView{}
// EntitlementProjectionView struct for EntitlementProjectionView
type EntitlementProjectionView struct {
// Apps says, per console app, whether the org may open it. The SAME six keys are always present (studio, bot, world, platform, team, admin), so a client maps over it unconditionally; a key is false both when the plan does not grant the app and when commerce could not be reached, because a read that decides what to SHOW fails to LOCKED rather than to an error.
Apps map[string]bool `json:"apps,omitempty"`
// Tier is the plan slug commerce resolved for the org, or \"\" when the org has no active licensing subscription — which the console treats as its free default.
Tier *string `json:"tier,omitempty"`
AdditionalProperties map[string]interface{}
}
type _EntitlementProjectionView EntitlementProjectionView
// NewEntitlementProjectionView instantiates a new EntitlementProjectionView 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 NewEntitlementProjectionView() *EntitlementProjectionView {
this := EntitlementProjectionView{}
return &this
}
// NewEntitlementProjectionViewWithDefaults instantiates a new EntitlementProjectionView 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 NewEntitlementProjectionViewWithDefaults() *EntitlementProjectionView {
this := EntitlementProjectionView{}
return &this
}
// GetApps returns the Apps field value if set, zero value otherwise.
func (o *EntitlementProjectionView) GetApps() map[string]bool {
if o == nil || IsNil(o.Apps) {
var ret map[string]bool
return ret
}
return o.Apps
}
// GetAppsOk returns a tuple with the Apps field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EntitlementProjectionView) GetAppsOk() (map[string]bool, bool) {
if o == nil || IsNil(o.Apps) {
return map[string]bool{}, false
}
return o.Apps, true
}
// HasApps returns a boolean if a field has been set.
func (o *EntitlementProjectionView) HasApps() bool {
if o != nil && !IsNil(o.Apps) {
return true
}
return false
}
// SetApps gets a reference to the given map[string]bool and assigns it to the Apps field.
func (o *EntitlementProjectionView) SetApps(v map[string]bool) {
o.Apps = v
}
// GetTier returns the Tier field value if set, zero value otherwise.
func (o *EntitlementProjectionView) GetTier() string {
if o == nil || IsNil(o.Tier) {
var ret string
return ret
}
return *o.Tier
}
// GetTierOk returns a tuple with the Tier field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EntitlementProjectionView) GetTierOk() (*string, bool) {
if o == nil || IsNil(o.Tier) {
return nil, false
}
return o.Tier, true
}
// HasTier returns a boolean if a field has been set.
func (o *EntitlementProjectionView) HasTier() bool {
if o != nil && !IsNil(o.Tier) {
return true
}
return false
}
// SetTier gets a reference to the given string and assigns it to the Tier field.
func (o *EntitlementProjectionView) SetTier(v string) {
o.Tier = &v
}
func (o EntitlementProjectionView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o EntitlementProjectionView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Apps) {
toSerialize["apps"] = o.Apps
}
if !IsNil(o.Tier) {
toSerialize["tier"] = o.Tier
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *EntitlementProjectionView) UnmarshalJSON(data []byte) (err error) {
varEntitlementProjectionView := _EntitlementProjectionView{}
err = json.Unmarshal(data, &varEntitlementProjectionView)
if err != nil {
return err
}
*o = EntitlementProjectionView(varEntitlementProjectionView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "apps")
delete(additionalProperties, "tier")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableEntitlementProjectionView struct {
value *EntitlementProjectionView
isSet bool
}
func (v NullableEntitlementProjectionView) Get() *EntitlementProjectionView {
return v.value
}
func (v *NullableEntitlementProjectionView) Set(val *EntitlementProjectionView) {
v.value = val
v.isSet = true
}
func (v NullableEntitlementProjectionView) IsSet() bool {
return v.isSet
}
func (v *NullableEntitlementProjectionView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableEntitlementProjectionView(val *EntitlementProjectionView) *NullableEntitlementProjectionView {
return &NullableEntitlementProjectionView{value: val, isSet: true}
}
func (v NullableEntitlementProjectionView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableEntitlementProjectionView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}