fakecloud_cloudfront/cfunctions.rs
1// CloudFront ConnectionFunction data types. Connection Functions are
2// edge functions that run on the connection-handling path (different
3// from regular CloudFront Functions which run on viewer requests).
4// Same lifecycle as Functions: create -> publish -> attached to
5// distributions.
6
7use chrono::{DateTime, Utc};
8use serde::{Deserialize, Serialize};
9
10#[derive(Debug, Clone, Serialize, Deserialize)]
11pub struct StoredConnectionFunction {
12 pub id: String,
13 pub name: String,
14 pub arn: String,
15 pub stage: String,
16 pub status: String,
17 pub runtime: String,
18 pub comment: String,
19 /// Latest source bytes (DEVELOPMENT stage). Replaced by
20 /// UpdateConnectionFunction; the LIVE snapshot lives in
21 /// `live_code` and is taken at PublishConnectionFunction.
22 pub code: Vec<u8>,
23 /// Snapshot of `code` taken at the most recent
24 /// PublishConnectionFunction. `TestConnectionFunction(Stage=LIVE)`
25 /// runs against this so the published behaviour stays stable while
26 /// DEVELOPMENT keeps mutating.
27 #[serde(default, skip_serializing_if = "Option::is_none")]
28 pub live_code: Option<Vec<u8>>,
29 pub etag: String,
30 pub created_time: DateTime<Utc>,
31 pub last_modified_time: DateTime<Utc>,
32}