/* 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 UpdateNetworkIPv4Body type satisfies the MappedNullable interface at compile time var _ MappedNullable = &UpdateNetworkIPv4Body{} /* types and functions for gateway */ // isNullableString type UpdateNetworkIPv4BodyGetGatewayAttributeType = *NullableString func getUpdateNetworkIPv4BodyGetGatewayAttributeTypeOk(arg UpdateNetworkIPv4BodyGetGatewayAttributeType) (ret UpdateNetworkIPv4BodyGetGatewayRetType, ok bool) { if arg == nil { return nil, false } return arg.Get(), true } func setUpdateNetworkIPv4BodyGetGatewayAttributeType(arg *UpdateNetworkIPv4BodyGetGatewayAttributeType, val UpdateNetworkIPv4BodyGetGatewayRetType) { if IsNil(*arg) { *arg = NewNullableString(val) } else { (*arg).Set(val) } } type UpdateNetworkIPv4BodyGetGatewayArgType = *string type UpdateNetworkIPv4BodyGetGatewayRetType = *string /* types and functions for nameservers */ // isArray type UpdateNetworkIPv4BodyGetNameserversAttributeType = *[]string type UpdateNetworkIPv4BodyGetNameserversArgType = []string type UpdateNetworkIPv4BodyGetNameserversRetType = []string func getUpdateNetworkIPv4BodyGetNameserversAttributeTypeOk(arg UpdateNetworkIPv4BodyGetNameserversAttributeType) (ret UpdateNetworkIPv4BodyGetNameserversRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setUpdateNetworkIPv4BodyGetNameserversAttributeType(arg *UpdateNetworkIPv4BodyGetNameserversAttributeType, val UpdateNetworkIPv4BodyGetNameserversRetType) { *arg = &val } // UpdateNetworkIPv4Body The config object for a IPv4 network update. type UpdateNetworkIPv4Body 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 UpdateNetworkIPv4BodyGetGatewayAttributeType `json:"gateway,omitempty"` // A list containing DNS Servers/Nameservers for IPv4. Nameservers UpdateNetworkIPv4BodyGetNameserversAttributeType `json:"nameservers,omitempty"` } // NewUpdateNetworkIPv4Body instantiates a new UpdateNetworkIPv4Body 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 NewUpdateNetworkIPv4Body() *UpdateNetworkIPv4Body { this := UpdateNetworkIPv4Body{} return &this } // NewUpdateNetworkIPv4BodyWithDefaults instantiates a new UpdateNetworkIPv4Body 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 NewUpdateNetworkIPv4BodyWithDefaults() *UpdateNetworkIPv4Body { this := UpdateNetworkIPv4Body{} return &this } // GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). func (o *UpdateNetworkIPv4Body) GetGateway() (res UpdateNetworkIPv4BodyGetGatewayRetType) { 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 *UpdateNetworkIPv4Body) GetGatewayOk() (ret UpdateNetworkIPv4BodyGetGatewayRetType, ok bool) { return getUpdateNetworkIPv4BodyGetGatewayAttributeTypeOk(o.Gateway) } // HasGateway returns a boolean if a field has been set. func (o *UpdateNetworkIPv4Body) HasGateway() bool { _, ok := o.GetGatewayOk() return ok } // SetGateway gets a reference to the given string and assigns it to the Gateway field. func (o *UpdateNetworkIPv4Body) SetGateway(v UpdateNetworkIPv4BodyGetGatewayRetType) { setUpdateNetworkIPv4BodyGetGatewayAttributeType(&o.Gateway, v) } // SetGatewayNil sets the value for Gateway to be an explicit nil func (o *UpdateNetworkIPv4Body) SetGatewayNil() { o.Gateway = nil } // UnsetGateway ensures that no value is present for Gateway, not even an explicit nil func (o *UpdateNetworkIPv4Body) UnsetGateway() { o.Gateway = nil } // GetNameservers returns the Nameservers field value if set, zero value otherwise. func (o *UpdateNetworkIPv4Body) GetNameservers() (res UpdateNetworkIPv4BodyGetNameserversRetType) { 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 *UpdateNetworkIPv4Body) GetNameserversOk() (ret UpdateNetworkIPv4BodyGetNameserversRetType, ok bool) { return getUpdateNetworkIPv4BodyGetNameserversAttributeTypeOk(o.Nameservers) } // HasNameservers returns a boolean if a field has been set. func (o *UpdateNetworkIPv4Body) HasNameservers() bool { _, ok := o.GetNameserversOk() return ok } // SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. func (o *UpdateNetworkIPv4Body) SetNameservers(v UpdateNetworkIPv4BodyGetNameserversRetType) { setUpdateNetworkIPv4BodyGetNameserversAttributeType(&o.Nameservers, v) } func (o UpdateNetworkIPv4Body) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getUpdateNetworkIPv4BodyGetGatewayAttributeTypeOk(o.Gateway); ok { toSerialize["Gateway"] = val } if val, ok := getUpdateNetworkIPv4BodyGetNameserversAttributeTypeOk(o.Nameservers); ok { toSerialize["Nameservers"] = val } return toSerialize, nil } type NullableUpdateNetworkIPv4Body struct { value *UpdateNetworkIPv4Body isSet bool } func (v NullableUpdateNetworkIPv4Body) Get() *UpdateNetworkIPv4Body { return v.value } func (v *NullableUpdateNetworkIPv4Body) Set(val *UpdateNetworkIPv4Body) { v.value = val v.isSet = true } func (v NullableUpdateNetworkIPv4Body) IsSet() bool { return v.isSet } func (v *NullableUpdateNetworkIPv4Body) Unset() { v.value = nil v.isSet = false } func NewNullableUpdateNetworkIPv4Body(val *UpdateNetworkIPv4Body) *NullableUpdateNetworkIPv4Body { return &NullableUpdateNetworkIPv4Body{value: val, isSet: true} } func (v NullableUpdateNetworkIPv4Body) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableUpdateNetworkIPv4Body) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) }