oci_rust_sdk/core/requests/
update_image_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 UpdateImageRequest {
11 pub image_id: String,
13
14 pub update_image_details: UpdateImageDetails,
16
17 #[serde(skip_serializing_if = "Option::is_none")]
19 pub opc_retry_token: Option<String>,
20
21 #[serde(skip_serializing_if = "Option::is_none")]
23 pub if_match: Option<String>,
24}
25
26pub struct UpdateImageRequestRequired {
28 pub image_id: String,
30
31 pub update_image_details: UpdateImageDetails,
33}
34
35impl UpdateImageRequest {
36 pub fn new(required: UpdateImageRequestRequired) -> Self {
38 Self {
39 image_id: required.image_id,
40
41 update_image_details: required.update_image_details,
42
43 opc_retry_token: None,
44
45 if_match: None,
46 }
47 }
48
49 pub fn set_image_id(mut self, value: String) -> Self {
51 self.image_id = value;
52 self
53 }
54
55 pub fn set_update_image_details(mut self, value: UpdateImageDetails) -> Self {
57 self.update_image_details = value;
58 self
59 }
60
61 pub fn set_opc_retry_token(mut self, value: Option<String>) -> Self {
63 self.opc_retry_token = value;
64 self
65 }
66
67 pub fn set_if_match(mut self, value: Option<String>) -> Self {
69 self.if_match = value;
70 self
71 }
72
73 pub fn with_opc_retry_token(mut self, value: impl Into<String>) -> Self {
75 self.opc_retry_token = Some(value.into());
76 self
77 }
78
79 pub fn with_if_match(mut self, value: impl Into<String>) -> Self {
81 self.if_match = Some(value.into());
82 self
83 }
84}