|
20 | 20 | from datetime import datetime |
21 | 21 | from datetime import timedelta |
22 | 22 | from datetime import timezone |
23 | | -from enum import Enum |
24 | 23 | import logging |
25 | 24 | import re |
26 | 25 | from typing import Tuple |
@@ -55,43 +54,6 @@ def _parse_instance_connection_name(connection_name: str) -> Tuple[str, str, str |
55 | 54 | return connection_name_split[1], connection_name_split[3], connection_name_split[4] |
56 | 55 |
|
57 | 56 |
|
58 | | -class RefreshStrategy(Enum): |
59 | | - LAZY: str = "LAZY" |
60 | | - BACKGROUND: str = "BACKGROUND" |
61 | | - |
62 | | - @classmethod |
63 | | - def _missing_(cls, value: object) -> None: |
64 | | - raise ValueError( |
65 | | - f"Incorrect value for refresh_strategy, got '{value}'. Want one of: " |
66 | | - f"{', '.join([repr(m.value) for m in cls])}." |
67 | | - ) |
68 | | - |
69 | | - @classmethod |
70 | | - def _from_str(cls, refresh_strategy: str) -> RefreshStrategy: |
71 | | - """Convert refresh strategy from a str into RefreshStrategy.""" |
72 | | - return cls(refresh_strategy.upper()) |
73 | | - |
74 | | - |
75 | | -class IPTypes(Enum): |
76 | | - PUBLIC: str = "PRIMARY" |
77 | | - PRIVATE: str = "PRIVATE" |
78 | | - PSC: str = "PSC" |
79 | | - |
80 | | - @classmethod |
81 | | - def _missing_(cls, value: object) -> None: |
82 | | - raise ValueError( |
83 | | - f"Incorrect value for ip_type, got '{value}'. Want one of: " |
84 | | - f"{', '.join([repr(m.value) for m in cls])}, 'PUBLIC'." |
85 | | - ) |
86 | | - |
87 | | - @classmethod |
88 | | - def _from_str(cls, ip_type_str: str) -> IPTypes: |
89 | | - """Convert IP type from a str into IPTypes.""" |
90 | | - if ip_type_str.upper() == "PUBLIC": |
91 | | - ip_type_str = "PRIMARY" |
92 | | - return cls(ip_type_str.upper()) |
93 | | - |
94 | | - |
95 | 57 | class RefreshAheadCache: |
96 | 58 | """Cache that refreshes connection info in the background prior to expiration. |
97 | 59 |
|
|
0 commit comments