/*
 * 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"
)

// ReverseRecord The reverse DNS record.
type ReverseRecord struct {
	// The reverse DNS record name
	Name *string `json:"name"`
	// Description stored along with the reverse DNS record to describe its usage.
	Description *string `json:"description,omitempty"`
	// Specifies for which IP address the reverse record should be created. The IP addresses needs to be owned by the contract. Accepts IPv4 and IPv6 addresses.
	Ip *string `json:"ip"`
}

// NewReverseRecord instantiates a new ReverseRecord 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 NewReverseRecord(name string, ip string) *ReverseRecord {
	this := ReverseRecord{}

	this.Name = &name
	this.Ip = &ip

	return &this
}

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

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

	return o.Name, true
}

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

	o.Name = &v

}

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

	return false
}

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

	return o.Description

}

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

	return o.Description, true
}

// SetDescription sets field value
func (o *ReverseRecord) SetDescription(v string) {

	o.Description = &v

}

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

	return false
}

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

	return o.Ip

}

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

	return o.Ip, true
}

// SetIp sets field value
func (o *ReverseRecord) SetIp(v string) {

	o.Ip = &v

}

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

	return false
}

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

	if o.Description != nil {
		toSerialize["description"] = o.Description
	}

	if o.Ip != nil {
		toSerialize["ip"] = o.Ip
	}

	return json.Marshal(toSerialize)
}

type NullableReverseRecord struct {
	value *ReverseRecord
	isSet bool
}

func (v NullableReverseRecord) Get() *ReverseRecord {
	return v.value
}

func (v *NullableReverseRecord) Set(val *ReverseRecord) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableReverseRecord(val *ReverseRecord) *NullableReverseRecord {
	return &NullableReverseRecord{value: val, isSet: true}
}

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

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