ephemeris_forge_github/live.rs
1mod actions;
2mod security;
3mod variables;
4
5use std::collections::BTreeMap;
6
7use ephemeris_forge::{AccessState, UserName};
8
9pub use self::actions::Actions as ActionsLive;
10pub(crate) use self::security::View as SecurityView;
11pub(crate) use self::variables::View as VariablesView;
12use crate::Permission;
13use crate::api::model::{
14 Autolink, Environment, ImmutableReleases, Invitation, Label, OwnerKind, Pages, PropertyEntry,
15 Repository, Ruleset, Security, Variable, Webhook,
16};
17
18/// The GitHub state that planning compares with the configuration.
19#[derive(Clone, Debug, Default)]
20pub struct Live {
21 /// The repository as GitHub reports it.
22 pub repository: Repository,
23 /// The immutable-release setting. `None` when unread or when GitHub does
24 /// not offer it for the repository.
25 pub immutable_releases: Option<ImmutableReleases>,
26 /// The security settings behind their own endpoints.
27 pub security: Security,
28 /// The Pages site, if the repository has one.
29 pub pages: Option<Pages>,
30 /// The repository's deployment environments. Empty unless environments
31 /// are managed.
32 pub environments: Vec<Environment>,
33 /// The repository's Actions variables. Empty unless variables are managed.
34 pub variables: Vec<Variable>,
35 /// The Actions variables of each environment that exists. Empty unless
36 /// variables are managed.
37 pub environment_variables: BTreeMap<String, Vec<Variable>>,
38 /// The custom property values GitHub reports. `None` when unread or when
39 /// the repository has no custom properties.
40 pub custom_properties: Option<Vec<PropertyEntry>>,
41 /// The repository's rulesets.
42 pub rulesets: Vec<Ruleset>,
43 /// The team and collaborator grants. Empty unless access is managed.
44 pub access: AccessState<Permission>,
45 /// Pending invitations by invited user. Empty unless access is managed.
46 pub invitations: BTreeMap<UserName, Invitation>,
47 /// The kind of account that owns the repository. Read only when the
48 /// configuration declares a custom role, and an organization when unread.
49 pub owner: Option<OwnerKind>,
50 /// The Actions settings groups that configuration manages.
51 pub actions: ActionsLive,
52 /// The repository's autolink references. Empty unless autolinks are
53 /// managed.
54 pub autolinks: Vec<Autolink>,
55 /// The repository's labels. Empty unless labels are managed.
56 pub labels: Vec<Label>,
57 /// The repository's webhooks. Empty unless webhooks are managed.
58 pub webhooks: Vec<Webhook>,
59}