Files
sdk/model_auto_automation_patch.go

565 lines
15 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 AutoAutomationPatch type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AutoAutomationPatch{}
// AutoAutomationPatch struct for AutoAutomationPatch
type AutoAutomationPatch struct {
// Enabled arms or disarms its schedule.
Enabled *bool `json:"enabled,omitempty"`
// Event replaces the trigger with a product outcome; null clears it.
Event *AutoOutcomeTrigger `json:"event,omitempty"`
// ID is the automation, from the path.
Id *string `json:"id,omitempty"`
Instructions *string `json:"instructions,omitempty"`
Model *string `json:"model,omitempty"`
Name *string `json:"name,omitempty"`
Notify *bool `json:"notify,omitempty"`
Permissions *string `json:"permissions,omitempty"`
PostTo []string `json:"postTo,omitempty"`
Project *string `json:"project,omitempty"`
Schedule *AutoSchedule `json:"schedule,omitempty"`
// Target replaces the registered execution target; null clears it.
Target *string `json:"target,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AutoAutomationPatch AutoAutomationPatch
// NewAutoAutomationPatch instantiates a new AutoAutomationPatch 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 NewAutoAutomationPatch() *AutoAutomationPatch {
this := AutoAutomationPatch{}
return &this
}
// NewAutoAutomationPatchWithDefaults instantiates a new AutoAutomationPatch 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 NewAutoAutomationPatchWithDefaults() *AutoAutomationPatch {
this := AutoAutomationPatch{}
return &this
}
// GetEnabled returns the Enabled field value if set, zero value otherwise.
func (o *AutoAutomationPatch) GetEnabled() bool {
if o == nil || IsNil(o.Enabled) {
var ret bool
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 *AutoAutomationPatch) GetEnabledOk() (*bool, 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 *AutoAutomationPatch) HasEnabled() bool {
if o != nil && !IsNil(o.Enabled) {
return true
}
return false
}
// SetEnabled gets a reference to the given bool and assigns it to the Enabled field.
func (o *AutoAutomationPatch) SetEnabled(v bool) {
o.Enabled = &v
}
// GetEvent returns the Event field value if set, zero value otherwise.
func (o *AutoAutomationPatch) GetEvent() AutoOutcomeTrigger {
if o == nil || IsNil(o.Event) {
var ret AutoOutcomeTrigger
return ret
}
return *o.Event
}
// GetEventOk returns a tuple with the Event field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AutoAutomationPatch) GetEventOk() (*AutoOutcomeTrigger, bool) {
if o == nil || IsNil(o.Event) {
return nil, false
}
return o.Event, true
}
// HasEvent returns a boolean if a field has been set.
func (o *AutoAutomationPatch) HasEvent() bool {
if o != nil && !IsNil(o.Event) {
return true
}
return false
}
// SetEvent gets a reference to the given AutoOutcomeTrigger and assigns it to the Event field.
func (o *AutoAutomationPatch) SetEvent(v AutoOutcomeTrigger) {
o.Event = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *AutoAutomationPatch) 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 *AutoAutomationPatch) 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 *AutoAutomationPatch) 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 *AutoAutomationPatch) SetId(v string) {
o.Id = &v
}
// GetInstructions returns the Instructions field value if set, zero value otherwise.
func (o *AutoAutomationPatch) GetInstructions() string {
if o == nil || IsNil(o.Instructions) {
var ret string
return ret
}
return *o.Instructions
}
// GetInstructionsOk returns a tuple with the Instructions field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AutoAutomationPatch) GetInstructionsOk() (*string, bool) {
if o == nil || IsNil(o.Instructions) {
return nil, false
}
return o.Instructions, true
}
// HasInstructions returns a boolean if a field has been set.
func (o *AutoAutomationPatch) HasInstructions() bool {
if o != nil && !IsNil(o.Instructions) {
return true
}
return false
}
// SetInstructions gets a reference to the given string and assigns it to the Instructions field.
func (o *AutoAutomationPatch) SetInstructions(v string) {
o.Instructions = &v
}
// GetModel returns the Model field value if set, zero value otherwise.
func (o *AutoAutomationPatch) GetModel() string {
if o == nil || IsNil(o.Model) {
var ret string
return ret
}
return *o.Model
}
// GetModelOk returns a tuple with the Model field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AutoAutomationPatch) GetModelOk() (*string, bool) {
if o == nil || IsNil(o.Model) {
return nil, false
}
return o.Model, true
}
// HasModel returns a boolean if a field has been set.
func (o *AutoAutomationPatch) HasModel() bool {
if o != nil && !IsNil(o.Model) {
return true
}
return false
}
// SetModel gets a reference to the given string and assigns it to the Model field.
func (o *AutoAutomationPatch) SetModel(v string) {
o.Model = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *AutoAutomationPatch) GetName() string {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AutoAutomationPatch) GetNameOk() (*string, bool) {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *AutoAutomationPatch) HasName() bool {
if o != nil && !IsNil(o.Name) {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *AutoAutomationPatch) SetName(v string) {
o.Name = &v
}
// GetNotify returns the Notify field value if set, zero value otherwise.
func (o *AutoAutomationPatch) GetNotify() bool {
if o == nil || IsNil(o.Notify) {
var ret bool
return ret
}
return *o.Notify
}
// GetNotifyOk returns a tuple with the Notify field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AutoAutomationPatch) GetNotifyOk() (*bool, bool) {
if o == nil || IsNil(o.Notify) {
return nil, false
}
return o.Notify, true
}
// HasNotify returns a boolean if a field has been set.
func (o *AutoAutomationPatch) HasNotify() bool {
if o != nil && !IsNil(o.Notify) {
return true
}
return false
}
// SetNotify gets a reference to the given bool and assigns it to the Notify field.
func (o *AutoAutomationPatch) SetNotify(v bool) {
o.Notify = &v
}
// GetPermissions returns the Permissions field value if set, zero value otherwise.
func (o *AutoAutomationPatch) GetPermissions() string {
if o == nil || IsNil(o.Permissions) {
var ret string
return ret
}
return *o.Permissions
}
// GetPermissionsOk returns a tuple with the Permissions field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AutoAutomationPatch) GetPermissionsOk() (*string, bool) {
if o == nil || IsNil(o.Permissions) {
return nil, false
}
return o.Permissions, true
}
// HasPermissions returns a boolean if a field has been set.
func (o *AutoAutomationPatch) HasPermissions() bool {
if o != nil && !IsNil(o.Permissions) {
return true
}
return false
}
// SetPermissions gets a reference to the given string and assigns it to the Permissions field.
func (o *AutoAutomationPatch) SetPermissions(v string) {
o.Permissions = &v
}
// GetPostTo returns the PostTo field value if set, zero value otherwise.
func (o *AutoAutomationPatch) GetPostTo() []string {
if o == nil || IsNil(o.PostTo) {
var ret []string
return ret
}
return o.PostTo
}
// GetPostToOk returns a tuple with the PostTo field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AutoAutomationPatch) GetPostToOk() ([]string, bool) {
if o == nil || IsNil(o.PostTo) {
return nil, false
}
return o.PostTo, true
}
// HasPostTo returns a boolean if a field has been set.
func (o *AutoAutomationPatch) HasPostTo() bool {
if o != nil && !IsNil(o.PostTo) {
return true
}
return false
}
// SetPostTo gets a reference to the given []string and assigns it to the PostTo field.
func (o *AutoAutomationPatch) SetPostTo(v []string) {
o.PostTo = v
}
// GetProject returns the Project field value if set, zero value otherwise.
func (o *AutoAutomationPatch) GetProject() string {
if o == nil || IsNil(o.Project) {
var ret string
return ret
}
return *o.Project
}
// GetProjectOk returns a tuple with the Project field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AutoAutomationPatch) GetProjectOk() (*string, bool) {
if o == nil || IsNil(o.Project) {
return nil, false
}
return o.Project, true
}
// HasProject returns a boolean if a field has been set.
func (o *AutoAutomationPatch) HasProject() bool {
if o != nil && !IsNil(o.Project) {
return true
}
return false
}
// SetProject gets a reference to the given string and assigns it to the Project field.
func (o *AutoAutomationPatch) SetProject(v string) {
o.Project = &v
}
// GetSchedule returns the Schedule field value if set, zero value otherwise.
func (o *AutoAutomationPatch) GetSchedule() AutoSchedule {
if o == nil || IsNil(o.Schedule) {
var ret AutoSchedule
return ret
}
return *o.Schedule
}
// GetScheduleOk returns a tuple with the Schedule field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AutoAutomationPatch) GetScheduleOk() (*AutoSchedule, bool) {
if o == nil || IsNil(o.Schedule) {
return nil, false
}
return o.Schedule, true
}
// HasSchedule returns a boolean if a field has been set.
func (o *AutoAutomationPatch) HasSchedule() bool {
if o != nil && !IsNil(o.Schedule) {
return true
}
return false
}
// SetSchedule gets a reference to the given AutoSchedule and assigns it to the Schedule field.
func (o *AutoAutomationPatch) SetSchedule(v AutoSchedule) {
o.Schedule = &v
}
// GetTarget returns the Target field value if set, zero value otherwise.
func (o *AutoAutomationPatch) GetTarget() string {
if o == nil || IsNil(o.Target) {
var ret string
return ret
}
return *o.Target
}
// GetTargetOk returns a tuple with the Target field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AutoAutomationPatch) GetTargetOk() (*string, bool) {
if o == nil || IsNil(o.Target) {
return nil, false
}
return o.Target, true
}
// HasTarget returns a boolean if a field has been set.
func (o *AutoAutomationPatch) HasTarget() bool {
if o != nil && !IsNil(o.Target) {
return true
}
return false
}
// SetTarget gets a reference to the given string and assigns it to the Target field.
func (o *AutoAutomationPatch) SetTarget(v string) {
o.Target = &v
}
func (o AutoAutomationPatch) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AutoAutomationPatch) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Enabled) {
toSerialize["enabled"] = o.Enabled
}
if !IsNil(o.Event) {
toSerialize["event"] = o.Event
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Instructions) {
toSerialize["instructions"] = o.Instructions
}
if !IsNil(o.Model) {
toSerialize["model"] = o.Model
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Notify) {
toSerialize["notify"] = o.Notify
}
if !IsNil(o.Permissions) {
toSerialize["permissions"] = o.Permissions
}
if !IsNil(o.PostTo) {
toSerialize["postTo"] = o.PostTo
}
if !IsNil(o.Project) {
toSerialize["project"] = o.Project
}
if !IsNil(o.Schedule) {
toSerialize["schedule"] = o.Schedule
}
if !IsNil(o.Target) {
toSerialize["target"] = o.Target
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AutoAutomationPatch) UnmarshalJSON(data []byte) (err error) {
varAutoAutomationPatch := _AutoAutomationPatch{}
err = json.Unmarshal(data, &varAutoAutomationPatch)
if err != nil {
return err
}
*o = AutoAutomationPatch(varAutoAutomationPatch)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "enabled")
delete(additionalProperties, "event")
delete(additionalProperties, "id")
delete(additionalProperties, "instructions")
delete(additionalProperties, "model")
delete(additionalProperties, "name")
delete(additionalProperties, "notify")
delete(additionalProperties, "permissions")
delete(additionalProperties, "postTo")
delete(additionalProperties, "project")
delete(additionalProperties, "schedule")
delete(additionalProperties, "target")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAutoAutomationPatch struct {
value *AutoAutomationPatch
isSet bool
}
func (v NullableAutoAutomationPatch) Get() *AutoAutomationPatch {
return v.value
}
func (v *NullableAutoAutomationPatch) Set(val *AutoAutomationPatch) {
v.value = val
v.isSet = true
}
func (v NullableAutoAutomationPatch) IsSet() bool {
return v.isSet
}
func (v *NullableAutoAutomationPatch) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAutoAutomationPatch(val *AutoAutomationPatch) *NullableAutoAutomationPatch {
return &NullableAutoAutomationPatch{value: val, isSet: true}
}
func (v NullableAutoAutomationPatch) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAutoAutomationPatch) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}