terraform-provider-stackitp.../pkg/iaasbeta/model_create_affinity_group_payload.go
Marcel S. Henselin 9f41c4da7f
Some checks failed
Publish / Check GoReleaser config (push) Successful in 4s
Release / goreleaser (push) Failing after 29s
Publish / Publish provider (push) Failing after 4m24s
feat: auto generated files and new structure (#4)
## Description

<!-- **Please link some issue here describing what you are trying to achieve.**

In case there is no issue present for your PR, please consider creating one.
At least please give us some description what you are trying to achieve and why your change is needed. -->

relates to #1234

## Checklist

- [ ] Issue was linked above
- [ ] Code format was applied: `make fmt`
- [ ] Examples were added / adjusted (see `examples/` directory)
- [x] Docs are up-to-date: `make generate-docs` (will be checked by CI)
- [ ] Unit tests got implemented or updated
- [ ] Acceptance tests got implemented or updated (see e.g. [here](f5f99d1709/stackit/internal/services/dns/dns_acc_test.go))
- [x] Unit tests are passing: `make test` (will be checked by CI)
- [x] No linter issues: `make lint` (will be checked by CI)

Reviewed-on: #4
Reviewed-by: Andre_Harms <andre.harms@stackit.cloud>
Co-authored-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
Co-committed-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
2026-01-29 14:10:25 +00:00

269 lines
9.6 KiB
Go

/*
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 CreateAffinityGroupPayload type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CreateAffinityGroupPayload{}
/*
types and functions for id
*/
// isNotNullableString
type CreateAffinityGroupPayloadGetIdAttributeType = *string
func getCreateAffinityGroupPayloadGetIdAttributeTypeOk(arg CreateAffinityGroupPayloadGetIdAttributeType) (ret CreateAffinityGroupPayloadGetIdRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setCreateAffinityGroupPayloadGetIdAttributeType(arg *CreateAffinityGroupPayloadGetIdAttributeType, val CreateAffinityGroupPayloadGetIdRetType) {
*arg = &val
}
type CreateAffinityGroupPayloadGetIdArgType = string
type CreateAffinityGroupPayloadGetIdRetType = string
/*
types and functions for members
*/
// isArray
type CreateAffinityGroupPayloadGetMembersAttributeType = *[]string
type CreateAffinityGroupPayloadGetMembersArgType = []string
type CreateAffinityGroupPayloadGetMembersRetType = []string
func getCreateAffinityGroupPayloadGetMembersAttributeTypeOk(arg CreateAffinityGroupPayloadGetMembersAttributeType) (ret CreateAffinityGroupPayloadGetMembersRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setCreateAffinityGroupPayloadGetMembersAttributeType(arg *CreateAffinityGroupPayloadGetMembersAttributeType, val CreateAffinityGroupPayloadGetMembersRetType) {
*arg = &val
}
/*
types and functions for name
*/
// isNotNullableString
type CreateAffinityGroupPayloadGetNameAttributeType = *string
func getCreateAffinityGroupPayloadGetNameAttributeTypeOk(arg CreateAffinityGroupPayloadGetNameAttributeType) (ret CreateAffinityGroupPayloadGetNameRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setCreateAffinityGroupPayloadGetNameAttributeType(arg *CreateAffinityGroupPayloadGetNameAttributeType, val CreateAffinityGroupPayloadGetNameRetType) {
*arg = &val
}
type CreateAffinityGroupPayloadGetNameArgType = string
type CreateAffinityGroupPayloadGetNameRetType = string
/*
types and functions for policy
*/
// isNotNullableString
type CreateAffinityGroupPayloadGetPolicyAttributeType = *string
func getCreateAffinityGroupPayloadGetPolicyAttributeTypeOk(arg CreateAffinityGroupPayloadGetPolicyAttributeType) (ret CreateAffinityGroupPayloadGetPolicyRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setCreateAffinityGroupPayloadGetPolicyAttributeType(arg *CreateAffinityGroupPayloadGetPolicyAttributeType, val CreateAffinityGroupPayloadGetPolicyRetType) {
*arg = &val
}
type CreateAffinityGroupPayloadGetPolicyArgType = string
type CreateAffinityGroupPayloadGetPolicyRetType = string
// CreateAffinityGroupPayload Definition of an affinity group.
type CreateAffinityGroupPayload struct {
// Universally Unique Identifier (UUID).
Id CreateAffinityGroupPayloadGetIdAttributeType `json:"id,omitempty"`
// The servers that are part of the affinity group.
Members CreateAffinityGroupPayloadGetMembersAttributeType `json:"members,omitempty"`
// The name for a General Object. Matches Names and also UUIDs.
// REQUIRED
Name CreateAffinityGroupPayloadGetNameAttributeType `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 CreateAffinityGroupPayloadGetPolicyAttributeType `json:"policy" required:"true"`
}
type _CreateAffinityGroupPayload CreateAffinityGroupPayload
// NewCreateAffinityGroupPayload instantiates a new CreateAffinityGroupPayload 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 NewCreateAffinityGroupPayload(name CreateAffinityGroupPayloadGetNameArgType, policy CreateAffinityGroupPayloadGetPolicyArgType) *CreateAffinityGroupPayload {
this := CreateAffinityGroupPayload{}
setCreateAffinityGroupPayloadGetNameAttributeType(&this.Name, name)
setCreateAffinityGroupPayloadGetPolicyAttributeType(&this.Policy, policy)
return &this
}
// NewCreateAffinityGroupPayloadWithDefaults instantiates a new CreateAffinityGroupPayload 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 NewCreateAffinityGroupPayloadWithDefaults() *CreateAffinityGroupPayload {
this := CreateAffinityGroupPayload{}
return &this
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *CreateAffinityGroupPayload) GetId() (res CreateAffinityGroupPayloadGetIdRetType) {
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 *CreateAffinityGroupPayload) GetIdOk() (ret CreateAffinityGroupPayloadGetIdRetType, ok bool) {
return getCreateAffinityGroupPayloadGetIdAttributeTypeOk(o.Id)
}
// HasId returns a boolean if a field has been set.
func (o *CreateAffinityGroupPayload) HasId() bool {
_, ok := o.GetIdOk()
return ok
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *CreateAffinityGroupPayload) SetId(v CreateAffinityGroupPayloadGetIdRetType) {
setCreateAffinityGroupPayloadGetIdAttributeType(&o.Id, v)
}
// GetMembers returns the Members field value if set, zero value otherwise.
func (o *CreateAffinityGroupPayload) GetMembers() (res CreateAffinityGroupPayloadGetMembersRetType) {
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 *CreateAffinityGroupPayload) GetMembersOk() (ret CreateAffinityGroupPayloadGetMembersRetType, ok bool) {
return getCreateAffinityGroupPayloadGetMembersAttributeTypeOk(o.Members)
}
// HasMembers returns a boolean if a field has been set.
func (o *CreateAffinityGroupPayload) HasMembers() bool {
_, ok := o.GetMembersOk()
return ok
}
// SetMembers gets a reference to the given []string and assigns it to the Members field.
func (o *CreateAffinityGroupPayload) SetMembers(v CreateAffinityGroupPayloadGetMembersRetType) {
setCreateAffinityGroupPayloadGetMembersAttributeType(&o.Members, v)
}
// GetName returns the Name field value
func (o *CreateAffinityGroupPayload) GetName() (ret CreateAffinityGroupPayloadGetNameRetType) {
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 *CreateAffinityGroupPayload) GetNameOk() (ret CreateAffinityGroupPayloadGetNameRetType, ok bool) {
return getCreateAffinityGroupPayloadGetNameAttributeTypeOk(o.Name)
}
// SetName sets field value
func (o *CreateAffinityGroupPayload) SetName(v CreateAffinityGroupPayloadGetNameRetType) {
setCreateAffinityGroupPayloadGetNameAttributeType(&o.Name, v)
}
// GetPolicy returns the Policy field value
func (o *CreateAffinityGroupPayload) GetPolicy() (ret CreateAffinityGroupPayloadGetPolicyRetType) {
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 *CreateAffinityGroupPayload) GetPolicyOk() (ret CreateAffinityGroupPayloadGetPolicyRetType, ok bool) {
return getCreateAffinityGroupPayloadGetPolicyAttributeTypeOk(o.Policy)
}
// SetPolicy sets field value
func (o *CreateAffinityGroupPayload) SetPolicy(v CreateAffinityGroupPayloadGetPolicyRetType) {
setCreateAffinityGroupPayloadGetPolicyAttributeType(&o.Policy, v)
}
func (o CreateAffinityGroupPayload) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getCreateAffinityGroupPayloadGetIdAttributeTypeOk(o.Id); ok {
toSerialize["Id"] = val
}
if val, ok := getCreateAffinityGroupPayloadGetMembersAttributeTypeOk(o.Members); ok {
toSerialize["Members"] = val
}
if val, ok := getCreateAffinityGroupPayloadGetNameAttributeTypeOk(o.Name); ok {
toSerialize["Name"] = val
}
if val, ok := getCreateAffinityGroupPayloadGetPolicyAttributeTypeOk(o.Policy); ok {
toSerialize["Policy"] = val
}
return toSerialize, nil
}
type NullableCreateAffinityGroupPayload struct {
value *CreateAffinityGroupPayload
isSet bool
}
func (v NullableCreateAffinityGroupPayload) Get() *CreateAffinityGroupPayload {
return v.value
}
func (v *NullableCreateAffinityGroupPayload) Set(val *CreateAffinityGroupPayload) {
v.value = val
v.isSet = true
}
func (v NullableCreateAffinityGroupPayload) IsSet() bool {
return v.isSet
}
func (v *NullableCreateAffinityGroupPayload) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCreateAffinityGroupPayload(val *CreateAffinityGroupPayload) *NullableCreateAffinityGroupPayload {
return &NullableCreateAffinityGroupPayload{value: val, isSet: true}
}
func (v NullableCreateAffinityGroupPayload) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCreateAffinityGroupPayload) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}