## 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>
416 lines
14 KiB
Go
416 lines
14 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 CreateNetworkPayload type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &CreateNetworkPayload{}
|
|
|
|
/*
|
|
types and functions for dhcp
|
|
*/
|
|
|
|
// isBoolean
|
|
type CreateNetworkPayloadgetDhcpAttributeType = *bool
|
|
type CreateNetworkPayloadgetDhcpArgType = bool
|
|
type CreateNetworkPayloadgetDhcpRetType = bool
|
|
|
|
func getCreateNetworkPayloadgetDhcpAttributeTypeOk(arg CreateNetworkPayloadgetDhcpAttributeType) (ret CreateNetworkPayloadgetDhcpRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setCreateNetworkPayloadgetDhcpAttributeType(arg *CreateNetworkPayloadgetDhcpAttributeType, val CreateNetworkPayloadgetDhcpRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for ipv4
|
|
*/
|
|
|
|
// isModel
|
|
type CreateNetworkPayloadGetIpv4AttributeType = *CreateNetworkIPv4
|
|
type CreateNetworkPayloadGetIpv4ArgType = CreateNetworkIPv4
|
|
type CreateNetworkPayloadGetIpv4RetType = CreateNetworkIPv4
|
|
|
|
func getCreateNetworkPayloadGetIpv4AttributeTypeOk(arg CreateNetworkPayloadGetIpv4AttributeType) (ret CreateNetworkPayloadGetIpv4RetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setCreateNetworkPayloadGetIpv4AttributeType(arg *CreateNetworkPayloadGetIpv4AttributeType, val CreateNetworkPayloadGetIpv4RetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for ipv6
|
|
*/
|
|
|
|
// isModel
|
|
type CreateNetworkPayloadGetIpv6AttributeType = *CreateNetworkIPv6
|
|
type CreateNetworkPayloadGetIpv6ArgType = CreateNetworkIPv6
|
|
type CreateNetworkPayloadGetIpv6RetType = CreateNetworkIPv6
|
|
|
|
func getCreateNetworkPayloadGetIpv6AttributeTypeOk(arg CreateNetworkPayloadGetIpv6AttributeType) (ret CreateNetworkPayloadGetIpv6RetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setCreateNetworkPayloadGetIpv6AttributeType(arg *CreateNetworkPayloadGetIpv6AttributeType, val CreateNetworkPayloadGetIpv6RetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for labels
|
|
*/
|
|
|
|
// isFreeform
|
|
type CreateNetworkPayloadGetLabelsAttributeType = *map[string]interface{}
|
|
type CreateNetworkPayloadGetLabelsArgType = map[string]interface{}
|
|
type CreateNetworkPayloadGetLabelsRetType = map[string]interface{}
|
|
|
|
func getCreateNetworkPayloadGetLabelsAttributeTypeOk(arg CreateNetworkPayloadGetLabelsAttributeType) (ret CreateNetworkPayloadGetLabelsRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setCreateNetworkPayloadGetLabelsAttributeType(arg *CreateNetworkPayloadGetLabelsAttributeType, val CreateNetworkPayloadGetLabelsRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for name
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type CreateNetworkPayloadGetNameAttributeType = *string
|
|
|
|
func getCreateNetworkPayloadGetNameAttributeTypeOk(arg CreateNetworkPayloadGetNameAttributeType) (ret CreateNetworkPayloadGetNameRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setCreateNetworkPayloadGetNameAttributeType(arg *CreateNetworkPayloadGetNameAttributeType, val CreateNetworkPayloadGetNameRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type CreateNetworkPayloadGetNameArgType = string
|
|
type CreateNetworkPayloadGetNameRetType = string
|
|
|
|
/*
|
|
types and functions for routed
|
|
*/
|
|
|
|
// isBoolean
|
|
type CreateNetworkPayloadgetRoutedAttributeType = *bool
|
|
type CreateNetworkPayloadgetRoutedArgType = bool
|
|
type CreateNetworkPayloadgetRoutedRetType = bool
|
|
|
|
func getCreateNetworkPayloadgetRoutedAttributeTypeOk(arg CreateNetworkPayloadgetRoutedAttributeType) (ret CreateNetworkPayloadgetRoutedRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setCreateNetworkPayloadgetRoutedAttributeType(arg *CreateNetworkPayloadgetRoutedAttributeType, val CreateNetworkPayloadgetRoutedRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for routingTableId
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type CreateNetworkPayloadGetRoutingTableIdAttributeType = *string
|
|
|
|
func getCreateNetworkPayloadGetRoutingTableIdAttributeTypeOk(arg CreateNetworkPayloadGetRoutingTableIdAttributeType) (ret CreateNetworkPayloadGetRoutingTableIdRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setCreateNetworkPayloadGetRoutingTableIdAttributeType(arg *CreateNetworkPayloadGetRoutingTableIdAttributeType, val CreateNetworkPayloadGetRoutingTableIdRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type CreateNetworkPayloadGetRoutingTableIdArgType = string
|
|
type CreateNetworkPayloadGetRoutingTableIdRetType = string
|
|
|
|
// CreateNetworkPayload Object that represents the request body for a network create.
|
|
type CreateNetworkPayload struct {
|
|
// Enable or disable DHCP for a network.
|
|
Dhcp CreateNetworkPayloadgetDhcpAttributeType `json:"dhcp,omitempty"`
|
|
Ipv4 CreateNetworkPayloadGetIpv4AttributeType `json:"ipv4,omitempty"`
|
|
Ipv6 CreateNetworkPayloadGetIpv6AttributeType `json:"ipv6,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 CreateNetworkPayloadGetLabelsAttributeType `json:"labels,omitempty"`
|
|
// The name for a General Object. Matches Names and also UUIDs.
|
|
// REQUIRED
|
|
Name CreateNetworkPayloadGetNameAttributeType `json:"name" required:"true"`
|
|
// Shows if the network is routed and therefore accessible from other networks.
|
|
Routed CreateNetworkPayloadgetRoutedAttributeType `json:"routed,omitempty"`
|
|
// Universally Unique Identifier (UUID).
|
|
RoutingTableId CreateNetworkPayloadGetRoutingTableIdAttributeType `json:"routingTableId,omitempty"`
|
|
}
|
|
|
|
type _CreateNetworkPayload CreateNetworkPayload
|
|
|
|
// NewCreateNetworkPayload instantiates a new CreateNetworkPayload 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 NewCreateNetworkPayload(name CreateNetworkPayloadGetNameArgType) *CreateNetworkPayload {
|
|
this := CreateNetworkPayload{}
|
|
setCreateNetworkPayloadGetNameAttributeType(&this.Name, name)
|
|
return &this
|
|
}
|
|
|
|
// NewCreateNetworkPayloadWithDefaults instantiates a new CreateNetworkPayload 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 NewCreateNetworkPayloadWithDefaults() *CreateNetworkPayload {
|
|
this := CreateNetworkPayload{}
|
|
var dhcp bool = true
|
|
this.Dhcp = &dhcp
|
|
return &this
|
|
}
|
|
|
|
// GetDhcp returns the Dhcp field value if set, zero value otherwise.
|
|
func (o *CreateNetworkPayload) GetDhcp() (res CreateNetworkPayloadgetDhcpRetType) {
|
|
res, _ = o.GetDhcpOk()
|
|
return
|
|
}
|
|
|
|
// GetDhcpOk returns a tuple with the Dhcp field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CreateNetworkPayload) GetDhcpOk() (ret CreateNetworkPayloadgetDhcpRetType, ok bool) {
|
|
return getCreateNetworkPayloadgetDhcpAttributeTypeOk(o.Dhcp)
|
|
}
|
|
|
|
// HasDhcp returns a boolean if a field has been set.
|
|
func (o *CreateNetworkPayload) HasDhcp() bool {
|
|
_, ok := o.GetDhcpOk()
|
|
return ok
|
|
}
|
|
|
|
// SetDhcp gets a reference to the given bool and assigns it to the Dhcp field.
|
|
func (o *CreateNetworkPayload) SetDhcp(v CreateNetworkPayloadgetDhcpRetType) {
|
|
setCreateNetworkPayloadgetDhcpAttributeType(&o.Dhcp, v)
|
|
}
|
|
|
|
// GetIpv4 returns the Ipv4 field value if set, zero value otherwise.
|
|
func (o *CreateNetworkPayload) GetIpv4() (res CreateNetworkPayloadGetIpv4RetType) {
|
|
res, _ = o.GetIpv4Ok()
|
|
return
|
|
}
|
|
|
|
// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CreateNetworkPayload) GetIpv4Ok() (ret CreateNetworkPayloadGetIpv4RetType, ok bool) {
|
|
return getCreateNetworkPayloadGetIpv4AttributeTypeOk(o.Ipv4)
|
|
}
|
|
|
|
// HasIpv4 returns a boolean if a field has been set.
|
|
func (o *CreateNetworkPayload) HasIpv4() bool {
|
|
_, ok := o.GetIpv4Ok()
|
|
return ok
|
|
}
|
|
|
|
// SetIpv4 gets a reference to the given CreateNetworkIPv4 and assigns it to the Ipv4 field.
|
|
func (o *CreateNetworkPayload) SetIpv4(v CreateNetworkPayloadGetIpv4RetType) {
|
|
setCreateNetworkPayloadGetIpv4AttributeType(&o.Ipv4, v)
|
|
}
|
|
|
|
// GetIpv6 returns the Ipv6 field value if set, zero value otherwise.
|
|
func (o *CreateNetworkPayload) GetIpv6() (res CreateNetworkPayloadGetIpv6RetType) {
|
|
res, _ = o.GetIpv6Ok()
|
|
return
|
|
}
|
|
|
|
// GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CreateNetworkPayload) GetIpv6Ok() (ret CreateNetworkPayloadGetIpv6RetType, ok bool) {
|
|
return getCreateNetworkPayloadGetIpv6AttributeTypeOk(o.Ipv6)
|
|
}
|
|
|
|
// HasIpv6 returns a boolean if a field has been set.
|
|
func (o *CreateNetworkPayload) HasIpv6() bool {
|
|
_, ok := o.GetIpv6Ok()
|
|
return ok
|
|
}
|
|
|
|
// SetIpv6 gets a reference to the given CreateNetworkIPv6 and assigns it to the Ipv6 field.
|
|
func (o *CreateNetworkPayload) SetIpv6(v CreateNetworkPayloadGetIpv6RetType) {
|
|
setCreateNetworkPayloadGetIpv6AttributeType(&o.Ipv6, v)
|
|
}
|
|
|
|
// GetLabels returns the Labels field value if set, zero value otherwise.
|
|
func (o *CreateNetworkPayload) GetLabels() (res CreateNetworkPayloadGetLabelsRetType) {
|
|
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 *CreateNetworkPayload) GetLabelsOk() (ret CreateNetworkPayloadGetLabelsRetType, ok bool) {
|
|
return getCreateNetworkPayloadGetLabelsAttributeTypeOk(o.Labels)
|
|
}
|
|
|
|
// HasLabels returns a boolean if a field has been set.
|
|
func (o *CreateNetworkPayload) 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 *CreateNetworkPayload) SetLabels(v CreateNetworkPayloadGetLabelsRetType) {
|
|
setCreateNetworkPayloadGetLabelsAttributeType(&o.Labels, v)
|
|
}
|
|
|
|
// GetName returns the Name field value
|
|
func (o *CreateNetworkPayload) GetName() (ret CreateNetworkPayloadGetNameRetType) {
|
|
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 *CreateNetworkPayload) GetNameOk() (ret CreateNetworkPayloadGetNameRetType, ok bool) {
|
|
return getCreateNetworkPayloadGetNameAttributeTypeOk(o.Name)
|
|
}
|
|
|
|
// SetName sets field value
|
|
func (o *CreateNetworkPayload) SetName(v CreateNetworkPayloadGetNameRetType) {
|
|
setCreateNetworkPayloadGetNameAttributeType(&o.Name, v)
|
|
}
|
|
|
|
// GetRouted returns the Routed field value if set, zero value otherwise.
|
|
func (o *CreateNetworkPayload) GetRouted() (res CreateNetworkPayloadgetRoutedRetType) {
|
|
res, _ = o.GetRoutedOk()
|
|
return
|
|
}
|
|
|
|
// GetRoutedOk returns a tuple with the Routed field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CreateNetworkPayload) GetRoutedOk() (ret CreateNetworkPayloadgetRoutedRetType, ok bool) {
|
|
return getCreateNetworkPayloadgetRoutedAttributeTypeOk(o.Routed)
|
|
}
|
|
|
|
// HasRouted returns a boolean if a field has been set.
|
|
func (o *CreateNetworkPayload) HasRouted() bool {
|
|
_, ok := o.GetRoutedOk()
|
|
return ok
|
|
}
|
|
|
|
// SetRouted gets a reference to the given bool and assigns it to the Routed field.
|
|
func (o *CreateNetworkPayload) SetRouted(v CreateNetworkPayloadgetRoutedRetType) {
|
|
setCreateNetworkPayloadgetRoutedAttributeType(&o.Routed, v)
|
|
}
|
|
|
|
// GetRoutingTableId returns the RoutingTableId field value if set, zero value otherwise.
|
|
func (o *CreateNetworkPayload) GetRoutingTableId() (res CreateNetworkPayloadGetRoutingTableIdRetType) {
|
|
res, _ = o.GetRoutingTableIdOk()
|
|
return
|
|
}
|
|
|
|
// GetRoutingTableIdOk returns a tuple with the RoutingTableId field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *CreateNetworkPayload) GetRoutingTableIdOk() (ret CreateNetworkPayloadGetRoutingTableIdRetType, ok bool) {
|
|
return getCreateNetworkPayloadGetRoutingTableIdAttributeTypeOk(o.RoutingTableId)
|
|
}
|
|
|
|
// HasRoutingTableId returns a boolean if a field has been set.
|
|
func (o *CreateNetworkPayload) HasRoutingTableId() bool {
|
|
_, ok := o.GetRoutingTableIdOk()
|
|
return ok
|
|
}
|
|
|
|
// SetRoutingTableId gets a reference to the given string and assigns it to the RoutingTableId field.
|
|
func (o *CreateNetworkPayload) SetRoutingTableId(v CreateNetworkPayloadGetRoutingTableIdRetType) {
|
|
setCreateNetworkPayloadGetRoutingTableIdAttributeType(&o.RoutingTableId, v)
|
|
}
|
|
|
|
func (o CreateNetworkPayload) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if val, ok := getCreateNetworkPayloadgetDhcpAttributeTypeOk(o.Dhcp); ok {
|
|
toSerialize["Dhcp"] = val
|
|
}
|
|
if val, ok := getCreateNetworkPayloadGetIpv4AttributeTypeOk(o.Ipv4); ok {
|
|
toSerialize["Ipv4"] = val
|
|
}
|
|
if val, ok := getCreateNetworkPayloadGetIpv6AttributeTypeOk(o.Ipv6); ok {
|
|
toSerialize["Ipv6"] = val
|
|
}
|
|
if val, ok := getCreateNetworkPayloadGetLabelsAttributeTypeOk(o.Labels); ok {
|
|
toSerialize["Labels"] = val
|
|
}
|
|
if val, ok := getCreateNetworkPayloadGetNameAttributeTypeOk(o.Name); ok {
|
|
toSerialize["Name"] = val
|
|
}
|
|
if val, ok := getCreateNetworkPayloadgetRoutedAttributeTypeOk(o.Routed); ok {
|
|
toSerialize["Routed"] = val
|
|
}
|
|
if val, ok := getCreateNetworkPayloadGetRoutingTableIdAttributeTypeOk(o.RoutingTableId); ok {
|
|
toSerialize["RoutingTableId"] = val
|
|
}
|
|
return toSerialize, nil
|
|
}
|
|
|
|
type NullableCreateNetworkPayload struct {
|
|
value *CreateNetworkPayload
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableCreateNetworkPayload) Get() *CreateNetworkPayload {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableCreateNetworkPayload) Set(val *CreateNetworkPayload) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableCreateNetworkPayload) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableCreateNetworkPayload) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableCreateNetworkPayload(val *CreateNetworkPayload) *NullableCreateNetworkPayload {
|
|
return &NullableCreateNetworkPayload{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableCreateNetworkPayload) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableCreateNetworkPayload) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|