use chrono::DateTime;
use chrono::NaiveDate;
use chrono::Utc;
use serde_json::Value;
use std::collections::HashMap;
use url::Url;
use uuid::Uuid;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
pub enum ApplicationInfoOnboardingStepsEvent {
#[serde(rename = "ToDo")]
ToDo,
#[serde(rename = "Done")]
Done,
}
impl ApplicationInfoOnboardingStepsEvent {
pub const fn as_str(&self) -> &'static str {
match self {
Self::ToDo => "ToDo",
Self::Done => "Done",
}
}
}
impl std::fmt::Display for ApplicationInfoOnboardingStepsEvent {
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str(self.as_str())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
pub enum ApplicationInfoOnboardingStepsEventType {
#[serde(rename = "ToDo")]
ToDo,
#[serde(rename = "Done")]
Done,
}
impl ApplicationInfoOnboardingStepsEventType {
pub const fn as_str(&self) -> &'static str {
match self {
Self::ToDo => "ToDo",
Self::Done => "Done",
}
}
}
impl std::fmt::Display for ApplicationInfoOnboardingStepsEventType {
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str(self.as_str())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
pub enum ApplicationInfoOnboardingStepsSubscription {
#[serde(rename = "ToDo")]
ToDo,
#[serde(rename = "Done")]
Done,
}
impl ApplicationInfoOnboardingStepsSubscription {
pub const fn as_str(&self) -> &'static str {
match self {
Self::ToDo => "ToDo",
Self::Done => "Done",
}
}
}
impl std::fmt::Display for ApplicationInfoOnboardingStepsSubscription {
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str(self.as_str())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
pub enum OrganizationInfoOnboardingStepsApplication {
#[serde(rename = "ToDo")]
ToDo,
#[serde(rename = "Done")]
Done,
}
impl OrganizationInfoOnboardingStepsApplication {
pub const fn as_str(&self) -> &'static str {
match self {
Self::ToDo => "ToDo",
Self::Done => "Done",
}
}
}
impl std::fmt::Display for OrganizationInfoOnboardingStepsApplication {
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str(self.as_str())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
pub enum OrganizationInfoOnboardingStepsEvent {
#[serde(rename = "ToDo")]
ToDo,
#[serde(rename = "Done")]
Done,
}
impl OrganizationInfoOnboardingStepsEvent {
pub const fn as_str(&self) -> &'static str {
match self {
Self::ToDo => "ToDo",
Self::Done => "Done",
}
}
}
impl std::fmt::Display for OrganizationInfoOnboardingStepsEvent {
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str(self.as_str())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
pub enum OrganizationInfoOnboardingStepsEventType {
#[serde(rename = "ToDo")]
ToDo,
#[serde(rename = "Done")]
Done,
}
impl OrganizationInfoOnboardingStepsEventType {
pub const fn as_str(&self) -> &'static str {
match self {
Self::ToDo => "ToDo",
Self::Done => "Done",
}
}
}
impl std::fmt::Display for OrganizationInfoOnboardingStepsEventType {
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str(self.as_str())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
pub enum OrganizationInfoOnboardingStepsSubscription {
#[serde(rename = "ToDo")]
ToDo,
#[serde(rename = "Done")]
Done,
}
impl OrganizationInfoOnboardingStepsSubscription {
pub const fn as_str(&self) -> &'static str {
match self {
Self::ToDo => "ToDo",
Self::Done => "Done",
}
}
}
impl std::fmt::Display for OrganizationInfoOnboardingStepsSubscription {
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str(self.as_str())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
pub enum ProblemId {
#[serde(rename = "OrganizationNameMissing")]
OrganizationNameMissing,
#[serde(rename = "UserAlreadyExist")]
UserAlreadyExist,
#[serde(rename = "RegistrationDisabled")]
RegistrationDisabled,
#[serde(rename = "PasswordTooShort")]
PasswordTooShort,
#[serde(rename = "PasswordTooLong")]
PasswordTooLong,
#[serde(rename = "PasswordSimilarToEmail")]
PasswordSimilarToEmail,
#[serde(rename = "PasswordSimilarToName")]
PasswordSimilarToName,
#[serde(rename = "PasswordTooCommon")]
PasswordTooCommon,
#[serde(rename = "PasswordNotDiverseEnough")]
PasswordNotDiverseEnough,
#[serde(rename = "OrganizationIsNotEmpty")]
OrganizationIsNotEmpty,
#[serde(rename = "InvitedUserDoesNotExist")]
InvitedUserDoesNotExist,
#[serde(rename = "InvitedUserAlreadyInOrganization")]
InvitedUserAlreadyInOrganization,
#[serde(rename = "ApplicationNameMissing")]
ApplicationNameMissing,
#[serde(rename = "InvalidRole")]
InvalidRole,
#[serde(rename = "EventTypeAlreadyExist")]
EventTypeAlreadyExist,
#[serde(rename = "EventTypeDoesNotExist")]
EventTypeDoesNotExist,
#[serde(rename = "UnauthorizedWorkers")]
UnauthorizedWorkers,
#[serde(rename = "EventAlreadyIngested")]
EventAlreadyIngested,
#[serde(rename = "EventInvalidPayloadContentType")]
EventInvalidPayloadContentType,
#[serde(rename = "EventInvalidBase64Payload")]
EventInvalidBase64Payload,
#[serde(rename = "EventInvalidJsonPayload")]
EventInvalidJsonPayload,
#[serde(rename = "LabelsAmbiguity")]
LabelsAmbiguity,
#[serde(rename = "InvalidDateRange")]
InvalidDateRange,
#[serde(rename = "AuthNoAuthorizationHeader")]
AuthNoAuthorizationHeader,
#[serde(rename = "AuthInvalidAuthorizationHeader")]
AuthInvalidAuthorizationHeader,
#[serde(rename = "AuthApplicationSecretLookupError")]
AuthApplicationSecretLookupError,
#[serde(rename = "AuthInvalidApplicationSecret")]
AuthInvalidApplicationSecret,
#[serde(rename = "AuthBiscuitLookupError")]
AuthBiscuitLookupError,
#[serde(rename = "AuthInvalidBiscuit")]
AuthInvalidBiscuit,
#[serde(rename = "AuthFailedLogin")]
AuthFailedLogin,
#[serde(rename = "AuthEmailNotVerified")]
AuthEmailNotVerified,
#[serde(rename = "AuthEmailAlreadyVerified")]
AuthEmailAlreadyVerified,
#[serde(rename = "AuthFailedRefresh")]
AuthFailedRefresh,
#[serde(rename = "AuthEmailExpired")]
AuthEmailExpired,
#[serde(rename = "TooManyMembersPerOrganization")]
TooManyMembersPerOrganization,
#[serde(rename = "TooManyApplicationsPerOrganization")]
TooManyApplicationsPerOrganization,
#[serde(rename = "TooManyEventsToday")]
TooManyEventsToday,
#[serde(rename = "TooManySubscriptionsPerApplication")]
TooManySubscriptionsPerApplication,
#[serde(rename = "TooManyEventTypesPerApplication")]
TooManyEventTypesPerApplication,
#[serde(rename = "JsonPayload")]
JsonPayload,
#[serde(rename = "Validation")]
Validation,
#[serde(rename = "NotFound")]
NotFound,
#[serde(rename = "InternalServerError")]
InternalServerError,
#[serde(rename = "Forbidden")]
Forbidden,
#[serde(rename = "RateLimited")]
RateLimited,
#[serde(rename = "ServiceUnavailable")]
ServiceUnavailable,
}
impl ProblemId {
pub const fn as_str(&self) -> &'static str {
match self {
Self::OrganizationNameMissing => "OrganizationNameMissing",
Self::UserAlreadyExist => "UserAlreadyExist",
Self::RegistrationDisabled => "RegistrationDisabled",
Self::PasswordTooShort => "PasswordTooShort",
Self::PasswordTooLong => "PasswordTooLong",
Self::PasswordSimilarToEmail => "PasswordSimilarToEmail",
Self::PasswordSimilarToName => "PasswordSimilarToName",
Self::PasswordTooCommon => "PasswordTooCommon",
Self::PasswordNotDiverseEnough => "PasswordNotDiverseEnough",
Self::OrganizationIsNotEmpty => "OrganizationIsNotEmpty",
Self::InvitedUserDoesNotExist => "InvitedUserDoesNotExist",
Self::InvitedUserAlreadyInOrganization => "InvitedUserAlreadyInOrganization",
Self::ApplicationNameMissing => "ApplicationNameMissing",
Self::InvalidRole => "InvalidRole",
Self::EventTypeAlreadyExist => "EventTypeAlreadyExist",
Self::EventTypeDoesNotExist => "EventTypeDoesNotExist",
Self::UnauthorizedWorkers => "UnauthorizedWorkers",
Self::EventAlreadyIngested => "EventAlreadyIngested",
Self::EventInvalidPayloadContentType => "EventInvalidPayloadContentType",
Self::EventInvalidBase64Payload => "EventInvalidBase64Payload",
Self::EventInvalidJsonPayload => "EventInvalidJsonPayload",
Self::LabelsAmbiguity => "LabelsAmbiguity",
Self::InvalidDateRange => "InvalidDateRange",
Self::AuthNoAuthorizationHeader => "AuthNoAuthorizationHeader",
Self::AuthInvalidAuthorizationHeader => "AuthInvalidAuthorizationHeader",
Self::AuthApplicationSecretLookupError => "AuthApplicationSecretLookupError",
Self::AuthInvalidApplicationSecret => "AuthInvalidApplicationSecret",
Self::AuthBiscuitLookupError => "AuthBiscuitLookupError",
Self::AuthInvalidBiscuit => "AuthInvalidBiscuit",
Self::AuthFailedLogin => "AuthFailedLogin",
Self::AuthEmailNotVerified => "AuthEmailNotVerified",
Self::AuthEmailAlreadyVerified => "AuthEmailAlreadyVerified",
Self::AuthFailedRefresh => "AuthFailedRefresh",
Self::AuthEmailExpired => "AuthEmailExpired",
Self::TooManyMembersPerOrganization => "TooManyMembersPerOrganization",
Self::TooManyApplicationsPerOrganization => "TooManyApplicationsPerOrganization",
Self::TooManyEventsToday => "TooManyEventsToday",
Self::TooManySubscriptionsPerApplication => "TooManySubscriptionsPerApplication",
Self::TooManyEventTypesPerApplication => "TooManyEventTypesPerApplication",
Self::JsonPayload => "JsonPayload",
Self::Validation => "Validation",
Self::NotFound => "NotFound",
Self::InternalServerError => "InternalServerError",
Self::Forbidden => "Forbidden",
Self::RateLimited => "RateLimited",
Self::ServiceUnavailable => "ServiceUnavailable",
}
}
}
impl std::fmt::Display for ProblemId {
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str(self.as_str())
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
pub enum RequestAttemptStatusType {
#[serde(rename = "waiting")]
Waiting,
#[serde(rename = "pending")]
Pending,
#[serde(rename = "in_progress")]
InProgress,
#[serde(rename = "successful")]
Successful,
#[serde(rename = "failed")]
Failed,
}
impl RequestAttemptStatusType {
pub const fn as_str(&self) -> &'static str {
match self {
Self::Waiting => "waiting",
Self::Pending => "pending",
Self::InProgress => "in_progress",
Self::Successful => "successful",
Self::Failed => "failed",
}
}
}
impl std::fmt::Display for RequestAttemptStatusType {
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str(self.as_str())
}
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct Application {
#[serde(rename = "application_id")]
pub application_id: Uuid,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "organization_id")]
pub organization_id: Uuid,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ApplicationInfo {
#[serde(rename = "application_id")]
pub application_id: Uuid,
#[serde(rename = "consumption")]
pub consumption: ApplicationInfoConsumption,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "onboarding_steps")]
pub onboarding_steps: ApplicationInfoOnboardingSteps,
#[serde(rename = "organization_id")]
pub organization_id: Uuid,
#[serde(rename = "quotas")]
pub quotas: ApplicationInfoQuotas,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ApplicationInfoConsumption {
#[serde(rename = "events_per_day")]
#[serde(skip_serializing_if = "Option::is_none")]
pub events_per_day: Option<i32>,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ApplicationInfoOnboardingSteps {
#[serde(rename = "event")]
pub event: ApplicationInfoOnboardingStepsEvent,
#[serde(rename = "event_type")]
pub event_type: ApplicationInfoOnboardingStepsEventType,
#[serde(rename = "subscription")]
pub subscription: ApplicationInfoOnboardingStepsSubscription,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ApplicationInfoQuotas {
#[serde(rename = "days_of_events_retention_limit")]
pub days_of_events_retention_limit: i32,
#[serde(rename = "events_per_day_limit")]
pub events_per_day_limit: i32,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ApplicationPost {
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "organization_id")]
pub organization_id: Uuid,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ApplicationSecret {
#[serde(rename = "created_at")]
pub created_at: DateTime<Utc>,
#[serde(rename = "deleted_at")]
#[serde(skip_serializing_if = "Option::is_none")]
pub deleted_at: Option<DateTime<Utc>>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "token")]
pub token: Uuid,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ApplicationSecretPost {
#[serde(rename = "application_id")]
pub application_id: Uuid,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct Event {
#[serde(rename = "event_id")]
pub event_id: Uuid,
#[serde(rename = "event_type_name")]
pub event_type_name: String,
#[serde(rename = "ip")]
pub ip: String,
#[serde(rename = "labels")]
pub labels: Value,
#[serde(rename = "metadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metadata: Option<Value>,
#[serde(rename = "occurred_at")]
pub occurred_at: DateTime<Utc>,
#[serde(rename = "payload_content_type")]
pub payload_content_type: String,
#[serde(rename = "received_at")]
pub received_at: DateTime<Utc>,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct EventPost {
#[serde(rename = "application_id")]
pub application_id: Uuid,
#[serde(rename = "event_id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_id: Option<Uuid>,
#[serde(rename = "event_type")]
pub event_type: String,
#[serde(rename = "labels")]
pub labels: HashMap<String, String>,
#[serde(rename = "metadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metadata: Option<HashMap<String, String>>,
#[serde(rename = "occurred_at")]
pub occurred_at: DateTime<Utc>,
#[serde(rename = "payload")]
pub payload: String,
#[serde(rename = "payload_content_type")]
pub payload_content_type: String,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct EventType {
#[serde(rename = "event_type_name")]
pub event_type_name: String,
#[serde(rename = "resource_type_name")]
pub resource_type_name: String,
#[serde(rename = "service_name")]
pub service_name: String,
#[serde(rename = "verb_name")]
pub verb_name: String,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct EventTypePost {
#[serde(rename = "application_id")]
pub application_id: Uuid,
#[serde(rename = "resource_type")]
pub resource_type: String,
#[serde(rename = "service")]
pub service: String,
#[serde(rename = "verb")]
pub verb: String,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct EventWithPayload {
#[serde(rename = "event_id")]
pub event_id: Uuid,
#[serde(rename = "event_type_name")]
pub event_type_name: String,
#[serde(rename = "ip")]
pub ip: String,
#[serde(rename = "labels")]
pub labels: Value,
#[serde(rename = "metadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metadata: Option<Value>,
#[serde(rename = "occurred_at")]
pub occurred_at: DateTime<Utc>,
#[serde(rename = "payload")]
pub payload: String,
#[serde(rename = "payload_content_type")]
pub payload_content_type: String,
#[serde(rename = "received_at")]
pub received_at: DateTime<Utc>,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct EventsPerDayEntry {
#[serde(rename = "amount")]
pub amount: i32,
#[serde(rename = "application_id")]
pub application_id: Uuid,
#[serde(rename = "application_name")]
pub application_name: String,
#[serde(rename = "date")]
pub date: NaiveDate,
#[serde(rename = "is_provisional")]
pub is_provisional: bool,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct IngestedEvent {
#[serde(rename = "application_id")]
pub application_id: Uuid,
#[serde(rename = "event_id")]
pub event_id: Uuid,
#[serde(rename = "received_at")]
pub received_at: DateTime<Utc>,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct InstanceConfig {
#[serde(rename = "application_secret_compatibility")]
pub application_secret_compatibility: bool,
#[serde(rename = "auto_db_migration")]
pub auto_db_migration: bool,
#[serde(rename = "biscuit_public_key")]
pub biscuit_public_key: String,
#[serde(rename = "cloudflare_turnstile_site_key")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cloudflare_turnstile_site_key: Option<String>,
#[serde(rename = "formbricks")]
#[serde(skip_serializing_if = "Option::is_none")]
pub formbricks: Option<InstanceConfigFormbricks>,
#[serde(rename = "matomo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub matomo: Option<InstanceConfigMatomo>,
#[serde(rename = "password_minimum_length")]
pub password_minimum_length: i32,
#[serde(rename = "quota_enforcement")]
pub quota_enforcement: bool,
#[serde(rename = "registration_disabled")]
pub registration_disabled: bool,
#[serde(rename = "support_email_address")]
pub support_email_address: String,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct InstanceConfigFormbricks {
#[serde(rename = "api_host")]
pub api_host: String,
#[serde(rename = "environment_id")]
pub environment_id: String,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct InstanceConfigMatomo {
#[serde(rename = "site_id")]
pub site_id: i32,
#[serde(rename = "url")]
pub url: String,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct Organization {
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "organization_id")]
pub organization_id: Uuid,
#[serde(rename = "plan")]
#[serde(skip_serializing_if = "Option::is_none")]
pub plan: Option<OrganizationPlan>,
#[serde(rename = "role")]
pub role: String,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct OrganizationInfo {
#[serde(rename = "consumption")]
pub consumption: OrganizationInfoConsumption,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "onboarding_steps")]
pub onboarding_steps: OrganizationInfoOnboardingSteps,
#[serde(rename = "organization_id")]
pub organization_id: Uuid,
#[serde(rename = "plan")]
#[serde(skip_serializing_if = "Option::is_none")]
pub plan: Option<OrganizationInfoPlan>,
#[serde(rename = "quotas")]
pub quotas: OrganizationInfoQuotas,
#[serde(rename = "users")]
pub users: Vec<OrganizationInfoUsers>,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct OrganizationInfoConsumption {
#[serde(rename = "applications")]
#[serde(skip_serializing_if = "Option::is_none")]
pub applications: Option<i64>,
#[serde(rename = "events_per_day")]
#[serde(skip_serializing_if = "Option::is_none")]
pub events_per_day: Option<i64>,
#[serde(rename = "members")]
#[serde(skip_serializing_if = "Option::is_none")]
pub members: Option<i64>,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct OrganizationInfoOnboardingSteps {
#[serde(rename = "application")]
pub application: OrganizationInfoOnboardingStepsApplication,
#[serde(rename = "event")]
pub event: OrganizationInfoOnboardingStepsEvent,
#[serde(rename = "event_type")]
pub event_type: OrganizationInfoOnboardingStepsEventType,
#[serde(rename = "subscription")]
pub subscription: OrganizationInfoOnboardingStepsSubscription,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct OrganizationInfoPlan {
#[serde(rename = "label")]
pub label: String,
#[serde(rename = "name")]
pub name: String,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct OrganizationInfoQuotas {
#[serde(rename = "applications_per_organization_limit")]
pub applications_per_organization_limit: i32,
#[serde(rename = "days_of_events_retention_limit")]
pub days_of_events_retention_limit: i32,
#[serde(rename = "events_per_day_limit")]
pub events_per_day_limit: i32,
#[serde(rename = "members_per_organization_limit")]
pub members_per_organization_limit: i32,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct OrganizationInfoUsers {
#[serde(rename = "email")]
pub email: String,
#[serde(rename = "first_name")]
pub first_name: String,
#[serde(rename = "last_name")]
pub last_name: String,
#[serde(rename = "role")]
pub role: String,
#[serde(rename = "user_id")]
pub user_id: Uuid,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct OrganizationPlan {
#[serde(rename = "label")]
pub label: String,
#[serde(rename = "name")]
pub name: String,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct Problem {
#[serde(rename = "detail")]
pub detail: String,
#[serde(rename = "id")]
pub id: ProblemId,
#[serde(rename = "status")]
pub status: i32,
#[serde(rename = "title")]
pub title: String,
#[serde(rename = "type")]
pub type_: String,
#[serde(rename = "validation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub validation: Option<Value>,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct QuotasResponse {
#[serde(rename = "enabled")]
pub enabled: bool,
#[serde(rename = "limits")]
pub limits: QuotasResponseLimits,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct QuotasResponseLimits {
#[serde(rename = "global_applications_per_organization_limit")]
pub global_applications_per_organization_limit: i32,
#[serde(rename = "global_days_of_events_retention_limit")]
pub global_days_of_events_retention_limit: i32,
#[serde(rename = "global_event_types_per_application_limit")]
pub global_event_types_per_application_limit: i32,
#[serde(rename = "global_events_per_day_limit")]
pub global_events_per_day_limit: i32,
#[serde(rename = "global_members_per_organization_limit")]
pub global_members_per_organization_limit: i32,
#[serde(rename = "global_subscriptions_per_application_limit")]
pub global_subscriptions_per_application_limit: i32,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ReplayEvent {
#[serde(rename = "application_id")]
pub application_id: Uuid,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct RequestAttempt {
#[serde(rename = "created_at")]
pub created_at: DateTime<Utc>,
#[serde(rename = "delay_until")]
#[serde(skip_serializing_if = "Option::is_none")]
pub delay_until: Option<DateTime<Utc>>,
#[serde(rename = "event")]
pub event: RequestAttemptEvent,
#[serde(rename = "event_id")]
pub event_id: Uuid,
#[serde(rename = "failed_at")]
#[serde(skip_serializing_if = "Option::is_none")]
pub failed_at: Option<DateTime<Utc>>,
#[serde(rename = "http_response_status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub http_response_status: Option<i32>,
#[serde(rename = "picked_at")]
#[serde(skip_serializing_if = "Option::is_none")]
pub picked_at: Option<DateTime<Utc>>,
#[serde(rename = "request_attempt_id")]
pub request_attempt_id: Uuid,
#[serde(rename = "response_id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub response_id: Option<Uuid>,
#[serde(rename = "retry_count")]
pub retry_count: i32,
#[serde(rename = "status")]
pub status: RequestAttemptStatus,
#[serde(rename = "subscription")]
pub subscription: RequestAttemptSubscription,
#[serde(rename = "succeeded_at")]
#[serde(skip_serializing_if = "Option::is_none")]
pub succeeded_at: Option<DateTime<Utc>>,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct RequestAttemptEvent {
#[serde(rename = "event_id")]
pub event_id: Uuid,
#[serde(rename = "event_type_name")]
pub event_type_name: String,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct RequestAttemptStatus {
#[serde(rename = "at")]
#[serde(skip_serializing_if = "Option::is_none")]
pub at: Option<DateTime<Utc>>,
#[serde(rename = "full_processing_ms")]
#[serde(skip_serializing_if = "Option::is_none")]
pub full_processing_ms: Option<i64>,
#[serde(rename = "since")]
#[serde(skip_serializing_if = "Option::is_none")]
pub since: Option<DateTime<Utc>>,
#[serde(rename = "type")]
pub type_: RequestAttemptStatusType,
#[serde(rename = "until")]
#[serde(skip_serializing_if = "Option::is_none")]
pub until: Option<DateTime<Utc>>,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct RequestAttemptSubscription {
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "subscription_id")]
pub subscription_id: Uuid,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct Response {
#[serde(rename = "body")]
#[serde(skip_serializing_if = "Option::is_none")]
pub body: Option<String>,
#[serde(rename = "elapsed_time_ms")]
#[serde(skip_serializing_if = "Option::is_none")]
pub elapsed_time_ms: Option<i32>,
#[serde(rename = "headers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub headers: Option<HashMap<String, String>>,
#[serde(rename = "http_code")]
#[serde(skip_serializing_if = "Option::is_none")]
pub http_code: Option<i32>,
#[serde(rename = "response_error_name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub response_error_name: Option<String>,
#[serde(rename = "response_id")]
pub response_id: Uuid,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ServiceToken {
#[serde(rename = "biscuit")]
pub biscuit: String,
#[serde(rename = "created_at")]
pub created_at: DateTime<Utc>,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "token_id")]
pub token_id: Uuid,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct ServiceTokenPost {
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "organization_id")]
pub organization_id: Uuid,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct Subscription {
#[serde(rename = "application_id")]
pub application_id: Uuid,
#[serde(rename = "created_at")]
pub created_at: DateTime<Utc>,
#[serde(rename = "dedicated_workers")]
pub dedicated_workers: Vec<String>,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "event_types")]
pub event_types: Vec<String>,
#[serde(rename = "is_enabled")]
pub is_enabled: bool,
#[serde(rename = "label_key")]
pub label_key: String,
#[serde(rename = "label_value")]
pub label_value: String,
#[serde(rename = "labels")]
pub labels: HashMap<String, String>,
#[serde(rename = "metadata")]
pub metadata: HashMap<String, String>,
#[serde(rename = "secret")]
pub secret: Uuid,
#[serde(rename = "subscription_id")]
pub subscription_id: Uuid,
#[serde(rename = "target")]
pub target: SubscriptionTarget,
#[serde(rename = "updated_at")]
pub updated_at: DateTime<Utc>,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct SubscriptionPost {
#[serde(rename = "application_id")]
pub application_id: Uuid,
#[serde(rename = "dedicated_workers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dedicated_workers: Option<Vec<String>>,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "event_types")]
pub event_types: Vec<String>,
#[serde(rename = "is_enabled")]
pub is_enabled: bool,
#[serde(rename = "label_key")]
#[serde(skip_serializing_if = "Option::is_none")]
pub label_key: Option<String>,
#[serde(rename = "label_value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub label_value: Option<String>,
#[serde(rename = "labels")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<HashMap<String, String>>,
#[serde(rename = "metadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metadata: Option<HashMap<String, String>>,
#[serde(rename = "target")]
pub target: SubscriptionPostTarget,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct SubscriptionPostTarget {
#[serde(rename = "headers")]
pub headers: Value,
#[serde(rename = "method")]
pub method: String,
#[serde(rename = "type")]
pub type_: String,
#[serde(rename = "url")]
pub url: Url,
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct SubscriptionTarget {
#[serde(rename = "headers")]
pub headers: Value,
#[serde(rename = "method")]
pub method: String,
#[serde(rename = "type")]
pub type_: String,
#[serde(rename = "url")]
pub url: Url,
}