#![doc = "generated by AutoRust 0.1.0"]
#![allow(unused_mut)]
#![allow(unused_variables)]
#![allow(unused_imports)]
use super::{models, API_VERSION};
#[derive(Clone)]
pub struct Client {
    endpoint: String,
    credential: std::sync::Arc<dyn azure_core::auth::TokenCredential>,
    scopes: Vec<String>,
    pipeline: azure_core::Pipeline,
}
#[derive(Clone)]
pub struct ClientBuilder {
    credential: std::sync::Arc<dyn azure_core::auth::TokenCredential>,
    endpoint: Option<String>,
    scopes: Option<Vec<String>>,
}
pub const DEFAULT_ENDPOINT: &str = azure_core::resource_manager_endpoint::AZURE_PUBLIC_CLOUD;
impl ClientBuilder {
    pub fn new(credential: std::sync::Arc<dyn azure_core::auth::TokenCredential>) -> Self {
        Self {
            credential,
            endpoint: None,
            scopes: None,
        }
    }
    pub fn endpoint(mut self, endpoint: impl Into<String>) -> Self {
        self.endpoint = Some(endpoint.into());
        self
    }
    pub fn scopes(mut self, scopes: &[&str]) -> Self {
        self.scopes = Some(scopes.iter().map(|scope| (*scope).to_owned()).collect());
        self
    }
    pub fn build(self) -> Client {
        let endpoint = self.endpoint.unwrap_or_else(|| DEFAULT_ENDPOINT.to_owned());
        let scopes = self.scopes.unwrap_or_else(|| vec![format!("{}/", endpoint)]);
        Client::new(endpoint, self.credential, scopes)
    }
}
impl Client {
    pub(crate) fn endpoint(&self) -> &str {
        self.endpoint.as_str()
    }
    pub(crate) fn token_credential(&self) -> &dyn azure_core::auth::TokenCredential {
        self.credential.as_ref()
    }
    pub(crate) fn scopes(&self) -> Vec<&str> {
        self.scopes.iter().map(String::as_str).collect()
    }
    pub(crate) async fn send(&self, request: impl Into<azure_core::Request>) -> Result<azure_core::Response, azure_core::Error> {
        let mut context = azure_core::Context::default();
        let mut request = request.into();
        self.pipeline.send(&mut context, &mut request).await
    }
    pub fn new(
        endpoint: impl Into<String>,
        credential: std::sync::Arc<dyn azure_core::auth::TokenCredential>,
        scopes: Vec<String>,
    ) -> Self {
        let endpoint = endpoint.into();
        let pipeline = azure_core::Pipeline::new(
            option_env!("CARGO_PKG_NAME"),
            option_env!("CARGO_PKG_VERSION"),
            azure_core::ClientOptions::default(),
            Vec::new(),
            Vec::new(),
        );
        Self {
            endpoint,
            credential,
            scopes,
            pipeline,
        }
    }
    pub fn hsm_security_domain(&self) -> hsm_security_domain::Client {
        hsm_security_domain::Client(self.clone())
    }
    pub fn role_assignments(&self) -> role_assignments::Client {
        role_assignments::Client(self.clone())
    }
    pub fn role_definitions(&self) -> role_definitions::Client {
        role_definitions::Client(self.clone())
    }
}
#[non_exhaustive]
#[derive(Debug, thiserror :: Error)]
#[allow(non_camel_case_types)]
pub enum Error {
    #[error(transparent)]
    GetCertificates(#[from] get_certificates::Error),
    #[error(transparent)]
    DeleteCertificate(#[from] delete_certificate::Error),
    #[error(transparent)]
    GetCertificateContacts(#[from] get_certificate_contacts::Error),
    #[error(transparent)]
    SetCertificateContacts(#[from] set_certificate_contacts::Error),
    #[error(transparent)]
    DeleteCertificateContacts(#[from] delete_certificate_contacts::Error),
    #[error(transparent)]
    GetCertificateIssuers(#[from] get_certificate_issuers::Error),
    #[error(transparent)]
    GetCertificateIssuer(#[from] get_certificate_issuer::Error),
    #[error(transparent)]
    SetCertificateIssuer(#[from] set_certificate_issuer::Error),
    #[error(transparent)]
    UpdateCertificateIssuer(#[from] update_certificate_issuer::Error),
    #[error(transparent)]
    DeleteCertificateIssuer(#[from] delete_certificate_issuer::Error),
    #[error(transparent)]
    CreateCertificate(#[from] create_certificate::Error),
    #[error(transparent)]
    ImportCertificate(#[from] import_certificate::Error),
    #[error(transparent)]
    GetCertificateVersions(#[from] get_certificate_versions::Error),
    #[error(transparent)]
    GetCertificatePolicy(#[from] get_certificate_policy::Error),
    #[error(transparent)]
    UpdateCertificatePolicy(#[from] update_certificate_policy::Error),
    #[error(transparent)]
    GetCertificate(#[from] get_certificate::Error),
    #[error(transparent)]
    UpdateCertificate(#[from] update_certificate::Error),
    #[error(transparent)]
    GetCertificateOperation(#[from] get_certificate_operation::Error),
    #[error(transparent)]
    UpdateCertificateOperation(#[from] update_certificate_operation::Error),
    #[error(transparent)]
    DeleteCertificateOperation(#[from] delete_certificate_operation::Error),
    #[error(transparent)]
    MergeCertificate(#[from] merge_certificate::Error),
    #[error(transparent)]
    BackupCertificate(#[from] backup_certificate::Error),
    #[error(transparent)]
    RestoreCertificate(#[from] restore_certificate::Error),
    #[error(transparent)]
    GetDeletedCertificates(#[from] get_deleted_certificates::Error),
    #[error(transparent)]
    GetDeletedCertificate(#[from] get_deleted_certificate::Error),
    #[error(transparent)]
    PurgeDeletedCertificate(#[from] purge_deleted_certificate::Error),
    #[error(transparent)]
    RecoverDeletedCertificate(#[from] recover_deleted_certificate::Error),
    #[error(transparent)]
    CreateKey(#[from] create_key::Error),
    #[error(transparent)]
    ImportKey(#[from] import_key::Error),
    #[error(transparent)]
    DeleteKey(#[from] delete_key::Error),
    #[error(transparent)]
    GetKey(#[from] get_key::Error),
    #[error(transparent)]
    UpdateKey(#[from] update_key::Error),
    #[error(transparent)]
    GetKeyVersions(#[from] get_key_versions::Error),
    #[error(transparent)]
    GetKeys(#[from] get_keys::Error),
    #[error(transparent)]
    BackupKey(#[from] backup_key::Error),
    #[error(transparent)]
    RestoreKey(#[from] restore_key::Error),
    #[error(transparent)]
    Encrypt(#[from] encrypt::Error),
    #[error(transparent)]
    Decrypt(#[from] decrypt::Error),
    #[error(transparent)]
    Sign(#[from] sign::Error),
    #[error(transparent)]
    Verify(#[from] verify::Error),
    #[error(transparent)]
    WrapKey(#[from] wrap_key::Error),
    #[error(transparent)]
    UnwrapKey(#[from] unwrap_key::Error),
    #[error(transparent)]
    GetDeletedKeys(#[from] get_deleted_keys::Error),
    #[error(transparent)]
    GetDeletedKey(#[from] get_deleted_key::Error),
    #[error(transparent)]
    PurgeDeletedKey(#[from] purge_deleted_key::Error),
    #[error(transparent)]
    RecoverDeletedKey(#[from] recover_deleted_key::Error),
    #[error(transparent)]
    SetSecret(#[from] set_secret::Error),
    #[error(transparent)]
    DeleteSecret(#[from] delete_secret::Error),
    #[error(transparent)]
    GetSecret(#[from] get_secret::Error),
    #[error(transparent)]
    UpdateSecret(#[from] update_secret::Error),
    #[error(transparent)]
    GetSecrets(#[from] get_secrets::Error),
    #[error(transparent)]
    GetSecretVersions(#[from] get_secret_versions::Error),
    #[error(transparent)]
    GetDeletedSecrets(#[from] get_deleted_secrets::Error),
    #[error(transparent)]
    GetDeletedSecret(#[from] get_deleted_secret::Error),
    #[error(transparent)]
    PurgeDeletedSecret(#[from] purge_deleted_secret::Error),
    #[error(transparent)]
    RecoverDeletedSecret(#[from] recover_deleted_secret::Error),
    #[error(transparent)]
    BackupSecret(#[from] backup_secret::Error),
    #[error(transparent)]
    RestoreSecret(#[from] restore_secret::Error),
    #[error(transparent)]
    RoleDefinitions_Get(#[from] role_definitions::get::Error),
    #[error(transparent)]
    RoleDefinitions_CreateOrUpdate(#[from] role_definitions::create_or_update::Error),
    #[error(transparent)]
    RoleDefinitions_Delete(#[from] role_definitions::delete::Error),
    #[error(transparent)]
    RoleDefinitions_List(#[from] role_definitions::list::Error),
    #[error(transparent)]
    RoleAssignments_Get(#[from] role_assignments::get::Error),
    #[error(transparent)]
    RoleAssignments_Create(#[from] role_assignments::create::Error),
    #[error(transparent)]
    RoleAssignments_Delete(#[from] role_assignments::delete::Error),
    #[error(transparent)]
    RoleAssignments_ListForScope(#[from] role_assignments::list_for_scope::Error),
    #[error(transparent)]
    GetStorageAccounts(#[from] get_storage_accounts::Error),
    #[error(transparent)]
    GetDeletedStorageAccounts(#[from] get_deleted_storage_accounts::Error),
    #[error(transparent)]
    GetDeletedStorageAccount(#[from] get_deleted_storage_account::Error),
    #[error(transparent)]
    PurgeDeletedStorageAccount(#[from] purge_deleted_storage_account::Error),
    #[error(transparent)]
    RecoverDeletedStorageAccount(#[from] recover_deleted_storage_account::Error),
    #[error(transparent)]
    BackupStorageAccount(#[from] backup_storage_account::Error),
    #[error(transparent)]
    RestoreStorageAccount(#[from] restore_storage_account::Error),
    #[error(transparent)]
    GetStorageAccount(#[from] get_storage_account::Error),
    #[error(transparent)]
    SetStorageAccount(#[from] set_storage_account::Error),
    #[error(transparent)]
    UpdateStorageAccount(#[from] update_storage_account::Error),
    #[error(transparent)]
    DeleteStorageAccount(#[from] delete_storage_account::Error),
    #[error(transparent)]
    RegenerateStorageAccountKey(#[from] regenerate_storage_account_key::Error),
    #[error(transparent)]
    GetSasDefinitions(#[from] get_sas_definitions::Error),
    #[error(transparent)]
    GetDeletedSasDefinitions(#[from] get_deleted_sas_definitions::Error),
    #[error(transparent)]
    GetDeletedSasDefinition(#[from] get_deleted_sas_definition::Error),
    #[error(transparent)]
    RecoverDeletedSasDefinition(#[from] recover_deleted_sas_definition::Error),
    #[error(transparent)]
    GetSasDefinition(#[from] get_sas_definition::Error),
    #[error(transparent)]
    SetSasDefinition(#[from] set_sas_definition::Error),
    #[error(transparent)]
    UpdateSasDefinition(#[from] update_sas_definition::Error),
    #[error(transparent)]
    DeleteSasDefinition(#[from] delete_sas_definition::Error),
    #[error(transparent)]
    FullBackup(#[from] full_backup::Error),
    #[error(transparent)]
    FullBackupStatus(#[from] full_backup_status::Error),
    #[error(transparent)]
    FullRestoreOperation(#[from] full_restore_operation::Error),
    #[error(transparent)]
    RestoreStatus(#[from] restore_status::Error),
    #[error(transparent)]
    SelectiveKeyRestoreOperation(#[from] selective_key_restore_operation::Error),
    #[error(transparent)]
    HsmSecurityDomain_DownloadPending(#[from] hsm_security_domain::download_pending::Error),
    #[error(transparent)]
    HsmSecurityDomain_Download(#[from] hsm_security_domain::download::Error),
    #[error(transparent)]
    HsmSecurityDomain_TransferKey(#[from] hsm_security_domain::transfer_key::Error),
    #[error(transparent)]
    HsmSecurityDomain_Upload(#[from] hsm_security_domain::upload::Error),
    #[error(transparent)]
    HsmSecurityDomain_UploadPending(#[from] hsm_security_domain::upload_pending::Error),
}
impl Client {
    #[doc = "List certificates in a specified key vault"]
    pub fn get_certificates(&self) -> get_certificates::Builder {
        get_certificates::Builder {
            client: self.clone(),
            maxresults: None,
            include_pending: None,
        }
    }
    #[doc = "Deletes a certificate from a specified key vault."]
    pub fn delete_certificate(&self, certificate_name: impl Into<String>) -> delete_certificate::Builder {
        delete_certificate::Builder {
            client: self.clone(),
            certificate_name: certificate_name.into(),
        }
    }
    #[doc = "Lists the certificate contacts for a specified key vault."]
    pub fn get_certificate_contacts(&self) -> get_certificate_contacts::Builder {
        get_certificate_contacts::Builder { client: self.clone() }
    }
    #[doc = "Sets the certificate contacts for the specified key vault."]
    pub fn set_certificate_contacts(&self, contacts: impl Into<models::Contacts>) -> set_certificate_contacts::Builder {
        set_certificate_contacts::Builder {
            client: self.clone(),
            contacts: contacts.into(),
        }
    }
    #[doc = "Deletes the certificate contacts for a specified key vault."]
    pub fn delete_certificate_contacts(&self) -> delete_certificate_contacts::Builder {
        delete_certificate_contacts::Builder { client: self.clone() }
    }
    #[doc = "List certificate issuers for a specified key vault."]
    pub fn get_certificate_issuers(&self) -> get_certificate_issuers::Builder {
        get_certificate_issuers::Builder {
            client: self.clone(),
            maxresults: None,
        }
    }
    #[doc = "Lists the specified certificate issuer."]
    pub fn get_certificate_issuer(&self, issuer_name: impl Into<String>) -> get_certificate_issuer::Builder {
        get_certificate_issuer::Builder {
            client: self.clone(),
            issuer_name: issuer_name.into(),
        }
    }
    #[doc = "Sets the specified certificate issuer."]
    pub fn set_certificate_issuer(
        &self,
        issuer_name: impl Into<String>,
        parameter: impl Into<models::CertificateIssuerSetParameters>,
    ) -> set_certificate_issuer::Builder {
        set_certificate_issuer::Builder {
            client: self.clone(),
            issuer_name: issuer_name.into(),
            parameter: parameter.into(),
        }
    }
    #[doc = "Updates the specified certificate issuer."]
    pub fn update_certificate_issuer(
        &self,
        issuer_name: impl Into<String>,
        parameter: impl Into<models::CertificateIssuerUpdateParameters>,
    ) -> update_certificate_issuer::Builder {
        update_certificate_issuer::Builder {
            client: self.clone(),
            issuer_name: issuer_name.into(),
            parameter: parameter.into(),
        }
    }
    #[doc = "Deletes the specified certificate issuer."]
    pub fn delete_certificate_issuer(&self, issuer_name: impl Into<String>) -> delete_certificate_issuer::Builder {
        delete_certificate_issuer::Builder {
            client: self.clone(),
            issuer_name: issuer_name.into(),
        }
    }
    #[doc = "Creates a new certificate."]
    pub fn create_certificate(
        &self,
        certificate_name: impl Into<String>,
        parameters: impl Into<models::CertificateCreateParameters>,
    ) -> create_certificate::Builder {
        create_certificate::Builder {
            client: self.clone(),
            certificate_name: certificate_name.into(),
            parameters: parameters.into(),
        }
    }
    #[doc = "Imports a certificate into a specified key vault."]
    pub fn import_certificate(
        &self,
        certificate_name: impl Into<String>,
        parameters: impl Into<models::CertificateImportParameters>,
    ) -> import_certificate::Builder {
        import_certificate::Builder {
            client: self.clone(),
            certificate_name: certificate_name.into(),
            parameters: parameters.into(),
        }
    }
    #[doc = "List the versions of a certificate."]
    pub fn get_certificate_versions(&self, certificate_name: impl Into<String>) -> get_certificate_versions::Builder {
        get_certificate_versions::Builder {
            client: self.clone(),
            certificate_name: certificate_name.into(),
            maxresults: None,
        }
    }
    #[doc = "Lists the policy for a certificate."]
    pub fn get_certificate_policy(&self, certificate_name: impl Into<String>) -> get_certificate_policy::Builder {
        get_certificate_policy::Builder {
            client: self.clone(),
            certificate_name: certificate_name.into(),
        }
    }
    #[doc = "Updates the policy for a certificate."]
    pub fn update_certificate_policy(
        &self,
        certificate_name: impl Into<String>,
        certificate_policy: impl Into<models::CertificatePolicy>,
    ) -> update_certificate_policy::Builder {
        update_certificate_policy::Builder {
            client: self.clone(),
            certificate_name: certificate_name.into(),
            certificate_policy: certificate_policy.into(),
        }
    }
    #[doc = "Gets information about a certificate."]
    pub fn get_certificate(&self, certificate_name: impl Into<String>, certificate_version: impl Into<String>) -> get_certificate::Builder {
        get_certificate::Builder {
            client: self.clone(),
            certificate_name: certificate_name.into(),
            certificate_version: certificate_version.into(),
        }
    }
    #[doc = "Updates the specified attributes associated with the given certificate."]
    pub fn update_certificate(
        &self,
        certificate_name: impl Into<String>,
        certificate_version: impl Into<String>,
        parameters: impl Into<models::CertificateUpdateParameters>,
    ) -> update_certificate::Builder {
        update_certificate::Builder {
            client: self.clone(),
            certificate_name: certificate_name.into(),
            certificate_version: certificate_version.into(),
            parameters: parameters.into(),
        }
    }
    #[doc = "Gets the creation operation of a certificate."]
    pub fn get_certificate_operation(&self, certificate_name: impl Into<String>) -> get_certificate_operation::Builder {
        get_certificate_operation::Builder {
            client: self.clone(),
            certificate_name: certificate_name.into(),
        }
    }
    #[doc = "Updates a certificate operation."]
    pub fn update_certificate_operation(
        &self,
        certificate_name: impl Into<String>,
        certificate_operation: impl Into<models::CertificateOperationUpdateParameter>,
    ) -> update_certificate_operation::Builder {
        update_certificate_operation::Builder {
            client: self.clone(),
            certificate_name: certificate_name.into(),
            certificate_operation: certificate_operation.into(),
        }
    }
    #[doc = "Deletes the creation operation for a specific certificate."]
    pub fn delete_certificate_operation(&self, certificate_name: impl Into<String>) -> delete_certificate_operation::Builder {
        delete_certificate_operation::Builder {
            client: self.clone(),
            certificate_name: certificate_name.into(),
        }
    }
    #[doc = "Merges a certificate or a certificate chain with a key pair existing on the server."]
    pub fn merge_certificate(
        &self,
        certificate_name: impl Into<String>,
        parameters: impl Into<models::CertificateMergeParameters>,
    ) -> merge_certificate::Builder {
        merge_certificate::Builder {
            client: self.clone(),
            certificate_name: certificate_name.into(),
            parameters: parameters.into(),
        }
    }
    #[doc = "Backs up the specified certificate."]
    pub fn backup_certificate(&self, certificate_name: impl Into<String>) -> backup_certificate::Builder {
        backup_certificate::Builder {
            client: self.clone(),
            certificate_name: certificate_name.into(),
        }
    }
    #[doc = "Restores a backed up certificate to a vault."]
    pub fn restore_certificate(&self, parameters: impl Into<models::CertificateRestoreParameters>) -> restore_certificate::Builder {
        restore_certificate::Builder {
            client: self.clone(),
            parameters: parameters.into(),
        }
    }
    #[doc = "Lists the deleted certificates in the specified vault currently available for recovery."]
    pub fn get_deleted_certificates(&self) -> get_deleted_certificates::Builder {
        get_deleted_certificates::Builder {
            client: self.clone(),
            maxresults: None,
            include_pending: None,
        }
    }
    #[doc = "Retrieves information about the specified deleted certificate."]
    pub fn get_deleted_certificate(&self, certificate_name: impl Into<String>) -> get_deleted_certificate::Builder {
        get_deleted_certificate::Builder {
            client: self.clone(),
            certificate_name: certificate_name.into(),
        }
    }
    #[doc = "Permanently deletes the specified deleted certificate."]
    pub fn purge_deleted_certificate(&self, certificate_name: impl Into<String>) -> purge_deleted_certificate::Builder {
        purge_deleted_certificate::Builder {
            client: self.clone(),
            certificate_name: certificate_name.into(),
        }
    }
    #[doc = "Recovers the deleted certificate back to its current version under /certificates."]
    pub fn recover_deleted_certificate(&self, certificate_name: impl Into<String>) -> recover_deleted_certificate::Builder {
        recover_deleted_certificate::Builder {
            client: self.clone(),
            certificate_name: certificate_name.into(),
        }
    }
    #[doc = "Creates a new key, stores it, then returns key parameters and attributes to the client."]
    pub fn create_key(&self, key_name: impl Into<String>, parameters: impl Into<models::KeyCreateParameters>) -> create_key::Builder {
        create_key::Builder {
            client: self.clone(),
            key_name: key_name.into(),
            parameters: parameters.into(),
        }
    }
    #[doc = "Imports an externally created key, stores it, and returns key parameters and attributes to the client."]
    pub fn import_key(&self, key_name: impl Into<String>, parameters: impl Into<models::KeyImportParameters>) -> import_key::Builder {
        import_key::Builder {
            client: self.clone(),
            key_name: key_name.into(),
            parameters: parameters.into(),
        }
    }
    #[doc = "Deletes a key of any type from storage in Azure Key Vault."]
    pub fn delete_key(&self, key_name: impl Into<String>) -> delete_key::Builder {
        delete_key::Builder {
            client: self.clone(),
            key_name: key_name.into(),
        }
    }
    #[doc = "Gets the public part of a stored key."]
    pub fn get_key(&self, key_name: impl Into<String>, key_version: impl Into<String>) -> get_key::Builder {
        get_key::Builder {
            client: self.clone(),
            key_name: key_name.into(),
            key_version: key_version.into(),
        }
    }
    #[doc = "The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault."]
    pub fn update_key(
        &self,
        key_name: impl Into<String>,
        key_version: impl Into<String>,
        parameters: impl Into<models::KeyUpdateParameters>,
    ) -> update_key::Builder {
        update_key::Builder {
            client: self.clone(),
            key_name: key_name.into(),
            key_version: key_version.into(),
            parameters: parameters.into(),
        }
    }
    #[doc = "Retrieves a list of individual key versions with the same key name."]
    pub fn get_key_versions(&self, key_name: impl Into<String>) -> get_key_versions::Builder {
        get_key_versions::Builder {
            client: self.clone(),
            key_name: key_name.into(),
            maxresults: None,
        }
    }
    #[doc = "List keys in the specified vault."]
    pub fn get_keys(&self) -> get_keys::Builder {
        get_keys::Builder {
            client: self.clone(),
            maxresults: None,
        }
    }
    #[doc = "Requests that a backup of the specified key be downloaded to the client."]
    pub fn backup_key(&self, key_name: impl Into<String>) -> backup_key::Builder {
        backup_key::Builder {
            client: self.clone(),
            key_name: key_name.into(),
        }
    }
    #[doc = "Restores a backed up key to a vault."]
    pub fn restore_key(&self, parameters: impl Into<models::KeyRestoreParameters>) -> restore_key::Builder {
        restore_key::Builder {
            client: self.clone(),
            parameters: parameters.into(),
        }
    }
    #[doc = "Encrypts an arbitrary sequence of bytes using an encryption key that is stored in a key vault."]
    pub fn encrypt(
        &self,
        key_name: impl Into<String>,
        key_version: impl Into<String>,
        parameters: impl Into<models::KeyOperationsParameters>,
    ) -> encrypt::Builder {
        encrypt::Builder {
            client: self.clone(),
            key_name: key_name.into(),
            key_version: key_version.into(),
            parameters: parameters.into(),
        }
    }
    #[doc = "Decrypts a single block of encrypted data."]
    pub fn decrypt(
        &self,
        key_name: impl Into<String>,
        key_version: impl Into<String>,
        parameters: impl Into<models::KeyOperationsParameters>,
    ) -> decrypt::Builder {
        decrypt::Builder {
            client: self.clone(),
            key_name: key_name.into(),
            key_version: key_version.into(),
            parameters: parameters.into(),
        }
    }
    #[doc = "Creates a signature from a digest using the specified key."]
    pub fn sign(
        &self,
        key_name: impl Into<String>,
        key_version: impl Into<String>,
        parameters: impl Into<models::KeySignParameters>,
    ) -> sign::Builder {
        sign::Builder {
            client: self.clone(),
            key_name: key_name.into(),
            key_version: key_version.into(),
            parameters: parameters.into(),
        }
    }
    #[doc = "Verifies a signature using a specified key."]
    pub fn verify(
        &self,
        key_name: impl Into<String>,
        key_version: impl Into<String>,
        parameters: impl Into<models::KeyVerifyParameters>,
    ) -> verify::Builder {
        verify::Builder {
            client: self.clone(),
            key_name: key_name.into(),
            key_version: key_version.into(),
            parameters: parameters.into(),
        }
    }
    #[doc = "Wraps a symmetric key using a specified key."]
    pub fn wrap_key(
        &self,
        key_name: impl Into<String>,
        key_version: impl Into<String>,
        parameters: impl Into<models::KeyOperationsParameters>,
    ) -> wrap_key::Builder {
        wrap_key::Builder {
            client: self.clone(),
            key_name: key_name.into(),
            key_version: key_version.into(),
            parameters: parameters.into(),
        }
    }
    #[doc = "Unwraps a symmetric key using the specified key that was initially used for wrapping that key."]
    pub fn unwrap_key(
        &self,
        key_name: impl Into<String>,
        key_version: impl Into<String>,
        parameters: impl Into<models::KeyOperationsParameters>,
    ) -> unwrap_key::Builder {
        unwrap_key::Builder {
            client: self.clone(),
            key_name: key_name.into(),
            key_version: key_version.into(),
            parameters: parameters.into(),
        }
    }
    #[doc = "Lists the deleted keys in the specified vault."]
    pub fn get_deleted_keys(&self) -> get_deleted_keys::Builder {
        get_deleted_keys::Builder {
            client: self.clone(),
            maxresults: None,
        }
    }
    #[doc = "Gets the public part of a deleted key."]
    pub fn get_deleted_key(&self, key_name: impl Into<String>) -> get_deleted_key::Builder {
        get_deleted_key::Builder {
            client: self.clone(),
            key_name: key_name.into(),
        }
    }
    #[doc = "Permanently deletes the specified key."]
    pub fn purge_deleted_key(&self, key_name: impl Into<String>) -> purge_deleted_key::Builder {
        purge_deleted_key::Builder {
            client: self.clone(),
            key_name: key_name.into(),
        }
    }
    #[doc = "Recovers the deleted key to its latest version."]
    pub fn recover_deleted_key(&self, key_name: impl Into<String>) -> recover_deleted_key::Builder {
        recover_deleted_key::Builder {
            client: self.clone(),
            key_name: key_name.into(),
        }
    }
    #[doc = "Sets a secret in a specified key vault."]
    pub fn set_secret(&self, secret_name: impl Into<String>, parameters: impl Into<models::SecretSetParameters>) -> set_secret::Builder {
        set_secret::Builder {
            client: self.clone(),
            secret_name: secret_name.into(),
            parameters: parameters.into(),
        }
    }
    #[doc = "Deletes a secret from a specified key vault."]
    pub fn delete_secret(&self, secret_name: impl Into<String>) -> delete_secret::Builder {
        delete_secret::Builder {
            client: self.clone(),
            secret_name: secret_name.into(),
        }
    }
    #[doc = "Get a specified secret from a given key vault."]
    pub fn get_secret(&self, secret_name: impl Into<String>, secret_version: impl Into<String>) -> get_secret::Builder {
        get_secret::Builder {
            client: self.clone(),
            secret_name: secret_name.into(),
            secret_version: secret_version.into(),
        }
    }
    #[doc = "Updates the attributes associated with a specified secret in a given key vault."]
    pub fn update_secret(
        &self,
        secret_name: impl Into<String>,
        secret_version: impl Into<String>,
        parameters: impl Into<models::SecretUpdateParameters>,
    ) -> update_secret::Builder {
        update_secret::Builder {
            client: self.clone(),
            secret_name: secret_name.into(),
            secret_version: secret_version.into(),
            parameters: parameters.into(),
        }
    }
    #[doc = "List secrets in a specified key vault."]
    pub fn get_secrets(&self) -> get_secrets::Builder {
        get_secrets::Builder {
            client: self.clone(),
            maxresults: None,
        }
    }
    #[doc = "List all versions of the specified secret."]
    pub fn get_secret_versions(&self, secret_name: impl Into<String>) -> get_secret_versions::Builder {
        get_secret_versions::Builder {
            client: self.clone(),
            secret_name: secret_name.into(),
            maxresults: None,
        }
    }
    #[doc = "Lists deleted secrets for the specified vault."]
    pub fn get_deleted_secrets(&self) -> get_deleted_secrets::Builder {
        get_deleted_secrets::Builder {
            client: self.clone(),
            maxresults: None,
        }
    }
    #[doc = "Gets the specified deleted secret."]
    pub fn get_deleted_secret(&self, secret_name: impl Into<String>) -> get_deleted_secret::Builder {
        get_deleted_secret::Builder {
            client: self.clone(),
            secret_name: secret_name.into(),
        }
    }
    #[doc = "Permanently deletes the specified secret."]
    pub fn purge_deleted_secret(&self, secret_name: impl Into<String>) -> purge_deleted_secret::Builder {
        purge_deleted_secret::Builder {
            client: self.clone(),
            secret_name: secret_name.into(),
        }
    }
    #[doc = "Recovers the deleted secret to the latest version."]
    pub fn recover_deleted_secret(&self, secret_name: impl Into<String>) -> recover_deleted_secret::Builder {
        recover_deleted_secret::Builder {
            client: self.clone(),
            secret_name: secret_name.into(),
        }
    }
    #[doc = "Backs up the specified secret."]
    pub fn backup_secret(&self, secret_name: impl Into<String>) -> backup_secret::Builder {
        backup_secret::Builder {
            client: self.clone(),
            secret_name: secret_name.into(),
        }
    }
    #[doc = "Restores a backed up secret to a vault."]
    pub fn restore_secret(&self, parameters: impl Into<models::SecretRestoreParameters>) -> restore_secret::Builder {
        restore_secret::Builder {
            client: self.clone(),
            parameters: parameters.into(),
        }
    }
    pub fn get_storage_accounts(&self) -> get_storage_accounts::Builder {
        get_storage_accounts::Builder {
            client: self.clone(),
            maxresults: None,
        }
    }
    #[doc = "Lists deleted storage accounts for the specified vault."]
    pub fn get_deleted_storage_accounts(&self) -> get_deleted_storage_accounts::Builder {
        get_deleted_storage_accounts::Builder {
            client: self.clone(),
            maxresults: None,
        }
    }
    #[doc = "Gets the specified deleted storage account."]
    pub fn get_deleted_storage_account(&self, storage_account_name: impl Into<String>) -> get_deleted_storage_account::Builder {
        get_deleted_storage_account::Builder {
            client: self.clone(),
            storage_account_name: storage_account_name.into(),
        }
    }
    #[doc = "Permanently deletes the specified storage account."]
    pub fn purge_deleted_storage_account(&self, storage_account_name: impl Into<String>) -> purge_deleted_storage_account::Builder {
        purge_deleted_storage_account::Builder {
            client: self.clone(),
            storage_account_name: storage_account_name.into(),
        }
    }
    #[doc = "Recovers the deleted storage account."]
    pub fn recover_deleted_storage_account(&self, storage_account_name: impl Into<String>) -> recover_deleted_storage_account::Builder {
        recover_deleted_storage_account::Builder {
            client: self.clone(),
            storage_account_name: storage_account_name.into(),
        }
    }
    #[doc = "Backs up the specified storage account."]
    pub fn backup_storage_account(&self, storage_account_name: impl Into<String>) -> backup_storage_account::Builder {
        backup_storage_account::Builder {
            client: self.clone(),
            storage_account_name: storage_account_name.into(),
        }
    }
    #[doc = "Restores a backed up storage account to a vault."]
    pub fn restore_storage_account(&self, parameters: impl Into<models::StorageRestoreParameters>) -> restore_storage_account::Builder {
        restore_storage_account::Builder {
            client: self.clone(),
            parameters: parameters.into(),
        }
    }
    pub fn get_storage_account(&self, storage_account_name: impl Into<String>) -> get_storage_account::Builder {
        get_storage_account::Builder {
            client: self.clone(),
            storage_account_name: storage_account_name.into(),
        }
    }
    pub fn set_storage_account(
        &self,
        storage_account_name: impl Into<String>,
        parameters: impl Into<models::StorageAccountCreateParameters>,
    ) -> set_storage_account::Builder {
        set_storage_account::Builder {
            client: self.clone(),
            storage_account_name: storage_account_name.into(),
            parameters: parameters.into(),
        }
    }
    pub fn update_storage_account(
        &self,
        storage_account_name: impl Into<String>,
        parameters: impl Into<models::StorageAccountUpdateParameters>,
    ) -> update_storage_account::Builder {
        update_storage_account::Builder {
            client: self.clone(),
            storage_account_name: storage_account_name.into(),
            parameters: parameters.into(),
        }
    }
    pub fn delete_storage_account(&self, storage_account_name: impl Into<String>) -> delete_storage_account::Builder {
        delete_storage_account::Builder {
            client: self.clone(),
            storage_account_name: storage_account_name.into(),
        }
    }
    pub fn regenerate_storage_account_key(
        &self,
        storage_account_name: impl Into<String>,
        parameters: impl Into<models::StorageAccountRegenerteKeyParameters>,
    ) -> regenerate_storage_account_key::Builder {
        regenerate_storage_account_key::Builder {
            client: self.clone(),
            storage_account_name: storage_account_name.into(),
            parameters: parameters.into(),
        }
    }
    pub fn get_sas_definitions(&self, storage_account_name: impl Into<String>) -> get_sas_definitions::Builder {
        get_sas_definitions::Builder {
            client: self.clone(),
            storage_account_name: storage_account_name.into(),
            maxresults: None,
        }
    }
    #[doc = "Lists deleted SAS definitions for the specified vault and storage account."]
    pub fn get_deleted_sas_definitions(&self, storage_account_name: impl Into<String>) -> get_deleted_sas_definitions::Builder {
        get_deleted_sas_definitions::Builder {
            client: self.clone(),
            storage_account_name: storage_account_name.into(),
            maxresults: None,
        }
    }
    #[doc = "Gets the specified deleted sas definition."]
    pub fn get_deleted_sas_definition(
        &self,
        storage_account_name: impl Into<String>,
        sas_definition_name: impl Into<String>,
    ) -> get_deleted_sas_definition::Builder {
        get_deleted_sas_definition::Builder {
            client: self.clone(),
            storage_account_name: storage_account_name.into(),
            sas_definition_name: sas_definition_name.into(),
        }
    }
    #[doc = "Recovers the deleted SAS definition."]
    pub fn recover_deleted_sas_definition(
        &self,
        storage_account_name: impl Into<String>,
        sas_definition_name: impl Into<String>,
    ) -> recover_deleted_sas_definition::Builder {
        recover_deleted_sas_definition::Builder {
            client: self.clone(),
            storage_account_name: storage_account_name.into(),
            sas_definition_name: sas_definition_name.into(),
        }
    }
    pub fn get_sas_definition(
        &self,
        storage_account_name: impl Into<String>,
        sas_definition_name: impl Into<String>,
    ) -> get_sas_definition::Builder {
        get_sas_definition::Builder {
            client: self.clone(),
            storage_account_name: storage_account_name.into(),
            sas_definition_name: sas_definition_name.into(),
        }
    }
    pub fn set_sas_definition(
        &self,
        storage_account_name: impl Into<String>,
        sas_definition_name: impl Into<String>,
        parameters: impl Into<models::SasDefinitionCreateParameters>,
    ) -> set_sas_definition::Builder {
        set_sas_definition::Builder {
            client: self.clone(),
            storage_account_name: storage_account_name.into(),
            sas_definition_name: sas_definition_name.into(),
            parameters: parameters.into(),
        }
    }
    pub fn update_sas_definition(
        &self,
        storage_account_name: impl Into<String>,
        sas_definition_name: impl Into<String>,
        parameters: impl Into<models::SasDefinitionUpdateParameters>,
    ) -> update_sas_definition::Builder {
        update_sas_definition::Builder {
            client: self.clone(),
            storage_account_name: storage_account_name.into(),
            sas_definition_name: sas_definition_name.into(),
            parameters: parameters.into(),
        }
    }
    pub fn delete_sas_definition(
        &self,
        storage_account_name: impl Into<String>,
        sas_definition_name: impl Into<String>,
    ) -> delete_sas_definition::Builder {
        delete_sas_definition::Builder {
            client: self.clone(),
            storage_account_name: storage_account_name.into(),
            sas_definition_name: sas_definition_name.into(),
        }
    }
    pub fn full_backup(&self) -> full_backup::Builder {
        full_backup::Builder {
            client: self.clone(),
            azure_storage_blob_container_uri: None,
        }
    }
    pub fn full_backup_status(&self, job_id: impl Into<String>) -> full_backup_status::Builder {
        full_backup_status::Builder {
            client: self.clone(),
            job_id: job_id.into(),
        }
    }
    pub fn full_restore_operation(&self) -> full_restore_operation::Builder {
        full_restore_operation::Builder {
            client: self.clone(),
            restore_blob_details: None,
        }
    }
    pub fn restore_status(&self, job_id: impl Into<String>) -> restore_status::Builder {
        restore_status::Builder {
            client: self.clone(),
            job_id: job_id.into(),
        }
    }
    pub fn selective_key_restore_operation(&self, key_name: impl Into<String>) -> selective_key_restore_operation::Builder {
        selective_key_restore_operation::Builder {
            client: self.clone(),
            key_name: key_name.into(),
            restore_blob_details: None,
        }
    }
}
pub mod get_certificates {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) maxresults: Option<i32>,
        pub(crate) include_pending: Option<bool>,
    }
    impl Builder {
        pub fn maxresults(mut self, maxresults: i32) -> Self {
            self.maxresults = Some(maxresults);
            self
        }
        pub fn include_pending(mut self, include_pending: bool) -> Self {
            self.include_pending = Some(include_pending);
            self
        }
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::CertificateListResult, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/certificates", self.client.endpoint(),);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::GET);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                if let Some(maxresults) = &self.maxresults {
                    url.query_pairs_mut().append_pair("maxresults", &maxresults.to_string());
                }
                if let Some(include_pending) = &self.include_pending {
                    url.query_pairs_mut().append_pair("includePending", &include_pending.to_string());
                }
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::CertificateListResult =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod delete_certificate {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) certificate_name: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::DeletedCertificateBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/certificates/{}", self.client.endpoint(), &self.certificate_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::DELETE);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::DeletedCertificateBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod get_certificate_contacts {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::Contacts, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/certificates/contacts", self.client.endpoint(),);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::GET);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::Contacts =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod set_certificate_contacts {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) contacts: models::Contacts,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::Contacts, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/certificates/contacts", self.client.endpoint(),);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::PUT);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                req_builder = req_builder.header("content-type", "application/json");
                let req_body = azure_core::to_json(&self.contacts).map_err(Error::Serialize)?;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::Contacts =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod delete_certificate_contacts {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::Contacts, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/certificates/contacts", self.client.endpoint(),);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::DELETE);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::Contacts =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod get_certificate_issuers {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) maxresults: Option<i32>,
    }
    impl Builder {
        pub fn maxresults(mut self, maxresults: i32) -> Self {
            self.maxresults = Some(maxresults);
            self
        }
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::CertificateIssuerListResult, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/certificates/issuers", self.client.endpoint(),);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::GET);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                if let Some(maxresults) = &self.maxresults {
                    url.query_pairs_mut().append_pair("maxresults", &maxresults.to_string());
                }
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::CertificateIssuerListResult =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod get_certificate_issuer {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) issuer_name: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::IssuerBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/certificates/issuers/{}", self.client.endpoint(), &self.issuer_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::GET);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::IssuerBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod set_certificate_issuer {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) issuer_name: String,
        pub(crate) parameter: models::CertificateIssuerSetParameters,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::IssuerBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/certificates/issuers/{}", self.client.endpoint(), &self.issuer_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::PUT);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                req_builder = req_builder.header("content-type", "application/json");
                let req_body = azure_core::to_json(&self.parameter).map_err(Error::Serialize)?;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::IssuerBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod update_certificate_issuer {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) issuer_name: String,
        pub(crate) parameter: models::CertificateIssuerUpdateParameters,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::IssuerBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/certificates/issuers/{}", self.client.endpoint(), &self.issuer_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::PATCH);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                req_builder = req_builder.header("content-type", "application/json");
                let req_body = azure_core::to_json(&self.parameter).map_err(Error::Serialize)?;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::IssuerBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod delete_certificate_issuer {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) issuer_name: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::IssuerBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/certificates/issuers/{}", self.client.endpoint(), &self.issuer_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::DELETE);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::IssuerBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod create_certificate {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) certificate_name: String,
        pub(crate) parameters: models::CertificateCreateParameters,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::CertificateOperation, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/certificates/{}/create", self.client.endpoint(), &self.certificate_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::POST);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                req_builder = req_builder.header("content-type", "application/json");
                let req_body = azure_core::to_json(&self.parameters).map_err(Error::Serialize)?;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::ACCEPTED => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::CertificateOperation =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod import_certificate {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) certificate_name: String,
        pub(crate) parameters: models::CertificateImportParameters,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::CertificateBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/certificates/{}/import", self.client.endpoint(), &self.certificate_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::POST);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                req_builder = req_builder.header("content-type", "application/json");
                let req_body = azure_core::to_json(&self.parameters).map_err(Error::Serialize)?;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::CertificateBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod get_certificate_versions {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) certificate_name: String,
        pub(crate) maxresults: Option<i32>,
    }
    impl Builder {
        pub fn maxresults(mut self, maxresults: i32) -> Self {
            self.maxresults = Some(maxresults);
            self
        }
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::CertificateListResult, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/certificates/{}/versions", self.client.endpoint(), &self.certificate_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::GET);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                if let Some(maxresults) = &self.maxresults {
                    url.query_pairs_mut().append_pair("maxresults", &maxresults.to_string());
                }
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::CertificateListResult =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod get_certificate_policy {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) certificate_name: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::CertificatePolicy, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/certificates/{}/policy", self.client.endpoint(), &self.certificate_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::GET);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::CertificatePolicy =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod update_certificate_policy {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) certificate_name: String,
        pub(crate) certificate_policy: models::CertificatePolicy,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::CertificatePolicy, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/certificates/{}/policy", self.client.endpoint(), &self.certificate_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::PATCH);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                req_builder = req_builder.header("content-type", "application/json");
                let req_body = azure_core::to_json(&self.certificate_policy).map_err(Error::Serialize)?;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::CertificatePolicy =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod get_certificate {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) certificate_name: String,
        pub(crate) certificate_version: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::CertificateBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!(
                    "{}/certificates/{}/{}",
                    self.client.endpoint(),
                    &self.certificate_name,
                    &self.certificate_version
                );
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::GET);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::CertificateBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod update_certificate {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) certificate_name: String,
        pub(crate) certificate_version: String,
        pub(crate) parameters: models::CertificateUpdateParameters,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::CertificateBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!(
                    "{}/certificates/{}/{}",
                    self.client.endpoint(),
                    &self.certificate_name,
                    &self.certificate_version
                );
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::PATCH);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                req_builder = req_builder.header("content-type", "application/json");
                let req_body = azure_core::to_json(&self.parameters).map_err(Error::Serialize)?;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::CertificateBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod get_certificate_operation {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) certificate_name: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::CertificateOperation, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/certificates/{}/pending", self.client.endpoint(), &self.certificate_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::GET);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::CertificateOperation =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod update_certificate_operation {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) certificate_name: String,
        pub(crate) certificate_operation: models::CertificateOperationUpdateParameter,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::CertificateOperation, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/certificates/{}/pending", self.client.endpoint(), &self.certificate_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::PATCH);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                req_builder = req_builder.header("content-type", "application/json");
                let req_body = azure_core::to_json(&self.certificate_operation).map_err(Error::Serialize)?;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::CertificateOperation =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod delete_certificate_operation {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) certificate_name: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::CertificateOperation, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/certificates/{}/pending", self.client.endpoint(), &self.certificate_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::DELETE);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::CertificateOperation =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod merge_certificate {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) certificate_name: String,
        pub(crate) parameters: models::CertificateMergeParameters,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::CertificateBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/certificates/{}/pending/merge", self.client.endpoint(), &self.certificate_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::POST);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                req_builder = req_builder.header("content-type", "application/json");
                let req_body = azure_core::to_json(&self.parameters).map_err(Error::Serialize)?;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::CREATED => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::CertificateBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod backup_certificate {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) certificate_name: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::BackupCertificateResult, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/certificates/{}/backup", self.client.endpoint(), &self.certificate_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::POST);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.header(http::header::CONTENT_LENGTH, 0);
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::BackupCertificateResult =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod restore_certificate {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) parameters: models::CertificateRestoreParameters,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::CertificateBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/certificates/restore", self.client.endpoint(),);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::POST);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                req_builder = req_builder.header("content-type", "application/json");
                let req_body = azure_core::to_json(&self.parameters).map_err(Error::Serialize)?;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::CertificateBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod get_deleted_certificates {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) maxresults: Option<i32>,
        pub(crate) include_pending: Option<bool>,
    }
    impl Builder {
        pub fn maxresults(mut self, maxresults: i32) -> Self {
            self.maxresults = Some(maxresults);
            self
        }
        pub fn include_pending(mut self, include_pending: bool) -> Self {
            self.include_pending = Some(include_pending);
            self
        }
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::DeletedCertificateListResult, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/deletedcertificates", self.client.endpoint(),);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::GET);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                if let Some(maxresults) = &self.maxresults {
                    url.query_pairs_mut().append_pair("maxresults", &maxresults.to_string());
                }
                if let Some(include_pending) = &self.include_pending {
                    url.query_pairs_mut().append_pair("includePending", &include_pending.to_string());
                }
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::DeletedCertificateListResult =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod get_deleted_certificate {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) certificate_name: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::DeletedCertificateBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/deletedcertificates/{}", self.client.endpoint(), &self.certificate_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::GET);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::DeletedCertificateBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod purge_deleted_certificate {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) certificate_name: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<(), Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/deletedcertificates/{}", self.client.endpoint(), &self.certificate_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::DELETE);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::NO_CONTENT => Ok(()),
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod recover_deleted_certificate {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) certificate_name: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::CertificateBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/deletedcertificates/{}/recover", self.client.endpoint(), &self.certificate_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::POST);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.header(http::header::CONTENT_LENGTH, 0);
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::CertificateBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod create_key {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) key_name: String,
        pub(crate) parameters: models::KeyCreateParameters,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::KeyBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/keys/{}/create", self.client.endpoint(), &self.key_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::POST);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                req_builder = req_builder.header("content-type", "application/json");
                let req_body = azure_core::to_json(&self.parameters).map_err(Error::Serialize)?;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod import_key {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) key_name: String,
        pub(crate) parameters: models::KeyImportParameters,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::KeyBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/keys/{}", self.client.endpoint(), &self.key_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::PUT);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                req_builder = req_builder.header("content-type", "application/json");
                let req_body = azure_core::to_json(&self.parameters).map_err(Error::Serialize)?;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod delete_key {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) key_name: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::DeletedKeyBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/keys/{}", self.client.endpoint(), &self.key_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::DELETE);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::DeletedKeyBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod get_key {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) key_name: String,
        pub(crate) key_version: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::KeyBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/keys/{}/{}", self.client.endpoint(), &self.key_name, &self.key_version);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::GET);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod update_key {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) key_name: String,
        pub(crate) key_version: String,
        pub(crate) parameters: models::KeyUpdateParameters,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::KeyBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/keys/{}/{}", self.client.endpoint(), &self.key_name, &self.key_version);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::PATCH);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                req_builder = req_builder.header("content-type", "application/json");
                let req_body = azure_core::to_json(&self.parameters).map_err(Error::Serialize)?;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod get_key_versions {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) key_name: String,
        pub(crate) maxresults: Option<i32>,
    }
    impl Builder {
        pub fn maxresults(mut self, maxresults: i32) -> Self {
            self.maxresults = Some(maxresults);
            self
        }
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::KeyListResult, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/keys/{}/versions", self.client.endpoint(), &self.key_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::GET);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                if let Some(maxresults) = &self.maxresults {
                    url.query_pairs_mut().append_pair("maxresults", &maxresults.to_string());
                }
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyListResult =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod get_keys {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) maxresults: Option<i32>,
    }
    impl Builder {
        pub fn maxresults(mut self, maxresults: i32) -> Self {
            self.maxresults = Some(maxresults);
            self
        }
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::KeyListResult, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/keys", self.client.endpoint(),);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::GET);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                if let Some(maxresults) = &self.maxresults {
                    url.query_pairs_mut().append_pair("maxresults", &maxresults.to_string());
                }
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyListResult =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod backup_key {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) key_name: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::BackupKeyResult, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/keys/{}/backup", self.client.endpoint(), &self.key_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::POST);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.header(http::header::CONTENT_LENGTH, 0);
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::BackupKeyResult =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod restore_key {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) parameters: models::KeyRestoreParameters,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::KeyBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/keys/restore", self.client.endpoint(),);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::POST);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                req_builder = req_builder.header("content-type", "application/json");
                let req_body = azure_core::to_json(&self.parameters).map_err(Error::Serialize)?;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod encrypt {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) key_name: String,
        pub(crate) key_version: String,
        pub(crate) parameters: models::KeyOperationsParameters,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::KeyOperationResult, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/keys/{}/{}/encrypt", self.client.endpoint(), &self.key_name, &self.key_version);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::POST);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                req_builder = req_builder.header("content-type", "application/json");
                let req_body = azure_core::to_json(&self.parameters).map_err(Error::Serialize)?;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyOperationResult =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod decrypt {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) key_name: String,
        pub(crate) key_version: String,
        pub(crate) parameters: models::KeyOperationsParameters,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::KeyOperationResult, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/keys/{}/{}/decrypt", self.client.endpoint(), &self.key_name, &self.key_version);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::POST);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                req_builder = req_builder.header("content-type", "application/json");
                let req_body = azure_core::to_json(&self.parameters).map_err(Error::Serialize)?;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyOperationResult =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod sign {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) key_name: String,
        pub(crate) key_version: String,
        pub(crate) parameters: models::KeySignParameters,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::KeyOperationResult, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/keys/{}/{}/sign", self.client.endpoint(), &self.key_name, &self.key_version);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::POST);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                req_builder = req_builder.header("content-type", "application/json");
                let req_body = azure_core::to_json(&self.parameters).map_err(Error::Serialize)?;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyOperationResult =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod verify {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) key_name: String,
        pub(crate) key_version: String,
        pub(crate) parameters: models::KeyVerifyParameters,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::KeyVerifyResult, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/keys/{}/{}/verify", self.client.endpoint(), &self.key_name, &self.key_version);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::POST);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                req_builder = req_builder.header("content-type", "application/json");
                let req_body = azure_core::to_json(&self.parameters).map_err(Error::Serialize)?;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVerifyResult =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod wrap_key {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) key_name: String,
        pub(crate) key_version: String,
        pub(crate) parameters: models::KeyOperationsParameters,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::KeyOperationResult, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/keys/{}/{}/wrapkey", self.client.endpoint(), &self.key_name, &self.key_version);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::POST);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                req_builder = req_builder.header("content-type", "application/json");
                let req_body = azure_core::to_json(&self.parameters).map_err(Error::Serialize)?;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyOperationResult =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod unwrap_key {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) key_name: String,
        pub(crate) key_version: String,
        pub(crate) parameters: models::KeyOperationsParameters,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::KeyOperationResult, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/keys/{}/{}/unwrapkey", self.client.endpoint(), &self.key_name, &self.key_version);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::POST);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                req_builder = req_builder.header("content-type", "application/json");
                let req_body = azure_core::to_json(&self.parameters).map_err(Error::Serialize)?;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyOperationResult =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod get_deleted_keys {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) maxresults: Option<i32>,
    }
    impl Builder {
        pub fn maxresults(mut self, maxresults: i32) -> Self {
            self.maxresults = Some(maxresults);
            self
        }
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::DeletedKeyListResult, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/deletedkeys", self.client.endpoint(),);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::GET);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                if let Some(maxresults) = &self.maxresults {
                    url.query_pairs_mut().append_pair("maxresults", &maxresults.to_string());
                }
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::DeletedKeyListResult =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod get_deleted_key {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) key_name: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::DeletedKeyBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/deletedkeys/{}", self.client.endpoint(), &self.key_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::GET);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::DeletedKeyBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod purge_deleted_key {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) key_name: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<(), Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/deletedkeys/{}", self.client.endpoint(), &self.key_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::DELETE);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::NO_CONTENT => Ok(()),
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod recover_deleted_key {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) key_name: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::KeyBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/deletedkeys/{}/recover", self.client.endpoint(), &self.key_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::POST);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.header(http::header::CONTENT_LENGTH, 0);
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod set_secret {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) secret_name: String,
        pub(crate) parameters: models::SecretSetParameters,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::SecretBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/secrets/{}", self.client.endpoint(), &self.secret_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::PUT);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                req_builder = req_builder.header("content-type", "application/json");
                let req_body = azure_core::to_json(&self.parameters).map_err(Error::Serialize)?;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::SecretBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod delete_secret {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) secret_name: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::DeletedSecretBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/secrets/{}", self.client.endpoint(), &self.secret_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::DELETE);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::DeletedSecretBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod get_secret {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) secret_name: String,
        pub(crate) secret_version: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::SecretBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/secrets/{}/{}", self.client.endpoint(), &self.secret_name, &self.secret_version);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::GET);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::SecretBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod update_secret {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) secret_name: String,
        pub(crate) secret_version: String,
        pub(crate) parameters: models::SecretUpdateParameters,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::SecretBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/secrets/{}/{}", self.client.endpoint(), &self.secret_name, &self.secret_version);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::PATCH);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                req_builder = req_builder.header("content-type", "application/json");
                let req_body = azure_core::to_json(&self.parameters).map_err(Error::Serialize)?;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::SecretBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod get_secrets {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) maxresults: Option<i32>,
    }
    impl Builder {
        pub fn maxresults(mut self, maxresults: i32) -> Self {
            self.maxresults = Some(maxresults);
            self
        }
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::SecretListResult, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/secrets", self.client.endpoint(),);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::GET);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                if let Some(maxresults) = &self.maxresults {
                    url.query_pairs_mut().append_pair("maxresults", &maxresults.to_string());
                }
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::SecretListResult =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod get_secret_versions {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) secret_name: String,
        pub(crate) maxresults: Option<i32>,
    }
    impl Builder {
        pub fn maxresults(mut self, maxresults: i32) -> Self {
            self.maxresults = Some(maxresults);
            self
        }
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::SecretListResult, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/secrets/{}/versions", self.client.endpoint(), &self.secret_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::GET);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                if let Some(maxresults) = &self.maxresults {
                    url.query_pairs_mut().append_pair("maxresults", &maxresults.to_string());
                }
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::SecretListResult =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod get_deleted_secrets {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) maxresults: Option<i32>,
    }
    impl Builder {
        pub fn maxresults(mut self, maxresults: i32) -> Self {
            self.maxresults = Some(maxresults);
            self
        }
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::DeletedSecretListResult, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/deletedsecrets", self.client.endpoint(),);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::GET);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                if let Some(maxresults) = &self.maxresults {
                    url.query_pairs_mut().append_pair("maxresults", &maxresults.to_string());
                }
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::DeletedSecretListResult =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod get_deleted_secret {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) secret_name: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::DeletedSecretBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/deletedsecrets/{}", self.client.endpoint(), &self.secret_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::GET);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::DeletedSecretBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod purge_deleted_secret {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) secret_name: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<(), Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/deletedsecrets/{}", self.client.endpoint(), &self.secret_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::DELETE);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::NO_CONTENT => Ok(()),
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod recover_deleted_secret {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) secret_name: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::SecretBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/deletedsecrets/{}/recover", self.client.endpoint(), &self.secret_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::POST);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.header(http::header::CONTENT_LENGTH, 0);
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::SecretBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod backup_secret {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) secret_name: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::BackupSecretResult, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/secrets/{}/backup", self.client.endpoint(), &self.secret_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::POST);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.header(http::header::CONTENT_LENGTH, 0);
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::BackupSecretResult =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod restore_secret {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) parameters: models::SecretRestoreParameters,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::SecretBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/secrets/restore", self.client.endpoint(),);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::POST);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                req_builder = req_builder.header("content-type", "application/json");
                let req_body = azure_core::to_json(&self.parameters).map_err(Error::Serialize)?;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::SecretBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod get_storage_accounts {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) maxresults: Option<i32>,
    }
    impl Builder {
        pub fn maxresults(mut self, maxresults: i32) -> Self {
            self.maxresults = Some(maxresults);
            self
        }
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::StorageListResult, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/storage", self.client.endpoint(),);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::GET);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                if let Some(maxresults) = &self.maxresults {
                    url.query_pairs_mut().append_pair("maxresults", &maxresults.to_string());
                }
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::StorageListResult =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod get_deleted_storage_accounts {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) maxresults: Option<i32>,
    }
    impl Builder {
        pub fn maxresults(mut self, maxresults: i32) -> Self {
            self.maxresults = Some(maxresults);
            self
        }
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::DeletedStorageListResult, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/deletedstorage", self.client.endpoint(),);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::GET);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                if let Some(maxresults) = &self.maxresults {
                    url.query_pairs_mut().append_pair("maxresults", &maxresults.to_string());
                }
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::DeletedStorageListResult =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod get_deleted_storage_account {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) storage_account_name: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::DeletedStorageBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/deletedstorage/{}", self.client.endpoint(), &self.storage_account_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::GET);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::DeletedStorageBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod purge_deleted_storage_account {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) storage_account_name: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<(), Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/deletedstorage/{}", self.client.endpoint(), &self.storage_account_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::DELETE);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::NO_CONTENT => Ok(()),
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod recover_deleted_storage_account {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) storage_account_name: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::StorageBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/deletedstorage/{}/recover", self.client.endpoint(), &self.storage_account_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::POST);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.header(http::header::CONTENT_LENGTH, 0);
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::StorageBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod backup_storage_account {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) storage_account_name: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::BackupStorageResult, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/storage/{}/backup", self.client.endpoint(), &self.storage_account_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::POST);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.header(http::header::CONTENT_LENGTH, 0);
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::BackupStorageResult =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod restore_storage_account {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) parameters: models::StorageRestoreParameters,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::StorageBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/storage/restore", self.client.endpoint(),);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::POST);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                req_builder = req_builder.header("content-type", "application/json");
                let req_body = azure_core::to_json(&self.parameters).map_err(Error::Serialize)?;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::StorageBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod get_storage_account {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) storage_account_name: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::StorageBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/storage/{}", self.client.endpoint(), &self.storage_account_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::GET);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::StorageBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod set_storage_account {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) storage_account_name: String,
        pub(crate) parameters: models::StorageAccountCreateParameters,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::StorageBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/storage/{}", self.client.endpoint(), &self.storage_account_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::PUT);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                req_builder = req_builder.header("content-type", "application/json");
                let req_body = azure_core::to_json(&self.parameters).map_err(Error::Serialize)?;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::StorageBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod update_storage_account {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) storage_account_name: String,
        pub(crate) parameters: models::StorageAccountUpdateParameters,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::StorageBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/storage/{}", self.client.endpoint(), &self.storage_account_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::PATCH);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                req_builder = req_builder.header("content-type", "application/json");
                let req_body = azure_core::to_json(&self.parameters).map_err(Error::Serialize)?;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::StorageBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod delete_storage_account {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) storage_account_name: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::DeletedStorageBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/storage/{}", self.client.endpoint(), &self.storage_account_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::DELETE);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::DeletedStorageBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod regenerate_storage_account_key {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) storage_account_name: String,
        pub(crate) parameters: models::StorageAccountRegenerteKeyParameters,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::StorageBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/storage/{}/regeneratekey", self.client.endpoint(), &self.storage_account_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::POST);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                req_builder = req_builder.header("content-type", "application/json");
                let req_body = azure_core::to_json(&self.parameters).map_err(Error::Serialize)?;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::StorageBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod get_sas_definitions {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) storage_account_name: String,
        pub(crate) maxresults: Option<i32>,
    }
    impl Builder {
        pub fn maxresults(mut self, maxresults: i32) -> Self {
            self.maxresults = Some(maxresults);
            self
        }
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::SasDefinitionListResult, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/storage/{}/sas", self.client.endpoint(), &self.storage_account_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::GET);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                if let Some(maxresults) = &self.maxresults {
                    url.query_pairs_mut().append_pair("maxresults", &maxresults.to_string());
                }
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::SasDefinitionListResult =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod get_deleted_sas_definitions {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) storage_account_name: String,
        pub(crate) maxresults: Option<i32>,
    }
    impl Builder {
        pub fn maxresults(mut self, maxresults: i32) -> Self {
            self.maxresults = Some(maxresults);
            self
        }
        pub fn into_future(
            self,
        ) -> futures::future::BoxFuture<'static, std::result::Result<models::DeletedSasDefinitionListResult, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/deletedstorage/{}/sas", self.client.endpoint(), &self.storage_account_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::GET);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                if let Some(maxresults) = &self.maxresults {
                    url.query_pairs_mut().append_pair("maxresults", &maxresults.to_string());
                }
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::DeletedSasDefinitionListResult =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod get_deleted_sas_definition {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) storage_account_name: String,
        pub(crate) sas_definition_name: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::DeletedSasDefinitionBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!(
                    "{}/deletedstorage/{}/sas/{}",
                    self.client.endpoint(),
                    &self.storage_account_name,
                    &self.sas_definition_name
                );
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::GET);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::DeletedSasDefinitionBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod recover_deleted_sas_definition {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) storage_account_name: String,
        pub(crate) sas_definition_name: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::SasDefinitionBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!(
                    "{}/deletedstorage/{}/sas/{}/recover",
                    self.client.endpoint(),
                    &self.storage_account_name,
                    &self.sas_definition_name
                );
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::POST);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.header(http::header::CONTENT_LENGTH, 0);
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::SasDefinitionBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod get_sas_definition {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) storage_account_name: String,
        pub(crate) sas_definition_name: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::SasDefinitionBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!(
                    "{}/storage/{}/sas/{}",
                    self.client.endpoint(),
                    &self.storage_account_name,
                    &self.sas_definition_name
                );
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::GET);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::SasDefinitionBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod set_sas_definition {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) storage_account_name: String,
        pub(crate) sas_definition_name: String,
        pub(crate) parameters: models::SasDefinitionCreateParameters,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::SasDefinitionBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!(
                    "{}/storage/{}/sas/{}",
                    self.client.endpoint(),
                    &self.storage_account_name,
                    &self.sas_definition_name
                );
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::PUT);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                req_builder = req_builder.header("content-type", "application/json");
                let req_body = azure_core::to_json(&self.parameters).map_err(Error::Serialize)?;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::SasDefinitionBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod update_sas_definition {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) storage_account_name: String,
        pub(crate) sas_definition_name: String,
        pub(crate) parameters: models::SasDefinitionUpdateParameters,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::SasDefinitionBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!(
                    "{}/storage/{}/sas/{}",
                    self.client.endpoint(),
                    &self.storage_account_name,
                    &self.sas_definition_name
                );
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::PATCH);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                req_builder = req_builder.header("content-type", "application/json");
                let req_body = azure_core::to_json(&self.parameters).map_err(Error::Serialize)?;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::SasDefinitionBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod delete_sas_definition {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) storage_account_name: String,
        pub(crate) sas_definition_name: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::DeletedSasDefinitionBundle, Error>> {
            Box::pin(async move {
                let url_str = &format!(
                    "{}/storage/{}/sas/{}",
                    self.client.endpoint(),
                    &self.storage_account_name,
                    &self.sas_definition_name
                );
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::DELETE);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::DeletedSasDefinitionBundle =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod full_backup {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) azure_storage_blob_container_uri: Option<models::SasTokenParameter>,
    }
    impl Builder {
        pub fn azure_storage_blob_container_uri(mut self, azure_storage_blob_container_uri: impl Into<models::SasTokenParameter>) -> Self {
            self.azure_storage_blob_container_uri = Some(azure_storage_blob_container_uri.into());
            self
        }
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::FullBackupOperation, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/backup", self.client.endpoint(),);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::POST);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = if let Some(azure_storage_blob_container_uri) = &self.azure_storage_blob_container_uri {
                    req_builder = req_builder.header("content-type", "application/json");
                    azure_core::to_json(azure_storage_blob_container_uri).map_err(Error::Serialize)?
                } else {
                    azure_core::EMPTY_BODY
                };
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::ACCEPTED => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::FullBackupOperation =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod full_backup_status {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) job_id: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::FullBackupOperation, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/backup/{}/pending", self.client.endpoint(), &self.job_id);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::GET);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::FullBackupOperation =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod full_restore_operation {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) restore_blob_details: Option<models::RestoreOperationParameters>,
    }
    impl Builder {
        pub fn restore_blob_details(mut self, restore_blob_details: impl Into<models::RestoreOperationParameters>) -> Self {
            self.restore_blob_details = Some(restore_blob_details.into());
            self
        }
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::RestoreOperation, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/restore", self.client.endpoint(),);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::PUT);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = if let Some(restore_blob_details) = &self.restore_blob_details {
                    req_builder = req_builder.header("content-type", "application/json");
                    azure_core::to_json(restore_blob_details).map_err(Error::Serialize)?
                } else {
                    azure_core::EMPTY_BODY
                };
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::ACCEPTED => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::RestoreOperation =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod restore_status {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) job_id: String,
    }
    impl Builder {
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::RestoreOperation, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/restore/{}/pending", self.client.endpoint(), &self.job_id);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::GET);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = azure_core::EMPTY_BODY;
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::OK => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::RestoreOperation =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod selective_key_restore_operation {
    use super::{models, API_VERSION};
    #[derive(Debug, thiserror :: Error)]
    pub enum Error {
        #[error("HTTP status code {}", status_code)]
        DefaultResponse {
            status_code: http::StatusCode,
            value: models::KeyVaultError,
        },
        #[error("Failed to parse request URL: {0}")]
        ParseUrl(url::ParseError),
        #[error("Failed to build request: {0}")]
        BuildRequest(http::Error),
        #[error("Failed to serialize request body: {0}")]
        Serialize(serde_json::Error),
        #[error("Failed to get access token: {0}")]
        GetToken(azure_core::Error),
        #[error("Failed to execute request: {0}")]
        SendRequest(azure_core::Error),
        #[error("Failed to get response bytes: {0}")]
        ResponseBytes(azure_core::StreamError),
        #[error("Failed to deserialize response: {0}, body: {1:?}")]
        Deserialize(serde_json::Error, bytes::Bytes),
    }
    #[derive(Clone)]
    pub struct Builder {
        pub(crate) client: super::Client,
        pub(crate) key_name: String,
        pub(crate) restore_blob_details: Option<models::SelectiveKeyRestoreOperationParameters>,
    }
    impl Builder {
        pub fn restore_blob_details(mut self, restore_blob_details: impl Into<models::SelectiveKeyRestoreOperationParameters>) -> Self {
            self.restore_blob_details = Some(restore_blob_details.into());
            self
        }
        pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::SelectiveKeyRestoreOperation, Error>> {
            Box::pin(async move {
                let url_str = &format!("{}/keys/{}/restore", self.client.endpoint(), &self.key_name);
                let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                let mut req_builder = http::request::Builder::new();
                req_builder = req_builder.method(http::Method::PUT);
                let credential = self.client.token_credential();
                let token_response = credential
                    .get_token(&self.client.scopes().join(" "))
                    .await
                    .map_err(Error::GetToken)?;
                req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                let req_body = if let Some(restore_blob_details) = &self.restore_blob_details {
                    req_builder = req_builder.header("content-type", "application/json");
                    azure_core::to_json(restore_blob_details).map_err(Error::Serialize)?
                } else {
                    azure_core::EMPTY_BODY
                };
                req_builder = req_builder.uri(url.as_str());
                let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                match rsp_status {
                    http::StatusCode::ACCEPTED => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::SelectiveKeyRestoreOperation =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Ok(rsp_value)
                    }
                    status_code => {
                        let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                        let rsp_value: models::KeyVaultError =
                            serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                        Err(Error::DefaultResponse {
                            status_code,
                            value: rsp_value,
                        })
                    }
                }
            })
        }
    }
}
pub mod role_definitions {
    use super::{models, API_VERSION};
    pub struct Client(pub(crate) super::Client);
    impl Client {
        pub fn get(&self, scope: impl Into<String>, role_definition_name: impl Into<String>) -> get::Builder {
            get::Builder {
                client: self.0.clone(),
                scope: scope.into(),
                role_definition_name: role_definition_name.into(),
            }
        }
        pub fn create_or_update(
            &self,
            scope: impl Into<String>,
            role_definition_name: impl Into<String>,
            parameters: impl Into<models::RoleDefinitionCreateParameters>,
        ) -> create_or_update::Builder {
            create_or_update::Builder {
                client: self.0.clone(),
                scope: scope.into(),
                role_definition_name: role_definition_name.into(),
                parameters: parameters.into(),
            }
        }
        pub fn delete(&self, scope: impl Into<String>, role_definition_name: impl Into<String>) -> delete::Builder {
            delete::Builder {
                client: self.0.clone(),
                scope: scope.into(),
                role_definition_name: role_definition_name.into(),
            }
        }
        pub fn list(&self, scope: impl Into<String>) -> list::Builder {
            list::Builder {
                client: self.0.clone(),
                scope: scope.into(),
                filter: None,
            }
        }
    }
    pub mod get {
        use super::{models, API_VERSION};
        #[derive(Debug, thiserror :: Error)]
        pub enum Error {
            #[error("HTTP status code {}", status_code)]
            DefaultResponse {
                status_code: http::StatusCode,
                value: models::KeyVaultError,
            },
            #[error("Failed to parse request URL: {0}")]
            ParseUrl(url::ParseError),
            #[error("Failed to build request: {0}")]
            BuildRequest(http::Error),
            #[error("Failed to serialize request body: {0}")]
            Serialize(serde_json::Error),
            #[error("Failed to get access token: {0}")]
            GetToken(azure_core::Error),
            #[error("Failed to execute request: {0}")]
            SendRequest(azure_core::Error),
            #[error("Failed to get response bytes: {0}")]
            ResponseBytes(azure_core::StreamError),
            #[error("Failed to deserialize response: {0}, body: {1:?}")]
            Deserialize(serde_json::Error, bytes::Bytes),
        }
        #[derive(Clone)]
        pub struct Builder {
            pub(crate) client: super::super::Client,
            pub(crate) scope: String,
            pub(crate) role_definition_name: String,
        }
        impl Builder {
            pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::RoleDefinition, Error>> {
                Box::pin(async move {
                    let url_str = &format!(
                        "{}/{}/providers/Microsoft.Authorization/roleDefinitions/{}",
                        self.client.endpoint(),
                        &self.scope,
                        &self.role_definition_name
                    );
                    let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                    let mut req_builder = http::request::Builder::new();
                    req_builder = req_builder.method(http::Method::GET);
                    let credential = self.client.token_credential();
                    let token_response = credential
                        .get_token(&self.client.scopes().join(" "))
                        .await
                        .map_err(Error::GetToken)?;
                    req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                    url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                    let req_body = azure_core::EMPTY_BODY;
                    req_builder = req_builder.uri(url.as_str());
                    let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                    let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                    let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                    match rsp_status {
                        http::StatusCode::OK => {
                            let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                            let rsp_value: models::RoleDefinition =
                                serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                            Ok(rsp_value)
                        }
                        status_code => {
                            let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                            let rsp_value: models::KeyVaultError =
                                serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                            Err(Error::DefaultResponse {
                                status_code,
                                value: rsp_value,
                            })
                        }
                    }
                })
            }
        }
    }
    pub mod create_or_update {
        use super::{models, API_VERSION};
        #[derive(Debug, thiserror :: Error)]
        pub enum Error {
            #[error("HTTP status code {}", status_code)]
            DefaultResponse {
                status_code: http::StatusCode,
                value: models::KeyVaultError,
            },
            #[error("Failed to parse request URL: {0}")]
            ParseUrl(url::ParseError),
            #[error("Failed to build request: {0}")]
            BuildRequest(http::Error),
            #[error("Failed to serialize request body: {0}")]
            Serialize(serde_json::Error),
            #[error("Failed to get access token: {0}")]
            GetToken(azure_core::Error),
            #[error("Failed to execute request: {0}")]
            SendRequest(azure_core::Error),
            #[error("Failed to get response bytes: {0}")]
            ResponseBytes(azure_core::StreamError),
            #[error("Failed to deserialize response: {0}, body: {1:?}")]
            Deserialize(serde_json::Error, bytes::Bytes),
        }
        #[derive(Clone)]
        pub struct Builder {
            pub(crate) client: super::super::Client,
            pub(crate) scope: String,
            pub(crate) role_definition_name: String,
            pub(crate) parameters: models::RoleDefinitionCreateParameters,
        }
        impl Builder {
            pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::RoleDefinition, Error>> {
                Box::pin(async move {
                    let url_str = &format!(
                        "{}/{}/providers/Microsoft.Authorization/roleDefinitions/{}",
                        self.client.endpoint(),
                        &self.scope,
                        &self.role_definition_name
                    );
                    let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                    let mut req_builder = http::request::Builder::new();
                    req_builder = req_builder.method(http::Method::PUT);
                    let credential = self.client.token_credential();
                    let token_response = credential
                        .get_token(&self.client.scopes().join(" "))
                        .await
                        .map_err(Error::GetToken)?;
                    req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                    url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                    req_builder = req_builder.header("content-type", "application/json");
                    let req_body = azure_core::to_json(&self.parameters).map_err(Error::Serialize)?;
                    req_builder = req_builder.uri(url.as_str());
                    let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                    let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                    let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                    match rsp_status {
                        http::StatusCode::CREATED => {
                            let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                            let rsp_value: models::RoleDefinition =
                                serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                            Ok(rsp_value)
                        }
                        status_code => {
                            let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                            let rsp_value: models::KeyVaultError =
                                serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                            Err(Error::DefaultResponse {
                                status_code,
                                value: rsp_value,
                            })
                        }
                    }
                })
            }
        }
    }
    pub mod delete {
        use super::{models, API_VERSION};
        #[derive(Debug, thiserror :: Error)]
        pub enum Error {
            #[error("HTTP status code {}", status_code)]
            DefaultResponse {
                status_code: http::StatusCode,
                value: models::KeyVaultError,
            },
            #[error("Failed to parse request URL: {0}")]
            ParseUrl(url::ParseError),
            #[error("Failed to build request: {0}")]
            BuildRequest(http::Error),
            #[error("Failed to serialize request body: {0}")]
            Serialize(serde_json::Error),
            #[error("Failed to get access token: {0}")]
            GetToken(azure_core::Error),
            #[error("Failed to execute request: {0}")]
            SendRequest(azure_core::Error),
            #[error("Failed to get response bytes: {0}")]
            ResponseBytes(azure_core::StreamError),
            #[error("Failed to deserialize response: {0}, body: {1:?}")]
            Deserialize(serde_json::Error, bytes::Bytes),
        }
        #[derive(Clone)]
        pub struct Builder {
            pub(crate) client: super::super::Client,
            pub(crate) scope: String,
            pub(crate) role_definition_name: String,
        }
        impl Builder {
            pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::RoleDefinition, Error>> {
                Box::pin(async move {
                    let url_str = &format!(
                        "{}/{}/providers/Microsoft.Authorization/roleDefinitions/{}",
                        self.client.endpoint(),
                        &self.scope,
                        &self.role_definition_name
                    );
                    let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                    let mut req_builder = http::request::Builder::new();
                    req_builder = req_builder.method(http::Method::DELETE);
                    let credential = self.client.token_credential();
                    let token_response = credential
                        .get_token(&self.client.scopes().join(" "))
                        .await
                        .map_err(Error::GetToken)?;
                    req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                    url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                    let req_body = azure_core::EMPTY_BODY;
                    req_builder = req_builder.uri(url.as_str());
                    let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                    let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                    let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                    match rsp_status {
                        http::StatusCode::OK => {
                            let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                            let rsp_value: models::RoleDefinition =
                                serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                            Ok(rsp_value)
                        }
                        status_code => {
                            let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                            let rsp_value: models::KeyVaultError =
                                serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                            Err(Error::DefaultResponse {
                                status_code,
                                value: rsp_value,
                            })
                        }
                    }
                })
            }
        }
    }
    pub mod list {
        use super::{models, API_VERSION};
        #[derive(Debug, thiserror :: Error)]
        pub enum Error {
            #[error("HTTP status code {}", status_code)]
            DefaultResponse {
                status_code: http::StatusCode,
                value: models::KeyVaultError,
            },
            #[error("Failed to parse request URL: {0}")]
            ParseUrl(url::ParseError),
            #[error("Failed to build request: {0}")]
            BuildRequest(http::Error),
            #[error("Failed to serialize request body: {0}")]
            Serialize(serde_json::Error),
            #[error("Failed to get access token: {0}")]
            GetToken(azure_core::Error),
            #[error("Failed to execute request: {0}")]
            SendRequest(azure_core::Error),
            #[error("Failed to get response bytes: {0}")]
            ResponseBytes(azure_core::StreamError),
            #[error("Failed to deserialize response: {0}, body: {1:?}")]
            Deserialize(serde_json::Error, bytes::Bytes),
        }
        #[derive(Clone)]
        pub struct Builder {
            pub(crate) client: super::super::Client,
            pub(crate) scope: String,
            pub(crate) filter: Option<String>,
        }
        impl Builder {
            pub fn filter(mut self, filter: impl Into<String>) -> Self {
                self.filter = Some(filter.into());
                self
            }
            pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::RoleDefinitionListResult, Error>> {
                Box::pin(async move {
                    let url_str = &format!(
                        "{}/{}/providers/Microsoft.Authorization/roleDefinitions",
                        self.client.endpoint(),
                        &self.scope
                    );
                    let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                    let mut req_builder = http::request::Builder::new();
                    req_builder = req_builder.method(http::Method::GET);
                    let credential = self.client.token_credential();
                    let token_response = credential
                        .get_token(&self.client.scopes().join(" "))
                        .await
                        .map_err(Error::GetToken)?;
                    req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                    url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                    if let Some(filter) = &self.filter {
                        url.query_pairs_mut().append_pair("$filter", filter);
                    }
                    let req_body = azure_core::EMPTY_BODY;
                    req_builder = req_builder.uri(url.as_str());
                    let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                    let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                    let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                    match rsp_status {
                        http::StatusCode::OK => {
                            let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                            let rsp_value: models::RoleDefinitionListResult =
                                serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                            Ok(rsp_value)
                        }
                        status_code => {
                            let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                            let rsp_value: models::KeyVaultError =
                                serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                            Err(Error::DefaultResponse {
                                status_code,
                                value: rsp_value,
                            })
                        }
                    }
                })
            }
        }
    }
}
pub mod role_assignments {
    use super::{models, API_VERSION};
    pub struct Client(pub(crate) super::Client);
    impl Client {
        pub fn get(&self, scope: impl Into<String>, role_assignment_name: impl Into<String>) -> get::Builder {
            get::Builder {
                client: self.0.clone(),
                scope: scope.into(),
                role_assignment_name: role_assignment_name.into(),
            }
        }
        pub fn create(
            &self,
            scope: impl Into<String>,
            role_assignment_name: impl Into<String>,
            parameters: impl Into<models::RoleAssignmentCreateParameters>,
        ) -> create::Builder {
            create::Builder {
                client: self.0.clone(),
                scope: scope.into(),
                role_assignment_name: role_assignment_name.into(),
                parameters: parameters.into(),
            }
        }
        pub fn delete(&self, scope: impl Into<String>, role_assignment_name: impl Into<String>) -> delete::Builder {
            delete::Builder {
                client: self.0.clone(),
                scope: scope.into(),
                role_assignment_name: role_assignment_name.into(),
            }
        }
        pub fn list_for_scope(&self, scope: impl Into<String>) -> list_for_scope::Builder {
            list_for_scope::Builder {
                client: self.0.clone(),
                scope: scope.into(),
                filter: None,
            }
        }
    }
    pub mod get {
        use super::{models, API_VERSION};
        #[derive(Debug, thiserror :: Error)]
        pub enum Error {
            #[error("HTTP status code {}", status_code)]
            DefaultResponse {
                status_code: http::StatusCode,
                value: models::KeyVaultError,
            },
            #[error("Failed to parse request URL: {0}")]
            ParseUrl(url::ParseError),
            #[error("Failed to build request: {0}")]
            BuildRequest(http::Error),
            #[error("Failed to serialize request body: {0}")]
            Serialize(serde_json::Error),
            #[error("Failed to get access token: {0}")]
            GetToken(azure_core::Error),
            #[error("Failed to execute request: {0}")]
            SendRequest(azure_core::Error),
            #[error("Failed to get response bytes: {0}")]
            ResponseBytes(azure_core::StreamError),
            #[error("Failed to deserialize response: {0}, body: {1:?}")]
            Deserialize(serde_json::Error, bytes::Bytes),
        }
        #[derive(Clone)]
        pub struct Builder {
            pub(crate) client: super::super::Client,
            pub(crate) scope: String,
            pub(crate) role_assignment_name: String,
        }
        impl Builder {
            pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::RoleAssignment, Error>> {
                Box::pin(async move {
                    let url_str = &format!(
                        "{}/{}/providers/Microsoft.Authorization/roleAssignments/{}",
                        self.client.endpoint(),
                        &self.scope,
                        &self.role_assignment_name
                    );
                    let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                    let mut req_builder = http::request::Builder::new();
                    req_builder = req_builder.method(http::Method::GET);
                    let credential = self.client.token_credential();
                    let token_response = credential
                        .get_token(&self.client.scopes().join(" "))
                        .await
                        .map_err(Error::GetToken)?;
                    req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                    url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                    let req_body = azure_core::EMPTY_BODY;
                    req_builder = req_builder.uri(url.as_str());
                    let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                    let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                    let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                    match rsp_status {
                        http::StatusCode::OK => {
                            let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                            let rsp_value: models::RoleAssignment =
                                serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                            Ok(rsp_value)
                        }
                        status_code => {
                            let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                            let rsp_value: models::KeyVaultError =
                                serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                            Err(Error::DefaultResponse {
                                status_code,
                                value: rsp_value,
                            })
                        }
                    }
                })
            }
        }
    }
    pub mod create {
        use super::{models, API_VERSION};
        #[derive(Debug, thiserror :: Error)]
        pub enum Error {
            #[error("HTTP status code {}", status_code)]
            DefaultResponse {
                status_code: http::StatusCode,
                value: models::KeyVaultError,
            },
            #[error("Failed to parse request URL: {0}")]
            ParseUrl(url::ParseError),
            #[error("Failed to build request: {0}")]
            BuildRequest(http::Error),
            #[error("Failed to serialize request body: {0}")]
            Serialize(serde_json::Error),
            #[error("Failed to get access token: {0}")]
            GetToken(azure_core::Error),
            #[error("Failed to execute request: {0}")]
            SendRequest(azure_core::Error),
            #[error("Failed to get response bytes: {0}")]
            ResponseBytes(azure_core::StreamError),
            #[error("Failed to deserialize response: {0}, body: {1:?}")]
            Deserialize(serde_json::Error, bytes::Bytes),
        }
        #[derive(Clone)]
        pub struct Builder {
            pub(crate) client: super::super::Client,
            pub(crate) scope: String,
            pub(crate) role_assignment_name: String,
            pub(crate) parameters: models::RoleAssignmentCreateParameters,
        }
        impl Builder {
            pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::RoleAssignment, Error>> {
                Box::pin(async move {
                    let url_str = &format!(
                        "{}/{}/providers/Microsoft.Authorization/roleAssignments/{}",
                        self.client.endpoint(),
                        &self.scope,
                        &self.role_assignment_name
                    );
                    let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                    let mut req_builder = http::request::Builder::new();
                    req_builder = req_builder.method(http::Method::PUT);
                    let credential = self.client.token_credential();
                    let token_response = credential
                        .get_token(&self.client.scopes().join(" "))
                        .await
                        .map_err(Error::GetToken)?;
                    req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                    url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                    req_builder = req_builder.header("content-type", "application/json");
                    let req_body = azure_core::to_json(&self.parameters).map_err(Error::Serialize)?;
                    req_builder = req_builder.uri(url.as_str());
                    let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                    let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                    let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                    match rsp_status {
                        http::StatusCode::CREATED => {
                            let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                            let rsp_value: models::RoleAssignment =
                                serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                            Ok(rsp_value)
                        }
                        status_code => {
                            let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                            let rsp_value: models::KeyVaultError =
                                serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                            Err(Error::DefaultResponse {
                                status_code,
                                value: rsp_value,
                            })
                        }
                    }
                })
            }
        }
    }
    pub mod delete {
        use super::{models, API_VERSION};
        #[derive(Debug, thiserror :: Error)]
        pub enum Error {
            #[error("HTTP status code {}", status_code)]
            DefaultResponse {
                status_code: http::StatusCode,
                value: models::KeyVaultError,
            },
            #[error("Failed to parse request URL: {0}")]
            ParseUrl(url::ParseError),
            #[error("Failed to build request: {0}")]
            BuildRequest(http::Error),
            #[error("Failed to serialize request body: {0}")]
            Serialize(serde_json::Error),
            #[error("Failed to get access token: {0}")]
            GetToken(azure_core::Error),
            #[error("Failed to execute request: {0}")]
            SendRequest(azure_core::Error),
            #[error("Failed to get response bytes: {0}")]
            ResponseBytes(azure_core::StreamError),
            #[error("Failed to deserialize response: {0}, body: {1:?}")]
            Deserialize(serde_json::Error, bytes::Bytes),
        }
        #[derive(Clone)]
        pub struct Builder {
            pub(crate) client: super::super::Client,
            pub(crate) scope: String,
            pub(crate) role_assignment_name: String,
        }
        impl Builder {
            pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::RoleAssignment, Error>> {
                Box::pin(async move {
                    let url_str = &format!(
                        "{}/{}/providers/Microsoft.Authorization/roleAssignments/{}",
                        self.client.endpoint(),
                        &self.scope,
                        &self.role_assignment_name
                    );
                    let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                    let mut req_builder = http::request::Builder::new();
                    req_builder = req_builder.method(http::Method::DELETE);
                    let credential = self.client.token_credential();
                    let token_response = credential
                        .get_token(&self.client.scopes().join(" "))
                        .await
                        .map_err(Error::GetToken)?;
                    req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                    url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                    let req_body = azure_core::EMPTY_BODY;
                    req_builder = req_builder.uri(url.as_str());
                    let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                    let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                    let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                    match rsp_status {
                        http::StatusCode::OK => {
                            let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                            let rsp_value: models::RoleAssignment =
                                serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                            Ok(rsp_value)
                        }
                        status_code => {
                            let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                            let rsp_value: models::KeyVaultError =
                                serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                            Err(Error::DefaultResponse {
                                status_code,
                                value: rsp_value,
                            })
                        }
                    }
                })
            }
        }
    }
    pub mod list_for_scope {
        use super::{models, API_VERSION};
        #[derive(Debug, thiserror :: Error)]
        pub enum Error {
            #[error("HTTP status code {}", status_code)]
            DefaultResponse {
                status_code: http::StatusCode,
                value: models::KeyVaultError,
            },
            #[error("Failed to parse request URL: {0}")]
            ParseUrl(url::ParseError),
            #[error("Failed to build request: {0}")]
            BuildRequest(http::Error),
            #[error("Failed to serialize request body: {0}")]
            Serialize(serde_json::Error),
            #[error("Failed to get access token: {0}")]
            GetToken(azure_core::Error),
            #[error("Failed to execute request: {0}")]
            SendRequest(azure_core::Error),
            #[error("Failed to get response bytes: {0}")]
            ResponseBytes(azure_core::StreamError),
            #[error("Failed to deserialize response: {0}, body: {1:?}")]
            Deserialize(serde_json::Error, bytes::Bytes),
        }
        #[derive(Clone)]
        pub struct Builder {
            pub(crate) client: super::super::Client,
            pub(crate) scope: String,
            pub(crate) filter: Option<String>,
        }
        impl Builder {
            pub fn filter(mut self, filter: impl Into<String>) -> Self {
                self.filter = Some(filter.into());
                self
            }
            pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::RoleAssignmentListResult, Error>> {
                Box::pin(async move {
                    let url_str = &format!(
                        "{}/{}/providers/Microsoft.Authorization/roleAssignments",
                        self.client.endpoint(),
                        &self.scope
                    );
                    let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                    let mut req_builder = http::request::Builder::new();
                    req_builder = req_builder.method(http::Method::GET);
                    let credential = self.client.token_credential();
                    let token_response = credential
                        .get_token(&self.client.scopes().join(" "))
                        .await
                        .map_err(Error::GetToken)?;
                    req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                    url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                    if let Some(filter) = &self.filter {
                        url.query_pairs_mut().append_pair("$filter", filter);
                    }
                    let req_body = azure_core::EMPTY_BODY;
                    req_builder = req_builder.uri(url.as_str());
                    let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                    let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                    let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                    match rsp_status {
                        http::StatusCode::OK => {
                            let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                            let rsp_value: models::RoleAssignmentListResult =
                                serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                            Ok(rsp_value)
                        }
                        status_code => {
                            let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                            let rsp_value: models::KeyVaultError =
                                serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                            Err(Error::DefaultResponse {
                                status_code,
                                value: rsp_value,
                            })
                        }
                    }
                })
            }
        }
    }
}
pub mod hsm_security_domain {
    use super::{models, API_VERSION};
    pub struct Client(pub(crate) super::Client);
    impl Client {
        pub fn download_pending(&self) -> download_pending::Builder {
            download_pending::Builder { client: self.0.clone() }
        }
        pub fn download(&self, certificate_info_object: impl Into<models::CertificateInfoObject>) -> download::Builder {
            download::Builder {
                client: self.0.clone(),
                certificate_info_object: certificate_info_object.into(),
            }
        }
        pub fn transfer_key(&self) -> transfer_key::Builder {
            transfer_key::Builder { client: self.0.clone() }
        }
        pub fn upload(&self, security_domain: impl Into<models::SecurityDomainObject>) -> upload::Builder {
            upload::Builder {
                client: self.0.clone(),
                security_domain: security_domain.into(),
            }
        }
        pub fn upload_pending(&self) -> upload_pending::Builder {
            upload_pending::Builder { client: self.0.clone() }
        }
    }
    pub mod download_pending {
        use super::{models, API_VERSION};
        #[derive(Debug, thiserror :: Error)]
        pub enum Error {
            #[error("HTTP status code {}", status_code)]
            DefaultResponse {
                status_code: http::StatusCode,
                value: models::KeyVaultError,
            },
            #[error("Failed to parse request URL: {0}")]
            ParseUrl(url::ParseError),
            #[error("Failed to build request: {0}")]
            BuildRequest(http::Error),
            #[error("Failed to serialize request body: {0}")]
            Serialize(serde_json::Error),
            #[error("Failed to get access token: {0}")]
            GetToken(azure_core::Error),
            #[error("Failed to execute request: {0}")]
            SendRequest(azure_core::Error),
            #[error("Failed to get response bytes: {0}")]
            ResponseBytes(azure_core::StreamError),
            #[error("Failed to deserialize response: {0}, body: {1:?}")]
            Deserialize(serde_json::Error, bytes::Bytes),
        }
        #[derive(Clone)]
        pub struct Builder {
            pub(crate) client: super::super::Client,
        }
        impl Builder {
            pub fn into_future(
                self,
            ) -> futures::future::BoxFuture<'static, std::result::Result<models::SecurityDomainOperationStatus, Error>> {
                Box::pin(async move {
                    let url_str = &format!("{}/securitydomain/download/pending", self.client.endpoint(),);
                    let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                    let mut req_builder = http::request::Builder::new();
                    req_builder = req_builder.method(http::Method::GET);
                    let credential = self.client.token_credential();
                    let token_response = credential
                        .get_token(&self.client.scopes().join(" "))
                        .await
                        .map_err(Error::GetToken)?;
                    req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                    let req_body = azure_core::EMPTY_BODY;
                    req_builder = req_builder.uri(url.as_str());
                    let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                    let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                    let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                    match rsp_status {
                        http::StatusCode::OK => {
                            let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                            let rsp_value: models::SecurityDomainOperationStatus =
                                serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                            Ok(rsp_value)
                        }
                        status_code => {
                            let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                            let rsp_value: models::KeyVaultError =
                                serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                            Err(Error::DefaultResponse {
                                status_code,
                                value: rsp_value,
                            })
                        }
                    }
                })
            }
        }
    }
    pub mod download {
        use super::{models, API_VERSION};
        #[derive(Debug, thiserror :: Error)]
        pub enum Error {
            #[error("HTTP status code {}", status_code)]
            DefaultResponse {
                status_code: http::StatusCode,
                value: models::KeyVaultError,
            },
            #[error("Failed to parse request URL: {0}")]
            ParseUrl(url::ParseError),
            #[error("Failed to build request: {0}")]
            BuildRequest(http::Error),
            #[error("Failed to serialize request body: {0}")]
            Serialize(serde_json::Error),
            #[error("Failed to get access token: {0}")]
            GetToken(azure_core::Error),
            #[error("Failed to execute request: {0}")]
            SendRequest(azure_core::Error),
            #[error("Failed to get response bytes: {0}")]
            ResponseBytes(azure_core::StreamError),
            #[error("Failed to deserialize response: {0}, body: {1:?}")]
            Deserialize(serde_json::Error, bytes::Bytes),
        }
        #[derive(Clone)]
        pub struct Builder {
            pub(crate) client: super::super::Client,
            pub(crate) certificate_info_object: models::CertificateInfoObject,
        }
        impl Builder {
            pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::SecurityDomainObject, Error>> {
                Box::pin(async move {
                    let url_str = &format!("{}/securitydomain/download", self.client.endpoint(),);
                    let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                    let mut req_builder = http::request::Builder::new();
                    req_builder = req_builder.method(http::Method::POST);
                    let credential = self.client.token_credential();
                    let token_response = credential
                        .get_token(&self.client.scopes().join(" "))
                        .await
                        .map_err(Error::GetToken)?;
                    req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                    url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                    req_builder = req_builder.header("content-type", "application/json");
                    let req_body = azure_core::to_json(&self.certificate_info_object).map_err(Error::Serialize)?;
                    req_builder = req_builder.uri(url.as_str());
                    let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                    let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                    let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                    match rsp_status {
                        http::StatusCode::ACCEPTED => {
                            let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                            let rsp_value: models::SecurityDomainObject =
                                serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                            Ok(rsp_value)
                        }
                        status_code => {
                            let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                            let rsp_value: models::KeyVaultError =
                                serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                            Err(Error::DefaultResponse {
                                status_code,
                                value: rsp_value,
                            })
                        }
                    }
                })
            }
        }
    }
    pub mod transfer_key {
        use super::{models, API_VERSION};
        #[derive(Debug, thiserror :: Error)]
        pub enum Error {
            #[error("HTTP status code {}", status_code)]
            DefaultResponse {
                status_code: http::StatusCode,
                value: models::KeyVaultError,
            },
            #[error("Failed to parse request URL: {0}")]
            ParseUrl(url::ParseError),
            #[error("Failed to build request: {0}")]
            BuildRequest(http::Error),
            #[error("Failed to serialize request body: {0}")]
            Serialize(serde_json::Error),
            #[error("Failed to get access token: {0}")]
            GetToken(azure_core::Error),
            #[error("Failed to execute request: {0}")]
            SendRequest(azure_core::Error),
            #[error("Failed to get response bytes: {0}")]
            ResponseBytes(azure_core::StreamError),
            #[error("Failed to deserialize response: {0}, body: {1:?}")]
            Deserialize(serde_json::Error, bytes::Bytes),
        }
        #[derive(Clone)]
        pub struct Builder {
            pub(crate) client: super::super::Client,
        }
        impl Builder {
            pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<models::TransferKey, Error>> {
                Box::pin(async move {
                    let url_str = &format!("{}/securitydomain/upload", self.client.endpoint(),);
                    let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                    let mut req_builder = http::request::Builder::new();
                    req_builder = req_builder.method(http::Method::GET);
                    let credential = self.client.token_credential();
                    let token_response = credential
                        .get_token(&self.client.scopes().join(" "))
                        .await
                        .map_err(Error::GetToken)?;
                    req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                    url.query_pairs_mut().append_pair("api-version", super::API_VERSION);
                    let req_body = azure_core::EMPTY_BODY;
                    req_builder = req_builder.uri(url.as_str());
                    let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                    let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                    let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                    match rsp_status {
                        http::StatusCode::OK => {
                            let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                            let rsp_value: models::TransferKey =
                                serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                            Ok(rsp_value)
                        }
                        status_code => {
                            let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                            let rsp_value: models::KeyVaultError =
                                serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                            Err(Error::DefaultResponse {
                                status_code,
                                value: rsp_value,
                            })
                        }
                    }
                })
            }
        }
    }
    pub mod upload {
        use super::{models, API_VERSION};
        #[derive(Debug)]
        pub enum Response {
            Accepted202(models::SecurityDomainOperationStatus),
            NoContent204,
        }
        #[derive(Debug, thiserror :: Error)]
        pub enum Error {
            #[error("HTTP status code {}", status_code)]
            DefaultResponse {
                status_code: http::StatusCode,
                value: models::KeyVaultError,
            },
            #[error("Failed to parse request URL: {0}")]
            ParseUrl(url::ParseError),
            #[error("Failed to build request: {0}")]
            BuildRequest(http::Error),
            #[error("Failed to serialize request body: {0}")]
            Serialize(serde_json::Error),
            #[error("Failed to get access token: {0}")]
            GetToken(azure_core::Error),
            #[error("Failed to execute request: {0}")]
            SendRequest(azure_core::Error),
            #[error("Failed to get response bytes: {0}")]
            ResponseBytes(azure_core::StreamError),
            #[error("Failed to deserialize response: {0}, body: {1:?}")]
            Deserialize(serde_json::Error, bytes::Bytes),
        }
        #[derive(Clone)]
        pub struct Builder {
            pub(crate) client: super::super::Client,
            pub(crate) security_domain: models::SecurityDomainObject,
        }
        impl Builder {
            pub fn into_future(self) -> futures::future::BoxFuture<'static, std::result::Result<Response, Error>> {
                Box::pin(async move {
                    let url_str = &format!("{}/securitydomain/upload", self.client.endpoint(),);
                    let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                    let mut req_builder = http::request::Builder::new();
                    req_builder = req_builder.method(http::Method::POST);
                    let credential = self.client.token_credential();
                    let token_response = credential
                        .get_token(&self.client.scopes().join(" "))
                        .await
                        .map_err(Error::GetToken)?;
                    req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                    req_builder = req_builder.header("content-type", "application/json");
                    let req_body = azure_core::to_json(&self.security_domain).map_err(Error::Serialize)?;
                    req_builder = req_builder.uri(url.as_str());
                    let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                    let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                    let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                    match rsp_status {
                        http::StatusCode::ACCEPTED => {
                            let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                            let rsp_value: models::SecurityDomainOperationStatus =
                                serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                            Ok(Response::Accepted202(rsp_value))
                        }
                        http::StatusCode::NO_CONTENT => Ok(Response::NoContent204),
                        status_code => {
                            let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                            let rsp_value: models::KeyVaultError =
                                serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                            Err(Error::DefaultResponse {
                                status_code,
                                value: rsp_value,
                            })
                        }
                    }
                })
            }
        }
    }
    pub mod upload_pending {
        use super::{models, API_VERSION};
        #[derive(Debug, thiserror :: Error)]
        pub enum Error {
            #[error("HTTP status code {}", status_code)]
            DefaultResponse {
                status_code: http::StatusCode,
                value: models::KeyVaultError,
            },
            #[error("Failed to parse request URL: {0}")]
            ParseUrl(url::ParseError),
            #[error("Failed to build request: {0}")]
            BuildRequest(http::Error),
            #[error("Failed to serialize request body: {0}")]
            Serialize(serde_json::Error),
            #[error("Failed to get access token: {0}")]
            GetToken(azure_core::Error),
            #[error("Failed to execute request: {0}")]
            SendRequest(azure_core::Error),
            #[error("Failed to get response bytes: {0}")]
            ResponseBytes(azure_core::StreamError),
            #[error("Failed to deserialize response: {0}, body: {1:?}")]
            Deserialize(serde_json::Error, bytes::Bytes),
        }
        #[derive(Clone)]
        pub struct Builder {
            pub(crate) client: super::super::Client,
        }
        impl Builder {
            pub fn into_future(
                self,
            ) -> futures::future::BoxFuture<'static, std::result::Result<models::SecurityDomainOperationStatus, Error>> {
                Box::pin(async move {
                    let url_str = &format!("{}/securitydomain/upload/pending", self.client.endpoint(),);
                    let mut url = url::Url::parse(url_str).map_err(Error::ParseUrl)?;
                    let mut req_builder = http::request::Builder::new();
                    req_builder = req_builder.method(http::Method::GET);
                    let credential = self.client.token_credential();
                    let token_response = credential
                        .get_token(&self.client.scopes().join(" "))
                        .await
                        .map_err(Error::GetToken)?;
                    req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret()));
                    let req_body = azure_core::EMPTY_BODY;
                    req_builder = req_builder.uri(url.as_str());
                    let req = req_builder.body(req_body).map_err(Error::BuildRequest)?;
                    let rsp = self.client.send(req).await.map_err(Error::SendRequest)?;
                    let (rsp_status, rsp_headers, rsp_stream) = rsp.deconstruct();
                    match rsp_status {
                        http::StatusCode::OK => {
                            let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                            let rsp_value: models::SecurityDomainOperationStatus =
                                serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                            Ok(rsp_value)
                        }
                        status_code => {
                            let rsp_body = azure_core::collect_pinned_stream(rsp_stream).await.map_err(Error::ResponseBytes)?;
                            let rsp_value: models::KeyVaultError =
                                serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?;
                            Err(Error::DefaultResponse {
                                status_code,
                                value: rsp_value,
                            })
                        }
                    }
                })
            }
        }
    }
}
