use serde::{Deserialize, Serialize};

#[allow(unused_imports)]
use super::super::models::*;
#[allow(unused_imports)]
use super::*;

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct GetInstanceResponse {
    /// For optimistic concurrency control. See {@code if-match}.
    pub etag: Option<String>,

    /// Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
    pub opc_request_id: Option<String>,

    /// The returned model.Instance instance.
    pub instance: Instance,
}

/// Required fields for GetInstanceResponse
pub struct GetInstanceResponseRequired {
    /// The returned model.Instance instance.
    pub instance: Instance,
}

impl GetInstanceResponse {
    /// Create a new GetInstanceResponse with required fields
    pub fn new(required: GetInstanceResponseRequired) -> Self {
        Self {
            etag: None,
            opc_request_id: None,
            instance: required.instance,
        }
    }

    /// Set etag
    pub fn set_etag(mut self, value: Option<String>) -> Self {
        self.etag = value;
        self
    }

    /// Set opc_request_id
    pub fn set_opc_request_id(mut self, value: Option<String>) -> Self {
        self.opc_request_id = value;
        self
    }

    /// Set instance
    pub fn set_instance(mut self, value: Instance) -> Self {
        self.instance = value;
        self
    }

    /// Set etag (unwraps Option)
    pub fn with_etag(mut self, value: impl Into<String>) -> Self {
        self.etag = Some(value.into());
        self
    }

    /// Set opc_request_id (unwraps Option)
    pub fn with_opc_request_id(mut self, value: impl Into<String>) -> Self {
        self.opc_request_id = Some(value.into());
        self
    }
}
