Files
sdk/model_form_receipt.go

269 lines
6.7 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 FormReceipt type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &FormReceipt{}
// FormReceipt struct for FormReceipt
type FormReceipt struct {
// Completed is whether the response is now submitted whole.
Completed *bool `json:"completed,omitempty"`
// ID is the response's id.
Id *string `json:"id,omitempty"`
// SubmittedAt is when it was completed, RFC 3339.
SubmittedAt *string `json:"submitted_at,omitempty"`
// Thanks is the form's thank-you screen, for a completed response.
Thanks *FormScreen `json:"thanks,omitempty"`
AdditionalProperties map[string]interface{}
}
type _FormReceipt FormReceipt
// NewFormReceipt instantiates a new FormReceipt 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 NewFormReceipt() *FormReceipt {
this := FormReceipt{}
return &this
}
// NewFormReceiptWithDefaults instantiates a new FormReceipt 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 NewFormReceiptWithDefaults() *FormReceipt {
this := FormReceipt{}
return &this
}
// GetCompleted returns the Completed field value if set, zero value otherwise.
func (o *FormReceipt) 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 *FormReceipt) 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 *FormReceipt) 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 *FormReceipt) SetCompleted(v bool) {
o.Completed = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *FormReceipt) 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 *FormReceipt) 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 *FormReceipt) 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 *FormReceipt) SetId(v string) {
o.Id = &v
}
// GetSubmittedAt returns the SubmittedAt field value if set, zero value otherwise.
func (o *FormReceipt) 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 *FormReceipt) 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 *FormReceipt) 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 *FormReceipt) SetSubmittedAt(v string) {
o.SubmittedAt = &v
}
// GetThanks returns the Thanks field value if set, zero value otherwise.
func (o *FormReceipt) 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 *FormReceipt) 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 *FormReceipt) 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 *FormReceipt) SetThanks(v FormScreen) {
o.Thanks = &v
}
func (o FormReceipt) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o FormReceipt) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Completed) {
toSerialize["completed"] = o.Completed
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.SubmittedAt) {
toSerialize["submitted_at"] = o.SubmittedAt
}
if !IsNil(o.Thanks) {
toSerialize["thanks"] = o.Thanks
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *FormReceipt) UnmarshalJSON(data []byte) (err error) {
varFormReceipt := _FormReceipt{}
err = json.Unmarshal(data, &varFormReceipt)
if err != nil {
return err
}
*o = FormReceipt(varFormReceipt)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "completed")
delete(additionalProperties, "id")
delete(additionalProperties, "submitted_at")
delete(additionalProperties, "thanks")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableFormReceipt struct {
value *FormReceipt
isSet bool
}
func (v NullableFormReceipt) Get() *FormReceipt {
return v.value
}
func (v *NullableFormReceipt) Set(val *FormReceipt) {
v.value = val
v.isSet = true
}
func (v NullableFormReceipt) IsSet() bool {
return v.isSet
}
func (v *NullableFormReceipt) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableFormReceipt(val *FormReceipt) *NullableFormReceipt {
return &NullableFormReceipt{value: val, isSet: true}
}
func (v NullableFormReceipt) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableFormReceipt) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}