/*
 * VPN Gateways
 *
 * POC Docs for VPN gateway as service
 *
 * API version: 0.0.1
 * Contact: support@cloud.ionos.com
 */

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

package vpn

import (
	"encoding/json"
)

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

// ResourceStatus The current status of the resource.
type ResourceStatus struct {
	// The current status of the resource. The status can be:  * `AVAILABLE` - resource exists and is healthy. * `PROVISIONING` - resource is being created or updated. * `DESTROYING` - delete command was issued, the resource is being deleted. * `FAILED`: - resource failed, details in `statusMessage`.
	Status string `json:"status"`
	// The message of the failure if the status is `FAILED`.
	StatusMessage *string `json:"statusMessage,omitempty"`
}

// NewResourceStatus instantiates a new ResourceStatus 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 NewResourceStatus(status string) *ResourceStatus {
	this := ResourceStatus{}

	this.Status = status

	return &this
}

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

// GetStatus returns the Status field value
func (o *ResourceStatus) GetStatus() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Status
}

// GetStatusOk returns a tuple with the Status field value
// and a boolean to check if the value has been set.
func (o *ResourceStatus) GetStatusOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Status, true
}

// SetStatus sets field value
func (o *ResourceStatus) SetStatus(v string) {
	o.Status = v
}

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

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

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

	return false
}

// SetStatusMessage gets a reference to the given string and assigns it to the StatusMessage field.
func (o *ResourceStatus) SetStatusMessage(v string) {
	o.StatusMessage = &v
}

func (o ResourceStatus) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["status"] = o.Status
	if !IsNil(o.StatusMessage) {
		toSerialize["statusMessage"] = o.StatusMessage
	}
	return toSerialize, nil
}

type NullableResourceStatus struct {
	value *ResourceStatus
	isSet bool
}

func (v NullableResourceStatus) Get() *ResourceStatus {
	return v.value
}

func (v *NullableResourceStatus) Set(val *ResourceStatus) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableResourceStatus(val *ResourceStatus) *NullableResourceStatus {
	return &NullableResourceStatus{value: val, isSet: true}
}

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

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