dub 0.26.2__py3-none-any.whl → 0.26.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
dub/_version.py CHANGED
@@ -3,10 +3,10 @@
3
3
  import importlib.metadata
4
4
 
5
5
  __title__: str = "dub"
6
- __version__: str = "0.26.2"
6
+ __version__: str = "0.26.3"
7
7
  __openapi_doc_version__: str = "0.0.1"
8
- __gen_version__: str = "2.616.1"
9
- __user_agent__: str = "speakeasy-sdk/python 0.26.2 2.616.1 0.0.1 dub"
8
+ __gen_version__: str = "2.620.2"
9
+ __user_agent__: str = "speakeasy-sdk/python 0.26.3 2.620.2 0.0.1 dub"
10
10
 
11
11
  try:
12
12
  if __package__ is not None:
dub/domains.py CHANGED
@@ -1265,3 +1265,605 @@ class Domains(BaseSDK):
1265
1265
  http_res_text,
1266
1266
  http_res,
1267
1267
  )
1268
+
1269
+ def register(
1270
+ self,
1271
+ *,
1272
+ request: Optional[
1273
+ Union[
1274
+ operations.RegisterDomainRequestBody,
1275
+ operations.RegisterDomainRequestBodyTypedDict,
1276
+ ]
1277
+ ] = None,
1278
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
1279
+ server_url: Optional[str] = None,
1280
+ timeout_ms: Optional[int] = None,
1281
+ http_headers: Optional[Mapping[str, str]] = None,
1282
+ ) -> Optional[operations.RegisterDomainResponseBody]:
1283
+ r"""Register a domain
1284
+
1285
+ Register a domain for the authenticated workspace. Only available for Enterprise Plans.
1286
+
1287
+ :param request: The request object to send.
1288
+ :param retries: Override the default retry configuration for this method
1289
+ :param server_url: Override the default server URL for this method
1290
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
1291
+ :param http_headers: Additional headers to set or replace on requests.
1292
+ """
1293
+ base_url = None
1294
+ url_variables = None
1295
+ if timeout_ms is None:
1296
+ timeout_ms = self.sdk_configuration.timeout_ms
1297
+
1298
+ if server_url is not None:
1299
+ base_url = server_url
1300
+ else:
1301
+ base_url = self._get_url(base_url, url_variables)
1302
+
1303
+ if not isinstance(request, BaseModel):
1304
+ request = utils.unmarshal(
1305
+ request, Optional[operations.RegisterDomainRequestBody]
1306
+ )
1307
+ request = cast(Optional[operations.RegisterDomainRequestBody], request)
1308
+
1309
+ req = self._build_request(
1310
+ method="POST",
1311
+ path="/domains/register",
1312
+ base_url=base_url,
1313
+ url_variables=url_variables,
1314
+ request=request,
1315
+ request_body_required=False,
1316
+ request_has_path_params=False,
1317
+ request_has_query_params=True,
1318
+ user_agent_header="user-agent",
1319
+ accept_header_value="application/json",
1320
+ http_headers=http_headers,
1321
+ security=self.sdk_configuration.security,
1322
+ get_serialized_body=lambda: utils.serialize_request_body(
1323
+ request,
1324
+ False,
1325
+ True,
1326
+ "json",
1327
+ Optional[operations.RegisterDomainRequestBody],
1328
+ ),
1329
+ timeout_ms=timeout_ms,
1330
+ )
1331
+
1332
+ if retries == UNSET:
1333
+ if self.sdk_configuration.retry_config is not UNSET:
1334
+ retries = self.sdk_configuration.retry_config
1335
+
1336
+ retry_config = None
1337
+ if isinstance(retries, utils.RetryConfig):
1338
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
1339
+
1340
+ http_res = self.do_request(
1341
+ hook_ctx=HookContext(
1342
+ config=self.sdk_configuration,
1343
+ base_url=base_url or "",
1344
+ operation_id="registerDomain",
1345
+ oauth2_scopes=[],
1346
+ security_source=self.sdk_configuration.security,
1347
+ ),
1348
+ request=req,
1349
+ error_status_codes=[
1350
+ "400",
1351
+ "401",
1352
+ "403",
1353
+ "404",
1354
+ "409",
1355
+ "410",
1356
+ "422",
1357
+ "429",
1358
+ "4XX",
1359
+ "500",
1360
+ "5XX",
1361
+ ],
1362
+ retry_config=retry_config,
1363
+ )
1364
+
1365
+ response_data: Any = None
1366
+ if utils.match_response(http_res, "201", "application/json"):
1367
+ return utils.unmarshal_json(
1368
+ http_res.text, Optional[operations.RegisterDomainResponseBody]
1369
+ )
1370
+ if utils.match_response(http_res, "400", "application/json"):
1371
+ response_data = utils.unmarshal_json(http_res.text, errors.BadRequestData)
1372
+ raise errors.BadRequest(data=response_data)
1373
+ if utils.match_response(http_res, "401", "application/json"):
1374
+ response_data = utils.unmarshal_json(http_res.text, errors.UnauthorizedData)
1375
+ raise errors.Unauthorized(data=response_data)
1376
+ if utils.match_response(http_res, "403", "application/json"):
1377
+ response_data = utils.unmarshal_json(http_res.text, errors.ForbiddenData)
1378
+ raise errors.Forbidden(data=response_data)
1379
+ if utils.match_response(http_res, "404", "application/json"):
1380
+ response_data = utils.unmarshal_json(http_res.text, errors.NotFoundData)
1381
+ raise errors.NotFound(data=response_data)
1382
+ if utils.match_response(http_res, "409", "application/json"):
1383
+ response_data = utils.unmarshal_json(http_res.text, errors.ConflictData)
1384
+ raise errors.Conflict(data=response_data)
1385
+ if utils.match_response(http_res, "410", "application/json"):
1386
+ response_data = utils.unmarshal_json(
1387
+ http_res.text, errors.InviteExpiredData
1388
+ )
1389
+ raise errors.InviteExpired(data=response_data)
1390
+ if utils.match_response(http_res, "422", "application/json"):
1391
+ response_data = utils.unmarshal_json(
1392
+ http_res.text, errors.UnprocessableEntityData
1393
+ )
1394
+ raise errors.UnprocessableEntity(data=response_data)
1395
+ if utils.match_response(http_res, "429", "application/json"):
1396
+ response_data = utils.unmarshal_json(
1397
+ http_res.text, errors.RateLimitExceededData
1398
+ )
1399
+ raise errors.RateLimitExceeded(data=response_data)
1400
+ if utils.match_response(http_res, "500", "application/json"):
1401
+ response_data = utils.unmarshal_json(
1402
+ http_res.text, errors.InternalServerErrorData
1403
+ )
1404
+ raise errors.InternalServerError(data=response_data)
1405
+ if utils.match_response(http_res, "4XX", "*"):
1406
+ http_res_text = utils.stream_to_text(http_res)
1407
+ raise errors.SDKError(
1408
+ "API error occurred", http_res.status_code, http_res_text, http_res
1409
+ )
1410
+ if utils.match_response(http_res, "5XX", "*"):
1411
+ http_res_text = utils.stream_to_text(http_res)
1412
+ raise errors.SDKError(
1413
+ "API error occurred", http_res.status_code, http_res_text, http_res
1414
+ )
1415
+
1416
+ content_type = http_res.headers.get("Content-Type")
1417
+ http_res_text = utils.stream_to_text(http_res)
1418
+ raise errors.SDKError(
1419
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1420
+ http_res.status_code,
1421
+ http_res_text,
1422
+ http_res,
1423
+ )
1424
+
1425
+ async def register_async(
1426
+ self,
1427
+ *,
1428
+ request: Optional[
1429
+ Union[
1430
+ operations.RegisterDomainRequestBody,
1431
+ operations.RegisterDomainRequestBodyTypedDict,
1432
+ ]
1433
+ ] = None,
1434
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
1435
+ server_url: Optional[str] = None,
1436
+ timeout_ms: Optional[int] = None,
1437
+ http_headers: Optional[Mapping[str, str]] = None,
1438
+ ) -> Optional[operations.RegisterDomainResponseBody]:
1439
+ r"""Register a domain
1440
+
1441
+ Register a domain for the authenticated workspace. Only available for Enterprise Plans.
1442
+
1443
+ :param request: The request object to send.
1444
+ :param retries: Override the default retry configuration for this method
1445
+ :param server_url: Override the default server URL for this method
1446
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
1447
+ :param http_headers: Additional headers to set or replace on requests.
1448
+ """
1449
+ base_url = None
1450
+ url_variables = None
1451
+ if timeout_ms is None:
1452
+ timeout_ms = self.sdk_configuration.timeout_ms
1453
+
1454
+ if server_url is not None:
1455
+ base_url = server_url
1456
+ else:
1457
+ base_url = self._get_url(base_url, url_variables)
1458
+
1459
+ if not isinstance(request, BaseModel):
1460
+ request = utils.unmarshal(
1461
+ request, Optional[operations.RegisterDomainRequestBody]
1462
+ )
1463
+ request = cast(Optional[operations.RegisterDomainRequestBody], request)
1464
+
1465
+ req = self._build_request_async(
1466
+ method="POST",
1467
+ path="/domains/register",
1468
+ base_url=base_url,
1469
+ url_variables=url_variables,
1470
+ request=request,
1471
+ request_body_required=False,
1472
+ request_has_path_params=False,
1473
+ request_has_query_params=True,
1474
+ user_agent_header="user-agent",
1475
+ accept_header_value="application/json",
1476
+ http_headers=http_headers,
1477
+ security=self.sdk_configuration.security,
1478
+ get_serialized_body=lambda: utils.serialize_request_body(
1479
+ request,
1480
+ False,
1481
+ True,
1482
+ "json",
1483
+ Optional[operations.RegisterDomainRequestBody],
1484
+ ),
1485
+ timeout_ms=timeout_ms,
1486
+ )
1487
+
1488
+ if retries == UNSET:
1489
+ if self.sdk_configuration.retry_config is not UNSET:
1490
+ retries = self.sdk_configuration.retry_config
1491
+
1492
+ retry_config = None
1493
+ if isinstance(retries, utils.RetryConfig):
1494
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
1495
+
1496
+ http_res = await self.do_request_async(
1497
+ hook_ctx=HookContext(
1498
+ config=self.sdk_configuration,
1499
+ base_url=base_url or "",
1500
+ operation_id="registerDomain",
1501
+ oauth2_scopes=[],
1502
+ security_source=self.sdk_configuration.security,
1503
+ ),
1504
+ request=req,
1505
+ error_status_codes=[
1506
+ "400",
1507
+ "401",
1508
+ "403",
1509
+ "404",
1510
+ "409",
1511
+ "410",
1512
+ "422",
1513
+ "429",
1514
+ "4XX",
1515
+ "500",
1516
+ "5XX",
1517
+ ],
1518
+ retry_config=retry_config,
1519
+ )
1520
+
1521
+ response_data: Any = None
1522
+ if utils.match_response(http_res, "201", "application/json"):
1523
+ return utils.unmarshal_json(
1524
+ http_res.text, Optional[operations.RegisterDomainResponseBody]
1525
+ )
1526
+ if utils.match_response(http_res, "400", "application/json"):
1527
+ response_data = utils.unmarshal_json(http_res.text, errors.BadRequestData)
1528
+ raise errors.BadRequest(data=response_data)
1529
+ if utils.match_response(http_res, "401", "application/json"):
1530
+ response_data = utils.unmarshal_json(http_res.text, errors.UnauthorizedData)
1531
+ raise errors.Unauthorized(data=response_data)
1532
+ if utils.match_response(http_res, "403", "application/json"):
1533
+ response_data = utils.unmarshal_json(http_res.text, errors.ForbiddenData)
1534
+ raise errors.Forbidden(data=response_data)
1535
+ if utils.match_response(http_res, "404", "application/json"):
1536
+ response_data = utils.unmarshal_json(http_res.text, errors.NotFoundData)
1537
+ raise errors.NotFound(data=response_data)
1538
+ if utils.match_response(http_res, "409", "application/json"):
1539
+ response_data = utils.unmarshal_json(http_res.text, errors.ConflictData)
1540
+ raise errors.Conflict(data=response_data)
1541
+ if utils.match_response(http_res, "410", "application/json"):
1542
+ response_data = utils.unmarshal_json(
1543
+ http_res.text, errors.InviteExpiredData
1544
+ )
1545
+ raise errors.InviteExpired(data=response_data)
1546
+ if utils.match_response(http_res, "422", "application/json"):
1547
+ response_data = utils.unmarshal_json(
1548
+ http_res.text, errors.UnprocessableEntityData
1549
+ )
1550
+ raise errors.UnprocessableEntity(data=response_data)
1551
+ if utils.match_response(http_res, "429", "application/json"):
1552
+ response_data = utils.unmarshal_json(
1553
+ http_res.text, errors.RateLimitExceededData
1554
+ )
1555
+ raise errors.RateLimitExceeded(data=response_data)
1556
+ if utils.match_response(http_res, "500", "application/json"):
1557
+ response_data = utils.unmarshal_json(
1558
+ http_res.text, errors.InternalServerErrorData
1559
+ )
1560
+ raise errors.InternalServerError(data=response_data)
1561
+ if utils.match_response(http_res, "4XX", "*"):
1562
+ http_res_text = await utils.stream_to_text_async(http_res)
1563
+ raise errors.SDKError(
1564
+ "API error occurred", http_res.status_code, http_res_text, http_res
1565
+ )
1566
+ if utils.match_response(http_res, "5XX", "*"):
1567
+ http_res_text = await utils.stream_to_text_async(http_res)
1568
+ raise errors.SDKError(
1569
+ "API error occurred", http_res.status_code, http_res_text, http_res
1570
+ )
1571
+
1572
+ content_type = http_res.headers.get("Content-Type")
1573
+ http_res_text = await utils.stream_to_text_async(http_res)
1574
+ raise errors.SDKError(
1575
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1576
+ http_res.status_code,
1577
+ http_res_text,
1578
+ http_res,
1579
+ )
1580
+
1581
+ def check_status(
1582
+ self,
1583
+ *,
1584
+ request: Union[
1585
+ operations.CheckDomainStatusRequest,
1586
+ operations.CheckDomainStatusRequestTypedDict,
1587
+ ],
1588
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
1589
+ server_url: Optional[str] = None,
1590
+ timeout_ms: Optional[int] = None,
1591
+ http_headers: Optional[Mapping[str, str]] = None,
1592
+ ) -> Optional[List[operations.CheckDomainStatusResponseBody]]:
1593
+ r"""Check the availability of one or more domains
1594
+
1595
+ Check if a domain name is available for purchase. You can check multiple domains at once.
1596
+
1597
+ :param request: The request object to send.
1598
+ :param retries: Override the default retry configuration for this method
1599
+ :param server_url: Override the default server URL for this method
1600
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
1601
+ :param http_headers: Additional headers to set or replace on requests.
1602
+ """
1603
+ base_url = None
1604
+ url_variables = None
1605
+ if timeout_ms is None:
1606
+ timeout_ms = self.sdk_configuration.timeout_ms
1607
+
1608
+ if server_url is not None:
1609
+ base_url = server_url
1610
+ else:
1611
+ base_url = self._get_url(base_url, url_variables)
1612
+
1613
+ if not isinstance(request, BaseModel):
1614
+ request = utils.unmarshal(request, operations.CheckDomainStatusRequest)
1615
+ request = cast(operations.CheckDomainStatusRequest, request)
1616
+
1617
+ req = self._build_request(
1618
+ method="GET",
1619
+ path="/domains/status",
1620
+ base_url=base_url,
1621
+ url_variables=url_variables,
1622
+ request=request,
1623
+ request_body_required=False,
1624
+ request_has_path_params=False,
1625
+ request_has_query_params=True,
1626
+ user_agent_header="user-agent",
1627
+ accept_header_value="application/json",
1628
+ http_headers=http_headers,
1629
+ security=self.sdk_configuration.security,
1630
+ timeout_ms=timeout_ms,
1631
+ )
1632
+
1633
+ if retries == UNSET:
1634
+ if self.sdk_configuration.retry_config is not UNSET:
1635
+ retries = self.sdk_configuration.retry_config
1636
+
1637
+ retry_config = None
1638
+ if isinstance(retries, utils.RetryConfig):
1639
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
1640
+
1641
+ http_res = self.do_request(
1642
+ hook_ctx=HookContext(
1643
+ config=self.sdk_configuration,
1644
+ base_url=base_url or "",
1645
+ operation_id="checkDomainStatus",
1646
+ oauth2_scopes=[],
1647
+ security_source=self.sdk_configuration.security,
1648
+ ),
1649
+ request=req,
1650
+ error_status_codes=[
1651
+ "400",
1652
+ "401",
1653
+ "403",
1654
+ "404",
1655
+ "409",
1656
+ "410",
1657
+ "422",
1658
+ "429",
1659
+ "4XX",
1660
+ "500",
1661
+ "5XX",
1662
+ ],
1663
+ retry_config=retry_config,
1664
+ )
1665
+
1666
+ response_data: Any = None
1667
+ if utils.match_response(http_res, "200", "application/json"):
1668
+ return utils.unmarshal_json(
1669
+ http_res.text, Optional[List[operations.CheckDomainStatusResponseBody]]
1670
+ )
1671
+ if utils.match_response(http_res, "400", "application/json"):
1672
+ response_data = utils.unmarshal_json(http_res.text, errors.BadRequestData)
1673
+ raise errors.BadRequest(data=response_data)
1674
+ if utils.match_response(http_res, "401", "application/json"):
1675
+ response_data = utils.unmarshal_json(http_res.text, errors.UnauthorizedData)
1676
+ raise errors.Unauthorized(data=response_data)
1677
+ if utils.match_response(http_res, "403", "application/json"):
1678
+ response_data = utils.unmarshal_json(http_res.text, errors.ForbiddenData)
1679
+ raise errors.Forbidden(data=response_data)
1680
+ if utils.match_response(http_res, "404", "application/json"):
1681
+ response_data = utils.unmarshal_json(http_res.text, errors.NotFoundData)
1682
+ raise errors.NotFound(data=response_data)
1683
+ if utils.match_response(http_res, "409", "application/json"):
1684
+ response_data = utils.unmarshal_json(http_res.text, errors.ConflictData)
1685
+ raise errors.Conflict(data=response_data)
1686
+ if utils.match_response(http_res, "410", "application/json"):
1687
+ response_data = utils.unmarshal_json(
1688
+ http_res.text, errors.InviteExpiredData
1689
+ )
1690
+ raise errors.InviteExpired(data=response_data)
1691
+ if utils.match_response(http_res, "422", "application/json"):
1692
+ response_data = utils.unmarshal_json(
1693
+ http_res.text, errors.UnprocessableEntityData
1694
+ )
1695
+ raise errors.UnprocessableEntity(data=response_data)
1696
+ if utils.match_response(http_res, "429", "application/json"):
1697
+ response_data = utils.unmarshal_json(
1698
+ http_res.text, errors.RateLimitExceededData
1699
+ )
1700
+ raise errors.RateLimitExceeded(data=response_data)
1701
+ if utils.match_response(http_res, "500", "application/json"):
1702
+ response_data = utils.unmarshal_json(
1703
+ http_res.text, errors.InternalServerErrorData
1704
+ )
1705
+ raise errors.InternalServerError(data=response_data)
1706
+ if utils.match_response(http_res, "4XX", "*"):
1707
+ http_res_text = utils.stream_to_text(http_res)
1708
+ raise errors.SDKError(
1709
+ "API error occurred", http_res.status_code, http_res_text, http_res
1710
+ )
1711
+ if utils.match_response(http_res, "5XX", "*"):
1712
+ http_res_text = utils.stream_to_text(http_res)
1713
+ raise errors.SDKError(
1714
+ "API error occurred", http_res.status_code, http_res_text, http_res
1715
+ )
1716
+
1717
+ content_type = http_res.headers.get("Content-Type")
1718
+ http_res_text = utils.stream_to_text(http_res)
1719
+ raise errors.SDKError(
1720
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1721
+ http_res.status_code,
1722
+ http_res_text,
1723
+ http_res,
1724
+ )
1725
+
1726
+ async def check_status_async(
1727
+ self,
1728
+ *,
1729
+ request: Union[
1730
+ operations.CheckDomainStatusRequest,
1731
+ operations.CheckDomainStatusRequestTypedDict,
1732
+ ],
1733
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
1734
+ server_url: Optional[str] = None,
1735
+ timeout_ms: Optional[int] = None,
1736
+ http_headers: Optional[Mapping[str, str]] = None,
1737
+ ) -> Optional[List[operations.CheckDomainStatusResponseBody]]:
1738
+ r"""Check the availability of one or more domains
1739
+
1740
+ Check if a domain name is available for purchase. You can check multiple domains at once.
1741
+
1742
+ :param request: The request object to send.
1743
+ :param retries: Override the default retry configuration for this method
1744
+ :param server_url: Override the default server URL for this method
1745
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
1746
+ :param http_headers: Additional headers to set or replace on requests.
1747
+ """
1748
+ base_url = None
1749
+ url_variables = None
1750
+ if timeout_ms is None:
1751
+ timeout_ms = self.sdk_configuration.timeout_ms
1752
+
1753
+ if server_url is not None:
1754
+ base_url = server_url
1755
+ else:
1756
+ base_url = self._get_url(base_url, url_variables)
1757
+
1758
+ if not isinstance(request, BaseModel):
1759
+ request = utils.unmarshal(request, operations.CheckDomainStatusRequest)
1760
+ request = cast(operations.CheckDomainStatusRequest, request)
1761
+
1762
+ req = self._build_request_async(
1763
+ method="GET",
1764
+ path="/domains/status",
1765
+ base_url=base_url,
1766
+ url_variables=url_variables,
1767
+ request=request,
1768
+ request_body_required=False,
1769
+ request_has_path_params=False,
1770
+ request_has_query_params=True,
1771
+ user_agent_header="user-agent",
1772
+ accept_header_value="application/json",
1773
+ http_headers=http_headers,
1774
+ security=self.sdk_configuration.security,
1775
+ timeout_ms=timeout_ms,
1776
+ )
1777
+
1778
+ if retries == UNSET:
1779
+ if self.sdk_configuration.retry_config is not UNSET:
1780
+ retries = self.sdk_configuration.retry_config
1781
+
1782
+ retry_config = None
1783
+ if isinstance(retries, utils.RetryConfig):
1784
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
1785
+
1786
+ http_res = await self.do_request_async(
1787
+ hook_ctx=HookContext(
1788
+ config=self.sdk_configuration,
1789
+ base_url=base_url or "",
1790
+ operation_id="checkDomainStatus",
1791
+ oauth2_scopes=[],
1792
+ security_source=self.sdk_configuration.security,
1793
+ ),
1794
+ request=req,
1795
+ error_status_codes=[
1796
+ "400",
1797
+ "401",
1798
+ "403",
1799
+ "404",
1800
+ "409",
1801
+ "410",
1802
+ "422",
1803
+ "429",
1804
+ "4XX",
1805
+ "500",
1806
+ "5XX",
1807
+ ],
1808
+ retry_config=retry_config,
1809
+ )
1810
+
1811
+ response_data: Any = None
1812
+ if utils.match_response(http_res, "200", "application/json"):
1813
+ return utils.unmarshal_json(
1814
+ http_res.text, Optional[List[operations.CheckDomainStatusResponseBody]]
1815
+ )
1816
+ if utils.match_response(http_res, "400", "application/json"):
1817
+ response_data = utils.unmarshal_json(http_res.text, errors.BadRequestData)
1818
+ raise errors.BadRequest(data=response_data)
1819
+ if utils.match_response(http_res, "401", "application/json"):
1820
+ response_data = utils.unmarshal_json(http_res.text, errors.UnauthorizedData)
1821
+ raise errors.Unauthorized(data=response_data)
1822
+ if utils.match_response(http_res, "403", "application/json"):
1823
+ response_data = utils.unmarshal_json(http_res.text, errors.ForbiddenData)
1824
+ raise errors.Forbidden(data=response_data)
1825
+ if utils.match_response(http_res, "404", "application/json"):
1826
+ response_data = utils.unmarshal_json(http_res.text, errors.NotFoundData)
1827
+ raise errors.NotFound(data=response_data)
1828
+ if utils.match_response(http_res, "409", "application/json"):
1829
+ response_data = utils.unmarshal_json(http_res.text, errors.ConflictData)
1830
+ raise errors.Conflict(data=response_data)
1831
+ if utils.match_response(http_res, "410", "application/json"):
1832
+ response_data = utils.unmarshal_json(
1833
+ http_res.text, errors.InviteExpiredData
1834
+ )
1835
+ raise errors.InviteExpired(data=response_data)
1836
+ if utils.match_response(http_res, "422", "application/json"):
1837
+ response_data = utils.unmarshal_json(
1838
+ http_res.text, errors.UnprocessableEntityData
1839
+ )
1840
+ raise errors.UnprocessableEntity(data=response_data)
1841
+ if utils.match_response(http_res, "429", "application/json"):
1842
+ response_data = utils.unmarshal_json(
1843
+ http_res.text, errors.RateLimitExceededData
1844
+ )
1845
+ raise errors.RateLimitExceeded(data=response_data)
1846
+ if utils.match_response(http_res, "500", "application/json"):
1847
+ response_data = utils.unmarshal_json(
1848
+ http_res.text, errors.InternalServerErrorData
1849
+ )
1850
+ raise errors.InternalServerError(data=response_data)
1851
+ if utils.match_response(http_res, "4XX", "*"):
1852
+ http_res_text = await utils.stream_to_text_async(http_res)
1853
+ raise errors.SDKError(
1854
+ "API error occurred", http_res.status_code, http_res_text, http_res
1855
+ )
1856
+ if utils.match_response(http_res, "5XX", "*"):
1857
+ http_res_text = await utils.stream_to_text_async(http_res)
1858
+ raise errors.SDKError(
1859
+ "API error occurred", http_res.status_code, http_res_text, http_res
1860
+ )
1861
+
1862
+ content_type = http_res.headers.get("Content-Type")
1863
+ http_res_text = await utils.stream_to_text_async(http_res)
1864
+ raise errors.SDKError(
1865
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1866
+ http_res.status_code,
1867
+ http_res_text,
1868
+ http_res,
1869
+ )
@@ -34,6 +34,14 @@ if TYPE_CHECKING:
34
34
  Data,
35
35
  DataTypedDict,
36
36
  )
37
+ from .checkdomainstatus import (
38
+ CheckDomainStatusRequest,
39
+ CheckDomainStatusRequestTypedDict,
40
+ CheckDomainStatusResponseBody,
41
+ CheckDomainStatusResponseBodyTypedDict,
42
+ Domains,
43
+ DomainsTypedDict,
44
+ )
37
45
  from .createcustomer import (
38
46
  CreateCustomerDiscount,
39
47
  CreateCustomerDiscountTypedDict,
@@ -241,6 +249,12 @@ if TYPE_CHECKING:
241
249
  QueryParamTrigger,
242
250
  )
243
251
  from .listfolders import ListFoldersRequest, ListFoldersRequestTypedDict
252
+ from .registerdomain import (
253
+ RegisterDomainRequestBody,
254
+ RegisterDomainRequestBodyTypedDict,
255
+ RegisterDomainResponseBody,
256
+ RegisterDomainResponseBodyTypedDict,
257
+ )
244
258
  from .retrieveanalytics import (
245
259
  Event,
246
260
  Interval,
@@ -396,6 +410,10 @@ __all__ = [
396
410
  "BulkUpdateLinksTagNamesTypedDict",
397
411
  "BulkUpdateLinksTestVariants",
398
412
  "BulkUpdateLinksTestVariantsTypedDict",
413
+ "CheckDomainStatusRequest",
414
+ "CheckDomainStatusRequestTypedDict",
415
+ "CheckDomainStatusResponseBody",
416
+ "CheckDomainStatusResponseBodyTypedDict",
399
417
  "Click",
400
418
  "ClickTypedDict",
401
419
  "Color",
@@ -481,6 +499,8 @@ __all__ = [
481
499
  "DeleteTagResponseBodyTypedDict",
482
500
  "Discount",
483
501
  "DiscountTypedDict",
502
+ "Domains",
503
+ "DomainsTypedDict",
484
504
  "Event",
485
505
  "Four",
486
506
  "GetCustomerDiscount",
@@ -573,6 +593,10 @@ __all__ = [
573
593
  "QueryParamTagNames",
574
594
  "QueryParamTagNamesTypedDict",
575
595
  "QueryParamTrigger",
596
+ "RegisterDomainRequestBody",
597
+ "RegisterDomainRequestBodyTypedDict",
598
+ "RegisterDomainResponseBody",
599
+ "RegisterDomainResponseBodyTypedDict",
576
600
  "RequestBody",
577
601
  "RequestBodyTypedDict",
578
602
  "ResponseBody",
@@ -711,6 +735,12 @@ _dynamic_imports: dict[str, str] = {
711
735
  "BulkUpdateLinksTestVariantsTypedDict": ".bulkupdatelinks",
712
736
  "Data": ".bulkupdatelinks",
713
737
  "DataTypedDict": ".bulkupdatelinks",
738
+ "CheckDomainStatusRequest": ".checkdomainstatus",
739
+ "CheckDomainStatusRequestTypedDict": ".checkdomainstatus",
740
+ "CheckDomainStatusResponseBody": ".checkdomainstatus",
741
+ "CheckDomainStatusResponseBodyTypedDict": ".checkdomainstatus",
742
+ "Domains": ".checkdomainstatus",
743
+ "DomainsTypedDict": ".checkdomainstatus",
714
744
  "CreateCustomerDiscount": ".createcustomer",
715
745
  "CreateCustomerDiscountTypedDict": ".createcustomer",
716
746
  "CreateCustomerLink": ".createcustomer",
@@ -888,6 +918,10 @@ _dynamic_imports: dict[str, str] = {
888
918
  "QueryParamTrigger": ".listevents",
889
919
  "ListFoldersRequest": ".listfolders",
890
920
  "ListFoldersRequestTypedDict": ".listfolders",
921
+ "RegisterDomainRequestBody": ".registerdomain",
922
+ "RegisterDomainRequestBodyTypedDict": ".registerdomain",
923
+ "RegisterDomainResponseBody": ".registerdomain",
924
+ "RegisterDomainResponseBodyTypedDict": ".registerdomain",
891
925
  "Event": ".retrieveanalytics",
892
926
  "Interval": ".retrieveanalytics",
893
927
  "QueryParamGroupBy": ".retrieveanalytics",
@@ -0,0 +1,83 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from dub.types import BaseModel, Nullable, UNSET_SENTINEL
5
+ from dub.utils import FieldMetadata, QueryParamMetadata
6
+ from pydantic import model_serializer
7
+ from typing import List, Union
8
+ from typing_extensions import Annotated, TypeAliasType, TypedDict
9
+
10
+
11
+ DomainsTypedDict = TypeAliasType("DomainsTypedDict", Union[str, List[str]])
12
+ r"""The domains to search. We only support .link domains for now."""
13
+
14
+
15
+ Domains = TypeAliasType("Domains", Union[str, List[str]])
16
+ r"""The domains to search. We only support .link domains for now."""
17
+
18
+
19
+ class CheckDomainStatusRequestTypedDict(TypedDict):
20
+ domains: DomainsTypedDict
21
+ r"""The domains to search. We only support .link domains for now."""
22
+
23
+
24
+ class CheckDomainStatusRequest(BaseModel):
25
+ domains: Annotated[
26
+ Domains, FieldMetadata(query=QueryParamMetadata(style="form", explode=False))
27
+ ]
28
+ r"""The domains to search. We only support .link domains for now."""
29
+
30
+
31
+ class CheckDomainStatusResponseBodyTypedDict(TypedDict):
32
+ domain: str
33
+ r"""The domain name."""
34
+ available: bool
35
+ r"""Whether the domain is available."""
36
+ price: Nullable[str]
37
+ r"""The price description."""
38
+ premium: Nullable[bool]
39
+ r"""Whether the domain is a premium domain."""
40
+
41
+
42
+ class CheckDomainStatusResponseBody(BaseModel):
43
+ domain: str
44
+ r"""The domain name."""
45
+
46
+ available: bool
47
+ r"""Whether the domain is available."""
48
+
49
+ price: Nullable[str]
50
+ r"""The price description."""
51
+
52
+ premium: Nullable[bool]
53
+ r"""Whether the domain is a premium domain."""
54
+
55
+ @model_serializer(mode="wrap")
56
+ def serialize_model(self, handler):
57
+ optional_fields = []
58
+ nullable_fields = ["price", "premium"]
59
+ null_default_fields = []
60
+
61
+ serialized = handler(self)
62
+
63
+ m = {}
64
+
65
+ for n, f in type(self).model_fields.items():
66
+ k = f.alias or n
67
+ val = serialized.get(k)
68
+ serialized.pop(k, None)
69
+
70
+ optional_nullable = k in optional_fields and k in nullable_fields
71
+ is_set = (
72
+ self.__pydantic_fields_set__.intersection({n})
73
+ or k in null_default_fields
74
+ ) # pylint: disable=no-member
75
+
76
+ if val is not None and val != UNSET_SENTINEL:
77
+ m[k] = val
78
+ elif val != UNSET_SENTINEL and (
79
+ not k in optional_fields or (optional_nullable and is_set)
80
+ ):
81
+ m[k] = val
82
+
83
+ return m
@@ -0,0 +1,70 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from dub.types import BaseModel, Nullable, UNSET_SENTINEL
5
+ from pydantic import model_serializer
6
+ from typing_extensions import TypedDict
7
+
8
+
9
+ class RegisterDomainRequestBodyTypedDict(TypedDict):
10
+ domain: str
11
+ r"""The domain to claim. We only support .link domains for now."""
12
+
13
+
14
+ class RegisterDomainRequestBody(BaseModel):
15
+ domain: str
16
+ r"""The domain to claim. We only support .link domains for now."""
17
+
18
+
19
+ class RegisterDomainResponseBodyTypedDict(TypedDict):
20
+ r"""The domain was registered."""
21
+
22
+ domain: str
23
+ r"""The domain name."""
24
+ status: str
25
+ r"""The status of the domain registration."""
26
+ expiration: Nullable[float]
27
+ r"""The expiration timestamp of the domain (Unix timestamp in milliseconds)."""
28
+
29
+
30
+ class RegisterDomainResponseBody(BaseModel):
31
+ r"""The domain was registered."""
32
+
33
+ domain: str
34
+ r"""The domain name."""
35
+
36
+ status: str
37
+ r"""The status of the domain registration."""
38
+
39
+ expiration: Nullable[float]
40
+ r"""The expiration timestamp of the domain (Unix timestamp in milliseconds)."""
41
+
42
+ @model_serializer(mode="wrap")
43
+ def serialize_model(self, handler):
44
+ optional_fields = []
45
+ nullable_fields = ["expiration"]
46
+ null_default_fields = []
47
+
48
+ serialized = handler(self)
49
+
50
+ m = {}
51
+
52
+ for n, f in type(self).model_fields.items():
53
+ k = f.alias or n
54
+ val = serialized.get(k)
55
+ serialized.pop(k, None)
56
+
57
+ optional_nullable = k in optional_fields and k in nullable_fields
58
+ is_set = (
59
+ self.__pydantic_fields_set__.intersection({n})
60
+ or k in null_default_fields
61
+ ) # pylint: disable=no-member
62
+
63
+ if val is not None and val != UNSET_SENTINEL:
64
+ m[k] = val
65
+ elif val != UNSET_SENTINEL and (
66
+ not k in optional_fields or (optional_nullable and is_set)
67
+ ):
68
+ m[k] = val
69
+
70
+ return m
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: dub
3
- Version: 0.26.2
3
+ Version: 0.26.3
4
4
  Summary: Python Client SDK Generated by Speakeasy
5
5
  Author: Speakeasy
6
6
  Requires-Python: >=3.9.2
@@ -296,6 +296,8 @@ asyncio.run(main())
296
296
  * [list](https://github.com/dubinc/dub-python/blob/master/docs/sdks/domains/README.md#list) - Retrieve a list of domains
297
297
  * [update](https://github.com/dubinc/dub-python/blob/master/docs/sdks/domains/README.md#update) - Update a domain
298
298
  * [delete](https://github.com/dubinc/dub-python/blob/master/docs/sdks/domains/README.md#delete) - Delete a domain
299
+ * [register](https://github.com/dubinc/dub-python/blob/master/docs/sdks/domains/README.md#register) - Register a domain
300
+ * [check_status](https://github.com/dubinc/dub-python/blob/master/docs/sdks/domains/README.md#check_status) - Check the availability of one or more domains
299
301
 
300
302
 
301
303
  ### [embed_tokens](https://github.com/dubinc/dub-python/blob/master/docs/sdks/embedtokens/README.md)
@@ -718,7 +720,9 @@ with Dub(
718
720
  token="DUB_API_KEY",
719
721
  ) as d_client:
720
722
 
721
- res = d_client.links.list(request={})
723
+ res = d_client.links.list(request={
724
+ "page_size": 50,
725
+ })
722
726
 
723
727
  while res is not None:
724
728
  # Handle items
@@ -3,12 +3,12 @@ dub/_hooks/__init__.py,sha256=9_7W5jAYw8rcO8Kfc-Ty-lB82BHfksAJJpVFb_UeU1c,146
3
3
  dub/_hooks/registration.py,sha256=tT-1Cjp5ax1DL-84HBNWPy4wAwgP-0aI4-asLfnkIlw,625
4
4
  dub/_hooks/sdkhooks.py,sha256=2rLEjSz1xFGWabNs1voFn0lXSCqkS38bdKVFdnBJufE,2553
5
5
  dub/_hooks/types.py,sha256=5vcNbFBNpCxqI7ZebiBtut7T_Gz2i36L5MjTqGvxV7Y,3035
6
- dub/_version.py,sha256=tDoP9fq7ePw_EHUmATynqbql5sqcvCLk59DEhgRxggw,450
6
+ dub/_version.py,sha256=VI8BzwMY5jpTeqaOXr_TN_HS_FnS5ODw_JcSEw7PDJc,450
7
7
  dub/analytics.py,sha256=acVdNv1hS7JDmBS1ena0kG-RNNq64lRZwOV6_2FZn60,13032
8
8
  dub/basesdk.py,sha256=nY5yee9uE5SQHkG_9Di9MUoQR0KcPr-WrtTCDHUdRnY,11779
9
9
  dub/commissions.py,sha256=H56AkD5M03FuXaIdsd5jY6rWZ7qa8c0gssXQhLkF634,25796
10
10
  dub/customers.py,sha256=XXNR-p5BwtflroD6CnA5zyL0AyuUWG9MNMYUlQAlqL0,63627
11
- dub/domains.py,sha256=R9YntGSxIynlZciHKxXtf5G1lz80NrBvEetfX7ztYQU,52826
11
+ dub/domains.py,sha256=94lm_PSnfZ_Ev1aN1iR-Z7dGEDbefNWdPD7vc_ezaxs,78566
12
12
  dub/embed_tokens.py,sha256=DZWaHM1895a6bgCNB3seubUL1SoW6NG_rRsnjM8JnXM,13748
13
13
  dub/events.py,sha256=0hBGone-gavQSOhwClDT8s_RCv95aZ8f9XDvCT7HleY,12679
14
14
  dub/folders.py,sha256=5ADzg8iDWq1KwGXcQNR1MbHNZY0wBP6YhUSRkgOXe4o,50692
@@ -63,10 +63,11 @@ dub/models/errors/ratelimitexceeded.py,sha256=0S2eQlQMdVQ8BZYXX59AQZkf5HtexijmQn
63
63
  dub/models/errors/sdkerror.py,sha256=kd75e3JYF2TXNgRZopcV-oGdBWoBZqRcvrwqn2fsFYs,528
64
64
  dub/models/errors/unauthorized.py,sha256=ranMcawvM0oJxxVkShfZsc7V5YYjbz9luhHywE_ObIg,1525
65
65
  dub/models/errors/unprocessableentity.py,sha256=TxgP43hrqcBW-UDMo8yJ7B0_o_skIH_dXw3DfEWG_cY,1515
66
- dub/models/operations/__init__.py,sha256=RcVE85OwAkVhIt8CbgdBK7QjfSK10cfmWg5XSCad_Tc,38059
66
+ dub/models/operations/__init__.py,sha256=qQXnwHCbeVw_tQxL3vIkJrD5QPLwPwdLhX94nFQxjYc,39411
67
67
  dub/models/operations/bulkcreatelinks.py,sha256=tT5lA_5LxR_k-WgIFNpYHZu4uvLANSssZbmZ7IamFFA,17466
68
68
  dub/models/operations/bulkdeletelinks.py,sha256=u_hEFC9TZ1UnGGgLhQ-Mf3HNDO98Ur49MtdBnNVIRsE,1151
69
69
  dub/models/operations/bulkupdatelinks.py,sha256=DDEW9Zp2BKPSwdzYGSnATxuFUsv175z3fq4UQ15IvME,16022
70
+ dub/models/operations/checkdomainstatus.py,sha256=W085WT-gUgU73qDi4LlXppdiPVC0Pm1CpPXTqTM56sI,2538
70
71
  dub/models/operations/createcustomer.py,sha256=gAwfJB7hXlbCKbfypCYxshq7LnWkTqAPdMIl1d5UOZQ,12006
71
72
  dub/models/operations/createdomain.py,sha256=dHRvCzE6knsndN4FTFjfijHVmTi8NXKpURz8cM_C-bk,3900
72
73
  dub/models/operations/createfolder.py,sha256=j9z0CIsc22VsWAwlCGNwxo6a3VsetD6t4T2LdCELYGE,1884
@@ -92,6 +93,7 @@ dub/models/operations/listcommissions.py,sha256=6bP8Hc5kwoMi--nCSIaMgDipwUnin47q
92
93
  dub/models/operations/listdomains.py,sha256=gbQrJyBIvTGKSeqJo0Jb08iE44Xu39NS9zbfetx4p-s,1936
93
94
  dub/models/operations/listevents.py,sha256=V-RYIPZwLN3djEK4oFBWafVd-BzzPrTYcShwkvGbmfA,17611
94
95
  dub/models/operations/listfolders.py,sha256=5FGf62ZTjquVXjq5axlzQgYGfEnrEwDn8QLlgGH_7jQ,1209
96
+ dub/models/operations/registerdomain.py,sha256=fjozn1tFU-cNarHdAqN_flQoGAE498ob-f4A2bIAiOc,2058
95
97
  dub/models/operations/retrieveanalytics.py,sha256=ySsbMk9s1zNOpuhPn4_q8wzVjtkmgMcwjpj0qlSmlaE,18879
96
98
  dub/models/operations/retrievelinks.py,sha256=1bLrT_Q2y60eU_gdOHTu99VW8c09gX3nkidb0R5qLuk,2988
97
99
  dub/models/operations/retrievepartneranalytics.py,sha256=MmBDRCB5lQ1lKkfHpeMnZcQXkKIjSCVGEUVcvJgZ_Io,5275
@@ -132,7 +134,7 @@ dub/utils/serializers.py,sha256=hiHBXM1AY8_N2Z_rvFfNSYwvLBkSQlPGFp8poasdU4s,5986
132
134
  dub/utils/url.py,sha256=BgGPgcTA6MRK4bF8fjP2dUopN3NzEzxWMXPBVg8NQUA,5254
133
135
  dub/utils/values.py,sha256=CcaCXEa3xHhkUDROyXZocN8f0bdITftv9Y0P9lTf0YM,3517
134
136
  dub/workspaces.py,sha256=_4KOZwwL0KADDqSrHZWfO7LpEwLi59uvaKm-X7JzAv0,25823
135
- dub-0.26.2.dist-info/LICENSE,sha256=kc_aZ6YHHcdSsRy-mGsT0Ehji0ZgR_zevXiUt05V2KY,1079
136
- dub-0.26.2.dist-info/METADATA,sha256=LjZBo2cE1QgkqMpdeYwj8AZYeKz2AlsvZlnr0-jqv8o,27769
137
- dub-0.26.2.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
138
- dub-0.26.2.dist-info/RECORD,,
137
+ dub-0.26.3.dist-info/LICENSE,sha256=kc_aZ6YHHcdSsRy-mGsT0Ehji0ZgR_zevXiUt05V2KY,1079
138
+ dub-0.26.3.dist-info/METADATA,sha256=wuzGsB3qU6IUGAFPBMln7moPaOtWr1x1MLxTdt4wSas,28075
139
+ dub-0.26.3.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
140
+ dub-0.26.3.dist-info/RECORD,,
File without changes
File without changes