Files
sdk/model_index.go

302 lines
7.2 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 Index type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Index{}
// Index struct for Index
type Index struct {
Links map[string]Link `json:"_links,omitempty"`
Description *string `json:"description,omitempty"`
Name *string `json:"name,omitempty"`
Operations []Op `json:"operations,omitempty"`
Stage *string `json:"stage,omitempty"`
AdditionalProperties map[string]interface{}
}
type _Index Index
// NewIndex instantiates a new Index 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 NewIndex() *Index {
this := Index{}
return &this
}
// NewIndexWithDefaults instantiates a new Index 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 NewIndexWithDefaults() *Index {
this := Index{}
return &this
}
// GetLinks returns the Links field value if set, zero value otherwise.
func (o *Index) GetLinks() map[string]Link {
if o == nil || IsNil(o.Links) {
var ret map[string]Link
return ret
}
return o.Links
}
// GetLinksOk returns a tuple with the Links field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Index) GetLinksOk() (map[string]Link, bool) {
if o == nil || IsNil(o.Links) {
return map[string]Link{}, false
}
return o.Links, true
}
// HasLinks returns a boolean if a field has been set.
func (o *Index) HasLinks() bool {
if o != nil && !IsNil(o.Links) {
return true
}
return false
}
// SetLinks gets a reference to the given map[string]Link and assigns it to the Links field.
func (o *Index) SetLinks(v map[string]Link) {
o.Links = v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *Index) GetDescription() string {
if o == nil || IsNil(o.Description) {
var ret string
return ret
}
return *o.Description
}
// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Index) GetDescriptionOk() (*string, bool) {
if o == nil || IsNil(o.Description) {
return nil, false
}
return o.Description, true
}
// HasDescription returns a boolean if a field has been set.
func (o *Index) HasDescription() bool {
if o != nil && !IsNil(o.Description) {
return true
}
return false
}
// SetDescription gets a reference to the given string and assigns it to the Description field.
func (o *Index) SetDescription(v string) {
o.Description = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *Index) 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 *Index) 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 *Index) 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 *Index) SetName(v string) {
o.Name = &v
}
// GetOperations returns the Operations field value if set, zero value otherwise.
func (o *Index) GetOperations() []Op {
if o == nil || IsNil(o.Operations) {
var ret []Op
return ret
}
return o.Operations
}
// GetOperationsOk returns a tuple with the Operations field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Index) GetOperationsOk() ([]Op, bool) {
if o == nil || IsNil(o.Operations) {
return nil, false
}
return o.Operations, true
}
// HasOperations returns a boolean if a field has been set.
func (o *Index) HasOperations() bool {
if o != nil && !IsNil(o.Operations) {
return true
}
return false
}
// SetOperations gets a reference to the given []Op and assigns it to the Operations field.
func (o *Index) SetOperations(v []Op) {
o.Operations = v
}
// GetStage returns the Stage field value if set, zero value otherwise.
func (o *Index) GetStage() string {
if o == nil || IsNil(o.Stage) {
var ret string
return ret
}
return *o.Stage
}
// GetStageOk returns a tuple with the Stage field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Index) GetStageOk() (*string, bool) {
if o == nil || IsNil(o.Stage) {
return nil, false
}
return o.Stage, true
}
// HasStage returns a boolean if a field has been set.
func (o *Index) HasStage() bool {
if o != nil && !IsNil(o.Stage) {
return true
}
return false
}
// SetStage gets a reference to the given string and assigns it to the Stage field.
func (o *Index) SetStage(v string) {
o.Stage = &v
}
func (o Index) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Index) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Links) {
toSerialize["_links"] = o.Links
}
if !IsNil(o.Description) {
toSerialize["description"] = o.Description
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Operations) {
toSerialize["operations"] = o.Operations
}
if !IsNil(o.Stage) {
toSerialize["stage"] = o.Stage
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Index) UnmarshalJSON(data []byte) (err error) {
varIndex := _Index{}
err = json.Unmarshal(data, &varIndex)
if err != nil {
return err
}
*o = Index(varIndex)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "_links")
delete(additionalProperties, "description")
delete(additionalProperties, "name")
delete(additionalProperties, "operations")
delete(additionalProperties, "stage")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableIndex struct {
value *Index
isSet bool
}
func (v NullableIndex) Get() *Index {
return v.value
}
func (v *NullableIndex) Set(val *Index) {
v.value = val
v.isSet = true
}
func (v NullableIndex) IsSet() bool {
return v.isSet
}
func (v *NullableIndex) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableIndex(val *Index) *NullableIndex {
return &NullableIndex{value: val, isSet: true}
}
func (v NullableIndex) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableIndex) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}