|
44 | 44 | from .get_connection import GetConnection, GetConnectionConnectionBySlug |
45 | 45 | from .get_file_by_path import GetFileByPath, GetFileByPathGetFileByPath |
46 | 46 | from .get_users import GetUsers, GetUsersUsers |
| 47 | +from .get_webapp_by_slug import GetWebappBySlug, GetWebappBySlugWebapp |
47 | 48 | from .input_types import ( |
48 | 49 | AddToFavoritesInput, |
49 | 50 | ArchiveWorkspaceInput, |
@@ -1093,3 +1094,43 @@ def get_file_by_path( |
1093 | 1094 | ) |
1094 | 1095 | data = self.get_data(response) |
1095 | 1096 | return GetFileByPath.model_validate(data).get_file_by_path |
| 1097 | + |
| 1098 | + def get_webapp_by_slug( |
| 1099 | + self, workspace_slug: str, webapp_slug: str, **kwargs: Any |
| 1100 | + ) -> Optional[GetWebappBySlugWebapp]: |
| 1101 | + query = gql( |
| 1102 | + """ |
| 1103 | + query getWebappBySlug($workspaceSlug: String!, $webappSlug: String!) { |
| 1104 | + webapp(workspaceSlug: $workspaceSlug, slug: $webappSlug) { |
| 1105 | + id |
| 1106 | + name |
| 1107 | + description |
| 1108 | + url |
| 1109 | + icon |
| 1110 | + isFavorite |
| 1111 | + createdBy { |
| 1112 | + id |
| 1113 | + displayName |
| 1114 | + email |
| 1115 | + } |
| 1116 | + workspace { |
| 1117 | + slug |
| 1118 | + name |
| 1119 | + } |
| 1120 | + permissions { |
| 1121 | + update |
| 1122 | + delete |
| 1123 | + } |
| 1124 | + } |
| 1125 | + } |
| 1126 | + """ |
| 1127 | + ) |
| 1128 | + variables: Dict[str, object] = { |
| 1129 | + "workspaceSlug": workspace_slug, |
| 1130 | + "webappSlug": webapp_slug, |
| 1131 | + } |
| 1132 | + response = self.execute( |
| 1133 | + query=query, operation_name="getWebappBySlug", variables=variables, **kwargs |
| 1134 | + ) |
| 1135 | + data = self.get_data(response) |
| 1136 | + return GetWebappBySlug.model_validate(data).webapp |
0 commit comments