openapi_github/models/
hook_delivery_item.rs

1/*
2 * GitHub's official OpenAPI spec + Octokit extension
3 *
4 * OpenAPI specs from https://github.com/github/rest-api-description with the 'x-octokit' extension required by the Octokit SDKs
5 *
6 * The version of the OpenAPI document: 16.6.0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// HookDeliveryItem : Delivery made by a webhook, without request and response information.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct HookDeliveryItem {
17    /// Unique identifier of the webhook delivery.
18    #[serde(rename = "id")]
19    pub id: i32,
20    /// Unique identifier for the event (shared with all deliveries for all webhooks that subscribe to this event).
21    #[serde(rename = "guid")]
22    pub guid: String,
23    /// Time when the webhook delivery occurred.
24    #[serde(rename = "delivered_at")]
25    pub delivered_at: String,
26    /// Whether the webhook delivery is a redelivery.
27    #[serde(rename = "redelivery")]
28    pub redelivery: bool,
29    /// Time spent delivering.
30    #[serde(rename = "duration")]
31    pub duration: f64,
32    /// Describes the response returned after attempting the delivery.
33    #[serde(rename = "status")]
34    pub status: String,
35    /// Status code received when delivery was made.
36    #[serde(rename = "status_code")]
37    pub status_code: i32,
38    /// The event that triggered the delivery.
39    #[serde(rename = "event")]
40    pub event: String,
41    /// The type of activity for the event that triggered the delivery.
42    #[serde(rename = "action", deserialize_with = "Option::deserialize")]
43    pub action: Option<String>,
44    /// The id of the GitHub App installation associated with this event.
45    #[serde(rename = "installation_id", deserialize_with = "Option::deserialize")]
46    pub installation_id: Option<i32>,
47    /// The id of the repository associated with this event.
48    #[serde(rename = "repository_id", deserialize_with = "Option::deserialize")]
49    pub repository_id: Option<i32>,
50}
51
52impl HookDeliveryItem {
53    /// Delivery made by a webhook, without request and response information.
54    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 {
55        HookDeliveryItem {
56            id,
57            guid,
58            delivered_at,
59            redelivery,
60            duration,
61            status,
62            status_code,
63            event,
64            action,
65            installation_id,
66            repository_id,
67        }
68    }
69}
70