/*
TiDB Cloud Console API

TiDB Cloud Console API.

API version: v1beta1
*/

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

package client

import (
	"encoding/json"
)

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

// EndpointsPrivate Message for private endpoint to securely connect to the cluster.
type EndpointsPrivate struct {
	Alicloud *PrivateALICLOUD `json:"alicloud,omitempty"`
	Aws *PrivateAWS `json:"aws,omitempty"`
	Gcp *PrivateGCP `json:"gcp,omitempty"`
	// The hostname of the private endpoint.
	Host *string `json:"host,omitempty"`
	// The port number of the private endpoint.
	Port *int32 `json:"port,omitempty"`
	AdditionalProperties map[string]interface{}
}

type _EndpointsPrivate EndpointsPrivate

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

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

// GetAlicloud returns the Alicloud field value if set, zero value otherwise.
func (o *EndpointsPrivate) GetAlicloud() PrivateALICLOUD {
	if o == nil || IsNil(o.Alicloud) {
		var ret PrivateALICLOUD
		return ret
	}
	return *o.Alicloud
}

// GetAlicloudOk returns a tuple with the Alicloud field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EndpointsPrivate) GetAlicloudOk() (*PrivateALICLOUD, bool) {
	if o == nil || IsNil(o.Alicloud) {
		return nil, false
	}
	return o.Alicloud, true
}

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

	return false
}

// SetAlicloud gets a reference to the given PrivateALICLOUD and assigns it to the Alicloud field.
func (o *EndpointsPrivate) SetAlicloud(v PrivateALICLOUD) {
	o.Alicloud = &v
}

// GetAws returns the Aws field value if set, zero value otherwise.
func (o *EndpointsPrivate) GetAws() PrivateAWS {
	if o == nil || IsNil(o.Aws) {
		var ret PrivateAWS
		return ret
	}
	return *o.Aws
}

// GetAwsOk returns a tuple with the Aws field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EndpointsPrivate) GetAwsOk() (*PrivateAWS, bool) {
	if o == nil || IsNil(o.Aws) {
		return nil, false
	}
	return o.Aws, true
}

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

	return false
}

// SetAws gets a reference to the given PrivateAWS and assigns it to the Aws field.
func (o *EndpointsPrivate) SetAws(v PrivateAWS) {
	o.Aws = &v
}

// GetGcp returns the Gcp field value if set, zero value otherwise.
func (o *EndpointsPrivate) GetGcp() PrivateGCP {
	if o == nil || IsNil(o.Gcp) {
		var ret PrivateGCP
		return ret
	}
	return *o.Gcp
}

// GetGcpOk returns a tuple with the Gcp field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EndpointsPrivate) GetGcpOk() (*PrivateGCP, bool) {
	if o == nil || IsNil(o.Gcp) {
		return nil, false
	}
	return o.Gcp, true
}

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

	return false
}

// SetGcp gets a reference to the given PrivateGCP and assigns it to the Gcp field.
func (o *EndpointsPrivate) SetGcp(v PrivateGCP) {
	o.Gcp = &v
}

// GetHost returns the Host field value if set, zero value otherwise.
func (o *EndpointsPrivate) GetHost() string {
	if o == nil || IsNil(o.Host) {
		var ret string
		return ret
	}
	return *o.Host
}

// GetHostOk returns a tuple with the Host field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EndpointsPrivate) GetHostOk() (*string, bool) {
	if o == nil || IsNil(o.Host) {
		return nil, false
	}
	return o.Host, true
}

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

	return false
}

// SetHost gets a reference to the given string and assigns it to the Host field.
func (o *EndpointsPrivate) SetHost(v string) {
	o.Host = &v
}

// GetPort returns the Port field value if set, zero value otherwise.
func (o *EndpointsPrivate) GetPort() int32 {
	if o == nil || IsNil(o.Port) {
		var ret int32
		return ret
	}
	return *o.Port
}

// GetPortOk returns a tuple with the Port field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EndpointsPrivate) GetPortOk() (*int32, bool) {
	if o == nil || IsNil(o.Port) {
		return nil, false
	}
	return o.Port, true
}

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

	return false
}

// SetPort gets a reference to the given int32 and assigns it to the Port field.
func (o *EndpointsPrivate) SetPort(v int32) {
	o.Port = &v
}

func (o EndpointsPrivate) MarshalJSON() ([]byte, error) {
	toSerialize,err := o.ToMap()
	if err != nil {
		return []byte{}, err
	}
	return json.Marshal(toSerialize)
}

func (o EndpointsPrivate) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Alicloud) {
		toSerialize["alicloud"] = o.Alicloud
	}
	if !IsNil(o.Aws) {
		toSerialize["aws"] = o.Aws
	}
	if !IsNil(o.Gcp) {
		toSerialize["gcp"] = o.Gcp
	}
	if !IsNil(o.Host) {
		toSerialize["host"] = o.Host
	}
	if !IsNil(o.Port) {
		toSerialize["port"] = o.Port
	}

	for key, value := range o.AdditionalProperties {
		toSerialize[key] = value
	}

	return toSerialize, nil
}

func (o *EndpointsPrivate) UnmarshalJSON(data []byte) (err error) {
	varEndpointsPrivate := _EndpointsPrivate{}

	err = json.Unmarshal(data, &varEndpointsPrivate)

	if err != nil {
		return err
	}

	*o = EndpointsPrivate(varEndpointsPrivate)

	additionalProperties := make(map[string]interface{})

	if err = json.Unmarshal(data, &additionalProperties); err == nil {
		delete(additionalProperties, "alicloud")
		delete(additionalProperties, "aws")
		delete(additionalProperties, "gcp")
		delete(additionalProperties, "host")
		delete(additionalProperties, "port")
		o.AdditionalProperties = additionalProperties
	}

	return err
}

type NullableEndpointsPrivate struct {
	value *EndpointsPrivate
	isSet bool
}

func (v NullableEndpointsPrivate) Get() *EndpointsPrivate {
	return v.value
}

func (v *NullableEndpointsPrivate) Set(val *EndpointsPrivate) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableEndpointsPrivate(val *EndpointsPrivate) *NullableEndpointsPrivate {
	return &NullableEndpointsPrivate{value: val, isSet: true}
}

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

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


