From 26e9789fd7bd89490e1eb558e8cb272e1e1cd624 Mon Sep 17 00:00:00 2001 From: rohan-r-kulkarni Date: Wed, 24 Jan 2024 20:26:22 -0800 Subject: [PATCH] get activity params --- src/aerie_cli/aerie_client.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/aerie_cli/aerie_client.py b/src/aerie_cli/aerie_client.py index c0df2ef9..cc1ae6ed 100644 --- a/src/aerie_cli/aerie_client.py +++ b/src/aerie_cli/aerie_client.py @@ -1286,6 +1286,27 @@ def get_all_activity_types(self, model_id: int) -> List[str]: activity_types = [o["name"] for o in data] return activity_types + def get_activity_parameters(self, activity_name:str, model_id:int): + query = """ + query GetActivityParameters( + $model_id: Int! + $activity_name: String! + ) { + activity_type(where: { model_id: { _eq: $model_id }, + name : {_eq : $activity_name}}) { + name + model_id + parameters + } + } + """ + resp = self.host_session.post_to_graphql( + query, + activity_name=activity_name + model_id=model_id, + ) + return resp + def list_command_dictionaries(self) -> List[CommandDictionaryInfo]: """List all command dictionaries on an Aerie host @@ -1577,7 +1598,7 @@ def __expand_activity_arguments(self, plan: ActivityPlanRead, full_args: str = N activity.parameters = ApiEffectiveActivityArguments.from_dict( resp).arguments return plan - + def upload_constraint(self, constraint): upload_constraint_query = """ mutation CreateConstraint($constraint: constraint_insert_input!) {