Files
sdk/model_function_trigger_view.go

345 lines
8.9 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 FunctionTriggerView type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &FunctionTriggerView{}
// FunctionTriggerView struct for FunctionTriggerView
type FunctionTriggerView struct {
// whether it currently fires
Enabled *bool `json:"enabled,omitempty"`
// the function it calls
FunctionName *string `json:"functionName,omitempty"`
// the trigger's handle
Id *string `json:"id,omitempty"`
// a human label for it
Name *string `json:"name,omitempty"`
// the path it calls
Target *string `json:"target,omitempty"`
// what kind of trigger it is; HTTP is the only one today
Type *string `json:"type,omitempty"`
AdditionalProperties map[string]interface{}
}
type _FunctionTriggerView FunctionTriggerView
// NewFunctionTriggerView instantiates a new FunctionTriggerView 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 NewFunctionTriggerView() *FunctionTriggerView {
this := FunctionTriggerView{}
return &this
}
// NewFunctionTriggerViewWithDefaults instantiates a new FunctionTriggerView 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 NewFunctionTriggerViewWithDefaults() *FunctionTriggerView {
this := FunctionTriggerView{}
return &this
}
// GetEnabled returns the Enabled field value if set, zero value otherwise.
func (o *FunctionTriggerView) 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 *FunctionTriggerView) 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 *FunctionTriggerView) 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 *FunctionTriggerView) SetEnabled(v bool) {
o.Enabled = &v
}
// GetFunctionName returns the FunctionName field value if set, zero value otherwise.
func (o *FunctionTriggerView) GetFunctionName() string {
if o == nil || IsNil(o.FunctionName) {
var ret string
return ret
}
return *o.FunctionName
}
// GetFunctionNameOk returns a tuple with the FunctionName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FunctionTriggerView) GetFunctionNameOk() (*string, bool) {
if o == nil || IsNil(o.FunctionName) {
return nil, false
}
return o.FunctionName, true
}
// HasFunctionName returns a boolean if a field has been set.
func (o *FunctionTriggerView) HasFunctionName() bool {
if o != nil && !IsNil(o.FunctionName) {
return true
}
return false
}
// SetFunctionName gets a reference to the given string and assigns it to the FunctionName field.
func (o *FunctionTriggerView) SetFunctionName(v string) {
o.FunctionName = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *FunctionTriggerView) 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 *FunctionTriggerView) 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 *FunctionTriggerView) 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 *FunctionTriggerView) SetId(v string) {
o.Id = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *FunctionTriggerView) 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 *FunctionTriggerView) 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 *FunctionTriggerView) 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 *FunctionTriggerView) SetName(v string) {
o.Name = &v
}
// GetTarget returns the Target field value if set, zero value otherwise.
func (o *FunctionTriggerView) 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 *FunctionTriggerView) 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 *FunctionTriggerView) 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 *FunctionTriggerView) SetTarget(v string) {
o.Target = &v
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *FunctionTriggerView) GetType() string {
if o == nil || IsNil(o.Type) {
var ret string
return ret
}
return *o.Type
}
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FunctionTriggerView) GetTypeOk() (*string, bool) {
if o == nil || IsNil(o.Type) {
return nil, false
}
return o.Type, true
}
// HasType returns a boolean if a field has been set.
func (o *FunctionTriggerView) HasType() bool {
if o != nil && !IsNil(o.Type) {
return true
}
return false
}
// SetType gets a reference to the given string and assigns it to the Type field.
func (o *FunctionTriggerView) SetType(v string) {
o.Type = &v
}
func (o FunctionTriggerView) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o FunctionTriggerView) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Enabled) {
toSerialize["enabled"] = o.Enabled
}
if !IsNil(o.FunctionName) {
toSerialize["functionName"] = o.FunctionName
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Target) {
toSerialize["target"] = o.Target
}
if !IsNil(o.Type) {
toSerialize["type"] = o.Type
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *FunctionTriggerView) UnmarshalJSON(data []byte) (err error) {
varFunctionTriggerView := _FunctionTriggerView{}
err = json.Unmarshal(data, &varFunctionTriggerView)
if err != nil {
return err
}
*o = FunctionTriggerView(varFunctionTriggerView)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "enabled")
delete(additionalProperties, "functionName")
delete(additionalProperties, "id")
delete(additionalProperties, "name")
delete(additionalProperties, "target")
delete(additionalProperties, "type")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableFunctionTriggerView struct {
value *FunctionTriggerView
isSet bool
}
func (v NullableFunctionTriggerView) Get() *FunctionTriggerView {
return v.value
}
func (v *NullableFunctionTriggerView) Set(val *FunctionTriggerView) {
v.value = val
v.isSet = true
}
func (v NullableFunctionTriggerView) IsSet() bool {
return v.isSet
}
func (v *NullableFunctionTriggerView) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableFunctionTriggerView(val *FunctionTriggerView) *NullableFunctionTriggerView {
return &NullableFunctionTriggerView{value: val, isSet: true}
}
func (v NullableFunctionTriggerView) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableFunctionTriggerView) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}