Skip to main content

oci_rust_sdk/core/responses/
create_image_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 CreateImageResponse {
11    /// For optimistic concurrency control. See {@code if-match}.
12    pub etag: 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: 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: String,
19
20    /// The returned model.Image instance.
21    pub image: Image,
22}
23
24/// Required fields for CreateImageResponse
25pub struct CreateImageResponseRequired {
26    /// For optimistic concurrency control. See {@code if-match}.
27    pub etag: String,
28
29    /// Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
30    pub opc_request_id: String,
31
32    /// 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.
33    pub opc_work_request_id: String,
34
35    /// The returned model.Image instance.
36    pub image: Image,
37}
38
39impl CreateImageResponse {
40    /// Create a new CreateImageResponse with required fields
41    pub fn new(required: CreateImageResponseRequired) -> Self {
42        Self {
43            etag: required.etag,
44
45            opc_request_id: required.opc_request_id,
46
47            opc_work_request_id: required.opc_work_request_id,
48
49            image: required.image,
50        }
51    }
52
53    /// Set etag
54    pub fn set_etag(mut self, value: String) -> Self {
55        self.etag = value;
56        self
57    }
58
59    /// Set opc_request_id
60    pub fn set_opc_request_id(mut self, value: String) -> Self {
61        self.opc_request_id = value;
62        self
63    }
64
65    /// Set opc_work_request_id
66    pub fn set_opc_work_request_id(mut self, value: String) -> Self {
67        self.opc_work_request_id = value;
68        self
69    }
70
71    /// Set image
72    pub fn set_image(mut self, value: Image) -> Self {
73        self.image = value;
74        self
75    }
76}