/*
 * Extra configuration to force openapi to generate enum validators
 *
 * 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 extras

import (
	"encoding/json"
	"fmt"
)

// ResourceEnumCloud The type of resource. In a `permission`, applies the permission to all resources of this type.
type ResourceEnumCloud string

// List of ResourceEnumCloud
const (
	RESOURCEENUMCLOUD_AUTHORIZATIONS         ResourceEnumCloud = "authorizations"
	RESOURCEENUMCLOUD_BUCKETS                ResourceEnumCloud = "buckets"
	RESOURCEENUMCLOUD_DASHBOARDS             ResourceEnumCloud = "dashboards"
	RESOURCEENUMCLOUD_ORGS                   ResourceEnumCloud = "orgs"
	RESOURCEENUMCLOUD_TASKS                  ResourceEnumCloud = "tasks"
	RESOURCEENUMCLOUD_TELEGRAFS              ResourceEnumCloud = "telegrafs"
	RESOURCEENUMCLOUD_USERS                  ResourceEnumCloud = "users"
	RESOURCEENUMCLOUD_VARIABLES              ResourceEnumCloud = "variables"
	RESOURCEENUMCLOUD_SECRETS                ResourceEnumCloud = "secrets"
	RESOURCEENUMCLOUD_LABELS                 ResourceEnumCloud = "labels"
	RESOURCEENUMCLOUD_VIEWS                  ResourceEnumCloud = "views"
	RESOURCEENUMCLOUD_DOCUMENTS              ResourceEnumCloud = "documents"
	RESOURCEENUMCLOUD_NOTIFICATION_RULES     ResourceEnumCloud = "notificationRules"
	RESOURCEENUMCLOUD_NOTIFICATION_ENDPOINTS ResourceEnumCloud = "notificationEndpoints"
	RESOURCEENUMCLOUD_CHECKS                 ResourceEnumCloud = "checks"
	RESOURCEENUMCLOUD_DBRP                   ResourceEnumCloud = "dbrp"
	RESOURCEENUMCLOUD_ANNOTATIONS            ResourceEnumCloud = "annotations"
	RESOURCEENUMCLOUD_FLOWS                  ResourceEnumCloud = "flows"
	RESOURCEENUMCLOUD_FUNCTIONS              ResourceEnumCloud = "functions"
	RESOURCEENUMCLOUD_SUBSCRIPTIONS          ResourceEnumCloud = "subscriptions"
)

func ResourceEnumCloudValues() []ResourceEnumCloud {
	return []ResourceEnumCloud{"authorizations", "buckets", "dashboards", "orgs", "tasks", "telegrafs", "users", "variables", "secrets", "labels", "views", "documents", "notificationRules", "notificationEndpoints", "checks", "dbrp", "annotations", "flows", "functions", "subscriptions"}
}

func (v *ResourceEnumCloud) UnmarshalJSON(src []byte) error {
	var value string
	err := json.Unmarshal(src, &value)
	if err != nil {
		return err
	}
	enumTypeValue := ResourceEnumCloud(value)
	for _, existing := range []ResourceEnumCloud{"authorizations", "buckets", "dashboards", "orgs", "tasks", "telegrafs", "users", "variables", "secrets", "labels", "views", "documents", "notificationRules", "notificationEndpoints", "checks", "dbrp", "annotations", "flows", "functions", "subscriptions"} {
		if existing == enumTypeValue {
			*v = enumTypeValue
			return nil
		}
	}

	return fmt.Errorf("%+v is not a valid ResourceEnumCloud", value)
}

// Ptr returns reference to ResourceEnumCloud value
func (v ResourceEnumCloud) Ptr() *ResourceEnumCloud {
	return &v
}

type NullableResourceEnumCloud struct {
	value *ResourceEnumCloud
	isSet bool
}

func (v NullableResourceEnumCloud) Get() *ResourceEnumCloud {
	return v.value
}

func (v *NullableResourceEnumCloud) Set(val *ResourceEnumCloud) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableResourceEnumCloud(val *ResourceEnumCloud) *NullableResourceEnumCloud {
	return &NullableResourceEnumCloud{value: val, isSet: true}
}

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

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