Files
sdk/model_form_response.go

763 lines
20 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 FormResponse type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &FormResponse{}
// FormResponse struct for FormResponse
type FormResponse struct {
// Answers are the answers, in the form's field order.
Answers []FormAnswer `json:"answers,omitempty"`
// Completed is whether the response was submitted whole; false is one saved part way.
Completed *bool `json:"completed,omitempty"`
// Created is when the record was first written, RFC 3339.
Created *string `json:"created,omitempty"`
// Duration is how many seconds lay between landing and submitting.
Duration *int64 `json:"duration,omitempty"`
// External is an imported response's id where it came from.
External *string `json:"external,omitempty"`
// Filed is whether a completed response is on the CRM's timeline. A filing that failed is tried again on a schedule, and POST .../file tries it now.
Filed *bool `json:"filed,omitempty"`
// Filing is why the last filing failed; empty once it is filed.
Filing *string `json:"filing,omitempty"`
// Form is the form's id.
Form *string `json:"form,omitempty"`
// Hidden are the values the page passed in, by name.
Hidden map[string]string `json:"hidden,omitempty"`
// ID is the response's id: derived from the form and the submission's token (from the form and the address on a subscribe form), so a retried submission is this same response.
Id *string `json:"id,omitempty"`
// LandedAt is when the respondent opened the form, RFC 3339, as their page said.
LandedAt *string `json:"landed_at,omitempty"`
// Path is the page the form was answered on.
Path *string `json:"path,omitempty"`
// Respondent is who it is from.
Respondent *FormRespondent `json:"respondent,omitempty"`
// Source is web, or import for a response brought in from elsewhere.
Source *string `json:"source,omitempty"`
// SubmittedAt is when the response was completed, RFC 3339.
SubmittedAt *string `json:"submitted_at,omitempty"`
// Token is the submission token the response was made under.
Token *string `json:"token,omitempty"`
// Updated is when it last changed, RFC 3339.
Updated *string `json:"updated,omitempty"`
AdditionalProperties map[string]interface{}
}
type _FormResponse FormResponse
// NewFormResponse instantiates a new FormResponse 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 NewFormResponse() *FormResponse {
this := FormResponse{}
return &this
}
// NewFormResponseWithDefaults instantiates a new FormResponse 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 NewFormResponseWithDefaults() *FormResponse {
this := FormResponse{}
return &this
}
// GetAnswers returns the Answers field value if set, zero value otherwise.
func (o *FormResponse) 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 *FormResponse) 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 *FormResponse) 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 *FormResponse) SetAnswers(v []FormAnswer) {
o.Answers = v
}
// GetCompleted returns the Completed field value if set, zero value otherwise.
func (o *FormResponse) 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 *FormResponse) 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 *FormResponse) 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 *FormResponse) SetCompleted(v bool) {
o.Completed = &v
}
// GetCreated returns the Created field value if set, zero value otherwise.
func (o *FormResponse) 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 *FormResponse) 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 *FormResponse) 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 *FormResponse) SetCreated(v string) {
o.Created = &v
}
// GetDuration returns the Duration field value if set, zero value otherwise.
func (o *FormResponse) GetDuration() int64 {
if o == nil || IsNil(o.Duration) {
var ret int64
return ret
}
return *o.Duration
}
// GetDurationOk returns a tuple with the Duration field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormResponse) GetDurationOk() (*int64, bool) {
if o == nil || IsNil(o.Duration) {
return nil, false
}
return o.Duration, true
}
// HasDuration returns a boolean if a field has been set.
func (o *FormResponse) HasDuration() bool {
if o != nil && !IsNil(o.Duration) {
return true
}
return false
}
// SetDuration gets a reference to the given int64 and assigns it to the Duration field.
func (o *FormResponse) SetDuration(v int64) {
o.Duration = &v
}
// GetExternal returns the External field value if set, zero value otherwise.
func (o *FormResponse) GetExternal() string {
if o == nil || IsNil(o.External) {
var ret string
return ret
}
return *o.External
}
// GetExternalOk returns a tuple with the External field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormResponse) GetExternalOk() (*string, bool) {
if o == nil || IsNil(o.External) {
return nil, false
}
return o.External, true
}
// HasExternal returns a boolean if a field has been set.
func (o *FormResponse) HasExternal() bool {
if o != nil && !IsNil(o.External) {
return true
}
return false
}
// SetExternal gets a reference to the given string and assigns it to the External field.
func (o *FormResponse) SetExternal(v string) {
o.External = &v
}
// GetFiled returns the Filed field value if set, zero value otherwise.
func (o *FormResponse) GetFiled() bool {
if o == nil || IsNil(o.Filed) {
var ret bool
return ret
}
return *o.Filed
}
// GetFiledOk returns a tuple with the Filed field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormResponse) GetFiledOk() (*bool, bool) {
if o == nil || IsNil(o.Filed) {
return nil, false
}
return o.Filed, true
}
// HasFiled returns a boolean if a field has been set.
func (o *FormResponse) HasFiled() bool {
if o != nil && !IsNil(o.Filed) {
return true
}
return false
}
// SetFiled gets a reference to the given bool and assigns it to the Filed field.
func (o *FormResponse) SetFiled(v bool) {
o.Filed = &v
}
// GetFiling returns the Filing field value if set, zero value otherwise.
func (o *FormResponse) GetFiling() string {
if o == nil || IsNil(o.Filing) {
var ret string
return ret
}
return *o.Filing
}
// GetFilingOk returns a tuple with the Filing field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormResponse) GetFilingOk() (*string, bool) {
if o == nil || IsNil(o.Filing) {
return nil, false
}
return o.Filing, true
}
// HasFiling returns a boolean if a field has been set.
func (o *FormResponse) HasFiling() bool {
if o != nil && !IsNil(o.Filing) {
return true
}
return false
}
// SetFiling gets a reference to the given string and assigns it to the Filing field.
func (o *FormResponse) SetFiling(v string) {
o.Filing = &v
}
// GetForm returns the Form field value if set, zero value otherwise.
func (o *FormResponse) 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 *FormResponse) 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 *FormResponse) 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 *FormResponse) SetForm(v string) {
o.Form = &v
}
// GetHidden returns the Hidden field value if set, zero value otherwise.
func (o *FormResponse) 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 *FormResponse) 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 *FormResponse) 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 *FormResponse) SetHidden(v map[string]string) {
o.Hidden = v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *FormResponse) 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 *FormResponse) 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 *FormResponse) 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 *FormResponse) SetId(v string) {
o.Id = &v
}
// GetLandedAt returns the LandedAt field value if set, zero value otherwise.
func (o *FormResponse) 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 *FormResponse) 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 *FormResponse) 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 *FormResponse) SetLandedAt(v string) {
o.LandedAt = &v
}
// GetPath returns the Path field value if set, zero value otherwise.
func (o *FormResponse) 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 *FormResponse) 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 *FormResponse) 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 *FormResponse) SetPath(v string) {
o.Path = &v
}
// GetRespondent returns the Respondent field value if set, zero value otherwise.
func (o *FormResponse) GetRespondent() FormRespondent {
if o == nil || IsNil(o.Respondent) {
var ret FormRespondent
return ret
}
return *o.Respondent
}
// GetRespondentOk returns a tuple with the Respondent field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormResponse) GetRespondentOk() (*FormRespondent, bool) {
if o == nil || IsNil(o.Respondent) {
return nil, false
}
return o.Respondent, true
}
// HasRespondent returns a boolean if a field has been set.
func (o *FormResponse) HasRespondent() bool {
if o != nil && !IsNil(o.Respondent) {
return true
}
return false
}
// SetRespondent gets a reference to the given FormRespondent and assigns it to the Respondent field.
func (o *FormResponse) SetRespondent(v FormRespondent) {
o.Respondent = &v
}
// GetSource returns the Source field value if set, zero value otherwise.
func (o *FormResponse) GetSource() string {
if o == nil || IsNil(o.Source) {
var ret string
return ret
}
return *o.Source
}
// GetSourceOk returns a tuple with the Source field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormResponse) GetSourceOk() (*string, bool) {
if o == nil || IsNil(o.Source) {
return nil, false
}
return o.Source, true
}
// HasSource returns a boolean if a field has been set.
func (o *FormResponse) HasSource() bool {
if o != nil && !IsNil(o.Source) {
return true
}
return false
}
// SetSource gets a reference to the given string and assigns it to the Source field.
func (o *FormResponse) SetSource(v string) {
o.Source = &v
}
// GetSubmittedAt returns the SubmittedAt field value if set, zero value otherwise.
func (o *FormResponse) GetSubmittedAt() string {
if o == nil || IsNil(o.SubmittedAt) {
var ret string
return ret
}
return *o.SubmittedAt
}
// GetSubmittedAtOk returns a tuple with the SubmittedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormResponse) GetSubmittedAtOk() (*string, bool) {
if o == nil || IsNil(o.SubmittedAt) {
return nil, false
}
return o.SubmittedAt, true
}
// HasSubmittedAt returns a boolean if a field has been set.
func (o *FormResponse) HasSubmittedAt() bool {
if o != nil && !IsNil(o.SubmittedAt) {
return true
}
return false
}
// SetSubmittedAt gets a reference to the given string and assigns it to the SubmittedAt field.
func (o *FormResponse) SetSubmittedAt(v string) {
o.SubmittedAt = &v
}
// GetToken returns the Token field value if set, zero value otherwise.
func (o *FormResponse) 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 *FormResponse) 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 *FormResponse) 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 *FormResponse) SetToken(v string) {
o.Token = &v
}
// GetUpdated returns the Updated field value if set, zero value otherwise.
func (o *FormResponse) 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 *FormResponse) 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 *FormResponse) 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 *FormResponse) SetUpdated(v string) {
o.Updated = &v
}
func (o FormResponse) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o FormResponse) 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.Created) {
toSerialize["created"] = o.Created
}
if !IsNil(o.Duration) {
toSerialize["duration"] = o.Duration
}
if !IsNil(o.External) {
toSerialize["external"] = o.External
}
if !IsNil(o.Filed) {
toSerialize["filed"] = o.Filed
}
if !IsNil(o.Filing) {
toSerialize["filing"] = o.Filing
}
if !IsNil(o.Form) {
toSerialize["form"] = o.Form
}
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.Respondent) {
toSerialize["respondent"] = o.Respondent
}
if !IsNil(o.Source) {
toSerialize["source"] = o.Source
}
if !IsNil(o.SubmittedAt) {
toSerialize["submitted_at"] = o.SubmittedAt
}
if !IsNil(o.Token) {
toSerialize["token"] = o.Token
}
if !IsNil(o.Updated) {
toSerialize["updated"] = o.Updated
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *FormResponse) UnmarshalJSON(data []byte) (err error) {
varFormResponse := _FormResponse{}
err = json.Unmarshal(data, &varFormResponse)
if err != nil {
return err
}
*o = FormResponse(varFormResponse)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "answers")
delete(additionalProperties, "completed")
delete(additionalProperties, "created")
delete(additionalProperties, "duration")
delete(additionalProperties, "external")
delete(additionalProperties, "filed")
delete(additionalProperties, "filing")
delete(additionalProperties, "form")
delete(additionalProperties, "hidden")
delete(additionalProperties, "id")
delete(additionalProperties, "landed_at")
delete(additionalProperties, "path")
delete(additionalProperties, "respondent")
delete(additionalProperties, "source")
delete(additionalProperties, "submitted_at")
delete(additionalProperties, "token")
delete(additionalProperties, "updated")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableFormResponse struct {
value *FormResponse
isSet bool
}
func (v NullableFormResponse) Get() *FormResponse {
return v.value
}
func (v *NullableFormResponse) Set(val *FormResponse) {
v.value = val
v.isSet = true
}
func (v NullableFormResponse) IsSet() bool {
return v.isSet
}
func (v *NullableFormResponse) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableFormResponse(val *FormResponse) *NullableFormResponse {
return &NullableFormResponse{value: val, isSet: true}
}
func (v NullableFormResponse) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableFormResponse) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}