/*
AutoGlue API

API for managing K3s clusters across cloud providers

API version: 1.0
*/

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

package autoglue

import (
	"encoding/json"
)

// checks if the DtoRefreshRequest type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DtoRefreshRequest{}

// DtoRefreshRequest struct for DtoRefreshRequest
type DtoRefreshRequest struct {
	RefreshToken *string `json:"refresh_token,omitempty"`
}

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

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

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

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

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

	return false
}

// SetRefreshToken gets a reference to the given string and assigns it to the RefreshToken field.
func (o *DtoRefreshRequest) SetRefreshToken(v string) {
	o.RefreshToken = &v
}

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

func (o DtoRefreshRequest) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.RefreshToken) {
		toSerialize["refresh_token"] = o.RefreshToken
	}
	return toSerialize, nil
}

type NullableDtoRefreshRequest struct {
	value *DtoRefreshRequest
	isSet bool
}

func (v NullableDtoRefreshRequest) Get() *DtoRefreshRequest {
	return v.value
}

func (v *NullableDtoRefreshRequest) Set(val *DtoRefreshRequest) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableDtoRefreshRequest(val *DtoRefreshRequest) *NullableDtoRefreshRequest {
	return &NullableDtoRefreshRequest{value: val, isSet: true}
}

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

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