oci_rust_sdk/core/requests/
attach_volume_request.rs1use serde::{Deserialize, Serialize};
2
3#[allow(unused_imports)]
4use super::super::models::*;
5#[allow(unused_imports)]
6use super::*;
7
8#[derive(Debug, Clone, Serialize, Deserialize)]
9#[serde(rename_all = "camelCase")]
10pub struct AttachVolumeRequest {
11 pub attach_volume_details: AttachServiceDeterminedVolumeDetails,
13
14 #[serde(skip_serializing_if = "Option::is_none")]
16 pub opc_retry_token: Option<String>,
17}
18
19pub struct AttachVolumeRequestRequired {
21 pub attach_volume_details: AttachServiceDeterminedVolumeDetails,
23}
24
25impl AttachVolumeRequest {
26 pub fn new(required: AttachVolumeRequestRequired) -> Self {
28 Self {
29 attach_volume_details: required.attach_volume_details,
30
31 opc_retry_token: None,
32 }
33 }
34
35 pub fn set_attach_volume_details(
37 mut self,
38 value: AttachServiceDeterminedVolumeDetails,
39 ) -> Self {
40 self.attach_volume_details = value;
41 self
42 }
43
44 pub fn set_opc_retry_token(mut self, value: Option<String>) -> Self {
46 self.opc_retry_token = value;
47 self
48 }
49
50 pub fn with_opc_retry_token(mut self, value: impl Into<String>) -> Self {
52 self.opc_retry_token = Some(value.into());
53 self
54 }
55}