Files
sdk/model_tool_activation_set.go

155 lines
4.0 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 ToolActivationSet type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ToolActivationSet{}
// ToolActivationSet struct for ToolActivationSet
type ToolActivationSet struct {
// Enabled is every tool name activated for the caller's org and project.
Enabled []string `json:"enabled,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ToolActivationSet ToolActivationSet
// NewToolActivationSet instantiates a new ToolActivationSet 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 NewToolActivationSet() *ToolActivationSet {
this := ToolActivationSet{}
return &this
}
// NewToolActivationSetWithDefaults instantiates a new ToolActivationSet 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 NewToolActivationSetWithDefaults() *ToolActivationSet {
this := ToolActivationSet{}
return &this
}
// GetEnabled returns the Enabled field value if set, zero value otherwise.
func (o *ToolActivationSet) GetEnabled() []string {
if o == nil || IsNil(o.Enabled) {
var ret []string
return ret
}
return o.Enabled
}
// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ToolActivationSet) GetEnabledOk() ([]string, bool) {
if o == nil || IsNil(o.Enabled) {
return nil, false
}
return o.Enabled, true
}
// HasEnabled returns a boolean if a field has been set.
func (o *ToolActivationSet) HasEnabled() bool {
if o != nil && !IsNil(o.Enabled) {
return true
}
return false
}
// SetEnabled gets a reference to the given []string and assigns it to the Enabled field.
func (o *ToolActivationSet) SetEnabled(v []string) {
o.Enabled = v
}
func (o ToolActivationSet) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ToolActivationSet) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Enabled) {
toSerialize["enabled"] = o.Enabled
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ToolActivationSet) UnmarshalJSON(data []byte) (err error) {
varToolActivationSet := _ToolActivationSet{}
err = json.Unmarshal(data, &varToolActivationSet)
if err != nil {
return err
}
*o = ToolActivationSet(varToolActivationSet)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "enabled")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableToolActivationSet struct {
value *ToolActivationSet
isSet bool
}
func (v NullableToolActivationSet) Get() *ToolActivationSet {
return v.value
}
func (v *NullableToolActivationSet) Set(val *ToolActivationSet) {
v.value = val
v.isSet = true
}
func (v NullableToolActivationSet) IsSet() bool {
return v.isSet
}
func (v *NullableToolActivationSet) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableToolActivationSet(val *ToolActivationSet) *NullableToolActivationSet {
return &NullableToolActivationSet{value: val, isSet: true}
}
func (v NullableToolActivationSet) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableToolActivationSet) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}