azure_security_keyvault_secrets 0.14.0

Rust wrappers around Microsoft Azure REST APIs - Azure Key Vault Secrets
Documentation
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
//
// Code generated by Microsoft (R) Rust Code Generator. DO NOT EDIT.

use super::{
    DeletedSecretProperties, ListDeletedSecretPropertiesResult, ListSecretPropertiesResult,
    RestoreSecretParameters, SecretProperties, SetSecretParameters,
    UpdateSecretPropertiesParameters,
};
use async_trait::async_trait;
use azure_core::{
    http::{pager::Page, RequestContent},
    json::to_json,
    Result,
};

#[async_trait]
impl Page for ListDeletedSecretPropertiesResult {
    type Item = DeletedSecretProperties;
    type IntoIter = <Vec<DeletedSecretProperties> as IntoIterator>::IntoIter;
    async fn into_items(self) -> Result<Self::IntoIter> {
        Ok(self.value.into_iter())
    }
}

#[async_trait]
impl Page for ListSecretPropertiesResult {
    type Item = SecretProperties;
    type IntoIter = <Vec<SecretProperties> as IntoIterator>::IntoIter;
    async fn into_items(self) -> Result<Self::IntoIter> {
        Ok(self.value.into_iter())
    }
}

impl TryFrom<RestoreSecretParameters> for RequestContent<RestoreSecretParameters> {
    type Error = azure_core::Error;
    fn try_from(value: RestoreSecretParameters) -> Result<Self> {
        Ok(to_json(&value)?.into())
    }
}

impl TryFrom<SetSecretParameters> for RequestContent<SetSecretParameters> {
    type Error = azure_core::Error;
    fn try_from(value: SetSecretParameters) -> Result<Self> {
        Ok(to_json(&value)?.into())
    }
}

impl TryFrom<UpdateSecretPropertiesParameters>
    for RequestContent<UpdateSecretPropertiesParameters>
{
    type Error = azure_core::Error;
    fn try_from(value: UpdateSecretPropertiesParameters) -> Result<Self> {
        Ok(to_json(&value)?.into())
    }
}