Skip to main content

oci_rust_sdk/core/responses/
get_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 GetInstanceResponse {
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 returned model.Instance instance.
18    pub instance: Instance,
19}
20
21/// Required fields for GetInstanceResponse
22pub struct GetInstanceResponseRequired {
23    /// The returned model.Instance instance.
24    pub instance: Instance,
25}
26
27impl GetInstanceResponse {
28    /// Create a new GetInstanceResponse with required fields
29    pub fn new(required: GetInstanceResponseRequired) -> Self {
30        Self {
31            etag: None,
32            opc_request_id: None,
33            instance: required.instance,
34        }
35    }
36
37    /// Set etag
38    pub fn set_etag(mut self, value: Option<String>) -> Self {
39        self.etag = value;
40        self
41    }
42
43    /// Set opc_request_id
44    pub fn set_opc_request_id(mut self, value: Option<String>) -> Self {
45        self.opc_request_id = value;
46        self
47    }
48
49    /// Set instance
50    pub fn set_instance(mut self, value: Instance) -> Self {
51        self.instance = value;
52        self
53    }
54
55    /// Set etag (unwraps Option)
56    pub fn with_etag(mut self, value: impl Into<String>) -> Self {
57        self.etag = Some(value.into());
58        self
59    }
60
61    /// Set opc_request_id (unwraps Option)
62    pub fn with_opc_request_id(mut self, value: impl Into<String>) -> Self {
63        self.opc_request_id = Some(value.into());
64        self
65    }
66}