1717class DomainsAPI (BaseAPI ):
1818 """Domain management operations."""
1919
20- def check (self , * domains : str , include_pricing : bool = False ) -> builtins .list [DomainCheck ]:
20+ def check (
21+ self , * domains : str , include_pricing : bool = False
22+ ) -> builtins .list [DomainCheck ]:
2123 """
2224 Check domain availability.
2325
@@ -158,7 +160,9 @@ def register(
158160
159161 # Add contact info if provided
160162 if contact :
161- contact_data = contact .model_dump () if isinstance (contact , Contact ) else contact
163+ contact_data = (
164+ contact .model_dump () if isinstance (contact , Contact ) else contact
165+ )
162166 # Add contact fields for all types (Registrant, Tech, Admin, AuxBilling)
163167 for contact_type in ["Registrant" , "Tech" , "Admin" , "AuxBilling" ]:
164168 for field , value in contact_data .items ():
@@ -284,7 +288,9 @@ def unlock(self, domain: str) -> bool:
284288 assert isinstance (result , dict )
285289 return bool (result )
286290
287- def _get_pricing (self , domains : builtins .list [str ]) -> dict [str , dict [str , Decimal | None ]]:
291+ def _get_pricing (
292+ self , domains : builtins .list [str ]
293+ ) -> dict [str , dict [str , Decimal | None ]]:
288294 """
289295 Get pricing information for domains.
290296
@@ -362,23 +368,29 @@ def _get_pricing(self, domains: builtins.list[str]) -> dict[str, dict[str, Decim
362368 if not isinstance (products , list ):
363369 products = [products ] if products else []
364370
365- logger .debug (f"Found { len (products )} products in REGISTER category" )
371+ logger .debug (
372+ f"Found { len (products )} products in REGISTER category"
373+ )
366374
367375 # Find the product matching our TLD
368376 for product in products :
369377 if not isinstance (product , dict ):
370378 continue
371379
372380 product_name = product .get ("@Name" , "" )
373- logger .debug (f"Checking product: { product_name } vs { tld } " )
381+ logger .debug (
382+ f"Checking product: { product_name } vs { tld } "
383+ )
374384
375385 if product_name .lower () == tld .lower ():
376386 # Get price list
377387 price_info = product .get ("Price" , [])
378388 if not isinstance (price_info , list ):
379389 price_info = [price_info ] if price_info else []
380390
381- logger .debug (f"Found { len (price_info )} price entries for { tld } " )
391+ logger .debug (
392+ f"Found { len (price_info )} price entries for { tld } "
393+ )
382394
383395 # Find 1 year price
384396 for price in price_info :
@@ -405,13 +417,17 @@ def _get_pricing(self, domains: builtins.list[str]) -> dict[str, dict[str, Decim
405417 # Apply to all domains with this TLD
406418 for domain in domain_list :
407419 pricing [domain ] = {
408- "regular_price" : Decimal (regular_price )
420+ "regular_price" : Decimal (
421+ regular_price
422+ )
409423 if regular_price
410424 else None ,
411425 "your_price" : Decimal (your_price )
412426 if your_price
413427 else None ,
414- "retail_price" : Decimal (retail_price )
428+ "retail_price" : Decimal (
429+ retail_price
430+ )
415431 if retail_price
416432 else None ,
417433 }
0 commit comments