use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct AzureExternalStorageProviderParams {
#[serde(rename = "type")]
pub r#type: Type,
#[serde(rename = "tenant_id")]
pub tenant_id: String,
#[serde(rename = "subscription_id")]
pub subscription_id: String,
#[serde(rename = "resource_group")]
pub resource_group: String,
#[serde(rename = "account_name")]
pub account_name: String,
#[serde(rename = "container")]
pub container: String,
}
impl AzureExternalStorageProviderParams {
pub fn new(
r#type: Type,
tenant_id: String,
subscription_id: String,
resource_group: String,
account_name: String,
container: String,
) -> AzureExternalStorageProviderParams {
AzureExternalStorageProviderParams {
r#type,
tenant_id,
subscription_id,
resource_group,
account_name,
container,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "azure")]
Azure,
}
impl Default for Type {
fn default() -> Type {
Self::Azure
}
}
impl std::fmt::Display for AzureExternalStorageProviderParams {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match serde_json::to_string(self) {
Ok(s) => write!(f, "{}", s),
Err(_) => Err(std::fmt::Error),
}
}
}