windmill-api 1.478.0__py3-none-any.whl → 1.479.0__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.

Potentially problematic release.


This version of windmill-api might be problematic. Click here for more details.

Files changed (118) hide show
  1. windmill_api/api/app/list_app_paths_from_workspace_runnable.py +176 -0
  2. windmill_api/api/git_sync/__init__.py +0 -0
  3. windmill_api/api/git_sync/delete_from_workspace.py +107 -0
  4. windmill_api/api/git_sync/export_installation.py +174 -0
  5. windmill_api/api/git_sync/get_global_connected_repositories.py +131 -0
  6. windmill_api/api/git_sync/import_installation.py +111 -0
  7. windmill_api/api/{workspace/set_automatic_billing.py → git_sync/install_from_workspace.py} +11 -9
  8. windmill_api/api/script/list_script_paths_from_workspace_runnable.py +161 -0
  9. windmill_api/api/workspace/get_copilot_info.py +65 -6
  10. windmill_api/api/workspace/get_github_app_token.py +170 -0
  11. windmill_api/models/ai_config.py +107 -0
  12. windmill_api/models/{get_settings_response_200_ai_resource.py → ai_config_code_completion_model.py} +15 -15
  13. windmill_api/models/{get_settings_response_200_ai_resource_provider.py → ai_config_code_completion_model_provider.py} +2 -1
  14. windmill_api/models/{edit_copilot_config_json_body_ai_resource.py → ai_config_default_model.py} +15 -15
  15. windmill_api/models/{edit_copilot_config_json_body_ai_resource_provider.py → ai_config_default_model_provider.py} +2 -1
  16. windmill_api/models/ai_config_providers.py +60 -0
  17. windmill_api/models/ai_config_providers_additional_property.py +65 -0
  18. windmill_api/models/ai_provider.py +1 -0
  19. windmill_api/models/ai_provider_config.py +65 -0
  20. windmill_api/models/{ai_resource.py → ai_provider_model.py} +15 -15
  21. windmill_api/models/{ai_resource_provider.py → ai_provider_model_provider.py} +2 -1
  22. windmill_api/models/archive_script_by_hash_response_200_language.py +2 -0
  23. windmill_api/models/authentication_method.py +13 -0
  24. windmill_api/models/completed_job_language.py +2 -0
  25. windmill_api/models/create_http_trigger_json_body.py +16 -6
  26. windmill_api/models/create_http_trigger_json_body_authentication_method.py +13 -0
  27. windmill_api/models/create_schedule_json_body.py +8 -0
  28. windmill_api/models/create_script_json_body_language.py +2 -0
  29. windmill_api/models/delete_completed_job_response_200_language.py +2 -0
  30. windmill_api/models/delete_script_by_hash_response_200_language.py +2 -0
  31. windmill_api/models/edit_copilot_config_json_body.py +50 -30
  32. windmill_api/models/edit_copilot_config_json_body_code_completion_model.py +69 -0
  33. windmill_api/models/edit_copilot_config_json_body_code_completion_model_provider.py +16 -0
  34. windmill_api/models/edit_copilot_config_json_body_default_model.py +67 -0
  35. windmill_api/models/edit_copilot_config_json_body_default_model_provider.py +16 -0
  36. windmill_api/models/edit_copilot_config_json_body_providers.py +66 -0
  37. windmill_api/models/edit_copilot_config_json_body_providers_additional_property.py +65 -0
  38. windmill_api/models/edit_http_trigger.py +16 -6
  39. windmill_api/models/edit_http_trigger_authentication_method.py +13 -0
  40. windmill_api/models/edit_schedule.py +8 -0
  41. windmill_api/models/{set_automatic_billing_json_body.py → export_installation_response_200.py} +13 -23
  42. windmill_api/models/extended_jobs_jobs_item_type_0_language.py +2 -0
  43. windmill_api/models/extended_jobs_jobs_item_type_1_language.py +2 -0
  44. windmill_api/models/get_completed_job_response_200_language.py +2 -0
  45. windmill_api/models/get_copilot_info_response_200.py +111 -0
  46. windmill_api/models/get_copilot_info_response_200_code_completion_model.py +69 -0
  47. windmill_api/models/get_copilot_info_response_200_code_completion_model_provider.py +16 -0
  48. windmill_api/models/get_copilot_info_response_200_default_model.py +67 -0
  49. windmill_api/models/get_copilot_info_response_200_default_model_provider.py +16 -0
  50. windmill_api/models/get_copilot_info_response_200_providers.py +66 -0
  51. windmill_api/models/get_copilot_info_response_200_providers_additional_property.py +65 -0
  52. windmill_api/models/get_github_app_token_json_body.py +58 -0
  53. windmill_api/models/get_github_app_token_response_200.py +58 -0
  54. windmill_api/models/get_global_connected_repositories_response_200_item.py +104 -0
  55. windmill_api/models/get_global_connected_repositories_response_200_item_repositories_item.py +65 -0
  56. windmill_api/models/get_http_trigger_response_200.py +17 -6
  57. windmill_api/models/get_http_trigger_response_200_authentication_method.py +13 -0
  58. windmill_api/models/get_job_response_200_type_0_language.py +2 -0
  59. windmill_api/models/get_job_response_200_type_1_language.py +2 -0
  60. windmill_api/models/get_premium_info_response_200.py +7 -14
  61. windmill_api/models/get_schedule_response_200.py +8 -0
  62. windmill_api/models/get_script_by_hash_response_200_language.py +2 -0
  63. windmill_api/models/get_script_by_path_response_200_language.py +2 -0
  64. windmill_api/models/get_script_by_path_with_draft_response_200_draft_language.py +2 -0
  65. windmill_api/models/get_script_by_path_with_draft_response_200_language.py +2 -0
  66. windmill_api/models/get_settings_response_200.py +16 -39
  67. windmill_api/models/get_settings_response_200_ai_config.py +113 -0
  68. windmill_api/models/get_settings_response_200_ai_config_code_completion_model.py +69 -0
  69. windmill_api/models/get_settings_response_200_ai_config_code_completion_model_provider.py +16 -0
  70. windmill_api/models/get_settings_response_200_ai_config_default_model.py +69 -0
  71. windmill_api/models/get_settings_response_200_ai_config_default_model_provider.py +16 -0
  72. windmill_api/models/get_settings_response_200_ai_config_providers.py +66 -0
  73. windmill_api/models/get_settings_response_200_ai_config_providers_additional_property.py +65 -0
  74. windmill_api/models/get_suspended_job_flow_response_200_job_type_0_language.py +2 -0
  75. windmill_api/models/get_suspended_job_flow_response_200_job_type_1_language.py +2 -0
  76. windmill_api/models/github_installations_item.py +98 -0
  77. windmill_api/models/github_installations_item_repositories_item.py +65 -0
  78. windmill_api/models/http_trigger.py +17 -6
  79. windmill_api/models/http_trigger_authentication_method.py +13 -0
  80. windmill_api/models/import_installation_json_body.py +58 -0
  81. windmill_api/models/install_from_workspace_json_body.py +65 -0
  82. windmill_api/models/job_type_0_language.py +2 -0
  83. windmill_api/models/job_type_1_language.py +2 -0
  84. windmill_api/models/list_app_paths_from_workspace_runnable_runnable_kind.py +9 -0
  85. windmill_api/models/list_completed_jobs_response_200_item_language.py +2 -0
  86. windmill_api/models/list_extended_jobs_response_200_jobs_item_type_0_language.py +2 -0
  87. windmill_api/models/list_extended_jobs_response_200_jobs_item_type_1_language.py +2 -0
  88. windmill_api/models/list_http_triggers_response_200_item.py +19 -6
  89. windmill_api/models/list_http_triggers_response_200_item_authentication_method.py +13 -0
  90. windmill_api/models/list_jobs_response_200_item_type_0_language.py +2 -0
  91. windmill_api/models/list_jobs_response_200_item_type_1_language.py +2 -0
  92. windmill_api/models/list_queue_response_200_item_language.py +2 -0
  93. windmill_api/models/list_schedules_response_200_item.py +8 -0
  94. windmill_api/models/list_schedules_with_jobs_response_200_item.py +8 -0
  95. windmill_api/models/list_scripts_response_200_item_language.py +2 -0
  96. windmill_api/models/new_http_trigger.py +16 -6
  97. windmill_api/models/new_http_trigger_authentication_method.py +13 -0
  98. windmill_api/models/new_schedule.py +8 -0
  99. windmill_api/models/new_script_language.py +2 -0
  100. windmill_api/models/new_script_with_draft_draft_language.py +2 -0
  101. windmill_api/models/new_script_with_draft_language.py +2 -0
  102. windmill_api/models/preview_language.py +2 -0
  103. windmill_api/models/queued_job_language.py +2 -0
  104. windmill_api/models/raw_script_for_dependencies_language.py +2 -0
  105. windmill_api/models/run_raw_script_dependencies_json_body_raw_scripts_item_language.py +2 -0
  106. windmill_api/models/run_script_preview_json_body_language.py +2 -0
  107. windmill_api/models/schedule.py +8 -0
  108. windmill_api/models/schedule_w_jobs.py +8 -0
  109. windmill_api/models/script_lang.py +2 -0
  110. windmill_api/models/script_language.py +2 -0
  111. windmill_api/models/update_http_trigger_json_body.py +16 -6
  112. windmill_api/models/update_http_trigger_json_body_authentication_method.py +13 -0
  113. windmill_api/models/update_schedule_json_body.py +8 -0
  114. windmill_api/models/workspace_github_installation.py +65 -0
  115. {windmill_api-1.478.0.dist-info → windmill_api-1.479.0.dist-info}/METADATA +1 -1
  116. {windmill_api-1.478.0.dist-info → windmill_api-1.479.0.dist-info}/RECORD +118 -68
  117. {windmill_api-1.478.0.dist-info → windmill_api-1.479.0.dist-info}/LICENSE +0 -0
  118. {windmill_api-1.478.0.dist-info → windmill_api-1.479.0.dist-info}/WHEEL +0 -0
@@ -0,0 +1,176 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Dict, List, Optional, Union, cast
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.list_app_paths_from_workspace_runnable_runnable_kind import ListAppPathsFromWorkspaceRunnableRunnableKind
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs(
13
+ workspace: str,
14
+ runnable_kind: ListAppPathsFromWorkspaceRunnableRunnableKind,
15
+ path: str,
16
+ ) -> Dict[str, Any]:
17
+ pass
18
+
19
+ return {
20
+ "method": "get",
21
+ "url": "/w/{workspace}/apps/list_paths_from_workspace_runnable/{runnable_kind}/{path}".format(
22
+ workspace=workspace,
23
+ runnable_kind=runnable_kind,
24
+ path=path,
25
+ ),
26
+ }
27
+
28
+
29
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[List[str]]:
30
+ if response.status_code == HTTPStatus.OK:
31
+ response_200 = cast(List[str], response.json())
32
+
33
+ return response_200
34
+ if client.raise_on_unexpected_status:
35
+ raise errors.UnexpectedStatus(response.status_code, response.content)
36
+ else:
37
+ return None
38
+
39
+
40
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[List[str]]:
41
+ return Response(
42
+ status_code=HTTPStatus(response.status_code),
43
+ content=response.content,
44
+ headers=response.headers,
45
+ parsed=_parse_response(client=client, response=response),
46
+ )
47
+
48
+
49
+ def sync_detailed(
50
+ workspace: str,
51
+ runnable_kind: ListAppPathsFromWorkspaceRunnableRunnableKind,
52
+ path: str,
53
+ *,
54
+ client: Union[AuthenticatedClient, Client],
55
+ ) -> Response[List[str]]:
56
+ """list app paths from workspace runnable
57
+
58
+ Args:
59
+ workspace (str):
60
+ runnable_kind (ListAppPathsFromWorkspaceRunnableRunnableKind):
61
+ path (str):
62
+
63
+ Raises:
64
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
65
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
66
+
67
+ Returns:
68
+ Response[List[str]]
69
+ """
70
+
71
+ kwargs = _get_kwargs(
72
+ workspace=workspace,
73
+ runnable_kind=runnable_kind,
74
+ path=path,
75
+ )
76
+
77
+ response = client.get_httpx_client().request(
78
+ **kwargs,
79
+ )
80
+
81
+ return _build_response(client=client, response=response)
82
+
83
+
84
+ def sync(
85
+ workspace: str,
86
+ runnable_kind: ListAppPathsFromWorkspaceRunnableRunnableKind,
87
+ path: str,
88
+ *,
89
+ client: Union[AuthenticatedClient, Client],
90
+ ) -> Optional[List[str]]:
91
+ """list app paths from workspace runnable
92
+
93
+ Args:
94
+ workspace (str):
95
+ runnable_kind (ListAppPathsFromWorkspaceRunnableRunnableKind):
96
+ path (str):
97
+
98
+ Raises:
99
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
100
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
101
+
102
+ Returns:
103
+ List[str]
104
+ """
105
+
106
+ return sync_detailed(
107
+ workspace=workspace,
108
+ runnable_kind=runnable_kind,
109
+ path=path,
110
+ client=client,
111
+ ).parsed
112
+
113
+
114
+ async def asyncio_detailed(
115
+ workspace: str,
116
+ runnable_kind: ListAppPathsFromWorkspaceRunnableRunnableKind,
117
+ path: str,
118
+ *,
119
+ client: Union[AuthenticatedClient, Client],
120
+ ) -> Response[List[str]]:
121
+ """list app paths from workspace runnable
122
+
123
+ Args:
124
+ workspace (str):
125
+ runnable_kind (ListAppPathsFromWorkspaceRunnableRunnableKind):
126
+ path (str):
127
+
128
+ Raises:
129
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
130
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
131
+
132
+ Returns:
133
+ Response[List[str]]
134
+ """
135
+
136
+ kwargs = _get_kwargs(
137
+ workspace=workspace,
138
+ runnable_kind=runnable_kind,
139
+ path=path,
140
+ )
141
+
142
+ response = await client.get_async_httpx_client().request(**kwargs)
143
+
144
+ return _build_response(client=client, response=response)
145
+
146
+
147
+ async def asyncio(
148
+ workspace: str,
149
+ runnable_kind: ListAppPathsFromWorkspaceRunnableRunnableKind,
150
+ path: str,
151
+ *,
152
+ client: Union[AuthenticatedClient, Client],
153
+ ) -> Optional[List[str]]:
154
+ """list app paths from workspace runnable
155
+
156
+ Args:
157
+ workspace (str):
158
+ runnable_kind (ListAppPathsFromWorkspaceRunnableRunnableKind):
159
+ path (str):
160
+
161
+ Raises:
162
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
163
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
164
+
165
+ Returns:
166
+ List[str]
167
+ """
168
+
169
+ return (
170
+ await asyncio_detailed(
171
+ workspace=workspace,
172
+ runnable_kind=runnable_kind,
173
+ path=path,
174
+ client=client,
175
+ )
176
+ ).parsed
File without changes
@@ -0,0 +1,107 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Dict, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...types import Response
9
+
10
+
11
+ def _get_kwargs(
12
+ workspace: str,
13
+ installation_id: int,
14
+ ) -> Dict[str, Any]:
15
+ pass
16
+
17
+ return {
18
+ "method": "delete",
19
+ "url": "/w/{workspace}/github_app/installation/{installation_id}".format(
20
+ workspace=workspace,
21
+ installation_id=installation_id,
22
+ ),
23
+ }
24
+
25
+
26
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
27
+ if response.status_code == HTTPStatus.OK:
28
+ return None
29
+ if client.raise_on_unexpected_status:
30
+ raise errors.UnexpectedStatus(response.status_code, response.content)
31
+ else:
32
+ return None
33
+
34
+
35
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
36
+ return Response(
37
+ status_code=HTTPStatus(response.status_code),
38
+ content=response.content,
39
+ headers=response.headers,
40
+ parsed=_parse_response(client=client, response=response),
41
+ )
42
+
43
+
44
+ def sync_detailed(
45
+ workspace: str,
46
+ installation_id: int,
47
+ *,
48
+ client: Union[AuthenticatedClient, Client],
49
+ ) -> Response[Any]:
50
+ """Delete a GitHub installation from a workspace
51
+
52
+ Removes a GitHub installation from the specified workspace. Requires admin privileges.
53
+
54
+ Args:
55
+ workspace (str):
56
+ installation_id (int):
57
+
58
+ Raises:
59
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
60
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
61
+
62
+ Returns:
63
+ Response[Any]
64
+ """
65
+
66
+ kwargs = _get_kwargs(
67
+ workspace=workspace,
68
+ installation_id=installation_id,
69
+ )
70
+
71
+ response = client.get_httpx_client().request(
72
+ **kwargs,
73
+ )
74
+
75
+ return _build_response(client=client, response=response)
76
+
77
+
78
+ async def asyncio_detailed(
79
+ workspace: str,
80
+ installation_id: int,
81
+ *,
82
+ client: Union[AuthenticatedClient, Client],
83
+ ) -> Response[Any]:
84
+ """Delete a GitHub installation from a workspace
85
+
86
+ Removes a GitHub installation from the specified workspace. Requires admin privileges.
87
+
88
+ Args:
89
+ workspace (str):
90
+ installation_id (int):
91
+
92
+ Raises:
93
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
94
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
95
+
96
+ Returns:
97
+ Response[Any]
98
+ """
99
+
100
+ kwargs = _get_kwargs(
101
+ workspace=workspace,
102
+ installation_id=installation_id,
103
+ )
104
+
105
+ response = await client.get_async_httpx_client().request(**kwargs)
106
+
107
+ return _build_response(client=client, response=response)
@@ -0,0 +1,174 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Dict, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.export_installation_response_200 import ExportInstallationResponse200
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs(
13
+ workspace: str,
14
+ installation_id: int,
15
+ ) -> Dict[str, Any]:
16
+ pass
17
+
18
+ return {
19
+ "method": "get",
20
+ "url": "/w/{workspace}/github_app/export/{installationId}".format(
21
+ workspace=workspace,
22
+ installationId=installation_id,
23
+ ),
24
+ }
25
+
26
+
27
+ def _parse_response(
28
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
29
+ ) -> Optional[ExportInstallationResponse200]:
30
+ if response.status_code == HTTPStatus.OK:
31
+ response_200 = ExportInstallationResponse200.from_dict(response.json())
32
+
33
+ return response_200
34
+ if client.raise_on_unexpected_status:
35
+ raise errors.UnexpectedStatus(response.status_code, response.content)
36
+ else:
37
+ return None
38
+
39
+
40
+ def _build_response(
41
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
42
+ ) -> Response[ExportInstallationResponse200]:
43
+ return Response(
44
+ status_code=HTTPStatus(response.status_code),
45
+ content=response.content,
46
+ headers=response.headers,
47
+ parsed=_parse_response(client=client, response=response),
48
+ )
49
+
50
+
51
+ def sync_detailed(
52
+ workspace: str,
53
+ installation_id: int,
54
+ *,
55
+ client: Union[AuthenticatedClient, Client],
56
+ ) -> Response[ExportInstallationResponse200]:
57
+ """Export GitHub installation JWT token
58
+
59
+ Exports the JWT token for a specific GitHub installation in the workspace
60
+
61
+ Args:
62
+ workspace (str):
63
+ installation_id (int):
64
+
65
+ Raises:
66
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
67
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
68
+
69
+ Returns:
70
+ Response[ExportInstallationResponse200]
71
+ """
72
+
73
+ kwargs = _get_kwargs(
74
+ workspace=workspace,
75
+ installation_id=installation_id,
76
+ )
77
+
78
+ response = client.get_httpx_client().request(
79
+ **kwargs,
80
+ )
81
+
82
+ return _build_response(client=client, response=response)
83
+
84
+
85
+ def sync(
86
+ workspace: str,
87
+ installation_id: int,
88
+ *,
89
+ client: Union[AuthenticatedClient, Client],
90
+ ) -> Optional[ExportInstallationResponse200]:
91
+ """Export GitHub installation JWT token
92
+
93
+ Exports the JWT token for a specific GitHub installation in the workspace
94
+
95
+ Args:
96
+ workspace (str):
97
+ installation_id (int):
98
+
99
+ Raises:
100
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
101
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
102
+
103
+ Returns:
104
+ ExportInstallationResponse200
105
+ """
106
+
107
+ return sync_detailed(
108
+ workspace=workspace,
109
+ installation_id=installation_id,
110
+ client=client,
111
+ ).parsed
112
+
113
+
114
+ async def asyncio_detailed(
115
+ workspace: str,
116
+ installation_id: int,
117
+ *,
118
+ client: Union[AuthenticatedClient, Client],
119
+ ) -> Response[ExportInstallationResponse200]:
120
+ """Export GitHub installation JWT token
121
+
122
+ Exports the JWT token for a specific GitHub installation in the workspace
123
+
124
+ Args:
125
+ workspace (str):
126
+ installation_id (int):
127
+
128
+ Raises:
129
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
130
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
131
+
132
+ Returns:
133
+ Response[ExportInstallationResponse200]
134
+ """
135
+
136
+ kwargs = _get_kwargs(
137
+ workspace=workspace,
138
+ installation_id=installation_id,
139
+ )
140
+
141
+ response = await client.get_async_httpx_client().request(**kwargs)
142
+
143
+ return _build_response(client=client, response=response)
144
+
145
+
146
+ async def asyncio(
147
+ workspace: str,
148
+ installation_id: int,
149
+ *,
150
+ client: Union[AuthenticatedClient, Client],
151
+ ) -> Optional[ExportInstallationResponse200]:
152
+ """Export GitHub installation JWT token
153
+
154
+ Exports the JWT token for a specific GitHub installation in the workspace
155
+
156
+ Args:
157
+ workspace (str):
158
+ installation_id (int):
159
+
160
+ Raises:
161
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
162
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
163
+
164
+ Returns:
165
+ ExportInstallationResponse200
166
+ """
167
+
168
+ return (
169
+ await asyncio_detailed(
170
+ workspace=workspace,
171
+ installation_id=installation_id,
172
+ client=client,
173
+ )
174
+ ).parsed
@@ -0,0 +1,131 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Dict, List, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.get_global_connected_repositories_response_200_item import GetGlobalConnectedRepositoriesResponse200Item
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs() -> Dict[str, Any]:
13
+ pass
14
+
15
+ return {
16
+ "method": "get",
17
+ "url": "/github_app/connected_repositories",
18
+ }
19
+
20
+
21
+ def _parse_response(
22
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
23
+ ) -> Optional[List["GetGlobalConnectedRepositoriesResponse200Item"]]:
24
+ if response.status_code == HTTPStatus.OK:
25
+ response_200 = []
26
+ _response_200 = response.json()
27
+ for response_200_item_data in _response_200:
28
+ response_200_item = GetGlobalConnectedRepositoriesResponse200Item.from_dict(response_200_item_data)
29
+
30
+ response_200.append(response_200_item)
31
+
32
+ return response_200
33
+ if client.raise_on_unexpected_status:
34
+ raise errors.UnexpectedStatus(response.status_code, response.content)
35
+ else:
36
+ return None
37
+
38
+
39
+ def _build_response(
40
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
41
+ ) -> Response[List["GetGlobalConnectedRepositoriesResponse200Item"]]:
42
+ return Response(
43
+ status_code=HTTPStatus(response.status_code),
44
+ content=response.content,
45
+ headers=response.headers,
46
+ parsed=_parse_response(client=client, response=response),
47
+ )
48
+
49
+
50
+ def sync_detailed(
51
+ *,
52
+ client: Union[AuthenticatedClient, Client],
53
+ ) -> Response[List["GetGlobalConnectedRepositoriesResponse200Item"]]:
54
+ """get connected repositories
55
+
56
+ Raises:
57
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
58
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
59
+
60
+ Returns:
61
+ Response[List['GetGlobalConnectedRepositoriesResponse200Item']]
62
+ """
63
+
64
+ kwargs = _get_kwargs()
65
+
66
+ response = client.get_httpx_client().request(
67
+ **kwargs,
68
+ )
69
+
70
+ return _build_response(client=client, response=response)
71
+
72
+
73
+ def sync(
74
+ *,
75
+ client: Union[AuthenticatedClient, Client],
76
+ ) -> Optional[List["GetGlobalConnectedRepositoriesResponse200Item"]]:
77
+ """get connected repositories
78
+
79
+ Raises:
80
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
81
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
82
+
83
+ Returns:
84
+ List['GetGlobalConnectedRepositoriesResponse200Item']
85
+ """
86
+
87
+ return sync_detailed(
88
+ client=client,
89
+ ).parsed
90
+
91
+
92
+ async def asyncio_detailed(
93
+ *,
94
+ client: Union[AuthenticatedClient, Client],
95
+ ) -> Response[List["GetGlobalConnectedRepositoriesResponse200Item"]]:
96
+ """get connected repositories
97
+
98
+ Raises:
99
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
100
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
101
+
102
+ Returns:
103
+ Response[List['GetGlobalConnectedRepositoriesResponse200Item']]
104
+ """
105
+
106
+ kwargs = _get_kwargs()
107
+
108
+ response = await client.get_async_httpx_client().request(**kwargs)
109
+
110
+ return _build_response(client=client, response=response)
111
+
112
+
113
+ async def asyncio(
114
+ *,
115
+ client: Union[AuthenticatedClient, Client],
116
+ ) -> Optional[List["GetGlobalConnectedRepositoriesResponse200Item"]]:
117
+ """get connected repositories
118
+
119
+ Raises:
120
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
121
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
122
+
123
+ Returns:
124
+ List['GetGlobalConnectedRepositoriesResponse200Item']
125
+ """
126
+
127
+ return (
128
+ await asyncio_detailed(
129
+ client=client,
130
+ )
131
+ ).parsed
@@ -0,0 +1,111 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Dict, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.import_installation_json_body import ImportInstallationJsonBody
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs(
13
+ workspace: str,
14
+ *,
15
+ json_body: ImportInstallationJsonBody,
16
+ ) -> Dict[str, Any]:
17
+ pass
18
+
19
+ json_json_body = json_body.to_dict()
20
+
21
+ return {
22
+ "method": "post",
23
+ "url": "/w/{workspace}/github_app/import".format(
24
+ workspace=workspace,
25
+ ),
26
+ "json": json_json_body,
27
+ }
28
+
29
+
30
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
31
+ if response.status_code == HTTPStatus.OK:
32
+ return None
33
+ if client.raise_on_unexpected_status:
34
+ raise errors.UnexpectedStatus(response.status_code, response.content)
35
+ else:
36
+ return None
37
+
38
+
39
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
40
+ return Response(
41
+ status_code=HTTPStatus(response.status_code),
42
+ content=response.content,
43
+ headers=response.headers,
44
+ parsed=_parse_response(client=client, response=response),
45
+ )
46
+
47
+
48
+ def sync_detailed(
49
+ workspace: str,
50
+ *,
51
+ client: Union[AuthenticatedClient, Client],
52
+ json_body: ImportInstallationJsonBody,
53
+ ) -> Response[Any]:
54
+ """Import GitHub installation from JWT token
55
+
56
+ Imports a GitHub installation from a JWT token exported from another instance
57
+
58
+ Args:
59
+ workspace (str):
60
+ json_body (ImportInstallationJsonBody):
61
+
62
+ Raises:
63
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
64
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
65
+
66
+ Returns:
67
+ Response[Any]
68
+ """
69
+
70
+ kwargs = _get_kwargs(
71
+ workspace=workspace,
72
+ json_body=json_body,
73
+ )
74
+
75
+ response = client.get_httpx_client().request(
76
+ **kwargs,
77
+ )
78
+
79
+ return _build_response(client=client, response=response)
80
+
81
+
82
+ async def asyncio_detailed(
83
+ workspace: str,
84
+ *,
85
+ client: Union[AuthenticatedClient, Client],
86
+ json_body: ImportInstallationJsonBody,
87
+ ) -> Response[Any]:
88
+ """Import GitHub installation from JWT token
89
+
90
+ Imports a GitHub installation from a JWT token exported from another instance
91
+
92
+ Args:
93
+ workspace (str):
94
+ json_body (ImportInstallationJsonBody):
95
+
96
+ Raises:
97
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
98
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
99
+
100
+ Returns:
101
+ Response[Any]
102
+ """
103
+
104
+ kwargs = _get_kwargs(
105
+ workspace=workspace,
106
+ json_body=json_body,
107
+ )
108
+
109
+ response = await client.get_async_httpx_client().request(**kwargs)
110
+
111
+ return _build_response(client=client, response=response)