Files
sdk/model_auto_automation.go

800 lines
21 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 AutoAutomation type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AutoAutomation{}
// AutoAutomation struct for AutoAutomation
type AutoAutomation struct {
// Created and Updated are RFC 3339 UTC.
Created *string `json:"created,omitempty"`
// Draft is a flow with no step yet: it has no instructions, never runs, and becomes an automation when its instructions are saved.
Draft *bool `json:"draft,omitempty"`
// Enabled is whether its schedule is armed.
Enabled *bool `json:"enabled,omitempty"`
// Event runs the automation on a committed product outcome instead of a schedule.
Event *AutoOutcomeTrigger `json:"event,omitempty"`
// ID is the automation's id, which is also its flow's.
Id *string `json:"id,omitempty"`
// Instructions are what the agent is asked to do each run.
Instructions *string `json:"instructions,omitempty"`
// Last is its most recent run that was not skipped; null before the first.
Last *AutoLastRun `json:"last,omitempty"`
// Model is the model the agent thinks with; null for the default.
Model *string `json:"model,omitempty"`
// Name is what it is called.
Name *string `json:"name,omitempty"`
// Next is when it runs next, RFC 3339 UTC; null when manual or disabled.
Next *string `json:"next,omitempty"`
// Notify sends a one-line summary to the automation's person when a run ends.
Notify *bool `json:"notify,omitempty"`
// Permissions is auto (works and uses connectors without stopping) or ask (changes nothing and ends with the actions it proposes; agent.go agentTask).
Permissions *string `json:"permissions,omitempty"`
// PostTo are the connected accounts each run's answer is posted to — x, linkedin, facebook — after review when Permissions is ask (post.go). Never null.
PostTo []string `json:"postTo,omitempty"`
// Project is the Dev project the run works in, by its slug; null for none.
Project *string `json:"project,omitempty"`
// Schedule is when it runs.
Schedule *AutoSchedule `json:"schedule,omitempty"`
// Source is the product it was made in: chat, dev, studio or workflow.
Source *string `json:"source,omitempty"`
// Target is an optional registered execution target, such as the person's local machine.
Target *string `json:"target,omitempty"`
Updated *string `json:"updated,omitempty"`
AdditionalProperties map[string]interface{}
}
type _AutoAutomation AutoAutomation
// NewAutoAutomation instantiates a new AutoAutomation 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 NewAutoAutomation() *AutoAutomation {
this := AutoAutomation{}
return &this
}
// NewAutoAutomationWithDefaults instantiates a new AutoAutomation 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 NewAutoAutomationWithDefaults() *AutoAutomation {
this := AutoAutomation{}
return &this
}
// GetCreated returns the Created field value if set, zero value otherwise.
func (o *AutoAutomation) GetCreated() string {
if o == nil || IsNil(o.Created) {
var ret string
return ret
}
return *o.Created
}
// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AutoAutomation) GetCreatedOk() (*string, bool) {
if o == nil || IsNil(o.Created) {
return nil, false
}
return o.Created, true
}
// HasCreated returns a boolean if a field has been set.
func (o *AutoAutomation) HasCreated() bool {
if o != nil && !IsNil(o.Created) {
return true
}
return false
}
// SetCreated gets a reference to the given string and assigns it to the Created field.
func (o *AutoAutomation) SetCreated(v string) {
o.Created = &v
}
// GetDraft returns the Draft field value if set, zero value otherwise.
func (o *AutoAutomation) GetDraft() bool {
if o == nil || IsNil(o.Draft) {
var ret bool
return ret
}
return *o.Draft
}
// GetDraftOk returns a tuple with the Draft field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AutoAutomation) GetDraftOk() (*bool, bool) {
if o == nil || IsNil(o.Draft) {
return nil, false
}
return o.Draft, true
}
// HasDraft returns a boolean if a field has been set.
func (o *AutoAutomation) HasDraft() bool {
if o != nil && !IsNil(o.Draft) {
return true
}
return false
}
// SetDraft gets a reference to the given bool and assigns it to the Draft field.
func (o *AutoAutomation) SetDraft(v bool) {
o.Draft = &v
}
// GetEnabled returns the Enabled field value if set, zero value otherwise.
func (o *AutoAutomation) 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 *AutoAutomation) 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 *AutoAutomation) 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 *AutoAutomation) SetEnabled(v bool) {
o.Enabled = &v
}
// GetEvent returns the Event field value if set, zero value otherwise.
func (o *AutoAutomation) 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 *AutoAutomation) 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 *AutoAutomation) 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 *AutoAutomation) SetEvent(v AutoOutcomeTrigger) {
o.Event = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *AutoAutomation) 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 *AutoAutomation) 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 *AutoAutomation) 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 *AutoAutomation) SetId(v string) {
o.Id = &v
}
// GetInstructions returns the Instructions field value if set, zero value otherwise.
func (o *AutoAutomation) 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 *AutoAutomation) 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 *AutoAutomation) 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 *AutoAutomation) SetInstructions(v string) {
o.Instructions = &v
}
// GetLast returns the Last field value if set, zero value otherwise.
func (o *AutoAutomation) GetLast() AutoLastRun {
if o == nil || IsNil(o.Last) {
var ret AutoLastRun
return ret
}
return *o.Last
}
// GetLastOk returns a tuple with the Last field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AutoAutomation) GetLastOk() (*AutoLastRun, bool) {
if o == nil || IsNil(o.Last) {
return nil, false
}
return o.Last, true
}
// HasLast returns a boolean if a field has been set.
func (o *AutoAutomation) HasLast() bool {
if o != nil && !IsNil(o.Last) {
return true
}
return false
}
// SetLast gets a reference to the given AutoLastRun and assigns it to the Last field.
func (o *AutoAutomation) SetLast(v AutoLastRun) {
o.Last = &v
}
// GetModel returns the Model field value if set, zero value otherwise.
func (o *AutoAutomation) 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 *AutoAutomation) 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 *AutoAutomation) 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 *AutoAutomation) SetModel(v string) {
o.Model = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *AutoAutomation) 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 *AutoAutomation) 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 *AutoAutomation) 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 *AutoAutomation) SetName(v string) {
o.Name = &v
}
// GetNext returns the Next field value if set, zero value otherwise.
func (o *AutoAutomation) GetNext() string {
if o == nil || IsNil(o.Next) {
var ret string
return ret
}
return *o.Next
}
// GetNextOk returns a tuple with the Next field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AutoAutomation) GetNextOk() (*string, bool) {
if o == nil || IsNil(o.Next) {
return nil, false
}
return o.Next, true
}
// HasNext returns a boolean if a field has been set.
func (o *AutoAutomation) HasNext() bool {
if o != nil && !IsNil(o.Next) {
return true
}
return false
}
// SetNext gets a reference to the given string and assigns it to the Next field.
func (o *AutoAutomation) SetNext(v string) {
o.Next = &v
}
// GetNotify returns the Notify field value if set, zero value otherwise.
func (o *AutoAutomation) 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 *AutoAutomation) 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 *AutoAutomation) 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 *AutoAutomation) SetNotify(v bool) {
o.Notify = &v
}
// GetPermissions returns the Permissions field value if set, zero value otherwise.
func (o *AutoAutomation) 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 *AutoAutomation) 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 *AutoAutomation) 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 *AutoAutomation) SetPermissions(v string) {
o.Permissions = &v
}
// GetPostTo returns the PostTo field value if set, zero value otherwise.
func (o *AutoAutomation) 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 *AutoAutomation) 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 *AutoAutomation) 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 *AutoAutomation) SetPostTo(v []string) {
o.PostTo = v
}
// GetProject returns the Project field value if set, zero value otherwise.
func (o *AutoAutomation) 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 *AutoAutomation) 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 *AutoAutomation) 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 *AutoAutomation) SetProject(v string) {
o.Project = &v
}
// GetSchedule returns the Schedule field value if set, zero value otherwise.
func (o *AutoAutomation) 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 *AutoAutomation) 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 *AutoAutomation) 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 *AutoAutomation) SetSchedule(v AutoSchedule) {
o.Schedule = &v
}
// GetSource returns the Source field value if set, zero value otherwise.
func (o *AutoAutomation) GetSource() string {
if o == nil || IsNil(o.Source) {
var ret string
return ret
}
return *o.Source
}
// GetSourceOk returns a tuple with the Source field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AutoAutomation) GetSourceOk() (*string, bool) {
if o == nil || IsNil(o.Source) {
return nil, false
}
return o.Source, true
}
// HasSource returns a boolean if a field has been set.
func (o *AutoAutomation) HasSource() bool {
if o != nil && !IsNil(o.Source) {
return true
}
return false
}
// SetSource gets a reference to the given string and assigns it to the Source field.
func (o *AutoAutomation) SetSource(v string) {
o.Source = &v
}
// GetTarget returns the Target field value if set, zero value otherwise.
func (o *AutoAutomation) 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 *AutoAutomation) 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 *AutoAutomation) 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 *AutoAutomation) SetTarget(v string) {
o.Target = &v
}
// GetUpdated returns the Updated field value if set, zero value otherwise.
func (o *AutoAutomation) GetUpdated() string {
if o == nil || IsNil(o.Updated) {
var ret string
return ret
}
return *o.Updated
}
// GetUpdatedOk returns a tuple with the Updated field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AutoAutomation) GetUpdatedOk() (*string, bool) {
if o == nil || IsNil(o.Updated) {
return nil, false
}
return o.Updated, true
}
// HasUpdated returns a boolean if a field has been set.
func (o *AutoAutomation) HasUpdated() bool {
if o != nil && !IsNil(o.Updated) {
return true
}
return false
}
// SetUpdated gets a reference to the given string and assigns it to the Updated field.
func (o *AutoAutomation) SetUpdated(v string) {
o.Updated = &v
}
func (o AutoAutomation) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AutoAutomation) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Created) {
toSerialize["created"] = o.Created
}
if !IsNil(o.Draft) {
toSerialize["draft"] = o.Draft
}
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.Last) {
toSerialize["last"] = o.Last
}
if !IsNil(o.Model) {
toSerialize["model"] = o.Model
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Next) {
toSerialize["next"] = o.Next
}
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.Source) {
toSerialize["source"] = o.Source
}
if !IsNil(o.Target) {
toSerialize["target"] = o.Target
}
if !IsNil(o.Updated) {
toSerialize["updated"] = o.Updated
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *AutoAutomation) UnmarshalJSON(data []byte) (err error) {
varAutoAutomation := _AutoAutomation{}
err = json.Unmarshal(data, &varAutoAutomation)
if err != nil {
return err
}
*o = AutoAutomation(varAutoAutomation)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "created")
delete(additionalProperties, "draft")
delete(additionalProperties, "enabled")
delete(additionalProperties, "event")
delete(additionalProperties, "id")
delete(additionalProperties, "instructions")
delete(additionalProperties, "last")
delete(additionalProperties, "model")
delete(additionalProperties, "name")
delete(additionalProperties, "next")
delete(additionalProperties, "notify")
delete(additionalProperties, "permissions")
delete(additionalProperties, "postTo")
delete(additionalProperties, "project")
delete(additionalProperties, "schedule")
delete(additionalProperties, "source")
delete(additionalProperties, "target")
delete(additionalProperties, "updated")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableAutoAutomation struct {
value *AutoAutomation
isSet bool
}
func (v NullableAutoAutomation) Get() *AutoAutomation {
return v.value
}
func (v *NullableAutoAutomation) Set(val *AutoAutomation) {
v.value = val
v.isSet = true
}
func (v NullableAutoAutomation) IsSet() bool {
return v.isSet
}
func (v *NullableAutoAutomation) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAutoAutomation(val *AutoAutomation) *NullableAutoAutomation {
return &NullableAutoAutomation{value: val, isSet: true}
}
func (v NullableAutoAutomation) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAutoAutomation) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}