Coverage for abb_rws_client_python_rw6/rws/users/remote.py: 100%

11 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: User Service → Operations on Remote User → Get remote user actions 

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_remote_user_actions( 

20 client: RWSClient, 

21 action: str | None = None, 

22) -> httpx.Response: 

23 """ 

24 Get remote user actions. 

25 

26 Route: ``GET /users/remoteuser`` 

27 ABB constraints: Not Supported in bootserver mode 

28 

29 Args: 

30 client: Open RWSClient instance. 

31 action: Query parameter. Optional. 

32 

33 Returns: 

34 Raw HTTP response. Expected success: HTTP 200. 

35 

36 Raises: 

37 RWSAuthenticationError: On HTTP 401. 

38 RWSNotFoundError: On HTTP 404. 

39 RWSHTTPError: On any other HTTP >= 400. 

40 # ABB codes: BAD REQUEST(400), FORBIDDEN(403), UNAUTHORIZED(401) 

41 

42 Example: 

43 ```python 

44 >>> await get_remote_user_actions(client) 

45 <Response [200]> 

46 ``` 

47 """ 

48 return await client.get( 

49 "/users/remoteuser", 

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

51 ) 

52 

53 

54async def post_remote_user_logon_request( 

55 client: RWSClient, 

56 action: str | None = None, 

57) -> httpx.Response: 

58 """ 

59 Remote User Logon Request. 

60 

61 Route: ``POST /users/remoteuser`` 

62 ABB constraints: Not Supported in bootserver mode. The UAS grant UAS_REMOTE_LOGIN is 

63 required. 

64 

65 Args: 

66 client: Open RWSClient instance. 

67 action: Query parameter. Optional. 

68 

69 Returns: 

70 Raw HTTP response. Expected success: HTTP 204. 

71 

72 Raises: 

73 RWSAuthenticationError: On HTTP 401. 

74 RWSNotFoundError: On HTTP 404. 

75 RWSHTTPError: On any other HTTP >= 400. 

76 # ABB codes: BAD REQUEST(400), FORBIDDEN(403), UNAUTHORIZED(401) 

77 

78 Example: 

79 ```python 

80 >>> await post_remote_user_logon_request(client) 

81 <Response [204]> 

82 ``` 

83 """ 

84 return await client.post( 

85 "/users/remoteuser", 

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

87 data={}, 

88 ) 

89 

90 

91async def post_remote_user_logout_request( 

92 client: RWSClient, 

93 action: str | None = None, 

94) -> httpx.Response: 

95 """ 

96 Remote User Logout Request. 

97 

98 Route: ``POST /users/remoteuser`` 

99 ABB constraints: Not Supported in bootserver mode 

100 

101 Args: 

102 client: Open RWSClient instance. 

103 action: Query parameter. Optional. 

104 

105 Returns: 

106 Raw HTTP response. Expected success: HTTP 204. 

107 

108 Raises: 

109 RWSAuthenticationError: On HTTP 401. 

110 RWSNotFoundError: On HTTP 404. 

111 RWSHTTPError: On any other HTTP >= 400. 

112 # ABB codes: BAD REQUEST(400), FORBIDDEN(403), UNAUTHORIZED(401) 

113 

114 Example: 

115 ```python 

116 >>> await post_remote_user_logout_request(client) 

117 <Response [204]> 

118 ``` 

119 """ 

120 return await client.post( 

121 "/users/remoteuser", 

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

123 data={}, 

124 ) 

125 

126 

127async def subscribe_on_remote_user_state( 

128 client: RWSClient, 

129 identifier: str | None = None, 

130 identifier_p: str | None = None, 

131) -> httpx.Response: 

132 """ 

133 Subscribe on remote user state. 

134 

135 Route: ``POST /subscription`` 

136 ABB constraints: Not supported in bootserver mode. 

137 

138 Args: 

139 client: Open RWSClient instance. 

140 identifier: Body parameter. Optional. 

141 identifier_p: Body parameter. Optional. 

142 

143 Returns: 

144 Raw HTTP response. Expected success: HTTP 201. 

145 

146 Raises: 

147 RWSAuthenticationError: On HTTP 401. 

148 RWSNotFoundError: On HTTP 404. 

149 RWSHTTPError: On any other HTTP >= 400. 

150 # ABB codes: UNSUPPORTED_MEDIA(415), BAD_REQUEST(400) 

151 

152 Example: 

153 ```python 

154 >>> await subscribe_on_remote_user_state(client) 

155 <Response [201]> 

156 ``` 

157 """ 

158 return await client.post( 

159 "/subscription", 

160 data={ 

161 k: v 

162 for k, v in {"identifier": identifier, "identifier_p": identifier_p}.items() 

163 if v is not None 

164 }, 

165 )