File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed
Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -78,10 +78,13 @@ async def retrieve(
7878 RuleSchemaForQueries , RuleSchemaForCounters
7979 ] = await self .api_call .get (
8080 self ._endpoint_path ,
81- entity_type = typing . Union [ RuleSchemaForQueries , RuleSchemaForCounters ] ,
81+ entity_type = dict ,
8282 as_json = True ,
8383 )
84- return response
84+ return typing .cast (
85+ typing .Union [RuleSchemaForQueries , RuleSchemaForCounters ],
86+ response ,
87+ )
8588
8689 async def delete (self ) -> RuleDeleteSchema :
8790 """
Original file line number Diff line number Diff line change @@ -122,12 +122,12 @@ async def create(
122122 body = rule ,
123123 params = rule_parameters ,
124124 as_json = True ,
125- entity_type = typing .Union [
126- RuleSchemaForCounters ,
127- RuleSchemaForQueries ,
128- ],
125+ entity_type = dict ,
126+ )
127+ return typing .cast (
128+ typing .Union [RuleSchemaForCounters , RuleSchemaForQueries ],
129+ response ,
129130 )
130- return response
131131
132132 @warn_deprecation ( # type: ignore[untyped-decorator]
133133 "AsyncAnalyticsRulesV1 is deprecated on v30+. Use client.analytics instead." ,
@@ -148,10 +148,12 @@ async def upsert(
148148 Returns:
149149 Union[RuleSchemaForCounters, RuleCreateSchemaForQueries]: The upserted rule.
150150 """
151- response = await self .api_call .put (
151+ response : typing .Union [
152+ RuleSchemaForCounters , RuleCreateSchemaForQueries
153+ ] = await self .api_call .put (
152154 "/" .join ([self .resource_path , rule_id ]),
153155 body = rule ,
154- entity_type = typing . Union [ RuleSchemaForQueries , RuleSchemaForCounters ] ,
156+ entity_type = dict ,
155157 )
156158 return typing .cast (
157159 typing .Union [RuleSchemaForCounters , RuleCreateSchemaForQueries ],
You can’t perform that action at this time.
0 commit comments