use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct AwsExternalStorageProviderResponse {
#[serde(rename = "type")]
pub r#type: Type,
#[serde(rename = "account_id")]
pub account_id: String,
#[serde(rename = "region")]
pub region: String,
#[serde(rename = "bucket")]
pub bucket: String,
#[serde(rename = "role_arn")]
pub role_arn: String,
#[serde(rename = "external_id")]
pub external_id: String,
}
impl AwsExternalStorageProviderResponse {
pub fn new(
r#type: Type,
account_id: String,
region: String,
bucket: String,
role_arn: String,
external_id: String,
) -> AwsExternalStorageProviderResponse {
AwsExternalStorageProviderResponse {
r#type,
account_id,
region,
bucket,
role_arn,
external_id,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "aws")]
Aws,
}
impl Default for Type {
fn default() -> Type {
Self::Aws
}
}
impl std::fmt::Display for AwsExternalStorageProviderResponse {
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),
}
}
}