Files
sdk/model_form_webhook_in.go

383 lines
9.6 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 FormWebhookIn type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &FormWebhookIn{}
// FormWebhookIn struct for FormWebhookIn
type FormWebhookIn struct {
// Enabled is whether responses are posted. Default true.
Enabled *bool `json:"enabled,omitempty"`
// ID is the form's id or slug, from the path.
Id *string `json:"id,omitempty"`
// Rotate mints a new secret on a replace, and answers it.
Rotate *bool `json:"rotate,omitempty"`
// Secret sets the signing secret: 16 to 256 characters. Absent on a make, one is minted; absent on a replace, the secret held is kept.
Secret *string `json:"secret,omitempty"`
// Tag names the webhook in its form, at most 64 characters.
Tag *string `json:"tag,omitempty"`
// URL is the https address posted to. Required.
Url *string `json:"url,omitempty"`
// Webhook is the webhook's id, from the path of a replace.
Webhook *string `json:"webhook,omitempty"`
AdditionalProperties map[string]interface{}
}
type _FormWebhookIn FormWebhookIn
// NewFormWebhookIn instantiates a new FormWebhookIn 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 NewFormWebhookIn() *FormWebhookIn {
this := FormWebhookIn{}
return &this
}
// NewFormWebhookInWithDefaults instantiates a new FormWebhookIn 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 NewFormWebhookInWithDefaults() *FormWebhookIn {
this := FormWebhookIn{}
return &this
}
// GetEnabled returns the Enabled field value if set, zero value otherwise.
func (o *FormWebhookIn) 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 *FormWebhookIn) 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 *FormWebhookIn) 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 *FormWebhookIn) SetEnabled(v bool) {
o.Enabled = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *FormWebhookIn) 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 *FormWebhookIn) 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 *FormWebhookIn) 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 *FormWebhookIn) SetId(v string) {
o.Id = &v
}
// GetRotate returns the Rotate field value if set, zero value otherwise.
func (o *FormWebhookIn) GetRotate() bool {
if o == nil || IsNil(o.Rotate) {
var ret bool
return ret
}
return *o.Rotate
}
// GetRotateOk returns a tuple with the Rotate field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormWebhookIn) GetRotateOk() (*bool, bool) {
if o == nil || IsNil(o.Rotate) {
return nil, false
}
return o.Rotate, true
}
// HasRotate returns a boolean if a field has been set.
func (o *FormWebhookIn) HasRotate() bool {
if o != nil && !IsNil(o.Rotate) {
return true
}
return false
}
// SetRotate gets a reference to the given bool and assigns it to the Rotate field.
func (o *FormWebhookIn) SetRotate(v bool) {
o.Rotate = &v
}
// GetSecret returns the Secret field value if set, zero value otherwise.
func (o *FormWebhookIn) GetSecret() string {
if o == nil || IsNil(o.Secret) {
var ret string
return ret
}
return *o.Secret
}
// GetSecretOk returns a tuple with the Secret field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormWebhookIn) GetSecretOk() (*string, bool) {
if o == nil || IsNil(o.Secret) {
return nil, false
}
return o.Secret, true
}
// HasSecret returns a boolean if a field has been set.
func (o *FormWebhookIn) HasSecret() bool {
if o != nil && !IsNil(o.Secret) {
return true
}
return false
}
// SetSecret gets a reference to the given string and assigns it to the Secret field.
func (o *FormWebhookIn) SetSecret(v string) {
o.Secret = &v
}
// GetTag returns the Tag field value if set, zero value otherwise.
func (o *FormWebhookIn) GetTag() string {
if o == nil || IsNil(o.Tag) {
var ret string
return ret
}
return *o.Tag
}
// GetTagOk returns a tuple with the Tag field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormWebhookIn) GetTagOk() (*string, bool) {
if o == nil || IsNil(o.Tag) {
return nil, false
}
return o.Tag, true
}
// HasTag returns a boolean if a field has been set.
func (o *FormWebhookIn) HasTag() bool {
if o != nil && !IsNil(o.Tag) {
return true
}
return false
}
// SetTag gets a reference to the given string and assigns it to the Tag field.
func (o *FormWebhookIn) SetTag(v string) {
o.Tag = &v
}
// GetUrl returns the Url field value if set, zero value otherwise.
func (o *FormWebhookIn) GetUrl() string {
if o == nil || IsNil(o.Url) {
var ret string
return ret
}
return *o.Url
}
// GetUrlOk returns a tuple with the Url field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormWebhookIn) GetUrlOk() (*string, bool) {
if o == nil || IsNil(o.Url) {
return nil, false
}
return o.Url, true
}
// HasUrl returns a boolean if a field has been set.
func (o *FormWebhookIn) HasUrl() bool {
if o != nil && !IsNil(o.Url) {
return true
}
return false
}
// SetUrl gets a reference to the given string and assigns it to the Url field.
func (o *FormWebhookIn) SetUrl(v string) {
o.Url = &v
}
// GetWebhook returns the Webhook field value if set, zero value otherwise.
func (o *FormWebhookIn) GetWebhook() string {
if o == nil || IsNil(o.Webhook) {
var ret string
return ret
}
return *o.Webhook
}
// GetWebhookOk returns a tuple with the Webhook field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormWebhookIn) GetWebhookOk() (*string, bool) {
if o == nil || IsNil(o.Webhook) {
return nil, false
}
return o.Webhook, true
}
// HasWebhook returns a boolean if a field has been set.
func (o *FormWebhookIn) HasWebhook() bool {
if o != nil && !IsNil(o.Webhook) {
return true
}
return false
}
// SetWebhook gets a reference to the given string and assigns it to the Webhook field.
func (o *FormWebhookIn) SetWebhook(v string) {
o.Webhook = &v
}
func (o FormWebhookIn) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o FormWebhookIn) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Enabled) {
toSerialize["enabled"] = o.Enabled
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Rotate) {
toSerialize["rotate"] = o.Rotate
}
if !IsNil(o.Secret) {
toSerialize["secret"] = o.Secret
}
if !IsNil(o.Tag) {
toSerialize["tag"] = o.Tag
}
if !IsNil(o.Url) {
toSerialize["url"] = o.Url
}
if !IsNil(o.Webhook) {
toSerialize["webhook"] = o.Webhook
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *FormWebhookIn) UnmarshalJSON(data []byte) (err error) {
varFormWebhookIn := _FormWebhookIn{}
err = json.Unmarshal(data, &varFormWebhookIn)
if err != nil {
return err
}
*o = FormWebhookIn(varFormWebhookIn)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "enabled")
delete(additionalProperties, "id")
delete(additionalProperties, "rotate")
delete(additionalProperties, "secret")
delete(additionalProperties, "tag")
delete(additionalProperties, "url")
delete(additionalProperties, "webhook")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableFormWebhookIn struct {
value *FormWebhookIn
isSet bool
}
func (v NullableFormWebhookIn) Get() *FormWebhookIn {
return v.value
}
func (v *NullableFormWebhookIn) Set(val *FormWebhookIn) {
v.value = val
v.isSet = true
}
func (v NullableFormWebhookIn) IsSet() bool {
return v.isSet
}
func (v *NullableFormWebhookIn) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableFormWebhookIn(val *FormWebhookIn) *NullableFormWebhookIn {
return &NullableFormWebhookIn{value: val, isSet: true}
}
func (v NullableFormWebhookIn) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableFormWebhookIn) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}