|
12 | 12 | "GitlabciymlManager",
|
13 | 13 | "License",
|
14 | 14 | "LicenseManager",
|
| 15 | + "ProjectDockerfileTemplate", |
| 16 | + "ProjectDockerfileTemplateManager", |
| 17 | + "ProjectGitignoreTemplate", |
| 18 | + "ProjectGitignoreTemplateManager", |
| 19 | + "ProjectGitlabciymlTemplate", |
| 20 | + "ProjectGitlabciymlTemplateManager", |
| 21 | + "ProjectIssueTemplate", |
| 22 | + "ProjectIssueTemplateManager", |
| 23 | + "ProjectLicenseTemplate", |
| 24 | + "ProjectLicenseTemplateManager", |
| 25 | + "ProjectMergeRequestTemplate", |
| 26 | + "ProjectMergeRequestTemplateManager", |
15 | 27 | ]
|
16 | 28 |
|
17 | 29 |
|
@@ -65,3 +77,95 @@ class LicenseManager(RetrieveMixin, RESTManager):
|
65 | 77 |
|
66 | 78 | def get(self, id: Union[str, int], lazy: bool = False, **kwargs: Any) -> License:
|
67 | 79 | return cast(License, super().get(id=id, lazy=lazy, **kwargs))
|
| 80 | + |
| 81 | + |
| 82 | +class ProjectDockerfileTemplate(RESTObject): |
| 83 | + _id_attr = "name" |
| 84 | + |
| 85 | + |
| 86 | +class ProjectDockerfileTemplateManager(RetrieveMixin, RESTManager): |
| 87 | + _path = "/projects/{project_id}/templates/dockerfiles" |
| 88 | + _obj_cls = ProjectDockerfileTemplate |
| 89 | + _from_parent_attrs = {"project_id": "id"} |
| 90 | + |
| 91 | + def get( |
| 92 | + self, id: Union[str, int], lazy: bool = False, **kwargs: Any |
| 93 | + ) -> ProjectDockerfileTemplate: |
| 94 | + return cast(ProjectDockerfileTemplate, super().get(id=id, lazy=lazy, **kwargs)) |
| 95 | + |
| 96 | + |
| 97 | +class ProjectGitignoreTemplate(RESTObject): |
| 98 | + _id_attr = "name" |
| 99 | + |
| 100 | + |
| 101 | +class ProjectGitignoreTemplateManager(RetrieveMixin, RESTManager): |
| 102 | + _path = "/projects/{project_id}/templates/gitignores" |
| 103 | + _obj_cls = ProjectGitignoreTemplate |
| 104 | + _from_parent_attrs = {"project_id": "id"} |
| 105 | + |
| 106 | + def get( |
| 107 | + self, id: Union[str, int], lazy: bool = False, **kwargs: Any |
| 108 | + ) -> ProjectGitignoreTemplate: |
| 109 | + return cast(ProjectGitignoreTemplate, super().get(id=id, lazy=lazy, **kwargs)) |
| 110 | + |
| 111 | + |
| 112 | +class ProjectGitlabciymlTemplate(RESTObject): |
| 113 | + _id_attr = "name" |
| 114 | + |
| 115 | + |
| 116 | +class ProjectGitlabciymlTemplateManager(RetrieveMixin, RESTManager): |
| 117 | + _path = "/projects/{project_id}/templates/gitlab_ci_ymls" |
| 118 | + _obj_cls = ProjectGitlabciymlTemplate |
| 119 | + _from_parent_attrs = {"project_id": "id"} |
| 120 | + |
| 121 | + def get( |
| 122 | + self, id: Union[str, int], lazy: bool = False, **kwargs: Any |
| 123 | + ) -> ProjectGitlabciymlTemplate: |
| 124 | + return cast(ProjectGitlabciymlTemplate, super().get(id=id, lazy=lazy, **kwargs)) |
| 125 | + |
| 126 | + |
| 127 | +class ProjectLicenseTemplate(RESTObject): |
| 128 | + _id_attr = "key" |
| 129 | + |
| 130 | + |
| 131 | +class ProjectLicenseTemplateManager(RetrieveMixin, RESTManager): |
| 132 | + _path = "/projects/{project_id}/templates/licenses" |
| 133 | + _obj_cls = ProjectLicenseTemplate |
| 134 | + _from_parent_attrs = {"project_id": "id"} |
| 135 | + |
| 136 | + def get( |
| 137 | + self, id: Union[str, int], lazy: bool = False, **kwargs: Any |
| 138 | + ) -> ProjectLicenseTemplate: |
| 139 | + return cast(ProjectLicenseTemplate, super().get(id=id, lazy=lazy, **kwargs)) |
| 140 | + |
| 141 | + |
| 142 | +class ProjectIssueTemplate(RESTObject): |
| 143 | + _id_attr = "name" |
| 144 | + |
| 145 | + |
| 146 | +class ProjectIssueTemplateManager(RetrieveMixin, RESTManager): |
| 147 | + _path = "/projects/{project_id}/templates/issues" |
| 148 | + _obj_cls = ProjectIssueTemplate |
| 149 | + _from_parent_attrs = {"project_id": "id"} |
| 150 | + |
| 151 | + def get( |
| 152 | + self, id: Union[str, int], lazy: bool = False, **kwargs: Any |
| 153 | + ) -> ProjectIssueTemplate: |
| 154 | + return cast(ProjectIssueTemplate, super().get(id=id, lazy=lazy, **kwargs)) |
| 155 | + |
| 156 | + |
| 157 | +class ProjectMergeRequestTemplate(RESTObject): |
| 158 | + _id_attr = "name" |
| 159 | + |
| 160 | + |
| 161 | +class ProjectMergeRequestTemplateManager(RetrieveMixin, RESTManager): |
| 162 | + _path = "/projects/{project_id}/templates/merge_requests" |
| 163 | + _obj_cls = ProjectMergeRequestTemplate |
| 164 | + _from_parent_attrs = {"project_id": "id"} |
| 165 | + |
| 166 | + def get( |
| 167 | + self, id: Union[str, int], lazy: bool = False, **kwargs: Any |
| 168 | + ) -> ProjectMergeRequestTemplate: |
| 169 | + return cast( |
| 170 | + ProjectMergeRequestTemplate, super().get(id=id, lazy=lazy, **kwargs) |
| 171 | + ) |
0 commit comments