|
18 | 18 | __all__ = [
|
19 | 19 | "ProjectEnvironment",
|
20 | 20 | "ProjectEnvironmentManager",
|
| 21 | + "ProjectProtectedEnvironment", |
| 22 | + "ProjectProtectedEnvironmentManager", |
21 | 23 | ]
|
22 | 24 |
|
23 | 25 |
|
@@ -55,3 +57,26 @@ def get(
|
55 | 57 | self, id: Union[str, int], lazy: bool = False, **kwargs: Any
|
56 | 58 | ) -> ProjectEnvironment:
|
57 | 59 | return cast(ProjectEnvironment, super().get(id=id, lazy=lazy, **kwargs))
|
| 60 | + |
| 61 | + |
| 62 | +class ProjectProtectedEnvironment(ObjectDeleteMixin, RESTObject): |
| 63 | + _id_attr = "name" |
| 64 | + _repr_attr = "name" |
| 65 | + |
| 66 | + |
| 67 | +class ProjectProtectedEnvironmentManager( |
| 68 | + RetrieveMixin, CreateMixin, UpdateMixin, DeleteMixin, RESTManager |
| 69 | +): |
| 70 | + _path = "/projects/{project_id}/protected_environments" |
| 71 | + _obj_cls = ProjectProtectedEnvironment |
| 72 | + _from_parent_attrs = {"project_id": "id"} |
| 73 | + _create_attrs = RequiredOptional(required=("name",), optional=("external_url",)) |
| 74 | + _update_attrs = RequiredOptional(optional=("name", "external_url")) |
| 75 | + _list_filters = ("name", "search", "states") |
| 76 | + |
| 77 | + def get( |
| 78 | + self, id: Union[str, int], lazy: bool = False, **kwargs: Any |
| 79 | + ) -> ProjectProtectedEnvironment: |
| 80 | + return cast( |
| 81 | + ProjectProtectedEnvironment, super().get(id=id, lazy=lazy, **kwargs) |
| 82 | + ) |
0 commit comments