vim_rs 0.4.4

Rust Bindings for the VMware by Broadcom vCenter VI JSON API
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
use std::sync::Arc;
use crate::core::client::{VimClient, Result};
/// Deprecated as of vSphere 9.0. Please refer to vLCM APIs.
/// 
/// An <code>Agency</code> handles the deployment of a single type of agent
/// virtual machine and any associated VIB bundle, on a set of compute resources.
/// 
/// For a solution to deploy multiple types of agents, it must create multiple
/// agencies by using <code>createAgency</code> on *EsxAgentManager* (see
/// *EsxAgentManager.CreateAgency*).
/// 
/// Creating an agency is a long-running process. vSphere ESX Agent Manager must
/// install VIBs, configure hosts, install agent virtual machines and do many
/// more things. Each of these steps can take a considerable amount of time.
/// vSphere ESX Agent Manager can also encounter problems when creating the
/// agency. In this case, the solution must remediate the problem. See
/// *Issue* for a description of the kinds of issue that vSphere ESX Agent
/// Manager will raise. Similarly, removing an agency from vSphere ESX Agent
/// Manager is also a long-running process that involves many steps. Removing an
/// agency can also raise issues.
/// 
/// Use the <code>goalState</code> and <code>status</code> properties to show the
/// progress of creating or removing an Agency. The <code>goalState</code> and
/// <code>status</code> properties are found in the runtime information of an
/// <code>Agency</code> (see *EamObjectRuntimeInfo.status* in
/// *Agency.runtime*):
/// - <code>goalState</code>. The goal state describes the overall goal of an
///   <code>Agency</code>. The goal state can be <code>enabled</code> or
///   <code>uninstalled</code>:
///   - <code>enabled</code>. The <code>Agency</code> continuously deploys VIBs
///     and agent virtual machines, powers on agent virtual machines, and monitors
///     agents for issues.
///   - <code>uninstalled</code>. The <code>Agency</code> uninstalls any
///     installed VIBs and powers off and deletes any deployed agent virtual
///     machines.
/// - <code>status</code>. The status of the <code>Agency</code> regarding the
///   given goal state. Status can be either red, yellow or green:
///   - <code>red</code>. An issue is preventing the <code>Agency</code> from
///     reaching its desired goal state. See *EamObjectRuntimeInfo.issue* in
///     *Agency.runtime* for the types of issues that can block this
///     <code>Agency</code>.
///   - <code>yellow</code>. The <code>Agency</code> is actively working to reach
///     the desired goal state. For the <code>enabled</code> goal state, this means
///     that this <code>Agency</code> is currently installing VIBs, deploying agent
///     virtual machines, and powering them on.
///   - <code>green</code>. The <code>Agency</code> has reached the desired goal
///     state. The <code>Agency</code> is no longer actively scheduling new tasks but
///     is monitoring the vCenter Server for changes that might conflict with this
///     <code>Agency</code>'s goal state.
///     
/// The following image shows in general terms how the status changes in the
/// life-cycle of an <code>Agency</code>.
/// 
/// "Agency degraded" means that something has happened in the vCenter Server
/// that causes this <code>Agency</code> to actively schedule new tasks to reach
/// the goal state. For example, adding a host to a cluster covered by the scope
/// of the <code>Agency</code>, which causes ESX Agent Manager to install a VIB
/// and deploy an agent virtual machine on the new host.
/// A solution should monitor the list of issues associated with this
/// <code>Agency</code>.
/// 
/// The solution can poll *Agency.runtime*.
#[derive(Clone)]
pub struct Agency {
    client: Arc<dyn VimClient>,
    mo_id: String,
}
impl Agency {
    pub fn new(client: Arc<dyn VimClient>, mo_id: &str) -> Self {
        Self {
            client,
            mo_id: mo_id.to_string(),
        }
    }
    /// Deprecated.
    /// 
    /// Adds an issue to this agency.
    /// 
    /// *Issue.key* and *Issue.time* is
    /// overwritten so that *Issue.key* becomes unique on this server and
    /// *Issue.time* is the current time.
    /// 
    /// Requires modify privileges.
    ///
    /// ## Parameters:
    ///
    /// ### issue
    /// A new issue.
    ///
    /// ## Returns:
    ///
    /// The same issue where the key and time is set.
    ///
    /// ## Errors:
    ///
    /// ***InvalidArgument***: Thrown if issue typeId is unknown.
    pub async fn add_issue(&self, issue: &dyn crate::types::traits::IssueTrait) -> Result<Box<dyn crate::types::traits::IssueTrait>> {
        let input = AddIssueRequestType {issue, };
        let bytes = self.client.invoke("eam", "Agency", &self.mo_id, "AddIssue", Some(&input)).await?;
        let result: Box<dyn crate::types::traits::IssueTrait> = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Destroys this Agency.
    /// 
    /// Any agents that the <code>Agency</code> has are
    /// removed. Until the agents have been removed, it is possible to view the
    /// runtime state of this <code>Agency</code> but it is not possible to modify
    /// its configuration or change its goal state. After all agents have been
    /// removed, any subsequent call on this <code>Agency</code> will throw a
    /// <code>ManagedObjectNotFound</code> exception.
    /// 
    /// Requires modify privileges.
    pub async fn destroy_agency(&self) -> Result<()> {
        self.client.invoke_void("eam", "Agency", &self.mo_id, "DestroyAgency", None).await
    }
    /// Deprecated its definition is not consistent across agent VMs and VIBs.
    /// It is impossible to be defined since there is no corresponding
    /// state of ESXi vibs.
    /// 
    /// Sets the goal state of this <code>Agency</code> to <code>disabled</code>.
    /// 
    /// This powers off any powered on agent virtual machines, but continues
    /// provisioning agents to hosts that are added to the compute resources in
    /// the agency's scope, and removes agents from hosts that are taken out of
    /// the scope.
    /// 
    /// Requires modify privileges.
    pub async fn agency_disable(&self) -> Result<()> {
        self.client.invoke_void("eam", "Agency", &self.mo_id, "Agency_Disable", None).await
    }
    /// Deprecated since agencies are always created as enabled. In addition,
    /// enabling already uninstalled agency is not supported.
    /// 
    /// Sets the goal state of this <code>Agency</code> to <code>enabled</code>.
    /// 
    /// This causes the agency to continuously deploy and monitor agents.
    /// 
    /// Requires modify privileges.
    pub async fn agency_enable(&self) -> Result<()> {
        self.client.invoke_void("eam", "Agency", &self.mo_id, "Agency_Enable", None).await
    }
    /// Deprecated use *Agency.agent* instead.
    /// 
    /// An array of agents deployed by this agent manager.
    /// 
    /// Requires view privileges.
    ///
    /// ## Returns:
    ///
    /// Refers instances of *Agent*.
    pub async fn query_agent(&self) -> Result<Option<Vec<crate::types::structs::ManagedObjectReference>>> {
        let bytes_opt = self.client.invoke_optional("eam", "Agency", &self.mo_id, "QueryAgent", None).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Deprecated use *Agency.config* instead.
    /// 
    /// The configuration of this <code>Agency</code>.
    /// 
    /// Specifies how this
    /// <code>Agency</code> deploys its agents and VIBs.
    /// 
    /// Requires view privileges.
    ///
    /// ## Returns:
    ///
    /// The configuration of this <code>Agency</code>.
    pub async fn query_config(&self) -> Result<crate::types::structs::AgencyConfigInfo> {
        let bytes = self.client.invoke("eam", "Agency", &self.mo_id, "QueryConfig", None).await?;
        let result: crate::types::structs::AgencyConfigInfo = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Current issues that have been detected for this entity.
    /// 
    /// Each issue can be remediated
    /// by invoking *EamObject.Resolve* or *EamObject.ResolveAll*.
    /// 
    /// Requires view privileges.
    ///
    /// ## Parameters:
    ///
    /// ### issue_key
    /// An optional array of issue keys. If not set, all issues for this
    /// entity are returned.
    ///
    /// ## Returns:
    ///
    /// A possibly empty array of issues that match the input <code>issueKey</code> array. Note
    /// that the returned array can be smaller than <code>issueKey</code> if one or more
    /// issue keys refers to issues that this entity does not have.
    pub async fn query_issue(&self, issue_key: Option<&[i32]>) -> Result<Option<Vec<Box<dyn crate::types::traits::IssueTrait>>>> {
        let input = QueryIssueRequestType {issue_key, };
        let bytes_opt = self.client.invoke_optional("eam", "Agency", &self.mo_id, "QueryIssue", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Deprecated use *Agency.runtime* instead.
    /// 
    /// Gets the runtime information for this agency.
    /// 
    /// Requires view privileges.
    ///
    /// ## Returns:
    ///
    /// The runtime information.
    pub async fn agency_query_runtime(&self) -> Result<Box<dyn crate::types::traits::EamObjectRuntimeInfoTrait>> {
        let bytes = self.client.invoke("eam", "Agency", &self.mo_id, "AgencyQueryRuntime", None).await?;
        let result: Box<dyn crate::types::traits::EamObjectRuntimeInfoTrait> = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Deprecated use *Agency.solutionId* instead.
    /// 
    /// The ID of the solution that owns this <code>Agency</code>.
    /// 
    /// If the agency
    /// is owned by a VC extension, this is the extension's key. Otherwise, this
    /// is same as *Agency.owner*. The users in the latter case are
    /// either regular or solution users.
    /// 
    /// Requires view privileges.
    ///
    /// ## Returns:
    ///
    /// The solution ID.
    pub async fn query_solution_id(&self) -> Result<String> {
        let bytes = self.client.invoke("eam", "Agency", &self.mo_id, "QuerySolutionId", None).await?;
        let result: String = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Deprecated use automatically provisioned VMs and register hooks to have
    /// control post provisioning and power on.
    /// 
    /// Adds an agent VM to this agency.
    /// 
    /// Used if
    /// *AgencyConfigInfo.manuallyProvisioned* is set to true. The method
    /// does nothing if the agent VM is already registered with this agency.
    /// 
    /// Requires modify privileges.
    ///
    /// ## Parameters:
    ///
    /// ### agent_vm
    /// The managed object reference to the agent VM.
    /// 
    /// Refers instance of *VirtualMachine*.
    ///
    /// ## Returns:
    ///
    /// Refers instance of *Agent*.
    ///
    /// ## Errors:
    ///
    /// ***ManagedObjectNotFound***: Thrown if agentVm does not exist in vCenter.
    pub async fn register_agent_vm(&self, agent_vm: &crate::types::structs::ManagedObjectReference) -> Result<crate::types::structs::ManagedObjectReference> {
        let input = RegisterAgentVmRequestType {agent_vm, };
        let bytes = self.client.invoke("eam", "Agency", &self.mo_id, "RegisterAgentVm", Some(&input)).await?;
        let result: crate::types::structs::ManagedObjectReference = crate::core::client::unmarshal(self.client.transport(), &bytes)?;
        Ok(result)
    }
    /// Resolves the issues specified in the input.
    /// 
    /// If an issue is remediable, ESX
    /// Agent Manager
    /// tries to resolve the misconfiguration that caused the issue. If it is not
    /// remediable, the offending issue is removed and ESX Agent Manager assumes that the issue has been
    /// resolved.
    /// 
    /// Requires modify privileges.
    /// 
    /// See also *Issue*.
    ///
    /// ## Parameters:
    ///
    /// ### issue_key
    /// A non-empty array of issue keys.
    ///
    /// ## Returns:
    ///
    /// A possibly empty array of issue keys for the issues that were not found on the
    /// entity. This can happen if <code>resolve</code> is called with issue keys that were
    /// resolved just prior to calling <code>resolve</code> or if an issue is currenly not resolvable.
    pub async fn resolve(&self, issue_key: &[i32]) -> Result<Option<Vec<i32>>> {
        let input = ResolveRequestType {issue_key, };
        let bytes_opt = self.client.invoke_optional("eam", "Agency", &self.mo_id, "Resolve", Some(&input)).await?;
        match bytes_opt {
            Some(ref b) => Ok(Some(crate::core::client::unmarshal_array(self.client.transport(), b)?)),
            None => Ok(None),
        }
    }
    /// Resolve all outstanding issues.
    /// 
    /// The method calls *EamObject.Resolve*
    /// with all issues the <code>EsxAgentManager</code>, <code>Agency</code>, or
    /// <code>Agent</code> have encountered. It is the equivalent of calling the following methods:
    /// - <code>agent.resolve(getIssueKeys(agent.getRuntime().getIssue()));</code>
    ///   for <code>Agent</code> objects
    /// - <code>agency.resolve(getIssueKeys(agency.getRuntime().getIssue()));</code>
    ///   for <code>Agency</code> objects
    /// - <code>esxAgentManager.resolve(getIssueKeys(esxAgentManager.getIssue()));</code>
    ///   for the <code>EsxAgentManager</code> object.
    ///   
    /// Requires modify privileges.
    /// 
    /// See also *Issue*.
    pub async fn resolve_all(&self) -> Result<()> {
        self.client.invoke_void("eam", "Agency", &self.mo_id, "ResolveAll", None).await
    }
    /// Sets the goal state of this <code>Agency</code> to
    /// <code>uninstalled</code>.
    /// 
    /// This initiates the uninstallation of this
    /// <code>Agency</code>, which causes all agents to be removed.
    /// 
    /// The best practice when destroying an agency is to call
    /// <code>uninstall</code>, wait for the runtime status to turn green, and
    /// then invoke *Agency.DestroyAgency*. When waiting for this
    /// <code>Agency</code> to be uninstalled the solution can then attend to and
    /// resolve any raised issues.
    /// 
    /// Requires modify privileges.
    pub async fn uninstall(&self) -> Result<()> {
        self.client.invoke_void("eam", "Agency", &self.mo_id, "Uninstall", None).await
    }
    /// Deprecated use automatically provisioned VMs and register hooks to have
    /// control post provisioning and power on.
    /// 
    /// Removes an agent VM to this agency.
    /// 
    /// Used if
    /// *AgencyConfigInfo.manuallyProvisioned* is set to true. The method
    /// does nothing if the agent VM is not registered with this agency.
    /// 
    /// Requires modify privileges.
    ///
    /// ## Parameters:
    ///
    /// ### agent_vm
    /// The managed object reference to the agent VM.
    /// 
    /// Refers instance of *VirtualMachine*.
    pub async fn unregister_agent_vm(&self, agent_vm: &crate::types::structs::ManagedObjectReference) -> Result<()> {
        let input = UnregisterAgentVmRequestType {agent_vm, };
        self.client.invoke_void("eam", "Agency", &self.mo_id, "UnregisterAgentVm", Some(&input)).await
    }
    /// Updates the agency configuration used by this <code>Agency</code> to
    /// deploy agents and VIBs.
    /// 
    /// vSphere ESX Agent Manager generates a diff between
    /// the old configuration and the new one and updates the <code>Agency</code>
    /// accordingly.
    /// 
    /// Requires modify privileges.
    ///
    /// ## Parameters:
    ///
    /// ### config
    /// The new configuration for this <code>Agency</code>
    ///
    /// ## Errors:
    ///
    /// ***InvalidAgentConfiguration***: Thrown if one or more agent configurations are invalid.
    /// 
    /// ***InvalidAgencyScope***: Thrown if one or more compute resources in the scope cannot be
    /// found in vCenter or there is no configured resource pool or
    /// folder where the VMs to be deployed.
    /// 
    /// ***EamInvalidUrl***: Thrown if either the agent virtual machine URL or VIB URL
    /// cannot be parsed or if the resource refered to cannot be
    /// downloaded.
    pub async fn update(&self, config: &crate::types::structs::AgencyConfigInfo) -> Result<()> {
        let input = UpdateRequestType {config, };
        self.client.invoke_void("eam", "Agency", &self.mo_id, "Update", Some(&input)).await
    }
    /// An array of agents deployed by this agent manager.
    /// 
    /// Requires view privileges.
    ///
    /// ## Returns:
    ///
    /// Refers instances of *Agent*.
    pub async fn agent(&self) -> Result<Option<Vec<crate::types::structs::ManagedObjectReference>>> {
        let pv_opt = self.client.fetch_property_raw("eam", "Agency", &self.mo_id, "agent").await?;
        match pv_opt {
            Some(pv) => Ok(Some(crate::core::client::extract_property(pv)?)),
            None => Ok(None),
        }
    }
    /// The configuration of this <code>Agency</code>.
    /// 
    /// Specifies how this
    /// <code>Agency</code> deploys its agents and VIBs.
    /// 
    /// Requires view privileges.
    ///
    /// ## Returns:
    ///
    /// The configuration of this <code>Agency</code>.
    pub async fn config(&self) -> Result<crate::types::structs::AgencyConfigInfo> {
        let pv_opt = self.client.fetch_property_raw("eam", "Agency", &self.mo_id, "config").await?;
        let pv = pv_opt.ok_or_else(|| crate::core::client::VimError::ParseError("property config was empty".to_string()))?;
        let result: crate::types::structs::AgencyConfigInfo = crate::core::client::extract_property(pv)?;
        Ok(result)
    }
    /// The principal name of the user that owns this <code>Agency</code>.
    /// 
    /// If the
    /// agency is owned by a VC extension, this method returns null.
    /// 
    /// Requires view privileges.
    ///
    /// ## Returns:
    ///
    /// the owner's principal name
    pub async fn owner(&self) -> Result<Option<String>> {
        let pv_opt = self.client.fetch_property_raw("eam", "Agency", &self.mo_id, "owner").await?;
        match pv_opt {
            Some(pv) => Ok(Some(crate::core::client::extract_property(pv)?)),
            None => Ok(None),
        }
    }
    /// Gets the runtime information for this agency.
    /// 
    /// Requires view privileges.
    ///
    /// ## Returns:
    ///
    /// The runtime information.
    pub async fn runtime(&self) -> Result<Box<dyn crate::types::traits::EamObjectRuntimeInfoTrait>> {
        let pv_opt = self.client.fetch_property_raw("eam", "Agency", &self.mo_id, "runtime").await?;
        let pv = pv_opt.ok_or_else(|| crate::core::client::VimError::ParseError("property runtime was empty".to_string()))?;
        let result: Box<dyn crate::types::traits::EamObjectRuntimeInfoTrait> = crate::core::client::extract_property(pv)?;
        Ok(result)
    }
    /// The ID of the solution that owns this <code>Agency</code>.
    /// 
    /// If the agency
    /// is owned by a VC extension, this is the extension's key. Otherwise, this
    /// is same as *Agency.owner*. The users in the latter case are
    /// either regular or solution users.
    /// 
    /// Requires view privileges.
    ///
    /// ## Returns:
    ///
    /// The solution ID.
    pub async fn solution_id(&self) -> Result<String> {
        let pv_opt = self.client.fetch_property_raw("eam", "Agency", &self.mo_id, "solutionId").await?;
        let pv = pv_opt.ok_or_else(|| crate::core::client::VimError::ParseError("property solutionId was empty".to_string()))?;
        let result: String = crate::core::client::extract_property(pv)?;
        Ok(result)
    }
}
struct AddIssueRequestType<'a> {
    issue: &'a dyn crate::types::traits::IssueTrait,
}

impl<'a> miniserde::Serialize for AddIssueRequestType<'a> {
    fn begin(&self) -> miniserde::ser::Fragment<'_> {
        miniserde::ser::Fragment::Map(Box::new(AddIssueRequestTypeSer { data: self, seq: 0 }))
    }
}

struct AddIssueRequestTypeSer<'b, 'a> {
    data: &'b AddIssueRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for AddIssueRequestTypeSer<'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"), &"AddIssueRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("issue"), &self.data.issue as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct QueryIssueRequestType<'a> {
    issue_key: Option<&'a [i32]>,
}

impl<'a> miniserde::Serialize for QueryIssueRequestType<'a> {
    fn begin(&self) -> miniserde::ser::Fragment<'_> {
        miniserde::ser::Fragment::Map(Box::new(QueryIssueRequestTypeSer { data: self, seq: 0 }))
    }
}

struct QueryIssueRequestTypeSer<'b, 'a> {
    data: &'b QueryIssueRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for QueryIssueRequestTypeSer<'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"), &"QueryIssueRequestType")),
                1 => {
                    let Some(ref val) = self.data.issue_key else { continue; };
                    return Some((std::borrow::Cow::Borrowed("issueKey"), val as &dyn miniserde::Serialize));
                }
                _ => return None,
            }
        }
    }
}
struct RegisterAgentVmRequestType<'a> {
    agent_vm: &'a crate::types::structs::ManagedObjectReference,
}

impl<'a> miniserde::Serialize for RegisterAgentVmRequestType<'a> {
    fn begin(&self) -> miniserde::ser::Fragment<'_> {
        miniserde::ser::Fragment::Map(Box::new(RegisterAgentVmRequestTypeSer { data: self, seq: 0 }))
    }
}

struct RegisterAgentVmRequestTypeSer<'b, 'a> {
    data: &'b RegisterAgentVmRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for RegisterAgentVmRequestTypeSer<'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"), &"RegisterAgentVmRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("agentVm"), &self.data.agent_vm as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct ResolveRequestType<'a> {
    issue_key: &'a [i32],
}

impl<'a> miniserde::Serialize for ResolveRequestType<'a> {
    fn begin(&self) -> miniserde::ser::Fragment<'_> {
        miniserde::ser::Fragment::Map(Box::new(ResolveRequestTypeSer { data: self, seq: 0 }))
    }
}

struct ResolveRequestTypeSer<'b, 'a> {
    data: &'b ResolveRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for ResolveRequestTypeSer<'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"), &"ResolveRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("issueKey"), &self.data.issue_key as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct UnregisterAgentVmRequestType<'a> {
    agent_vm: &'a crate::types::structs::ManagedObjectReference,
}

impl<'a> miniserde::Serialize for UnregisterAgentVmRequestType<'a> {
    fn begin(&self) -> miniserde::ser::Fragment<'_> {
        miniserde::ser::Fragment::Map(Box::new(UnregisterAgentVmRequestTypeSer { data: self, seq: 0 }))
    }
}

struct UnregisterAgentVmRequestTypeSer<'b, 'a> {
    data: &'b UnregisterAgentVmRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for UnregisterAgentVmRequestTypeSer<'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"), &"UnregisterAgentVmRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("agentVm"), &self.data.agent_vm as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}
struct UpdateRequestType<'a> {
    config: &'a crate::types::structs::AgencyConfigInfo,
}

impl<'a> miniserde::Serialize for UpdateRequestType<'a> {
    fn begin(&self) -> miniserde::ser::Fragment<'_> {
        miniserde::ser::Fragment::Map(Box::new(UpdateRequestTypeSer { data: self, seq: 0 }))
    }
}

struct UpdateRequestTypeSer<'b, 'a> {
    data: &'b UpdateRequestType<'a>,
    seq: usize,
}

impl<'b, 'a> miniserde::ser::Map for UpdateRequestTypeSer<'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"), &"UpdateRequestType")),
            1 => return Some((std::borrow::Cow::Borrowed("config"), &self.data.config as &dyn miniserde::Serialize)),
            _ => return None,
        }
    }
}