use serde::{Deserialize, Serialize}; /*
                                      * Compute Engine API
                                      *
                                      * Creates and runs virtual machines on Google Cloud Platform.
                                      *
                                      * The version of the OpenAPI document: v1
                                      *
                                      * Generated by: https://openapi-generator.tech
                                      */

/// UrlMapTest : Message for the expected URL mappings.

#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct UrlMapTest {
    /// Description of this test case.
    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// The expected output URL evaluated by the load balancer containing the scheme, host, path and query parameters. For rules that forward requests to backends, the test passes only when expectedOutputUrl matches the request forwarded by the load balancer to backends. For rules with urlRewrite, the test verifies that the forwarded request matches hostRewrite and pathPrefixRewrite in the urlRewrite action. When service is specified, expectedOutputUrl`s scheme is ignored. For rules with urlRedirect, the test passes only if expectedOutputUrl matches the URL in the load balancer's redirect response. If urlRedirect specifies https_redirect, the test passes only if the scheme in expectedOutputUrl is also set to HTTPS. If urlRedirect specifies strip_query, the test passes only if expectedOutputUrl does not contain any query parameters. expectedOutputUrl is optional when service is specified.
    #[serde(rename = "expectedOutputUrl", skip_serializing_if = "Option::is_none")]
    pub expected_output_url: Option<String>,
    /// For rules with urlRedirect, the test passes only if expectedRedirectResponseCode matches the HTTP status code in load balancer's redirect response. expectedRedirectResponseCode cannot be set when service is set.
    #[serde(
        rename = "expectedRedirectResponseCode",
        skip_serializing_if = "Option::is_none"
    )]
    pub expected_redirect_response_code: Option<i32>,
    /// HTTP headers for this request. If headers contains a host header, then host must also match the header value.
    #[serde(rename = "headers", skip_serializing_if = "Option::is_none")]
    pub headers: Option<Vec<crate::google_rest_apis::compute_v1::models::UrlMapTestHeader>>,
    /// Host portion of the URL. If headers contains a host header, then host must also match the header value.
    #[serde(rename = "host", skip_serializing_if = "Option::is_none")]
    pub host: Option<String>,
    /// Path portion of the URL.
    #[serde(rename = "path", skip_serializing_if = "Option::is_none")]
    pub path: Option<String>,
    /// Expected BackendService or BackendBucket resource the given URL should be mapped to. The service field cannot be set if expectedRedirectResponseCode is set.
    #[serde(rename = "service", skip_serializing_if = "Option::is_none")]
    pub service: Option<String>,
}

impl UrlMapTest {
    /// Message for the expected URL mappings.
    pub fn new() -> UrlMapTest {
        UrlMapTest {
            description: None,
            expected_output_url: None,
            expected_redirect_response_code: None,
            headers: None,
            host: None,
            path: None,
            service: None,
        }
    }
}
