google_cloud_storage/http/channels/mod.rs
1use std::collections::HashMap;
2
3use time::OffsetDateTime;
4
5pub mod stop;
6
7/// An notification channel used to watch for resource changes.
8#[derive(Clone, PartialEq, Eq, serde::Deserialize, serde::Serialize, Debug)]
9#[serde(rename_all = "camelCase")]
10pub struct WatchableChannel {
11 /// A UUID or similar unique string that identifies this channel.
12 pub id: String,
13 /// An opaque ID that identifies the resource being watched on this channel.
14 /// Stable across different API versions.
15 pub resource_id: String,
16 /// A version-specific identifier for the watched resource.
17 pub resource_uri: String,
18 /// An arbitrary string delivered to the target address with each notification
19 /// delivered over this channel. Optional.
20 pub token: String,
21 /// Date and time of notification channel expiration. Optional.
22 #[serde(default, with = "time::serde::rfc3339::option")]
23 pub expiration: Option<OffsetDateTime>,
24 /// The type of delivery mechanism used for this channel.
25 pub r#type: String,
26 /// The address where notifications are delivered for this channel.
27 pub address: String,
28 /// Additional parameters controlling delivery channel behavior. Optional.
29 pub params: HashMap<String, String>,
30 /// A Boolean value to indicate whether payload is wanted. Optional.
31 pub payload: bool,
32}
33
34#[derive(Clone, PartialEq, Eq, serde::Deserialize, serde::Serialize, Debug)]
35#[serde(rename_all = "camelCase")]
36pub struct Channel {
37 /// User-specified name for a channel. Needed to unsubscribe.
38 pub channel_id: String,
39 /// Opaque value generated by GCS representing a bucket. Needed to
40 /// unsubscribe.
41 pub resource_id: String,
42 /// Url used to identify where notifications are sent to.
43 pub push_url: String,
44 /// Email address of the subscriber.
45 pub subscriber_email: String,
46 /// Time when the channel was created.
47 #[serde(default, with = "time::serde::rfc3339::option")]
48 pub creation_time: Option<OffsetDateTime>,
49}