Coverage for python_carrier_infinity/gql_schemas/update_zone_config.py: 100%

8 statements  

« prev     ^ index     » next       coverage.py v6.5.0, created at 2023-08-19 01:56 +0000

1"""updateInfinityZoneConfig GraphQL schema""" 

2from __future__ import annotations 

3 

4OPERATION = "updateInfinityZoneConfig" 

5QUERY = """mutation updateInfinityZoneConfig($input: InfinityZoneConfigInput!) { 

6 updateInfinityZoneConfig(input: $input) { 

7 etag 

8 } 

9}""" 

10 

11 

12def update_zone_config_query( 

13 serial: str, 

14 zone_id: str, 

15 hold_activity: str | None, 

16 hold_until: str | None, 

17) -> dict: 

18 """Generate GraphQL query for updateInfinityZoneConfig""" 

19 

20 if hold_activity: 

21 hold = "on" 

22 else: 

23 hold = "off" 

24 

25 return { 

26 "operationName": OPERATION, 

27 "variables": { 

28 "input": { 

29 "serial": serial, 

30 "zoneId": zone_id, 

31 "hold": hold, 

32 "holdActivity": hold_activity, 

33 "otmr": hold_until, 

34 }, 

35 }, 

36 "query": QUERY, 

37 }