feat: all-access and operator token from CLI (#285)
* chore: include enum values in openapi generated code * chore: add enum template to list of template overrides * chore: update template and generated code * feat: generate permissions list from openapi spec * feat: all-access and operator token from CLI Closes #22510 * fix: cloud fixed the resources endpoint * fix: all access and operator permissions cannot be composed * fix: review comments from dan-moran
This commit is contained in:
104
api/extras/model_resource_enum_oss.gen.go
Normal file
104
api/extras/model_resource_enum_oss.gen.go
Normal file
@ -0,0 +1,104 @@
|
||||
/*
|
||||
* 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"
|
||||
)
|
||||
|
||||
func ResourceEnumOSSValues() []ResourceEnumOSS {
|
||||
return []ResourceEnumOSS{"authorizations", "buckets", "dashboards", "orgs", "sources", "tasks", "telegrafs", "users", "variables", "scrapers", "secrets", "labels", "views", "documents", "notificationRules", "notificationEndpoints", "checks", "dbrp", "notebooks"}
|
||||
}
|
||||
|
||||
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"} {
|
||||
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)
|
||||
}
|
Reference in New Issue
Block a user