Coverage for functions \ flipdare \ generated \ shared \ model \ user \ user_level_type.py: 100%

0 statements  

« prev     ^ index     » next       coverage.py v7.13.0, created at 2026-05-08 12:22 +1000

1#!/usr/bin/env python 

2# 

3# Copyright (c) 2026 Flipdare Pty Ltd. All rights reserved. 

4# 

5# This file is part of Flipdare's proprietary software and contains 

6# confidential and copyrighted material. Unauthorised copying, 

7# modification, distribution, or use of this file is strictly 

8# prohibited without prior written permission from Flipdare Pty Ltd. 

9# 

10# This software includes third-party components licensed under MIT, 

11# BSD, and Apache 2.0 licences. See THIRD_PARTY_NOTICES for details. 

12# 

13# NOTE: THIS FILE IS AUTO GENERATED. DO NOT EDIT. 

14# 

15# Generated by codegen_models.py 

16# 

17# Modify 'codegen_models.py' 

18# and re-run the script above to update. 

19# 

20 

21# pragma: no cover 

22 

23from enum import StrEnum 

24 

25 

26class UserLevelType(StrEnum): 

27 

28 # Declared here so type-checkers know these attributes exist. 

29 # They are populated per-member inside __new__. 

30 _level: int 

31 

32 def __new__( 

33 cls, 

34 code: str, 

35 level: int | None = None, 

36 ) -> "UserLevelType": 

37 obj = str.__new__(cls, code) 

38 obj._value_ = code 

39 # Only set attributes if they are provided (during member definition) 

40 if level is not None: 

41 obj._level = level 

42 return obj 

43 

44 # ---- Members -------------------------------------------------------- 

45 # fmt: off 

46 ROOKIE = ("rookie", 1) 

47 VETERAN = ("veteran", 10) 

48 EXPERT = ("expert", 20) 

49 MASTER = ("master", 30) 

50 LEGEND = ("legend", 40) 

51 GOAT = ("goat", 50) 

52 # fmt: on 

53 # ---- Properties ----------------------------------------------------- 

54 @property 

55 def level(self) -> int: 

56 return self._level