maws 25.12.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.
Files changed (31) hide show
  1. maws/__init__.py +2 -0
  2. maws/clients/.gitignore +23 -0
  3. maws/clients/.ruff_cache/.gitignore +2 -0
  4. maws/clients/.ruff_cache/0.12.8/1537955332066184707 +0 -0
  5. maws/clients/.ruff_cache/CACHEDIR.TAG +1 -0
  6. maws/clients/README.md +123 -0
  7. maws/clients/ecs_service_deployment_client/__init__.py +8 -0
  8. maws/clients/ecs_service_deployment_client/api/__init__.py +1 -0
  9. maws/clients/ecs_service_deployment_client/api/services/__init__.py +1 -0
  10. maws/clients/ecs_service_deployment_client/api/services/get_service.py +171 -0
  11. maws/clients/ecs_service_deployment_client/api/services/get_services.py +85 -0
  12. maws/clients/ecs_service_deployment_client/api/services/patch_service.py +189 -0
  13. maws/clients/ecs_service_deployment_client/api/tasks/__init__.py +1 -0
  14. maws/clients/ecs_service_deployment_client/api/tasks/get_tasks.py +85 -0
  15. maws/clients/ecs_service_deployment_client/api/tasks/patch_task.py +193 -0
  16. maws/clients/ecs_service_deployment_client/client.py +268 -0
  17. maws/clients/ecs_service_deployment_client/errors.py +16 -0
  18. maws/clients/ecs_service_deployment_client/models/__init__.py +11 -0
  19. maws/clients/ecs_service_deployment_client/models/error_response.py +76 -0
  20. maws/clients/ecs_service_deployment_client/models/service_deployment_request.py +113 -0
  21. maws/clients/ecs_service_deployment_client/models/task_deployment_request.py +61 -0
  22. maws/clients/ecs_service_deployment_client/py.typed +1 -0
  23. maws/clients/ecs_service_deployment_client/types.py +54 -0
  24. maws/clients/pyproject.toml +29 -0
  25. maws/commands/ecs.py +116 -0
  26. maws/config.py +109 -0
  27. maws/main.py +18 -0
  28. maws-25.12.0.dist-info/METADATA +72 -0
  29. maws-25.12.0.dist-info/RECORD +31 -0
  30. maws-25.12.0.dist-info/WHEEL +4 -0
  31. maws-25.12.0.dist-info/entry_points.txt +3 -0
maws/__init__.py ADDED
@@ -0,0 +1,2 @@
1
+ __app_name__ = "maws"
2
+ __version__ = "0.0.1"
@@ -0,0 +1,23 @@
1
+ __pycache__/
2
+ build/
3
+ dist/
4
+ *.egg-info/
5
+ .pytest_cache/
6
+
7
+ # pyenv
8
+ .python-version
9
+
10
+ # Environments
11
+ .env
12
+ .venv
13
+
14
+ # mypy
15
+ .mypy_cache/
16
+ .dmypy.json
17
+ dmypy.json
18
+
19
+ # JetBrains
20
+ .idea/
21
+
22
+ /coverage.xml
23
+ /.coverage
@@ -0,0 +1,2 @@
1
+ # Automatically created by ruff.
2
+ *
@@ -0,0 +1 @@
1
+ Signature: 8a477f597d28d172789f06886806bc55
maws/clients/README.md ADDED
@@ -0,0 +1,123 @@
1
+ # ecs-service-deployment-client
2
+ A client library for accessing ECS Service Deployment
3
+
4
+ ## Usage
5
+ First, create a client:
6
+
7
+ ```python
8
+ from ecs_service_deployment_client import Client
9
+
10
+ client = Client(base_url="https://api.example.com")
11
+ ```
12
+
13
+ If the endpoints you're going to hit require authentication, use `AuthenticatedClient` instead:
14
+
15
+ ```python
16
+ from ecs_service_deployment_client import AuthenticatedClient
17
+
18
+ client = AuthenticatedClient(base_url="https://api.example.com", token="SuperSecretToken")
19
+ ```
20
+
21
+ Now call your endpoint and use your models:
22
+
23
+ ```python
24
+ from ecs_service_deployment_client.models import MyDataModel
25
+ from ecs_service_deployment_client.api.my_tag import get_my_data_model
26
+ from ecs_service_deployment_client.types import Response
27
+
28
+ with client as client:
29
+ my_data: MyDataModel = get_my_data_model.sync(client=client)
30
+ # or if you need more info (e.g. status_code)
31
+ response: Response[MyDataModel] = get_my_data_model.sync_detailed(client=client)
32
+ ```
33
+
34
+ Or do the same thing with an async version:
35
+
36
+ ```python
37
+ from ecs_service_deployment_client.models import MyDataModel
38
+ from ecs_service_deployment_client.api.my_tag import get_my_data_model
39
+ from ecs_service_deployment_client.types import Response
40
+
41
+ async with client as client:
42
+ my_data: MyDataModel = await get_my_data_model.asyncio(client=client)
43
+ response: Response[MyDataModel] = await get_my_data_model.asyncio_detailed(client=client)
44
+ ```
45
+
46
+ By default, when you're calling an HTTPS API it will attempt to verify that SSL is working correctly. Using certificate verification is highly recommended most of the time, but sometimes you may need to authenticate to a server (especially an internal server) using a custom certificate bundle.
47
+
48
+ ```python
49
+ client = AuthenticatedClient(
50
+ base_url="https://internal_api.example.com",
51
+ token="SuperSecretToken",
52
+ verify_ssl="/path/to/certificate_bundle.pem",
53
+ )
54
+ ```
55
+
56
+ You can also disable certificate validation altogether, but beware that **this is a security risk**.
57
+
58
+ ```python
59
+ client = AuthenticatedClient(
60
+ base_url="https://internal_api.example.com",
61
+ token="SuperSecretToken",
62
+ verify_ssl=False
63
+ )
64
+ ```
65
+
66
+ Things to know:
67
+ 1. Every path/method combo becomes a Python module with four functions:
68
+ 1. `sync`: Blocking request that returns parsed data (if successful) or `None`
69
+ 1. `sync_detailed`: Blocking request that always returns a `Request`, optionally with `parsed` set if the request was successful.
70
+ 1. `asyncio`: Like `sync` but async instead of blocking
71
+ 1. `asyncio_detailed`: Like `sync_detailed` but async instead of blocking
72
+
73
+ 1. All path/query params, and bodies become method arguments.
74
+ 1. If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above)
75
+ 1. Any endpoint which did not have a tag will be in `ecs_service_deployment_client.api.default`
76
+
77
+ ## Advanced customizations
78
+
79
+ There are more settings on the generated `Client` class which let you control more runtime behavior, check out the docstring on that class for more info. You can also customize the underlying `httpx.Client` or `httpx.AsyncClient` (depending on your use-case):
80
+
81
+ ```python
82
+ from ecs_service_deployment_client import Client
83
+
84
+ def log_request(request):
85
+ print(f"Request event hook: {request.method} {request.url} - Waiting for response")
86
+
87
+ def log_response(response):
88
+ request = response.request
89
+ print(f"Response event hook: {request.method} {request.url} - Status {response.status_code}")
90
+
91
+ client = Client(
92
+ base_url="https://api.example.com",
93
+ httpx_args={"event_hooks": {"request": [log_request], "response": [log_response]}},
94
+ )
95
+
96
+ # Or get the underlying httpx client to modify directly with client.get_httpx_client() or client.get_async_httpx_client()
97
+ ```
98
+
99
+ You can even set the httpx client directly, but beware that this will override any existing settings (e.g., base_url):
100
+
101
+ ```python
102
+ import httpx
103
+ from ecs_service_deployment_client import Client
104
+
105
+ client = Client(
106
+ base_url="https://api.example.com",
107
+ )
108
+ # Note that base_url needs to be re-set, as would any shared cookies, headers, etc.
109
+ client.set_httpx_client(httpx.Client(base_url="https://api.example.com", proxies="http://localhost:8030"))
110
+ ```
111
+
112
+ ## Building / publishing this package
113
+ This project uses [uv](https://github.com/astral-sh/uv) to manage dependencies and packaging. Here are the basics:
114
+ 1. Update the metadata in `pyproject.toml` (e.g. authors, version).
115
+ 2. If you're using a private repository: https://docs.astral.sh/uv/guides/integration/alternative-indexes/
116
+ 3. Build a distribution with `uv build`, builds `sdist` and `wheel` by default.
117
+ 1. Publish the client with `uv publish`, see documentation for publishing to private indexes.
118
+
119
+ If you want to install this client into another project without publishing it (e.g. for development) then:
120
+ 1. If that project **is using uv**, you can simply do `uv add <path-to-this-client>` from that project
121
+ 1. If that project is not using uv:
122
+ 1. Build a wheel with `uv build --wheel`.
123
+ 1. Install that wheel from the other project `pip install <path-to-wheel>`.
@@ -0,0 +1,8 @@
1
+ """A client library for accessing ECS Service Deployment"""
2
+
3
+ from .client import AuthenticatedClient, Client
4
+
5
+ __all__ = (
6
+ "AuthenticatedClient",
7
+ "Client",
8
+ )
@@ -0,0 +1 @@
1
+ """Contains methods for accessing the API"""
@@ -0,0 +1 @@
1
+ """Contains endpoint functions for accessing the API"""
@@ -0,0 +1,171 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Optional, Union, cast
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.error_response import ErrorResponse
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs(
13
+ service: str,
14
+ ) -> dict[str, Any]:
15
+ _kwargs: dict[str, Any] = {
16
+ "method": "get",
17
+ "url": f"/services/{service}",
18
+ }
19
+
20
+ return _kwargs
21
+
22
+
23
+ def _parse_response(
24
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
25
+ ) -> Optional[Union[Any, ErrorResponse]]:
26
+ if response.status_code == 200:
27
+ response_200 = cast(Any, None)
28
+ return response_200
29
+ if response.status_code == 202:
30
+ response_202 = cast(Any, None)
31
+ return response_202
32
+ if response.status_code == 403:
33
+ response_403 = ErrorResponse.from_dict(response.json())
34
+
35
+ return response_403
36
+ if response.status_code == 404:
37
+ response_404 = cast(Any, None)
38
+ return response_404
39
+ if response.status_code == 417:
40
+ response_417 = ErrorResponse.from_dict(response.json())
41
+
42
+ return response_417
43
+ if client.raise_on_unexpected_status:
44
+ raise errors.UnexpectedStatus(response.status_code, response.content)
45
+ else:
46
+ return None
47
+
48
+
49
+ def _build_response(
50
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
51
+ ) -> Response[Union[Any, ErrorResponse]]:
52
+ return Response(
53
+ status_code=HTTPStatus(response.status_code),
54
+ content=response.content,
55
+ headers=response.headers,
56
+ parsed=_parse_response(client=client, response=response),
57
+ )
58
+
59
+
60
+ def sync_detailed(
61
+ service: str,
62
+ *,
63
+ client: AuthenticatedClient,
64
+ ) -> Response[Union[Any, ErrorResponse]]:
65
+ """Get deployment status for ECS service.
66
+
67
+ Get deployment status for ECS service.
68
+
69
+ Args:
70
+ service (str):
71
+
72
+ Raises:
73
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
74
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
75
+
76
+ Returns:
77
+ Response[Union[Any, ErrorResponse]]
78
+ """
79
+
80
+ kwargs = _get_kwargs(
81
+ service=service,
82
+ )
83
+
84
+ response = client.get_httpx_client().request(
85
+ **kwargs,
86
+ )
87
+
88
+ return _build_response(client=client, response=response)
89
+
90
+
91
+ def sync(
92
+ service: str,
93
+ *,
94
+ client: AuthenticatedClient,
95
+ ) -> Optional[Union[Any, ErrorResponse]]:
96
+ """Get deployment status for ECS service.
97
+
98
+ Get deployment status for ECS service.
99
+
100
+ Args:
101
+ service (str):
102
+
103
+ Raises:
104
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
105
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
106
+
107
+ Returns:
108
+ Union[Any, ErrorResponse]
109
+ """
110
+
111
+ return sync_detailed(
112
+ service=service,
113
+ client=client,
114
+ ).parsed
115
+
116
+
117
+ async def asyncio_detailed(
118
+ service: str,
119
+ *,
120
+ client: AuthenticatedClient,
121
+ ) -> Response[Union[Any, ErrorResponse]]:
122
+ """Get deployment status for ECS service.
123
+
124
+ Get deployment status for ECS service.
125
+
126
+ Args:
127
+ service (str):
128
+
129
+ Raises:
130
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
131
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
132
+
133
+ Returns:
134
+ Response[Union[Any, ErrorResponse]]
135
+ """
136
+
137
+ kwargs = _get_kwargs(
138
+ service=service,
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
+ service: str,
148
+ *,
149
+ client: AuthenticatedClient,
150
+ ) -> Optional[Union[Any, ErrorResponse]]:
151
+ """Get deployment status for ECS service.
152
+
153
+ Get deployment status for ECS service.
154
+
155
+ Args:
156
+ service (str):
157
+
158
+ Raises:
159
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
160
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
161
+
162
+ Returns:
163
+ Union[Any, ErrorResponse]
164
+ """
165
+
166
+ return (
167
+ await asyncio_detailed(
168
+ service=service,
169
+ client=client,
170
+ )
171
+ ).parsed
@@ -0,0 +1,85 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, 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() -> dict[str, Any]:
12
+ _kwargs: dict[str, Any] = {
13
+ "method": "get",
14
+ "url": "/services",
15
+ }
16
+
17
+ return _kwargs
18
+
19
+
20
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
21
+ if response.status_code == 200:
22
+ return None
23
+ if response.status_code == 403:
24
+ return None
25
+ if client.raise_on_unexpected_status:
26
+ raise errors.UnexpectedStatus(response.status_code, response.content)
27
+ else:
28
+ return None
29
+
30
+
31
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
32
+ return Response(
33
+ status_code=HTTPStatus(response.status_code),
34
+ content=response.content,
35
+ headers=response.headers,
36
+ parsed=_parse_response(client=client, response=response),
37
+ )
38
+
39
+
40
+ def sync_detailed(
41
+ *,
42
+ client: AuthenticatedClient,
43
+ ) -> Response[Any]:
44
+ """Get available ECS services.
45
+
46
+ Get available ECS services.
47
+
48
+ Raises:
49
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
50
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
51
+
52
+ Returns:
53
+ Response[Any]
54
+ """
55
+
56
+ kwargs = _get_kwargs()
57
+
58
+ response = client.get_httpx_client().request(
59
+ **kwargs,
60
+ )
61
+
62
+ return _build_response(client=client, response=response)
63
+
64
+
65
+ async def asyncio_detailed(
66
+ *,
67
+ client: AuthenticatedClient,
68
+ ) -> Response[Any]:
69
+ """Get available ECS services.
70
+
71
+ Get available ECS services.
72
+
73
+ Raises:
74
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
75
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
76
+
77
+ Returns:
78
+ Response[Any]
79
+ """
80
+
81
+ kwargs = _get_kwargs()
82
+
83
+ response = await client.get_async_httpx_client().request(**kwargs)
84
+
85
+ return _build_response(client=client, response=response)
@@ -0,0 +1,189 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Optional, Union, cast
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.error_response import ErrorResponse
9
+ from ...models.service_deployment_request import ServiceDeploymentRequest
10
+ from ...types import Response
11
+
12
+
13
+ def _get_kwargs(
14
+ service: str,
15
+ *,
16
+ body: ServiceDeploymentRequest,
17
+ ) -> dict[str, Any]:
18
+ headers: dict[str, Any] = {}
19
+
20
+ _kwargs: dict[str, Any] = {
21
+ "method": "patch",
22
+ "url": f"/services/{service}",
23
+ }
24
+
25
+ _kwargs["json"] = body.to_dict()
26
+
27
+ headers["Content-Type"] = "application/json"
28
+
29
+ _kwargs["headers"] = headers
30
+ return _kwargs
31
+
32
+
33
+ def _parse_response(
34
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
35
+ ) -> Optional[Union[Any, ErrorResponse]]:
36
+ if response.status_code == 201:
37
+ response_201 = cast(Any, None)
38
+ return response_201
39
+ if response.status_code == 403:
40
+ response_403 = cast(Any, None)
41
+ return response_403
42
+ if response.status_code == 404:
43
+ response_404 = cast(Any, None)
44
+ return response_404
45
+ if response.status_code == 417:
46
+ response_417 = ErrorResponse.from_dict(response.json())
47
+
48
+ return response_417
49
+ if client.raise_on_unexpected_status:
50
+ raise errors.UnexpectedStatus(response.status_code, response.content)
51
+ else:
52
+ return None
53
+
54
+
55
+ def _build_response(
56
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
57
+ ) -> Response[Union[Any, ErrorResponse]]:
58
+ return Response(
59
+ status_code=HTTPStatus(response.status_code),
60
+ content=response.content,
61
+ headers=response.headers,
62
+ parsed=_parse_response(client=client, response=response),
63
+ )
64
+
65
+
66
+ def sync_detailed(
67
+ service: str,
68
+ *,
69
+ client: AuthenticatedClient,
70
+ body: ServiceDeploymentRequest,
71
+ ) -> Response[Union[Any, ErrorResponse]]:
72
+ """Update an ECS service.
73
+
74
+ Update an ECS service.
75
+
76
+ Args:
77
+ service (str):
78
+ body (ServiceDeploymentRequest): ECS Service Deployment Request.
79
+
80
+ Raises:
81
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
82
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
83
+
84
+ Returns:
85
+ Response[Union[Any, ErrorResponse]]
86
+ """
87
+
88
+ kwargs = _get_kwargs(
89
+ service=service,
90
+ body=body,
91
+ )
92
+
93
+ response = client.get_httpx_client().request(
94
+ **kwargs,
95
+ )
96
+
97
+ return _build_response(client=client, response=response)
98
+
99
+
100
+ def sync(
101
+ service: str,
102
+ *,
103
+ client: AuthenticatedClient,
104
+ body: ServiceDeploymentRequest,
105
+ ) -> Optional[Union[Any, ErrorResponse]]:
106
+ """Update an ECS service.
107
+
108
+ Update an ECS service.
109
+
110
+ Args:
111
+ service (str):
112
+ body (ServiceDeploymentRequest): ECS Service Deployment Request.
113
+
114
+ Raises:
115
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
116
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
117
+
118
+ Returns:
119
+ Union[Any, ErrorResponse]
120
+ """
121
+
122
+ return sync_detailed(
123
+ service=service,
124
+ client=client,
125
+ body=body,
126
+ ).parsed
127
+
128
+
129
+ async def asyncio_detailed(
130
+ service: str,
131
+ *,
132
+ client: AuthenticatedClient,
133
+ body: ServiceDeploymentRequest,
134
+ ) -> Response[Union[Any, ErrorResponse]]:
135
+ """Update an ECS service.
136
+
137
+ Update an ECS service.
138
+
139
+ Args:
140
+ service (str):
141
+ body (ServiceDeploymentRequest): ECS Service Deployment Request.
142
+
143
+ Raises:
144
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
145
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
146
+
147
+ Returns:
148
+ Response[Union[Any, ErrorResponse]]
149
+ """
150
+
151
+ kwargs = _get_kwargs(
152
+ service=service,
153
+ body=body,
154
+ )
155
+
156
+ response = await client.get_async_httpx_client().request(**kwargs)
157
+
158
+ return _build_response(client=client, response=response)
159
+
160
+
161
+ async def asyncio(
162
+ service: str,
163
+ *,
164
+ client: AuthenticatedClient,
165
+ body: ServiceDeploymentRequest,
166
+ ) -> Optional[Union[Any, ErrorResponse]]:
167
+ """Update an ECS service.
168
+
169
+ Update an ECS service.
170
+
171
+ Args:
172
+ service (str):
173
+ body (ServiceDeploymentRequest): ECS Service Deployment Request.
174
+
175
+ Raises:
176
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
177
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
178
+
179
+ Returns:
180
+ Union[Any, ErrorResponse]
181
+ """
182
+
183
+ return (
184
+ await asyncio_detailed(
185
+ service=service,
186
+ client=client,
187
+ body=body,
188
+ )
189
+ ).parsed
@@ -0,0 +1 @@
1
+ """Contains endpoint functions for accessing the API"""