22
33from __future__ import annotations
44
5+ import builtins
56import json
67from typing import Any
78
@@ -78,7 +79,7 @@ def retrieve(self, location_id: str | int) -> APIObject:
7879 raise NotFoundError (f"Location { location_id } not found" , status_code = 404 )
7980 return results [0 ]
8081
81- def list_by_ids (self , location_ids : list [str | int ]) -> list [APIObject ]:
82+ def list_by_ids (self , location_ids : builtins . list [str | int ]) -> builtins . list [APIObject ]:
8283 """Get locations by a list of IDs (numeric or base64)."""
8384 if not location_ids :
8485 return []
@@ -87,7 +88,7 @@ def list_by_ids(self, location_ids: list[str | int]) -> list[APIObject]:
8788 items = data .get ("data" , {}).get ("getLocationsByIds" ) or []
8889 return [APIObject (item ) for item in items ]
8990
90- def list_by_store_codes (self , store_codes : list [str ]) -> list [APIObject ]:
91+ def list_by_store_codes (self , store_codes : builtins . list [str ]) -> builtins . list [APIObject ]:
9192 """Get locations matching the given store codes."""
9293 if not store_codes :
9394 return []
@@ -99,7 +100,7 @@ def search(
99100 self ,
100101 query : str ,
101102 * ,
102- fields : list [str ] | None = None ,
103+ fields : builtins . list [str ] | None = None ,
103104 first : int | None = None ,
104105 after : str | None = None ,
105106 before : str | None = None ,
@@ -168,11 +169,11 @@ def add(
168169 website : str | None = None ,
169170 store_id : str | None = None ,
170171 hide_address : bool | None = None ,
171- business_hours : list [dict [str , Any ]] | None = None ,
172- folder_ids : list [str ] | None = None ,
172+ business_hours : builtins . list [dict [str , Any ]] | None = None ,
173+ folder_ids : builtins . list [str ] | None = None ,
173174 service_area : dict [str , Any ] | None = None ,
174- place_action_links : list [dict [str , Any ]] | None = None ,
175- enabled_site_ids : list [int ] | None = None ,
175+ place_action_links : builtins . list [dict [str , Any ]] | None = None ,
176+ enabled_site_ids : builtins . list [int ] | None = None ,
176177 additional_fields : dict [str , Any ] | None = None ,
177178 ) -> APIObject :
178179 """Create a location in one call with every mandatory field as a keyword argument.
@@ -222,7 +223,7 @@ def add(
222223 )
223224 print(result.location.id)
224225 """
225- problems : list [str ] = []
226+ problems : builtins . list [str ] = []
226227 if not name or not (2 <= len (name .strip ()) <= 150 ):
227228 problems .append ("name must be 2-150 characters" )
228229 if not description or len (description .strip ()) < 200 :
@@ -276,15 +277,15 @@ def update(self, input: dict[str, Any]) -> APIObject:
276277 data = self ._post ("locations/update" , {"input" : input })
277278 return APIObject (data .get ("data" , {}).get ("updateLocation" ) or {})
278279
279- def archive (self , location_ids : list [str | int ]) -> APIObject :
280+ def archive (self , location_ids : builtins . list [str | int ]) -> APIObject :
280281 """Archive one or more locations."""
281282 encoded = [encode_location_id (lid ) for lid in location_ids ]
282283 data = self ._post ("locations/archive" , {"input" : {"locationIds" : encoded }})
283284 return APIObject (data .get ("data" , {}).get ("archiveLocations" ) or {})
284285
285286
286287 def cancel_archive (
287- self , location_ids : list [str | int ], selection_type : str , changed_by : str
288+ self , location_ids : builtins . list [str | int ], selection_type : str , changed_by : str
288289 ) -> APIObject :
289290 """Cancel a scheduled archival."""
290291 encoded = [encode_location_id (lid ) for lid in location_ids ]
0 commit comments