Coverage for abb_rws_client_python_rw6/rws/iosystem/devices.py: 100%
9 statements
« prev ^ index » next coverage.py v7.15.4, created at 2026-08-13 22:17 +0000
« prev ^ index » next coverage.py v7.15.4, created at 2026-08-13 22:17 +0000
1# This file is AUTO-GENERATED by utils/generator/main.py
2# DO NOT EDIT MANUALLY — run the generator to regenerate.
3# Generator author: Clement RACINET
4"""
5RWS module: RobotWare Services → IO Service → Operations on IO Devices
71:1 mirror of the ABB RobotWare 6 REST API.
8Each function maps to exactly one HTTP endpoint.
9No composed logic — see highlevel/ for wrappers.
10"""
12from __future__ import annotations
14import httpx
16from abb_rws_client_python_rw6.core.client import RWSClient
19async def get_io_devices(client: RWSClient) -> httpx.Response:
20 """
21 Get IO Devices.
23 Route: ``GET /rw/iosystem/devices``
24 ABB constraints: Not supported in bootserver mode
26 Args:
27 client: Open RWSClient instance.
29 Returns:
30 Raw HTTP response. Expected success: HTTP 200.
32 Raises:
33 RWSAuthenticationError: On HTTP 401.
34 RWSNotFoundError: On HTTP 404.
35 RWSHTTPError: On any other HTTP >= 400.
36 # ABB codes: BAD_REQUEST(400)
38 Example:
39 ```python
40 >>> await get_io_devices(client)
41 <Response [200]>
42 ```
43 """
44 return await client.get("/rw/iosystem/devices")
47async def get_actions_io_devices(
48 client: RWSClient,
49 action: str | None = None,
50) -> httpx.Response:
51 """
52 Get Actions IO Devices.
54 Route: ``GET /rw/iosystem/devices``
55 ABB constraints: Not supported in bootserver mode
57 Args:
58 client: Open RWSClient instance.
59 action: Query parameter. Optional.
61 Returns:
62 Raw HTTP response. Expected success: HTTP 200.
64 Raises:
65 RWSAuthenticationError: On HTTP 401.
66 RWSNotFoundError: On HTTP 404.
67 RWSHTTPError: On any other HTTP >= 400.
68 # ABB codes: BAD_REQUEST(400)
70 Example:
71 ```python
72 >>> await get_actions_io_devices(client)
73 <Response [200]>
74 ```
75 """
76 return await client.get(
77 "/rw/iosystem/devices",
78 params={k: v for k, v in {"action": action}.items() if v is not None},
79 )
82async def post_search_io_devices(
83 client: RWSClient,
84 action: str | None = None,
85 name: str | None = None,
86 lstate: str | None = None,
87 network: str | None = None,
88 example_name: str | None = None,
89) -> httpx.Response:
90 """
91 Search IO Devices.
93 Route: ``POST /rw/iosystem/devices``
94 ABB constraints: Not supported in bootserver mode
96 Args:
97 client: Open RWSClient instance.
98 action: Query parameter. Optional.
99 name: Body parameter. Optional.
100 lstate: Body parameter. Optional.
101 network: Body parameter. Optional.
102 example_name: Body parameter. Optional.
104 Returns:
105 Raw HTTP response. Expected success: HTTP 200.
107 Raises:
108 RWSAuthenticationError: On HTTP 401.
109 RWSNotFoundError: On HTTP 404.
110 RWSHTTPError: On any other HTTP >= 400.
111 # ABB codes: BAD_REQUEST(400)
113 Example:
114 ```python
115 >>> await post_search_io_devices(client)
116 <Response [200]>
117 ```
118 """
119 return await client.post(
120 "/rw/iosystem/devices",
121 params={k: v for k, v in {"action": action}.items() if v is not None},
122 data={
123 k: v
124 for k, v in {
125 "name": name,
126 "lstate": lstate,
127 "network": network,
128 "example_name": example_name,
129 }.items()
130 if v is not None
131 },
132 )