use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct UnstableCreateDashboardPlacementRequestOneOf {
#[serde(
rename = "id",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub id: Option<Option<String>>,
#[serde(rename = "widgetId")]
pub widget_id: String,
#[serde(
rename = "x",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub x: Option<Option<i32>>,
#[serde(
rename = "y",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub y: Option<Option<i32>>,
#[serde(
rename = "width",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub width: Option<Option<i32>>,
#[serde(
rename = "height",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub height: Option<Option<i32>>,
#[serde(rename = "type")]
pub r#type: Type,
}
impl UnstableCreateDashboardPlacementRequestOneOf {
pub fn new(widget_id: String, r#type: Type) -> UnstableCreateDashboardPlacementRequestOneOf {
UnstableCreateDashboardPlacementRequestOneOf {
id: None,
widget_id,
x: None,
y: None,
width: None,
height: None,
r#type,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "widget")]
Widget,
}
impl Default for Type {
fn default() -> Type {
Self::Widget
}
}