use crate::Secret;
use crate::model;
use crate::models::KnownValues;
pub const PROVIDER_TYPES: &[&str] = &["slack", "mattermost", "googlechat", "discord"];
pub const SUBSCRIPTIONS: &[&str] = &[
"nodeCreated",
"nodeNeedsApproval",
"nodeApproved",
"nodeKeyExpiringInOneDay",
"nodeKeyExpired",
"nodeDeleted",
"nodeSigned",
"nodeNeedsSignature",
"policyUpdate",
"userCreated",
"userNeedsApproval",
"userSuspended",
"userRestored",
"userDeleted",
"userApproved",
"userRoleUpdated",
"subnetIPForwardingNotEnabled",
"exitNodeIPForwardingNotEnabled",
];
pub const KNOWN_VALUES: &[KnownValues] = &[
("Webhook.providerType", PROVIDER_TYPES),
("providerType", PROVIDER_TYPES),
("Webhook.subscriptions[]", SUBSCRIPTIONS),
("subscriptions[]", SUBSCRIPTIONS),
];
model! {
Webhook {
endpoint_id: "endpointId" => String,
endpoint_url: "endpointUrl" => String,
provider_type: "providerType" => String,
creator_login_name: "creatorLoginName" => String,
created: "created" => String,
last_modified: "lastModified" => String,
subscriptions: "subscriptions" => Vec<String>,
secret: "secret" => Secret,
}
WebhookList as "GET /tailnet/{tailnet}/webhooks 200" {
webhooks: "webhooks" => Vec<Webhook>,
}
CreateWebhookRequest as "POST /tailnet/{tailnet}/webhooks body" {
endpoint_url: "endpointUrl" => String,
provider_type: "providerType" => String,
subscriptions: "subscriptions" => Vec<String>,
}
UpdateWebhookRequest as "PATCH /webhooks/{endpointId} body" {
subscriptions: "subscriptions" => Vec<String>,
}
}