2023-06-10 00:15:42 +02:00
|
|
|
// Code generated by enum-generate.go DO NOT EDIT.
|
2023-04-21 21:45:16 +02:00
|
|
|
|
|
|
|
package models
|
|
|
|
|
|
|
|
import "gogs.mikescher.com/BlackForestBytes/goext/langext"
|
|
|
|
|
2023-07-31 20:04:38 +02:00
|
|
|
const ChecksumGenerator = "38908fc9adc16eb3a1266e4bca06e50ebc8613c5d3c9a4fea39314115f66544e"
|
2023-06-10 00:15:42 +02:00
|
|
|
|
2023-04-21 21:45:16 +02:00
|
|
|
type Enum interface {
|
2023-06-10 00:15:42 +02:00
|
|
|
Valid() bool
|
|
|
|
ValuesAny() []any
|
|
|
|
ValuesMeta() []EnumMetaValue
|
|
|
|
VarName() string
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
type StringEnum interface {
|
2023-06-10 00:15:42 +02:00
|
|
|
Enum
|
|
|
|
String() string
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
type DescriptionEnum interface {
|
2023-06-10 00:15:42 +02:00
|
|
|
Enum
|
|
|
|
Description() string
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
type EnumMetaValue struct {
|
2023-06-10 00:15:42 +02:00
|
|
|
VarName string `json:"varName"`
|
|
|
|
Value any `json:"value"`
|
|
|
|
Description *string `json:"description"`
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ================================ ClientType ================================
|
|
|
|
//
|
|
|
|
// File: client.go
|
|
|
|
// StringEnum: true
|
|
|
|
// DescrEnum: false
|
|
|
|
//
|
|
|
|
|
|
|
|
var __ClientTypeValues = []ClientType{
|
2023-06-10 00:15:42 +02:00
|
|
|
ClientTypeAndroid,
|
|
|
|
ClientTypeIOS,
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
var __ClientTypeVarnames = map[ClientType]string{
|
2023-06-10 00:15:42 +02:00
|
|
|
ClientTypeAndroid: "ClientTypeAndroid",
|
|
|
|
ClientTypeIOS: "ClientTypeIOS",
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (e ClientType) Valid() bool {
|
2023-06-10 00:15:42 +02:00
|
|
|
return langext.InArray(e, __ClientTypeValues)
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (e ClientType) Values() []ClientType {
|
2023-06-10 00:15:42 +02:00
|
|
|
return __ClientTypeValues
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (e ClientType) ValuesAny() []any {
|
2023-06-10 00:15:42 +02:00
|
|
|
return langext.ArrCastToAny(__ClientTypeValues)
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (e ClientType) ValuesMeta() []EnumMetaValue {
|
2023-07-27 17:44:06 +02:00
|
|
|
return ClientTypeValuesMeta()
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (e ClientType) String() string {
|
2023-06-10 00:15:42 +02:00
|
|
|
return string(e)
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (e ClientType) VarName() string {
|
2023-06-10 00:15:42 +02:00
|
|
|
if d, ok := __ClientTypeVarnames[e]; ok {
|
|
|
|
return d
|
|
|
|
}
|
|
|
|
return ""
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
2023-07-27 17:44:06 +02:00
|
|
|
func (e ClientType) Meta() EnumMetaValue {
|
|
|
|
return EnumMetaValue{VarName: e.VarName(), Value: e, Description: nil}
|
|
|
|
}
|
|
|
|
|
2023-04-21 21:45:16 +02:00
|
|
|
func ParseClientType(vv string) (ClientType, bool) {
|
2023-06-10 00:15:42 +02:00
|
|
|
for _, ev := range __ClientTypeValues {
|
|
|
|
if string(ev) == vv {
|
|
|
|
return ev, true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return "", false
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func ClientTypeValues() []ClientType {
|
2023-06-10 00:15:42 +02:00
|
|
|
return __ClientTypeValues
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func ClientTypeValuesMeta() []EnumMetaValue {
|
2023-06-10 00:15:42 +02:00
|
|
|
return []EnumMetaValue{
|
2023-07-27 17:44:06 +02:00
|
|
|
ClientTypeAndroid.Meta(),
|
|
|
|
ClientTypeIOS.Meta(),
|
2023-06-10 00:15:42 +02:00
|
|
|
}
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ================================ DeliveryStatus ================================
|
|
|
|
//
|
|
|
|
// File: delivery.go
|
|
|
|
// StringEnum: true
|
|
|
|
// DescrEnum: false
|
|
|
|
//
|
|
|
|
|
|
|
|
var __DeliveryStatusValues = []DeliveryStatus{
|
2023-06-10 00:15:42 +02:00
|
|
|
DeliveryStatusRetry,
|
|
|
|
DeliveryStatusSuccess,
|
|
|
|
DeliveryStatusFailed,
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
var __DeliveryStatusVarnames = map[DeliveryStatus]string{
|
2023-06-10 00:15:42 +02:00
|
|
|
DeliveryStatusRetry: "DeliveryStatusRetry",
|
|
|
|
DeliveryStatusSuccess: "DeliveryStatusSuccess",
|
|
|
|
DeliveryStatusFailed: "DeliveryStatusFailed",
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (e DeliveryStatus) Valid() bool {
|
2023-06-10 00:15:42 +02:00
|
|
|
return langext.InArray(e, __DeliveryStatusValues)
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (e DeliveryStatus) Values() []DeliveryStatus {
|
2023-06-10 00:15:42 +02:00
|
|
|
return __DeliveryStatusValues
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (e DeliveryStatus) ValuesAny() []any {
|
2023-06-10 00:15:42 +02:00
|
|
|
return langext.ArrCastToAny(__DeliveryStatusValues)
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (e DeliveryStatus) ValuesMeta() []EnumMetaValue {
|
2023-07-27 17:44:06 +02:00
|
|
|
return DeliveryStatusValuesMeta()
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (e DeliveryStatus) String() string {
|
2023-06-10 00:15:42 +02:00
|
|
|
return string(e)
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (e DeliveryStatus) VarName() string {
|
2023-06-10 00:15:42 +02:00
|
|
|
if d, ok := __DeliveryStatusVarnames[e]; ok {
|
|
|
|
return d
|
|
|
|
}
|
|
|
|
return ""
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
2023-07-27 17:44:06 +02:00
|
|
|
func (e DeliveryStatus) Meta() EnumMetaValue {
|
|
|
|
return EnumMetaValue{VarName: e.VarName(), Value: e, Description: nil}
|
|
|
|
}
|
|
|
|
|
2023-04-21 21:45:16 +02:00
|
|
|
func ParseDeliveryStatus(vv string) (DeliveryStatus, bool) {
|
2023-06-10 00:15:42 +02:00
|
|
|
for _, ev := range __DeliveryStatusValues {
|
|
|
|
if string(ev) == vv {
|
|
|
|
return ev, true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return "", false
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func DeliveryStatusValues() []DeliveryStatus {
|
2023-06-10 00:15:42 +02:00
|
|
|
return __DeliveryStatusValues
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func DeliveryStatusValuesMeta() []EnumMetaValue {
|
2023-06-10 00:15:42 +02:00
|
|
|
return []EnumMetaValue{
|
2023-07-27 17:44:06 +02:00
|
|
|
DeliveryStatusRetry.Meta(),
|
|
|
|
DeliveryStatusSuccess.Meta(),
|
|
|
|
DeliveryStatusFailed.Meta(),
|
2023-06-10 00:15:42 +02:00
|
|
|
}
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// ================================ TokenPerm ================================
|
|
|
|
//
|
|
|
|
// File: keytoken.go
|
|
|
|
// StringEnum: true
|
2023-05-28 13:39:20 +02:00
|
|
|
// DescrEnum: true
|
2023-04-21 21:45:16 +02:00
|
|
|
//
|
|
|
|
|
|
|
|
var __TokenPermValues = []TokenPerm{
|
2023-06-10 00:15:42 +02:00
|
|
|
PermAdmin,
|
|
|
|
PermChannelRead,
|
|
|
|
PermChannelSend,
|
|
|
|
PermUserRead,
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
2023-05-28 13:39:20 +02:00
|
|
|
var __TokenPermDescriptions = map[TokenPerm]string{
|
2023-06-10 00:15:42 +02:00
|
|
|
PermAdmin: "Edit userdata (+ includes all other permissions)",
|
|
|
|
PermChannelRead: "Read messages",
|
|
|
|
PermChannelSend: "Send messages",
|
|
|
|
PermUserRead: "Read userdata",
|
2023-05-28 13:39:20 +02:00
|
|
|
}
|
|
|
|
|
2023-04-21 21:45:16 +02:00
|
|
|
var __TokenPermVarnames = map[TokenPerm]string{
|
2023-06-10 00:15:42 +02:00
|
|
|
PermAdmin: "PermAdmin",
|
|
|
|
PermChannelRead: "PermChannelRead",
|
|
|
|
PermChannelSend: "PermChannelSend",
|
|
|
|
PermUserRead: "PermUserRead",
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (e TokenPerm) Valid() bool {
|
2023-06-10 00:15:42 +02:00
|
|
|
return langext.InArray(e, __TokenPermValues)
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (e TokenPerm) Values() []TokenPerm {
|
2023-06-10 00:15:42 +02:00
|
|
|
return __TokenPermValues
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (e TokenPerm) ValuesAny() []any {
|
2023-06-10 00:15:42 +02:00
|
|
|
return langext.ArrCastToAny(__TokenPermValues)
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (e TokenPerm) ValuesMeta() []EnumMetaValue {
|
2023-07-27 17:44:06 +02:00
|
|
|
return TokenPermValuesMeta()
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (e TokenPerm) String() string {
|
2023-06-10 00:15:42 +02:00
|
|
|
return string(e)
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
2023-05-28 13:39:20 +02:00
|
|
|
func (e TokenPerm) Description() string {
|
2023-06-10 00:15:42 +02:00
|
|
|
if d, ok := __TokenPermDescriptions[e]; ok {
|
|
|
|
return d
|
|
|
|
}
|
|
|
|
return ""
|
2023-05-28 13:39:20 +02:00
|
|
|
}
|
|
|
|
|
2023-04-21 21:45:16 +02:00
|
|
|
func (e TokenPerm) VarName() string {
|
2023-06-10 00:15:42 +02:00
|
|
|
if d, ok := __TokenPermVarnames[e]; ok {
|
|
|
|
return d
|
|
|
|
}
|
|
|
|
return ""
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
2023-07-27 17:44:06 +02:00
|
|
|
func (e TokenPerm) Meta() EnumMetaValue {
|
|
|
|
return EnumMetaValue{VarName: e.VarName(), Value: e, Description: langext.Ptr(e.Description())}
|
|
|
|
}
|
|
|
|
|
2023-04-21 21:45:16 +02:00
|
|
|
func ParseTokenPerm(vv string) (TokenPerm, bool) {
|
2023-06-10 00:15:42 +02:00
|
|
|
for _, ev := range __TokenPermValues {
|
|
|
|
if string(ev) == vv {
|
|
|
|
return ev, true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return "", false
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func TokenPermValues() []TokenPerm {
|
2023-06-10 00:15:42 +02:00
|
|
|
return __TokenPermValues
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func TokenPermValuesMeta() []EnumMetaValue {
|
2023-06-10 00:15:42 +02:00
|
|
|
return []EnumMetaValue{
|
2023-07-27 17:44:06 +02:00
|
|
|
PermAdmin.Meta(),
|
|
|
|
PermChannelRead.Meta(),
|
|
|
|
PermChannelSend.Meta(),
|
|
|
|
PermUserRead.Meta(),
|
2023-06-10 00:15:42 +02:00
|
|
|
}
|
2023-04-21 21:45:16 +02:00
|
|
|
}
|