File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 209
209
"""
210
210
Helper: Generates a secured API key based on the given `parent_api_key` and given `restrictions`.
211
211
"""
212
- if not isinstance(restrictions, SecuredApiKeyRestrictions):
213
- restrictions = SecuredApiKeyRestrictions.from_dict(restrictions)
212
+ restrictions_dict = { }
213
+ if isinstance(restrictions, SecuredApiKeyRestrictions):
214
+ restrictions_dict = restrictions.to_dict()
215
+ elif isinstance(restrictions, dict):
216
+ restrictions_dict = restrictions
214
217
215
- restrictions_dict: dict[str, Any] = restrictions.to_dict()
216
218
if "searchParams" in restrictions_dict:
217
219
restrictions_dict = { **restrictions_dict, **restrictions_dict["searchParams"]}
218
220
del restrictions_dict["searchParams"]
You can’t perform that action at this time.
0 commit comments