mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
421 lines
10 KiB
Go
421 lines
10 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 FormWebhook type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &FormWebhook{}
|
|
|
|
// FormWebhook struct for FormWebhook
|
|
type FormWebhook struct {
|
|
// Created is when the webhook was made, RFC 3339.
|
|
Created *string `json:"created,omitempty"`
|
|
// Enabled is whether responses are posted.
|
|
Enabled *bool `json:"enabled,omitempty"`
|
|
// Form is the form's id.
|
|
Form *string `json:"form,omitempty"`
|
|
// ID is the webhook's id.
|
|
Id *string `json:"id,omitempty"`
|
|
// Secret is the signing secret, answered once: when the webhook is made or its secret is set or rotated. Every delivery carries Hanzo-Signature: t=<unix seconds>,sha256=<base64 of HMAC-SHA256(secret, \"<seconds>.\" + body)>; a receiver refuses one older than five minutes. It is kept in KMS and never read back.
|
|
Secret *string `json:"secret,omitempty"`
|
|
// Tag names the webhook in its form. At most 64 characters.
|
|
Tag *string `json:"tag,omitempty"`
|
|
// Updated is when it last changed, RFC 3339.
|
|
Updated *string `json:"updated,omitempty"`
|
|
// URL is the https address posted to.
|
|
Url *string `json:"url,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _FormWebhook FormWebhook
|
|
|
|
// NewFormWebhook instantiates a new FormWebhook 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 NewFormWebhook() *FormWebhook {
|
|
this := FormWebhook{}
|
|
return &this
|
|
}
|
|
|
|
// NewFormWebhookWithDefaults instantiates a new FormWebhook 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 NewFormWebhookWithDefaults() *FormWebhook {
|
|
this := FormWebhook{}
|
|
return &this
|
|
}
|
|
|
|
// GetCreated returns the Created field value if set, zero value otherwise.
|
|
func (o *FormWebhook) 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 *FormWebhook) 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 *FormWebhook) 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 *FormWebhook) SetCreated(v string) {
|
|
o.Created = &v
|
|
}
|
|
|
|
// GetEnabled returns the Enabled field value if set, zero value otherwise.
|
|
func (o *FormWebhook) 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 *FormWebhook) 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 *FormWebhook) 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 *FormWebhook) SetEnabled(v bool) {
|
|
o.Enabled = &v
|
|
}
|
|
|
|
// GetForm returns the Form field value if set, zero value otherwise.
|
|
func (o *FormWebhook) GetForm() string {
|
|
if o == nil || IsNil(o.Form) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Form
|
|
}
|
|
|
|
// GetFormOk returns a tuple with the Form field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *FormWebhook) GetFormOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Form) {
|
|
return nil, false
|
|
}
|
|
return o.Form, true
|
|
}
|
|
|
|
// HasForm returns a boolean if a field has been set.
|
|
func (o *FormWebhook) HasForm() bool {
|
|
if o != nil && !IsNil(o.Form) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetForm gets a reference to the given string and assigns it to the Form field.
|
|
func (o *FormWebhook) SetForm(v string) {
|
|
o.Form = &v
|
|
}
|
|
|
|
// GetId returns the Id field value if set, zero value otherwise.
|
|
func (o *FormWebhook) 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 *FormWebhook) 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 *FormWebhook) 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 *FormWebhook) SetId(v string) {
|
|
o.Id = &v
|
|
}
|
|
|
|
// GetSecret returns the Secret field value if set, zero value otherwise.
|
|
func (o *FormWebhook) 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 *FormWebhook) 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 *FormWebhook) 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 *FormWebhook) SetSecret(v string) {
|
|
o.Secret = &v
|
|
}
|
|
|
|
// GetTag returns the Tag field value if set, zero value otherwise.
|
|
func (o *FormWebhook) 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 *FormWebhook) 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 *FormWebhook) 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 *FormWebhook) SetTag(v string) {
|
|
o.Tag = &v
|
|
}
|
|
|
|
// GetUpdated returns the Updated field value if set, zero value otherwise.
|
|
func (o *FormWebhook) 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 *FormWebhook) 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 *FormWebhook) 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 *FormWebhook) SetUpdated(v string) {
|
|
o.Updated = &v
|
|
}
|
|
|
|
// GetUrl returns the Url field value if set, zero value otherwise.
|
|
func (o *FormWebhook) 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 *FormWebhook) 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 *FormWebhook) 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 *FormWebhook) SetUrl(v string) {
|
|
o.Url = &v
|
|
}
|
|
|
|
func (o FormWebhook) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o FormWebhook) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Created) {
|
|
toSerialize["created"] = o.Created
|
|
}
|
|
if !IsNil(o.Enabled) {
|
|
toSerialize["enabled"] = o.Enabled
|
|
}
|
|
if !IsNil(o.Form) {
|
|
toSerialize["form"] = o.Form
|
|
}
|
|
if !IsNil(o.Id) {
|
|
toSerialize["id"] = o.Id
|
|
}
|
|
if !IsNil(o.Secret) {
|
|
toSerialize["secret"] = o.Secret
|
|
}
|
|
if !IsNil(o.Tag) {
|
|
toSerialize["tag"] = o.Tag
|
|
}
|
|
if !IsNil(o.Updated) {
|
|
toSerialize["updated"] = o.Updated
|
|
}
|
|
if !IsNil(o.Url) {
|
|
toSerialize["url"] = o.Url
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *FormWebhook) UnmarshalJSON(data []byte) (err error) {
|
|
varFormWebhook := _FormWebhook{}
|
|
|
|
err = json.Unmarshal(data, &varFormWebhook)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = FormWebhook(varFormWebhook)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "created")
|
|
delete(additionalProperties, "enabled")
|
|
delete(additionalProperties, "form")
|
|
delete(additionalProperties, "id")
|
|
delete(additionalProperties, "secret")
|
|
delete(additionalProperties, "tag")
|
|
delete(additionalProperties, "updated")
|
|
delete(additionalProperties, "url")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableFormWebhook struct {
|
|
value *FormWebhook
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableFormWebhook) Get() *FormWebhook {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableFormWebhook) Set(val *FormWebhook) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableFormWebhook) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableFormWebhook) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableFormWebhook(val *FormWebhook) *NullableFormWebhook {
|
|
return &NullableFormWebhook{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableFormWebhook) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableFormWebhook) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|