Files
sdk/model_form_summary.go

420 lines
11 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 FormSummary type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &FormSummary{}
// FormSummary struct for FormSummary
type FormSummary struct {
// CompletionRate is completions over starts, 0 to 1.
CompletionRate *float64 `json:"completion_rate,omitempty"`
// Completions is how many were completed.
Completions *int64 `json:"completions,omitempty"`
// Fields are each asked field's figures, in form order.
Fields []FormFieldSummary `json:"fields,omitempty"`
// Form is the form's id.
Form *string `json:"form,omitempty"`
// Scanned is how many responses were read; Truncated says the form has more than one summary reads (50000), and the newest were read.
Scanned *int64 `json:"scanned,omitempty"`
// Starts is how many responses were begun: open and completed.
Starts *int64 `json:"starts,omitempty"`
Truncated *bool `json:"truncated,omitempty"`
// Views is null: a view is stated on the event stream as form_viewed and counted there, not kept with the responses.
Views *int64 `json:"views,omitempty"`
AdditionalProperties map[string]interface{}
}
type _FormSummary FormSummary
// NewFormSummary instantiates a new FormSummary 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 NewFormSummary() *FormSummary {
this := FormSummary{}
return &this
}
// NewFormSummaryWithDefaults instantiates a new FormSummary 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 NewFormSummaryWithDefaults() *FormSummary {
this := FormSummary{}
return &this
}
// GetCompletionRate returns the CompletionRate field value if set, zero value otherwise.
func (o *FormSummary) GetCompletionRate() float64 {
if o == nil || IsNil(o.CompletionRate) {
var ret float64
return ret
}
return *o.CompletionRate
}
// GetCompletionRateOk returns a tuple with the CompletionRate field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormSummary) GetCompletionRateOk() (*float64, bool) {
if o == nil || IsNil(o.CompletionRate) {
return nil, false
}
return o.CompletionRate, true
}
// HasCompletionRate returns a boolean if a field has been set.
func (o *FormSummary) HasCompletionRate() bool {
if o != nil && !IsNil(o.CompletionRate) {
return true
}
return false
}
// SetCompletionRate gets a reference to the given float64 and assigns it to the CompletionRate field.
func (o *FormSummary) SetCompletionRate(v float64) {
o.CompletionRate = &v
}
// GetCompletions returns the Completions field value if set, zero value otherwise.
func (o *FormSummary) GetCompletions() int64 {
if o == nil || IsNil(o.Completions) {
var ret int64
return ret
}
return *o.Completions
}
// GetCompletionsOk returns a tuple with the Completions field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormSummary) GetCompletionsOk() (*int64, bool) {
if o == nil || IsNil(o.Completions) {
return nil, false
}
return o.Completions, true
}
// HasCompletions returns a boolean if a field has been set.
func (o *FormSummary) HasCompletions() bool {
if o != nil && !IsNil(o.Completions) {
return true
}
return false
}
// SetCompletions gets a reference to the given int64 and assigns it to the Completions field.
func (o *FormSummary) SetCompletions(v int64) {
o.Completions = &v
}
// GetFields returns the Fields field value if set, zero value otherwise.
func (o *FormSummary) GetFields() []FormFieldSummary {
if o == nil || IsNil(o.Fields) {
var ret []FormFieldSummary
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 *FormSummary) GetFieldsOk() ([]FormFieldSummary, 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 *FormSummary) HasFields() bool {
if o != nil && !IsNil(o.Fields) {
return true
}
return false
}
// SetFields gets a reference to the given []FormFieldSummary and assigns it to the Fields field.
func (o *FormSummary) SetFields(v []FormFieldSummary) {
o.Fields = v
}
// GetForm returns the Form field value if set, zero value otherwise.
func (o *FormSummary) 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 *FormSummary) 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 *FormSummary) 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 *FormSummary) SetForm(v string) {
o.Form = &v
}
// GetScanned returns the Scanned field value if set, zero value otherwise.
func (o *FormSummary) GetScanned() int64 {
if o == nil || IsNil(o.Scanned) {
var ret int64
return ret
}
return *o.Scanned
}
// GetScannedOk returns a tuple with the Scanned field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormSummary) GetScannedOk() (*int64, bool) {
if o == nil || IsNil(o.Scanned) {
return nil, false
}
return o.Scanned, true
}
// HasScanned returns a boolean if a field has been set.
func (o *FormSummary) HasScanned() bool {
if o != nil && !IsNil(o.Scanned) {
return true
}
return false
}
// SetScanned gets a reference to the given int64 and assigns it to the Scanned field.
func (o *FormSummary) SetScanned(v int64) {
o.Scanned = &v
}
// GetStarts returns the Starts field value if set, zero value otherwise.
func (o *FormSummary) GetStarts() int64 {
if o == nil || IsNil(o.Starts) {
var ret int64
return ret
}
return *o.Starts
}
// GetStartsOk returns a tuple with the Starts field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormSummary) GetStartsOk() (*int64, bool) {
if o == nil || IsNil(o.Starts) {
return nil, false
}
return o.Starts, true
}
// HasStarts returns a boolean if a field has been set.
func (o *FormSummary) HasStarts() bool {
if o != nil && !IsNil(o.Starts) {
return true
}
return false
}
// SetStarts gets a reference to the given int64 and assigns it to the Starts field.
func (o *FormSummary) SetStarts(v int64) {
o.Starts = &v
}
// GetTruncated returns the Truncated field value if set, zero value otherwise.
func (o *FormSummary) GetTruncated() bool {
if o == nil || IsNil(o.Truncated) {
var ret bool
return ret
}
return *o.Truncated
}
// GetTruncatedOk returns a tuple with the Truncated field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormSummary) GetTruncatedOk() (*bool, bool) {
if o == nil || IsNil(o.Truncated) {
return nil, false
}
return o.Truncated, true
}
// HasTruncated returns a boolean if a field has been set.
func (o *FormSummary) HasTruncated() bool {
if o != nil && !IsNil(o.Truncated) {
return true
}
return false
}
// SetTruncated gets a reference to the given bool and assigns it to the Truncated field.
func (o *FormSummary) SetTruncated(v bool) {
o.Truncated = &v
}
// GetViews returns the Views field value if set, zero value otherwise.
func (o *FormSummary) GetViews() int64 {
if o == nil || IsNil(o.Views) {
var ret int64
return ret
}
return *o.Views
}
// GetViewsOk returns a tuple with the Views field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormSummary) GetViewsOk() (*int64, bool) {
if o == nil || IsNil(o.Views) {
return nil, false
}
return o.Views, true
}
// HasViews returns a boolean if a field has been set.
func (o *FormSummary) HasViews() bool {
if o != nil && !IsNil(o.Views) {
return true
}
return false
}
// SetViews gets a reference to the given int64 and assigns it to the Views field.
func (o *FormSummary) SetViews(v int64) {
o.Views = &v
}
func (o FormSummary) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o FormSummary) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.CompletionRate) {
toSerialize["completion_rate"] = o.CompletionRate
}
if !IsNil(o.Completions) {
toSerialize["completions"] = o.Completions
}
if !IsNil(o.Fields) {
toSerialize["fields"] = o.Fields
}
if !IsNil(o.Form) {
toSerialize["form"] = o.Form
}
if !IsNil(o.Scanned) {
toSerialize["scanned"] = o.Scanned
}
if !IsNil(o.Starts) {
toSerialize["starts"] = o.Starts
}
if !IsNil(o.Truncated) {
toSerialize["truncated"] = o.Truncated
}
if !IsNil(o.Views) {
toSerialize["views"] = o.Views
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *FormSummary) UnmarshalJSON(data []byte) (err error) {
varFormSummary := _FormSummary{}
err = json.Unmarshal(data, &varFormSummary)
if err != nil {
return err
}
*o = FormSummary(varFormSummary)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "completion_rate")
delete(additionalProperties, "completions")
delete(additionalProperties, "fields")
delete(additionalProperties, "form")
delete(additionalProperties, "scanned")
delete(additionalProperties, "starts")
delete(additionalProperties, "truncated")
delete(additionalProperties, "views")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableFormSummary struct {
value *FormSummary
isSet bool
}
func (v NullableFormSummary) Get() *FormSummary {
return v.value
}
func (v *NullableFormSummary) Set(val *FormSummary) {
v.value = val
v.isSet = true
}
func (v NullableFormSummary) IsSet() bool {
return v.isSet
}
func (v *NullableFormSummary) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableFormSummary(val *FormSummary) *NullableFormSummary {
return &NullableFormSummary{value: val, isSet: true}
}
func (v NullableFormSummary) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableFormSummary) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}