Files
sdk/model_entitlement_mutate_req.go

193 lines
5.2 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 EntitlementMutateReq type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &EntitlementMutateReq{}
// EntitlementMutateReq struct for EntitlementMutateReq
type EntitlementMutateReq struct {
// Add is the product ids to turn ON. Each must already be an ACTIVE entitlement of the org's plan, unless the caller is a platform super admin.
Add []string `json:"add,omitempty"`
// Remove is the product ids to turn OFF. Disabling is never gated.
Remove []string `json:"remove,omitempty"`
AdditionalProperties map[string]interface{}
}
type _EntitlementMutateReq EntitlementMutateReq
// NewEntitlementMutateReq instantiates a new EntitlementMutateReq 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 NewEntitlementMutateReq() *EntitlementMutateReq {
this := EntitlementMutateReq{}
return &this
}
// NewEntitlementMutateReqWithDefaults instantiates a new EntitlementMutateReq 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 NewEntitlementMutateReqWithDefaults() *EntitlementMutateReq {
this := EntitlementMutateReq{}
return &this
}
// GetAdd returns the Add field value if set, zero value otherwise.
func (o *EntitlementMutateReq) GetAdd() []string {
if o == nil || IsNil(o.Add) {
var ret []string
return ret
}
return o.Add
}
// GetAddOk returns a tuple with the Add field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EntitlementMutateReq) GetAddOk() ([]string, bool) {
if o == nil || IsNil(o.Add) {
return nil, false
}
return o.Add, true
}
// HasAdd returns a boolean if a field has been set.
func (o *EntitlementMutateReq) HasAdd() bool {
if o != nil && !IsNil(o.Add) {
return true
}
return false
}
// SetAdd gets a reference to the given []string and assigns it to the Add field.
func (o *EntitlementMutateReq) SetAdd(v []string) {
o.Add = v
}
// GetRemove returns the Remove field value if set, zero value otherwise.
func (o *EntitlementMutateReq) GetRemove() []string {
if o == nil || IsNil(o.Remove) {
var ret []string
return ret
}
return o.Remove
}
// GetRemoveOk returns a tuple with the Remove field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EntitlementMutateReq) GetRemoveOk() ([]string, bool) {
if o == nil || IsNil(o.Remove) {
return nil, false
}
return o.Remove, true
}
// HasRemove returns a boolean if a field has been set.
func (o *EntitlementMutateReq) HasRemove() bool {
if o != nil && !IsNil(o.Remove) {
return true
}
return false
}
// SetRemove gets a reference to the given []string and assigns it to the Remove field.
func (o *EntitlementMutateReq) SetRemove(v []string) {
o.Remove = v
}
func (o EntitlementMutateReq) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o EntitlementMutateReq) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Add) {
toSerialize["add"] = o.Add
}
if !IsNil(o.Remove) {
toSerialize["remove"] = o.Remove
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *EntitlementMutateReq) UnmarshalJSON(data []byte) (err error) {
varEntitlementMutateReq := _EntitlementMutateReq{}
err = json.Unmarshal(data, &varEntitlementMutateReq)
if err != nil {
return err
}
*o = EntitlementMutateReq(varEntitlementMutateReq)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "add")
delete(additionalProperties, "remove")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableEntitlementMutateReq struct {
value *EntitlementMutateReq
isSet bool
}
func (v NullableEntitlementMutateReq) Get() *EntitlementMutateReq {
return v.value
}
func (v *NullableEntitlementMutateReq) Set(val *EntitlementMutateReq) {
v.value = val
v.isSet = true
}
func (v NullableEntitlementMutateReq) IsSet() bool {
return v.isSet
}
func (v *NullableEntitlementMutateReq) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableEntitlementMutateReq(val *EntitlementMutateReq) *NullableEntitlementMutateReq {
return &NullableEntitlementMutateReq{value: val, isSet: true}
}
func (v NullableEntitlementMutateReq) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableEntitlementMutateReq) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}