|
34 | 34 | DatabaseApiUnassignDatabaseUserRequest, |
35 | 35 | DatabaseUser, |
36 | 36 | DnsApiCheckUserOwnsDomainRequest, |
| 37 | + DnsApiSyncDomainDnsRecordsRequest, |
37 | 38 | DnsRecords, |
38 | 39 | FtpAccount, |
39 | 40 | FtpAccountApiChangeFtpAccountPasswordRequest, |
|
59 | 60 | ResetHostingPasswordResponse, |
60 | 61 | ResourceSummary, |
61 | 62 | Session, |
| 63 | + SyncDomainDnsRecordsRequestRecord, |
62 | 64 | Website, |
63 | 65 | ) |
64 | 66 | from .content import ( |
|
89 | 91 | marshal_DatabaseApiCreateDatabaseUserRequest, |
90 | 92 | marshal_DatabaseApiUnassignDatabaseUserRequest, |
91 | 93 | marshal_DnsApiCheckUserOwnsDomainRequest, |
| 94 | + marshal_DnsApiSyncDomainDnsRecordsRequest, |
92 | 95 | marshal_FtpAccountApiChangeFtpAccountPasswordRequest, |
93 | 96 | marshal_FtpAccountApiCreateFtpAccountRequest, |
94 | 97 | marshal_HostingApiCreateHostingRequest, |
@@ -824,6 +827,61 @@ async def check_user_owns_domain( |
824 | 827 | self._throw_on_error(res) |
825 | 828 | return unmarshal_CheckUserOwnsDomainResponse(res.json()) |
826 | 829 |
|
| 830 | + async def sync_domain_dns_records( |
| 831 | + self, |
| 832 | + *, |
| 833 | + domain: str, |
| 834 | + update_web_records: bool, |
| 835 | + update_mail_records: bool, |
| 836 | + update_all_records: bool, |
| 837 | + region: Optional[Region] = None, |
| 838 | + custom_records: Optional[List[SyncDomainDnsRecordsRequestRecord]] = None, |
| 839 | + ) -> DnsRecords: |
| 840 | + """ |
| 841 | + "Synchronize your DNS records on the Elements Console and on cPanel.". |
| 842 | + :param domain: Domain for which the DNS records will be synchronized. |
| 843 | + :param update_web_records: Whether or not to synchronize the web records. |
| 844 | + :param update_mail_records: Whether or not to synchronize the mail records. |
| 845 | + :param update_all_records: Whether or not to synchronize all types of records. This one has priority. |
| 846 | + :param region: Region to target. If none is passed will use default region from the config. |
| 847 | + :param custom_records: Custom records to synchronize. |
| 848 | + :return: :class:`DnsRecords <DnsRecords>` |
| 849 | +
|
| 850 | + Usage: |
| 851 | + :: |
| 852 | +
|
| 853 | + result = await api.sync_domain_dns_records( |
| 854 | + domain="example", |
| 855 | + update_web_records=False, |
| 856 | + update_mail_records=False, |
| 857 | + update_all_records=False, |
| 858 | + ) |
| 859 | + """ |
| 860 | + |
| 861 | + param_region = validate_path_param( |
| 862 | + "region", region or self.client.default_region |
| 863 | + ) |
| 864 | + param_domain = validate_path_param("domain", domain) |
| 865 | + |
| 866 | + res = self._request( |
| 867 | + "POST", |
| 868 | + f"/webhosting/v1/regions/{param_region}/domains/{param_domain}/sync-domain-dns-records", |
| 869 | + body=marshal_DnsApiSyncDomainDnsRecordsRequest( |
| 870 | + DnsApiSyncDomainDnsRecordsRequest( |
| 871 | + domain=domain, |
| 872 | + update_web_records=update_web_records, |
| 873 | + update_mail_records=update_mail_records, |
| 874 | + update_all_records=update_all_records, |
| 875 | + region=region, |
| 876 | + custom_records=custom_records, |
| 877 | + ), |
| 878 | + self.client, |
| 879 | + ), |
| 880 | + ) |
| 881 | + |
| 882 | + self._throw_on_error(res) |
| 883 | + return unmarshal_DnsRecords(res.json()) |
| 884 | + |
827 | 885 |
|
828 | 886 | class WebhostingV1OfferAPI(API): |
829 | 887 | """ |
|
0 commit comments