## 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>
368 lines
11 KiB
Go
368 lines
11 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"
|
|
"time"
|
|
)
|
|
|
|
// checks if the NetworkArea type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &NetworkArea{}
|
|
|
|
/*
|
|
types and functions for createdAt
|
|
*/
|
|
|
|
// isDateTime
|
|
type NetworkAreaGetCreatedAtAttributeType = *time.Time
|
|
type NetworkAreaGetCreatedAtArgType = time.Time
|
|
type NetworkAreaGetCreatedAtRetType = time.Time
|
|
|
|
func getNetworkAreaGetCreatedAtAttributeTypeOk(arg NetworkAreaGetCreatedAtAttributeType) (ret NetworkAreaGetCreatedAtRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setNetworkAreaGetCreatedAtAttributeType(arg *NetworkAreaGetCreatedAtAttributeType, val NetworkAreaGetCreatedAtRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for id
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type NetworkAreaGetIdAttributeType = *string
|
|
|
|
func getNetworkAreaGetIdAttributeTypeOk(arg NetworkAreaGetIdAttributeType) (ret NetworkAreaGetIdRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setNetworkAreaGetIdAttributeType(arg *NetworkAreaGetIdAttributeType, val NetworkAreaGetIdRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type NetworkAreaGetIdArgType = string
|
|
type NetworkAreaGetIdRetType = string
|
|
|
|
/*
|
|
types and functions for labels
|
|
*/
|
|
|
|
// isFreeform
|
|
type NetworkAreaGetLabelsAttributeType = *map[string]interface{}
|
|
type NetworkAreaGetLabelsArgType = map[string]interface{}
|
|
type NetworkAreaGetLabelsRetType = map[string]interface{}
|
|
|
|
func getNetworkAreaGetLabelsAttributeTypeOk(arg NetworkAreaGetLabelsAttributeType) (ret NetworkAreaGetLabelsRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setNetworkAreaGetLabelsAttributeType(arg *NetworkAreaGetLabelsAttributeType, val NetworkAreaGetLabelsRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for name
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type NetworkAreaGetNameAttributeType = *string
|
|
|
|
func getNetworkAreaGetNameAttributeTypeOk(arg NetworkAreaGetNameAttributeType) (ret NetworkAreaGetNameRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setNetworkAreaGetNameAttributeType(arg *NetworkAreaGetNameAttributeType, val NetworkAreaGetNameRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type NetworkAreaGetNameArgType = string
|
|
type NetworkAreaGetNameRetType = string
|
|
|
|
/*
|
|
types and functions for projectCount
|
|
*/
|
|
|
|
// isLong
|
|
type NetworkAreaGetProjectCountAttributeType = *int64
|
|
type NetworkAreaGetProjectCountArgType = int64
|
|
type NetworkAreaGetProjectCountRetType = int64
|
|
|
|
func getNetworkAreaGetProjectCountAttributeTypeOk(arg NetworkAreaGetProjectCountAttributeType) (ret NetworkAreaGetProjectCountRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setNetworkAreaGetProjectCountAttributeType(arg *NetworkAreaGetProjectCountAttributeType, val NetworkAreaGetProjectCountRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for updatedAt
|
|
*/
|
|
|
|
// isDateTime
|
|
type NetworkAreaGetUpdatedAtAttributeType = *time.Time
|
|
type NetworkAreaGetUpdatedAtArgType = time.Time
|
|
type NetworkAreaGetUpdatedAtRetType = time.Time
|
|
|
|
func getNetworkAreaGetUpdatedAtAttributeTypeOk(arg NetworkAreaGetUpdatedAtAttributeType) (ret NetworkAreaGetUpdatedAtRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setNetworkAreaGetUpdatedAtAttributeType(arg *NetworkAreaGetUpdatedAtAttributeType, val NetworkAreaGetUpdatedAtRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
// NetworkArea Object that represents a network area.
|
|
type NetworkArea struct {
|
|
// Date-time when resource was created.
|
|
CreatedAt NetworkAreaGetCreatedAtAttributeType `json:"createdAt,omitempty"`
|
|
// Universally Unique Identifier (UUID).
|
|
Id NetworkAreaGetIdAttributeType `json:"id,omitempty"`
|
|
// Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key.
|
|
Labels NetworkAreaGetLabelsAttributeType `json:"labels,omitempty"`
|
|
// REQUIRED
|
|
Name NetworkAreaGetNameAttributeType `json:"name" required:"true"`
|
|
// The amount of projects currently referencing a specific area.
|
|
ProjectCount NetworkAreaGetProjectCountAttributeType `json:"projectCount,omitempty"`
|
|
// Date-time when resource was last updated.
|
|
UpdatedAt NetworkAreaGetUpdatedAtAttributeType `json:"updatedAt,omitempty"`
|
|
}
|
|
|
|
type _NetworkArea NetworkArea
|
|
|
|
// NewNetworkArea instantiates a new NetworkArea 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 NewNetworkArea(name NetworkAreaGetNameArgType) *NetworkArea {
|
|
this := NetworkArea{}
|
|
setNetworkAreaGetNameAttributeType(&this.Name, name)
|
|
return &this
|
|
}
|
|
|
|
// NewNetworkAreaWithDefaults instantiates a new NetworkArea 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 NewNetworkAreaWithDefaults() *NetworkArea {
|
|
this := NetworkArea{}
|
|
return &this
|
|
}
|
|
|
|
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
|
|
func (o *NetworkArea) GetCreatedAt() (res NetworkAreaGetCreatedAtRetType) {
|
|
res, _ = o.GetCreatedAtOk()
|
|
return
|
|
}
|
|
|
|
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *NetworkArea) GetCreatedAtOk() (ret NetworkAreaGetCreatedAtRetType, ok bool) {
|
|
return getNetworkAreaGetCreatedAtAttributeTypeOk(o.CreatedAt)
|
|
}
|
|
|
|
// HasCreatedAt returns a boolean if a field has been set.
|
|
func (o *NetworkArea) HasCreatedAt() bool {
|
|
_, ok := o.GetCreatedAtOk()
|
|
return ok
|
|
}
|
|
|
|
// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field.
|
|
func (o *NetworkArea) SetCreatedAt(v NetworkAreaGetCreatedAtRetType) {
|
|
setNetworkAreaGetCreatedAtAttributeType(&o.CreatedAt, v)
|
|
}
|
|
|
|
// GetId returns the Id field value if set, zero value otherwise.
|
|
func (o *NetworkArea) GetId() (res NetworkAreaGetIdRetType) {
|
|
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 *NetworkArea) GetIdOk() (ret NetworkAreaGetIdRetType, ok bool) {
|
|
return getNetworkAreaGetIdAttributeTypeOk(o.Id)
|
|
}
|
|
|
|
// HasId returns a boolean if a field has been set.
|
|
func (o *NetworkArea) HasId() bool {
|
|
_, ok := o.GetIdOk()
|
|
return ok
|
|
}
|
|
|
|
// SetId gets a reference to the given string and assigns it to the Id field.
|
|
func (o *NetworkArea) SetId(v NetworkAreaGetIdRetType) {
|
|
setNetworkAreaGetIdAttributeType(&o.Id, v)
|
|
}
|
|
|
|
// GetLabels returns the Labels field value if set, zero value otherwise.
|
|
func (o *NetworkArea) GetLabels() (res NetworkAreaGetLabelsRetType) {
|
|
res, _ = o.GetLabelsOk()
|
|
return
|
|
}
|
|
|
|
// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *NetworkArea) GetLabelsOk() (ret NetworkAreaGetLabelsRetType, ok bool) {
|
|
return getNetworkAreaGetLabelsAttributeTypeOk(o.Labels)
|
|
}
|
|
|
|
// HasLabels returns a boolean if a field has been set.
|
|
func (o *NetworkArea) HasLabels() bool {
|
|
_, ok := o.GetLabelsOk()
|
|
return ok
|
|
}
|
|
|
|
// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field.
|
|
func (o *NetworkArea) SetLabels(v NetworkAreaGetLabelsRetType) {
|
|
setNetworkAreaGetLabelsAttributeType(&o.Labels, v)
|
|
}
|
|
|
|
// GetName returns the Name field value
|
|
func (o *NetworkArea) GetName() (ret NetworkAreaGetNameRetType) {
|
|
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 *NetworkArea) GetNameOk() (ret NetworkAreaGetNameRetType, ok bool) {
|
|
return getNetworkAreaGetNameAttributeTypeOk(o.Name)
|
|
}
|
|
|
|
// SetName sets field value
|
|
func (o *NetworkArea) SetName(v NetworkAreaGetNameRetType) {
|
|
setNetworkAreaGetNameAttributeType(&o.Name, v)
|
|
}
|
|
|
|
// GetProjectCount returns the ProjectCount field value if set, zero value otherwise.
|
|
func (o *NetworkArea) GetProjectCount() (res NetworkAreaGetProjectCountRetType) {
|
|
res, _ = o.GetProjectCountOk()
|
|
return
|
|
}
|
|
|
|
// GetProjectCountOk returns a tuple with the ProjectCount field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *NetworkArea) GetProjectCountOk() (ret NetworkAreaGetProjectCountRetType, ok bool) {
|
|
return getNetworkAreaGetProjectCountAttributeTypeOk(o.ProjectCount)
|
|
}
|
|
|
|
// HasProjectCount returns a boolean if a field has been set.
|
|
func (o *NetworkArea) HasProjectCount() bool {
|
|
_, ok := o.GetProjectCountOk()
|
|
return ok
|
|
}
|
|
|
|
// SetProjectCount gets a reference to the given int64 and assigns it to the ProjectCount field.
|
|
func (o *NetworkArea) SetProjectCount(v NetworkAreaGetProjectCountRetType) {
|
|
setNetworkAreaGetProjectCountAttributeType(&o.ProjectCount, v)
|
|
}
|
|
|
|
// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
|
|
func (o *NetworkArea) GetUpdatedAt() (res NetworkAreaGetUpdatedAtRetType) {
|
|
res, _ = o.GetUpdatedAtOk()
|
|
return
|
|
}
|
|
|
|
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *NetworkArea) GetUpdatedAtOk() (ret NetworkAreaGetUpdatedAtRetType, ok bool) {
|
|
return getNetworkAreaGetUpdatedAtAttributeTypeOk(o.UpdatedAt)
|
|
}
|
|
|
|
// HasUpdatedAt returns a boolean if a field has been set.
|
|
func (o *NetworkArea) HasUpdatedAt() bool {
|
|
_, ok := o.GetUpdatedAtOk()
|
|
return ok
|
|
}
|
|
|
|
// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field.
|
|
func (o *NetworkArea) SetUpdatedAt(v NetworkAreaGetUpdatedAtRetType) {
|
|
setNetworkAreaGetUpdatedAtAttributeType(&o.UpdatedAt, v)
|
|
}
|
|
|
|
func (o NetworkArea) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if val, ok := getNetworkAreaGetCreatedAtAttributeTypeOk(o.CreatedAt); ok {
|
|
toSerialize["CreatedAt"] = val
|
|
}
|
|
if val, ok := getNetworkAreaGetIdAttributeTypeOk(o.Id); ok {
|
|
toSerialize["Id"] = val
|
|
}
|
|
if val, ok := getNetworkAreaGetLabelsAttributeTypeOk(o.Labels); ok {
|
|
toSerialize["Labels"] = val
|
|
}
|
|
if val, ok := getNetworkAreaGetNameAttributeTypeOk(o.Name); ok {
|
|
toSerialize["Name"] = val
|
|
}
|
|
if val, ok := getNetworkAreaGetProjectCountAttributeTypeOk(o.ProjectCount); ok {
|
|
toSerialize["ProjectCount"] = val
|
|
}
|
|
if val, ok := getNetworkAreaGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok {
|
|
toSerialize["UpdatedAt"] = val
|
|
}
|
|
return toSerialize, nil
|
|
}
|
|
|
|
type NullableNetworkArea struct {
|
|
value *NetworkArea
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableNetworkArea) Get() *NetworkArea {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableNetworkArea) Set(val *NetworkArea) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableNetworkArea) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableNetworkArea) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableNetworkArea(val *NetworkArea) *NullableNetworkArea {
|
|
return &NullableNetworkArea{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableNetworkArea) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableNetworkArea) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|