Files
sdk/model_form_form.go

687 lines
18 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 FormForm type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &FormForm{}
// FormForm struct for FormForm
type FormForm struct {
// Created is when the form was made, RFC 3339.
Created *string `json:"created,omitempty"`
// Fields are the questions, in the order they are asked.
Fields []FormField `json:"fields,omitempty"`
// Hidden names the values a page passes in when it embeds the form (a video id, a plan): lowercase letters, digits and underscores, at most 32 each.
Hidden []string `json:"hidden,omitempty"`
// ID is the form's id: 15 lowercase hex characters, derived from the slug when the form has one, so a slug names one form for good.
Id *string `json:"id,omitempty"`
// Kind is form (every submission is a response, the default) or subscribe (a mailing list: an email field is required and one address is one response).
Kind *string `json:"kind,omitempty"`
// PublicID is the address the form is answered at: \"<org>.<slug or id>\", as GET /v1/form/public/{id} and POST /v1/form/public/{id}/responses take it.
PublicId *string `json:"public_id,omitempty"`
// Settings is how the form is answered.
Settings *FormOptions `json:"settings,omitempty"`
// Sinks are where each completed response goes. Absent on a write, the platform's defaults are taken.
Sinks *FormSinks `json:"sinks,omitempty"`
// Slug is the form's own name within its org: lowercase letters, digits and dashes, at most 64. Optional; once set it is the form's id, so it cannot change.
Slug *string `json:"slug,omitempty"`
// Tags label the form for its org: at most 20, each at most 64 characters.
Tags []string `json:"tags,omitempty"`
// Thanks is the screen shown after a submission, or where the respondent is sent. Optional.
Thanks *FormScreen `json:"thanks,omitempty"`
// Theme is the id of the theme the form is drawn in. Optional.
Theme *string `json:"theme,omitempty"`
// Title is the form's name, as a respondent and the CRM timeline read it. At most 200 characters.
Title *string `json:"title,omitempty"`
// Updated is when it last changed, RFC 3339.
Updated *string `json:"updated,omitempty"`
// Welcome is the screen shown before the first question. Optional.
Welcome *FormScreen `json:"welcome,omitempty"`
AdditionalProperties map[string]interface{}
}
type _FormForm FormForm
// NewFormForm instantiates a new FormForm 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 NewFormForm() *FormForm {
this := FormForm{}
return &this
}
// NewFormFormWithDefaults instantiates a new FormForm 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 NewFormFormWithDefaults() *FormForm {
this := FormForm{}
return &this
}
// GetCreated returns the Created field value if set, zero value otherwise.
func (o *FormForm) 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 *FormForm) 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 *FormForm) 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 *FormForm) SetCreated(v string) {
o.Created = &v
}
// GetFields returns the Fields field value if set, zero value otherwise.
func (o *FormForm) GetFields() []FormField {
if o == nil || IsNil(o.Fields) {
var ret []FormField
return ret
}
return o.Fields
}
// GetFieldsOk returns a tuple with the Fields field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormForm) GetFieldsOk() ([]FormField, bool) {
if o == nil || IsNil(o.Fields) {
return nil, false
}
return o.Fields, true
}
// HasFields returns a boolean if a field has been set.
func (o *FormForm) HasFields() bool {
if o != nil && !IsNil(o.Fields) {
return true
}
return false
}
// SetFields gets a reference to the given []FormField and assigns it to the Fields field.
func (o *FormForm) SetFields(v []FormField) {
o.Fields = v
}
// GetHidden returns the Hidden field value if set, zero value otherwise.
func (o *FormForm) GetHidden() []string {
if o == nil || IsNil(o.Hidden) {
var ret []string
return ret
}
return o.Hidden
}
// GetHiddenOk returns a tuple with the Hidden field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormForm) GetHiddenOk() ([]string, bool) {
if o == nil || IsNil(o.Hidden) {
return nil, false
}
return o.Hidden, true
}
// HasHidden returns a boolean if a field has been set.
func (o *FormForm) HasHidden() bool {
if o != nil && !IsNil(o.Hidden) {
return true
}
return false
}
// SetHidden gets a reference to the given []string and assigns it to the Hidden field.
func (o *FormForm) SetHidden(v []string) {
o.Hidden = v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *FormForm) 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 *FormForm) 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 *FormForm) 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 *FormForm) SetId(v string) {
o.Id = &v
}
// GetKind returns the Kind field value if set, zero value otherwise.
func (o *FormForm) GetKind() string {
if o == nil || IsNil(o.Kind) {
var ret string
return ret
}
return *o.Kind
}
// GetKindOk returns a tuple with the Kind field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormForm) GetKindOk() (*string, bool) {
if o == nil || IsNil(o.Kind) {
return nil, false
}
return o.Kind, true
}
// HasKind returns a boolean if a field has been set.
func (o *FormForm) HasKind() bool {
if o != nil && !IsNil(o.Kind) {
return true
}
return false
}
// SetKind gets a reference to the given string and assigns it to the Kind field.
func (o *FormForm) SetKind(v string) {
o.Kind = &v
}
// GetPublicId returns the PublicId field value if set, zero value otherwise.
func (o *FormForm) GetPublicId() string {
if o == nil || IsNil(o.PublicId) {
var ret string
return ret
}
return *o.PublicId
}
// GetPublicIdOk returns a tuple with the PublicId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormForm) GetPublicIdOk() (*string, bool) {
if o == nil || IsNil(o.PublicId) {
return nil, false
}
return o.PublicId, true
}
// HasPublicId returns a boolean if a field has been set.
func (o *FormForm) HasPublicId() bool {
if o != nil && !IsNil(o.PublicId) {
return true
}
return false
}
// SetPublicId gets a reference to the given string and assigns it to the PublicId field.
func (o *FormForm) SetPublicId(v string) {
o.PublicId = &v
}
// GetSettings returns the Settings field value if set, zero value otherwise.
func (o *FormForm) GetSettings() FormOptions {
if o == nil || IsNil(o.Settings) {
var ret FormOptions
return ret
}
return *o.Settings
}
// GetSettingsOk returns a tuple with the Settings field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormForm) GetSettingsOk() (*FormOptions, bool) {
if o == nil || IsNil(o.Settings) {
return nil, false
}
return o.Settings, true
}
// HasSettings returns a boolean if a field has been set.
func (o *FormForm) HasSettings() bool {
if o != nil && !IsNil(o.Settings) {
return true
}
return false
}
// SetSettings gets a reference to the given FormOptions and assigns it to the Settings field.
func (o *FormForm) SetSettings(v FormOptions) {
o.Settings = &v
}
// GetSinks returns the Sinks field value if set, zero value otherwise.
func (o *FormForm) GetSinks() FormSinks {
if o == nil || IsNil(o.Sinks) {
var ret FormSinks
return ret
}
return *o.Sinks
}
// GetSinksOk returns a tuple with the Sinks field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormForm) GetSinksOk() (*FormSinks, bool) {
if o == nil || IsNil(o.Sinks) {
return nil, false
}
return o.Sinks, true
}
// HasSinks returns a boolean if a field has been set.
func (o *FormForm) HasSinks() bool {
if o != nil && !IsNil(o.Sinks) {
return true
}
return false
}
// SetSinks gets a reference to the given FormSinks and assigns it to the Sinks field.
func (o *FormForm) SetSinks(v FormSinks) {
o.Sinks = &v
}
// GetSlug returns the Slug field value if set, zero value otherwise.
func (o *FormForm) GetSlug() string {
if o == nil || IsNil(o.Slug) {
var ret string
return ret
}
return *o.Slug
}
// GetSlugOk returns a tuple with the Slug field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormForm) GetSlugOk() (*string, bool) {
if o == nil || IsNil(o.Slug) {
return nil, false
}
return o.Slug, true
}
// HasSlug returns a boolean if a field has been set.
func (o *FormForm) HasSlug() bool {
if o != nil && !IsNil(o.Slug) {
return true
}
return false
}
// SetSlug gets a reference to the given string and assigns it to the Slug field.
func (o *FormForm) SetSlug(v string) {
o.Slug = &v
}
// GetTags returns the Tags field value if set, zero value otherwise.
func (o *FormForm) GetTags() []string {
if o == nil || IsNil(o.Tags) {
var ret []string
return ret
}
return o.Tags
}
// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormForm) GetTagsOk() ([]string, bool) {
if o == nil || IsNil(o.Tags) {
return nil, false
}
return o.Tags, true
}
// HasTags returns a boolean if a field has been set.
func (o *FormForm) HasTags() bool {
if o != nil && !IsNil(o.Tags) {
return true
}
return false
}
// SetTags gets a reference to the given []string and assigns it to the Tags field.
func (o *FormForm) SetTags(v []string) {
o.Tags = v
}
// GetThanks returns the Thanks field value if set, zero value otherwise.
func (o *FormForm) GetThanks() FormScreen {
if o == nil || IsNil(o.Thanks) {
var ret FormScreen
return ret
}
return *o.Thanks
}
// GetThanksOk returns a tuple with the Thanks field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormForm) GetThanksOk() (*FormScreen, bool) {
if o == nil || IsNil(o.Thanks) {
return nil, false
}
return o.Thanks, true
}
// HasThanks returns a boolean if a field has been set.
func (o *FormForm) HasThanks() bool {
if o != nil && !IsNil(o.Thanks) {
return true
}
return false
}
// SetThanks gets a reference to the given FormScreen and assigns it to the Thanks field.
func (o *FormForm) SetThanks(v FormScreen) {
o.Thanks = &v
}
// GetTheme returns the Theme field value if set, zero value otherwise.
func (o *FormForm) GetTheme() string {
if o == nil || IsNil(o.Theme) {
var ret string
return ret
}
return *o.Theme
}
// GetThemeOk returns a tuple with the Theme field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormForm) GetThemeOk() (*string, bool) {
if o == nil || IsNil(o.Theme) {
return nil, false
}
return o.Theme, true
}
// HasTheme returns a boolean if a field has been set.
func (o *FormForm) HasTheme() bool {
if o != nil && !IsNil(o.Theme) {
return true
}
return false
}
// SetTheme gets a reference to the given string and assigns it to the Theme field.
func (o *FormForm) SetTheme(v string) {
o.Theme = &v
}
// GetTitle returns the Title field value if set, zero value otherwise.
func (o *FormForm) GetTitle() string {
if o == nil || IsNil(o.Title) {
var ret string
return ret
}
return *o.Title
}
// GetTitleOk returns a tuple with the Title field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormForm) GetTitleOk() (*string, bool) {
if o == nil || IsNil(o.Title) {
return nil, false
}
return o.Title, true
}
// HasTitle returns a boolean if a field has been set.
func (o *FormForm) HasTitle() bool {
if o != nil && !IsNil(o.Title) {
return true
}
return false
}
// SetTitle gets a reference to the given string and assigns it to the Title field.
func (o *FormForm) SetTitle(v string) {
o.Title = &v
}
// GetUpdated returns the Updated field value if set, zero value otherwise.
func (o *FormForm) 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 *FormForm) 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 *FormForm) 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 *FormForm) SetUpdated(v string) {
o.Updated = &v
}
// GetWelcome returns the Welcome field value if set, zero value otherwise.
func (o *FormForm) GetWelcome() FormScreen {
if o == nil || IsNil(o.Welcome) {
var ret FormScreen
return ret
}
return *o.Welcome
}
// GetWelcomeOk returns a tuple with the Welcome field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormForm) GetWelcomeOk() (*FormScreen, bool) {
if o == nil || IsNil(o.Welcome) {
return nil, false
}
return o.Welcome, true
}
// HasWelcome returns a boolean if a field has been set.
func (o *FormForm) HasWelcome() bool {
if o != nil && !IsNil(o.Welcome) {
return true
}
return false
}
// SetWelcome gets a reference to the given FormScreen and assigns it to the Welcome field.
func (o *FormForm) SetWelcome(v FormScreen) {
o.Welcome = &v
}
func (o FormForm) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o FormForm) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Created) {
toSerialize["created"] = o.Created
}
if !IsNil(o.Fields) {
toSerialize["fields"] = o.Fields
}
if !IsNil(o.Hidden) {
toSerialize["hidden"] = o.Hidden
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Kind) {
toSerialize["kind"] = o.Kind
}
if !IsNil(o.PublicId) {
toSerialize["public_id"] = o.PublicId
}
if !IsNil(o.Settings) {
toSerialize["settings"] = o.Settings
}
if !IsNil(o.Sinks) {
toSerialize["sinks"] = o.Sinks
}
if !IsNil(o.Slug) {
toSerialize["slug"] = o.Slug
}
if !IsNil(o.Tags) {
toSerialize["tags"] = o.Tags
}
if !IsNil(o.Thanks) {
toSerialize["thanks"] = o.Thanks
}
if !IsNil(o.Theme) {
toSerialize["theme"] = o.Theme
}
if !IsNil(o.Title) {
toSerialize["title"] = o.Title
}
if !IsNil(o.Updated) {
toSerialize["updated"] = o.Updated
}
if !IsNil(o.Welcome) {
toSerialize["welcome"] = o.Welcome
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *FormForm) UnmarshalJSON(data []byte) (err error) {
varFormForm := _FormForm{}
err = json.Unmarshal(data, &varFormForm)
if err != nil {
return err
}
*o = FormForm(varFormForm)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "created")
delete(additionalProperties, "fields")
delete(additionalProperties, "hidden")
delete(additionalProperties, "id")
delete(additionalProperties, "kind")
delete(additionalProperties, "public_id")
delete(additionalProperties, "settings")
delete(additionalProperties, "sinks")
delete(additionalProperties, "slug")
delete(additionalProperties, "tags")
delete(additionalProperties, "thanks")
delete(additionalProperties, "theme")
delete(additionalProperties, "title")
delete(additionalProperties, "updated")
delete(additionalProperties, "welcome")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableFormForm struct {
value *FormForm
isSet bool
}
func (v NullableFormForm) Get() *FormForm {
return v.value
}
func (v *NullableFormForm) Set(val *FormForm) {
v.value = val
v.isSet = true
}
func (v NullableFormForm) IsSet() bool {
return v.isSet
}
func (v *NullableFormForm) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableFormForm(val *FormForm) *NullableFormForm {
return &NullableFormForm{value: val, isSet: true}
}
func (v NullableFormForm) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableFormForm) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}