rusty_falcon 0.7.1

Rust bindings for CrowdStrike Falcon API
Documentation
/*
 * CrowdStrike API Specification
 *
 * Use this API specification as a reference for the API endpoints you can use to interact with your Falcon environment. These endpoints support authentication via OAuth2 and interact with detections and network containment. For detailed usage guides and examples, see our [documentation inside the Falcon console](https://falcon.crowdstrike.com/support/documentation).     To use the APIs described below, combine the base URL with the path shown for each API endpoint. For commercial cloud customers, your base URL is `https://api.crowdstrike.com`.    Each API endpoint requires authorization via an OAuth2 token. Your first API request should retrieve an OAuth2 token using the `oauth2/token` endpoint, such as `https://api.crowdstrike.com/oauth2/token`. For subsequent requests, include the OAuth2 token in an HTTP authorization header. Tokens expire after 30 minutes, after which you should make a new token request to continue making API requests.
 *
 * The version of the OpenAPI document: rolling
 *
 * Generated by: https://openapi-generator.tech
 */

use crate::models;

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DomainExternalAssetService {
    /// Details about the applications associated to the service
    #[serde(rename = "applications", skip_serializing_if = "Option::is_none")]
    pub applications: Option<Vec<models::DomainExternalAssetApplication>>,
    #[serde(rename = "blob_links", skip_serializing_if = "Option::is_none")]
    pub blob_links: Option<Box<models::DomainExternalAssetServiceBlobsLinks>>,
    /// The cloud provider name
    #[serde(rename = "cloud_provider", skip_serializing_if = "Option::is_none")]
    pub cloud_provider: Option<String>,
    /// A list of Common Platform Enumeration identifiers for this service. The schema format is: cpe:<cpe_version>:<part>:<vendor>:<product>:<version>:<update>:<edition>:<language>:<sw_edition>:<target_sw>:<target_hw>:<other>
    #[serde(rename = "cpes", skip_serializing_if = "Option::is_none")]
    pub cpes: Option<Vec<String>>,
    /// The first time this service was observed
    #[serde(rename = "first_seen", skip_serializing_if = "Option::is_none")]
    pub first_seen: Option<String>,
    /// The hosting provider name
    #[serde(rename = "hosting_provider", skip_serializing_if = "Option::is_none")]
    pub hosting_provider: Option<String>,
    #[serde(rename = "http_attributes", skip_serializing_if = "Option::is_none")]
    pub http_attributes: Option<Box<models::DomainExternalAssetHttpAttributes>>,
    /// The unique external asset identifier
    #[serde(rename = "id")]
    pub id: String,
    /// The date on which this was last scanned
    #[serde(rename = "last_seen")]
    pub last_seen: String,
    /// The operating system the service is running on
    #[serde(rename = "os", skip_serializing_if = "Option::is_none")]
    pub os: Option<String>,
    /// The name of the platform on which the service is running (Windows, Mac, Linux).
    #[serde(rename = "platform_name", skip_serializing_if = "Option::is_none")]
    pub platform_name: Option<String>,
    /// The port on which the service is accessible
    #[serde(rename = "port")]
    pub port: i32,
    /// The protocol used to access this service
    #[serde(rename = "protocol")]
    pub protocol: String,
    /// The availability status for this service
    #[serde(rename = "status")]
    pub status: String,
    /// The status code returned by the service
    #[serde(rename = "status_code")]
    pub status_code: i32,
    /// List of subsidiaries that the asset belongs to
    #[serde(rename = "subsidiaries", skip_serializing_if = "Option::is_none")]
    pub subsidiaries: Option<Vec<models::DomainExternalAssetSubsidiary>>,
    #[serde(rename = "tls", skip_serializing_if = "Option::is_none")]
    pub tls: Option<Box<models::DomainExternalAssetSslRecord>>,
    /// The network transport used to access this service
    #[serde(rename = "transport")]
    pub transport: String,
}

impl DomainExternalAssetService {
    pub fn new(
        id: String,
        last_seen: String,
        port: i32,
        protocol: String,
        status: String,
        status_code: i32,
        transport: String,
    ) -> DomainExternalAssetService {
        DomainExternalAssetService {
            applications: None,
            blob_links: None,
            cloud_provider: None,
            cpes: None,
            first_seen: None,
            hosting_provider: None,
            http_attributes: None,
            id,
            last_seen,
            os: None,
            platform_name: None,
            port,
            protocol,
            status,
            status_code,
            subsidiaries: None,
            tls: None,
            transport,
        }
    }
}