/*
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 PrivateALICLOUD type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PrivateALICLOUD{}

// PrivateALICLOUD The [Alibaba Cloud PrivateLink](https://www.alibabacloud.com/help/en/privatelink/product-overview/what-is-a-private-network-connection) configuration for private access.
type PrivateALICLOUD struct {
	// A list of availability zones where the service is available.
	AvailabilityZone []string `json:"availabilityZone,omitempty"`
	// The Alibaba Cloud service name for private access.
	ServiceName *string `json:"serviceName,omitempty"`
	AdditionalProperties map[string]interface{}
}

type _PrivateALICLOUD PrivateALICLOUD

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

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

// GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise.
func (o *PrivateALICLOUD) GetAvailabilityZone() []string {
	if o == nil || IsNil(o.AvailabilityZone) {
		var ret []string
		return ret
	}
	return o.AvailabilityZone
}

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

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

	return false
}

// SetAvailabilityZone gets a reference to the given []string and assigns it to the AvailabilityZone field.
func (o *PrivateALICLOUD) SetAvailabilityZone(v []string) {
	o.AvailabilityZone = v
}

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

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

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

	return false
}

// SetServiceName gets a reference to the given string and assigns it to the ServiceName field.
func (o *PrivateALICLOUD) SetServiceName(v string) {
	o.ServiceName = &v
}

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

func (o PrivateALICLOUD) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.AvailabilityZone) {
		toSerialize["availabilityZone"] = o.AvailabilityZone
	}
	if !IsNil(o.ServiceName) {
		toSerialize["serviceName"] = o.ServiceName
	}

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

	return toSerialize, nil
}

func (o *PrivateALICLOUD) UnmarshalJSON(data []byte) (err error) {
	varPrivateALICLOUD := _PrivateALICLOUD{}

	err = json.Unmarshal(data, &varPrivateALICLOUD)

	if err != nil {
		return err
	}

	*o = PrivateALICLOUD(varPrivateALICLOUD)

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

	if err = json.Unmarshal(data, &additionalProperties); err == nil {
		delete(additionalProperties, "availabilityZone")
		delete(additionalProperties, "serviceName")
		o.AdditionalProperties = additionalProperties
	}

	return err
}

type NullablePrivateALICLOUD struct {
	value *PrivateALICLOUD
	isSet bool
}

func (v NullablePrivateALICLOUD) Get() *PrivateALICLOUD {
	return v.value
}

func (v *NullablePrivateALICLOUD) Set(val *PrivateALICLOUD) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullablePrivateALICLOUD(val *PrivateALICLOUD) *NullablePrivateALICLOUD {
	return &NullablePrivateALICLOUD{value: val, isSet: true}
}

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

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


