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_cloud.gen.go
Normal file
104
api/extras/model_resource_enum_cloud.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"
|
||||
)
|
||||
|
||||
// ResourceEnumCloud the model 'ResourceEnumCloud'
|
||||
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_FLOWS ResourceEnumCloud = "flows"
|
||||
RESOURCEENUMCLOUD_ANNOTATIONS ResourceEnumCloud = "annotations"
|
||||
RESOURCEENUMCLOUD_FUNCTIONS ResourceEnumCloud = "functions"
|
||||
)
|
||||
|
||||
func ResourceEnumCloudValues() []ResourceEnumCloud {
|
||||
return []ResourceEnumCloud{"authorizations", "buckets", "dashboards", "orgs", "tasks", "telegrafs", "users", "variables", "secrets", "labels", "views", "documents", "notificationRules", "notificationEndpoints", "checks", "dbrp", "flows", "annotations", "functions"}
|
||||
}
|
||||
|
||||
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", "flows", "annotations", "functions"} {
|
||||
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)
|
||||
}
|
Reference in New Issue
Block a user