/* STACKIT IaaS API This API allows you to create and modify IaaS resources. API version: 2beta1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package iaasbeta import ( "encoding/json" ) // checks if the AffinityGroup type satisfies the MappedNullable interface at compile time var _ MappedNullable = &AffinityGroup{} /* types and functions for id */ // isNotNullableString type AffinityGroupGetIdAttributeType = *string func getAffinityGroupGetIdAttributeTypeOk(arg AffinityGroupGetIdAttributeType) (ret AffinityGroupGetIdRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setAffinityGroupGetIdAttributeType(arg *AffinityGroupGetIdAttributeType, val AffinityGroupGetIdRetType) { *arg = &val } type AffinityGroupGetIdArgType = string type AffinityGroupGetIdRetType = string /* types and functions for members */ // isArray type AffinityGroupGetMembersAttributeType = *[]string type AffinityGroupGetMembersArgType = []string type AffinityGroupGetMembersRetType = []string func getAffinityGroupGetMembersAttributeTypeOk(arg AffinityGroupGetMembersAttributeType) (ret AffinityGroupGetMembersRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setAffinityGroupGetMembersAttributeType(arg *AffinityGroupGetMembersAttributeType, val AffinityGroupGetMembersRetType) { *arg = &val } /* types and functions for name */ // isNotNullableString type AffinityGroupGetNameAttributeType = *string func getAffinityGroupGetNameAttributeTypeOk(arg AffinityGroupGetNameAttributeType) (ret AffinityGroupGetNameRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setAffinityGroupGetNameAttributeType(arg *AffinityGroupGetNameAttributeType, val AffinityGroupGetNameRetType) { *arg = &val } type AffinityGroupGetNameArgType = string type AffinityGroupGetNameRetType = string /* types and functions for policy */ // isNotNullableString type AffinityGroupGetPolicyAttributeType = *string func getAffinityGroupGetPolicyAttributeTypeOk(arg AffinityGroupGetPolicyAttributeType) (ret AffinityGroupGetPolicyRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setAffinityGroupGetPolicyAttributeType(arg *AffinityGroupGetPolicyAttributeType, val AffinityGroupGetPolicyRetType) { *arg = &val } type AffinityGroupGetPolicyArgType = string type AffinityGroupGetPolicyRetType = string // AffinityGroup Definition of an affinity group. type AffinityGroup struct { // Universally Unique Identifier (UUID). Id AffinityGroupGetIdAttributeType `json:"id,omitempty"` // The servers that are part of the affinity group. Members AffinityGroupGetMembersAttributeType `json:"members,omitempty"` // The name for a General Object. Matches Names and also UUIDs. // REQUIRED Name AffinityGroupGetNameAttributeType `json:"name" required:"true"` // The affinity group policy. `hard-affinity`: All servers in this group will be hosted on the same compute node. `soft-affinity`: All servers in this group will be hosted on as few compute nodes as possible. `hard-anti-affinity`: All servers in this group will be hosted on different compute nodes. `soft-anti-affinity`: All servers in this group will be hosted on as many compute nodes as possible. Possible values: `hard-anti-affinity`, `hard-affinity`, `soft-anti-affinity`, `soft-affinity`. // REQUIRED Policy AffinityGroupGetPolicyAttributeType `json:"policy" required:"true"` } type _AffinityGroup AffinityGroup // NewAffinityGroup instantiates a new AffinityGroup 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 NewAffinityGroup(name AffinityGroupGetNameArgType, policy AffinityGroupGetPolicyArgType) *AffinityGroup { this := AffinityGroup{} setAffinityGroupGetNameAttributeType(&this.Name, name) setAffinityGroupGetPolicyAttributeType(&this.Policy, policy) return &this } // NewAffinityGroupWithDefaults instantiates a new AffinityGroup 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 NewAffinityGroupWithDefaults() *AffinityGroup { this := AffinityGroup{} return &this } // GetId returns the Id field value if set, zero value otherwise. func (o *AffinityGroup) GetId() (res AffinityGroupGetIdRetType) { res, _ = o.GetIdOk() return } // 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 *AffinityGroup) GetIdOk() (ret AffinityGroupGetIdRetType, ok bool) { return getAffinityGroupGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. func (o *AffinityGroup) HasId() bool { _, ok := o.GetIdOk() return ok } // SetId gets a reference to the given string and assigns it to the Id field. func (o *AffinityGroup) SetId(v AffinityGroupGetIdRetType) { setAffinityGroupGetIdAttributeType(&o.Id, v) } // GetMembers returns the Members field value if set, zero value otherwise. func (o *AffinityGroup) GetMembers() (res AffinityGroupGetMembersRetType) { res, _ = o.GetMembersOk() return } // GetMembersOk returns a tuple with the Members field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *AffinityGroup) GetMembersOk() (ret AffinityGroupGetMembersRetType, ok bool) { return getAffinityGroupGetMembersAttributeTypeOk(o.Members) } // HasMembers returns a boolean if a field has been set. func (o *AffinityGroup) HasMembers() bool { _, ok := o.GetMembersOk() return ok } // SetMembers gets a reference to the given []string and assigns it to the Members field. func (o *AffinityGroup) SetMembers(v AffinityGroupGetMembersRetType) { setAffinityGroupGetMembersAttributeType(&o.Members, v) } // GetName returns the Name field value func (o *AffinityGroup) GetName() (ret AffinityGroupGetNameRetType) { ret, _ = o.GetNameOk() return ret } // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. func (o *AffinityGroup) GetNameOk() (ret AffinityGroupGetNameRetType, ok bool) { return getAffinityGroupGetNameAttributeTypeOk(o.Name) } // SetName sets field value func (o *AffinityGroup) SetName(v AffinityGroupGetNameRetType) { setAffinityGroupGetNameAttributeType(&o.Name, v) } // GetPolicy returns the Policy field value func (o *AffinityGroup) GetPolicy() (ret AffinityGroupGetPolicyRetType) { ret, _ = o.GetPolicyOk() return ret } // GetPolicyOk returns a tuple with the Policy field value // and a boolean to check if the value has been set. func (o *AffinityGroup) GetPolicyOk() (ret AffinityGroupGetPolicyRetType, ok bool) { return getAffinityGroupGetPolicyAttributeTypeOk(o.Policy) } // SetPolicy sets field value func (o *AffinityGroup) SetPolicy(v AffinityGroupGetPolicyRetType) { setAffinityGroupGetPolicyAttributeType(&o.Policy, v) } func (o AffinityGroup) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getAffinityGroupGetIdAttributeTypeOk(o.Id); ok { toSerialize["Id"] = val } if val, ok := getAffinityGroupGetMembersAttributeTypeOk(o.Members); ok { toSerialize["Members"] = val } if val, ok := getAffinityGroupGetNameAttributeTypeOk(o.Name); ok { toSerialize["Name"] = val } if val, ok := getAffinityGroupGetPolicyAttributeTypeOk(o.Policy); ok { toSerialize["Policy"] = val } return toSerialize, nil } type NullableAffinityGroup struct { value *AffinityGroup isSet bool } func (v NullableAffinityGroup) Get() *AffinityGroup { return v.value } func (v *NullableAffinityGroup) Set(val *AffinityGroup) { v.value = val v.isSet = true } func (v NullableAffinityGroup) IsSet() bool { return v.isSet } func (v *NullableAffinityGroup) Unset() { v.value = nil v.isSet = false } func NewNullableAffinityGroup(val *AffinityGroup) *NullableAffinityGroup { return &NullableAffinityGroup{value: val, isSet: true} } func (v NullableAffinityGroup) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableAffinityGroup) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) }