1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
* 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,
}
}
}