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

/// HookDeliveryItem : Delivery made by a webhook, without request and response information.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct HookDeliveryItem {
    /// Unique identifier of the webhook delivery.
    #[serde(rename = "id")]
    pub id: i32,
    /// Unique identifier for the event (shared with all deliveries for all webhooks that subscribe to this event).
    #[serde(rename = "guid")]
    pub guid: String,
    /// Time when the webhook delivery occurred.
    #[serde(rename = "delivered_at")]
    pub delivered_at: String,
    /// Whether the webhook delivery is a redelivery.
    #[serde(rename = "redelivery")]
    pub redelivery: bool,
    /// Time spent delivering.
    #[serde(rename = "duration")]
    pub duration: f64,
    /// Describes the response returned after attempting the delivery.
    #[serde(rename = "status")]
    pub status: String,
    /// Status code received when delivery was made.
    #[serde(rename = "status_code")]
    pub status_code: i32,
    /// The event that triggered the delivery.
    #[serde(rename = "event")]
    pub event: String,
    /// The type of activity for the event that triggered the delivery.
    #[serde(rename = "action", deserialize_with = "Option::deserialize")]
    pub action: Option<String>,
    /// The id of the GitHub App installation associated with this event.
    #[serde(rename = "installation_id", deserialize_with = "Option::deserialize")]
    pub installation_id: Option<i32>,
    /// The id of the repository associated with this event.
    #[serde(rename = "repository_id", deserialize_with = "Option::deserialize")]
    pub repository_id: Option<i32>,
}

impl HookDeliveryItem {
    /// Delivery made by a webhook, without request and response information.
    pub fn new(id: i32, guid: String, delivered_at: String, redelivery: bool, duration: f64, status: String, status_code: i32, event: String, action: Option<String>, installation_id: Option<i32>, repository_id: Option<i32>) -> HookDeliveryItem {
        HookDeliveryItem {
            id,
            guid,
            delivered_at,
            redelivery,
            duration,
            status,
            status_code,
            event,
            action,
            installation_id,
            repository_id,
        }
    }
}