/* 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 NetworkIPv4 type satisfies the MappedNullable interface at compile time var _ MappedNullable = &NetworkIPv4{} /* types and functions for gateway */ // isNullableString type NetworkIPv4GetGatewayAttributeType = *NullableString func getNetworkIPv4GetGatewayAttributeTypeOk(arg NetworkIPv4GetGatewayAttributeType) (ret NetworkIPv4GetGatewayRetType, ok bool) { if arg == nil { return nil, false } return arg.Get(), true } func setNetworkIPv4GetGatewayAttributeType(arg *NetworkIPv4GetGatewayAttributeType, val NetworkIPv4GetGatewayRetType) { if IsNil(*arg) { *arg = NewNullableString(val) } else { (*arg).Set(val) } } type NetworkIPv4GetGatewayArgType = *string type NetworkIPv4GetGatewayRetType = *string /* types and functions for nameservers */ // isArray type NetworkIPv4GetNameserversAttributeType = *[]string type NetworkIPv4GetNameserversArgType = []string type NetworkIPv4GetNameserversRetType = []string func getNetworkIPv4GetNameserversAttributeTypeOk(arg NetworkIPv4GetNameserversAttributeType) (ret NetworkIPv4GetNameserversRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setNetworkIPv4GetNameserversAttributeType(arg *NetworkIPv4GetNameserversAttributeType, val NetworkIPv4GetNameserversRetType) { *arg = &val } /* types and functions for prefixes */ // isArray type NetworkIPv4GetPrefixesAttributeType = *[]string type NetworkIPv4GetPrefixesArgType = []string type NetworkIPv4GetPrefixesRetType = []string func getNetworkIPv4GetPrefixesAttributeTypeOk(arg NetworkIPv4GetPrefixesAttributeType) (ret NetworkIPv4GetPrefixesRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setNetworkIPv4GetPrefixesAttributeType(arg *NetworkIPv4GetPrefixesAttributeType, val NetworkIPv4GetPrefixesRetType) { *arg = &val } /* types and functions for publicIp */ // isNotNullableString type NetworkIPv4GetPublicIpAttributeType = *string func getNetworkIPv4GetPublicIpAttributeTypeOk(arg NetworkIPv4GetPublicIpAttributeType) (ret NetworkIPv4GetPublicIpRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setNetworkIPv4GetPublicIpAttributeType(arg *NetworkIPv4GetPublicIpAttributeType, val NetworkIPv4GetPublicIpRetType) { *arg = &val } type NetworkIPv4GetPublicIpArgType = string type NetworkIPv4GetPublicIpRetType = string // NetworkIPv4 Object that represents the IPv4 part of a network. type NetworkIPv4 struct { // The IPv4 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 NetworkIPv4GetGatewayAttributeType `json:"gateway,omitempty"` // A list containing DNS Servers/Nameservers for IPv4. Nameservers NetworkIPv4GetNameserversAttributeType `json:"nameservers,omitempty"` // REQUIRED Prefixes NetworkIPv4GetPrefixesAttributeType `json:"prefixes" required:"true"` // String that represents an IPv4 address. PublicIp NetworkIPv4GetPublicIpAttributeType `json:"publicIp,omitempty"` } type _NetworkIPv4 NetworkIPv4 // NewNetworkIPv4 instantiates a new NetworkIPv4 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 NewNetworkIPv4(prefixes NetworkIPv4GetPrefixesArgType) *NetworkIPv4 { this := NetworkIPv4{} setNetworkIPv4GetPrefixesAttributeType(&this.Prefixes, prefixes) return &this } // NewNetworkIPv4WithDefaults instantiates a new NetworkIPv4 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 NewNetworkIPv4WithDefaults() *NetworkIPv4 { this := NetworkIPv4{} return &this } // GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). func (o *NetworkIPv4) GetGateway() (res NetworkIPv4GetGatewayRetType) { 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 *NetworkIPv4) GetGatewayOk() (ret NetworkIPv4GetGatewayRetType, ok bool) { return getNetworkIPv4GetGatewayAttributeTypeOk(o.Gateway) } // HasGateway returns a boolean if a field has been set. func (o *NetworkIPv4) HasGateway() bool { _, ok := o.GetGatewayOk() return ok } // SetGateway gets a reference to the given string and assigns it to the Gateway field. func (o *NetworkIPv4) SetGateway(v NetworkIPv4GetGatewayRetType) { setNetworkIPv4GetGatewayAttributeType(&o.Gateway, v) } // SetGatewayNil sets the value for Gateway to be an explicit nil func (o *NetworkIPv4) SetGatewayNil() { o.Gateway = nil } // UnsetGateway ensures that no value is present for Gateway, not even an explicit nil func (o *NetworkIPv4) UnsetGateway() { o.Gateway = nil } // GetNameservers returns the Nameservers field value if set, zero value otherwise. func (o *NetworkIPv4) GetNameservers() (res NetworkIPv4GetNameserversRetType) { 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 *NetworkIPv4) GetNameserversOk() (ret NetworkIPv4GetNameserversRetType, ok bool) { return getNetworkIPv4GetNameserversAttributeTypeOk(o.Nameservers) } // HasNameservers returns a boolean if a field has been set. func (o *NetworkIPv4) HasNameservers() bool { _, ok := o.GetNameserversOk() return ok } // SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. func (o *NetworkIPv4) SetNameservers(v NetworkIPv4GetNameserversRetType) { setNetworkIPv4GetNameserversAttributeType(&o.Nameservers, v) } // GetPrefixes returns the Prefixes field value func (o *NetworkIPv4) GetPrefixes() (ret NetworkIPv4GetPrefixesRetType) { 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 *NetworkIPv4) GetPrefixesOk() (ret NetworkIPv4GetPrefixesRetType, ok bool) { return getNetworkIPv4GetPrefixesAttributeTypeOk(o.Prefixes) } // SetPrefixes sets field value func (o *NetworkIPv4) SetPrefixes(v NetworkIPv4GetPrefixesRetType) { setNetworkIPv4GetPrefixesAttributeType(&o.Prefixes, v) } // GetPublicIp returns the PublicIp field value if set, zero value otherwise. func (o *NetworkIPv4) GetPublicIp() (res NetworkIPv4GetPublicIpRetType) { res, _ = o.GetPublicIpOk() return } // GetPublicIpOk returns a tuple with the PublicIp field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *NetworkIPv4) GetPublicIpOk() (ret NetworkIPv4GetPublicIpRetType, ok bool) { return getNetworkIPv4GetPublicIpAttributeTypeOk(o.PublicIp) } // HasPublicIp returns a boolean if a field has been set. func (o *NetworkIPv4) HasPublicIp() bool { _, ok := o.GetPublicIpOk() return ok } // SetPublicIp gets a reference to the given string and assigns it to the PublicIp field. func (o *NetworkIPv4) SetPublicIp(v NetworkIPv4GetPublicIpRetType) { setNetworkIPv4GetPublicIpAttributeType(&o.PublicIp, v) } func (o NetworkIPv4) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getNetworkIPv4GetGatewayAttributeTypeOk(o.Gateway); ok { toSerialize["Gateway"] = val } if val, ok := getNetworkIPv4GetNameserversAttributeTypeOk(o.Nameservers); ok { toSerialize["Nameservers"] = val } if val, ok := getNetworkIPv4GetPrefixesAttributeTypeOk(o.Prefixes); ok { toSerialize["Prefixes"] = val } if val, ok := getNetworkIPv4GetPublicIpAttributeTypeOk(o.PublicIp); ok { toSerialize["PublicIp"] = val } return toSerialize, nil } type NullableNetworkIPv4 struct { value *NetworkIPv4 isSet bool } func (v NullableNetworkIPv4) Get() *NetworkIPv4 { return v.value } func (v *NullableNetworkIPv4) Set(val *NetworkIPv4) { v.value = val v.isSet = true } func (v NullableNetworkIPv4) IsSet() bool { return v.isSet } func (v *NullableNetworkIPv4) Unset() { v.value = nil v.isSet = false } func NewNullableNetworkIPv4(val *NetworkIPv4) *NullableNetworkIPv4 { return &NullableNetworkIPv4{value: val, isSet: true} } func (v NullableNetworkIPv4) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableNetworkIPv4) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) }