maleo-foundation 0.2.86__py3-none-any.whl → 0.2.90__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- maleo_foundation/managers/client/google/storage.py +8 -8
- maleo_foundation/models/schemas/general.py +8 -1
- {maleo_foundation-0.2.86.dist-info → maleo_foundation-0.2.90.dist-info}/METADATA +1 -1
- {maleo_foundation-0.2.86.dist-info → maleo_foundation-0.2.90.dist-info}/RECORD +6 -6
- {maleo_foundation-0.2.86.dist-info → maleo_foundation-0.2.90.dist-info}/WHEEL +0 -0
- {maleo_foundation-0.2.86.dist-info → maleo_foundation-0.2.90.dist-info}/top_level.txt +0 -0
@@ -51,7 +51,7 @@ class GoogleCloudStorage(GoogleClientManager):
|
|
51
51
|
self._client = None
|
52
52
|
self._logger.info("Client manager disposed successfully")
|
53
53
|
|
54
|
-
def upload(
|
54
|
+
async def upload(
|
55
55
|
self,
|
56
56
|
content:bytes,
|
57
57
|
location:str,
|
@@ -59,7 +59,7 @@ class GoogleCloudStorage(GoogleClientManager):
|
|
59
59
|
make_public:bool=False,
|
60
60
|
expiration:BaseEnums=BaseEnums.Expiration.EXP_15MN,
|
61
61
|
root_location_override:BaseTypes.OptionalString=None,
|
62
|
-
set_in_redis:bool=
|
62
|
+
set_in_redis:bool=True
|
63
63
|
) -> str:
|
64
64
|
"""
|
65
65
|
Upload a file to Google Cloud Storage.
|
@@ -93,18 +93,18 @@ class GoogleCloudStorage(GoogleClientManager):
|
|
93
93
|
|
94
94
|
if set_in_redis:
|
95
95
|
if make_public:
|
96
|
-
self._redis.set(f"{self.key}:{blob_name}", url)
|
96
|
+
await self._redis.set(f"{self.key}:{blob_name}", url)
|
97
97
|
else:
|
98
|
-
self._redis.set(f"{self.key}:{blob_name}", url, ex=int(expiration))
|
98
|
+
await self._redis.set(f"{self.key}:{blob_name}", url, ex=int(expiration))
|
99
99
|
|
100
100
|
return url
|
101
101
|
|
102
|
-
def generate_signed_url(
|
102
|
+
async def generate_signed_url(
|
103
103
|
self,
|
104
104
|
location:str,
|
105
105
|
expiration:BaseEnums=BaseEnums.Expiration.EXP_15MN,
|
106
106
|
root_location_override:BaseTypes.OptionalString=None,
|
107
|
-
use_redis:bool=
|
107
|
+
use_redis:bool=True
|
108
108
|
) -> str:
|
109
109
|
"""
|
110
110
|
generate signed URL of a file in the bucket based on its location.
|
@@ -134,7 +134,7 @@ class GoogleCloudStorage(GoogleClientManager):
|
|
134
134
|
if use_redis:
|
135
135
|
if self._redis is None:
|
136
136
|
raise ValueError("Can not use redis. Redis is not initialized")
|
137
|
-
url = self._redis.get(blob_name)
|
137
|
+
url = await self._redis.get(blob_name)
|
138
138
|
if url is not None:
|
139
139
|
return url
|
140
140
|
|
@@ -143,5 +143,5 @@ class GoogleCloudStorage(GoogleClientManager):
|
|
143
143
|
expiration=timedelta(seconds=int(expiration)),
|
144
144
|
method="GET"
|
145
145
|
)
|
146
|
-
self._redis.set(f"{self.key}:{blob_name}", url, ex=int(expiration))
|
146
|
+
await self._redis.set(f"{self.key}:{blob_name}", url, ex=int(expiration))
|
147
147
|
return url
|
@@ -24,14 +24,21 @@ class BaseGeneralSchemas:
|
|
24
24
|
id:int = Field(..., ge=1, description="Data's ID, must be >= 1.")
|
25
25
|
uuid:UUID = Field(..., description="Data's UUID.")
|
26
26
|
|
27
|
-
class
|
27
|
+
class EssentialTimestamps(BaseModel):
|
28
28
|
created_at:datetime = Field(..., description="Data's created_at timestamp")
|
29
29
|
updated_at:datetime = Field(..., description="Data's updated_at timestamp")
|
30
|
+
|
31
|
+
class StatusTimestamps(BaseModel):
|
30
32
|
deleted_at:BaseTypes.OptionalDatetime = Field(..., description="Data's deleted_at timestamp")
|
31
33
|
restored_at:BaseTypes.OptionalDatetime = Field(..., description="Data's restored_at timestamp")
|
32
34
|
deactivated_at:BaseTypes.OptionalDatetime = Field(..., description="Data's deactivated_at timestamp")
|
33
35
|
activated_at:datetime = Field(..., description="Data's activated_at timestamp")
|
34
36
|
|
37
|
+
class Timestamps(
|
38
|
+
StatusTimestamps,
|
39
|
+
EssentialTimestamps
|
40
|
+
): pass
|
41
|
+
|
35
42
|
class Status(BaseModel):
|
36
43
|
status:BaseEnums.StatusType = Field(..., description="Data's status")
|
37
44
|
|
@@ -45,7 +45,7 @@ maleo_foundation/managers/client/google/__init__.py,sha256=47DEQpj8HBSa-_TImW-5J
|
|
45
45
|
maleo_foundation/managers/client/google/base.py,sha256=eIdd6C2BFIu4EyZ1j017VZaJn_nSTPGFftBwQmVAUDA,1366
|
46
46
|
maleo_foundation/managers/client/google/parameter.py,sha256=Lnj7mQgxWQpsQwbmDRK5_bF01M1QpM5PS0eZP2q17yQ,1337
|
47
47
|
maleo_foundation/managers/client/google/secret.py,sha256=Ski1CHYeA8vjSk2Oc2Pf4CfFrzT_RcA6NEZwza7gM7Y,4464
|
48
|
-
maleo_foundation/managers/client/google/storage.py,sha256=
|
48
|
+
maleo_foundation/managers/client/google/storage.py,sha256=lDJNCbH-OMU51mBBtTTl9Yrzs-aE44bf0UAv6fzhbzw,5374
|
49
49
|
maleo_foundation/middlewares/authentication.py,sha256=UL6kL65SvqrzemlIDopoO9N1C05eWlYMHVR2tiRsVEA,4821
|
50
50
|
maleo_foundation/middlewares/base.py,sha256=LhsLbZARC4lwGpaIeCfhHFa4YbN3210JnmUEKSTDZW0,16299
|
51
51
|
maleo_foundation/middlewares/cors.py,sha256=9uvBvY2N6Vxa9RP_YtESxcWo6Doi6uS0lzAG9iLY7Uc,2288
|
@@ -54,7 +54,7 @@ maleo_foundation/models/responses.py,sha256=nE5qThK-WgcYB-9J4wHzJltMA3PLmWbMI-dk
|
|
54
54
|
maleo_foundation/models/table.py,sha256=yFv9KAr0kp-QqfIFEPXqRn61pQKCCIory1zEL7Y7rVc,1873
|
55
55
|
maleo_foundation/models/schemas/__init__.py,sha256=Xj8Ahsqyra-fmEaVcGPok5GOOsPQlKcknHYMvbjvENA,277
|
56
56
|
maleo_foundation/models/schemas/encryption.py,sha256=KYs2P57AqWpEROuqTuSuyt1Zk-jsIUKFeRWIfSwem74,658
|
57
|
-
maleo_foundation/models/schemas/general.py,sha256=
|
57
|
+
maleo_foundation/models/schemas/general.py,sha256=jzX5_F6peqrWNxlrZaQWvG6nJaLCmNq6McNWyHrULBg,3809
|
58
58
|
maleo_foundation/models/schemas/hash.py,sha256=db2uyCeUzvF2zDCcbiZMh1MxIOGOGezOMOx-M1ta4zI,441
|
59
59
|
maleo_foundation/models/schemas/key.py,sha256=7FZxVqTL5qRK48AXL1odrMNhAwhwtCwSkBUPsJwuBII,594
|
60
60
|
maleo_foundation/models/schemas/parameter.py,sha256=6jVHw538cnCK-SN8SlPVKWakeeJGn3yRNzHegR231j8,3497
|
@@ -119,7 +119,7 @@ maleo_foundation/utils/loaders/credential/__init__.py,sha256=qopTKvcMVoTFwyRijeg
|
|
119
119
|
maleo_foundation/utils/loaders/credential/google.py,sha256=HUcuHD4tXHPt0eHInlFYxA_MDrGSOtbenpd0PX156OM,1255
|
120
120
|
maleo_foundation/utils/loaders/key/__init__.py,sha256=hVygcC2ImHc_aVrSrOmyedR8tMUZokWUKCKOSh5ctbo,106
|
121
121
|
maleo_foundation/utils/loaders/key/rsa.py,sha256=gDhyX6iTFtHiluuhFCozaZ3pOLKU2Y9TlrNMK_GVyGU,3796
|
122
|
-
maleo_foundation-0.2.
|
123
|
-
maleo_foundation-0.2.
|
124
|
-
maleo_foundation-0.2.
|
125
|
-
maleo_foundation-0.2.
|
122
|
+
maleo_foundation-0.2.90.dist-info/METADATA,sha256=1RWvQ_KygG0kv0zWFBTsH7ztBwkCI_-PKGimmJiJscs,3598
|
123
|
+
maleo_foundation-0.2.90.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
124
|
+
maleo_foundation-0.2.90.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
|
125
|
+
maleo_foundation-0.2.90.dist-info/RECORD,,
|
File without changes
|
File without changes
|