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-10-26 13:14:11 +02:00
|
|
|
import "gogs.mikescher.com/BlackForestBytes/goext/enums"
|
2023-04-21 21:45:16 +02:00
|
|
|
|
2024-07-16 17:19:55 +02:00
|
|
|
const ChecksumEnumGenerator = "ba14f2f5d0b0357f248dcbd12933de102c80f1e61be697a37ebb723609fc0c59" // GoExtVersion: 0.0.485
|
2023-04-21 21:45:16 +02:00
|
|
|
|
|
|
|
// ================================ ClientType ================================
|
|
|
|
//
|
|
|
|
// File: client.go
|
|
|
|
// StringEnum: true
|
|
|
|
// DescrEnum: false
|
2024-05-31 15:22:27 +02:00
|
|
|
// DataEnum: false
|
2023-04-21 21:45:16 +02:00
|
|
|
//
|
|
|
|
|
|
|
|
var __ClientTypeValues = []ClientType{
|
2023-06-10 00:15:42 +02:00
|
|
|
ClientTypeAndroid,
|
|
|
|
ClientTypeIOS,
|
2024-05-31 15:22:27 +02:00
|
|
|
ClientTypeLinux,
|
|
|
|
ClientTypeMacOS,
|
|
|
|
ClientTypeWindows,
|
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",
|
2024-05-31 15:22:27 +02:00
|
|
|
ClientTypeLinux: "ClientTypeLinux",
|
|
|
|
ClientTypeMacOS: "ClientTypeMacOS",
|
|
|
|
ClientTypeWindows: "ClientTypeWindows",
|
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
|
|
|
}
|
|
|
|
|
2023-10-26 13:14:11 +02:00
|
|
|
func (e ClientType) ValuesMeta() []enums.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
|
|
|
}
|
|
|
|
|
2024-05-31 15:22:27 +02:00
|
|
|
func (e ClientType) TypeName() string {
|
|
|
|
return "ClientType"
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e ClientType) PackageName() string {
|
|
|
|
return "models"
|
|
|
|
}
|
|
|
|
|
2023-10-26 13:14:11 +02:00
|
|
|
func (e ClientType) Meta() enums.EnumMetaValue {
|
|
|
|
return enums.EnumMetaValue{VarName: e.VarName(), Value: e, Description: nil}
|
2023-07-27 17:44:06 +02:00
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2023-10-26 13:14:11 +02:00
|
|
|
func ClientTypeValuesMeta() []enums.EnumMetaValue {
|
|
|
|
return []enums.EnumMetaValue{
|
2023-07-27 17:44:06 +02:00
|
|
|
ClientTypeAndroid.Meta(),
|
|
|
|
ClientTypeIOS.Meta(),
|
2024-05-31 15:22:27 +02:00
|
|
|
ClientTypeLinux.Meta(),
|
|
|
|
ClientTypeMacOS.Meta(),
|
|
|
|
ClientTypeWindows.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
|
2024-05-31 15:22:27 +02:00
|
|
|
// DataEnum: false
|
2023-04-21 21:45:16 +02:00
|
|
|
//
|
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2023-10-26 13:14:11 +02:00
|
|
|
func (e DeliveryStatus) ValuesMeta() []enums.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
|
|
|
}
|
|
|
|
|
2024-05-31 15:22:27 +02:00
|
|
|
func (e DeliveryStatus) TypeName() string {
|
|
|
|
return "DeliveryStatus"
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e DeliveryStatus) PackageName() string {
|
|
|
|
return "models"
|
|
|
|
}
|
|
|
|
|
2023-10-26 13:14:11 +02:00
|
|
|
func (e DeliveryStatus) Meta() enums.EnumMetaValue {
|
|
|
|
return enums.EnumMetaValue{VarName: e.VarName(), Value: e, Description: nil}
|
2023-07-27 17:44:06 +02:00
|
|
|
}
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2023-10-26 13:14:11 +02:00
|
|
|
func DeliveryStatusValuesMeta() []enums.EnumMetaValue {
|
|
|
|
return []enums.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
|
2024-05-31 15:22:27 +02:00
|
|
|
// DataEnum: false
|
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
|
|
|
}
|
|
|
|
|
2023-10-26 13:14:11 +02:00
|
|
|
func (e TokenPerm) ValuesMeta() []enums.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
|
|
|
}
|
|
|
|
|
2024-05-31 15:22:27 +02:00
|
|
|
func (e TokenPerm) TypeName() string {
|
|
|
|
return "TokenPerm"
|
|
|
|
}
|
|
|
|
|
|
|
|
func (e TokenPerm) PackageName() string {
|
|
|
|
return "models"
|
|
|
|
}
|
|
|
|
|
2023-10-26 13:14:11 +02:00
|
|
|
func (e TokenPerm) Meta() enums.EnumMetaValue {
|
|
|
|
return enums.EnumMetaValue{VarName: e.VarName(), Value: e, Description: langext.Ptr(e.Description())}
|
2023-07-27 17:44:06 +02:00
|
|
|
}
|
|
|
|
|
2024-05-31 15:22:27 +02:00
|
|
|
func (e TokenPerm) DescriptionMeta() enums.EnumDescriptionMetaValue {
|
|
|
|
return enums.EnumDescriptionMetaValue{VarName: e.VarName(), Value: e, Description: 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
|
|
|
}
|
|
|
|
|
2023-10-26 13:14:11 +02:00
|
|
|
func TokenPermValuesMeta() []enums.EnumMetaValue {
|
|
|
|
return []enums.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
|
|
|
}
|
2024-05-31 15:22:27 +02:00
|
|
|
|
|
|
|
func TokenPermValuesDescriptionMeta() []enums.EnumDescriptionMetaValue {
|
|
|
|
return []enums.EnumDescriptionMetaValue{
|
|
|
|
PermAdmin.DescriptionMeta(),
|
|
|
|
PermChannelRead.DescriptionMeta(),
|
|
|
|
PermChannelSend.DescriptionMeta(),
|
|
|
|
PermUserRead.DescriptionMeta(),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// ================================ ================= ================================
|
|
|
|
|
|
|
|
func AllPackageEnums() []enums.Enum {
|
|
|
|
return []enums.Enum{
|
|
|
|
ClientTypeAndroid, // ClientType
|
|
|
|
DeliveryStatusRetry, // DeliveryStatus
|
|
|
|
PermAdmin, // TokenPerm
|
|
|
|
}
|
|
|
|
}
|