SimpleCloudNotifier/scnserver/models/enums_gen.go

236 lines
5.0 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
2023-10-26 13:14:11 +02:00
const ChecksumEnumGenerator = "8926e4a9845e67086109bef7ca447371ab5c0a94fcfd988f14fd4ee98da9e932" // GoExtVersion: 0.0.291
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
}
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
}
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(),
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
}
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
}
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
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
}
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-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
}