Coverage for abb_rws_client_python_rw6/rws/rapid/uiinstr.py: 100%

19 statements  

« 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 → RAPID Service → Operations on RAPID UI instructions 

6 

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""" 

11 

12from __future__ import annotations 

13 

14import httpx 

15 

16from abb_rws_client_python_rw6.core.client import RWSClient 

17 

18 

19async def get_ui_instruction_resource(client: RWSClient) -> httpx.Response: 

20 """ 

21 Get UI instruction resource. 

22 

23 Route: ``GET /rw/rapid/uiinstr`` 

24 ABB constraints: Not supported in bootserver mode 

25 

26 Args: 

27 client: Open RWSClient instance. 

28 

29 Returns: 

30 Raw HTTP response. Expected success: HTTP 200. 

31 

32 Raises: 

33 RWSAuthenticationError: On HTTP 401. 

34 RWSNotFoundError: On HTTP 404. 

35 RWSHTTPError: On any other HTTP >= 400. 

36 # ABB codes: NOT FOUND(404), see 

37 

38 Example: 

39 ```python 

40 >>> await get_ui_instruction_resource(client) 

41 <Response [200]> 

42 ``` 

43 """ 

44 return await client.get("/rw/rapid/uiinstr") 

45 

46 

47async def get_ui_instruction_actions( 

48 client: RWSClient, 

49 action: str | None = None, 

50) -> httpx.Response: 

51 """ 

52 Get UI instruction actions. 

53 

54 Route: ``GET /rw/rapid/uiinstr`` 

55 ABB constraints: Not supported in bootserver mode 

56 

57 Args: 

58 client: Open RWSClient instance. 

59 action: Query parameter. Optional. 

60 

61 Returns: 

62 Raw HTTP response. Expected success: HTTP 200. 

63 

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), see 

69 

70 Example: 

71 ```python 

72 >>> await get_ui_instruction_actions(client) 

73 <Response [200]> 

74 ``` 

75 """ 

76 return await client.get( 

77 "/rw/rapid/uiinstr", 

78 params={k: v for k, v in {"action": action}.items() if v is not None}, 

79 ) 

80 

81 

82async def subscribe_on_ui_instruction( 

83 client: RWSClient, 

84 resources: str | None = None, 

85) -> httpx.Response: 

86 """ 

87 Subscribe on UI instruction. 

88 

89 Route: ``POST /subscription`` 

90 ABB constraints: Not supported in bootserver mode 

91 

92 Args: 

93 client: Open RWSClient instance. 

94 resources: Body parameter. Optional. 

95 

96 Returns: 

97 Raw HTTP response. Expected success: HTTP 201. 

98 

99 Raises: 

100 RWSAuthenticationError: On HTTP 401. 

101 RWSNotFoundError: On HTTP 404. 

102 RWSHTTPError: On any other HTTP >= 400. 

103 # ABB codes: BAD_REQUEST(400), see 

104 

105 Example: 

106 ```python 

107 >>> await subscribe_on_ui_instruction(client) 

108 <Response [201]> 

109 ``` 

110 """ 

111 return await client.post( 

112 "/subscription", 

113 data={k: v for k, v in {"resources": resources}.items() if v is not None}, 

114 ) 

115 

116 

117async def get_active_ui_instruction(client: RWSClient) -> httpx.Response: 

118 """ 

119 Get Active UI Instruction. 

120 

121 Route: ``GET /rw/rapid/uiinstr/active`` 

122 ABB constraints: Not supported in bootserver mode 

123 

124 Args: 

125 client: Open RWSClient instance. 

126 

127 Returns: 

128 Raw HTTP response. Expected success: HTTP 200. 

129 

130 Raises: 

131 RWSAuthenticationError: On HTTP 401. 

132 RWSNotFoundError: On HTTP 404. 

133 RWSHTTPError: On any other HTTP >= 400. 

134 # ABB codes: BAD REQUEST(400),NOT_FOUND(404) see 

135 

136 Example: 

137 ```python 

138 >>> await get_active_ui_instruction(client) 

139 <Response [200]> 

140 ``` 

141 """ 

142 return await client.get("/rw/rapid/uiinstr/active") 

143 

144 

145async def get_active_ui_instruction_actions( 

146 client: RWSClient, 

147 action: str | None = None, 

148) -> httpx.Response: 

149 """ 

150 Get Active UI instruction actions. 

151 

152 Route: ``GET /rw/rapid/uiinstr/active`` 

153 ABB constraints: Not supported in bootserver mode 

154 

155 Args: 

156 client: Open RWSClient instance. 

157 action: Query parameter. Optional. 

158 

159 Returns: 

160 Raw HTTP response. Expected success: HTTP 200. 

161 

162 Raises: 

163 RWSAuthenticationError: On HTTP 401. 

164 RWSNotFoundError: On HTTP 404. 

165 RWSHTTPError: On any other HTTP >= 400. 

166 # ABB codes: Bad Request(400), see 

167 

168 Example: 

169 ```python 

170 >>> await get_active_ui_instruction_actions(client) 

171 <Response [200]> 

172 ``` 

173 """ 

174 return await client.get( 

175 "/rw/rapid/uiinstr/active", 

176 params={k: v for k, v in {"action": action}.items() if v is not None}, 

177 ) 

178 

179 

180async def update_an_active_ui_instruction_parameter( 

181 client: RWSClient, 

182 stackurl: str, 

183 uiparam: str, 

184 action: str | None = None, 

185 value: str | None = None, 

186) -> httpx.Response: 

187 """ 

188 Update an Active UI Instruction Parameter. 

189 

190 Route: ``POST /rw/rapid/uiinstr/active/param/{stackurl}/{uiparam}`` 

191 ABB constraints: -Not supported in bootserver mode -{stackurl} ends with a variable number, 

192 which can be obtained from "Get Active UI Instruction" API. -RAPID program should be 

193 running -Example of {uiparam} are TPFK1, TPFK2, TPFK3, TPCompleted etc 

194 

195 Args: 

196 client: Open RWSClient instance. 

197 stackurl: URL path parameter. 

198 uiparam: URL path parameter. 

199 action: Query parameter. Optional. 

200 value: Body parameter. Optional. 

201 

202 Returns: 

203 Raw HTTP response. Expected success: HTTP 204. 

204 

205 Raises: 

206 RWSAuthenticationError: On HTTP 401. 

207 RWSNotFoundError: On HTTP 404. 

208 RWSHTTPError: On any other HTTP >= 400. 

209 # ABB codes: BAD REQUEST(400),NOT_FOUND(404),FORBIDDEN(403) see 

210 

211 Example: 

212 ```python 

213 >>> await update_an_active_ui_instruction_parameter( 

214 ... client, 

215 ... "stackurl_value", 

216 ... "uiparam_value" 

217 ... ) 

218 <Response [204]> 

219 ``` 

220 """ 

221 return await client.post( 

222 f"/rw/rapid/uiinstr/active/param/{stackurl}/{uiparam}", 

223 params={k: v for k, v in {"action": action}.items() if v is not None}, 

224 data={k: v for k, v in {"value": value}.items() if v is not None}, 

225 ) 

226 

227 

228async def get_parameter_value_for_an_active_ui( 

229 client: RWSClient, 

230 stackurl: str, 

231 uiparam: str, 

232) -> httpx.Response: 

233 """ 

234 Get parameter value for an active UI instruction. 

235 

236 Route: ``GET /rw/rapid/uiinstr/active/param/{stackurl}/{uiparam}`` 

237 ABB constraints: Not supported in bootserver mode 

238 

239 Args: 

240 client: Open RWSClient instance. 

241 stackurl: URL path parameter. 

242 uiparam: URL path parameter. 

243 

244 Returns: 

245 Raw HTTP response. Expected success: HTTP 200. 

246 

247 Raises: 

248 RWSAuthenticationError: On HTTP 401. 

249 RWSNotFoundError: On HTTP 404. 

250 RWSHTTPError: On any other HTTP >= 400. 

251 # ABB codes: BAD_REQUEST(400) , NOT_FOUND(404) see 

252 

253 Example: 

254 ```python 

255 >>> await get_parameter_value_for_an_active_ui(client, "stackurl_value", "uiparam_value") 

256 <Response [200]> 

257 ``` 

258 """ 

259 return await client.get(f"/rw/rapid/uiinstr/active/param/{stackurl}/{uiparam}") 

260 

261 

262async def get_active_ui_instruction_parameters( 

263 client: RWSClient, 

264 stackurl: str, 

265) -> httpx.Response: 

266 """ 

267 Get active UI instruction parameters. 

268 

269 Route: ``GET /rw/rapid/uiinstr/active/params/{stackurl}`` 

270 ABB constraints: Not supported in bootserver mode 

271 

272 Args: 

273 client: Open RWSClient instance. 

274 stackurl: URL path parameter. 

275 

276 Returns: 

277 Raw HTTP response. Expected success: HTTP 200. 

278 

279 Raises: 

280 RWSAuthenticationError: On HTTP 401. 

281 RWSNotFoundError: On HTTP 404. 

282 RWSHTTPError: On any other HTTP >= 400. 

283 # ABB codes: BAD_REQUEST(400), NOT_FOUND(404), see 

284 

285 Example: 

286 ```python 

287 >>> await get_active_ui_instruction_parameters(client, "stackurl_value") 

288 <Response [200]> 

289 ``` 

290 """ 

291 return await client.get(f"/rw/rapid/uiinstr/active/params/{stackurl}")