1use chrono::DateTime;
6use chrono::NaiveDate;
7use chrono::Utc;
8use serde_json::Value;
9use std::collections::HashMap;
10use url::Url;
11use uuid::Uuid;
12
13#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
15pub enum ApplicationInfoOnboardingStepsEvent {
16 #[serde(rename = "ToDo")]
18 ToDo,
19 #[serde(rename = "Done")]
21 Done,
22}
23
24impl ApplicationInfoOnboardingStepsEvent {
25 pub const fn as_str(&self) -> &'static str {
27 match self {
28 Self::ToDo => "ToDo",
29 Self::Done => "Done",
30 }
31 }
32}
33
34impl std::fmt::Display for ApplicationInfoOnboardingStepsEvent {
35 fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
36 formatter.write_str(self.as_str())
37 }
38}
39
40#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
42pub enum ApplicationInfoOnboardingStepsEventType {
43 #[serde(rename = "ToDo")]
45 ToDo,
46 #[serde(rename = "Done")]
48 Done,
49}
50
51impl ApplicationInfoOnboardingStepsEventType {
52 pub const fn as_str(&self) -> &'static str {
54 match self {
55 Self::ToDo => "ToDo",
56 Self::Done => "Done",
57 }
58 }
59}
60
61impl std::fmt::Display for ApplicationInfoOnboardingStepsEventType {
62 fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
63 formatter.write_str(self.as_str())
64 }
65}
66
67#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
69pub enum ApplicationInfoOnboardingStepsSubscription {
70 #[serde(rename = "ToDo")]
72 ToDo,
73 #[serde(rename = "Done")]
75 Done,
76}
77
78impl ApplicationInfoOnboardingStepsSubscription {
79 pub const fn as_str(&self) -> &'static str {
81 match self {
82 Self::ToDo => "ToDo",
83 Self::Done => "Done",
84 }
85 }
86}
87
88impl std::fmt::Display for ApplicationInfoOnboardingStepsSubscription {
89 fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
90 formatter.write_str(self.as_str())
91 }
92}
93
94#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
96pub enum OrganizationInfoOnboardingStepsApplication {
97 #[serde(rename = "ToDo")]
99 ToDo,
100 #[serde(rename = "Done")]
102 Done,
103}
104
105impl OrganizationInfoOnboardingStepsApplication {
106 pub const fn as_str(&self) -> &'static str {
108 match self {
109 Self::ToDo => "ToDo",
110 Self::Done => "Done",
111 }
112 }
113}
114
115impl std::fmt::Display for OrganizationInfoOnboardingStepsApplication {
116 fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
117 formatter.write_str(self.as_str())
118 }
119}
120
121#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
123pub enum OrganizationInfoOnboardingStepsEvent {
124 #[serde(rename = "ToDo")]
126 ToDo,
127 #[serde(rename = "Done")]
129 Done,
130}
131
132impl OrganizationInfoOnboardingStepsEvent {
133 pub const fn as_str(&self) -> &'static str {
135 match self {
136 Self::ToDo => "ToDo",
137 Self::Done => "Done",
138 }
139 }
140}
141
142impl std::fmt::Display for OrganizationInfoOnboardingStepsEvent {
143 fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
144 formatter.write_str(self.as_str())
145 }
146}
147
148#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
150pub enum OrganizationInfoOnboardingStepsEventType {
151 #[serde(rename = "ToDo")]
153 ToDo,
154 #[serde(rename = "Done")]
156 Done,
157}
158
159impl OrganizationInfoOnboardingStepsEventType {
160 pub const fn as_str(&self) -> &'static str {
162 match self {
163 Self::ToDo => "ToDo",
164 Self::Done => "Done",
165 }
166 }
167}
168
169impl std::fmt::Display for OrganizationInfoOnboardingStepsEventType {
170 fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
171 formatter.write_str(self.as_str())
172 }
173}
174
175#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
177pub enum OrganizationInfoOnboardingStepsSubscription {
178 #[serde(rename = "ToDo")]
180 ToDo,
181 #[serde(rename = "Done")]
183 Done,
184}
185
186impl OrganizationInfoOnboardingStepsSubscription {
187 pub const fn as_str(&self) -> &'static str {
189 match self {
190 Self::ToDo => "ToDo",
191 Self::Done => "Done",
192 }
193 }
194}
195
196impl std::fmt::Display for OrganizationInfoOnboardingStepsSubscription {
197 fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
198 formatter.write_str(self.as_str())
199 }
200}
201
202#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
204pub enum ProblemId {
205 #[serde(rename = "OrganizationNameMissing")]
207 OrganizationNameMissing,
208 #[serde(rename = "UserAlreadyExist")]
210 UserAlreadyExist,
211 #[serde(rename = "RegistrationDisabled")]
213 RegistrationDisabled,
214 #[serde(rename = "PasswordTooShort")]
216 PasswordTooShort,
217 #[serde(rename = "PasswordTooLong")]
219 PasswordTooLong,
220 #[serde(rename = "PasswordSimilarToEmail")]
222 PasswordSimilarToEmail,
223 #[serde(rename = "PasswordSimilarToName")]
225 PasswordSimilarToName,
226 #[serde(rename = "PasswordTooCommon")]
228 PasswordTooCommon,
229 #[serde(rename = "PasswordNotDiverseEnough")]
231 PasswordNotDiverseEnough,
232 #[serde(rename = "OrganizationIsNotEmpty")]
234 OrganizationIsNotEmpty,
235 #[serde(rename = "InvitedUserDoesNotExist")]
237 InvitedUserDoesNotExist,
238 #[serde(rename = "InvitedUserAlreadyInOrganization")]
240 InvitedUserAlreadyInOrganization,
241 #[serde(rename = "ApplicationNameMissing")]
243 ApplicationNameMissing,
244 #[serde(rename = "InvalidRole")]
246 InvalidRole,
247 #[serde(rename = "EventTypeAlreadyExist")]
249 EventTypeAlreadyExist,
250 #[serde(rename = "EventTypeDoesNotExist")]
252 EventTypeDoesNotExist,
253 #[serde(rename = "UnauthorizedWorkers")]
255 UnauthorizedWorkers,
256 #[serde(rename = "EventAlreadyIngested")]
258 EventAlreadyIngested,
259 #[serde(rename = "EventInvalidPayloadContentType")]
261 EventInvalidPayloadContentType,
262 #[serde(rename = "EventInvalidBase64Payload")]
264 EventInvalidBase64Payload,
265 #[serde(rename = "EventInvalidJsonPayload")]
267 EventInvalidJsonPayload,
268 #[serde(rename = "LabelsAmbiguity")]
270 LabelsAmbiguity,
271 #[serde(rename = "InvalidDateRange")]
273 InvalidDateRange,
274 #[serde(rename = "AuthNoAuthorizationHeader")]
276 AuthNoAuthorizationHeader,
277 #[serde(rename = "AuthInvalidAuthorizationHeader")]
279 AuthInvalidAuthorizationHeader,
280 #[serde(rename = "AuthApplicationSecretLookupError")]
282 AuthApplicationSecretLookupError,
283 #[serde(rename = "AuthInvalidApplicationSecret")]
285 AuthInvalidApplicationSecret,
286 #[serde(rename = "AuthBiscuitLookupError")]
288 AuthBiscuitLookupError,
289 #[serde(rename = "AuthInvalidBiscuit")]
291 AuthInvalidBiscuit,
292 #[serde(rename = "AuthFailedLogin")]
294 AuthFailedLogin,
295 #[serde(rename = "AuthEmailNotVerified")]
297 AuthEmailNotVerified,
298 #[serde(rename = "AuthEmailAlreadyVerified")]
300 AuthEmailAlreadyVerified,
301 #[serde(rename = "AuthFailedRefresh")]
303 AuthFailedRefresh,
304 #[serde(rename = "AuthEmailExpired")]
306 AuthEmailExpired,
307 #[serde(rename = "TooManyMembersPerOrganization")]
309 TooManyMembersPerOrganization,
310 #[serde(rename = "TooManyApplicationsPerOrganization")]
312 TooManyApplicationsPerOrganization,
313 #[serde(rename = "TooManyEventsToday")]
315 TooManyEventsToday,
316 #[serde(rename = "TooManySubscriptionsPerApplication")]
318 TooManySubscriptionsPerApplication,
319 #[serde(rename = "TooManyEventTypesPerApplication")]
321 TooManyEventTypesPerApplication,
322 #[serde(rename = "JsonPayload")]
324 JsonPayload,
325 #[serde(rename = "Validation")]
327 Validation,
328 #[serde(rename = "NotFound")]
330 NotFound,
331 #[serde(rename = "InternalServerError")]
333 InternalServerError,
334 #[serde(rename = "Forbidden")]
336 Forbidden,
337 #[serde(rename = "RateLimited")]
339 RateLimited,
340 #[serde(rename = "ServiceUnavailable")]
342 ServiceUnavailable,
343}
344
345impl ProblemId {
346 pub const fn as_str(&self) -> &'static str {
348 match self {
349 Self::OrganizationNameMissing => "OrganizationNameMissing",
350 Self::UserAlreadyExist => "UserAlreadyExist",
351 Self::RegistrationDisabled => "RegistrationDisabled",
352 Self::PasswordTooShort => "PasswordTooShort",
353 Self::PasswordTooLong => "PasswordTooLong",
354 Self::PasswordSimilarToEmail => "PasswordSimilarToEmail",
355 Self::PasswordSimilarToName => "PasswordSimilarToName",
356 Self::PasswordTooCommon => "PasswordTooCommon",
357 Self::PasswordNotDiverseEnough => "PasswordNotDiverseEnough",
358 Self::OrganizationIsNotEmpty => "OrganizationIsNotEmpty",
359 Self::InvitedUserDoesNotExist => "InvitedUserDoesNotExist",
360 Self::InvitedUserAlreadyInOrganization => "InvitedUserAlreadyInOrganization",
361 Self::ApplicationNameMissing => "ApplicationNameMissing",
362 Self::InvalidRole => "InvalidRole",
363 Self::EventTypeAlreadyExist => "EventTypeAlreadyExist",
364 Self::EventTypeDoesNotExist => "EventTypeDoesNotExist",
365 Self::UnauthorizedWorkers => "UnauthorizedWorkers",
366 Self::EventAlreadyIngested => "EventAlreadyIngested",
367 Self::EventInvalidPayloadContentType => "EventInvalidPayloadContentType",
368 Self::EventInvalidBase64Payload => "EventInvalidBase64Payload",
369 Self::EventInvalidJsonPayload => "EventInvalidJsonPayload",
370 Self::LabelsAmbiguity => "LabelsAmbiguity",
371 Self::InvalidDateRange => "InvalidDateRange",
372 Self::AuthNoAuthorizationHeader => "AuthNoAuthorizationHeader",
373 Self::AuthInvalidAuthorizationHeader => "AuthInvalidAuthorizationHeader",
374 Self::AuthApplicationSecretLookupError => "AuthApplicationSecretLookupError",
375 Self::AuthInvalidApplicationSecret => "AuthInvalidApplicationSecret",
376 Self::AuthBiscuitLookupError => "AuthBiscuitLookupError",
377 Self::AuthInvalidBiscuit => "AuthInvalidBiscuit",
378 Self::AuthFailedLogin => "AuthFailedLogin",
379 Self::AuthEmailNotVerified => "AuthEmailNotVerified",
380 Self::AuthEmailAlreadyVerified => "AuthEmailAlreadyVerified",
381 Self::AuthFailedRefresh => "AuthFailedRefresh",
382 Self::AuthEmailExpired => "AuthEmailExpired",
383 Self::TooManyMembersPerOrganization => "TooManyMembersPerOrganization",
384 Self::TooManyApplicationsPerOrganization => "TooManyApplicationsPerOrganization",
385 Self::TooManyEventsToday => "TooManyEventsToday",
386 Self::TooManySubscriptionsPerApplication => "TooManySubscriptionsPerApplication",
387 Self::TooManyEventTypesPerApplication => "TooManyEventTypesPerApplication",
388 Self::JsonPayload => "JsonPayload",
389 Self::Validation => "Validation",
390 Self::NotFound => "NotFound",
391 Self::InternalServerError => "InternalServerError",
392 Self::Forbidden => "Forbidden",
393 Self::RateLimited => "RateLimited",
394 Self::ServiceUnavailable => "ServiceUnavailable",
395 }
396 }
397}
398
399impl std::fmt::Display for ProblemId {
400 fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
401 formatter.write_str(self.as_str())
402 }
403}
404
405#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
407pub enum RequestAttemptStatusType {
408 #[serde(rename = "waiting")]
410 Waiting,
411 #[serde(rename = "pending")]
413 Pending,
414 #[serde(rename = "in_progress")]
416 InProgress,
417 #[serde(rename = "successful")]
419 Successful,
420 #[serde(rename = "failed")]
422 Failed,
423}
424
425impl RequestAttemptStatusType {
426 pub const fn as_str(&self) -> &'static str {
428 match self {
429 Self::Waiting => "waiting",
430 Self::Pending => "pending",
431 Self::InProgress => "in_progress",
432 Self::Successful => "successful",
433 Self::Failed => "failed",
434 }
435 }
436}
437
438impl std::fmt::Display for RequestAttemptStatusType {
439 fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
440 formatter.write_str(self.as_str())
441 }
442}
443
444#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
446pub struct Application {
447 #[serde(rename = "application_id")]
449 pub application_id: Uuid,
450 #[serde(rename = "name")]
452 pub name: String,
453 #[serde(rename = "organization_id")]
455 pub organization_id: Uuid,
456}
457
458#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
460pub struct ApplicationInfo {
461 #[serde(rename = "application_id")]
463 pub application_id: Uuid,
464 #[serde(rename = "consumption")]
466 pub consumption: ApplicationInfoConsumption,
467 #[serde(rename = "name")]
469 pub name: String,
470 #[serde(rename = "onboarding_steps")]
472 pub onboarding_steps: ApplicationInfoOnboardingSteps,
473 #[serde(rename = "organization_id")]
475 pub organization_id: Uuid,
476 #[serde(rename = "quotas")]
478 pub quotas: ApplicationInfoQuotas,
479}
480
481#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
483pub struct ApplicationInfoConsumption {
484 #[serde(rename = "events_per_day")]
486 #[serde(skip_serializing_if = "Option::is_none")]
487 pub events_per_day: Option<i32>,
488}
489
490#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
492pub struct ApplicationInfoOnboardingSteps {
493 #[serde(rename = "event")]
495 pub event: ApplicationInfoOnboardingStepsEvent,
496 #[serde(rename = "event_type")]
498 pub event_type: ApplicationInfoOnboardingStepsEventType,
499 #[serde(rename = "subscription")]
501 pub subscription: ApplicationInfoOnboardingStepsSubscription,
502}
503
504#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
506pub struct ApplicationInfoQuotas {
507 #[serde(rename = "days_of_events_retention_limit")]
509 pub days_of_events_retention_limit: i32,
510 #[serde(rename = "events_per_day_limit")]
512 pub events_per_day_limit: i32,
513}
514
515#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
517pub struct ApplicationPost {
518 #[serde(rename = "name")]
520 pub name: String,
521 #[serde(rename = "organization_id")]
523 pub organization_id: Uuid,
524}
525
526#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
528pub struct ApplicationSecret {
529 #[serde(rename = "created_at")]
531 pub created_at: DateTime<Utc>,
532 #[serde(rename = "deleted_at")]
534 #[serde(skip_serializing_if = "Option::is_none")]
535 pub deleted_at: Option<DateTime<Utc>>,
536 #[serde(rename = "name")]
538 #[serde(skip_serializing_if = "Option::is_none")]
539 pub name: Option<String>,
540 #[serde(rename = "token")]
542 pub token: Uuid,
543}
544
545#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
547pub struct ApplicationSecretPost {
548 #[serde(rename = "application_id")]
550 pub application_id: Uuid,
551 #[serde(rename = "name")]
553 #[serde(skip_serializing_if = "Option::is_none")]
554 pub name: Option<String>,
555}
556
557#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
559pub struct Event {
560 #[serde(rename = "event_id")]
562 pub event_id: Uuid,
563 #[serde(rename = "event_type_name")]
565 pub event_type_name: String,
566 #[serde(rename = "ip")]
568 pub ip: String,
569 #[serde(rename = "labels")]
571 pub labels: Value,
572 #[serde(rename = "metadata")]
574 #[serde(skip_serializing_if = "Option::is_none")]
575 pub metadata: Option<Value>,
576 #[serde(rename = "occurred_at")]
578 pub occurred_at: DateTime<Utc>,
579 #[serde(rename = "payload_content_type")]
581 pub payload_content_type: String,
582 #[serde(rename = "received_at")]
584 pub received_at: DateTime<Utc>,
585}
586
587#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
589pub struct EventPost {
590 #[serde(rename = "application_id")]
592 pub application_id: Uuid,
593 #[serde(rename = "event_id")]
595 #[serde(skip_serializing_if = "Option::is_none")]
596 pub event_id: Option<Uuid>,
597 #[serde(rename = "event_type")]
599 pub event_type: String,
600 #[serde(rename = "labels")]
602 pub labels: HashMap<String, String>,
603 #[serde(rename = "metadata")]
605 #[serde(skip_serializing_if = "Option::is_none")]
606 pub metadata: Option<HashMap<String, String>>,
607 #[serde(rename = "occurred_at")]
609 pub occurred_at: DateTime<Utc>,
610 #[serde(rename = "payload")]
612 pub payload: String,
613 #[serde(rename = "payload_content_type")]
615 pub payload_content_type: String,
616}
617
618#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
620pub struct EventType {
621 #[serde(rename = "event_type_name")]
623 pub event_type_name: String,
624 #[serde(rename = "resource_type_name")]
626 pub resource_type_name: String,
627 #[serde(rename = "service_name")]
629 pub service_name: String,
630 #[serde(rename = "verb_name")]
632 pub verb_name: String,
633}
634
635#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
637pub struct EventTypePost {
638 #[serde(rename = "application_id")]
640 pub application_id: Uuid,
641 #[serde(rename = "resource_type")]
643 pub resource_type: String,
644 #[serde(rename = "service")]
646 pub service: String,
647 #[serde(rename = "verb")]
649 pub verb: String,
650}
651
652#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
654pub struct EventWithPayload {
655 #[serde(rename = "event_id")]
657 pub event_id: Uuid,
658 #[serde(rename = "event_type_name")]
660 pub event_type_name: String,
661 #[serde(rename = "ip")]
663 pub ip: String,
664 #[serde(rename = "labels")]
666 pub labels: Value,
667 #[serde(rename = "metadata")]
669 #[serde(skip_serializing_if = "Option::is_none")]
670 pub metadata: Option<Value>,
671 #[serde(rename = "occurred_at")]
673 pub occurred_at: DateTime<Utc>,
674 #[serde(rename = "payload")]
676 pub payload: String,
677 #[serde(rename = "payload_content_type")]
679 pub payload_content_type: String,
680 #[serde(rename = "received_at")]
682 pub received_at: DateTime<Utc>,
683}
684
685#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
687pub struct EventsPerDayEntry {
688 #[serde(rename = "amount")]
690 pub amount: i32,
691 #[serde(rename = "application_id")]
693 pub application_id: Uuid,
694 #[serde(rename = "application_name")]
696 pub application_name: String,
697 #[serde(rename = "date")]
699 pub date: NaiveDate,
700 #[serde(rename = "is_provisional")]
702 pub is_provisional: bool,
703}
704
705#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
707pub struct IngestedEvent {
708 #[serde(rename = "application_id")]
710 pub application_id: Uuid,
711 #[serde(rename = "event_id")]
713 pub event_id: Uuid,
714 #[serde(rename = "received_at")]
716 pub received_at: DateTime<Utc>,
717}
718
719#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
721pub struct InstanceConfig {
722 #[serde(rename = "application_secret_compatibility")]
724 pub application_secret_compatibility: bool,
725 #[serde(rename = "auto_db_migration")]
727 pub auto_db_migration: bool,
728 #[serde(rename = "biscuit_public_key")]
730 pub biscuit_public_key: String,
731 #[serde(rename = "cloudflare_turnstile_site_key")]
733 #[serde(skip_serializing_if = "Option::is_none")]
734 pub cloudflare_turnstile_site_key: Option<String>,
735 #[serde(rename = "formbricks")]
737 #[serde(skip_serializing_if = "Option::is_none")]
738 pub formbricks: Option<InstanceConfigFormbricks>,
739 #[serde(rename = "matomo")]
741 #[serde(skip_serializing_if = "Option::is_none")]
742 pub matomo: Option<InstanceConfigMatomo>,
743 #[serde(rename = "password_minimum_length")]
745 pub password_minimum_length: i32,
746 #[serde(rename = "quota_enforcement")]
748 pub quota_enforcement: bool,
749 #[serde(rename = "registration_disabled")]
751 pub registration_disabled: bool,
752 #[serde(rename = "support_email_address")]
754 pub support_email_address: String,
755}
756
757#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
759pub struct InstanceConfigFormbricks {
760 #[serde(rename = "api_host")]
762 pub api_host: String,
763 #[serde(rename = "environment_id")]
765 pub environment_id: String,
766}
767
768#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
770pub struct InstanceConfigMatomo {
771 #[serde(rename = "site_id")]
773 pub site_id: i32,
774 #[serde(rename = "url")]
776 pub url: String,
777}
778
779#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
781pub struct Organization {
782 #[serde(rename = "name")]
784 pub name: String,
785 #[serde(rename = "organization_id")]
787 pub organization_id: Uuid,
788 #[serde(rename = "plan")]
790 #[serde(skip_serializing_if = "Option::is_none")]
791 pub plan: Option<OrganizationPlan>,
792 #[serde(rename = "role")]
794 pub role: String,
795}
796
797#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
799pub struct OrganizationInfo {
800 #[serde(rename = "consumption")]
802 pub consumption: OrganizationInfoConsumption,
803 #[serde(rename = "name")]
805 pub name: String,
806 #[serde(rename = "onboarding_steps")]
808 pub onboarding_steps: OrganizationInfoOnboardingSteps,
809 #[serde(rename = "organization_id")]
811 pub organization_id: Uuid,
812 #[serde(rename = "plan")]
814 #[serde(skip_serializing_if = "Option::is_none")]
815 pub plan: Option<OrganizationInfoPlan>,
816 #[serde(rename = "quotas")]
818 pub quotas: OrganizationInfoQuotas,
819 #[serde(rename = "users")]
821 pub users: Vec<OrganizationInfoUsers>,
822}
823
824#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
826pub struct OrganizationInfoConsumption {
827 #[serde(rename = "applications")]
829 #[serde(skip_serializing_if = "Option::is_none")]
830 pub applications: Option<i64>,
831 #[serde(rename = "events_per_day")]
833 #[serde(skip_serializing_if = "Option::is_none")]
834 pub events_per_day: Option<i64>,
835 #[serde(rename = "members")]
837 #[serde(skip_serializing_if = "Option::is_none")]
838 pub members: Option<i64>,
839}
840
841#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
843pub struct OrganizationInfoOnboardingSteps {
844 #[serde(rename = "application")]
846 pub application: OrganizationInfoOnboardingStepsApplication,
847 #[serde(rename = "event")]
849 pub event: OrganizationInfoOnboardingStepsEvent,
850 #[serde(rename = "event_type")]
852 pub event_type: OrganizationInfoOnboardingStepsEventType,
853 #[serde(rename = "subscription")]
855 pub subscription: OrganizationInfoOnboardingStepsSubscription,
856}
857
858#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
860pub struct OrganizationInfoPlan {
861 #[serde(rename = "label")]
863 pub label: String,
864 #[serde(rename = "name")]
866 pub name: String,
867}
868
869#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
871pub struct OrganizationInfoQuotas {
872 #[serde(rename = "applications_per_organization_limit")]
874 pub applications_per_organization_limit: i32,
875 #[serde(rename = "days_of_events_retention_limit")]
877 pub days_of_events_retention_limit: i32,
878 #[serde(rename = "events_per_day_limit")]
880 pub events_per_day_limit: i32,
881 #[serde(rename = "members_per_organization_limit")]
883 pub members_per_organization_limit: i32,
884}
885
886#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
888pub struct OrganizationInfoUsers {
889 #[serde(rename = "email")]
891 pub email: String,
892 #[serde(rename = "first_name")]
894 pub first_name: String,
895 #[serde(rename = "last_name")]
897 pub last_name: String,
898 #[serde(rename = "role")]
900 pub role: String,
901 #[serde(rename = "user_id")]
903 pub user_id: Uuid,
904}
905
906#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
908pub struct OrganizationPlan {
909 #[serde(rename = "label")]
911 pub label: String,
912 #[serde(rename = "name")]
914 pub name: String,
915}
916
917#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
919pub struct Problem {
920 #[serde(rename = "detail")]
922 pub detail: String,
923 #[serde(rename = "id")]
925 pub id: ProblemId,
926 #[serde(rename = "status")]
928 pub status: i32,
929 #[serde(rename = "title")]
931 pub title: String,
932 #[serde(rename = "type")]
934 pub type_: String,
935 #[serde(rename = "validation")]
937 #[serde(skip_serializing_if = "Option::is_none")]
938 pub validation: Option<Value>,
939}
940
941#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
943pub struct QuotasResponse {
944 #[serde(rename = "enabled")]
946 pub enabled: bool,
947 #[serde(rename = "limits")]
949 pub limits: QuotasResponseLimits,
950}
951
952#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
954pub struct QuotasResponseLimits {
955 #[serde(rename = "global_applications_per_organization_limit")]
957 pub global_applications_per_organization_limit: i32,
958 #[serde(rename = "global_days_of_events_retention_limit")]
960 pub global_days_of_events_retention_limit: i32,
961 #[serde(rename = "global_event_types_per_application_limit")]
963 pub global_event_types_per_application_limit: i32,
964 #[serde(rename = "global_events_per_day_limit")]
966 pub global_events_per_day_limit: i32,
967 #[serde(rename = "global_members_per_organization_limit")]
969 pub global_members_per_organization_limit: i32,
970 #[serde(rename = "global_subscriptions_per_application_limit")]
972 pub global_subscriptions_per_application_limit: i32,
973}
974
975#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
977pub struct ReplayEvent {
978 #[serde(rename = "application_id")]
980 pub application_id: Uuid,
981}
982
983#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
985pub struct RequestAttempt {
986 #[serde(rename = "created_at")]
988 pub created_at: DateTime<Utc>,
989 #[serde(rename = "delay_until")]
991 #[serde(skip_serializing_if = "Option::is_none")]
992 pub delay_until: Option<DateTime<Utc>>,
993 #[serde(rename = "event")]
995 pub event: RequestAttemptEvent,
996 #[serde(rename = "event_id")]
998 pub event_id: Uuid,
999 #[serde(rename = "failed_at")]
1001 #[serde(skip_serializing_if = "Option::is_none")]
1002 pub failed_at: Option<DateTime<Utc>>,
1003 #[serde(rename = "http_response_status")]
1005 #[serde(skip_serializing_if = "Option::is_none")]
1006 pub http_response_status: Option<i32>,
1007 #[serde(rename = "picked_at")]
1009 #[serde(skip_serializing_if = "Option::is_none")]
1010 pub picked_at: Option<DateTime<Utc>>,
1011 #[serde(rename = "request_attempt_id")]
1013 pub request_attempt_id: Uuid,
1014 #[serde(rename = "response_id")]
1016 #[serde(skip_serializing_if = "Option::is_none")]
1017 pub response_id: Option<Uuid>,
1018 #[serde(rename = "retry_count")]
1020 pub retry_count: i32,
1021 #[serde(rename = "status")]
1023 pub status: RequestAttemptStatus,
1024 #[serde(rename = "subscription")]
1026 pub subscription: RequestAttemptSubscription,
1027 #[serde(rename = "succeeded_at")]
1029 #[serde(skip_serializing_if = "Option::is_none")]
1030 pub succeeded_at: Option<DateTime<Utc>>,
1031}
1032
1033#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
1035pub struct RequestAttemptEvent {
1036 #[serde(rename = "event_id")]
1038 pub event_id: Uuid,
1039 #[serde(rename = "event_type_name")]
1041 pub event_type_name: String,
1042}
1043
1044#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
1046pub struct RequestAttemptStatus {
1047 #[serde(rename = "at")]
1049 #[serde(skip_serializing_if = "Option::is_none")]
1050 pub at: Option<DateTime<Utc>>,
1051 #[serde(rename = "full_processing_ms")]
1053 #[serde(skip_serializing_if = "Option::is_none")]
1054 pub full_processing_ms: Option<i64>,
1055 #[serde(rename = "since")]
1057 #[serde(skip_serializing_if = "Option::is_none")]
1058 pub since: Option<DateTime<Utc>>,
1059 #[serde(rename = "type")]
1061 pub type_: RequestAttemptStatusType,
1062 #[serde(rename = "until")]
1064 #[serde(skip_serializing_if = "Option::is_none")]
1065 pub until: Option<DateTime<Utc>>,
1066}
1067
1068#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
1070pub struct RequestAttemptSubscription {
1071 #[serde(rename = "description")]
1073 #[serde(skip_serializing_if = "Option::is_none")]
1074 pub description: Option<String>,
1075 #[serde(rename = "subscription_id")]
1077 pub subscription_id: Uuid,
1078}
1079
1080#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
1082pub struct Response {
1083 #[serde(rename = "body")]
1085 #[serde(skip_serializing_if = "Option::is_none")]
1086 pub body: Option<String>,
1087 #[serde(rename = "elapsed_time_ms")]
1089 #[serde(skip_serializing_if = "Option::is_none")]
1090 pub elapsed_time_ms: Option<i32>,
1091 #[serde(rename = "headers")]
1093 #[serde(skip_serializing_if = "Option::is_none")]
1094 pub headers: Option<HashMap<String, String>>,
1095 #[serde(rename = "http_code")]
1097 #[serde(skip_serializing_if = "Option::is_none")]
1098 pub http_code: Option<i32>,
1099 #[serde(rename = "response_error_name")]
1101 #[serde(skip_serializing_if = "Option::is_none")]
1102 pub response_error_name: Option<String>,
1103 #[serde(rename = "response_id")]
1105 pub response_id: Uuid,
1106}
1107
1108#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
1110pub struct ServiceToken {
1111 #[serde(rename = "biscuit")]
1113 pub biscuit: String,
1114 #[serde(rename = "created_at")]
1116 pub created_at: DateTime<Utc>,
1117 #[serde(rename = "name")]
1119 pub name: String,
1120 #[serde(rename = "token_id")]
1122 pub token_id: Uuid,
1123}
1124
1125#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
1127pub struct ServiceTokenPost {
1128 #[serde(rename = "name")]
1130 pub name: String,
1131 #[serde(rename = "organization_id")]
1133 pub organization_id: Uuid,
1134}
1135
1136#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
1138pub struct Subscription {
1139 #[serde(rename = "application_id")]
1141 pub application_id: Uuid,
1142 #[serde(rename = "created_at")]
1144 pub created_at: DateTime<Utc>,
1145 #[serde(rename = "dedicated_workers")]
1147 pub dedicated_workers: Vec<String>,
1148 #[serde(rename = "description")]
1150 #[serde(skip_serializing_if = "Option::is_none")]
1151 pub description: Option<String>,
1152 #[serde(rename = "event_types")]
1154 pub event_types: Vec<String>,
1155 #[serde(rename = "is_enabled")]
1157 pub is_enabled: bool,
1158 #[serde(rename = "label_key")]
1160 pub label_key: String,
1161 #[serde(rename = "label_value")]
1163 pub label_value: String,
1164 #[serde(rename = "labels")]
1166 pub labels: HashMap<String, String>,
1167 #[serde(rename = "metadata")]
1169 pub metadata: HashMap<String, String>,
1170 #[serde(rename = "secret")]
1172 pub secret: Uuid,
1173 #[serde(rename = "subscription_id")]
1175 pub subscription_id: Uuid,
1176 #[serde(rename = "target")]
1178 pub target: SubscriptionTarget,
1179 #[serde(rename = "updated_at")]
1181 pub updated_at: DateTime<Utc>,
1182}
1183
1184#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
1186pub struct SubscriptionPost {
1187 #[serde(rename = "application_id")]
1189 pub application_id: Uuid,
1190 #[serde(rename = "dedicated_workers")]
1192 #[serde(skip_serializing_if = "Option::is_none")]
1193 pub dedicated_workers: Option<Vec<String>>,
1194 #[serde(rename = "description")]
1196 #[serde(skip_serializing_if = "Option::is_none")]
1197 pub description: Option<String>,
1198 #[serde(rename = "event_types")]
1200 pub event_types: Vec<String>,
1201 #[serde(rename = "is_enabled")]
1203 pub is_enabled: bool,
1204 #[serde(rename = "label_key")]
1206 #[serde(skip_serializing_if = "Option::is_none")]
1207 pub label_key: Option<String>,
1208 #[serde(rename = "label_value")]
1210 #[serde(skip_serializing_if = "Option::is_none")]
1211 pub label_value: Option<String>,
1212 #[serde(rename = "labels")]
1214 #[serde(skip_serializing_if = "Option::is_none")]
1215 pub labels: Option<HashMap<String, String>>,
1216 #[serde(rename = "metadata")]
1218 #[serde(skip_serializing_if = "Option::is_none")]
1219 pub metadata: Option<HashMap<String, String>>,
1220 #[serde(rename = "target")]
1222 pub target: SubscriptionPostTarget,
1223}
1224
1225#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
1227pub struct SubscriptionPostTarget {
1228 #[serde(rename = "headers")]
1230 pub headers: Value,
1231 #[serde(rename = "method")]
1233 pub method: String,
1234 #[serde(rename = "type")]
1236 pub type_: String,
1237 #[serde(rename = "url")]
1239 pub url: Url,
1240}
1241
1242#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
1244pub struct SubscriptionTarget {
1245 #[serde(rename = "headers")]
1247 pub headers: Value,
1248 #[serde(rename = "method")]
1250 pub method: String,
1251 #[serde(rename = "type")]
1253 pub type_: String,
1254 #[serde(rename = "url")]
1256 pub url: Url,
1257}