Skip to main content

oci_rust_sdk/core/requests/
create_vlan_request.rs

1use 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 CreateVlanRequest {
11    /// Details for creating a VLAN
12    pub create_vlan_details: CreateVlanDetails,
13
14    /// A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (for example, if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).
15    #[serde(skip_serializing_if = "Option::is_none")]
16    pub opc_retry_token: Option<String>,
17
18    /// Unique identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
19    #[serde(skip_serializing_if = "Option::is_none")]
20    pub opc_request_id: Option<String>,
21}
22
23/// Required fields for CreateVlanRequest
24pub struct CreateVlanRequestRequired {
25    /// Details for creating a VLAN
26    pub create_vlan_details: CreateVlanDetails,
27}
28
29impl CreateVlanRequest {
30    /// Create a new CreateVlanRequest with required fields
31    pub fn new(required: CreateVlanRequestRequired) -> Self {
32        Self {
33            create_vlan_details: required.create_vlan_details,
34
35            opc_retry_token: None,
36
37            opc_request_id: None,
38        }
39    }
40
41    /// Set create_vlan_details
42    pub fn set_create_vlan_details(mut self, value: CreateVlanDetails) -> Self {
43        self.create_vlan_details = value;
44        self
45    }
46
47    /// Set opc_retry_token
48    pub fn set_opc_retry_token(mut self, value: Option<String>) -> Self {
49        self.opc_retry_token = value;
50        self
51    }
52
53    /// Set opc_request_id
54    pub fn set_opc_request_id(mut self, value: Option<String>) -> Self {
55        self.opc_request_id = value;
56        self
57    }
58
59    /// Set opc_retry_token (unwraps Option)
60    pub fn with_opc_retry_token(mut self, value: impl Into<String>) -> Self {
61        self.opc_retry_token = Some(value.into());
62        self
63    }
64
65    /// Set opc_request_id (unwraps Option)
66    pub fn with_opc_request_id(mut self, value: impl Into<String>) -> Self {
67        self.opc_request_id = Some(value.into());
68        self
69    }
70}