pub mod events;
pub mod deployments {
use crate::model::{misc::deployments::nested::*, prelude::*, user::SimpleUser};
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Deployment {
pub id: i64,
pub node_id: String,
pub sha: String,
#[serde(rename = "ref")]
pub ref_field: String,
pub task: String,
pub environment: String,
pub creator: Option<SimpleUser>,
pub payload: Value,
pub description: Option<String>,
pub statuses_url: String,
pub repository_url: String,
pub url: String,
pub created_at: String,
pub updated_at: String,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct DeploymentStatus {
pub id: i64,
pub node_id: String,
pub state: DeploymentState,
pub creator: Option<SimpleUser>,
pub description: String,
pub deployment_url: String,
pub target_url: String,
pub repository_url: String,
pub url: String,
pub created_at: String,
pub updated_at: String,
}
pub mod nested {
use crate::model::{organizations::SimpleOrganization, prelude::*, user::SimpleUser};
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize, EnumString, EnumVariantNames)]
#[serde(rename_all = "snake_case")]
pub enum DeploymentState {
Error,
Failure,
Inactive,
Pending,
Success,
Queued,
InProgress,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct MarketplacePurchase {
#[serde(flatten)]
pub account: UserOrOrg,
pub billing_cycle: MarketplaceBillingCycle,
pub unit_count: usize,
pub on_free_trial: bool,
pub free_trial_ends_on: String,
pub next_billing_date: String,
pub plan: MarketplacePlan,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum UserOrOrg {
User(SimpleUser),
Organization(SimpleOrganization),
}
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize, EnumString, EnumVariantNames)]
#[serde(rename_all = "snake_case")]
pub enum MarketplaceBillingCycle {
Yearly,
Monthly,
Nil,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct MarketplacePlan {
pub id: usize,
pub name: String,
pub description: String,
pub monthly_price_in_cents: usize,
pub yearly_price_in_cents: usize,
pub price_model: MarketplacePriceModel,
pub has_free_trial: bool,
pub unit_name: String,
pub bullet: Vec<String>,
}
#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize, EnumString, EnumVariantNames)]
#[serde(rename_all = "kebab-case")]
pub enum MarketplacePriceModel {
FlatRate,
PerUnit,
Free,
}
}
}