/*
 * IONOS Cloud - API Gateway
 *
 * API Gateway is an application that acts as a \"front door\" for backend services and APIs, handling client requests and routing them to the appropriate backend.
 *
 * API version: 0.0.1
 */

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

package ionoscloud

import (
	"encoding/json"
)

// Gateway An API gateway consists of the generic rules and configurations of an API Gateway.
type Gateway struct {
	Name *string `json:"name"`
	// This field enables or disables the collection and reporting of logs for observability of this instance.
	Logs *bool `json:"logs,omitempty"`
	// This field enables or disables the collection and reporting of metrics for observability of this instance.
	Metrics       *bool                   `json:"metrics,omitempty"`
	CustomDomains *[]GatewayCustomDomains `json:"customDomains,omitempty"`
}

// NewGateway instantiates a new Gateway 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 NewGateway(name string) *Gateway {
	this := Gateway{}

	this.Name = &name
	var logs bool = false
	this.Logs = &logs
	var metrics bool = false
	this.Metrics = &metrics

	return &this
}

// NewGatewayWithDefaults instantiates a new Gateway 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 NewGatewayWithDefaults() *Gateway {
	this := Gateway{}
	var logs bool = false
	this.Logs = &logs
	var metrics bool = false
	this.Metrics = &metrics
	return &this
}

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

	return o.Name

}

// GetNameOk returns a tuple with the Name 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 *Gateway) GetNameOk() (*string, bool) {
	if o == nil {
		return nil, false
	}

	return o.Name, true
}

// SetName sets field value
func (o *Gateway) SetName(v string) {

	o.Name = &v

}

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

	return false
}

// GetLogs returns the Logs field value
// If the value is explicit nil, the zero value for bool will be returned
func (o *Gateway) GetLogs() *bool {
	if o == nil {
		return nil
	}

	return o.Logs

}

// GetLogsOk returns a tuple with the Logs 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 *Gateway) GetLogsOk() (*bool, bool) {
	if o == nil {
		return nil, false
	}

	return o.Logs, true
}

// SetLogs sets field value
func (o *Gateway) SetLogs(v bool) {

	o.Logs = &v

}

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

	return false
}

// GetMetrics returns the Metrics field value
// If the value is explicit nil, the zero value for bool will be returned
func (o *Gateway) GetMetrics() *bool {
	if o == nil {
		return nil
	}

	return o.Metrics

}

// GetMetricsOk returns a tuple with the Metrics 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 *Gateway) GetMetricsOk() (*bool, bool) {
	if o == nil {
		return nil, false
	}

	return o.Metrics, true
}

// SetMetrics sets field value
func (o *Gateway) SetMetrics(v bool) {

	o.Metrics = &v

}

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

	return false
}

// GetCustomDomains returns the CustomDomains field value
// If the value is explicit nil, the zero value for []GatewayCustomDomains will be returned
func (o *Gateway) GetCustomDomains() *[]GatewayCustomDomains {
	if o == nil {
		return nil
	}

	return o.CustomDomains

}

// GetCustomDomainsOk returns a tuple with the CustomDomains 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 *Gateway) GetCustomDomainsOk() (*[]GatewayCustomDomains, bool) {
	if o == nil {
		return nil, false
	}

	return o.CustomDomains, true
}

// SetCustomDomains sets field value
func (o *Gateway) SetCustomDomains(v []GatewayCustomDomains) {

	o.CustomDomains = &v

}

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

	return false
}

func (o Gateway) MarshalJSON() ([]byte, error) {
	toSerialize := map[string]interface{}{}
	if o.Name != nil {
		toSerialize["name"] = o.Name
	}

	if o.Logs != nil {
		toSerialize["logs"] = o.Logs
	}

	if o.Metrics != nil {
		toSerialize["metrics"] = o.Metrics
	}

	if o.CustomDomains != nil {
		toSerialize["customDomains"] = o.CustomDomains
	}

	return json.Marshal(toSerialize)
}

type NullableGateway struct {
	value *Gateway
	isSet bool
}

func (v NullableGateway) Get() *Gateway {
	return v.value
}

func (v *NullableGateway) Set(val *Gateway) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableGateway(val *Gateway) *NullableGateway {
	return &NullableGateway{value: val, isSet: true}
}

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

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