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.list_app_environments_response import ListAppEnvironmentsResponse
8
+ from ...types import Response
9
+
10
+
11
+ def _get_kwargs(
12
+ name: str,
13
+ *,
14
+ client: AuthenticatedClient,
15
+ ) -> Dict[str, Any]:
16
+ url = "{}/apps/{name}/environments".format(client.base_url, name=name)
17
+
18
+ headers: Dict[str, str] = client.get_headers()
19
+ cookies: Dict[str, Any] = client.get_cookies()
20
+
21
+ return {
22
+ "method": "get",
23
+ "url": url,
24
+ "headers": headers,
25
+ "cookies": cookies,
26
+ "timeout": client.get_timeout(),
27
+ }
28
+
29
+
30
+ def _parse_response(
31
+ *, response: httpx.Response
32
+ ) -> Optional[ListAppEnvironmentsResponse]:
33
+ if response.status_code == 200:
34
+ response_200 = ListAppEnvironmentsResponse.from_dict(response.json())
35
+
36
+ return response_200
37
+ return None
38
+
39
+
40
+ def _build_response(
41
+ *, response: httpx.Response
42
+ ) -> Response[ListAppEnvironmentsResponse]:
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
+ ) -> Response[ListAppEnvironmentsResponse]:
56
+ """List app environments
57
+
58
+ Generates a list of all the known environments for a given app in the current account.
59
+
60
+ Args:
61
+ name (str): The name of the app to get the version for.
62
+
63
+ Returns:
64
+ Response[ListAppEnvironmentsResponse]
65
+ """
66
+
67
+ kwargs = _get_kwargs(
68
+ name=name,
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
+ *,
83
+ client: AuthenticatedClient,
84
+ ) -> Optional[ListAppEnvironmentsResponse]:
85
+ """List app environments
86
+
87
+ Generates a list of all the known environments for a given app in the current account.
88
+
89
+ Args:
90
+ name (str): The name of the app to get the version for.
91
+
92
+ Returns:
93
+ Response[ListAppEnvironmentsResponse]
94
+ """
95
+
96
+ return sync_detailed(
97
+ name=name,
98
+ client=client,
99
+ ).parsed
100
+
101
+
102
+ async def asyncio_detailed(
103
+ name: str,
104
+ *,
105
+ client: AuthenticatedClient,
106
+ ) -> Response[ListAppEnvironmentsResponse]:
107
+ """List app environments
108
+
109
+ Generates a list of all the known environments for a given app in the current account.
110
+
111
+ Args:
112
+ name (str): The name of the app to get the version for.
113
+
114
+ Returns:
115
+ Response[ListAppEnvironmentsResponse]
116
+ """
117
+
118
+ kwargs = _get_kwargs(
119
+ name=name,
120
+ client=client,
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
+ name: str,
131
+ *,
132
+ client: AuthenticatedClient,
133
+ ) -> Optional[ListAppEnvironmentsResponse]:
134
+ """List app environments
135
+
136
+ Generates a list of all the known environments for a given app in the current account.
137
+
138
+ Args:
139
+ name (str): The name of the app to get the version for.
140
+
141
+ Returns:
142
+ Response[ListAppEnvironmentsResponse]
143
+ """
144
+
145
+ return (
146
+ await asyncio_detailed(
147
+ name=name,
148
+ client=client,
149
+ )
150
+ ).parsed
@@ -0,0 +1,146 @@
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_app_versions_response import ListAppVersionsResponse
8
+ from ...types import Response
9
+
10
+
11
+ def _get_kwargs(
12
+ name: str,
13
+ *,
14
+ client: AuthenticatedClient,
15
+ ) -> Dict[str, Any]:
16
+ url = "{}/apps/{name}/versions".format(client.base_url, name=name)
17
+
18
+ headers: Dict[str, str] = client.get_headers()
19
+ cookies: Dict[str, Any] = client.get_cookies()
20
+
21
+ return {
22
+ "method": "get",
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[ListAppVersionsResponse]:
31
+ if response.status_code == 200:
32
+ response_200 = ListAppVersionsResponse.from_dict(response.json())
33
+
34
+ return response_200
35
+ return None
36
+
37
+
38
+ def _build_response(*, response: httpx.Response) -> Response[ListAppVersionsResponse]:
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
+ name: str,
49
+ *,
50
+ client: AuthenticatedClient,
51
+ ) -> Response[ListAppVersionsResponse]:
52
+ """List app versions
53
+
54
+ List all versions of an app in the current account, sorted with the most recent first.
55
+
56
+ Args:
57
+ name (str): The name of the app to list versions for.
58
+
59
+ Returns:
60
+ Response[ListAppVersionsResponse]
61
+ """
62
+
63
+ kwargs = _get_kwargs(
64
+ name=name,
65
+ client=client,
66
+ )
67
+
68
+ response = httpx.request(
69
+ verify=client.verify_ssl,
70
+ **kwargs,
71
+ )
72
+
73
+ return _build_response(response=response)
74
+
75
+
76
+ def sync(
77
+ name: str,
78
+ *,
79
+ client: AuthenticatedClient,
80
+ ) -> Optional[ListAppVersionsResponse]:
81
+ """List app versions
82
+
83
+ List all versions of an app in the current account, sorted with the most recent first.
84
+
85
+ Args:
86
+ name (str): The name of the app to list versions for.
87
+
88
+ Returns:
89
+ Response[ListAppVersionsResponse]
90
+ """
91
+
92
+ return sync_detailed(
93
+ name=name,
94
+ client=client,
95
+ ).parsed
96
+
97
+
98
+ async def asyncio_detailed(
99
+ name: str,
100
+ *,
101
+ client: AuthenticatedClient,
102
+ ) -> Response[ListAppVersionsResponse]:
103
+ """List app versions
104
+
105
+ List all versions of an app in the current account, sorted with the most recent first.
106
+
107
+ Args:
108
+ name (str): The name of the app to list versions for.
109
+
110
+ Returns:
111
+ Response[ListAppVersionsResponse]
112
+ """
113
+
114
+ kwargs = _get_kwargs(
115
+ name=name,
116
+ client=client,
117
+ )
118
+
119
+ async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
120
+ response = await _client.request(**kwargs)
121
+
122
+ return _build_response(response=response)
123
+
124
+
125
+ async def asyncio(
126
+ name: str,
127
+ *,
128
+ client: AuthenticatedClient,
129
+ ) -> Optional[ListAppVersionsResponse]:
130
+ """List app versions
131
+
132
+ List all versions of an app in the current account, sorted with the most recent first.
133
+
134
+ Args:
135
+ name (str): The name of the app to list versions for.
136
+
137
+ Returns:
138
+ Response[ListAppVersionsResponse]
139
+ """
140
+
141
+ return (
142
+ await asyncio_detailed(
143
+ name=name,
144
+ client=client,
145
+ )
146
+ ).parsed
@@ -0,0 +1,247 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Dict, List, Optional, Union
3
+
4
+ import httpx
5
+
6
+ from ...client import AuthenticatedClient
7
+ from ...models.list_apps_response import ListAppsResponse
8
+ from ...models.list_apps_status_item import ListAppsStatusItem
9
+ from ...types import UNSET, Response, Unset
10
+
11
+
12
+ def _get_kwargs(
13
+ *,
14
+ client: AuthenticatedClient,
15
+ query: Union[Unset, None, str] = UNSET,
16
+ page: Union[Unset, None, int] = UNSET,
17
+ page_size: Union[Unset, None, int] = UNSET,
18
+ period: Union[Unset, None, str] = UNSET,
19
+ num_runs: Union[Unset, None, int] = 20,
20
+ status: Union[Unset, None, List[ListAppsStatusItem]] = UNSET,
21
+ ) -> Dict[str, Any]:
22
+ url = "{}/apps".format(client.base_url)
23
+
24
+ headers: Dict[str, str] = client.get_headers()
25
+ cookies: Dict[str, Any] = client.get_cookies()
26
+
27
+ params: Dict[str, Any] = {}
28
+ params["query"] = query
29
+
30
+ params["page"] = page
31
+
32
+ params["page_size"] = page_size
33
+
34
+ params["period"] = period
35
+
36
+ params["num_runs"] = num_runs
37
+
38
+ json_status: Union[Unset, None, List[str]] = UNSET
39
+ if not isinstance(status, Unset):
40
+ if status is None:
41
+ json_status = None
42
+ else:
43
+ json_status = []
44
+ for status_item_data in status:
45
+ status_item = status_item_data.value
46
+
47
+ json_status.append(status_item)
48
+
49
+ params["status"] = json_status
50
+
51
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
52
+
53
+ return {
54
+ "method": "get",
55
+ "url": url,
56
+ "headers": headers,
57
+ "cookies": cookies,
58
+ "timeout": client.get_timeout(),
59
+ "params": params,
60
+ }
61
+
62
+
63
+ def _parse_response(*, response: httpx.Response) -> Optional[ListAppsResponse]:
64
+ if response.status_code == 200:
65
+ response_200 = ListAppsResponse.from_dict(response.json())
66
+
67
+ return response_200
68
+ return None
69
+
70
+
71
+ def _build_response(*, response: httpx.Response) -> Response[ListAppsResponse]:
72
+ return Response(
73
+ status_code=HTTPStatus(response.status_code),
74
+ content=response.content,
75
+ headers=response.headers,
76
+ parsed=_parse_response(response=response),
77
+ )
78
+
79
+
80
+ def sync_detailed(
81
+ *,
82
+ client: AuthenticatedClient,
83
+ query: Union[Unset, None, str] = UNSET,
84
+ page: Union[Unset, None, int] = UNSET,
85
+ page_size: Union[Unset, None, int] = UNSET,
86
+ period: Union[Unset, None, str] = UNSET,
87
+ num_runs: Union[Unset, None, int] = 20,
88
+ status: Union[Unset, None, List[ListAppsStatusItem]] = UNSET,
89
+ ) -> Response[ListAppsResponse]:
90
+ """List apps
91
+
92
+ Get all the apps for the current account.
93
+
94
+ Args:
95
+ query (Union[Unset, None, str]): The search query to filter apps by.
96
+ page (Union[Unset, None, int]): The page number to fetch.
97
+ page_size (Union[Unset, None, int]): The number of records to fetch on each page.
98
+ period (Union[Unset, None, str]): Time period for statistics (24h, 7d, 30d, or none)
99
+ num_runs (Union[Unset, None, int]): Number of recent runs to fetch (-1 for all runs,
100
+ defaults to 20) Default: 20.
101
+ status (Union[Unset, None, List[ListAppsStatusItem]]): Filter apps by status(es) (comma
102
+ separated for multiple). Valid values: active, failed, disabled etc.
103
+
104
+ Returns:
105
+ Response[ListAppsResponse]
106
+ """
107
+
108
+ kwargs = _get_kwargs(
109
+ client=client,
110
+ query=query,
111
+ page=page,
112
+ page_size=page_size,
113
+ period=period,
114
+ num_runs=num_runs,
115
+ status=status,
116
+ )
117
+
118
+ response = httpx.request(
119
+ verify=client.verify_ssl,
120
+ **kwargs,
121
+ )
122
+
123
+ return _build_response(response=response)
124
+
125
+
126
+ def sync(
127
+ *,
128
+ client: AuthenticatedClient,
129
+ query: Union[Unset, None, str] = UNSET,
130
+ page: Union[Unset, None, int] = UNSET,
131
+ page_size: Union[Unset, None, int] = UNSET,
132
+ period: Union[Unset, None, str] = UNSET,
133
+ num_runs: Union[Unset, None, int] = 20,
134
+ status: Union[Unset, None, List[ListAppsStatusItem]] = UNSET,
135
+ ) -> Optional[ListAppsResponse]:
136
+ """List apps
137
+
138
+ Get all the apps for the current account.
139
+
140
+ Args:
141
+ query (Union[Unset, None, str]): The search query to filter apps by.
142
+ page (Union[Unset, None, int]): The page number to fetch.
143
+ page_size (Union[Unset, None, int]): The number of records to fetch on each page.
144
+ period (Union[Unset, None, str]): Time period for statistics (24h, 7d, 30d, or none)
145
+ num_runs (Union[Unset, None, int]): Number of recent runs to fetch (-1 for all runs,
146
+ defaults to 20) Default: 20.
147
+ status (Union[Unset, None, List[ListAppsStatusItem]]): Filter apps by status(es) (comma
148
+ separated for multiple). Valid values: active, failed, disabled etc.
149
+
150
+ Returns:
151
+ Response[ListAppsResponse]
152
+ """
153
+
154
+ return sync_detailed(
155
+ client=client,
156
+ query=query,
157
+ page=page,
158
+ page_size=page_size,
159
+ period=period,
160
+ num_runs=num_runs,
161
+ status=status,
162
+ ).parsed
163
+
164
+
165
+ async def asyncio_detailed(
166
+ *,
167
+ client: AuthenticatedClient,
168
+ query: Union[Unset, None, str] = UNSET,
169
+ page: Union[Unset, None, int] = UNSET,
170
+ page_size: Union[Unset, None, int] = UNSET,
171
+ period: Union[Unset, None, str] = UNSET,
172
+ num_runs: Union[Unset, None, int] = 20,
173
+ status: Union[Unset, None, List[ListAppsStatusItem]] = UNSET,
174
+ ) -> Response[ListAppsResponse]:
175
+ """List apps
176
+
177
+ Get all the apps for the current account.
178
+
179
+ Args:
180
+ query (Union[Unset, None, str]): The search query to filter apps by.
181
+ page (Union[Unset, None, int]): The page number to fetch.
182
+ page_size (Union[Unset, None, int]): The number of records to fetch on each page.
183
+ period (Union[Unset, None, str]): Time period for statistics (24h, 7d, 30d, or none)
184
+ num_runs (Union[Unset, None, int]): Number of recent runs to fetch (-1 for all runs,
185
+ defaults to 20) Default: 20.
186
+ status (Union[Unset, None, List[ListAppsStatusItem]]): Filter apps by status(es) (comma
187
+ separated for multiple). Valid values: active, failed, disabled etc.
188
+
189
+ Returns:
190
+ Response[ListAppsResponse]
191
+ """
192
+
193
+ kwargs = _get_kwargs(
194
+ client=client,
195
+ query=query,
196
+ page=page,
197
+ page_size=page_size,
198
+ period=period,
199
+ num_runs=num_runs,
200
+ status=status,
201
+ )
202
+
203
+ async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
204
+ response = await _client.request(**kwargs)
205
+
206
+ return _build_response(response=response)
207
+
208
+
209
+ async def asyncio(
210
+ *,
211
+ client: AuthenticatedClient,
212
+ query: Union[Unset, None, str] = UNSET,
213
+ page: Union[Unset, None, int] = UNSET,
214
+ page_size: Union[Unset, None, int] = UNSET,
215
+ period: Union[Unset, None, str] = UNSET,
216
+ num_runs: Union[Unset, None, int] = 20,
217
+ status: Union[Unset, None, List[ListAppsStatusItem]] = UNSET,
218
+ ) -> Optional[ListAppsResponse]:
219
+ """List apps
220
+
221
+ Get all the apps for the current account.
222
+
223
+ Args:
224
+ query (Union[Unset, None, str]): The search query to filter apps by.
225
+ page (Union[Unset, None, int]): The page number to fetch.
226
+ page_size (Union[Unset, None, int]): The number of records to fetch on each page.
227
+ period (Union[Unset, None, str]): Time period for statistics (24h, 7d, 30d, or none)
228
+ num_runs (Union[Unset, None, int]): Number of recent runs to fetch (-1 for all runs,
229
+ defaults to 20) Default: 20.
230
+ status (Union[Unset, None, List[ListAppsStatusItem]]): Filter apps by status(es) (comma
231
+ separated for multiple). Valid values: active, failed, disabled etc.
232
+
233
+ Returns:
234
+ Response[ListAppsResponse]
235
+ """
236
+
237
+ return (
238
+ await asyncio_detailed(
239
+ client=client,
240
+ query=query,
241
+ page=page,
242
+ page_size=page_size,
243
+ period=period,
244
+ num_runs=num_runs,
245
+ status=status,
246
+ )
247
+ ).parsed
@@ -0,0 +1,129 @@
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_my_team_invitations_response import ListMyTeamInvitationsResponse
8
+ from ...types import Response
9
+
10
+
11
+ def _get_kwargs(
12
+ *,
13
+ client: AuthenticatedClient,
14
+ ) -> Dict[str, Any]:
15
+ url = "{}/team-invites".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(
30
+ *, response: httpx.Response
31
+ ) -> Optional[ListMyTeamInvitationsResponse]:
32
+ if response.status_code == 200:
33
+ response_200 = ListMyTeamInvitationsResponse.from_dict(response.json())
34
+
35
+ return response_200
36
+ return None
37
+
38
+
39
+ def _build_response(
40
+ *, response: httpx.Response
41
+ ) -> Response[ListMyTeamInvitationsResponse]:
42
+ return Response(
43
+ status_code=HTTPStatus(response.status_code),
44
+ content=response.content,
45
+ headers=response.headers,
46
+ parsed=_parse_response(response=response),
47
+ )
48
+
49
+
50
+ def sync_detailed(
51
+ *,
52
+ client: AuthenticatedClient,
53
+ ) -> Response[ListMyTeamInvitationsResponse]:
54
+ """List My Team Invitations
55
+
56
+ List your pending invitations for teams
57
+
58
+ Returns:
59
+ Response[ListMyTeamInvitationsResponse]
60
+ """
61
+
62
+ kwargs = _get_kwargs(
63
+ client=client,
64
+ )
65
+
66
+ response = httpx.request(
67
+ verify=client.verify_ssl,
68
+ **kwargs,
69
+ )
70
+
71
+ return _build_response(response=response)
72
+
73
+
74
+ def sync(
75
+ *,
76
+ client: AuthenticatedClient,
77
+ ) -> Optional[ListMyTeamInvitationsResponse]:
78
+ """List My Team Invitations
79
+
80
+ List your pending invitations for teams
81
+
82
+ Returns:
83
+ Response[ListMyTeamInvitationsResponse]
84
+ """
85
+
86
+ return sync_detailed(
87
+ client=client,
88
+ ).parsed
89
+
90
+
91
+ async def asyncio_detailed(
92
+ *,
93
+ client: AuthenticatedClient,
94
+ ) -> Response[ListMyTeamInvitationsResponse]:
95
+ """List My Team Invitations
96
+
97
+ List your pending invitations for teams
98
+
99
+ Returns:
100
+ Response[ListMyTeamInvitationsResponse]
101
+ """
102
+
103
+ kwargs = _get_kwargs(
104
+ client=client,
105
+ )
106
+
107
+ async with httpx.AsyncClient(verify=client.verify_ssl) as _client:
108
+ response = await _client.request(**kwargs)
109
+
110
+ return _build_response(response=response)
111
+
112
+
113
+ async def asyncio(
114
+ *,
115
+ client: AuthenticatedClient,
116
+ ) -> Optional[ListMyTeamInvitationsResponse]:
117
+ """List My Team Invitations
118
+
119
+ List your pending invitations for teams
120
+
121
+ Returns:
122
+ Response[ListMyTeamInvitationsResponse]
123
+ """
124
+
125
+ return (
126
+ await asyncio_detailed(
127
+ client=client,
128
+ )
129
+ ).parsed