mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
459 lines
12 KiB
Go
459 lines
12 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 FormSubmission type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &FormSubmission{}
|
|
|
|
// FormSubmission struct for FormSubmission
|
|
type FormSubmission struct {
|
|
// Answers are the answers, one per field at most.
|
|
Answers []FormAnswer `json:"answers,omitempty"`
|
|
// Completed is false to save the answers so far and keep the response open (a later submission under the same token completes it); true or absent submits it whole, every required field answered. A completed response is final.
|
|
Completed *bool `json:"completed,omitempty"`
|
|
// Hidden are the values the page passes in, by the names the form declares; each one line of at most 500 characters.
|
|
Hidden map[string]string `json:"hidden,omitempty"`
|
|
// ID is the form's public id, from the path.
|
|
Id *string `json:"id,omitempty"`
|
|
// LandedAt is when the respondent opened the form, RFC 3339.
|
|
LandedAt *string `json:"landed_at,omitempty"`
|
|
// Path is the page the form was answered on, at most 500 characters.
|
|
Path *string `json:"path,omitempty"`
|
|
// Token is the client's idempotency token for this response: 8 to 64 letters, digits, dashes and underscores. A submission sent twice under one token is one response, so a double click or a retry files nothing twice. Absent, the response is new each time.
|
|
Token *string `json:"token,omitempty"`
|
|
// Visitor is the page's visitor id: letters, digits, dot, dash and underscore, at most 64. It is who the response is from when nobody is signed in and no email field is answered.
|
|
Visitor *string `json:"visitor,omitempty"`
|
|
// Website is a field no person sees and no person fills: a submission that fills it is refused.
|
|
Website *string `json:"website,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _FormSubmission FormSubmission
|
|
|
|
// NewFormSubmission instantiates a new FormSubmission 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 NewFormSubmission() *FormSubmission {
|
|
this := FormSubmission{}
|
|
return &this
|
|
}
|
|
|
|
// NewFormSubmissionWithDefaults instantiates a new FormSubmission 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 NewFormSubmissionWithDefaults() *FormSubmission {
|
|
this := FormSubmission{}
|
|
return &this
|
|
}
|
|
|
|
// GetAnswers returns the Answers field value if set, zero value otherwise.
|
|
func (o *FormSubmission) GetAnswers() []FormAnswer {
|
|
if o == nil || IsNil(o.Answers) {
|
|
var ret []FormAnswer
|
|
return ret
|
|
}
|
|
return o.Answers
|
|
}
|
|
|
|
// GetAnswersOk returns a tuple with the Answers field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *FormSubmission) GetAnswersOk() ([]FormAnswer, bool) {
|
|
if o == nil || IsNil(o.Answers) {
|
|
return nil, false
|
|
}
|
|
return o.Answers, true
|
|
}
|
|
|
|
// HasAnswers returns a boolean if a field has been set.
|
|
func (o *FormSubmission) HasAnswers() bool {
|
|
if o != nil && !IsNil(o.Answers) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetAnswers gets a reference to the given []FormAnswer and assigns it to the Answers field.
|
|
func (o *FormSubmission) SetAnswers(v []FormAnswer) {
|
|
o.Answers = v
|
|
}
|
|
|
|
// GetCompleted returns the Completed field value if set, zero value otherwise.
|
|
func (o *FormSubmission) GetCompleted() bool {
|
|
if o == nil || IsNil(o.Completed) {
|
|
var ret bool
|
|
return ret
|
|
}
|
|
return *o.Completed
|
|
}
|
|
|
|
// GetCompletedOk returns a tuple with the Completed field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *FormSubmission) GetCompletedOk() (*bool, bool) {
|
|
if o == nil || IsNil(o.Completed) {
|
|
return nil, false
|
|
}
|
|
return o.Completed, true
|
|
}
|
|
|
|
// HasCompleted returns a boolean if a field has been set.
|
|
func (o *FormSubmission) HasCompleted() bool {
|
|
if o != nil && !IsNil(o.Completed) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetCompleted gets a reference to the given bool and assigns it to the Completed field.
|
|
func (o *FormSubmission) SetCompleted(v bool) {
|
|
o.Completed = &v
|
|
}
|
|
|
|
// GetHidden returns the Hidden field value if set, zero value otherwise.
|
|
func (o *FormSubmission) GetHidden() map[string]string {
|
|
if o == nil || IsNil(o.Hidden) {
|
|
var ret map[string]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 *FormSubmission) GetHiddenOk() (map[string]string, bool) {
|
|
if o == nil || IsNil(o.Hidden) {
|
|
return map[string]string{}, false
|
|
}
|
|
return o.Hidden, true
|
|
}
|
|
|
|
// HasHidden returns a boolean if a field has been set.
|
|
func (o *FormSubmission) HasHidden() bool {
|
|
if o != nil && !IsNil(o.Hidden) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetHidden gets a reference to the given map[string]string and assigns it to the Hidden field.
|
|
func (o *FormSubmission) SetHidden(v map[string]string) {
|
|
o.Hidden = v
|
|
}
|
|
|
|
// GetId returns the Id field value if set, zero value otherwise.
|
|
func (o *FormSubmission) 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 *FormSubmission) 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 *FormSubmission) 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 *FormSubmission) SetId(v string) {
|
|
o.Id = &v
|
|
}
|
|
|
|
// GetLandedAt returns the LandedAt field value if set, zero value otherwise.
|
|
func (o *FormSubmission) GetLandedAt() string {
|
|
if o == nil || IsNil(o.LandedAt) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.LandedAt
|
|
}
|
|
|
|
// GetLandedAtOk returns a tuple with the LandedAt field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *FormSubmission) GetLandedAtOk() (*string, bool) {
|
|
if o == nil || IsNil(o.LandedAt) {
|
|
return nil, false
|
|
}
|
|
return o.LandedAt, true
|
|
}
|
|
|
|
// HasLandedAt returns a boolean if a field has been set.
|
|
func (o *FormSubmission) HasLandedAt() bool {
|
|
if o != nil && !IsNil(o.LandedAt) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetLandedAt gets a reference to the given string and assigns it to the LandedAt field.
|
|
func (o *FormSubmission) SetLandedAt(v string) {
|
|
o.LandedAt = &v
|
|
}
|
|
|
|
// GetPath returns the Path field value if set, zero value otherwise.
|
|
func (o *FormSubmission) GetPath() string {
|
|
if o == nil || IsNil(o.Path) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Path
|
|
}
|
|
|
|
// GetPathOk returns a tuple with the Path field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *FormSubmission) GetPathOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Path) {
|
|
return nil, false
|
|
}
|
|
return o.Path, true
|
|
}
|
|
|
|
// HasPath returns a boolean if a field has been set.
|
|
func (o *FormSubmission) HasPath() bool {
|
|
if o != nil && !IsNil(o.Path) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPath gets a reference to the given string and assigns it to the Path field.
|
|
func (o *FormSubmission) SetPath(v string) {
|
|
o.Path = &v
|
|
}
|
|
|
|
// GetToken returns the Token field value if set, zero value otherwise.
|
|
func (o *FormSubmission) GetToken() string {
|
|
if o == nil || IsNil(o.Token) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Token
|
|
}
|
|
|
|
// GetTokenOk returns a tuple with the Token field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *FormSubmission) GetTokenOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Token) {
|
|
return nil, false
|
|
}
|
|
return o.Token, true
|
|
}
|
|
|
|
// HasToken returns a boolean if a field has been set.
|
|
func (o *FormSubmission) HasToken() bool {
|
|
if o != nil && !IsNil(o.Token) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetToken gets a reference to the given string and assigns it to the Token field.
|
|
func (o *FormSubmission) SetToken(v string) {
|
|
o.Token = &v
|
|
}
|
|
|
|
// GetVisitor returns the Visitor field value if set, zero value otherwise.
|
|
func (o *FormSubmission) GetVisitor() string {
|
|
if o == nil || IsNil(o.Visitor) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Visitor
|
|
}
|
|
|
|
// GetVisitorOk returns a tuple with the Visitor field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *FormSubmission) GetVisitorOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Visitor) {
|
|
return nil, false
|
|
}
|
|
return o.Visitor, true
|
|
}
|
|
|
|
// HasVisitor returns a boolean if a field has been set.
|
|
func (o *FormSubmission) HasVisitor() bool {
|
|
if o != nil && !IsNil(o.Visitor) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetVisitor gets a reference to the given string and assigns it to the Visitor field.
|
|
func (o *FormSubmission) SetVisitor(v string) {
|
|
o.Visitor = &v
|
|
}
|
|
|
|
// GetWebsite returns the Website field value if set, zero value otherwise.
|
|
func (o *FormSubmission) GetWebsite() string {
|
|
if o == nil || IsNil(o.Website) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Website
|
|
}
|
|
|
|
// GetWebsiteOk returns a tuple with the Website field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *FormSubmission) GetWebsiteOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Website) {
|
|
return nil, false
|
|
}
|
|
return o.Website, true
|
|
}
|
|
|
|
// HasWebsite returns a boolean if a field has been set.
|
|
func (o *FormSubmission) HasWebsite() bool {
|
|
if o != nil && !IsNil(o.Website) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetWebsite gets a reference to the given string and assigns it to the Website field.
|
|
func (o *FormSubmission) SetWebsite(v string) {
|
|
o.Website = &v
|
|
}
|
|
|
|
func (o FormSubmission) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o FormSubmission) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Answers) {
|
|
toSerialize["answers"] = o.Answers
|
|
}
|
|
if !IsNil(o.Completed) {
|
|
toSerialize["completed"] = o.Completed
|
|
}
|
|
if !IsNil(o.Hidden) {
|
|
toSerialize["hidden"] = o.Hidden
|
|
}
|
|
if !IsNil(o.Id) {
|
|
toSerialize["id"] = o.Id
|
|
}
|
|
if !IsNil(o.LandedAt) {
|
|
toSerialize["landed_at"] = o.LandedAt
|
|
}
|
|
if !IsNil(o.Path) {
|
|
toSerialize["path"] = o.Path
|
|
}
|
|
if !IsNil(o.Token) {
|
|
toSerialize["token"] = o.Token
|
|
}
|
|
if !IsNil(o.Visitor) {
|
|
toSerialize["visitor"] = o.Visitor
|
|
}
|
|
if !IsNil(o.Website) {
|
|
toSerialize["website"] = o.Website
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *FormSubmission) UnmarshalJSON(data []byte) (err error) {
|
|
varFormSubmission := _FormSubmission{}
|
|
|
|
err = json.Unmarshal(data, &varFormSubmission)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = FormSubmission(varFormSubmission)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "answers")
|
|
delete(additionalProperties, "completed")
|
|
delete(additionalProperties, "hidden")
|
|
delete(additionalProperties, "id")
|
|
delete(additionalProperties, "landed_at")
|
|
delete(additionalProperties, "path")
|
|
delete(additionalProperties, "token")
|
|
delete(additionalProperties, "visitor")
|
|
delete(additionalProperties, "website")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableFormSubmission struct {
|
|
value *FormSubmission
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableFormSubmission) Get() *FormSubmission {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableFormSubmission) Set(val *FormSubmission) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableFormSubmission) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableFormSubmission) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableFormSubmission(val *FormSubmission) *NullableFormSubmission {
|
|
return &NullableFormSubmission{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableFormSubmission) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableFormSubmission) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|