Coverage for abb_rws_client_python_rw6/rws/ctrl/identity.py: 100%

9 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: Controller Service → Operations on Identity Resource → Get Identity Resource 

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_identity_resource(client: RWSClient) -> httpx.Response: 

20 """ 

21 Get Identity Resource. 

22 

23 Route: ``GET /ctrl/identity`` 

24 ABB constraints: 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_identity_resource(client) 

41 <Response [200]> 

42 ``` 

43 """ 

44 return await client.get("/ctrl/identity") 

45 

46 

47async def get_identity_actions( 

48 client: RWSClient, 

49 action: str | None = None, 

50) -> httpx.Response: 

51 """ 

52 Get Identity Actions. 

53 

54 Route: ``GET /ctrl/identity`` 

55 ABB constraints: 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: NOT_FOUND(404) See 

69 

70 Example: 

71 ```python 

72 >>> await get_identity_actions(client) 

73 <Response [200]> 

74 ``` 

75 """ 

76 return await client.get( 

77 "/ctrl/identity", 

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

79 ) 

80 

81 

82async def set_the_identity_of_the_controller(client: RWSClient) -> httpx.Response: 

83 """ 

84 Set the Identity of the controller. 

85 

86 Route: ``PUT /ctrl/identity`` 

87 ABB constraints: Supported in bootserver mode 

88 

89 Args: 

90 client: Open RWSClient instance. 

91 

92 Returns: 

93 Raw HTTP response. Expected success: HTTP 204. 

94 

95 Raises: 

96 RWSAuthenticationError: On HTTP 401. 

97 RWSNotFoundError: On HTTP 404. 

98 RWSHTTPError: On any other HTTP >= 400. 

99 # ABB codes: UNAUTHORIZED(401), BAD_REQUEST(400), UNSUPPORTED_MEDIA(415) 

100 

101 Example: 

102 ```python 

103 >>> await set_the_identity_of_the_controller(client) 

104 <Response [204]> 

105 ``` 

106 """ 

107 return await client.put( 

108 "/ctrl/identity", 

109 data={}, 

110 )