/*
 * Kafka as a Service API
 *
 * An managed Apache Kafka cluster is designed to be highly fault-tolerant and scalable, allowing large volumes of data to be ingested, stored, and processed in real-time. By distributing data across multiple brokers, Kafka achieves high throughput and low latency, making it suitable for applications requiring real-time data processing and analytics.
 *
 * API version: 1.7.1
 * Contact: support@cloud.ionos.com
 */

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

package ionoscloud

import (
	"encoding/json"
)

// ResourceState The current status of the resource.
type ResourceState struct {
	// State of the resource. Resource states: `AVAILABLE`: There are no pending modification requests for this item. `BUSY`: There is at least one modification request pending and all following requests will be queued. `DEPLOYING`: The resource is being created. `FAILED`: The creation of the resource failed. `UPDATING`: The resource is being updated. `FAILED_UPDATING`: An update to the resource was not successful. `DESTROYING`: A delete command was issued, and the resource is being deleted.
	State *string `json:"state"`
	// A human readable message describing the current state. In case of an error, the message will contain a detailed error message.
	Message *string `json:"message,omitempty"`
}

// NewResourceState instantiates a new ResourceState 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 NewResourceState(state string) *ResourceState {
	this := ResourceState{}

	this.State = &state

	return &this
}

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

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

	return o.State

}

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

	return o.State, true
}

// SetState sets field value
func (o *ResourceState) SetState(v string) {

	o.State = &v

}

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

	return false
}

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

	return o.Message

}

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

	return o.Message, true
}

// SetMessage sets field value
func (o *ResourceState) SetMessage(v string) {

	o.Message = &v

}

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

	return false
}

func (o ResourceState) MarshalJSON() ([]byte, error) {
	toSerialize := map[string]interface{}{}
	if o.State != nil {
		toSerialize["state"] = o.State
	}

	if o.Message != nil {
		toSerialize["message"] = o.Message
	}

	return json.Marshal(toSerialize)
}

type NullableResourceState struct {
	value *ResourceState
	isSet bool
}

func (v NullableResourceState) Get() *ResourceState {
	return v.value
}

func (v *NullableResourceState) Set(val *ResourceState) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableResourceState(val *ResourceState) *NullableResourceState {
	return &NullableResourceState{value: val, isSet: true}
}

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

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