openapi-github 0.1.0

OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
Documentation
/*
 * GitHub's official OpenAPI spec + Octokit extension
 *
 * OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
 *
 * The version of the OpenAPI document: 16.6.0
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// CopilotUsageMetrics : Summary of Copilot usage.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CopilotUsageMetrics {
    /// The date for which the usage metrics are reported, in `YYYY-MM-DD` format.
    #[serde(rename = "day")]
    pub day: String,
    /// The total number of Copilot code completion suggestions shown to users.
    #[serde(rename = "total_suggestions_count", skip_serializing_if = "Option::is_none")]
    pub total_suggestions_count: Option<i32>,
    /// The total number of Copilot code completion suggestions accepted by users.
    #[serde(rename = "total_acceptances_count", skip_serializing_if = "Option::is_none")]
    pub total_acceptances_count: Option<i32>,
    /// The total number of lines of code completions suggested by Copilot.
    #[serde(rename = "total_lines_suggested", skip_serializing_if = "Option::is_none")]
    pub total_lines_suggested: Option<i32>,
    /// The total number of lines of code completions accepted by users.
    #[serde(rename = "total_lines_accepted", skip_serializing_if = "Option::is_none")]
    pub total_lines_accepted: Option<i32>,
    /// The total number of users who were shown Copilot code completion suggestions during the day specified.
    #[serde(rename = "total_active_users", skip_serializing_if = "Option::is_none")]
    pub total_active_users: Option<i32>,
    /// The total instances of users who accepted code suggested by Copilot Chat in the IDE (panel and inline).
    #[serde(rename = "total_chat_acceptances", skip_serializing_if = "Option::is_none")]
    pub total_chat_acceptances: Option<i32>,
    /// The total number of chat turns (prompt and response pairs) sent between users and Copilot Chat in the IDE.
    #[serde(rename = "total_chat_turns", skip_serializing_if = "Option::is_none")]
    pub total_chat_turns: Option<i32>,
    /// The total number of users who interacted with Copilot Chat in the IDE during the day specified.
    #[serde(rename = "total_active_chat_users", skip_serializing_if = "Option::is_none")]
    pub total_active_chat_users: Option<i32>,
    /// Breakdown of Copilot code completions usage by language and editor
    #[serde(rename = "breakdown", deserialize_with = "Option::deserialize")]
    pub breakdown: Option<Vec<models::CopilotUsageMetricsBreakdownInner>>,
}

impl CopilotUsageMetrics {
    /// Summary of Copilot usage.
    pub fn new(day: String, breakdown: Option<Vec<models::CopilotUsageMetricsBreakdownInner>>) -> CopilotUsageMetrics {
        CopilotUsageMetrics {
            day,
            total_suggestions_count: None,
            total_acceptances_count: None,
            total_lines_suggested: None,
            total_lines_accepted: None,
            total_active_users: None,
            total_chat_acceptances: None,
            total_chat_turns: None,
            total_active_chat_users: None,
            breakdown,
        }
    }
}