tower 0.3.4__py3-none-linux_armv6l.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.
Files changed (156) hide show
  1. tower/__init__.py +4 -0
  2. tower/__main__.py +38 -0
  3. tower/client.py +115 -0
  4. tower/tower_api_client/__init__.py +7 -0
  5. tower/tower_api_client/api/__init__.py +1 -0
  6. tower/tower_api_client/api/default/__init__.py +0 -0
  7. tower/tower_api_client/api/default/accept_invitation.py +150 -0
  8. tower/tower_api_client/api/default/cancel_run.py +159 -0
  9. tower/tower_api_client/api/default/claim_device_login_ticket.py +154 -0
  10. tower/tower_api_client/api/default/create_account.py +150 -0
  11. tower/tower_api_client/api/default/create_api_key.py +142 -0
  12. tower/tower_api_client/api/default/create_apps.py +150 -0
  13. tower/tower_api_client/api/default/create_device_login_ticket.py +131 -0
  14. tower/tower_api_client/api/default/create_secret.py +150 -0
  15. tower/tower_api_client/api/default/create_session.py +150 -0
  16. tower/tower_api_client/api/default/create_team.py +150 -0
  17. tower/tower_api_client/api/default/delete_api_key.py +142 -0
  18. tower/tower_api_client/api/default/delete_app.py +146 -0
  19. tower/tower_api_client/api/default/delete_secret.py +104 -0
  20. tower/tower_api_client/api/default/delete_team.py +150 -0
  21. tower/tower_api_client/api/default/delete_team_invitation.py +167 -0
  22. tower/tower_api_client/api/default/deploy_app.py +166 -0
  23. tower/tower_api_client/api/default/describe_app.py +165 -0
  24. tower/tower_api_client/api/default/describe_app_version.py +163 -0
  25. tower/tower_api_client/api/default/describe_device_login_session.py +154 -0
  26. tower/tower_api_client/api/default/describe_run.py +172 -0
  27. tower/tower_api_client/api/default/describe_secrets_key.py +160 -0
  28. tower/tower_api_client/api/default/describe_session.py +125 -0
  29. tower/tower_api_client/api/default/export_secrets.py +218 -0
  30. tower/tower_api_client/api/default/generate_app_statistics.py +129 -0
  31. tower/tower_api_client/api/default/generate_run_statistics.py +160 -0
  32. tower/tower_api_client/api/default/get_app_run_logs.py +159 -0
  33. tower/tower_api_client/api/default/invite_team_member.py +163 -0
  34. tower/tower_api_client/api/default/leave_team.py +150 -0
  35. tower/tower_api_client/api/default/list_api_keys.py +125 -0
  36. tower/tower_api_client/api/default/list_app_environments.py +150 -0
  37. tower/tower_api_client/api/default/list_app_versions.py +146 -0
  38. tower/tower_api_client/api/default/list_apps.py +247 -0
  39. tower/tower_api_client/api/default/list_my_team_invitations.py +129 -0
  40. tower/tower_api_client/api/default/list_runs.py +184 -0
  41. tower/tower_api_client/api/default/list_secret_environments.py +129 -0
  42. tower/tower_api_client/api/default/list_secrets.py +201 -0
  43. tower/tower_api_client/api/default/list_team_invitations.py +150 -0
  44. tower/tower_api_client/api/default/list_team_members.py +146 -0
  45. tower/tower_api_client/api/default/list_teams.py +125 -0
  46. tower/tower_api_client/api/default/refresh_session.py +129 -0
  47. tower/tower_api_client/api/default/remove_team_member.py +163 -0
  48. tower/tower_api_client/api/default/resend_team_invitation.py +167 -0
  49. tower/tower_api_client/api/default/run_app.py +176 -0
  50. tower/tower_api_client/api/default/stream_app_run_logs.py +100 -0
  51. tower/tower_api_client/api/default/update_account_slug.py +163 -0
  52. tower/tower_api_client/api/default/update_my_team_invitation.py +154 -0
  53. tower/tower_api_client/api/default/update_team.py +167 -0
  54. tower/tower_api_client/api/default/update_user.py +150 -0
  55. tower/tower_api_client/client.py +51 -0
  56. tower/tower_api_client/models/__init__.py +193 -0
  57. tower/tower_api_client/models/accept_invitation_params.py +49 -0
  58. tower/tower_api_client/models/accept_invitation_response.py +56 -0
  59. tower/tower_api_client/models/account.py +45 -0
  60. tower/tower_api_client/models/api_key.py +67 -0
  61. tower/tower_api_client/models/app.py +122 -0
  62. tower/tower_api_client/models/app_statistics.py +66 -0
  63. tower/tower_api_client/models/app_summary.py +81 -0
  64. tower/tower_api_client/models/app_version.py +71 -0
  65. tower/tower_api_client/models/cancel_run_response.py +56 -0
  66. tower/tower_api_client/models/claim_device_login_ticket_params.py +49 -0
  67. tower/tower_api_client/models/claim_device_login_ticket_response.py +49 -0
  68. tower/tower_api_client/models/create_account_params.py +91 -0
  69. tower/tower_api_client/models/create_account_params_flags_struct.py +38 -0
  70. tower/tower_api_client/models/create_account_response.py +56 -0
  71. tower/tower_api_client/models/create_api_key_params.py +49 -0
  72. tower/tower_api_client/models/create_api_key_response.py +56 -0
  73. tower/tower_api_client/models/create_app_params.py +57 -0
  74. tower/tower_api_client/models/create_app_response.py +56 -0
  75. tower/tower_api_client/models/create_device_login_ticket_response.py +94 -0
  76. tower/tower_api_client/models/create_secret_params.py +70 -0
  77. tower/tower_api_client/models/create_secret_response.py +56 -0
  78. tower/tower_api_client/models/create_session_params.py +56 -0
  79. tower/tower_api_client/models/create_session_response.py +56 -0
  80. tower/tower_api_client/models/create_team_params.py +56 -0
  81. tower/tower_api_client/models/create_team_response.py +56 -0
  82. tower/tower_api_client/models/delete_api_key_params.py +49 -0
  83. tower/tower_api_client/models/delete_api_key_response.py +56 -0
  84. tower/tower_api_client/models/delete_app_response.py +56 -0
  85. tower/tower_api_client/models/delete_team_invitation_params.py +49 -0
  86. tower/tower_api_client/models/delete_team_invitation_response.py +56 -0
  87. tower/tower_api_client/models/delete_team_params.py +49 -0
  88. tower/tower_api_client/models/delete_team_response.py +56 -0
  89. tower/tower_api_client/models/deploy_app_response.py +56 -0
  90. tower/tower_api_client/models/describe_app_response.py +75 -0
  91. tower/tower_api_client/models/describe_app_version_response.py +56 -0
  92. tower/tower_api_client/models/describe_device_login_session_response.py +56 -0
  93. tower/tower_api_client/models/describe_run_response.py +56 -0
  94. tower/tower_api_client/models/describe_secrets_key_response.py +49 -0
  95. tower/tower_api_client/models/describe_session_response.py +56 -0
  96. tower/tower_api_client/models/error_detail.py +54 -0
  97. tower/tower_api_client/models/error_model.py +109 -0
  98. tower/tower_api_client/models/export_secrets_response.py +75 -0
  99. tower/tower_api_client/models/export_user_secrets_params.py +49 -0
  100. tower/tower_api_client/models/exported_secret.py +62 -0
  101. tower/tower_api_client/models/generate_app_statistics_response.py +56 -0
  102. tower/tower_api_client/models/generate_run_statistics_response.py +85 -0
  103. tower/tower_api_client/models/get_run_log_line.py +47 -0
  104. tower/tower_api_client/models/get_run_logs_output_body.py +65 -0
  105. tower/tower_api_client/models/invite_team_member_params.py +58 -0
  106. tower/tower_api_client/models/invite_team_member_response.py +65 -0
  107. tower/tower_api_client/models/leave_team_response.py +56 -0
  108. tower/tower_api_client/models/list_api_keys_response.py +65 -0
  109. tower/tower_api_client/models/list_app_environments_response.py +50 -0
  110. tower/tower_api_client/models/list_app_versions_response.py +65 -0
  111. tower/tower_api_client/models/list_apps_response.py +75 -0
  112. tower/tower_api_client/models/list_apps_status_item.py +11 -0
  113. tower/tower_api_client/models/list_my_team_invitations_response.py +65 -0
  114. tower/tower_api_client/models/list_runs_response.py +75 -0
  115. tower/tower_api_client/models/list_secret_environments_response.py +50 -0
  116. tower/tower_api_client/models/list_secrets_response.py +75 -0
  117. tower/tower_api_client/models/list_team_invitations_response.py +65 -0
  118. tower/tower_api_client/models/list_team_members_response.py +65 -0
  119. tower/tower_api_client/models/list_teams_response.py +65 -0
  120. tower/tower_api_client/models/log_line.py +62 -0
  121. tower/tower_api_client/models/log_line_error.py +47 -0
  122. tower/tower_api_client/models/pagination.py +59 -0
  123. tower/tower_api_client/models/parameter.py +52 -0
  124. tower/tower_api_client/models/refresh_session_response.py +66 -0
  125. tower/tower_api_client/models/remove_team_member_params.py +49 -0
  126. tower/tower_api_client/models/remove_team_member_response.py +56 -0
  127. tower/tower_api_client/models/resend_team_invitation_params.py +57 -0
  128. tower/tower_api_client/models/resend_team_invitation_response.py +56 -0
  129. tower/tower_api_client/models/run.py +129 -0
  130. tower/tower_api_client/models/run_app_params.py +72 -0
  131. tower/tower_api_client/models/run_app_params_parameters.py +43 -0
  132. tower/tower_api_client/models/run_app_response.py +56 -0
  133. tower/tower_api_client/models/run_results.py +73 -0
  134. tower/tower_api_client/models/run_statistics.py +52 -0
  135. tower/tower_api_client/models/secret.py +62 -0
  136. tower/tower_api_client/models/series_point.py +52 -0
  137. tower/tower_api_client/models/session.py +73 -0
  138. tower/tower_api_client/models/statistics_settings.py +38 -0
  139. tower/tower_api_client/models/team.py +75 -0
  140. tower/tower_api_client/models/team_invitation.py +61 -0
  141. tower/tower_api_client/models/token.py +38 -0
  142. tower/tower_api_client/models/update_account_slug_params.py +49 -0
  143. tower/tower_api_client/models/update_account_slug_response.py +56 -0
  144. tower/tower_api_client/models/update_my_team_invitation_params.py +56 -0
  145. tower/tower_api_client/models/update_my_team_invitation_response.py +39 -0
  146. tower/tower_api_client/models/update_team_params.py +58 -0
  147. tower/tower_api_client/models/update_team_response.py +56 -0
  148. tower/tower_api_client/models/update_user_params.py +71 -0
  149. tower/tower_api_client/models/update_user_response.py +56 -0
  150. tower/tower_api_client/models/user.py +90 -0
  151. tower/tower_api_client/types.py +44 -0
  152. tower-0.3.4.data/scripts/tower +0 -0
  153. tower-0.3.4.dist-info/METADATA +115 -0
  154. tower-0.3.4.dist-info/RECORD +156 -0
  155. tower-0.3.4.dist-info/WHEEL +4 -0
  156. tower-0.3.4.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,150 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Dict, Optional
3
+
4
+ import httpx
5
+
6
+ from ...client import AuthenticatedClient
7
+ from ...models.delete_team_params import DeleteTeamParams
8
+ from ...models.delete_team_response import DeleteTeamResponse
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs(
13
+ *,
14
+ client: AuthenticatedClient,
15
+ json_body: DeleteTeamParams,
16
+ ) -> Dict[str, Any]:
17
+ url = "{}/teams".format(client.base_url)
18
+
19
+ headers: Dict[str, str] = client.get_headers()
20
+ cookies: Dict[str, Any] = client.get_cookies()
21
+
22
+ json_json_body = json_body.to_dict()
23
+
24
+ return {
25
+ "method": "delete",
26
+ "url": url,
27
+ "headers": headers,
28
+ "cookies": cookies,
29
+ "timeout": client.get_timeout(),
30
+ "json": json_json_body,
31
+ }
32
+
33
+
34
+ def _parse_response(*, response: httpx.Response) -> Optional[DeleteTeamResponse]:
35
+ if response.status_code == 200:
36
+ response_200 = DeleteTeamResponse.from_dict(response.json())
37
+
38
+ return response_200
39
+ return None
40
+
41
+
42
+ def _build_response(*, response: httpx.Response) -> Response[DeleteTeamResponse]:
43
+ return Response(
44
+ status_code=HTTPStatus(response.status_code),
45
+ content=response.content,
46
+ headers=response.headers,
47
+ parsed=_parse_response(response=response),
48
+ )
49
+
50
+
51
+ def sync_detailed(
52
+ *,
53
+ client: AuthenticatedClient,
54
+ json_body: DeleteTeamParams,
55
+ ) -> Response[DeleteTeamResponse]:
56
+ """Delete Team
57
+
58
+ Delete a new team
59
+
60
+ Args:
61
+ json_body (DeleteTeamParams):
62
+
63
+ Returns:
64
+ Response[DeleteTeamResponse]
65
+ """
66
+
67
+ kwargs = _get_kwargs(
68
+ client=client,
69
+ json_body=json_body,
70
+ )
71
+
72
+ response = httpx.request(
73
+ verify=client.verify_ssl,
74
+ **kwargs,
75
+ )
76
+
77
+ return _build_response(response=response)
78
+
79
+
80
+ def sync(
81
+ *,
82
+ client: AuthenticatedClient,
83
+ json_body: DeleteTeamParams,
84
+ ) -> Optional[DeleteTeamResponse]:
85
+ """Delete Team
86
+
87
+ Delete a new team
88
+
89
+ Args:
90
+ json_body (DeleteTeamParams):
91
+
92
+ Returns:
93
+ Response[DeleteTeamResponse]
94
+ """
95
+
96
+ return sync_detailed(
97
+ client=client,
98
+ json_body=json_body,
99
+ ).parsed
100
+
101
+
102
+ async def asyncio_detailed(
103
+ *,
104
+ client: AuthenticatedClient,
105
+ json_body: DeleteTeamParams,
106
+ ) -> Response[DeleteTeamResponse]:
107
+ """Delete Team
108
+
109
+ Delete a new team
110
+
111
+ Args:
112
+ json_body (DeleteTeamParams):
113
+
114
+ Returns:
115
+ Response[DeleteTeamResponse]
116
+ """
117
+
118
+ kwargs = _get_kwargs(
119
+ client=client,
120
+ json_body=json_body,
121
+ )
122
+
123
+ async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
124
+ response = await _client.request(**kwargs)
125
+
126
+ return _build_response(response=response)
127
+
128
+
129
+ async def asyncio(
130
+ *,
131
+ client: AuthenticatedClient,
132
+ json_body: DeleteTeamParams,
133
+ ) -> Optional[DeleteTeamResponse]:
134
+ """Delete Team
135
+
136
+ Delete a new team
137
+
138
+ Args:
139
+ json_body (DeleteTeamParams):
140
+
141
+ Returns:
142
+ Response[DeleteTeamResponse]
143
+ """
144
+
145
+ return (
146
+ await asyncio_detailed(
147
+ client=client,
148
+ json_body=json_body,
149
+ )
150
+ ).parsed
@@ -0,0 +1,167 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Dict, Optional
3
+
4
+ import httpx
5
+
6
+ from ...client import AuthenticatedClient
7
+ from ...models.delete_team_invitation_params import DeleteTeamInvitationParams
8
+ from ...models.delete_team_invitation_response import DeleteTeamInvitationResponse
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs(
13
+ slug: str,
14
+ *,
15
+ client: AuthenticatedClient,
16
+ json_body: DeleteTeamInvitationParams,
17
+ ) -> Dict[str, Any]:
18
+ url = "{}/teams/{slug}/invites".format(client.base_url, slug=slug)
19
+
20
+ headers: Dict[str, str] = client.get_headers()
21
+ cookies: Dict[str, Any] = client.get_cookies()
22
+
23
+ json_json_body = json_body.to_dict()
24
+
25
+ return {
26
+ "method": "delete",
27
+ "url": url,
28
+ "headers": headers,
29
+ "cookies": cookies,
30
+ "timeout": client.get_timeout(),
31
+ "json": json_json_body,
32
+ }
33
+
34
+
35
+ def _parse_response(
36
+ *, response: httpx.Response
37
+ ) -> Optional[DeleteTeamInvitationResponse]:
38
+ if response.status_code == 200:
39
+ response_200 = DeleteTeamInvitationResponse.from_dict(response.json())
40
+
41
+ return response_200
42
+ return None
43
+
44
+
45
+ def _build_response(
46
+ *, response: httpx.Response
47
+ ) -> Response[DeleteTeamInvitationResponse]:
48
+ return Response(
49
+ status_code=HTTPStatus(response.status_code),
50
+ content=response.content,
51
+ headers=response.headers,
52
+ parsed=_parse_response(response=response),
53
+ )
54
+
55
+
56
+ def sync_detailed(
57
+ slug: str,
58
+ *,
59
+ client: AuthenticatedClient,
60
+ json_body: DeleteTeamInvitationParams,
61
+ ) -> Response[DeleteTeamInvitationResponse]:
62
+ """Delete Team Invitation
63
+
64
+ Delete a pending team invitation that you have previously sent
65
+
66
+ Args:
67
+ slug (str): The slug of the team to remove someone from
68
+ json_body (DeleteTeamInvitationParams):
69
+
70
+ Returns:
71
+ Response[DeleteTeamInvitationResponse]
72
+ """
73
+
74
+ kwargs = _get_kwargs(
75
+ slug=slug,
76
+ client=client,
77
+ json_body=json_body,
78
+ )
79
+
80
+ response = httpx.request(
81
+ verify=client.verify_ssl,
82
+ **kwargs,
83
+ )
84
+
85
+ return _build_response(response=response)
86
+
87
+
88
+ def sync(
89
+ slug: str,
90
+ *,
91
+ client: AuthenticatedClient,
92
+ json_body: DeleteTeamInvitationParams,
93
+ ) -> Optional[DeleteTeamInvitationResponse]:
94
+ """Delete Team Invitation
95
+
96
+ Delete a pending team invitation that you have previously sent
97
+
98
+ Args:
99
+ slug (str): The slug of the team to remove someone from
100
+ json_body (DeleteTeamInvitationParams):
101
+
102
+ Returns:
103
+ Response[DeleteTeamInvitationResponse]
104
+ """
105
+
106
+ return sync_detailed(
107
+ slug=slug,
108
+ client=client,
109
+ json_body=json_body,
110
+ ).parsed
111
+
112
+
113
+ async def asyncio_detailed(
114
+ slug: str,
115
+ *,
116
+ client: AuthenticatedClient,
117
+ json_body: DeleteTeamInvitationParams,
118
+ ) -> Response[DeleteTeamInvitationResponse]:
119
+ """Delete Team Invitation
120
+
121
+ Delete a pending team invitation that you have previously sent
122
+
123
+ Args:
124
+ slug (str): The slug of the team to remove someone from
125
+ json_body (DeleteTeamInvitationParams):
126
+
127
+ Returns:
128
+ Response[DeleteTeamInvitationResponse]
129
+ """
130
+
131
+ kwargs = _get_kwargs(
132
+ slug=slug,
133
+ client=client,
134
+ json_body=json_body,
135
+ )
136
+
137
+ async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
138
+ response = await _client.request(**kwargs)
139
+
140
+ return _build_response(response=response)
141
+
142
+
143
+ async def asyncio(
144
+ slug: str,
145
+ *,
146
+ client: AuthenticatedClient,
147
+ json_body: DeleteTeamInvitationParams,
148
+ ) -> Optional[DeleteTeamInvitationResponse]:
149
+ """Delete Team Invitation
150
+
151
+ Delete a pending team invitation that you have previously sent
152
+
153
+ Args:
154
+ slug (str): The slug of the team to remove someone from
155
+ json_body (DeleteTeamInvitationParams):
156
+
157
+ Returns:
158
+ Response[DeleteTeamInvitationResponse]
159
+ """
160
+
161
+ return (
162
+ await asyncio_detailed(
163
+ slug=slug,
164
+ client=client,
165
+ json_body=json_body,
166
+ )
167
+ ).parsed
@@ -0,0 +1,166 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Dict, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ...client import AuthenticatedClient
7
+ from ...models.deploy_app_response import DeployAppResponse
8
+ from ...types import UNSET, Response, Unset
9
+
10
+
11
+ def _get_kwargs(
12
+ name: str,
13
+ *,
14
+ client: AuthenticatedClient,
15
+ content_encoding: Union[Unset, str] = UNSET,
16
+ ) -> Dict[str, Any]:
17
+ url = "{}/apps/{name}/deploy".format(client.base_url, name=name)
18
+
19
+ headers: Dict[str, str] = client.get_headers()
20
+ cookies: Dict[str, Any] = client.get_cookies()
21
+
22
+ if not isinstance(content_encoding, Unset):
23
+ headers["Content-Encoding"] = content_encoding
24
+
25
+ return {
26
+ "method": "post",
27
+ "url": url,
28
+ "headers": headers,
29
+ "cookies": cookies,
30
+ "timeout": client.get_timeout(),
31
+ }
32
+
33
+
34
+ def _parse_response(*, response: httpx.Response) -> Optional[DeployAppResponse]:
35
+ if response.status_code == 200:
36
+ response_200 = DeployAppResponse.from_dict(response.json())
37
+
38
+ return response_200
39
+ return None
40
+
41
+
42
+ def _build_response(*, response: httpx.Response) -> Response[DeployAppResponse]:
43
+ return Response(
44
+ status_code=HTTPStatus(response.status_code),
45
+ content=response.content,
46
+ headers=response.headers,
47
+ parsed=_parse_response(response=response),
48
+ )
49
+
50
+
51
+ def sync_detailed(
52
+ name: str,
53
+ *,
54
+ client: AuthenticatedClient,
55
+ content_encoding: Union[Unset, str] = UNSET,
56
+ ) -> Response[DeployAppResponse]:
57
+ """Deploy app
58
+
59
+ Deploy a new version of an app. Reads the request body, which is a TAR file (or a GZipped TAR file)
60
+ and creates a new deployment for an app based on that file.
61
+
62
+ Args:
63
+ name (str): The name of the app to deploy.
64
+ content_encoding (Union[Unset, str]): The encoding of the content.
65
+
66
+ Returns:
67
+ Response[DeployAppResponse]
68
+ """
69
+
70
+ kwargs = _get_kwargs(
71
+ name=name,
72
+ client=client,
73
+ content_encoding=content_encoding,
74
+ )
75
+
76
+ response = httpx.request(
77
+ verify=client.verify_ssl,
78
+ **kwargs,
79
+ )
80
+
81
+ return _build_response(response=response)
82
+
83
+
84
+ def sync(
85
+ name: str,
86
+ *,
87
+ client: AuthenticatedClient,
88
+ content_encoding: Union[Unset, str] = UNSET,
89
+ ) -> Optional[DeployAppResponse]:
90
+ """Deploy app
91
+
92
+ Deploy a new version of an app. Reads the request body, which is a TAR file (or a GZipped TAR file)
93
+ and creates a new deployment for an app based on that file.
94
+
95
+ Args:
96
+ name (str): The name of the app to deploy.
97
+ content_encoding (Union[Unset, str]): The encoding of the content.
98
+
99
+ Returns:
100
+ Response[DeployAppResponse]
101
+ """
102
+
103
+ return sync_detailed(
104
+ name=name,
105
+ client=client,
106
+ content_encoding=content_encoding,
107
+ ).parsed
108
+
109
+
110
+ async def asyncio_detailed(
111
+ name: str,
112
+ *,
113
+ client: AuthenticatedClient,
114
+ content_encoding: Union[Unset, str] = UNSET,
115
+ ) -> Response[DeployAppResponse]:
116
+ """Deploy app
117
+
118
+ Deploy a new version of an app. Reads the request body, which is a TAR file (or a GZipped TAR file)
119
+ and creates a new deployment for an app based on that file.
120
+
121
+ Args:
122
+ name (str): The name of the app to deploy.
123
+ content_encoding (Union[Unset, str]): The encoding of the content.
124
+
125
+ Returns:
126
+ Response[DeployAppResponse]
127
+ """
128
+
129
+ kwargs = _get_kwargs(
130
+ name=name,
131
+ client=client,
132
+ content_encoding=content_encoding,
133
+ )
134
+
135
+ async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
136
+ response = await _client.request(**kwargs)
137
+
138
+ return _build_response(response=response)
139
+
140
+
141
+ async def asyncio(
142
+ name: str,
143
+ *,
144
+ client: AuthenticatedClient,
145
+ content_encoding: Union[Unset, str] = UNSET,
146
+ ) -> Optional[DeployAppResponse]:
147
+ """Deploy app
148
+
149
+ Deploy a new version of an app. Reads the request body, which is a TAR file (or a GZipped TAR file)
150
+ and creates a new deployment for an app based on that file.
151
+
152
+ Args:
153
+ name (str): The name of the app to deploy.
154
+ content_encoding (Union[Unset, str]): The encoding of the content.
155
+
156
+ Returns:
157
+ Response[DeployAppResponse]
158
+ """
159
+
160
+ return (
161
+ await asyncio_detailed(
162
+ name=name,
163
+ client=client,
164
+ content_encoding=content_encoding,
165
+ )
166
+ ).parsed
@@ -0,0 +1,165 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Dict, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ...client import AuthenticatedClient
7
+ from ...models.describe_app_response import DescribeAppResponse
8
+ from ...types import UNSET, Response, Unset
9
+
10
+
11
+ def _get_kwargs(
12
+ name: str,
13
+ *,
14
+ client: AuthenticatedClient,
15
+ runs: Union[Unset, None, int] = UNSET,
16
+ ) -> Dict[str, Any]:
17
+ url = "{}/apps/{name}".format(client.base_url, name=name)
18
+
19
+ headers: Dict[str, str] = client.get_headers()
20
+ cookies: Dict[str, Any] = client.get_cookies()
21
+
22
+ params: Dict[str, Any] = {}
23
+ params["runs"] = runs
24
+
25
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
26
+
27
+ return {
28
+ "method": "get",
29
+ "url": url,
30
+ "headers": headers,
31
+ "cookies": cookies,
32
+ "timeout": client.get_timeout(),
33
+ "params": params,
34
+ }
35
+
36
+
37
+ def _parse_response(*, response: httpx.Response) -> Optional[DescribeAppResponse]:
38
+ if response.status_code == 200:
39
+ response_200 = DescribeAppResponse.from_dict(response.json())
40
+
41
+ return response_200
42
+ return None
43
+
44
+
45
+ def _build_response(*, response: httpx.Response) -> Response[DescribeAppResponse]:
46
+ return Response(
47
+ status_code=HTTPStatus(response.status_code),
48
+ content=response.content,
49
+ headers=response.headers,
50
+ parsed=_parse_response(response=response),
51
+ )
52
+
53
+
54
+ def sync_detailed(
55
+ name: str,
56
+ *,
57
+ client: AuthenticatedClient,
58
+ runs: Union[Unset, None, int] = UNSET,
59
+ ) -> Response[DescribeAppResponse]:
60
+ """Describe app
61
+
62
+ Get all the runs for the current account.
63
+
64
+ Args:
65
+ name (str): The name of the app to fetch.
66
+ runs (Union[Unset, None, int]): The number of recent runs to fetch for the app.
67
+
68
+ Returns:
69
+ Response[DescribeAppResponse]
70
+ """
71
+
72
+ kwargs = _get_kwargs(
73
+ name=name,
74
+ client=client,
75
+ runs=runs,
76
+ )
77
+
78
+ response = httpx.request(
79
+ verify=client.verify_ssl,
80
+ **kwargs,
81
+ )
82
+
83
+ return _build_response(response=response)
84
+
85
+
86
+ def sync(
87
+ name: str,
88
+ *,
89
+ client: AuthenticatedClient,
90
+ runs: Union[Unset, None, int] = UNSET,
91
+ ) -> Optional[DescribeAppResponse]:
92
+ """Describe app
93
+
94
+ Get all the runs for the current account.
95
+
96
+ Args:
97
+ name (str): The name of the app to fetch.
98
+ runs (Union[Unset, None, int]): The number of recent runs to fetch for the app.
99
+
100
+ Returns:
101
+ Response[DescribeAppResponse]
102
+ """
103
+
104
+ return sync_detailed(
105
+ name=name,
106
+ client=client,
107
+ runs=runs,
108
+ ).parsed
109
+
110
+
111
+ async def asyncio_detailed(
112
+ name: str,
113
+ *,
114
+ client: AuthenticatedClient,
115
+ runs: Union[Unset, None, int] = UNSET,
116
+ ) -> Response[DescribeAppResponse]:
117
+ """Describe app
118
+
119
+ Get all the runs for the current account.
120
+
121
+ Args:
122
+ name (str): The name of the app to fetch.
123
+ runs (Union[Unset, None, int]): The number of recent runs to fetch for the app.
124
+
125
+ Returns:
126
+ Response[DescribeAppResponse]
127
+ """
128
+
129
+ kwargs = _get_kwargs(
130
+ name=name,
131
+ client=client,
132
+ runs=runs,
133
+ )
134
+
135
+ async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
136
+ response = await _client.request(**kwargs)
137
+
138
+ return _build_response(response=response)
139
+
140
+
141
+ async def asyncio(
142
+ name: str,
143
+ *,
144
+ client: AuthenticatedClient,
145
+ runs: Union[Unset, None, int] = UNSET,
146
+ ) -> Optional[DescribeAppResponse]:
147
+ """Describe app
148
+
149
+ Get all the runs for the current account.
150
+
151
+ Args:
152
+ name (str): The name of the app to fetch.
153
+ runs (Union[Unset, None, int]): The number of recent runs to fetch for the app.
154
+
155
+ Returns:
156
+ Response[DescribeAppResponse]
157
+ """
158
+
159
+ return (
160
+ await asyncio_detailed(
161
+ name=name,
162
+ client=client,
163
+ runs=runs,
164
+ )
165
+ ).parsed