|
38 | 38 | ListWebhookEventsResponse, |
39 | 39 | ListWebhooksResponse, |
40 | 40 | Statistics, |
| 41 | + UpdateDomainRequest, |
41 | 42 | UpdateWebhookRequest, |
42 | 43 | Webhook, |
43 | 44 | WebhookEvent, |
|
60 | 61 | marshal_CreateDomainRequest, |
61 | 62 | marshal_CreateEmailRequest, |
62 | 63 | marshal_CreateWebhookRequest, |
| 64 | + marshal_UpdateDomainRequest, |
63 | 65 | marshal_UpdateWebhookRequest, |
64 | 66 | ) |
65 | 67 |
|
@@ -761,6 +763,50 @@ async def get_domain_last_status( |
761 | 763 | self._throw_on_error(res) |
762 | 764 | return unmarshal_DomainLastStatus(res.json()) |
763 | 765 |
|
| 766 | + async def update_domain( |
| 767 | + self, |
| 768 | + *, |
| 769 | + domain_id: str, |
| 770 | + region: Optional[Region] = None, |
| 771 | + autoconfig: Optional[bool] = None, |
| 772 | + ) -> Domain: |
| 773 | + """ |
| 774 | + Update a domain. |
| 775 | + Update a domain auto-configuration. |
| 776 | + :param domain_id: ID of the domain to update. |
| 777 | + :param region: Region to target. If none is passed will use default region from the config. |
| 778 | + :param autoconfig: (Optional) If set to true, activate auto-configuration of the domain's DNS zone. |
| 779 | + :return: :class:`Domain <Domain>` |
| 780 | +
|
| 781 | + Usage: |
| 782 | + :: |
| 783 | +
|
| 784 | + result = await api.update_domain( |
| 785 | + domain_id="example", |
| 786 | + ) |
| 787 | + """ |
| 788 | + |
| 789 | + param_region = validate_path_param( |
| 790 | + "region", region or self.client.default_region |
| 791 | + ) |
| 792 | + param_domain_id = validate_path_param("domain_id", domain_id) |
| 793 | + |
| 794 | + res = self._request( |
| 795 | + "PATCH", |
| 796 | + f"/transactional-email/v1alpha1/regions/{param_region}/domains/{param_domain_id}", |
| 797 | + body=marshal_UpdateDomainRequest( |
| 798 | + UpdateDomainRequest( |
| 799 | + domain_id=domain_id, |
| 800 | + region=region, |
| 801 | + autoconfig=autoconfig, |
| 802 | + ), |
| 803 | + self.client, |
| 804 | + ), |
| 805 | + ) |
| 806 | + |
| 807 | + self._throw_on_error(res) |
| 808 | + return unmarshal_Domain(res.json()) |
| 809 | + |
764 | 810 | async def create_webhook( |
765 | 811 | self, |
766 | 812 | *, |
|
0 commit comments