108 lines
3.8 KiB
Go
108 lines
3.8 KiB
Go
/*
|
|
* 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"
|
|
)
|
|
|
|
// ResourceEnumOSS the model 'ResourceEnumOSS'
|
|
type ResourceEnumOSS string
|
|
|
|
// List of ResourceEnumOSS
|
|
const (
|
|
RESOURCEENUMOSS_AUTHORIZATIONS ResourceEnumOSS = "authorizations"
|
|
RESOURCEENUMOSS_BUCKETS ResourceEnumOSS = "buckets"
|
|
RESOURCEENUMOSS_DASHBOARDS ResourceEnumOSS = "dashboards"
|
|
RESOURCEENUMOSS_ORGS ResourceEnumOSS = "orgs"
|
|
RESOURCEENUMOSS_SOURCES ResourceEnumOSS = "sources"
|
|
RESOURCEENUMOSS_TASKS ResourceEnumOSS = "tasks"
|
|
RESOURCEENUMOSS_TELEGRAFS ResourceEnumOSS = "telegrafs"
|
|
RESOURCEENUMOSS_USERS ResourceEnumOSS = "users"
|
|
RESOURCEENUMOSS_VARIABLES ResourceEnumOSS = "variables"
|
|
RESOURCEENUMOSS_SCRAPERS ResourceEnumOSS = "scrapers"
|
|
RESOURCEENUMOSS_SECRETS ResourceEnumOSS = "secrets"
|
|
RESOURCEENUMOSS_LABELS ResourceEnumOSS = "labels"
|
|
RESOURCEENUMOSS_VIEWS ResourceEnumOSS = "views"
|
|
RESOURCEENUMOSS_DOCUMENTS ResourceEnumOSS = "documents"
|
|
RESOURCEENUMOSS_NOTIFICATION_RULES ResourceEnumOSS = "notificationRules"
|
|
RESOURCEENUMOSS_NOTIFICATION_ENDPOINTS ResourceEnumOSS = "notificationEndpoints"
|
|
RESOURCEENUMOSS_CHECKS ResourceEnumOSS = "checks"
|
|
RESOURCEENUMOSS_DBRP ResourceEnumOSS = "dbrp"
|
|
RESOURCEENUMOSS_NOTEBOOKS ResourceEnumOSS = "notebooks"
|
|
RESOURCEENUMOSS_ANNOTATIONS ResourceEnumOSS = "annotations"
|
|
RESOURCEENUMOSS_REMOTES ResourceEnumOSS = "remotes"
|
|
RESOURCEENUMOSS_REPLICATIONS ResourceEnumOSS = "replications"
|
|
)
|
|
|
|
func ResourceEnumOSSValues() []ResourceEnumOSS {
|
|
return []ResourceEnumOSS{"authorizations", "buckets", "dashboards", "orgs", "sources", "tasks", "telegrafs", "users", "variables", "scrapers", "secrets", "labels", "views", "documents", "notificationRules", "notificationEndpoints", "checks", "dbrp", "notebooks", "annotations", "remotes", "replications"}
|
|
}
|
|
|
|
func (v *ResourceEnumOSS) UnmarshalJSON(src []byte) error {
|
|
var value string
|
|
err := json.Unmarshal(src, &value)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
enumTypeValue := ResourceEnumOSS(value)
|
|
for _, existing := range []ResourceEnumOSS{"authorizations", "buckets", "dashboards", "orgs", "sources", "tasks", "telegrafs", "users", "variables", "scrapers", "secrets", "labels", "views", "documents", "notificationRules", "notificationEndpoints", "checks", "dbrp", "notebooks", "annotations", "remotes", "replications"} {
|
|
if existing == enumTypeValue {
|
|
*v = enumTypeValue
|
|
return nil
|
|
}
|
|
}
|
|
|
|
return fmt.Errorf("%+v is not a valid ResourceEnumOSS", value)
|
|
}
|
|
|
|
// Ptr returns reference to ResourceEnumOSS value
|
|
func (v ResourceEnumOSS) Ptr() *ResourceEnumOSS {
|
|
return &v
|
|
}
|
|
|
|
type NullableResourceEnumOSS struct {
|
|
value *ResourceEnumOSS
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableResourceEnumOSS) Get() *ResourceEnumOSS {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableResourceEnumOSS) Set(val *ResourceEnumOSS) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableResourceEnumOSS) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableResourceEnumOSS) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableResourceEnumOSS(val *ResourceEnumOSS) *NullableResourceEnumOSS {
|
|
return &NullableResourceEnumOSS{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableResourceEnumOSS) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableResourceEnumOSS) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|