Skip to content

Commit d75adef

Browse files
authored
refactor(secret): rename EphemeralStatus to EphemeralProperties (#404)
1 parent 5b98b20 commit d75adef

File tree

8 files changed

+86
-86
lines changed

8 files changed

+86
-86
lines changed

scaleway-async/scaleway_async/secret/v1alpha1/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from .types import SecretVersionStatus
1010
from .types import AccessSecretVersionResponse
1111
from .types import EphemeralPolicy
12-
from .types import EphemeralStatus
12+
from .types import EphemeralProperties
1313
from .types import Folder
1414
from .types import ListFoldersResponse
1515
from .types import ListSecretVersionsResponse
@@ -30,7 +30,7 @@
3030
"SecretVersionStatus",
3131
"AccessSecretVersionResponse",
3232
"EphemeralPolicy",
33-
"EphemeralStatus",
33+
"EphemeralProperties",
3434
"Folder",
3535
"ListFoldersResponse",
3636
"ListSecretVersionsResponse",

scaleway-async/scaleway_async/secret/v1alpha1/api.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
SecretVersionStatus,
2020
AccessSecretVersionResponse,
2121
EphemeralPolicy,
22-
EphemeralStatus,
22+
EphemeralProperties,
2323
Folder,
2424
ListFoldersResponse,
2525
ListSecretVersionsResponse,
@@ -73,7 +73,7 @@ async def create_secret(
7373
tags: Optional[List[str]] = None,
7474
description: Optional[str] = None,
7575
path: Optional[str] = None,
76-
ephemeral_policy_template: Optional[EphemeralPolicy] = None,
76+
ephemeral_policy: Optional[EphemeralPolicy] = None,
7777
) -> Secret:
7878
"""
7979
Create a secret.
@@ -87,7 +87,7 @@ async def create_secret(
8787
(Optional.) See `Secret.Type` enum for description of values. If not specified, the type is `Opaque`.
8888
:param path: Path of the secret.
8989
(Optional.) Location of the secret in the directory structure. If not specified, the path is `/`.
90-
:param ephemeral_policy_template: Ephemeral policy of the secret.
90+
:param ephemeral_policy: Ephemeral policy of the secret.
9191
(Optional.) Policy that defines whether/when a secret's versions expire. By default, the policy is applied to all the secret's versions.
9292
:return: :class:`Secret <Secret>`
9393
@@ -116,7 +116,7 @@ async def create_secret(
116116
tags=tags,
117117
description=description,
118118
path=path,
119-
ephemeral_policy_template=ephemeral_policy_template,
119+
ephemeral_policy=ephemeral_policy,
120120
),
121121
self.client,
122122
),
@@ -253,7 +253,7 @@ async def update_secret(
253253
tags: Optional[List[str]] = None,
254254
description: Optional[str] = None,
255255
path: Optional[str] = None,
256-
ephemeral_policy_template: Optional[EphemeralPolicy] = None,
256+
ephemeral_policy: Optional[EphemeralPolicy] = None,
257257
) -> Secret:
258258
"""
259259
Update metadata of a secret.
@@ -265,7 +265,7 @@ async def update_secret(
265265
:param description: Description of the secret.
266266
:param path: Path of the folder.
267267
(Optional.) Location of the folder in the directory structure. If not specified, the path is `/`.
268-
:param ephemeral_policy_template: Ephemeral policy of the secret.
268+
:param ephemeral_policy: Ephemeral policy of the secret.
269269
(Optional.) Policy that defines whether/when a secret's versions expire.
270270
:return: :class:`Secret <Secret>`
271271
@@ -291,7 +291,7 @@ async def update_secret(
291291
tags=tags,
292292
description=description,
293293
path=path,
294-
ephemeral_policy_template=ephemeral_policy_template,
294+
ephemeral_policy=ephemeral_policy,
295295
),
296296
self.client,
297297
),
@@ -905,7 +905,7 @@ async def update_secret_version(
905905
revision: str,
906906
region: Optional[Region] = None,
907907
description: Optional[str] = None,
908-
ephemeral_status: Optional[EphemeralStatus] = None,
908+
ephemeral_properties: Optional[EphemeralProperties] = None,
909909
) -> SecretVersion:
910910
"""
911911
Update metadata of a version.
@@ -918,8 +918,8 @@ async def update_secret_version(
918918
- "latest" (the latest revision)
919919
- "latest_enabled" (the latest enabled revision).
920920
:param description: Description of the version.
921-
:param ephemeral_status: Ephemeral status of the version.
922-
(Optional.) Status that defines the version's expiration date, whether it expires after being accessed once, and the action to perform (disable or delete) once the version expires.
921+
:param ephemeral_properties: Ephemeral properties of the version.
922+
(Optional.) Properties that defines the version's expiration date, whether it expires after being accessed once, and the action to perform (disable or delete) once the version expires.
923923
:return: :class:`SecretVersion <SecretVersion>`
924924
925925
Usage:
@@ -946,7 +946,7 @@ async def update_secret_version(
946946
revision=revision,
947947
region=region,
948948
description=description,
949-
ephemeral_status=ephemeral_status,
949+
ephemeral_properties=ephemeral_properties,
950950
),
951951
self.client,
952952
),

scaleway-async/scaleway_async/secret/v1alpha1/marshalling.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
SecretType,
1616
AccessSecretVersionResponse,
1717
EphemeralPolicy,
18-
EphemeralStatus,
18+
EphemeralProperties,
1919
Folder,
2020
ListFoldersResponse,
2121
ListSecretVersionsResponse,
@@ -54,10 +54,10 @@ def unmarshal_EphemeralPolicy(data: Any) -> EphemeralPolicy:
5454
return EphemeralPolicy(**args)
5555

5656

57-
def unmarshal_EphemeralStatus(data: Any) -> EphemeralStatus:
57+
def unmarshal_EphemeralProperties(data: Any) -> EphemeralProperties:
5858
if type(data) is not dict:
5959
raise TypeError(
60-
f"Unmarshalling the type 'EphemeralStatus' failed as data isn't a dictionary."
60+
f"Unmarshalling the type 'EphemeralProperties' failed as data isn't a dictionary."
6161
)
6262

6363
args: Dict[str, Any] = {}
@@ -71,7 +71,7 @@ def unmarshal_EphemeralStatus(data: Any) -> EphemeralStatus:
7171
field = data.get("expires_once_accessed", None)
7272
args["expires_once_accessed"] = field
7373

74-
return EphemeralStatus(**args)
74+
return EphemeralProperties(**args)
7575

7676

7777
def unmarshal_Folder(data: Any) -> Folder:
@@ -117,8 +117,8 @@ def unmarshal_Secret(data: Any) -> Secret:
117117
field = data.get("description", None)
118118
args["description"] = field
119119

120-
field = data.get("ephemeral_policy_template", None)
121-
args["ephemeral_policy_template"] = (
120+
field = data.get("ephemeral_policy", None)
121+
args["ephemeral_policy"] = (
122122
unmarshal_EphemeralPolicy(field) if field is not None else None
123123
)
124124

@@ -175,9 +175,9 @@ def unmarshal_SecretVersion(data: Any) -> SecretVersion:
175175
field = data.get("description", None)
176176
args["description"] = field
177177

178-
field = data.get("ephemeral_status", None)
179-
args["ephemeral_status"] = (
180-
unmarshal_EphemeralStatus(field) if field is not None else None
178+
field = data.get("ephemeral_properties", None)
179+
args["ephemeral_properties"] = (
180+
unmarshal_EphemeralProperties(field) if field is not None else None
181181
)
182182

183183
field = data.get("is_latest", None)
@@ -313,8 +313,8 @@ def marshal_EphemeralPolicy(
313313
return output
314314

315315

316-
def marshal_EphemeralStatus(
317-
request: EphemeralStatus,
316+
def marshal_EphemeralProperties(
317+
request: EphemeralProperties,
318318
defaults: ProfileDefaults,
319319
) -> Dict[str, Any]:
320320
output: Dict[str, Any] = {}
@@ -397,9 +397,9 @@ def marshal_CreateSecretRequest(
397397
if request.description is not None:
398398
output["description"] = request.description
399399

400-
if request.ephemeral_policy_template is not None:
401-
output["ephemeral_policy_template"] = marshal_EphemeralPolicy(
402-
request.ephemeral_policy_template, defaults
400+
if request.ephemeral_policy is not None:
401+
output["ephemeral_policy"] = marshal_EphemeralPolicy(
402+
request.ephemeral_policy, defaults
403403
)
404404

405405
if request.name is not None:
@@ -494,9 +494,9 @@ def marshal_UpdateSecretRequest(
494494
if request.description is not None:
495495
output["description"] = request.description
496496

497-
if request.ephemeral_policy_template is not None:
498-
output["ephemeral_policy_template"] = marshal_EphemeralPolicy(
499-
request.ephemeral_policy_template, defaults
497+
if request.ephemeral_policy is not None:
498+
output["ephemeral_policy"] = marshal_EphemeralPolicy(
499+
request.ephemeral_policy, defaults
500500
)
501501

502502
if request.name is not None:
@@ -520,9 +520,9 @@ def marshal_UpdateSecretVersionRequest(
520520
if request.description is not None:
521521
output["description"] = request.description
522522

523-
if request.ephemeral_status is not None:
524-
output["ephemeral_status"] = marshal_EphemeralStatus(
525-
request.ephemeral_status, defaults
523+
if request.ephemeral_properties is not None:
524+
output["ephemeral_properties"] = marshal_EphemeralProperties(
525+
request.ephemeral_properties, defaults
526526
)
527527

528528
return output

scaleway-async/scaleway_async/secret/v1alpha1/types.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ class EphemeralPolicy:
135135

136136

137137
@dataclass
138-
class EphemeralStatus:
138+
class EphemeralProperties:
139139
"""
140-
Ephemeral status.
140+
Ephemeral properties.
141141
"""
142142

143143
expires_at: Optional[datetime]
@@ -372,7 +372,7 @@ class Secret:
372372
Location of the secret in the directory structure.
373373
"""
374374

375-
ephemeral_policy_template: Optional[EphemeralPolicy]
375+
ephemeral_policy: Optional[EphemeralPolicy]
376376
"""
377377
Ephemeral policy of the secret.
378378
(Optional.) Policy that defines whether/when a secret's versions expire. By default, the policy is applied to all the secret's versions.
@@ -430,9 +430,9 @@ class SecretVersion:
430430
Returns `true` if the version is the latest.
431431
"""
432432

433-
ephemeral_status: Optional[EphemeralStatus]
433+
ephemeral_properties: Optional[EphemeralProperties]
434434
"""
435-
Status of the ephemeral version.
435+
Properties of the ephemeral version.
436436
Returns the version's expiration date, whether it expires after being accessed once, and the action to perform (disable or delete) once the version expires.
437437
"""
438438

@@ -476,7 +476,7 @@ class CreateSecretRequest:
476476
(Optional.) Location of the secret in the directory structure. If not specified, the path is `/`.
477477
"""
478478

479-
ephemeral_policy_template: Optional[EphemeralPolicy]
479+
ephemeral_policy: Optional[EphemeralPolicy]
480480
"""
481481
Ephemeral policy of the secret.
482482
(Optional.) Policy that defines whether/when a secret's versions expire. By default, the policy is applied to all the secret's versions.
@@ -572,7 +572,7 @@ class UpdateSecretRequest:
572572
(Optional.) Location of the folder in the directory structure. If not specified, the path is `/`.
573573
"""
574574

575-
ephemeral_policy_template: Optional[EphemeralPolicy]
575+
ephemeral_policy: Optional[EphemeralPolicy]
576576
"""
577577
Ephemeral policy of the secret.
578578
(Optional.) Policy that defines whether/when a secret's versions expire.
@@ -898,10 +898,10 @@ class UpdateSecretVersionRequest:
898898
Description of the version.
899899
"""
900900

901-
ephemeral_status: Optional[EphemeralStatus]
901+
ephemeral_properties: Optional[EphemeralProperties]
902902
"""
903-
Ephemeral status of the version.
904-
(Optional.) Status that defines the version's expiration date, whether it expires after being accessed once, and the action to perform (disable or delete) once the version expires.
903+
Ephemeral properties of the version.
904+
(Optional.) Properties that defines the version's expiration date, whether it expires after being accessed once, and the action to perform (disable or delete) once the version expires.
905905
"""
906906

907907

scaleway/scaleway/secret/v1alpha1/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from .types import SecretVersionStatus
1010
from .types import AccessSecretVersionResponse
1111
from .types import EphemeralPolicy
12-
from .types import EphemeralStatus
12+
from .types import EphemeralProperties
1313
from .types import Folder
1414
from .types import ListFoldersResponse
1515
from .types import ListSecretVersionsResponse
@@ -30,7 +30,7 @@
3030
"SecretVersionStatus",
3131
"AccessSecretVersionResponse",
3232
"EphemeralPolicy",
33-
"EphemeralStatus",
33+
"EphemeralProperties",
3434
"Folder",
3535
"ListFoldersResponse",
3636
"ListSecretVersionsResponse",

scaleway/scaleway/secret/v1alpha1/api.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
SecretVersionStatus,
2020
AccessSecretVersionResponse,
2121
EphemeralPolicy,
22-
EphemeralStatus,
22+
EphemeralProperties,
2323
Folder,
2424
ListFoldersResponse,
2525
ListSecretVersionsResponse,
@@ -73,7 +73,7 @@ def create_secret(
7373
tags: Optional[List[str]] = None,
7474
description: Optional[str] = None,
7575
path: Optional[str] = None,
76-
ephemeral_policy_template: Optional[EphemeralPolicy] = None,
76+
ephemeral_policy: Optional[EphemeralPolicy] = None,
7777
) -> Secret:
7878
"""
7979
Create a secret.
@@ -87,7 +87,7 @@ def create_secret(
8787
(Optional.) See `Secret.Type` enum for description of values. If not specified, the type is `Opaque`.
8888
:param path: Path of the secret.
8989
(Optional.) Location of the secret in the directory structure. If not specified, the path is `/`.
90-
:param ephemeral_policy_template: Ephemeral policy of the secret.
90+
:param ephemeral_policy: Ephemeral policy of the secret.
9191
(Optional.) Policy that defines whether/when a secret's versions expire. By default, the policy is applied to all the secret's versions.
9292
:return: :class:`Secret <Secret>`
9393
@@ -116,7 +116,7 @@ def create_secret(
116116
tags=tags,
117117
description=description,
118118
path=path,
119-
ephemeral_policy_template=ephemeral_policy_template,
119+
ephemeral_policy=ephemeral_policy,
120120
),
121121
self.client,
122122
),
@@ -253,7 +253,7 @@ def update_secret(
253253
tags: Optional[List[str]] = None,
254254
description: Optional[str] = None,
255255
path: Optional[str] = None,
256-
ephemeral_policy_template: Optional[EphemeralPolicy] = None,
256+
ephemeral_policy: Optional[EphemeralPolicy] = None,
257257
) -> Secret:
258258
"""
259259
Update metadata of a secret.
@@ -265,7 +265,7 @@ def update_secret(
265265
:param description: Description of the secret.
266266
:param path: Path of the folder.
267267
(Optional.) Location of the folder in the directory structure. If not specified, the path is `/`.
268-
:param ephemeral_policy_template: Ephemeral policy of the secret.
268+
:param ephemeral_policy: Ephemeral policy of the secret.
269269
(Optional.) Policy that defines whether/when a secret's versions expire.
270270
:return: :class:`Secret <Secret>`
271271
@@ -291,7 +291,7 @@ def update_secret(
291291
tags=tags,
292292
description=description,
293293
path=path,
294-
ephemeral_policy_template=ephemeral_policy_template,
294+
ephemeral_policy=ephemeral_policy,
295295
),
296296
self.client,
297297
),
@@ -905,7 +905,7 @@ def update_secret_version(
905905
revision: str,
906906
region: Optional[Region] = None,
907907
description: Optional[str] = None,
908-
ephemeral_status: Optional[EphemeralStatus] = None,
908+
ephemeral_properties: Optional[EphemeralProperties] = None,
909909
) -> SecretVersion:
910910
"""
911911
Update metadata of a version.
@@ -918,8 +918,8 @@ def update_secret_version(
918918
- "latest" (the latest revision)
919919
- "latest_enabled" (the latest enabled revision).
920920
:param description: Description of the version.
921-
:param ephemeral_status: Ephemeral status of the version.
922-
(Optional.) Status that defines the version's expiration date, whether it expires after being accessed once, and the action to perform (disable or delete) once the version expires.
921+
:param ephemeral_properties: Ephemeral properties of the version.
922+
(Optional.) Properties that defines the version's expiration date, whether it expires after being accessed once, and the action to perform (disable or delete) once the version expires.
923923
:return: :class:`SecretVersion <SecretVersion>`
924924
925925
Usage:
@@ -946,7 +946,7 @@ def update_secret_version(
946946
revision=revision,
947947
region=region,
948948
description=description,
949-
ephemeral_status=ephemeral_status,
949+
ephemeral_properties=ephemeral_properties,
950950
),
951951
self.client,
952952
),

0 commit comments

Comments
 (0)