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