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};

/// Activity : Activity
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Activity {
    #[serde(rename = "id")]
    pub id: i32,
    #[serde(rename = "node_id")]
    pub node_id: String,
    /// The SHA of the commit before the activity.
    #[serde(rename = "before")]
    pub before: String,
    /// The SHA of the commit after the activity.
    #[serde(rename = "after")]
    pub after: String,
    /// The full Git reference, formatted as `refs/heads/<branch name>`.
    #[serde(rename = "ref")]
    pub r#ref: String,
    /// The time when the activity occurred.
    #[serde(rename = "timestamp")]
    pub timestamp: String,
    /// The type of the activity that was performed.
    #[serde(rename = "activity_type")]
    pub activity_type: ActivityType,
    #[serde(rename = "actor", deserialize_with = "Option::deserialize")]
    pub actor: Option<Box<models::NullableSimpleUser>>,
}

impl Activity {
    /// Activity
    pub fn new(id: i32, node_id: String, before: String, after: String, r#ref: String, timestamp: String, activity_type: ActivityType, actor: Option<models::NullableSimpleUser>) -> Activity {
        Activity {
            id,
            node_id,
            before,
            after,
            r#ref,
            timestamp,
            activity_type,
            actor: actor.map(Box::new),
        }
    }
}
/// The type of the activity that was performed.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ActivityType {
    #[serde(rename = "push")]
    Push,
    #[serde(rename = "force_push")]
    ForcePush,
    #[serde(rename = "branch_deletion")]
    BranchDeletion,
    #[serde(rename = "branch_creation")]
    BranchCreation,
    #[serde(rename = "pr_merge")]
    PrMerge,
    #[serde(rename = "merge_queue_merge")]
    MergeQueueMerge,
}

impl Default for ActivityType {
    fn default() -> ActivityType {
        Self::Push
    }
}