/*
 * IONOS Cloud - DNS API
 *
 * Cloud DNS service helps IONOS Cloud customers to automate DNS Zone and Record management.
 *
 * API version: 1.16.0
 * Contact: support@cloud.ionos.com
 */

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

package ionoscloud

import (
	"encoding/json"
)

// Record struct for Record
type Record struct {
	Name *string `json:"name"`
	// Holds supported DNS resource record types. In the DNS context a record is a DNS resource record.
	Type    *string `json:"type"`
	Content *string `json:"content"`
	// Time to live for the record, recommended 3600.
	Ttl *int32 `json:"ttl,omitempty"`
	// Priority value is between 0 and 65535. Priority is mandatory for MX, SRV and URI record types and ignored for all other types.
	Priority *int32 `json:"priority,omitempty"`
	// When true - the record is visible for lookup.
	Enabled *bool `json:"enabled,omitempty"`
}

// NewRecord instantiates a new Record 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 NewRecord(name string, type_ string, content string) *Record {
	this := Record{}

	this.Name = &name
	this.Type = &type_
	this.Content = &content
	var ttl int32 = 3600
	this.Ttl = &ttl
	var enabled bool = true
	this.Enabled = &enabled

	return &this
}

// NewRecordWithDefaults instantiates a new Record 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 NewRecordWithDefaults() *Record {
	this := Record{}
	var ttl int32 = 3600
	this.Ttl = &ttl
	var enabled bool = true
	this.Enabled = &enabled
	return &this
}

// GetName returns the Name field value
// If the value is explicit nil, the zero value for string will be returned
func (o *Record) 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 *Record) GetNameOk() (*string, bool) {
	if o == nil {
		return nil, false
	}

	return o.Name, true
}

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

	o.Name = &v

}

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

	return false
}

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

	return o.Type

}

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

	return o.Type, true
}

// SetType sets field value
func (o *Record) SetType(v string) {

	o.Type = &v

}

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

	return false
}

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

	return o.Content

}

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

	return o.Content, true
}

// SetContent sets field value
func (o *Record) SetContent(v string) {

	o.Content = &v

}

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

	return false
}

// GetTtl returns the Ttl field value
// If the value is explicit nil, the zero value for int32 will be returned
func (o *Record) GetTtl() *int32 {
	if o == nil {
		return nil
	}

	return o.Ttl

}

// GetTtlOk returns a tuple with the Ttl 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 *Record) GetTtlOk() (*int32, bool) {
	if o == nil {
		return nil, false
	}

	return o.Ttl, true
}

// SetTtl sets field value
func (o *Record) SetTtl(v int32) {

	o.Ttl = &v

}

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

	return false
}

// GetPriority returns the Priority field value
// If the value is explicit nil, the zero value for int32 will be returned
func (o *Record) GetPriority() *int32 {
	if o == nil {
		return nil
	}

	return o.Priority

}

// GetPriorityOk returns a tuple with the Priority 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 *Record) GetPriorityOk() (*int32, bool) {
	if o == nil {
		return nil, false
	}

	return o.Priority, true
}

// SetPriority sets field value
func (o *Record) SetPriority(v int32) {

	o.Priority = &v

}

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

	return false
}

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

	return o.Enabled

}

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

	return o.Enabled, true
}

// SetEnabled sets field value
func (o *Record) SetEnabled(v bool) {

	o.Enabled = &v

}

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

	return false
}

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

	if o.Type != nil {
		toSerialize["type"] = o.Type
	}

	if o.Content != nil {
		toSerialize["content"] = o.Content
	}

	if o.Ttl != nil {
		toSerialize["ttl"] = o.Ttl
	}

	if o.Priority != nil {
		toSerialize["priority"] = o.Priority
	}

	if o.Enabled != nil {
		toSerialize["enabled"] = o.Enabled
	}

	return json.Marshal(toSerialize)
}

type NullableRecord struct {
	value *Record
	isSet bool
}

func (v NullableRecord) Get() *Record {
	return v.value
}

func (v *NullableRecord) Set(val *Record) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableRecord(val *Record) *NullableRecord {
	return &NullableRecord{value: val, isSet: true}
}

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

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