Skip to main content

oci_rust_sdk/core/responses/
launch_instance_response.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 LaunchInstanceResponse {
11    /// For optimistic concurrency control. See {@code if-match}.
12    pub etag: Option<String>,
13
14    /// Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
15    pub opc_request_id: Option<String>,
16
17    /// The [OCID](https://docs.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the work request. Use [GetWorkRequest](https://docs.oracle.com/iaas/api/#/en/workrequests/latest/WorkRequest/GetWorkRequest) with this ID to track the status of the request.
18    pub opc_work_request_id: Option<String>,
19
20    /// The returned model.Instance instance.
21    pub instance: Instance,
22}
23
24/// Required fields for LaunchInstanceResponse
25pub struct LaunchInstanceResponseRequired {
26    /// The returned model.Instance instance.
27    pub instance: Instance,
28}
29
30impl LaunchInstanceResponse {
31    /// Create a new LaunchInstanceResponse with required fields
32    pub fn new(required: LaunchInstanceResponseRequired) -> Self {
33        Self {
34            etag: None,
35            opc_request_id: None,
36            opc_work_request_id: None,
37            instance: required.instance,
38        }
39    }
40
41    /// Set etag
42    pub fn set_etag(mut self, value: Option<String>) -> Self {
43        self.etag = value;
44        self
45    }
46
47    /// Set opc_request_id
48    pub fn set_opc_request_id(mut self, value: Option<String>) -> Self {
49        self.opc_request_id = value;
50        self
51    }
52
53    /// Set opc_work_request_id
54    pub fn set_opc_work_request_id(mut self, value: Option<String>) -> Self {
55        self.opc_work_request_id = value;
56        self
57    }
58
59    /// Set instance
60    pub fn set_instance(mut self, value: Instance) -> Self {
61        self.instance = value;
62        self
63    }
64
65    /// Set etag (unwraps Option)
66    pub fn with_etag(mut self, value: impl Into<String>) -> Self {
67        self.etag = Some(value.into());
68        self
69    }
70
71    /// Set opc_request_id (unwraps Option)
72    pub fn with_opc_request_id(mut self, value: impl Into<String>) -> Self {
73        self.opc_request_id = Some(value.into());
74        self
75    }
76
77    /// Set opc_work_request_id (unwraps Option)
78    pub fn with_opc_work_request_id(mut self, value: impl Into<String>) -> Self {
79        self.opc_work_request_id = Some(value.into());
80        self
81    }
82}