use std::sync::Arc;
use crate::core::client::{VimClient, Result};
#[derive(Clone)]
pub struct HostVsanInternalSystem {
client: Arc<dyn VimClient>,
mo_id: String,
}
impl HostVsanInternalSystem {
pub fn new(client: Arc<dyn VimClient>, mo_id: &str) -> Self {
Self {
client,
mo_id: mo_id.to_string(),
}
}
pub async fn abdicate_dom_ownership(&self, uuids: &[String]) -> Result<Option<Vec<String>>> {
let input = AbdicateDomOwnershipRequestType {uuids, };
let bytes_opt = self.client.invoke_optional("", "HostVsanInternalSystem", &self.mo_id, "AbdicateDomOwnership", Some(&input)).await?;
match bytes_opt {
Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
None => Ok(None),
}
}
pub async fn can_provision_objects(&self, npbs: &[crate::types::structs::VsanNewPolicyBatch], ignore_satisfiability: Option<bool>) -> Result<Vec<crate::types::structs::VsanPolicySatisfiability>> {
let input = CanProvisionObjectsRequestType {npbs, ignore_satisfiability, };
let bytes = self.client.invoke("", "HostVsanInternalSystem", &self.mo_id, "CanProvisionObjects", Some(&input)).await?;
let result: Vec<crate::types::structs::VsanPolicySatisfiability> = crate::core::client::unmarshal_array(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn delete_vsan_objects(&self, uuids: &[String], force: Option<bool>) -> Result<Vec<crate::types::structs::HostVsanInternalSystemDeleteVsanObjectsResult>> {
let input = DeleteVsanObjectsRequestType {uuids, force, };
let bytes = self.client.invoke("", "HostVsanInternalSystem", &self.mo_id, "DeleteVsanObjects", Some(&input)).await?;
let result: Vec<crate::types::structs::HostVsanInternalSystemDeleteVsanObjectsResult> = crate::core::client::unmarshal_array(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn get_vsan_obj_ext_attrs(&self, uuids: &[String]) -> Result<String> {
let input = GetVsanObjExtAttrsRequestType {uuids, };
let bytes = self.client.invoke("", "HostVsanInternalSystem", &self.mo_id, "GetVsanObjExtAttrs", Some(&input)).await?;
let result: String = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn query_cmmds(&self, queries: &[crate::types::structs::HostVsanInternalSystemCmmdsQuery]) -> Result<String> {
let input = QueryCmmdsRequestType {queries, };
let bytes = self.client.invoke("", "HostVsanInternalSystem", &self.mo_id, "QueryCmmds", Some(&input)).await?;
let result: String = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn query_objects_on_physical_vsan_disk(&self, disks: &[String]) -> Result<String> {
let input = QueryObjectsOnPhysicalVsanDiskRequestType {disks, };
let bytes = self.client.invoke("", "HostVsanInternalSystem", &self.mo_id, "QueryObjectsOnPhysicalVsanDisk", Some(&input)).await?;
let result: String = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn query_physical_vsan_disks(&self, props: Option<&[String]>) -> Result<String> {
let input = QueryPhysicalVsanDisksRequestType {props, };
let bytes = self.client.invoke("", "HostVsanInternalSystem", &self.mo_id, "QueryPhysicalVsanDisks", Some(&input)).await?;
let result: String = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn query_syncing_vsan_objects(&self, uuids: Option<&[String]>) -> Result<String> {
let input = QuerySyncingVsanObjectsRequestType {uuids, };
let bytes = self.client.invoke("", "HostVsanInternalSystem", &self.mo_id, "QuerySyncingVsanObjects", Some(&input)).await?;
let result: String = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn query_vsan_object_uuids_by_filter(&self, uuids: Option<&[String]>, limit: Option<i32>, version: Option<i32>) -> Result<Option<Vec<String>>> {
let input = QueryVsanObjectUuidsByFilterRequestType {uuids, limit, version, };
let bytes_opt = self.client.invoke_optional("", "HostVsanInternalSystem", &self.mo_id, "QueryVsanObjectUuidsByFilter", Some(&input)).await?;
match bytes_opt {
Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
None => Ok(None),
}
}
pub async fn query_vsan_objects(&self, uuids: Option<&[String]>) -> Result<String> {
let input = QueryVsanObjectsRequestType {uuids, };
let bytes = self.client.invoke("", "HostVsanInternalSystem", &self.mo_id, "QueryVsanObjects", Some(&input)).await?;
let result: String = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn query_vsan_statistics(&self, labels: &[String]) -> Result<String> {
let input = QueryVsanStatisticsRequestType {labels, };
let bytes = self.client.invoke("", "HostVsanInternalSystem", &self.mo_id, "QueryVsanStatistics", Some(&input)).await?;
let result: String = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn reconfiguration_satisfiable(&self, pcbs: &[crate::types::structs::VsanPolicyChangeBatch], ignore_satisfiability: Option<bool>) -> Result<Vec<crate::types::structs::VsanPolicySatisfiability>> {
let input = ReconfigurationSatisfiableRequestType {pcbs, ignore_satisfiability, };
let bytes = self.client.invoke("", "HostVsanInternalSystem", &self.mo_id, "ReconfigurationSatisfiable", Some(&input)).await?;
let result: Vec<crate::types::structs::VsanPolicySatisfiability> = crate::core::client::unmarshal_array(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn reconfigure_dom_object(&self, uuid: &str, policy: &str) -> Result<()> {
let input = ReconfigureDomObjectRequestType {uuid, policy, };
self.client.invoke_void("", "HostVsanInternalSystem", &self.mo_id, "ReconfigureDomObject", Some(&input)).await
}
pub async fn run_vsan_physical_disk_diagnostics(&self, disks: Option<&[String]>) -> Result<Vec<crate::types::structs::HostVsanInternalSystemVsanPhysicalDiskDiagnosticsResult>> {
let input = RunVsanPhysicalDiskDiagnosticsRequestType {disks, };
let bytes = self.client.invoke("", "HostVsanInternalSystem", &self.mo_id, "RunVsanPhysicalDiskDiagnostics", Some(&input)).await?;
let result: Vec<crate::types::structs::HostVsanInternalSystemVsanPhysicalDiskDiagnosticsResult> = crate::core::client::unmarshal_array(self.client.transport(), &bytes)?;
Ok(result)
}
pub async fn upgrade_vsan_objects(&self, uuids: &[String], new_version: i32) -> Result<Option<Vec<crate::types::structs::HostVsanInternalSystemVsanObjectOperationResult>>> {
let input = UpgradeVsanObjectsRequestType {uuids, new_version, };
let bytes_opt = self.client.invoke_optional("", "HostVsanInternalSystem", &self.mo_id, "UpgradeVsanObjects", Some(&input)).await?;
match bytes_opt {
Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
None => Ok(None),
}
}
}
struct AbdicateDomOwnershipRequestType<'a> {
uuids: &'a [String],
}
impl<'a> miniserde::Serialize for AbdicateDomOwnershipRequestType<'a> {
fn begin(&self) -> miniserde::ser::Fragment<'_> {
miniserde::ser::Fragment::Map(Box::new(AbdicateDomOwnershipRequestTypeSer { data: self, seq: 0 }))
}
}
struct AbdicateDomOwnershipRequestTypeSer<'b, 'a> {
data: &'b AbdicateDomOwnershipRequestType<'a>,
seq: usize,
}
impl<'b, 'a> miniserde::ser::Map for AbdicateDomOwnershipRequestTypeSer<'b, 'a> {
fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
let seq = self.seq;
self.seq += 1;
match seq {
0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"AbdicateDomOwnershipRequestType")),
1 => return Some((std::borrow::Cow::Borrowed("uuids"), &self.data.uuids as &dyn miniserde::Serialize)),
_ => return None,
}
}
}
struct CanProvisionObjectsRequestType<'a> {
npbs: &'a [crate::types::structs::VsanNewPolicyBatch],
ignore_satisfiability: Option<bool>,
}
impl<'a> miniserde::Serialize for CanProvisionObjectsRequestType<'a> {
fn begin(&self) -> miniserde::ser::Fragment<'_> {
miniserde::ser::Fragment::Map(Box::new(CanProvisionObjectsRequestTypeSer { data: self, seq: 0 }))
}
}
struct CanProvisionObjectsRequestTypeSer<'b, 'a> {
data: &'b CanProvisionObjectsRequestType<'a>,
seq: usize,
}
impl<'b, 'a> miniserde::ser::Map for CanProvisionObjectsRequestTypeSer<'b, 'a> {
fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
loop {
let seq = self.seq;
self.seq += 1;
match seq {
0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"CanProvisionObjectsRequestType")),
1 => return Some((std::borrow::Cow::Borrowed("npbs"), &self.data.npbs as &dyn miniserde::Serialize)),
2 => {
let Some(ref val) = self.data.ignore_satisfiability else { continue; };
return Some((std::borrow::Cow::Borrowed("ignoreSatisfiability"), val as &dyn miniserde::Serialize));
}
_ => return None,
}
}
}
}
struct DeleteVsanObjectsRequestType<'a> {
uuids: &'a [String],
force: Option<bool>,
}
impl<'a> miniserde::Serialize for DeleteVsanObjectsRequestType<'a> {
fn begin(&self) -> miniserde::ser::Fragment<'_> {
miniserde::ser::Fragment::Map(Box::new(DeleteVsanObjectsRequestTypeSer { data: self, seq: 0 }))
}
}
struct DeleteVsanObjectsRequestTypeSer<'b, 'a> {
data: &'b DeleteVsanObjectsRequestType<'a>,
seq: usize,
}
impl<'b, 'a> miniserde::ser::Map for DeleteVsanObjectsRequestTypeSer<'b, 'a> {
fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
loop {
let seq = self.seq;
self.seq += 1;
match seq {
0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"DeleteVsanObjectsRequestType")),
1 => return Some((std::borrow::Cow::Borrowed("uuids"), &self.data.uuids as &dyn miniserde::Serialize)),
2 => {
let Some(ref val) = self.data.force else { continue; };
return Some((std::borrow::Cow::Borrowed("force"), val as &dyn miniserde::Serialize));
}
_ => return None,
}
}
}
}
struct GetVsanObjExtAttrsRequestType<'a> {
uuids: &'a [String],
}
impl<'a> miniserde::Serialize for GetVsanObjExtAttrsRequestType<'a> {
fn begin(&self) -> miniserde::ser::Fragment<'_> {
miniserde::ser::Fragment::Map(Box::new(GetVsanObjExtAttrsRequestTypeSer { data: self, seq: 0 }))
}
}
struct GetVsanObjExtAttrsRequestTypeSer<'b, 'a> {
data: &'b GetVsanObjExtAttrsRequestType<'a>,
seq: usize,
}
impl<'b, 'a> miniserde::ser::Map for GetVsanObjExtAttrsRequestTypeSer<'b, 'a> {
fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
let seq = self.seq;
self.seq += 1;
match seq {
0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"GetVsanObjExtAttrsRequestType")),
1 => return Some((std::borrow::Cow::Borrowed("uuids"), &self.data.uuids as &dyn miniserde::Serialize)),
_ => return None,
}
}
}
struct QueryCmmdsRequestType<'a> {
queries: &'a [crate::types::structs::HostVsanInternalSystemCmmdsQuery],
}
impl<'a> miniserde::Serialize for QueryCmmdsRequestType<'a> {
fn begin(&self) -> miniserde::ser::Fragment<'_> {
miniserde::ser::Fragment::Map(Box::new(QueryCmmdsRequestTypeSer { data: self, seq: 0 }))
}
}
struct QueryCmmdsRequestTypeSer<'b, 'a> {
data: &'b QueryCmmdsRequestType<'a>,
seq: usize,
}
impl<'b, 'a> miniserde::ser::Map for QueryCmmdsRequestTypeSer<'b, 'a> {
fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
let seq = self.seq;
self.seq += 1;
match seq {
0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"QueryCmmdsRequestType")),
1 => return Some((std::borrow::Cow::Borrowed("queries"), &self.data.queries as &dyn miniserde::Serialize)),
_ => return None,
}
}
}
struct QueryObjectsOnPhysicalVsanDiskRequestType<'a> {
disks: &'a [String],
}
impl<'a> miniserde::Serialize for QueryObjectsOnPhysicalVsanDiskRequestType<'a> {
fn begin(&self) -> miniserde::ser::Fragment<'_> {
miniserde::ser::Fragment::Map(Box::new(QueryObjectsOnPhysicalVsanDiskRequestTypeSer { data: self, seq: 0 }))
}
}
struct QueryObjectsOnPhysicalVsanDiskRequestTypeSer<'b, 'a> {
data: &'b QueryObjectsOnPhysicalVsanDiskRequestType<'a>,
seq: usize,
}
impl<'b, 'a> miniserde::ser::Map for QueryObjectsOnPhysicalVsanDiskRequestTypeSer<'b, 'a> {
fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
let seq = self.seq;
self.seq += 1;
match seq {
0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"QueryObjectsOnPhysicalVsanDiskRequestType")),
1 => return Some((std::borrow::Cow::Borrowed("disks"), &self.data.disks as &dyn miniserde::Serialize)),
_ => return None,
}
}
}
struct QueryPhysicalVsanDisksRequestType<'a> {
props: Option<&'a [String]>,
}
impl<'a> miniserde::Serialize for QueryPhysicalVsanDisksRequestType<'a> {
fn begin(&self) -> miniserde::ser::Fragment<'_> {
miniserde::ser::Fragment::Map(Box::new(QueryPhysicalVsanDisksRequestTypeSer { data: self, seq: 0 }))
}
}
struct QueryPhysicalVsanDisksRequestTypeSer<'b, 'a> {
data: &'b QueryPhysicalVsanDisksRequestType<'a>,
seq: usize,
}
impl<'b, 'a> miniserde::ser::Map for QueryPhysicalVsanDisksRequestTypeSer<'b, 'a> {
fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
loop {
let seq = self.seq;
self.seq += 1;
match seq {
0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"QueryPhysicalVsanDisksRequestType")),
1 => {
let Some(ref val) = self.data.props else { continue; };
return Some((std::borrow::Cow::Borrowed("props"), val as &dyn miniserde::Serialize));
}
_ => return None,
}
}
}
}
struct QuerySyncingVsanObjectsRequestType<'a> {
uuids: Option<&'a [String]>,
}
impl<'a> miniserde::Serialize for QuerySyncingVsanObjectsRequestType<'a> {
fn begin(&self) -> miniserde::ser::Fragment<'_> {
miniserde::ser::Fragment::Map(Box::new(QuerySyncingVsanObjectsRequestTypeSer { data: self, seq: 0 }))
}
}
struct QuerySyncingVsanObjectsRequestTypeSer<'b, 'a> {
data: &'b QuerySyncingVsanObjectsRequestType<'a>,
seq: usize,
}
impl<'b, 'a> miniserde::ser::Map for QuerySyncingVsanObjectsRequestTypeSer<'b, 'a> {
fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
loop {
let seq = self.seq;
self.seq += 1;
match seq {
0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"QuerySyncingVsanObjectsRequestType")),
1 => {
let Some(ref val) = self.data.uuids else { continue; };
return Some((std::borrow::Cow::Borrowed("uuids"), val as &dyn miniserde::Serialize));
}
_ => return None,
}
}
}
}
struct QueryVsanObjectUuidsByFilterRequestType<'a> {
uuids: Option<&'a [String]>,
limit: Option<i32>,
version: Option<i32>,
}
impl<'a> miniserde::Serialize for QueryVsanObjectUuidsByFilterRequestType<'a> {
fn begin(&self) -> miniserde::ser::Fragment<'_> {
miniserde::ser::Fragment::Map(Box::new(QueryVsanObjectUuidsByFilterRequestTypeSer { data: self, seq: 0 }))
}
}
struct QueryVsanObjectUuidsByFilterRequestTypeSer<'b, 'a> {
data: &'b QueryVsanObjectUuidsByFilterRequestType<'a>,
seq: usize,
}
impl<'b, 'a> miniserde::ser::Map for QueryVsanObjectUuidsByFilterRequestTypeSer<'b, 'a> {
fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
loop {
let seq = self.seq;
self.seq += 1;
match seq {
0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"QueryVsanObjectUuidsByFilterRequestType")),
1 => {
let Some(ref val) = self.data.uuids else { continue; };
return Some((std::borrow::Cow::Borrowed("uuids"), val as &dyn miniserde::Serialize));
}
2 => {
let Some(ref val) = self.data.limit else { continue; };
return Some((std::borrow::Cow::Borrowed("limit"), val as &dyn miniserde::Serialize));
}
3 => {
let Some(ref val) = self.data.version else { continue; };
return Some((std::borrow::Cow::Borrowed("version"), val as &dyn miniserde::Serialize));
}
_ => return None,
}
}
}
}
struct QueryVsanObjectsRequestType<'a> {
uuids: Option<&'a [String]>,
}
impl<'a> miniserde::Serialize for QueryVsanObjectsRequestType<'a> {
fn begin(&self) -> miniserde::ser::Fragment<'_> {
miniserde::ser::Fragment::Map(Box::new(QueryVsanObjectsRequestTypeSer { data: self, seq: 0 }))
}
}
struct QueryVsanObjectsRequestTypeSer<'b, 'a> {
data: &'b QueryVsanObjectsRequestType<'a>,
seq: usize,
}
impl<'b, 'a> miniserde::ser::Map for QueryVsanObjectsRequestTypeSer<'b, 'a> {
fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
loop {
let seq = self.seq;
self.seq += 1;
match seq {
0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"QueryVsanObjectsRequestType")),
1 => {
let Some(ref val) = self.data.uuids else { continue; };
return Some((std::borrow::Cow::Borrowed("uuids"), val as &dyn miniserde::Serialize));
}
_ => return None,
}
}
}
}
struct QueryVsanStatisticsRequestType<'a> {
labels: &'a [String],
}
impl<'a> miniserde::Serialize for QueryVsanStatisticsRequestType<'a> {
fn begin(&self) -> miniserde::ser::Fragment<'_> {
miniserde::ser::Fragment::Map(Box::new(QueryVsanStatisticsRequestTypeSer { data: self, seq: 0 }))
}
}
struct QueryVsanStatisticsRequestTypeSer<'b, 'a> {
data: &'b QueryVsanStatisticsRequestType<'a>,
seq: usize,
}
impl<'b, 'a> miniserde::ser::Map for QueryVsanStatisticsRequestTypeSer<'b, 'a> {
fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
let seq = self.seq;
self.seq += 1;
match seq {
0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"QueryVsanStatisticsRequestType")),
1 => return Some((std::borrow::Cow::Borrowed("labels"), &self.data.labels as &dyn miniserde::Serialize)),
_ => return None,
}
}
}
struct ReconfigurationSatisfiableRequestType<'a> {
pcbs: &'a [crate::types::structs::VsanPolicyChangeBatch],
ignore_satisfiability: Option<bool>,
}
impl<'a> miniserde::Serialize for ReconfigurationSatisfiableRequestType<'a> {
fn begin(&self) -> miniserde::ser::Fragment<'_> {
miniserde::ser::Fragment::Map(Box::new(ReconfigurationSatisfiableRequestTypeSer { data: self, seq: 0 }))
}
}
struct ReconfigurationSatisfiableRequestTypeSer<'b, 'a> {
data: &'b ReconfigurationSatisfiableRequestType<'a>,
seq: usize,
}
impl<'b, 'a> miniserde::ser::Map for ReconfigurationSatisfiableRequestTypeSer<'b, 'a> {
fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
loop {
let seq = self.seq;
self.seq += 1;
match seq {
0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"ReconfigurationSatisfiableRequestType")),
1 => return Some((std::borrow::Cow::Borrowed("pcbs"), &self.data.pcbs as &dyn miniserde::Serialize)),
2 => {
let Some(ref val) = self.data.ignore_satisfiability else { continue; };
return Some((std::borrow::Cow::Borrowed("ignoreSatisfiability"), val as &dyn miniserde::Serialize));
}
_ => return None,
}
}
}
}
struct ReconfigureDomObjectRequestType<'a> {
uuid: &'a str,
policy: &'a str,
}
impl<'a> miniserde::Serialize for ReconfigureDomObjectRequestType<'a> {
fn begin(&self) -> miniserde::ser::Fragment<'_> {
miniserde::ser::Fragment::Map(Box::new(ReconfigureDomObjectRequestTypeSer { data: self, seq: 0 }))
}
}
struct ReconfigureDomObjectRequestTypeSer<'b, 'a> {
data: &'b ReconfigureDomObjectRequestType<'a>,
seq: usize,
}
impl<'b, 'a> miniserde::ser::Map for ReconfigureDomObjectRequestTypeSer<'b, 'a> {
fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
let seq = self.seq;
self.seq += 1;
match seq {
0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"ReconfigureDomObjectRequestType")),
1 => return Some((std::borrow::Cow::Borrowed("uuid"), &self.data.uuid as &dyn miniserde::Serialize)),
2 => return Some((std::borrow::Cow::Borrowed("policy"), &self.data.policy as &dyn miniserde::Serialize)),
_ => return None,
}
}
}
struct RunVsanPhysicalDiskDiagnosticsRequestType<'a> {
disks: Option<&'a [String]>,
}
impl<'a> miniserde::Serialize for RunVsanPhysicalDiskDiagnosticsRequestType<'a> {
fn begin(&self) -> miniserde::ser::Fragment<'_> {
miniserde::ser::Fragment::Map(Box::new(RunVsanPhysicalDiskDiagnosticsRequestTypeSer { data: self, seq: 0 }))
}
}
struct RunVsanPhysicalDiskDiagnosticsRequestTypeSer<'b, 'a> {
data: &'b RunVsanPhysicalDiskDiagnosticsRequestType<'a>,
seq: usize,
}
impl<'b, 'a> miniserde::ser::Map for RunVsanPhysicalDiskDiagnosticsRequestTypeSer<'b, 'a> {
fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
loop {
let seq = self.seq;
self.seq += 1;
match seq {
0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"RunVsanPhysicalDiskDiagnosticsRequestType")),
1 => {
let Some(ref val) = self.data.disks else { continue; };
return Some((std::borrow::Cow::Borrowed("disks"), val as &dyn miniserde::Serialize));
}
_ => return None,
}
}
}
}
struct UpgradeVsanObjectsRequestType<'a> {
uuids: &'a [String],
new_version: i32,
}
impl<'a> miniserde::Serialize for UpgradeVsanObjectsRequestType<'a> {
fn begin(&self) -> miniserde::ser::Fragment<'_> {
miniserde::ser::Fragment::Map(Box::new(UpgradeVsanObjectsRequestTypeSer { data: self, seq: 0 }))
}
}
struct UpgradeVsanObjectsRequestTypeSer<'b, 'a> {
data: &'b UpgradeVsanObjectsRequestType<'a>,
seq: usize,
}
impl<'b, 'a> miniserde::ser::Map for UpgradeVsanObjectsRequestTypeSer<'b, 'a> {
fn next(&mut self) -> Option<(std::borrow::Cow<'_, str>, &dyn miniserde::Serialize)> {
let seq = self.seq;
self.seq += 1;
match seq {
0 => return Some((std::borrow::Cow::Borrowed("_typeName"), &"UpgradeVsanObjectsRequestType")),
1 => return Some((std::borrow::Cow::Borrowed("uuids"), &self.data.uuids as &dyn miniserde::Serialize)),
2 => return Some((std::borrow::Cow::Borrowed("newVersion"), &self.data.new_version as &dyn miniserde::Serialize)),
_ => return None,
}
}
}