SimpleCloudNotifier/scnserver/models/enums_gen.go

376 lines
8.2 KiB
Go
Raw Permalink Normal View History

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
const ChecksumEnumGenerator = "a1b9c4807e1cec4ea2a8b19cd447aa4b47c13f8058a12470dff8eeec895ad8f8" // GoExtVersion: 0.0.513
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 {
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-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{
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 {
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-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{
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 {
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())}
}
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{
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(),
}
}
// ================================ TransactionLockMode ================================
//
// File: lock.go
// StringEnum: true
// DescrEnum: false
// DataEnum: false
//
var __TransactionLockModeValues = []TransactionLockMode{
TLockNone,
TLockRead,
TLockReadWrite,
}
var __TransactionLockModeVarnames = map[TransactionLockMode]string{
TLockNone: "TLockNone",
TLockRead: "TLockRead",
TLockReadWrite: "TLockReadWrite",
}
func (e TransactionLockMode) Valid() bool {
return langext.InArray(e, __TransactionLockModeValues)
}
func (e TransactionLockMode) Values() []TransactionLockMode {
return __TransactionLockModeValues
}
func (e TransactionLockMode) ValuesAny() []any {
return langext.ArrCastToAny(__TransactionLockModeValues)
}
func (e TransactionLockMode) ValuesMeta() []enums.EnumMetaValue {
return TransactionLockModeValuesMeta()
}
func (e TransactionLockMode) String() string {
return string(e)
}
func (e TransactionLockMode) VarName() string {
if d, ok := __TransactionLockModeVarnames[e]; ok {
return d
}
return ""
}
func (e TransactionLockMode) TypeName() string {
return "TransactionLockMode"
}
func (e TransactionLockMode) PackageName() string {
return "models"
}
func (e TransactionLockMode) Meta() enums.EnumMetaValue {
return enums.EnumMetaValue{VarName: e.VarName(), Value: e, Description: nil}
}
func ParseTransactionLockMode(vv string) (TransactionLockMode, bool) {
for _, ev := range __TransactionLockModeValues {
if string(ev) == vv {
return ev, true
}
}
return "", false
}
func TransactionLockModeValues() []TransactionLockMode {
return __TransactionLockModeValues
}
func TransactionLockModeValuesMeta() []enums.EnumMetaValue {
return []enums.EnumMetaValue{
TLockNone.Meta(),
TLockRead.Meta(),
TLockReadWrite.Meta(),
}
}
2024-05-31 15:22:27 +02:00
// ================================ ================= ================================
func AllPackageEnums() []enums.Enum {
return []enums.Enum{
ClientTypeAndroid, // ClientType
DeliveryStatusRetry, // DeliveryStatus
PermAdmin, // TokenPerm
TLockNone, // TransactionLockMode
2024-05-31 15:22:27 +02:00
}
}