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 209209 """
210210 Helper: Generates a secured API key based on the given `parent_api_key` and given `restrictions`.
211211 """
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
214217
215- restrictions_dict: dict[str, Any] = restrictions.to_dict()
216218 if "searchParams" in restrictions_dict:
217219 restrictions_dict = { **restrictions_dict, **restrictions_dict["searchParams"]}
218220 del restrictions_dict["searchParams"]
You can’t perform that action at this time.
0 commit comments