terraform-provider-stackitp.../pkg/iaasbeta/model_network_ipv6.go
2026-01-21 09:07:29 +01:00

237 lines
7.1 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 NetworkIPv6 type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &NetworkIPv6{}
/*
types and functions for gateway
*/
// isNullableString
type NetworkIPv6GetGatewayAttributeType = *NullableString
func getNetworkIPv6GetGatewayAttributeTypeOk(arg NetworkIPv6GetGatewayAttributeType) (ret NetworkIPv6GetGatewayRetType, ok bool) {
if arg == nil {
return nil, false
}
return arg.Get(), true
}
func setNetworkIPv6GetGatewayAttributeType(arg *NetworkIPv6GetGatewayAttributeType, val NetworkIPv6GetGatewayRetType) {
if IsNil(*arg) {
*arg = NewNullableString(val)
} else {
(*arg).Set(val)
}
}
type NetworkIPv6GetGatewayArgType = *string
type NetworkIPv6GetGatewayRetType = *string
/*
types and functions for nameservers
*/
// isArray
type NetworkIPv6GetNameserversAttributeType = *[]string
type NetworkIPv6GetNameserversArgType = []string
type NetworkIPv6GetNameserversRetType = []string
func getNetworkIPv6GetNameserversAttributeTypeOk(arg NetworkIPv6GetNameserversAttributeType) (ret NetworkIPv6GetNameserversRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setNetworkIPv6GetNameserversAttributeType(arg *NetworkIPv6GetNameserversAttributeType, val NetworkIPv6GetNameserversRetType) {
*arg = &val
}
/*
types and functions for prefixes
*/
// isArray
type NetworkIPv6GetPrefixesAttributeType = *[]string
type NetworkIPv6GetPrefixesArgType = []string
type NetworkIPv6GetPrefixesRetType = []string
func getNetworkIPv6GetPrefixesAttributeTypeOk(arg NetworkIPv6GetPrefixesAttributeType) (ret NetworkIPv6GetPrefixesRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setNetworkIPv6GetPrefixesAttributeType(arg *NetworkIPv6GetPrefixesAttributeType, val NetworkIPv6GetPrefixesRetType) {
*arg = &val
}
// NetworkIPv6 Object that represents the IPv6 part of a network.
type NetworkIPv6 struct {
// The IPv6 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway.
Gateway NetworkIPv6GetGatewayAttributeType `json:"gateway,omitempty"`
// A list containing DNS Servers/Nameservers for IPv6.
Nameservers NetworkIPv6GetNameserversAttributeType `json:"nameservers,omitempty"`
// REQUIRED
Prefixes NetworkIPv6GetPrefixesAttributeType `json:"prefixes" required:"true"`
}
type _NetworkIPv6 NetworkIPv6
// NewNetworkIPv6 instantiates a new NetworkIPv6 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 NewNetworkIPv6(prefixes NetworkIPv6GetPrefixesArgType) *NetworkIPv6 {
this := NetworkIPv6{}
setNetworkIPv6GetPrefixesAttributeType(&this.Prefixes, prefixes)
return &this
}
// NewNetworkIPv6WithDefaults instantiates a new NetworkIPv6 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 NewNetworkIPv6WithDefaults() *NetworkIPv6 {
this := NetworkIPv6{}
return &this
}
// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *NetworkIPv6) GetGateway() (res NetworkIPv6GetGatewayRetType) {
res, _ = o.GetGatewayOk()
return
}
// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *NetworkIPv6) GetGatewayOk() (ret NetworkIPv6GetGatewayRetType, ok bool) {
return getNetworkIPv6GetGatewayAttributeTypeOk(o.Gateway)
}
// HasGateway returns a boolean if a field has been set.
func (o *NetworkIPv6) HasGateway() bool {
_, ok := o.GetGatewayOk()
return ok
}
// SetGateway gets a reference to the given string and assigns it to the Gateway field.
func (o *NetworkIPv6) SetGateway(v NetworkIPv6GetGatewayRetType) {
setNetworkIPv6GetGatewayAttributeType(&o.Gateway, v)
}
// SetGatewayNil sets the value for Gateway to be an explicit nil
func (o *NetworkIPv6) SetGatewayNil() {
o.Gateway = nil
}
// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil
func (o *NetworkIPv6) UnsetGateway() {
o.Gateway = nil
}
// GetNameservers returns the Nameservers field value if set, zero value otherwise.
func (o *NetworkIPv6) GetNameservers() (res NetworkIPv6GetNameserversRetType) {
res, _ = o.GetNameserversOk()
return
}
// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NetworkIPv6) GetNameserversOk() (ret NetworkIPv6GetNameserversRetType, ok bool) {
return getNetworkIPv6GetNameserversAttributeTypeOk(o.Nameservers)
}
// HasNameservers returns a boolean if a field has been set.
func (o *NetworkIPv6) HasNameservers() bool {
_, ok := o.GetNameserversOk()
return ok
}
// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field.
func (o *NetworkIPv6) SetNameservers(v NetworkIPv6GetNameserversRetType) {
setNetworkIPv6GetNameserversAttributeType(&o.Nameservers, v)
}
// GetPrefixes returns the Prefixes field value
func (o *NetworkIPv6) GetPrefixes() (ret NetworkIPv6GetPrefixesRetType) {
ret, _ = o.GetPrefixesOk()
return ret
}
// GetPrefixesOk returns a tuple with the Prefixes field value
// and a boolean to check if the value has been set.
func (o *NetworkIPv6) GetPrefixesOk() (ret NetworkIPv6GetPrefixesRetType, ok bool) {
return getNetworkIPv6GetPrefixesAttributeTypeOk(o.Prefixes)
}
// SetPrefixes sets field value
func (o *NetworkIPv6) SetPrefixes(v NetworkIPv6GetPrefixesRetType) {
setNetworkIPv6GetPrefixesAttributeType(&o.Prefixes, v)
}
func (o NetworkIPv6) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getNetworkIPv6GetGatewayAttributeTypeOk(o.Gateway); ok {
toSerialize["Gateway"] = val
}
if val, ok := getNetworkIPv6GetNameserversAttributeTypeOk(o.Nameservers); ok {
toSerialize["Nameservers"] = val
}
if val, ok := getNetworkIPv6GetPrefixesAttributeTypeOk(o.Prefixes); ok {
toSerialize["Prefixes"] = val
}
return toSerialize, nil
}
type NullableNetworkIPv6 struct {
value *NetworkIPv6
isSet bool
}
func (v NullableNetworkIPv6) Get() *NetworkIPv6 {
return v.value
}
func (v *NullableNetworkIPv6) Set(val *NetworkIPv6) {
v.value = val
v.isSet = true
}
func (v NullableNetworkIPv6) IsSet() bool {
return v.isSet
}
func (v *NullableNetworkIPv6) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableNetworkIPv6(val *NetworkIPv6) *NullableNetworkIPv6 {
return &NullableNetworkIPv6{value: val, isSet: true}
}
func (v NullableNetworkIPv6) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableNetworkIPv6) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}