/*
 * Kafka as a Service API
 *
 * An managed Apache Kafka cluster is designed to be highly fault-tolerant and scalable, allowing large volumes of data to be ingested, stored, and processed in real-time. By distributing data across multiple brokers, Kafka achieves high throughput and low latency, making it suitable for applications requiring real-time data processing and analytics.
 *
 * API version: 1.7.1
 * Contact: support@cloud.ionos.com
 */

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

package ionoscloud

import (
	"encoding/json"
)

// KafkaClusterConnection Connection information of the Kafka cluster.
type KafkaClusterConnection struct {
	// The datacenter to connect your instance to.
	DatacenterId *string `json:"datacenterId"`
	// The numeric LAN ID to connect your instance to.
	LanId *string `json:"lanId"`
	// IP addresses and subnet of cluster brokers. Note the following unavailable IP range: 10.224.0.0/11
	BrokerAddresses *[]string `json:"brokerAddresses"`
}

// NewKafkaClusterConnection instantiates a new KafkaClusterConnection 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 NewKafkaClusterConnection(datacenterId string, lanId string, brokerAddresses []string) *KafkaClusterConnection {
	this := KafkaClusterConnection{}

	this.DatacenterId = &datacenterId
	this.LanId = &lanId
	this.BrokerAddresses = &brokerAddresses

	return &this
}

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

// GetDatacenterId returns the DatacenterId field value
// If the value is explicit nil, the zero value for string will be returned
func (o *KafkaClusterConnection) GetDatacenterId() *string {
	if o == nil {
		return nil
	}

	return o.DatacenterId

}

// GetDatacenterIdOk returns a tuple with the DatacenterId field value
// 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 *KafkaClusterConnection) GetDatacenterIdOk() (*string, bool) {
	if o == nil {
		return nil, false
	}

	return o.DatacenterId, true
}

// SetDatacenterId sets field value
func (o *KafkaClusterConnection) SetDatacenterId(v string) {

	o.DatacenterId = &v

}

// HasDatacenterId returns a boolean if a field has been set.
func (o *KafkaClusterConnection) HasDatacenterId() bool {
	if o != nil && o.DatacenterId != nil {
		return true
	}

	return false
}

// GetLanId returns the LanId field value
// If the value is explicit nil, the zero value for string will be returned
func (o *KafkaClusterConnection) GetLanId() *string {
	if o == nil {
		return nil
	}

	return o.LanId

}

// GetLanIdOk returns a tuple with the LanId field value
// 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 *KafkaClusterConnection) GetLanIdOk() (*string, bool) {
	if o == nil {
		return nil, false
	}

	return o.LanId, true
}

// SetLanId sets field value
func (o *KafkaClusterConnection) SetLanId(v string) {

	o.LanId = &v

}

// HasLanId returns a boolean if a field has been set.
func (o *KafkaClusterConnection) HasLanId() bool {
	if o != nil && o.LanId != nil {
		return true
	}

	return false
}

// GetBrokerAddresses returns the BrokerAddresses field value
// If the value is explicit nil, the zero value for []string will be returned
func (o *KafkaClusterConnection) GetBrokerAddresses() *[]string {
	if o == nil {
		return nil
	}

	return o.BrokerAddresses

}

// GetBrokerAddressesOk returns a tuple with the BrokerAddresses field value
// 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 *KafkaClusterConnection) GetBrokerAddressesOk() (*[]string, bool) {
	if o == nil {
		return nil, false
	}

	return o.BrokerAddresses, true
}

// SetBrokerAddresses sets field value
func (o *KafkaClusterConnection) SetBrokerAddresses(v []string) {

	o.BrokerAddresses = &v

}

// HasBrokerAddresses returns a boolean if a field has been set.
func (o *KafkaClusterConnection) HasBrokerAddresses() bool {
	if o != nil && o.BrokerAddresses != nil {
		return true
	}

	return false
}

func (o KafkaClusterConnection) MarshalJSON() ([]byte, error) {
	toSerialize := map[string]interface{}{}
	if o.DatacenterId != nil {
		toSerialize["datacenterId"] = o.DatacenterId
	}

	if o.LanId != nil {
		toSerialize["lanId"] = o.LanId
	}

	if o.BrokerAddresses != nil {
		toSerialize["brokerAddresses"] = o.BrokerAddresses
	}

	return json.Marshal(toSerialize)
}

type NullableKafkaClusterConnection struct {
	value *KafkaClusterConnection
	isSet bool
}

func (v NullableKafkaClusterConnection) Get() *KafkaClusterConnection {
	return v.value
}

func (v *NullableKafkaClusterConnection) Set(val *KafkaClusterConnection) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableKafkaClusterConnection(val *KafkaClusterConnection) *NullableKafkaClusterConnection {
	return &NullableKafkaClusterConnection{value: val, isSet: true}
}

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

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