/*
 * Subset of Influx API covered by Influx CLI
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * API version: 2.0.0
 */

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

package api

import (
	"encoding/json"
)

// UnauthorizedRequestError struct for UnauthorizedRequestError
type UnauthorizedRequestError struct {
	// The HTTP status code description. Default is `unauthorized`.
	Code *string `json:"code,omitempty" yaml:"code,omitempty"`
	// A human-readable message that may contain detail about the error.
	Message *string `json:"message,omitempty" yaml:"message,omitempty"`
}

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

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

// GetCode returns the Code field value if set, zero value otherwise.
func (o *UnauthorizedRequestError) GetCode() string {
	if o == nil || o.Code == nil {
		var ret string
		return ret
	}
	return *o.Code
}

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

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

	return false
}

// SetCode gets a reference to the given string and assigns it to the Code field.
func (o *UnauthorizedRequestError) SetCode(v string) {
	o.Code = &v
}

// GetMessage returns the Message field value if set, zero value otherwise.
func (o *UnauthorizedRequestError) GetMessage() string {
	if o == nil || o.Message == nil {
		var ret string
		return ret
	}
	return *o.Message
}

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

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

	return false
}

// SetMessage gets a reference to the given string and assigns it to the Message field.
func (o *UnauthorizedRequestError) SetMessage(v string) {
	o.Message = &v
}

func (o UnauthorizedRequestError) MarshalJSON() ([]byte, error) {
	toSerialize := map[string]interface{}{}
	if o.Code != nil {
		toSerialize["code"] = o.Code
	}
	if o.Message != nil {
		toSerialize["message"] = o.Message
	}
	return json.Marshal(toSerialize)
}

type NullableUnauthorizedRequestError struct {
	value *UnauthorizedRequestError
	isSet bool
}

func (v NullableUnauthorizedRequestError) Get() *UnauthorizedRequestError {
	return v.value
}

func (v *NullableUnauthorizedRequestError) Set(val *UnauthorizedRequestError) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableUnauthorizedRequestError(val *UnauthorizedRequestError) *NullableUnauthorizedRequestError {
	return &NullableUnauthorizedRequestError{value: val, isSet: true}
}

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

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