Files
sdk/model_tool_activation_req.go

193 lines
5.1 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 ToolActivationReq type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ToolActivationReq{}
// ToolActivationReq struct for ToolActivationReq
type ToolActivationReq struct {
// Activate switches these tool names on for the caller's org and project.
Activate []string `json:"activate,omitempty"`
// Deactivate switches these tool names off.
Deactivate []string `json:"deactivate,omitempty"`
AdditionalProperties map[string]interface{}
}
type _ToolActivationReq ToolActivationReq
// NewToolActivationReq instantiates a new ToolActivationReq 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 NewToolActivationReq() *ToolActivationReq {
this := ToolActivationReq{}
return &this
}
// NewToolActivationReqWithDefaults instantiates a new ToolActivationReq 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 NewToolActivationReqWithDefaults() *ToolActivationReq {
this := ToolActivationReq{}
return &this
}
// GetActivate returns the Activate field value if set, zero value otherwise.
func (o *ToolActivationReq) GetActivate() []string {
if o == nil || IsNil(o.Activate) {
var ret []string
return ret
}
return o.Activate
}
// GetActivateOk returns a tuple with the Activate field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ToolActivationReq) GetActivateOk() ([]string, bool) {
if o == nil || IsNil(o.Activate) {
return nil, false
}
return o.Activate, true
}
// HasActivate returns a boolean if a field has been set.
func (o *ToolActivationReq) HasActivate() bool {
if o != nil && !IsNil(o.Activate) {
return true
}
return false
}
// SetActivate gets a reference to the given []string and assigns it to the Activate field.
func (o *ToolActivationReq) SetActivate(v []string) {
o.Activate = v
}
// GetDeactivate returns the Deactivate field value if set, zero value otherwise.
func (o *ToolActivationReq) GetDeactivate() []string {
if o == nil || IsNil(o.Deactivate) {
var ret []string
return ret
}
return o.Deactivate
}
// GetDeactivateOk returns a tuple with the Deactivate field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ToolActivationReq) GetDeactivateOk() ([]string, bool) {
if o == nil || IsNil(o.Deactivate) {
return nil, false
}
return o.Deactivate, true
}
// HasDeactivate returns a boolean if a field has been set.
func (o *ToolActivationReq) HasDeactivate() bool {
if o != nil && !IsNil(o.Deactivate) {
return true
}
return false
}
// SetDeactivate gets a reference to the given []string and assigns it to the Deactivate field.
func (o *ToolActivationReq) SetDeactivate(v []string) {
o.Deactivate = v
}
func (o ToolActivationReq) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o ToolActivationReq) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Activate) {
toSerialize["activate"] = o.Activate
}
if !IsNil(o.Deactivate) {
toSerialize["deactivate"] = o.Deactivate
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *ToolActivationReq) UnmarshalJSON(data []byte) (err error) {
varToolActivationReq := _ToolActivationReq{}
err = json.Unmarshal(data, &varToolActivationReq)
if err != nil {
return err
}
*o = ToolActivationReq(varToolActivationReq)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "activate")
delete(additionalProperties, "deactivate")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableToolActivationReq struct {
value *ToolActivationReq
isSet bool
}
func (v NullableToolActivationReq) Get() *ToolActivationReq {
return v.value
}
func (v *NullableToolActivationReq) Set(val *ToolActivationReq) {
v.value = val
v.isSet = true
}
func (v NullableToolActivationReq) IsSet() bool {
return v.isSet
}
func (v *NullableToolActivationReq) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableToolActivationReq(val *ToolActivationReq) *NullableToolActivationReq {
return &NullableToolActivationReq{value: val, isSet: true}
}
func (v NullableToolActivationReq) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableToolActivationReq) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}