use serde::{Deserialize, Serialize}; /*
                                      * Service Control API
                                      *
                                      * Provides admission control and telemetry reporting for services integrated with Service Infrastructure.
                                      *
                                      * The version of the OpenAPI document: v2
                                      *
                                      * Generated by: https://openapi-generator.tech
                                      */

use crate::google_rest_apis::servicecontrol_v2::models;

/// Response : This message defines attributes for a typical network response. It generally models semantics of an HTTP response.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Response {
    /// The amount of time it takes the backend service to fully respond to a request. Measured from when the destination service starts to send the request to the backend until when the destination service receives the complete response from the backend.
    #[serde(rename = "backendLatency", skip_serializing_if = "Option::is_none")]
    pub backend_latency: Option<String>,
    /// The HTTP response status code, such as `200` and `404`.
    #[serde(rename = "code", skip_serializing_if = "Option::is_none")]
    pub code: Option<String>,
    /// The HTTP response headers. If multiple headers share the same key, they must be merged according to HTTP spec. All header keys must be lowercased, because HTTP header keys are case-insensitive.
    #[serde(rename = "headers", skip_serializing_if = "Option::is_none")]
    pub headers: Option<std::collections::HashMap<String, String>>,
    /// The HTTP response size in bytes. If unknown, it must be -1.
    #[serde(rename = "size", skip_serializing_if = "Option::is_none")]
    pub size: Option<String>,
    /// The timestamp when the `destination` service sends the last byte of the response.
    #[serde(rename = "time", skip_serializing_if = "Option::is_none")]
    pub time: Option<String>,
}

impl Response {
    /// This message defines attributes for a typical network response. It generally models semantics of an HTTP response.
    pub fn new() -> Response {
        Response {
            backend_latency: None,
            code: None,
            headers: None,
            size: None,
            time: None,
        }
    }
}
