Files
sdk/model_form_item.go

302 lines
7.1 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 FormItem type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &FormItem{}
// FormItem struct for FormItem
type FormItem struct {
Label *string `json:"label,omitempty"`
Name *string `json:"name,omitempty"`
Type *string `json:"type,omitempty"`
Visible *bool `json:"visible,omitempty"`
Width *string `json:"width,omitempty"`
AdditionalProperties map[string]interface{}
}
type _FormItem FormItem
// NewFormItem instantiates a new FormItem 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 NewFormItem() *FormItem {
this := FormItem{}
return &this
}
// NewFormItemWithDefaults instantiates a new FormItem 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 NewFormItemWithDefaults() *FormItem {
this := FormItem{}
return &this
}
// GetLabel returns the Label field value if set, zero value otherwise.
func (o *FormItem) GetLabel() string {
if o == nil || IsNil(o.Label) {
var ret string
return ret
}
return *o.Label
}
// GetLabelOk returns a tuple with the Label field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormItem) GetLabelOk() (*string, bool) {
if o == nil || IsNil(o.Label) {
return nil, false
}
return o.Label, true
}
// HasLabel returns a boolean if a field has been set.
func (o *FormItem) HasLabel() bool {
if o != nil && !IsNil(o.Label) {
return true
}
return false
}
// SetLabel gets a reference to the given string and assigns it to the Label field.
func (o *FormItem) SetLabel(v string) {
o.Label = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *FormItem) GetName() string {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormItem) GetNameOk() (*string, bool) {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *FormItem) HasName() bool {
if o != nil && !IsNil(o.Name) {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *FormItem) SetName(v string) {
o.Name = &v
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *FormItem) GetType() string {
if o == nil || IsNil(o.Type) {
var ret string
return ret
}
return *o.Type
}
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormItem) GetTypeOk() (*string, bool) {
if o == nil || IsNil(o.Type) {
return nil, false
}
return o.Type, true
}
// HasType returns a boolean if a field has been set.
func (o *FormItem) HasType() bool {
if o != nil && !IsNil(o.Type) {
return true
}
return false
}
// SetType gets a reference to the given string and assigns it to the Type field.
func (o *FormItem) SetType(v string) {
o.Type = &v
}
// GetVisible returns the Visible field value if set, zero value otherwise.
func (o *FormItem) GetVisible() bool {
if o == nil || IsNil(o.Visible) {
var ret bool
return ret
}
return *o.Visible
}
// GetVisibleOk returns a tuple with the Visible field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormItem) GetVisibleOk() (*bool, bool) {
if o == nil || IsNil(o.Visible) {
return nil, false
}
return o.Visible, true
}
// HasVisible returns a boolean if a field has been set.
func (o *FormItem) HasVisible() bool {
if o != nil && !IsNil(o.Visible) {
return true
}
return false
}
// SetVisible gets a reference to the given bool and assigns it to the Visible field.
func (o *FormItem) SetVisible(v bool) {
o.Visible = &v
}
// GetWidth returns the Width field value if set, zero value otherwise.
func (o *FormItem) GetWidth() string {
if o == nil || IsNil(o.Width) {
var ret string
return ret
}
return *o.Width
}
// GetWidthOk returns a tuple with the Width field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *FormItem) GetWidthOk() (*string, bool) {
if o == nil || IsNil(o.Width) {
return nil, false
}
return o.Width, true
}
// HasWidth returns a boolean if a field has been set.
func (o *FormItem) HasWidth() bool {
if o != nil && !IsNil(o.Width) {
return true
}
return false
}
// SetWidth gets a reference to the given string and assigns it to the Width field.
func (o *FormItem) SetWidth(v string) {
o.Width = &v
}
func (o FormItem) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o FormItem) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Label) {
toSerialize["label"] = o.Label
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Type) {
toSerialize["type"] = o.Type
}
if !IsNil(o.Visible) {
toSerialize["visible"] = o.Visible
}
if !IsNil(o.Width) {
toSerialize["width"] = o.Width
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *FormItem) UnmarshalJSON(data []byte) (err error) {
varFormItem := _FormItem{}
err = json.Unmarshal(data, &varFormItem)
if err != nil {
return err
}
*o = FormItem(varFormItem)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "label")
delete(additionalProperties, "name")
delete(additionalProperties, "type")
delete(additionalProperties, "visible")
delete(additionalProperties, "width")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableFormItem struct {
value *FormItem
isSet bool
}
func (v NullableFormItem) Get() *FormItem {
return v.value
}
func (v *NullableFormItem) Set(val *FormItem) {
v.value = val
v.isSet = true
}
func (v NullableFormItem) IsSet() bool {
return v.isSet
}
func (v *NullableFormItem) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableFormItem(val *FormItem) *NullableFormItem {
return &NullableFormItem{value: val, isSet: true}
}
func (v NullableFormItem) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableFormItem) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}