Files
sdk/model_layout.go

487 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 Layout type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Layout{}
// Layout struct for Layout
type Layout struct {
Category *string `json:"category,omitempty"`
CreatedTime *string `json:"createdTime,omitempty"`
DisplayName *string `json:"displayName,omitempty"`
FormItems []FormItem `json:"formItems,omitempty"`
Name *string `json:"name,omitempty"`
Owner *string `json:"owner,omitempty"`
Position *string `json:"position,omitempty"`
Tag *string `json:"tag,omitempty"`
Type *string `json:"type,omitempty"`
Url *string `json:"url,omitempty"`
AdditionalProperties map[string]interface{}
}
type _Layout Layout
// NewLayout instantiates a new Layout 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 NewLayout() *Layout {
this := Layout{}
return &this
}
// NewLayoutWithDefaults instantiates a new Layout 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 NewLayoutWithDefaults() *Layout {
this := Layout{}
return &this
}
// GetCategory returns the Category field value if set, zero value otherwise.
func (o *Layout) GetCategory() string {
if o == nil || IsNil(o.Category) {
var ret string
return ret
}
return *o.Category
}
// GetCategoryOk returns a tuple with the Category field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Layout) GetCategoryOk() (*string, bool) {
if o == nil || IsNil(o.Category) {
return nil, false
}
return o.Category, true
}
// HasCategory returns a boolean if a field has been set.
func (o *Layout) HasCategory() bool {
if o != nil && !IsNil(o.Category) {
return true
}
return false
}
// SetCategory gets a reference to the given string and assigns it to the Category field.
func (o *Layout) SetCategory(v string) {
o.Category = &v
}
// GetCreatedTime returns the CreatedTime field value if set, zero value otherwise.
func (o *Layout) GetCreatedTime() string {
if o == nil || IsNil(o.CreatedTime) {
var ret string
return ret
}
return *o.CreatedTime
}
// GetCreatedTimeOk returns a tuple with the CreatedTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Layout) GetCreatedTimeOk() (*string, bool) {
if o == nil || IsNil(o.CreatedTime) {
return nil, false
}
return o.CreatedTime, true
}
// HasCreatedTime returns a boolean if a field has been set.
func (o *Layout) HasCreatedTime() bool {
if o != nil && !IsNil(o.CreatedTime) {
return true
}
return false
}
// SetCreatedTime gets a reference to the given string and assigns it to the CreatedTime field.
func (o *Layout) SetCreatedTime(v string) {
o.CreatedTime = &v
}
// GetDisplayName returns the DisplayName field value if set, zero value otherwise.
func (o *Layout) GetDisplayName() string {
if o == nil || IsNil(o.DisplayName) {
var ret string
return ret
}
return *o.DisplayName
}
// GetDisplayNameOk returns a tuple with the DisplayName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Layout) GetDisplayNameOk() (*string, bool) {
if o == nil || IsNil(o.DisplayName) {
return nil, false
}
return o.DisplayName, true
}
// HasDisplayName returns a boolean if a field has been set.
func (o *Layout) HasDisplayName() bool {
if o != nil && !IsNil(o.DisplayName) {
return true
}
return false
}
// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field.
func (o *Layout) SetDisplayName(v string) {
o.DisplayName = &v
}
// GetFormItems returns the FormItems field value if set, zero value otherwise.
func (o *Layout) GetFormItems() []FormItem {
if o == nil || IsNil(o.FormItems) {
var ret []FormItem
return ret
}
return o.FormItems
}
// GetFormItemsOk returns a tuple with the FormItems field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Layout) GetFormItemsOk() ([]FormItem, bool) {
if o == nil || IsNil(o.FormItems) {
return nil, false
}
return o.FormItems, true
}
// HasFormItems returns a boolean if a field has been set.
func (o *Layout) HasFormItems() bool {
if o != nil && !IsNil(o.FormItems) {
return true
}
return false
}
// SetFormItems gets a reference to the given []FormItem and assigns it to the FormItems field.
func (o *Layout) SetFormItems(v []FormItem) {
o.FormItems = v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *Layout) 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 *Layout) 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 *Layout) 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 *Layout) SetName(v string) {
o.Name = &v
}
// GetOwner returns the Owner field value if set, zero value otherwise.
func (o *Layout) GetOwner() string {
if o == nil || IsNil(o.Owner) {
var ret string
return ret
}
return *o.Owner
}
// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Layout) GetOwnerOk() (*string, bool) {
if o == nil || IsNil(o.Owner) {
return nil, false
}
return o.Owner, true
}
// HasOwner returns a boolean if a field has been set.
func (o *Layout) HasOwner() bool {
if o != nil && !IsNil(o.Owner) {
return true
}
return false
}
// SetOwner gets a reference to the given string and assigns it to the Owner field.
func (o *Layout) SetOwner(v string) {
o.Owner = &v
}
// GetPosition returns the Position field value if set, zero value otherwise.
func (o *Layout) GetPosition() string {
if o == nil || IsNil(o.Position) {
var ret string
return ret
}
return *o.Position
}
// GetPositionOk returns a tuple with the Position field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Layout) GetPositionOk() (*string, bool) {
if o == nil || IsNil(o.Position) {
return nil, false
}
return o.Position, true
}
// HasPosition returns a boolean if a field has been set.
func (o *Layout) HasPosition() bool {
if o != nil && !IsNil(o.Position) {
return true
}
return false
}
// SetPosition gets a reference to the given string and assigns it to the Position field.
func (o *Layout) SetPosition(v string) {
o.Position = &v
}
// GetTag returns the Tag field value if set, zero value otherwise.
func (o *Layout) GetTag() string {
if o == nil || IsNil(o.Tag) {
var ret string
return ret
}
return *o.Tag
}
// GetTagOk returns a tuple with the Tag field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Layout) GetTagOk() (*string, bool) {
if o == nil || IsNil(o.Tag) {
return nil, false
}
return o.Tag, true
}
// HasTag returns a boolean if a field has been set.
func (o *Layout) HasTag() bool {
if o != nil && !IsNil(o.Tag) {
return true
}
return false
}
// SetTag gets a reference to the given string and assigns it to the Tag field.
func (o *Layout) SetTag(v string) {
o.Tag = &v
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *Layout) 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 *Layout) 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 *Layout) 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 *Layout) SetType(v string) {
o.Type = &v
}
// GetUrl returns the Url field value if set, zero value otherwise.
func (o *Layout) GetUrl() string {
if o == nil || IsNil(o.Url) {
var ret string
return ret
}
return *o.Url
}
// GetUrlOk returns a tuple with the Url field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Layout) GetUrlOk() (*string, bool) {
if o == nil || IsNil(o.Url) {
return nil, false
}
return o.Url, true
}
// HasUrl returns a boolean if a field has been set.
func (o *Layout) HasUrl() bool {
if o != nil && !IsNil(o.Url) {
return true
}
return false
}
// SetUrl gets a reference to the given string and assigns it to the Url field.
func (o *Layout) SetUrl(v string) {
o.Url = &v
}
func (o Layout) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Layout) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Category) {
toSerialize["category"] = o.Category
}
if !IsNil(o.CreatedTime) {
toSerialize["createdTime"] = o.CreatedTime
}
if !IsNil(o.DisplayName) {
toSerialize["displayName"] = o.DisplayName
}
if !IsNil(o.FormItems) {
toSerialize["formItems"] = o.FormItems
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Owner) {
toSerialize["owner"] = o.Owner
}
if !IsNil(o.Position) {
toSerialize["position"] = o.Position
}
if !IsNil(o.Tag) {
toSerialize["tag"] = o.Tag
}
if !IsNil(o.Type) {
toSerialize["type"] = o.Type
}
if !IsNil(o.Url) {
toSerialize["url"] = o.Url
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Layout) UnmarshalJSON(data []byte) (err error) {
varLayout := _Layout{}
err = json.Unmarshal(data, &varLayout)
if err != nil {
return err
}
*o = Layout(varLayout)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "category")
delete(additionalProperties, "createdTime")
delete(additionalProperties, "displayName")
delete(additionalProperties, "formItems")
delete(additionalProperties, "name")
delete(additionalProperties, "owner")
delete(additionalProperties, "position")
delete(additionalProperties, "tag")
delete(additionalProperties, "type")
delete(additionalProperties, "url")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableLayout struct {
value *Layout
isSet bool
}
func (v NullableLayout) Get() *Layout {
return v.value
}
func (v *NullableLayout) Set(val *Layout) {
v.value = val
v.isSet = true
}
func (v NullableLayout) IsSet() bool {
return v.isSet
}
func (v *NullableLayout) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableLayout(val *Layout) *NullableLayout {
return &NullableLayout{value: val, isSet: true}
}
func (v NullableLayout) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableLayout) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}