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,159 @@
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.get_run_logs_output_body import GetRunLogsOutputBody
8
+ from ...types import Response
9
+
10
+
11
+ def _get_kwargs(
12
+ name: str,
13
+ seq: int,
14
+ *,
15
+ client: AuthenticatedClient,
16
+ ) -> Dict[str, Any]:
17
+ url = "{}/apps/{name}/runs/{seq}/logs".format(client.base_url, name=name, seq=seq)
18
+
19
+ headers: Dict[str, str] = client.get_headers()
20
+ cookies: Dict[str, Any] = client.get_cookies()
21
+
22
+ return {
23
+ "method": "get",
24
+ "url": url,
25
+ "headers": headers,
26
+ "cookies": cookies,
27
+ "timeout": client.get_timeout(),
28
+ }
29
+
30
+
31
+ def _parse_response(*, response: httpx.Response) -> Optional[GetRunLogsOutputBody]:
32
+ if response.status_code == 200:
33
+ response_200 = GetRunLogsOutputBody.from_dict(response.json())
34
+
35
+ return response_200
36
+ return None
37
+
38
+
39
+ def _build_response(*, response: httpx.Response) -> Response[GetRunLogsOutputBody]:
40
+ return Response(
41
+ status_code=HTTPStatus(response.status_code),
42
+ content=response.content,
43
+ headers=response.headers,
44
+ parsed=_parse_response(response=response),
45
+ )
46
+
47
+
48
+ def sync_detailed(
49
+ name: str,
50
+ seq: int,
51
+ *,
52
+ client: AuthenticatedClient,
53
+ ) -> Response[GetRunLogsOutputBody]:
54
+ """Get logs for a specific app run.
55
+
56
+ Retrieves the logs associated with a particular run of an app.
57
+
58
+ Args:
59
+ name (str): The name of the app to get logs for.
60
+ seq (int): The sequence number of the run to get logs for.
61
+
62
+ Returns:
63
+ Response[GetRunLogsOutputBody]
64
+ """
65
+
66
+ kwargs = _get_kwargs(
67
+ name=name,
68
+ seq=seq,
69
+ client=client,
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
+ name: str,
82
+ seq: int,
83
+ *,
84
+ client: AuthenticatedClient,
85
+ ) -> Optional[GetRunLogsOutputBody]:
86
+ """Get logs for a specific app run.
87
+
88
+ Retrieves the logs associated with a particular run of an app.
89
+
90
+ Args:
91
+ name (str): The name of the app to get logs for.
92
+ seq (int): The sequence number of the run to get logs for.
93
+
94
+ Returns:
95
+ Response[GetRunLogsOutputBody]
96
+ """
97
+
98
+ return sync_detailed(
99
+ name=name,
100
+ seq=seq,
101
+ client=client,
102
+ ).parsed
103
+
104
+
105
+ async def asyncio_detailed(
106
+ name: str,
107
+ seq: int,
108
+ *,
109
+ client: AuthenticatedClient,
110
+ ) -> Response[GetRunLogsOutputBody]:
111
+ """Get logs for a specific app run.
112
+
113
+ Retrieves the logs associated with a particular run of an app.
114
+
115
+ Args:
116
+ name (str): The name of the app to get logs for.
117
+ seq (int): The sequence number of the run to get logs for.
118
+
119
+ Returns:
120
+ Response[GetRunLogsOutputBody]
121
+ """
122
+
123
+ kwargs = _get_kwargs(
124
+ name=name,
125
+ seq=seq,
126
+ client=client,
127
+ )
128
+
129
+ async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
130
+ response = await _client.request(**kwargs)
131
+
132
+ return _build_response(response=response)
133
+
134
+
135
+ async def asyncio(
136
+ name: str,
137
+ seq: int,
138
+ *,
139
+ client: AuthenticatedClient,
140
+ ) -> Optional[GetRunLogsOutputBody]:
141
+ """Get logs for a specific app run.
142
+
143
+ Retrieves the logs associated with a particular run of an app.
144
+
145
+ Args:
146
+ name (str): The name of the app to get logs for.
147
+ seq (int): The sequence number of the run to get logs for.
148
+
149
+ Returns:
150
+ Response[GetRunLogsOutputBody]
151
+ """
152
+
153
+ return (
154
+ await asyncio_detailed(
155
+ name=name,
156
+ seq=seq,
157
+ client=client,
158
+ )
159
+ ).parsed
@@ -0,0 +1,163 @@
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.invite_team_member_params import InviteTeamMemberParams
8
+ from ...models.invite_team_member_response import InviteTeamMemberResponse
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs(
13
+ slug: str,
14
+ *,
15
+ client: AuthenticatedClient,
16
+ json_body: InviteTeamMemberParams,
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": "post",
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(*, response: httpx.Response) -> Optional[InviteTeamMemberResponse]:
36
+ if response.status_code == 200:
37
+ response_200 = InviteTeamMemberResponse.from_dict(response.json())
38
+
39
+ return response_200
40
+ return None
41
+
42
+
43
+ def _build_response(*, response: httpx.Response) -> Response[InviteTeamMemberResponse]:
44
+ return Response(
45
+ status_code=HTTPStatus(response.status_code),
46
+ content=response.content,
47
+ headers=response.headers,
48
+ parsed=_parse_response(response=response),
49
+ )
50
+
51
+
52
+ def sync_detailed(
53
+ slug: str,
54
+ *,
55
+ client: AuthenticatedClient,
56
+ json_body: InviteTeamMemberParams,
57
+ ) -> Response[InviteTeamMemberResponse]:
58
+ """Invite Team Member
59
+
60
+ Invite a new team
61
+
62
+ Args:
63
+ slug (str): The slug of the team to invite someone to
64
+ json_body (InviteTeamMemberParams):
65
+
66
+ Returns:
67
+ Response[InviteTeamMemberResponse]
68
+ """
69
+
70
+ kwargs = _get_kwargs(
71
+ slug=slug,
72
+ client=client,
73
+ json_body=json_body,
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
+ slug: str,
86
+ *,
87
+ client: AuthenticatedClient,
88
+ json_body: InviteTeamMemberParams,
89
+ ) -> Optional[InviteTeamMemberResponse]:
90
+ """Invite Team Member
91
+
92
+ Invite a new team
93
+
94
+ Args:
95
+ slug (str): The slug of the team to invite someone to
96
+ json_body (InviteTeamMemberParams):
97
+
98
+ Returns:
99
+ Response[InviteTeamMemberResponse]
100
+ """
101
+
102
+ return sync_detailed(
103
+ slug=slug,
104
+ client=client,
105
+ json_body=json_body,
106
+ ).parsed
107
+
108
+
109
+ async def asyncio_detailed(
110
+ slug: str,
111
+ *,
112
+ client: AuthenticatedClient,
113
+ json_body: InviteTeamMemberParams,
114
+ ) -> Response[InviteTeamMemberResponse]:
115
+ """Invite Team Member
116
+
117
+ Invite a new team
118
+
119
+ Args:
120
+ slug (str): The slug of the team to invite someone to
121
+ json_body (InviteTeamMemberParams):
122
+
123
+ Returns:
124
+ Response[InviteTeamMemberResponse]
125
+ """
126
+
127
+ kwargs = _get_kwargs(
128
+ slug=slug,
129
+ client=client,
130
+ json_body=json_body,
131
+ )
132
+
133
+ async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
134
+ response = await _client.request(**kwargs)
135
+
136
+ return _build_response(response=response)
137
+
138
+
139
+ async def asyncio(
140
+ slug: str,
141
+ *,
142
+ client: AuthenticatedClient,
143
+ json_body: InviteTeamMemberParams,
144
+ ) -> Optional[InviteTeamMemberResponse]:
145
+ """Invite Team Member
146
+
147
+ Invite a new team
148
+
149
+ Args:
150
+ slug (str): The slug of the team to invite someone to
151
+ json_body (InviteTeamMemberParams):
152
+
153
+ Returns:
154
+ Response[InviteTeamMemberResponse]
155
+ """
156
+
157
+ return (
158
+ await asyncio_detailed(
159
+ slug=slug,
160
+ client=client,
161
+ json_body=json_body,
162
+ )
163
+ ).parsed
@@ -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.leave_team_response import LeaveTeamResponse
8
+ from ...types import Response
9
+
10
+
11
+ def _get_kwargs(
12
+ slug: str,
13
+ *,
14
+ client: AuthenticatedClient,
15
+ ) -> Dict[str, Any]:
16
+ url = "{}/teams/{slug}/leave".format(client.base_url, slug=slug)
17
+
18
+ headers: Dict[str, str] = client.get_headers()
19
+ cookies: Dict[str, Any] = client.get_cookies()
20
+
21
+ return {
22
+ "method": "post",
23
+ "url": url,
24
+ "headers": headers,
25
+ "cookies": cookies,
26
+ "timeout": client.get_timeout(),
27
+ }
28
+
29
+
30
+ def _parse_response(*, response: httpx.Response) -> Optional[LeaveTeamResponse]:
31
+ if response.status_code == 200:
32
+ response_200 = LeaveTeamResponse.from_dict(response.json())
33
+
34
+ return response_200
35
+ return None
36
+
37
+
38
+ def _build_response(*, response: httpx.Response) -> Response[LeaveTeamResponse]:
39
+ return Response(
40
+ status_code=HTTPStatus(response.status_code),
41
+ content=response.content,
42
+ headers=response.headers,
43
+ parsed=_parse_response(response=response),
44
+ )
45
+
46
+
47
+ def sync_detailed(
48
+ slug: str,
49
+ *,
50
+ client: AuthenticatedClient,
51
+ ) -> Response[LeaveTeamResponse]:
52
+ """Leave Team
53
+
54
+ Remove yourself from a team, if that's something you'd like to do for whatever reason. If you're the
55
+ last member of a team, you cannot remove yourself. You should delete the team instead.
56
+
57
+ Args:
58
+ slug (str): The slug of the team to leave
59
+
60
+ Returns:
61
+ Response[LeaveTeamResponse]
62
+ """
63
+
64
+ kwargs = _get_kwargs(
65
+ slug=slug,
66
+ client=client,
67
+ )
68
+
69
+ response = httpx.request(
70
+ verify=client.verify_ssl,
71
+ **kwargs,
72
+ )
73
+
74
+ return _build_response(response=response)
75
+
76
+
77
+ def sync(
78
+ slug: str,
79
+ *,
80
+ client: AuthenticatedClient,
81
+ ) -> Optional[LeaveTeamResponse]:
82
+ """Leave Team
83
+
84
+ Remove yourself from a team, if that's something you'd like to do for whatever reason. If you're the
85
+ last member of a team, you cannot remove yourself. You should delete the team instead.
86
+
87
+ Args:
88
+ slug (str): The slug of the team to leave
89
+
90
+ Returns:
91
+ Response[LeaveTeamResponse]
92
+ """
93
+
94
+ return sync_detailed(
95
+ slug=slug,
96
+ client=client,
97
+ ).parsed
98
+
99
+
100
+ async def asyncio_detailed(
101
+ slug: str,
102
+ *,
103
+ client: AuthenticatedClient,
104
+ ) -> Response[LeaveTeamResponse]:
105
+ """Leave Team
106
+
107
+ Remove yourself from a team, if that's something you'd like to do for whatever reason. If you're the
108
+ last member of a team, you cannot remove yourself. You should delete the team instead.
109
+
110
+ Args:
111
+ slug (str): The slug of the team to leave
112
+
113
+ Returns:
114
+ Response[LeaveTeamResponse]
115
+ """
116
+
117
+ kwargs = _get_kwargs(
118
+ slug=slug,
119
+ client=client,
120
+ )
121
+
122
+ async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
123
+ response = await _client.request(**kwargs)
124
+
125
+ return _build_response(response=response)
126
+
127
+
128
+ async def asyncio(
129
+ slug: str,
130
+ *,
131
+ client: AuthenticatedClient,
132
+ ) -> Optional[LeaveTeamResponse]:
133
+ """Leave Team
134
+
135
+ Remove yourself from a team, if that's something you'd like to do for whatever reason. If you're the
136
+ last member of a team, you cannot remove yourself. You should delete the team instead.
137
+
138
+ Args:
139
+ slug (str): The slug of the team to leave
140
+
141
+ Returns:
142
+ Response[LeaveTeamResponse]
143
+ """
144
+
145
+ return (
146
+ await asyncio_detailed(
147
+ slug=slug,
148
+ client=client,
149
+ )
150
+ ).parsed
@@ -0,0 +1,125 @@
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.list_api_keys_response import ListAPIKeysResponse
8
+ from ...types import Response
9
+
10
+
11
+ def _get_kwargs(
12
+ *,
13
+ client: AuthenticatedClient,
14
+ ) -> Dict[str, Any]:
15
+ url = "{}/api-keys".format(client.base_url)
16
+
17
+ headers: Dict[str, str] = client.get_headers()
18
+ cookies: Dict[str, Any] = client.get_cookies()
19
+
20
+ return {
21
+ "method": "get",
22
+ "url": url,
23
+ "headers": headers,
24
+ "cookies": cookies,
25
+ "timeout": client.get_timeout(),
26
+ }
27
+
28
+
29
+ def _parse_response(*, response: httpx.Response) -> Optional[ListAPIKeysResponse]:
30
+ if response.status_code == 200:
31
+ response_200 = ListAPIKeysResponse.from_dict(response.json())
32
+
33
+ return response_200
34
+ return None
35
+
36
+
37
+ def _build_response(*, response: httpx.Response) -> Response[ListAPIKeysResponse]:
38
+ return Response(
39
+ status_code=HTTPStatus(response.status_code),
40
+ content=response.content,
41
+ headers=response.headers,
42
+ parsed=_parse_response(response=response),
43
+ )
44
+
45
+
46
+ def sync_detailed(
47
+ *,
48
+ client: AuthenticatedClient,
49
+ ) -> Response[ListAPIKeysResponse]:
50
+ """List API Keys
51
+
52
+ List all the API keys associated with your current account.
53
+
54
+ Returns:
55
+ Response[ListAPIKeysResponse]
56
+ """
57
+
58
+ kwargs = _get_kwargs(
59
+ client=client,
60
+ )
61
+
62
+ response = httpx.request(
63
+ verify=client.verify_ssl,
64
+ **kwargs,
65
+ )
66
+
67
+ return _build_response(response=response)
68
+
69
+
70
+ def sync(
71
+ *,
72
+ client: AuthenticatedClient,
73
+ ) -> Optional[ListAPIKeysResponse]:
74
+ """List API Keys
75
+
76
+ List all the API keys associated with your current account.
77
+
78
+ Returns:
79
+ Response[ListAPIKeysResponse]
80
+ """
81
+
82
+ return sync_detailed(
83
+ client=client,
84
+ ).parsed
85
+
86
+
87
+ async def asyncio_detailed(
88
+ *,
89
+ client: AuthenticatedClient,
90
+ ) -> Response[ListAPIKeysResponse]:
91
+ """List API Keys
92
+
93
+ List all the API keys associated with your current account.
94
+
95
+ Returns:
96
+ Response[ListAPIKeysResponse]
97
+ """
98
+
99
+ kwargs = _get_kwargs(
100
+ client=client,
101
+ )
102
+
103
+ async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
104
+ response = await _client.request(**kwargs)
105
+
106
+ return _build_response(response=response)
107
+
108
+
109
+ async def asyncio(
110
+ *,
111
+ client: AuthenticatedClient,
112
+ ) -> Optional[ListAPIKeysResponse]:
113
+ """List API Keys
114
+
115
+ List all the API keys associated with your current account.
116
+
117
+ Returns:
118
+ Response[ListAPIKeysResponse]
119
+ """
120
+
121
+ return (
122
+ await asyncio_detailed(
123
+ client=client,
124
+ )
125
+ ).parsed