/*
 * VPN Gateways
 *
 * POC Docs for VPN gateway as service
 *
 * API version: 0.0.1
 * Contact: support@cloud.ionos.com
 */

// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.

package vpn

import (
	"encoding/json"
)

// checks if the WireguardGatewayEnsure type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &WireguardGatewayEnsure{}

// WireguardGatewayEnsure struct for WireguardGatewayEnsure
type WireguardGatewayEnsure struct {
	// The ID (UUID) of the WireguardGateway.
	Id string `json:"id"`
	// Metadata
	Metadata   map[string]interface{} `json:"metadata,omitempty"`
	Properties WireguardGateway       `json:"properties"`
}

// NewWireguardGatewayEnsure instantiates a new WireguardGatewayEnsure 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 NewWireguardGatewayEnsure(id string, properties WireguardGateway) *WireguardGatewayEnsure {
	this := WireguardGatewayEnsure{}

	this.Id = id
	this.Properties = properties

	return &this
}

// NewWireguardGatewayEnsureWithDefaults instantiates a new WireguardGatewayEnsure 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 NewWireguardGatewayEnsureWithDefaults() *WireguardGatewayEnsure {
	this := WireguardGatewayEnsure{}
	return &this
}

// GetId returns the Id field value
func (o *WireguardGatewayEnsure) GetId() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Id
}

// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
func (o *WireguardGatewayEnsure) GetIdOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Id, true
}

// SetId sets field value
func (o *WireguardGatewayEnsure) SetId(v string) {
	o.Id = v
}

// GetMetadata returns the Metadata field value if set, zero value otherwise.
func (o *WireguardGatewayEnsure) GetMetadata() map[string]interface{} {
	if o == nil || IsNil(o.Metadata) {
		var ret map[string]interface{}
		return ret
	}
	return o.Metadata
}

// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *WireguardGatewayEnsure) GetMetadataOk() (map[string]interface{}, bool) {
	if o == nil || IsNil(o.Metadata) {
		return map[string]interface{}{}, false
	}
	return o.Metadata, true
}

// HasMetadata returns a boolean if a field has been set.
func (o *WireguardGatewayEnsure) HasMetadata() bool {
	if o != nil && !IsNil(o.Metadata) {
		return true
	}

	return false
}

// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field.
func (o *WireguardGatewayEnsure) SetMetadata(v map[string]interface{}) {
	o.Metadata = v
}

// GetProperties returns the Properties field value
func (o *WireguardGatewayEnsure) GetProperties() WireguardGateway {
	if o == nil {
		var ret WireguardGateway
		return ret
	}

	return o.Properties
}

// GetPropertiesOk returns a tuple with the Properties field value
// and a boolean to check if the value has been set.
func (o *WireguardGatewayEnsure) GetPropertiesOk() (*WireguardGateway, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Properties, true
}

// SetProperties sets field value
func (o *WireguardGatewayEnsure) SetProperties(v WireguardGateway) {
	o.Properties = v
}

func (o WireguardGatewayEnsure) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["id"] = o.Id
	if !IsNil(o.Metadata) {
		toSerialize["metadata"] = o.Metadata
	}
	toSerialize["properties"] = o.Properties
	return toSerialize, nil
}

type NullableWireguardGatewayEnsure struct {
	value *WireguardGatewayEnsure
	isSet bool
}

func (v NullableWireguardGatewayEnsure) Get() *WireguardGatewayEnsure {
	return v.value
}

func (v *NullableWireguardGatewayEnsure) Set(val *WireguardGatewayEnsure) {
	v.value = val
	v.isSet = true
}

func (v NullableWireguardGatewayEnsure) IsSet() bool {
	return v.isSet
}

func (v *NullableWireguardGatewayEnsure) Unset() {
	v.value = nil
	v.isSet = false
}

func NewNullableWireguardGatewayEnsure(val *WireguardGatewayEnsure) *NullableWireguardGatewayEnsure {
	return &NullableWireguardGatewayEnsure{value: val, isSet: true}
}

func (v NullableWireguardGatewayEnsure) MarshalJSON() ([]byte, error) {
	return json.Marshal(v.value)
}

func (v *NullableWireguardGatewayEnsure) UnmarshalJSON(src []byte) error {
	v.isSet = true
	return json.Unmarshal(src, &v.value)
}
