/*
* Mittwald API
*
* ## Introduction This OpenAPI spec documents the mittwald API. It follows the [OpenAPI 3.0.0 specification](https://spec.openapis.org/oas/v3.0.0.html). ## Authentication You will need an API token to access the API. You can obtain one by logging into the [mStudio](https://studio.mittwald.de) and navigating to the [\"API Tokens\" section in the user menu](https://studio.mittwald.de/app/profile/api-tokens). When making requests to the API, you can authenticate by passing your API token in the `X-Access-Token` header or as a bearer token. ## Rate Limiting Please note that usage of the API is rate-limited to prevent abuse. You can inspect the rate limiting for your current user by observing the `X-Ratelimit-*` headers included in each response. ## mStudio A main consumer of the mittwald API is the management interface for our customers, the [mStudio](https://studio.mittwald.de). ## Contact and support For support, please use the [mStudio support area](https://studio.mittwald.de/app/support/conversations) or drop us an email at [support@mittwald.de](mailto:support@mittwald.de). For security issues, please report to [security@mittwald.de](mailto:security@mittwald.de).
*
* The version of the OpenAPI document: 2.0
*
* Generated by: https://openapi-generator.tech
*/
use reqwest;
use serde::{Deserialize, Serialize};
use crate::{apis::ResponseContent, models};
use super::{Error, configuration};
/// struct for typed errors of method [`deprecated_domain_get_screenshot_for_domain`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DeprecatedDomainGetScreenshotForDomainError {
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`dns_create_dns_zone`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DnsCreateDnsZoneError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`dns_delete_dns_zone`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DnsDeleteDnsZoneError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`dns_get_dns_zone`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DnsGetDnsZoneError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`dns_list_dns_zones`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DnsListDnsZonesError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`dns_record_a_set_custom_deprecated`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DnsRecordASetCustomDeprecatedError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`dns_record_a_set_managed_by_ingress_deprecated`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DnsRecordASetManagedByIngressDeprecatedError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`dns_record_cname_set_deprecated`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DnsRecordCnameSetDeprecatedError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`dns_record_mx_set_custom_deprecated`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DnsRecordMxSetCustomDeprecatedError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`dns_record_mx_set_managed_deprecated`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DnsRecordMxSetManagedDeprecatedError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`dns_record_srv_set_deprecated`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DnsRecordSrvSetDeprecatedError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`dns_record_txt_set_deprecated`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DnsRecordTxtSetDeprecatedError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`dns_set_record_set_managed`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DnsSetRecordSetManagedError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`dns_update_record_set`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DnsUpdateRecordSetError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`domain_abort_domain_declaration`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DomainAbortDomainDeclarationError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`domain_change_ownerc_of_domain_v2_deprecated`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DomainChangeOwnercOfDomainV2DeprecatedError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`domain_change_project_of_domain_v2_deprecated`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DomainChangeProjectOfDomainV2DeprecatedError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`domain_check_domain_registrability`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DomainCheckDomainRegistrabilityError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`domain_check_domain_registrability_v2_deprecated`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DomainCheckDomainRegistrabilityV2DeprecatedError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`domain_check_domain_transferability`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DomainCheckDomainTransferabilityError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`domain_create_domain_auth_code`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DomainCreateDomainAuthCodeError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`domain_declare_nameservers_v2_deprecated`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DomainDeclareNameserversV2DeprecatedError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`domain_declare_process_change_authcode_v2_deprecated`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DomainDeclareProcessChangeAuthcodeV2DeprecatedError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`domain_declare_process_change_handles_v2_deprecated`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DomainDeclareProcessChangeHandlesV2DeprecatedError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`domain_delete_domain`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DomainDeleteDomainError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`domain_get_domain`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DomainGetDomainError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`domain_get_handle_fields_v2_deprecated`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DomainGetHandleFieldsV2DeprecatedError {
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`domain_get_latest_screenshot`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DomainGetLatestScreenshotError {
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`domain_list_domains`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DomainListDomainsError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`domain_list_domains_v2_deprecated`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DomainListDomainsV2DeprecatedError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`domain_list_tld_contact_schemas`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DomainListTldContactSchemasError {
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`domain_list_tlds`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DomainListTldsError {
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`domain_resend_domain_email`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DomainResendDomainEmailError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`domain_suggest`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DomainSuggestError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status412(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`domain_update_domain_auth_code`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DomainUpdateDomainAuthCodeError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`domain_update_domain_contact`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DomainUpdateDomainContactError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`domain_update_domain_nameservers`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DomainUpdateDomainNameserversError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`domain_update_domain_project_id`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DomainUpdateDomainProjectIdError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`ingress_create_ingress`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum IngressCreateIngressError {
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`ingress_delete_ingress`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum IngressDeleteIngressError {
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`ingress_get_ingress`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum IngressGetIngressError {
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`ingress_ingress_verify_ownership`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum IngressIngressVerifyOwnershipError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status412(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`ingress_list_ingresses`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum IngressListIngressesError {
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`ingress_list_ingresses_compatible_with_certificate`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum IngressListIngressesCompatibleWithCertificateError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`ingress_list_ingresses_v2_deprecated`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum IngressListIngressesV2DeprecatedError {
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`ingress_paths_deprecated`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum IngressPathsDeprecatedError {
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`ingress_request_ingress_acme_certificate_issuance`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum IngressRequestIngressAcmeCertificateIssuanceError {
Status400(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodValidationErrors),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`ingress_tls_deprecated`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum IngressTlsDeprecatedError {
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`ingress_update_ingress_paths`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum IngressUpdateIngressPathsError {
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`ingress_update_ingress_tls`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum IngressUpdateIngressTlsError {
Status403(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status412(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`ssl_check_replace_certificate`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SslCheckReplaceCertificateError {
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`ssl_create_certificate_request`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SslCreateCertificateRequestError {
Status400(models::DePeriodMittwaldPeriodV1PeriodSslPeriodCertificateError),
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`ssl_delete_certificate`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SslDeleteCertificateError {
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`ssl_delete_certificate_request`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SslDeleteCertificateRequestError {
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`ssl_get_certificate`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SslGetCertificateError {
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`ssl_get_certificate_request`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SslGetCertificateRequestError {
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`ssl_list_certificate_requests`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SslListCertificateRequestsError {
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`ssl_list_certificates`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SslListCertificatesError {
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`ssl_replace_certificate`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SslReplaceCertificateError {
Status400(models::DePeriodMittwaldPeriodV1PeriodSslPeriodCertificateError),
Status404(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
Status429(models::AppExecuteAction429Response),
DefaultResponse(models::DePeriodMittwaldPeriodV1PeriodCommonsPeriodError),
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`v2_dns_zones_dns_zone_id_delete`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum V2DnsZonesDnsZoneIdDeleteError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`v2_dns_zones_dns_zone_id_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum V2DnsZonesDnsZoneIdGetError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`v2_dns_zones_post`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum V2DnsZonesPostError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`v2_domains_domain_id_actions_create_authcode_post`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum V2DomainsDomainIdActionsCreateAuthcodePostError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`v2_domains_domain_id_authcode_patch`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum V2DomainsDomainIdAuthcodePatchError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`v2_domains_domain_id_declarations_delete`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum V2DomainsDomainIdDeclarationsDeleteError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`v2_domains_supported_tlds_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum V2DomainsSupportedTldsGetError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`v2_projects_project_id_dns_zones_get`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum V2ProjectsProjectIdDnsZonesGetError {
UnknownValue(serde_json::Value),
}
pub async fn deprecated_domain_get_screenshot_for_domain(configuration: &configuration::Configuration, domain_id: &str, deprecated_domain_get_screenshot_for_domain_request: models::DeprecatedDomainGetScreenshotForDomainRequest) -> Result<models::DeprecatedDomainGetScreenshotForDomain200Response, Error<DeprecatedDomainGetScreenshotForDomainError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/domains/{domainId}/screenshots/newest", local_var_configuration.base_path, domainId=crate::apis::urlencode(domain_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&deprecated_domain_get_screenshot_for_domain_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<DeprecatedDomainGetScreenshotForDomainError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn dns_create_dns_zone(configuration: &configuration::Configuration, v2_dns_zones_post_request: Option<models::V2DnsZonesPostRequest>) -> Result<models::AppRequestAppinstallation201Response, Error<DnsCreateDnsZoneError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/dns-zones", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&v2_dns_zones_post_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<DnsCreateDnsZoneError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn dns_delete_dns_zone(configuration: &configuration::Configuration, dns_zone_id: &str) -> Result<(), Error<DnsDeleteDnsZoneError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/dns-zones/{dnsZoneId}", local_var_configuration.base_path, dnsZoneId=crate::apis::urlencode(dns_zone_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<DnsDeleteDnsZoneError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn dns_get_dns_zone(configuration: &configuration::Configuration, dns_zone_id: &str) -> Result<models::DePeriodMittwaldPeriodV1PeriodDnsPeriodZone, Error<DnsGetDnsZoneError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/dns-zones/{dnsZoneId}", local_var_configuration.base_path, dnsZoneId=crate::apis::urlencode(dns_zone_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<DnsGetDnsZoneError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn dns_list_dns_zones(configuration: &configuration::Configuration, project_id: &str) -> Result<Vec<models::DePeriodMittwaldPeriodV1PeriodDnsPeriodZone>, Error<DnsListDnsZonesError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/projects/{projectId}/dns-zones", local_var_configuration.base_path, projectId=crate::apis::urlencode(project_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<DnsListDnsZonesError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn dns_record_a_set_custom_deprecated(configuration: &configuration::Configuration, zone_id: &str, dns_record_a_set_custom_deprecated_request: Option<models::DnsRecordASetCustomDeprecatedRequest>) -> Result<(), Error<DnsRecordASetCustomDeprecatedError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/dns/zones/{zoneId}/recordset/acombined/custom", local_var_configuration.base_path, zoneId=crate::apis::urlencode(zone_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&dns_record_a_set_custom_deprecated_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<DnsRecordASetCustomDeprecatedError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn dns_record_a_set_managed_by_ingress_deprecated(configuration: &configuration::Configuration, zone_id: &str, body: Option<serde_json::Value>) -> Result<models::DnsRecordASetManagedByIngressDeprecated204Response, Error<DnsRecordASetManagedByIngressDeprecatedError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/dns/zones/{zoneId}/recordset/acombined/managed/ingress", local_var_configuration.base_path, zoneId=crate::apis::urlencode(zone_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&body);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<DnsRecordASetManagedByIngressDeprecatedError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn dns_record_cname_set_deprecated(configuration: &configuration::Configuration, zone_id: &str, dns_record_cname_set_deprecated_request: Option<models::DnsRecordCnameSetDeprecatedRequest>) -> Result<(), Error<DnsRecordCnameSetDeprecatedError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/dns/zones/{zoneId}/recordset/cname", local_var_configuration.base_path, zoneId=crate::apis::urlencode(zone_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&dns_record_cname_set_deprecated_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<DnsRecordCnameSetDeprecatedError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn dns_record_mx_set_custom_deprecated(configuration: &configuration::Configuration, zone_id: &str, dns_record_mx_set_custom_deprecated_request: Option<models::DnsRecordMxSetCustomDeprecatedRequest>) -> Result<(), Error<DnsRecordMxSetCustomDeprecatedError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/dns/zones/{zoneId}/recordset/mx/custom", local_var_configuration.base_path, zoneId=crate::apis::urlencode(zone_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&dns_record_mx_set_custom_deprecated_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<DnsRecordMxSetCustomDeprecatedError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn dns_record_mx_set_managed_deprecated(configuration: &configuration::Configuration, zone_id: &str, body: Option<serde_json::Value>) -> Result<(), Error<DnsRecordMxSetManagedDeprecatedError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/dns/zones/{zoneId}/recordset/mx/managed", local_var_configuration.base_path, zoneId=crate::apis::urlencode(zone_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&body);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<DnsRecordMxSetManagedDeprecatedError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn dns_record_srv_set_deprecated(configuration: &configuration::Configuration, zone_id: &str, dns_record_srv_set_deprecated_request: Option<models::DnsRecordSrvSetDeprecatedRequest>) -> Result<(), Error<DnsRecordSrvSetDeprecatedError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/dns/zones/{zoneId}/recordset/srv", local_var_configuration.base_path, zoneId=crate::apis::urlencode(zone_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&dns_record_srv_set_deprecated_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<DnsRecordSrvSetDeprecatedError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn dns_record_txt_set_deprecated(configuration: &configuration::Configuration, zone_id: &str, dns_record_txt_set_deprecated_request: Option<models::DnsRecordTxtSetDeprecatedRequest>) -> Result<(), Error<DnsRecordTxtSetDeprecatedError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/dns/zones/{zoneId}/recordset/txt", local_var_configuration.base_path, zoneId=crate::apis::urlencode(zone_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&dns_record_txt_set_deprecated_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<DnsRecordTxtSetDeprecatedError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn dns_set_record_set_managed(configuration: &configuration::Configuration, dns_zone_id: &str, record_set: &str, body: Option<serde_json::Value>) -> Result<models::DnsSetRecordSetManaged204Response, Error<DnsSetRecordSetManagedError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/dns-zones/{dnsZoneId}/record-sets/{recordSet}/actions/set-managed", local_var_configuration.base_path, dnsZoneId=crate::apis::urlencode(dns_zone_id), recordSet=crate::apis::urlencode(record_set));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&body);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<DnsSetRecordSetManagedError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn dns_update_record_set(configuration: &configuration::Configuration, dns_zone_id: &str, record_set: &str, dns_update_record_set_request: Option<models::DnsUpdateRecordSetRequest>) -> Result<(), Error<DnsUpdateRecordSetError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/dns-zones/{dnsZoneId}/record-sets/{recordSet}", local_var_configuration.base_path, dnsZoneId=crate::apis::urlencode(dns_zone_id), recordSet=crate::apis::urlencode(record_set));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&dns_update_record_set_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<DnsUpdateRecordSetError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Abort an incomplete Domain registration/transfer.
pub async fn domain_abort_domain_declaration(configuration: &configuration::Configuration, domain_id: &str) -> Result<(), Error<DomainAbortDomainDeclarationError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/domains/{domainId}/declaration", local_var_configuration.base_path, domainId=crate::apis::urlencode(domain_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<DomainAbortDomainDeclarationError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Change the domain owner of a fully registered domain.
pub async fn domain_change_ownerc_of_domain_v2_deprecated(configuration: &configuration::Configuration, domain_id: &str, domain_change_ownerc_of_domain_v2_deprecated_request: Option<models::DomainChangeOwnercOfDomainV2DeprecatedRequest>) -> Result<models::DomainChangeOwnercOfDomainV2Deprecated200Response, Error<DomainChangeOwnercOfDomainV2DeprecatedError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/domains/{domainId}/handles/ownerc", local_var_configuration.base_path, domainId=crate::apis::urlencode(domain_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&domain_change_ownerc_of_domain_v2_deprecated_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<DomainChangeOwnercOfDomainV2DeprecatedError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn domain_change_project_of_domain_v2_deprecated(configuration: &configuration::Configuration, domain_id: &str, domain_change_project_of_domain_v2_deprecated_request: Option<models::DomainChangeProjectOfDomainV2DeprecatedRequest>) -> Result<(), Error<DomainChangeProjectOfDomainV2DeprecatedError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/domains/{domainId}/projectId", local_var_configuration.base_path, domainId=crate::apis::urlencode(domain_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&domain_change_project_of_domain_v2_deprecated_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<DomainChangeProjectOfDomainV2DeprecatedError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// If false, you have to start a transfer with an auth code instead.
pub async fn domain_check_domain_registrability(configuration: &configuration::Configuration, domain_check_domain_registrability_request: Option<models::DomainCheckDomainRegistrabilityRequest>) -> Result<models::DomainCheckDomainRegistrability200Response, Error<DomainCheckDomainRegistrabilityError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/domain-registrable", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&domain_check_domain_registrability_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<DomainCheckDomainRegistrabilityError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// If false, you have to start a transfer with an auth code instead.
pub async fn domain_check_domain_registrability_v2_deprecated(configuration: &configuration::Configuration, domain_check_domain_registrability_request: Option<models::DomainCheckDomainRegistrabilityRequest>) -> Result<models::DomainCheckDomainRegistrabilityV2Deprecated200Response, Error<DomainCheckDomainRegistrabilityV2DeprecatedError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/domains", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&domain_check_domain_registrability_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<DomainCheckDomainRegistrabilityV2DeprecatedError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn domain_check_domain_transferability(configuration: &configuration::Configuration, domain_check_domain_transferability_request: Option<models::DomainCheckDomainTransferabilityRequest>) -> Result<models::DomainCheckDomainTransferability200Response, Error<DomainCheckDomainTransferabilityError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/domain-transferable", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
local_var_req_builder = local_var_req_builder.json(&domain_check_domain_transferability_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<DomainCheckDomainTransferabilityError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn domain_create_domain_auth_code(configuration: &configuration::Configuration, domain_id: &str) -> Result<models::DomainCreateDomainAuthCode201Response, Error<DomainCreateDomainAuthCodeError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/domains/{domainId}/actions/auth-code", local_var_configuration.base_path, domainId=crate::apis::urlencode(domain_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<DomainCreateDomainAuthCodeError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn domain_declare_nameservers_v2_deprecated(configuration: &configuration::Configuration, domain_id: &str, domain_declare_nameservers_v2_deprecated_request: Option<models::DomainDeclareNameserversV2DeprecatedRequest>) -> Result<(), Error<DomainDeclareNameserversV2DeprecatedError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/domains/{domainId}/nameservers", local_var_configuration.base_path, domainId=crate::apis::urlencode(domain_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&domain_declare_nameservers_v2_deprecated_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<DomainDeclareNameserversV2DeprecatedError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Change a wrong AuthCode of your transfer domain request (declare domain process). This route will also restart the transfer itself.
pub async fn domain_declare_process_change_authcode_v2_deprecated(configuration: &configuration::Configuration, domain_id: &str, domain_declare_process_change_authcode_v2_deprecated_request: Option<models::DomainDeclareProcessChangeAuthcodeV2DeprecatedRequest>) -> Result<models::DomainChangeOwnercOfDomainV2Deprecated200Response, Error<DomainDeclareProcessChangeAuthcodeV2DeprecatedError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/domains/{domainId}/declarations/authcode", local_var_configuration.base_path, domainId=crate::apis::urlencode(domain_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&domain_declare_process_change_authcode_v2_deprecated_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<DomainDeclareProcessChangeAuthcodeV2DeprecatedError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// This route will also restart the transfer or register itself.
pub async fn domain_declare_process_change_handles_v2_deprecated(configuration: &configuration::Configuration, domain_id: &str, domain_change_ownerc_of_domain_v2_deprecated_request: Option<models::DomainChangeOwnercOfDomainV2DeprecatedRequest>) -> Result<models::DomainChangeOwnercOfDomainV2Deprecated200Response, Error<DomainDeclareProcessChangeHandlesV2DeprecatedError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/domains/{domainId}/declarations/handles", local_var_configuration.base_path, domainId=crate::apis::urlencode(domain_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&domain_change_ownerc_of_domain_v2_deprecated_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<DomainDeclareProcessChangeHandlesV2DeprecatedError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn domain_delete_domain(configuration: &configuration::Configuration, domain_id: &str, transit: Option<bool>) -> Result<models::DomainChangeOwnercOfDomainV2Deprecated200Response, Error<DomainDeleteDomainError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/domains/{domainId}", local_var_configuration.base_path, domainId=crate::apis::urlencode(domain_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_str) = transit {
local_var_req_builder = local_var_req_builder.query(&[("transit", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<DomainDeleteDomainError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn domain_get_domain(configuration: &configuration::Configuration, domain_id: &str) -> Result<models::DePeriodMittwaldPeriodV1PeriodDomainPeriodDomain, Error<DomainGetDomainError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/domains/{domainId}", local_var_configuration.base_path, domainId=crate::apis::urlencode(domain_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<DomainGetDomainError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Get required handle fields of a registrar for your domain process (transfer/registration).
pub async fn domain_get_handle_fields_v2_deprecated(configuration: &configuration::Configuration, domain_name: &str) -> Result<models::DomainGetHandleFieldsV2Deprecated200Response, Error<DomainGetHandleFieldsV2DeprecatedError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/domains/handle-schema/{domainName}", local_var_configuration.base_path, domainName=crate::apis::urlencode(domain_name));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<DomainGetHandleFieldsV2DeprecatedError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn domain_get_latest_screenshot(configuration: &configuration::Configuration, domain_id: &str, deprecated_domain_get_screenshot_for_domain_request: models::DeprecatedDomainGetScreenshotForDomainRequest) -> Result<models::DomainGetLatestScreenshot200Response, Error<DomainGetLatestScreenshotError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/domains/{domainId}/latest-screenshot", local_var_configuration.base_path, domainId=crate::apis::urlencode(domain_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&deprecated_domain_get_screenshot_for_domain_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<DomainGetLatestScreenshotError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn domain_list_domains(configuration: &configuration::Configuration, project_id: Option<&str>, page: Option<i32>, limit: Option<i32>, domain_search_name: Option<&str>) -> Result<Vec<models::DePeriodMittwaldPeriodV1PeriodDomainPeriodDomain>, Error<DomainListDomainsError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/domains", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = project_id {
local_var_req_builder = local_var_req_builder.query(&[("projectId", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = page {
local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = limit {
local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = domain_search_name {
local_var_req_builder = local_var_req_builder.query(&[("domainSearchName", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<DomainListDomainsError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn domain_list_domains_v2_deprecated(configuration: &configuration::Configuration, project_id: &str, page: Option<i32>, limit: Option<i32>, domain_search_name: Option<&str>) -> Result<Vec<models::DePeriodMittwaldPeriodV1PeriodDomainPeriodDomain>, Error<DomainListDomainsV2DeprecatedError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/projects/{projectId}/domains", local_var_configuration.base_path, projectId=crate::apis::urlencode(project_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = page {
local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = limit {
local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = domain_search_name {
local_var_req_builder = local_var_req_builder.query(&[("domainSearchName", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<DomainListDomainsV2DeprecatedError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// List the contact schemas describing the fields required to register/transfer a Domain.
pub async fn domain_list_tld_contact_schemas(configuration: &configuration::Configuration, tld: &str) -> Result<models::DomainGetHandleFieldsV2Deprecated200Response, Error<DomainListTldContactSchemasError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/domain-tlds/{tld}/contact-schemas", local_var_configuration.base_path, tld=crate::apis::urlencode(tld));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<DomainListTldContactSchemasError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// List the top level domains currently supported by our API.
pub async fn domain_list_tlds(configuration: &configuration::Configuration, ) -> Result<Vec<models::DePeriodMittwaldPeriodV1PeriodDomainPeriodTopLevel>, Error<DomainListTldsError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/domain-tlds", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<DomainListTldsError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Trigger a resend of a confirmation or registrant verification email. Has no effect on .de Domains.
pub async fn domain_resend_domain_email(configuration: &configuration::Configuration, domain_id: &str) -> Result<(), Error<DomainResendDomainEmailError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/domains/{domainId}/actions/resend-email", local_var_configuration.base_path, domainId=crate::apis::urlencode(domain_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<DomainResendDomainEmailError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn domain_suggest(configuration: &configuration::Configuration, prompt: &str, domain_count: Option<i32>, tlds: Option<Vec<String>>) -> Result<models::DePeriodMittwaldPeriodV1PeriodDomainPeriodSuggestedDomains, Error<DomainSuggestError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/domain-suggestions", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
local_var_req_builder = local_var_req_builder.query(&[("prompt", &prompt.to_string())]);
if let Some(ref local_var_str) = domain_count {
local_var_req_builder = local_var_req_builder.query(&[("domainCount", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = tlds {
local_var_req_builder = match "multi" {
"multi" => local_var_req_builder.query(&local_var_str.into_iter().map(|p| ("tlds".to_owned(), p.to_string())).collect::<Vec<(std::string::String, std::string::String)>>()),
_ => local_var_req_builder.query(&[("tlds", &local_var_str.into_iter().map(|p| p.to_string()).collect::<Vec<String>>().join(",").to_string())]),
};
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<DomainSuggestError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Update an incorrect auth code of an ongoing/failed Domain transfer. This route will also restart the transfer itself.
pub async fn domain_update_domain_auth_code(configuration: &configuration::Configuration, domain_id: &str, domain_declare_process_change_authcode_v2_deprecated_request: Option<models::DomainDeclareProcessChangeAuthcodeV2DeprecatedRequest>) -> Result<models::DomainChangeOwnercOfDomainV2Deprecated200Response, Error<DomainUpdateDomainAuthCodeError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/domains/{domainId}/auth-code", local_var_configuration.base_path, domainId=crate::apis::urlencode(domain_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&domain_declare_process_change_authcode_v2_deprecated_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<DomainUpdateDomainAuthCodeError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn domain_update_domain_contact(configuration: &configuration::Configuration, domain_id: &str, contact: &str, domain_update_domain_contact_request: Option<models::DomainUpdateDomainContactRequest>) -> Result<models::DomainChangeOwnercOfDomainV2Deprecated200Response, Error<DomainUpdateDomainContactError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/domains/{domainId}/contacts/{contact}", local_var_configuration.base_path, domainId=crate::apis::urlencode(domain_id), contact=crate::apis::urlencode(contact));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&domain_update_domain_contact_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<DomainUpdateDomainContactError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn domain_update_domain_nameservers(configuration: &configuration::Configuration, domain_id: &str, domain_declare_nameservers_v2_deprecated_request: Option<models::DomainDeclareNameserversV2DeprecatedRequest>) -> Result<(), Error<DomainUpdateDomainNameserversError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/domains/{domainId}/nameservers", local_var_configuration.base_path, domainId=crate::apis::urlencode(domain_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&domain_declare_nameservers_v2_deprecated_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<DomainUpdateDomainNameserversError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn domain_update_domain_project_id(configuration: &configuration::Configuration, domain_id: &str, domain_change_project_of_domain_v2_deprecated_request: Option<models::DomainChangeProjectOfDomainV2DeprecatedRequest>) -> Result<(), Error<DomainUpdateDomainProjectIdError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/domains/{domainId}/project-id", local_var_configuration.base_path, domainId=crate::apis::urlencode(domain_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&domain_change_project_of_domain_v2_deprecated_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<DomainUpdateDomainProjectIdError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn ingress_create_ingress(configuration: &configuration::Configuration, ingress_create_ingress_request: Option<models::IngressCreateIngressRequest>) -> Result<models::IngressCreateIngress201Response, Error<IngressCreateIngressError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/ingresses", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&ingress_create_ingress_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<IngressCreateIngressError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn ingress_delete_ingress(configuration: &configuration::Configuration, ingress_id: &str) -> Result<(), Error<IngressDeleteIngressError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/ingresses/{ingressId}", local_var_configuration.base_path, ingressId=crate::apis::urlencode(ingress_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<IngressDeleteIngressError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn ingress_get_ingress(configuration: &configuration::Configuration, ingress_id: &str) -> Result<models::DePeriodMittwaldPeriodV1PeriodIngressPeriodIngress, Error<IngressGetIngressError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/ingresses/{ingressId}", local_var_configuration.base_path, ingressId=crate::apis::urlencode(ingress_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<IngressGetIngressError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn ingress_ingress_verify_ownership(configuration: &configuration::Configuration, ingress_id: &str) -> Result<serde_json::Value, Error<IngressIngressVerifyOwnershipError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/ingresses/{ingressId}/actions/verify-ownership", local_var_configuration.base_path, ingressId=crate::apis::urlencode(ingress_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<IngressIngressVerifyOwnershipError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn ingress_list_ingresses(configuration: &configuration::Configuration, project_id: Option<&str>, certificate_id: Option<&str>, limit: Option<i32>, skip: Option<i32>, page: Option<i32>) -> Result<Vec<models::DePeriodMittwaldPeriodV1PeriodIngressPeriodIngress>, Error<IngressListIngressesError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/ingresses", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = project_id {
local_var_req_builder = local_var_req_builder.query(&[("projectId", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = certificate_id {
local_var_req_builder = local_var_req_builder.query(&[("certificateId", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = limit {
local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = skip {
local_var_req_builder = local_var_req_builder.query(&[("skip", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = page {
local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<IngressListIngressesError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// List Ingresses in a Project compatible with a certificate.
pub async fn ingress_list_ingresses_compatible_with_certificate(configuration: &configuration::Configuration, ingress_list_ingresses_compatible_with_certificate_request: Option<models::IngressListIngressesCompatibleWithCertificateRequest>) -> Result<Vec<models::DePeriodMittwaldPeriodV1PeriodIngressPeriodIngress>, Error<IngressListIngressesCompatibleWithCertificateError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/actions/list-ingresses-compatible-with-certificate", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&ingress_list_ingresses_compatible_with_certificate_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<IngressListIngressesCompatibleWithCertificateError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn ingress_list_ingresses_v2_deprecated(configuration: &configuration::Configuration, project_id: &str) -> Result<Vec<models::DePeriodMittwaldPeriodV1PeriodIngressPeriodIngressDeprecated>, Error<IngressListIngressesV2DeprecatedError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/projects/{projectId}/ingresses", local_var_configuration.base_path, projectId=crate::apis::urlencode(project_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<IngressListIngressesV2DeprecatedError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn ingress_paths_deprecated(configuration: &configuration::Configuration, ingress_id: &str, de_period_mittwald_period_v1_period_ingress_period_path: Option<Vec<models::DePeriodMittwaldPeriodV1PeriodIngressPeriodPath>>) -> Result<(), Error<IngressPathsDeprecatedError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/ingresses/{ingressId}/paths", local_var_configuration.base_path, ingressId=crate::apis::urlencode(ingress_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&de_period_mittwald_period_v1_period_ingress_period_path);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<IngressPathsDeprecatedError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn ingress_request_ingress_acme_certificate_issuance(configuration: &configuration::Configuration, ingress_id: &str) -> Result<(), Error<IngressRequestIngressAcmeCertificateIssuanceError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/ingresses/{ingressId}/actions/request-acme-certificate-issuance", local_var_configuration.base_path, ingressId=crate::apis::urlencode(ingress_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<IngressRequestIngressAcmeCertificateIssuanceError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn ingress_tls_deprecated(configuration: &configuration::Configuration, ingress_id: &str, ingress_tls_deprecated_request: Option<models::IngressTlsDeprecatedRequest>) -> Result<serde_json::Value, Error<IngressTlsDeprecatedError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/ingresses/{ingressId}/tls", local_var_configuration.base_path, ingressId=crate::apis::urlencode(ingress_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&ingress_tls_deprecated_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<IngressTlsDeprecatedError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn ingress_update_ingress_paths(configuration: &configuration::Configuration, ingress_id: &str, de_period_mittwald_period_v1_period_ingress_period_path: Option<Vec<models::DePeriodMittwaldPeriodV1PeriodIngressPeriodPath>>) -> Result<(), Error<IngressUpdateIngressPathsError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/ingresses/{ingressId}/paths", local_var_configuration.base_path, ingressId=crate::apis::urlencode(ingress_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&de_period_mittwald_period_v1_period_ingress_period_path);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<IngressUpdateIngressPathsError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn ingress_update_ingress_tls(configuration: &configuration::Configuration, ingress_id: &str, ingress_update_ingress_tls_request: Option<models::IngressUpdateIngressTlsRequest>) -> Result<serde_json::Value, Error<IngressUpdateIngressTlsError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/ingresses/{ingressId}/tls", local_var_configuration.base_path, ingressId=crate::apis::urlencode(ingress_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&ingress_update_ingress_tls_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<IngressUpdateIngressTlsError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Checks the replacement of a Certificate and shows differences between the current and the new Certificate.
pub async fn ssl_check_replace_certificate(configuration: &configuration::Configuration, certificate_id: &str, ssl_check_replace_certificate_request: Option<models::SslCheckReplaceCertificateRequest>) -> Result<models::DePeriodMittwaldPeriodV1PeriodSslPeriodCheckReplaceCertificateResponse, Error<SslCheckReplaceCertificateError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/certificates/{certificateId}/actions/check-replace-certificate", local_var_configuration.base_path, certificateId=crate::apis::urlencode(certificate_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&ssl_check_replace_certificate_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<SslCheckReplaceCertificateError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn ssl_create_certificate_request(configuration: &configuration::Configuration, ssl_create_certificate_request_request: Option<models::SslCreateCertificateRequestRequest>) -> Result<models::DePeriodMittwaldPeriodV1PeriodSslPeriodCertificateRequestCreateResponse, Error<SslCreateCertificateRequestError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/certificate-requests", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&ssl_create_certificate_request_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<SslCreateCertificateRequestError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn ssl_delete_certificate(configuration: &configuration::Configuration, certificate_id: &str) -> Result<(), Error<SslDeleteCertificateError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/certificate/{certificateId}", local_var_configuration.base_path, certificateId=crate::apis::urlencode(certificate_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<SslDeleteCertificateError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn ssl_delete_certificate_request(configuration: &configuration::Configuration, certificate_request_id: &str) -> Result<(), Error<SslDeleteCertificateRequestError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/certificate-request/{certificateRequestId}", local_var_configuration.base_path, certificateRequestId=crate::apis::urlencode(certificate_request_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<SslDeleteCertificateRequestError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn ssl_get_certificate(configuration: &configuration::Configuration, certificate_id: &str) -> Result<models::DePeriodMittwaldPeriodV1PeriodSslPeriodCertificate, Error<SslGetCertificateError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/certificates/{certificateId}", local_var_configuration.base_path, certificateId=crate::apis::urlencode(certificate_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<SslGetCertificateError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn ssl_get_certificate_request(configuration: &configuration::Configuration, certificate_request_id: &str) -> Result<models::DePeriodMittwaldPeriodV1PeriodSslPeriodCertificateRequest, Error<SslGetCertificateRequestError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/certificate-requests/{certificateRequestId}", local_var_configuration.base_path, certificateRequestId=crate::apis::urlencode(certificate_request_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<SslGetCertificateRequestError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn ssl_list_certificate_requests(configuration: &configuration::Configuration, project_id: Option<&str>, ingress_id: Option<&str>) -> Result<Vec<models::DePeriodMittwaldPeriodV1PeriodSslPeriodCertificateRequest>, Error<SslListCertificateRequestsError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/certificate-requests", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = project_id {
local_var_req_builder = local_var_req_builder.query(&[("projectId", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = ingress_id {
local_var_req_builder = local_var_req_builder.query(&[("ingressId", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<SslListCertificateRequestsError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn ssl_list_certificates(configuration: &configuration::Configuration, project_id: Option<&str>, ingress_id: Option<&str>) -> Result<Vec<models::DePeriodMittwaldPeriodV1PeriodSslPeriodCertificate>, Error<SslListCertificatesError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/certificates", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_str) = project_id {
local_var_req_builder = local_var_req_builder.query(&[("projectId", &local_var_str.to_string())]);
}
if let Some(ref local_var_str) = ingress_id {
local_var_req_builder = local_var_req_builder.query(&[("ingressId", &local_var_str.to_string())]);
}
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
serde_json::from_str(&local_var_content).map_err(Error::from)
} else {
let local_var_entity: Option<SslListCertificatesError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn ssl_replace_certificate(configuration: &configuration::Configuration, certificate_id: &str, ssl_check_replace_certificate_request: Option<models::SslCheckReplaceCertificateRequest>) -> Result<(), Error<SslReplaceCertificateError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/certificates/{certificateId}", local_var_configuration.base_path, certificateId=crate::apis::urlencode(certificate_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&ssl_check_replace_certificate_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<SslReplaceCertificateError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn v2_dns_zones_dns_zone_id_delete(configuration: &configuration::Configuration, dns_zone_id: &str) -> Result<(), Error<V2DnsZonesDnsZoneIdDeleteError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/dns/zones/{dnsZoneId}", local_var_configuration.base_path, dnsZoneId=crate::apis::urlencode(dns_zone_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<V2DnsZonesDnsZoneIdDeleteError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn v2_dns_zones_dns_zone_id_get(configuration: &configuration::Configuration, dns_zone_id: &str) -> Result<(), Error<V2DnsZonesDnsZoneIdGetError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/dns/zones/{dnsZoneId}", local_var_configuration.base_path, dnsZoneId=crate::apis::urlencode(dns_zone_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<V2DnsZonesDnsZoneIdGetError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn v2_dns_zones_post(configuration: &configuration::Configuration, v2_dns_zones_post_request: Option<models::V2DnsZonesPostRequest>) -> Result<(), Error<V2DnsZonesPostError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/dns/zones", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&v2_dns_zones_post_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<V2DnsZonesPostError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn v2_domains_domain_id_actions_create_authcode_post(configuration: &configuration::Configuration, domain_id: &str) -> Result<(), Error<V2DomainsDomainIdActionsCreateAuthcodePostError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/domains/{domainId}/actions/create-authcode", local_var_configuration.base_path, domainId=crate::apis::urlencode(domain_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<V2DomainsDomainIdActionsCreateAuthcodePostError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Update an incorrect auth code of an ongoing/failed Domain transfer. This route will also restart the transfer itself.
pub async fn v2_domains_domain_id_authcode_patch(configuration: &configuration::Configuration, domain_id: &str, domain_declare_process_change_authcode_v2_deprecated_request: Option<models::DomainDeclareProcessChangeAuthcodeV2DeprecatedRequest>) -> Result<(), Error<V2DomainsDomainIdAuthcodePatchError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/domains/{domainId}/authcode", local_var_configuration.base_path, domainId=crate::apis::urlencode(domain_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::PATCH, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
local_var_req_builder = local_var_req_builder.json(&domain_declare_process_change_authcode_v2_deprecated_request);
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<V2DomainsDomainIdAuthcodePatchError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// Abort an incomplete Domain registration/transfer.
pub async fn v2_domains_domain_id_declarations_delete(configuration: &configuration::Configuration, domain_id: &str) -> Result<(), Error<V2DomainsDomainIdDeclarationsDeleteError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/domains/{domainId}/declarations", local_var_configuration.base_path, domainId=crate::apis::urlencode(domain_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<V2DomainsDomainIdDeclarationsDeleteError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
/// List the top level domains currently supported by our API.
pub async fn v2_domains_supported_tlds_get(configuration: &configuration::Configuration, ) -> Result<(), Error<V2DomainsSupportedTldsGetError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/domains/supported-tlds", local_var_configuration.base_path);
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<V2DomainsSupportedTldsGetError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}
pub async fn v2_projects_project_id_dns_zones_get(configuration: &configuration::Configuration, project_id: &str) -> Result<(), Error<V2ProjectsProjectIdDnsZonesGetError>> {
let local_var_configuration = configuration;
let local_var_client = &local_var_configuration.client;
let local_var_uri_str = format!("{}/v2/projects/{projectId}/dns/zones", local_var_configuration.base_path, projectId=crate::apis::urlencode(project_id));
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
}
if let Some(ref local_var_apikey) = local_var_configuration.api_key {
let local_var_key = local_var_apikey.key.clone();
let local_var_value = match local_var_apikey.prefix {
Some(ref local_var_prefix) => format!("{} {}", local_var_prefix, local_var_key),
None => local_var_key,
};
local_var_req_builder = local_var_req_builder.header("x-access-token", local_var_value);
};
let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;
let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<V2ProjectsProjectIdDnsZonesGetError> = serde_json::from_str(&local_var_content).ok();
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
Err(Error::ResponseError(local_var_error))
}
}