1#![doc = "Generated transport-independent contract objects."]
3
4use std::collections::BTreeMap;
5use std::error::Error as StdError;
6use std::fmt::{self, Display, Formatter};
7
8use serde::{Deserialize, Deserializer, Serialize, Serializer};
9use serde_json::Value;
10use spiral_contract::error::{ErrorEnvelope, ServiceError};
11use spiral_contract::strict::{DeserializeStrict, Strict};
12use uuid::Uuid;
13
14#[derive(Clone, Debug, PartialEq, Eq)]
16pub enum AppAccessDecision {
17 Allow,
19 Block,
21 Unknown(String),
23}
24impl Serialize for AppAccessDecision {
25 fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
26 serializer.serialize_str(match self {
27 Self::Allow => "allow",
28 Self::Block => "block",
29 Self::Unknown(value) => value,
30 })
31 }
32}
33impl<'de> Deserialize<'de> for AppAccessDecision {
34 fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
35 Ok(match String::deserialize(deserializer)?.as_str() {
36 "allow" => Self::Allow,
37 "block" => Self::Block,
38 value => Self::Unknown(value.to_owned()),
39 })
40 }
41}
42impl<'de> DeserializeStrict<'de> for AppAccessDecision {
43 fn deserialize_strict<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
44 #[derive(Deserialize)]
45 enum __Known {
46 #[serde(rename = "allow")]
47 Allow,
48 #[serde(rename = "block")]
49 Block,
50 }
51 Ok(match __Known::deserialize(deserializer)? {
52 __Known::Allow => Self::Allow,
53 __Known::Block => Self::Block,
54 })
55 }
56}
57
58#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
61pub struct Application {
62 #[serde(rename = "configuration")]
64 pub configuration: ApplicationConfiguration,
65 #[serde(rename = "id")]
67 pub id: String,
68 #[serde(rename = "organizationId")]
70 pub organization_id: String,
71 #[serde(rename = "projectId")]
73 pub project_id: String,
74 #[serde(rename = "status")]
76 pub status: ApplicationStatus,
77}
78impl<'de> DeserializeStrict<'de> for Application {
79 fn deserialize_strict<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
80 #[derive(Deserialize)]
81 #[serde(deny_unknown_fields)]
82 struct __Wire {
83 #[serde(rename = "configuration")]
84 configuration: Strict<ApplicationConfiguration>,
85 #[serde(rename = "id")]
86 id: Strict<String>,
87 #[serde(rename = "organizationId")]
88 organization_id: Strict<String>,
89 #[serde(rename = "projectId")]
90 project_id: Strict<String>,
91 #[serde(rename = "status")]
92 status: Strict<ApplicationStatus>,
93 }
94 let wire = __Wire::deserialize(deserializer)?;
95 Ok(Self {
96 configuration: wire.configuration.0,
97 id: wire.id.0,
98 organization_id: wire.organization_id.0,
99 project_id: wire.project_id.0,
100 status: wire.status.0,
101 })
102 }
103}
104
105#[derive(Clone, Debug, PartialEq, Eq)]
109pub enum ApplicationAudience {
110 Internal,
112 Public,
114 Unknown(String),
116}
117impl Serialize for ApplicationAudience {
118 fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
119 serializer.serialize_str(match self {
120 Self::Internal => "internal",
121 Self::Public => "public",
122 Self::Unknown(value) => value,
123 })
124 }
125}
126impl<'de> Deserialize<'de> for ApplicationAudience {
127 fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
128 Ok(match String::deserialize(deserializer)?.as_str() {
129 "internal" => Self::Internal,
130 "public" => Self::Public,
131 value => Self::Unknown(value.to_owned()),
132 })
133 }
134}
135impl<'de> DeserializeStrict<'de> for ApplicationAudience {
136 fn deserialize_strict<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
137 #[derive(Deserialize)]
138 enum __Known {
139 #[serde(rename = "internal")]
140 Internal,
141 #[serde(rename = "public")]
142 Public,
143 }
144 Ok(match __Known::deserialize(deserializer)? {
145 __Known::Internal => Self::Internal,
146 __Known::Public => Self::Public,
147 })
148 }
149}
150
151#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
162pub struct ApplicationConfiguration {
163 #[serde(rename = "allowedCorsOrigins")]
165 #[serde(default, skip_serializing_if = "Option::is_none")]
166 pub allowed_cors_origins: Option<Vec<String>>,
167 #[serde(rename = "audience")]
169 #[serde(default, skip_serializing_if = "Option::is_none")]
170 pub audience: Option<ApplicationAudience>,
171 #[serde(rename = "backgroundIdentity")]
173 #[serde(default, skip_serializing_if = "Option::is_none")]
174 pub background_identity: Option<BackgroundIdentity>,
175 #[serde(rename = "enabled")]
177 pub enabled: bool,
178 #[serde(rename = "installOnSignIn")]
180 #[serde(default, skip_serializing_if = "Option::is_none")]
181 pub install_on_sign_in: Option<bool>,
182 #[serde(rename = "jwks")]
184 #[serde(default, skip_serializing_if = "Option::is_none")]
185 pub jwks: Option<Value>,
186 #[serde(rename = "jwtBearerIssuers")]
188 #[serde(default, skip_serializing_if = "Option::is_none")]
189 pub jwt_bearer_issuers: Option<Vec<BackgroundIdentity>>,
190 #[serde(rename = "name")]
192 pub name: String,
193 #[serde(rename = "redirectOnUpdate")]
195 #[serde(default, skip_serializing_if = "Option::is_none")]
196 pub redirect_on_update: Option<bool>,
197 #[serde(rename = "redirectUris")]
199 pub redirect_uris: Vec<String>,
200 #[serde(rename = "scopes")]
202 pub scopes: Vec<String>,
203 #[serde(rename = "setupUrl")]
205 #[serde(default, skip_serializing_if = "Option::is_none")]
206 pub setup_url: Option<String>,
207}
208impl<'de> DeserializeStrict<'de> for ApplicationConfiguration {
209 fn deserialize_strict<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
210 #[derive(Deserialize)]
211 #[serde(deny_unknown_fields)]
212 struct __Wire {
213 #[serde(rename = "allowedCorsOrigins")]
214 #[serde(default)]
215 allowed_cors_origins: Strict<Option<Vec<String>>>,
216 #[serde(rename = "audience")]
217 #[serde(default)]
218 audience: Strict<Option<ApplicationAudience>>,
219 #[serde(rename = "backgroundIdentity")]
220 #[serde(default)]
221 background_identity: Strict<Option<BackgroundIdentity>>,
222 #[serde(rename = "enabled")]
223 enabled: Strict<bool>,
224 #[serde(rename = "installOnSignIn")]
225 #[serde(default)]
226 install_on_sign_in: Strict<Option<bool>>,
227 #[serde(rename = "jwks")]
228 #[serde(default)]
229 jwks: Strict<Option<Value>>,
230 #[serde(rename = "jwtBearerIssuers")]
231 #[serde(default)]
232 jwt_bearer_issuers: Strict<Option<Vec<BackgroundIdentity>>>,
233 #[serde(rename = "name")]
234 name: Strict<String>,
235 #[serde(rename = "redirectOnUpdate")]
236 #[serde(default)]
237 redirect_on_update: Strict<Option<bool>>,
238 #[serde(rename = "redirectUris")]
239 redirect_uris: Strict<Vec<String>>,
240 #[serde(rename = "scopes")]
241 scopes: Strict<Vec<String>>,
242 #[serde(rename = "setupUrl")]
243 #[serde(default)]
244 setup_url: Strict<Option<String>>,
245 }
246 let wire = __Wire::deserialize(deserializer)?;
247 Ok(Self {
248 allowed_cors_origins: wire.allowed_cors_origins.0,
249 audience: wire.audience.0,
250 background_identity: wire.background_identity.0,
251 enabled: wire.enabled.0,
252 install_on_sign_in: wire.install_on_sign_in.0,
253 jwks: wire.jwks.0,
254 jwt_bearer_issuers: wire.jwt_bearer_issuers.0,
255 name: wire.name.0,
256 redirect_on_update: wire.redirect_on_update.0,
257 redirect_uris: wire.redirect_uris.0,
258 scopes: wire.scopes.0,
259 setup_url: wire.setup_url.0,
260 })
261 }
262}
263
264#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
266pub struct ApplicationPage {
267 #[serde(rename = "applications")]
269 pub applications: Vec<Application>,
270 #[serde(rename = "nextPageToken")]
272 #[serde(default, skip_serializing_if = "Option::is_none")]
273 pub next_page_token: Option<String>,
274}
275impl<'de> DeserializeStrict<'de> for ApplicationPage {
276 fn deserialize_strict<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
277 #[derive(Deserialize)]
278 #[serde(deny_unknown_fields)]
279 struct __Wire {
280 #[serde(rename = "applications")]
281 applications: Strict<Vec<Application>>,
282 #[serde(rename = "nextPageToken")]
283 #[serde(default)]
284 next_page_token: Strict<Option<String>>,
285 }
286 let wire = __Wire::deserialize(deserializer)?;
287 Ok(Self {
288 applications: wire.applications.0,
289 next_page_token: wire.next_page_token.0,
290 })
291 }
292}
293
294#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
296pub struct ApplicationScope {
297 #[serde(rename = "description")]
299 pub description: String,
300 #[serde(rename = "name")]
302 pub name: String,
303}
304impl<'de> DeserializeStrict<'de> for ApplicationScope {
305 fn deserialize_strict<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
306 #[derive(Deserialize)]
307 #[serde(deny_unknown_fields)]
308 struct __Wire {
309 #[serde(rename = "description")]
310 description: Strict<String>,
311 #[serde(rename = "name")]
312 name: Strict<String>,
313 }
314 let wire = __Wire::deserialize(deserializer)?;
315 Ok(Self {
316 description: wire.description.0,
317 name: wire.name.0,
318 })
319 }
320}
321
322#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
324pub struct ApplicationScopes {
325 #[serde(rename = "scopes")]
327 pub scopes: Vec<ApplicationScope>,
328}
329impl<'de> DeserializeStrict<'de> for ApplicationScopes {
330 fn deserialize_strict<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
331 #[derive(Deserialize)]
332 #[serde(deny_unknown_fields)]
333 struct __Wire {
334 #[serde(rename = "scopes")]
335 scopes: Strict<Vec<ApplicationScope>>,
336 }
337 let wire = __Wire::deserialize(deserializer)?;
338 Ok(Self {
339 scopes: wire.scopes.0,
340 })
341 }
342}
343
344#[derive(Clone, Debug, PartialEq, Eq)]
346pub enum ApplicationStatus {
347 Active,
349 Suspended,
351 Deleted,
353 Unknown(String),
355}
356impl Serialize for ApplicationStatus {
357 fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
358 serializer.serialize_str(match self {
359 Self::Active => "active",
360 Self::Suspended => "suspended",
361 Self::Deleted => "deleted",
362 Self::Unknown(value) => value,
363 })
364 }
365}
366impl<'de> Deserialize<'de> for ApplicationStatus {
367 fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
368 Ok(match String::deserialize(deserializer)?.as_str() {
369 "active" => Self::Active,
370 "suspended" => Self::Suspended,
371 "deleted" => Self::Deleted,
372 value => Self::Unknown(value.to_owned()),
373 })
374 }
375}
376impl<'de> DeserializeStrict<'de> for ApplicationStatus {
377 fn deserialize_strict<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
378 #[derive(Deserialize)]
379 enum __Known {
380 #[serde(rename = "active")]
381 Active,
382 #[serde(rename = "suspended")]
383 Suspended,
384 #[serde(rename = "deleted")]
385 Deleted,
386 }
387 Ok(match __Known::deserialize(deserializer)? {
388 __Known::Active => Self::Active,
389 __Known::Suspended => Self::Suspended,
390 __Known::Deleted => Self::Deleted,
391 })
392 }
393}
394
395#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
399pub struct BackgroundIdentity {
400 #[serde(rename = "audience")]
402 #[serde(default, skip_serializing_if = "Option::is_none")]
403 pub audience: Option<String>,
404 #[serde(rename = "claims")]
406 pub claims: BTreeMap<String, String>,
407 #[serde(rename = "issuer")]
409 pub issuer: String,
410}
411impl<'de> DeserializeStrict<'de> for BackgroundIdentity {
412 fn deserialize_strict<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
413 #[derive(Deserialize)]
414 #[serde(deny_unknown_fields)]
415 struct __Wire {
416 #[serde(rename = "audience")]
417 #[serde(default)]
418 audience: Strict<Option<String>>,
419 #[serde(rename = "claims")]
420 claims: Strict<BTreeMap<String, String>>,
421 #[serde(rename = "issuer")]
422 issuer: Strict<String>,
423 }
424 let wire = __Wire::deserialize(deserializer)?;
425 Ok(Self {
426 audience: wire.audience.0,
427 claims: wire.claims.0,
428 issuer: wire.issuer.0,
429 })
430 }
431}
432
433#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
435pub struct ClientAppAccess {
436 #[serde(rename = "clientId")]
438 pub client_id: String,
439 #[serde(rename = "decision")]
441 pub decision: AppAccessDecision,
442}
443impl<'de> DeserializeStrict<'de> for ClientAppAccess {
444 fn deserialize_strict<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
445 #[derive(Deserialize)]
446 #[serde(deny_unknown_fields)]
447 struct __Wire {
448 #[serde(rename = "clientId")]
449 client_id: Strict<String>,
450 #[serde(rename = "decision")]
451 decision: Strict<AppAccessDecision>,
452 }
453 let wire = __Wire::deserialize(deserializer)?;
454 Ok(Self {
455 client_id: wire.client_id.0,
456 decision: wire.decision.0,
457 })
458 }
459}
460
461#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
463pub struct ConsentClient {
464 #[serde(rename = "id")]
466 pub id: String,
467 #[serde(rename = "loopbackOnly")]
469 pub loopback_only: bool,
470 #[serde(rename = "managed")]
472 pub managed: bool,
473 #[serde(rename = "name")]
475 pub name: String,
476 #[serde(rename = "publisher")]
478 pub publisher: String,
479 #[serde(rename = "publisherName")]
481 #[serde(default, skip_serializing_if = "Option::is_none")]
482 pub publisher_name: Option<String>,
483 #[serde(rename = "redirectHost")]
485 pub redirect_host: String,
486}
487impl<'de> DeserializeStrict<'de> for ConsentClient {
488 fn deserialize_strict<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
489 #[derive(Deserialize)]
490 #[serde(deny_unknown_fields)]
491 struct __Wire {
492 #[serde(rename = "id")]
493 id: Strict<String>,
494 #[serde(rename = "loopbackOnly")]
495 loopback_only: Strict<bool>,
496 #[serde(rename = "managed")]
497 managed: Strict<bool>,
498 #[serde(rename = "name")]
499 name: Strict<String>,
500 #[serde(rename = "publisher")]
501 publisher: Strict<String>,
502 #[serde(rename = "publisherName")]
503 #[serde(default)]
504 publisher_name: Strict<Option<String>>,
505 #[serde(rename = "redirectHost")]
506 redirect_host: Strict<String>,
507 }
508 let wire = __Wire::deserialize(deserializer)?;
509 Ok(Self {
510 id: wire.id.0,
511 loopback_only: wire.loopback_only.0,
512 managed: wire.managed.0,
513 name: wire.name.0,
514 publisher: wire.publisher.0,
515 publisher_name: wire.publisher_name.0,
516 redirect_host: wire.redirect_host.0,
517 })
518 }
519}
520
521#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
523pub struct ConsentDecision {
524 #[serde(rename = "approve")]
526 pub approve: bool,
527 #[serde(rename = "scopes")]
529 pub scopes: Vec<String>,
530}
531impl<'de> DeserializeStrict<'de> for ConsentDecision {
532 fn deserialize_strict<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
533 #[derive(Deserialize)]
534 #[serde(deny_unknown_fields)]
535 struct __Wire {
536 #[serde(rename = "approve")]
537 approve: Strict<bool>,
538 #[serde(rename = "scopes")]
539 scopes: Strict<Vec<String>>,
540 }
541 let wire = __Wire::deserialize(deserializer)?;
542 Ok(Self {
543 approve: wire.approve.0,
544 scopes: wire.scopes.0,
545 })
546 }
547}
548
549#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
551pub struct ConsentRedirect {
552 #[serde(rename = "redirectTo")]
554 pub redirect_to: String,
555}
556impl<'de> DeserializeStrict<'de> for ConsentRedirect {
557 fn deserialize_strict<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
558 #[derive(Deserialize)]
559 #[serde(deny_unknown_fields)]
560 struct __Wire {
561 #[serde(rename = "redirectTo")]
562 redirect_to: Strict<String>,
563 }
564 let wire = __Wire::deserialize(deserializer)?;
565 Ok(Self {
566 redirect_to: wire.redirect_to.0,
567 })
568 }
569}
570
571#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
573pub struct ConsentRequest {
574 #[serde(rename = "client")]
576 pub client: ConsentClient,
577 #[serde(rename = "resource")]
579 pub resource: String,
580 #[serde(rename = "scopes")]
582 pub scopes: Vec<String>,
583 #[serde(rename = "skip")]
585 pub skip: bool,
586 #[serde(rename = "subject")]
588 pub subject: ConsentSubject,
589}
590impl<'de> DeserializeStrict<'de> for ConsentRequest {
591 fn deserialize_strict<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
592 #[derive(Deserialize)]
593 #[serde(deny_unknown_fields)]
594 struct __Wire {
595 #[serde(rename = "client")]
596 client: Strict<ConsentClient>,
597 #[serde(rename = "resource")]
598 resource: Strict<String>,
599 #[serde(rename = "scopes")]
600 scopes: Strict<Vec<String>>,
601 #[serde(rename = "skip")]
602 skip: Strict<bool>,
603 #[serde(rename = "subject")]
604 subject: Strict<ConsentSubject>,
605 }
606 let wire = __Wire::deserialize(deserializer)?;
607 Ok(Self {
608 client: wire.client.0,
609 resource: wire.resource.0,
610 scopes: wire.scopes.0,
611 skip: wire.skip.0,
612 subject: wire.subject.0,
613 })
614 }
615}
616
617#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
619pub struct ConsentSubject {
620 #[serde(rename = "organizationId")]
622 pub organization_id: String,
623 #[serde(rename = "organizationName")]
625 pub organization_name: String,
626 #[serde(rename = "userId")]
628 pub user_id: String,
629}
630impl<'de> DeserializeStrict<'de> for ConsentSubject {
631 fn deserialize_strict<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
632 #[derive(Deserialize)]
633 #[serde(deny_unknown_fields)]
634 struct __Wire {
635 #[serde(rename = "organizationId")]
636 organization_id: Strict<String>,
637 #[serde(rename = "organizationName")]
638 organization_name: Strict<String>,
639 #[serde(rename = "userId")]
640 user_id: Strict<String>,
641 }
642 let wire = __Wire::deserialize(deserializer)?;
643 Ok(Self {
644 organization_id: wire.organization_id.0,
645 organization_name: wire.organization_name.0,
646 user_id: wire.user_id.0,
647 })
648 }
649}
650
651#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
655pub struct InstallableApplication {
656 #[serde(rename = "id")]
658 pub id: String,
659 #[serde(rename = "installOnSignIn")]
661 #[serde(default, skip_serializing_if = "Option::is_none")]
662 pub install_on_sign_in: Option<bool>,
663 #[serde(rename = "installation")]
665 #[serde(default, skip_serializing_if = "Option::is_none")]
666 pub installation: Option<Installation>,
667 #[serde(rename = "name")]
669 pub name: String,
670 #[serde(rename = "organizationId")]
672 pub organization_id: String,
673 #[serde(rename = "redirectOnUpdate")]
675 #[serde(default, skip_serializing_if = "Option::is_none")]
676 pub redirect_on_update: Option<bool>,
677 #[serde(rename = "scopes")]
679 pub scopes: Vec<String>,
680 #[serde(rename = "setupUrl")]
682 #[serde(default, skip_serializing_if = "Option::is_none")]
683 pub setup_url: Option<String>,
684 #[serde(rename = "status")]
686 pub status: ApplicationStatus,
687}
688impl<'de> DeserializeStrict<'de> for InstallableApplication {
689 fn deserialize_strict<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
690 #[derive(Deserialize)]
691 #[serde(deny_unknown_fields)]
692 struct __Wire {
693 #[serde(rename = "id")]
694 id: Strict<String>,
695 #[serde(rename = "installOnSignIn")]
696 #[serde(default)]
697 install_on_sign_in: Strict<Option<bool>>,
698 #[serde(rename = "installation")]
699 #[serde(default)]
700 installation: Strict<Option<Installation>>,
701 #[serde(rename = "name")]
702 name: Strict<String>,
703 #[serde(rename = "organizationId")]
704 organization_id: Strict<String>,
705 #[serde(rename = "redirectOnUpdate")]
706 #[serde(default)]
707 redirect_on_update: Strict<Option<bool>>,
708 #[serde(rename = "scopes")]
709 scopes: Strict<Vec<String>>,
710 #[serde(rename = "setupUrl")]
711 #[serde(default)]
712 setup_url: Strict<Option<String>>,
713 #[serde(rename = "status")]
714 status: Strict<ApplicationStatus>,
715 }
716 let wire = __Wire::deserialize(deserializer)?;
717 Ok(Self {
718 id: wire.id.0,
719 install_on_sign_in: wire.install_on_sign_in.0,
720 installation: wire.installation.0,
721 name: wire.name.0,
722 organization_id: wire.organization_id.0,
723 redirect_on_update: wire.redirect_on_update.0,
724 scopes: wire.scopes.0,
725 setup_url: wire.setup_url.0,
726 status: wire.status.0,
727 })
728 }
729}
730
731#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
735pub struct Installation {
736 #[serde(rename = "applicationId")]
738 pub application_id: String,
739 #[serde(rename = "approved")]
741 #[serde(default, skip_serializing_if = "Option::is_none")]
742 pub approved: Option<InstallationGrant>,
743 #[serde(rename = "id")]
745 pub id: String,
746 #[serde(rename = "organizationId")]
748 pub organization_id: String,
749 #[serde(rename = "requested")]
751 pub requested: InstallationGrant,
752 #[serde(rename = "status")]
754 pub status: InstallationStatus,
755}
756impl<'de> DeserializeStrict<'de> for Installation {
757 fn deserialize_strict<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
758 #[derive(Deserialize)]
759 #[serde(deny_unknown_fields)]
760 struct __Wire {
761 #[serde(rename = "applicationId")]
762 application_id: Strict<String>,
763 #[serde(rename = "approved")]
764 #[serde(default)]
765 approved: Strict<Option<InstallationGrant>>,
766 #[serde(rename = "id")]
767 id: Strict<String>,
768 #[serde(rename = "organizationId")]
769 organization_id: Strict<String>,
770 #[serde(rename = "requested")]
771 requested: Strict<InstallationGrant>,
772 #[serde(rename = "status")]
773 status: Strict<InstallationStatus>,
774 }
775 let wire = __Wire::deserialize(deserializer)?;
776 Ok(Self {
777 application_id: wire.application_id.0,
778 approved: wire.approved.0,
779 id: wire.id.0,
780 organization_id: wire.organization_id.0,
781 requested: wire.requested.0,
782 status: wire.status.0,
783 })
784 }
785}
786
787#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
791pub struct InstallationDetails {
792 #[serde(rename = "apiUrl")]
794 pub api_url: String,
795 #[serde(rename = "configurationUrl")]
797 #[serde(default, skip_serializing_if = "Option::is_none")]
798 pub configuration_url: Option<String>,
799 #[serde(rename = "installation")]
801 pub installation: Installation,
802}
803impl<'de> DeserializeStrict<'de> for InstallationDetails {
804 fn deserialize_strict<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
805 #[derive(Deserialize)]
806 #[serde(deny_unknown_fields)]
807 struct __Wire {
808 #[serde(rename = "apiUrl")]
809 api_url: Strict<String>,
810 #[serde(rename = "configurationUrl")]
811 #[serde(default)]
812 configuration_url: Strict<Option<String>>,
813 #[serde(rename = "installation")]
814 installation: Strict<Installation>,
815 }
816 let wire = __Wire::deserialize(deserializer)?;
817 Ok(Self {
818 api_url: wire.api_url.0,
819 configuration_url: wire.configuration_url.0,
820 installation: wire.installation.0,
821 })
822 }
823}
824
825#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
827pub struct InstallationGrant {
828 #[serde(rename = "projects")]
830 pub projects: InstallationProjects,
831 #[serde(rename = "scopes")]
833 pub scopes: Vec<String>,
834}
835impl<'de> DeserializeStrict<'de> for InstallationGrant {
836 fn deserialize_strict<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
837 #[derive(Deserialize)]
838 #[serde(deny_unknown_fields)]
839 struct __Wire {
840 #[serde(rename = "projects")]
841 projects: Strict<InstallationProjects>,
842 #[serde(rename = "scopes")]
843 scopes: Strict<Vec<String>>,
844 }
845 let wire = __Wire::deserialize(deserializer)?;
846 Ok(Self {
847 projects: wire.projects.0,
848 scopes: wire.scopes.0,
849 })
850 }
851}
852
853#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
855pub struct InstallationPage {
856 #[serde(rename = "installations")]
858 pub installations: Vec<Installation>,
859 #[serde(rename = "nextPageToken")]
861 #[serde(default, skip_serializing_if = "Option::is_none")]
862 pub next_page_token: Option<String>,
863}
864impl<'de> DeserializeStrict<'de> for InstallationPage {
865 fn deserialize_strict<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
866 #[derive(Deserialize)]
867 #[serde(deny_unknown_fields)]
868 struct __Wire {
869 #[serde(rename = "installations")]
870 installations: Strict<Vec<Installation>>,
871 #[serde(rename = "nextPageToken")]
872 #[serde(default)]
873 next_page_token: Strict<Option<String>>,
874 }
875 let wire = __Wire::deserialize(deserializer)?;
876 Ok(Self {
877 installations: wire.installations.0,
878 next_page_token: wire.next_page_token.0,
879 })
880 }
881}
882
883#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
885pub struct InstallationProject {
886 #[serde(rename = "description")]
888 #[serde(default, skip_serializing_if = "Option::is_none")]
889 pub description: Option<String>,
890 #[serde(rename = "id")]
892 pub id: String,
893 #[serde(rename = "organizationId")]
895 pub organization_id: String,
896}
897impl<'de> DeserializeStrict<'de> for InstallationProject {
898 fn deserialize_strict<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
899 #[derive(Deserialize)]
900 #[serde(deny_unknown_fields)]
901 struct __Wire {
902 #[serde(rename = "description")]
903 #[serde(default)]
904 description: Strict<Option<String>>,
905 #[serde(rename = "id")]
906 id: Strict<String>,
907 #[serde(rename = "organizationId")]
908 organization_id: Strict<String>,
909 }
910 let wire = __Wire::deserialize(deserializer)?;
911 Ok(Self {
912 description: wire.description.0,
913 id: wire.id.0,
914 organization_id: wire.organization_id.0,
915 })
916 }
917}
918
919#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
921pub struct InstallationProjectPage {
922 #[serde(rename = "nextPageToken")]
924 #[serde(default, skip_serializing_if = "Option::is_none")]
925 pub next_page_token: Option<String>,
926 #[serde(rename = "projects")]
928 pub projects: Vec<InstallationProject>,
929}
930impl<'de> DeserializeStrict<'de> for InstallationProjectPage {
931 fn deserialize_strict<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
932 #[derive(Deserialize)]
933 #[serde(deny_unknown_fields)]
934 struct __Wire {
935 #[serde(rename = "nextPageToken")]
936 #[serde(default)]
937 next_page_token: Strict<Option<String>>,
938 #[serde(rename = "projects")]
939 projects: Strict<Vec<InstallationProject>>,
940 }
941 let wire = __Wire::deserialize(deserializer)?;
942 Ok(Self {
943 next_page_token: wire.next_page_token.0,
944 projects: wire.projects.0,
945 })
946 }
947}
948
949#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
952pub struct InstallationProjects {
953 #[serde(rename = "all")]
955 pub all: bool,
956 #[serde(rename = "projectIds")]
958 pub project_ids: Vec<String>,
959}
960impl<'de> DeserializeStrict<'de> for InstallationProjects {
961 fn deserialize_strict<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
962 #[derive(Deserialize)]
963 #[serde(deny_unknown_fields)]
964 struct __Wire {
965 #[serde(rename = "all")]
966 all: Strict<bool>,
967 #[serde(rename = "projectIds")]
968 project_ids: Strict<Vec<String>>,
969 }
970 let wire = __Wire::deserialize(deserializer)?;
971 Ok(Self {
972 all: wire.all.0,
973 project_ids: wire.project_ids.0,
974 })
975 }
976}
977
978#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
980pub struct InstallationRequest {
981 #[serde(rename = "applicationId")]
983 pub application_id: String,
984 #[serde(rename = "projects")]
986 pub projects: InstallationProjects,
987 #[serde(rename = "scopes")]
989 pub scopes: Vec<String>,
990}
991impl<'de> DeserializeStrict<'de> for InstallationRequest {
992 fn deserialize_strict<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
993 #[derive(Deserialize)]
994 #[serde(deny_unknown_fields)]
995 struct __Wire {
996 #[serde(rename = "applicationId")]
997 application_id: Strict<String>,
998 #[serde(rename = "projects")]
999 projects: Strict<InstallationProjects>,
1000 #[serde(rename = "scopes")]
1001 scopes: Strict<Vec<String>>,
1002 }
1003 let wire = __Wire::deserialize(deserializer)?;
1004 Ok(Self {
1005 application_id: wire.application_id.0,
1006 projects: wire.projects.0,
1007 scopes: wire.scopes.0,
1008 })
1009 }
1010}
1011
1012#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
1016pub struct InstallationReview {
1017 #[serde(rename = "approve")]
1019 pub approve: bool,
1020 #[serde(rename = "requested")]
1022 pub requested: InstallationGrant,
1023}
1024impl<'de> DeserializeStrict<'de> for InstallationReview {
1025 fn deserialize_strict<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1026 #[derive(Deserialize)]
1027 #[serde(deny_unknown_fields)]
1028 struct __Wire {
1029 #[serde(rename = "approve")]
1030 approve: Strict<bool>,
1031 #[serde(rename = "requested")]
1032 requested: Strict<InstallationGrant>,
1033 }
1034 let wire = __Wire::deserialize(deserializer)?;
1035 Ok(Self {
1036 approve: wire.approve.0,
1037 requested: wire.requested.0,
1038 })
1039 }
1040}
1041
1042#[derive(Clone, Debug, PartialEq, Eq)]
1044pub enum InstallationStatus {
1045 Requested,
1047 Active,
1049 Suspended,
1051 Unknown(String),
1053}
1054impl Serialize for InstallationStatus {
1055 fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
1056 serializer.serialize_str(match self {
1057 Self::Requested => "requested",
1058 Self::Active => "active",
1059 Self::Suspended => "suspended",
1060 Self::Unknown(value) => value,
1061 })
1062 }
1063}
1064impl<'de> Deserialize<'de> for InstallationStatus {
1065 fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1066 Ok(match String::deserialize(deserializer)?.as_str() {
1067 "requested" => Self::Requested,
1068 "active" => Self::Active,
1069 "suspended" => Self::Suspended,
1070 value => Self::Unknown(value.to_owned()),
1071 })
1072 }
1073}
1074impl<'de> DeserializeStrict<'de> for InstallationStatus {
1075 fn deserialize_strict<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1076 #[derive(Deserialize)]
1077 enum __Known {
1078 #[serde(rename = "requested")]
1079 Requested,
1080 #[serde(rename = "active")]
1081 Active,
1082 #[serde(rename = "suspended")]
1083 Suspended,
1084 }
1085 Ok(match __Known::deserialize(deserializer)? {
1086 __Known::Requested => Self::Requested,
1087 __Known::Active => Self::Active,
1088 __Known::Suspended => Self::Suspended,
1089 })
1090 }
1091}
1092
1093#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
1095pub struct InstallationStatusChange {
1096 #[serde(rename = "enabled")]
1098 pub enabled: bool,
1099}
1100impl<'de> DeserializeStrict<'de> for InstallationStatusChange {
1101 fn deserialize_strict<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1102 #[derive(Deserialize)]
1103 #[serde(deny_unknown_fields)]
1104 struct __Wire {
1105 #[serde(rename = "enabled")]
1106 enabled: Strict<bool>,
1107 }
1108 let wire = __Wire::deserialize(deserializer)?;
1109 Ok(Self {
1110 enabled: wire.enabled.0,
1111 })
1112 }
1113}
1114
1115#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
1119pub struct InstallationSummary {
1120 #[serde(rename = "apiUrl")]
1122 pub api_url: String,
1123 #[serde(rename = "applicationId")]
1125 pub application_id: String,
1126 #[serde(rename = "approvedAllProjects")]
1128 #[serde(default, skip_serializing_if = "Option::is_none")]
1129 pub approved_all_projects: Option<bool>,
1130 #[serde(rename = "approvedScopes")]
1132 pub approved_scopes: Vec<String>,
1133 #[serde(rename = "id")]
1135 pub id: String,
1136 #[serde(rename = "organizationId")]
1138 pub organization_id: String,
1139 #[serde(rename = "requestedScopes")]
1141 pub requested_scopes: Vec<String>,
1142 #[serde(rename = "status")]
1144 pub status: InstallationStatus,
1145}
1146impl<'de> DeserializeStrict<'de> for InstallationSummary {
1147 fn deserialize_strict<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1148 #[derive(Deserialize)]
1149 #[serde(deny_unknown_fields)]
1150 struct __Wire {
1151 #[serde(rename = "apiUrl")]
1152 api_url: Strict<String>,
1153 #[serde(rename = "applicationId")]
1154 application_id: Strict<String>,
1155 #[serde(rename = "approvedAllProjects")]
1156 #[serde(default)]
1157 approved_all_projects: Strict<Option<bool>>,
1158 #[serde(rename = "approvedScopes")]
1159 approved_scopes: Strict<Vec<String>>,
1160 #[serde(rename = "id")]
1161 id: Strict<String>,
1162 #[serde(rename = "organizationId")]
1163 organization_id: Strict<String>,
1164 #[serde(rename = "requestedScopes")]
1165 requested_scopes: Strict<Vec<String>>,
1166 #[serde(rename = "status")]
1167 status: Strict<InstallationStatus>,
1168 }
1169 let wire = __Wire::deserialize(deserializer)?;
1170 Ok(Self {
1171 api_url: wire.api_url.0,
1172 application_id: wire.application_id.0,
1173 approved_all_projects: wire.approved_all_projects.0,
1174 approved_scopes: wire.approved_scopes.0,
1175 id: wire.id.0,
1176 organization_id: wire.organization_id.0,
1177 requested_scopes: wire.requested_scopes.0,
1178 status: wire.status.0,
1179 })
1180 }
1181}
1182
1183#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
1185pub struct ListApplicationsRequest {
1186 #[serde(rename = "pageSize")]
1188 #[serde(default, skip_serializing_if = "Option::is_none")]
1189 pub page_size: Option<u32>,
1190 #[serde(rename = "pageToken")]
1192 #[serde(default, skip_serializing_if = "Option::is_none")]
1193 pub page_token: Option<String>,
1194}
1195impl<'de> DeserializeStrict<'de> for ListApplicationsRequest {
1196 fn deserialize_strict<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1197 #[derive(Deserialize)]
1198 #[serde(deny_unknown_fields)]
1199 struct __Wire {
1200 #[serde(rename = "pageSize")]
1201 #[serde(default)]
1202 page_size: Strict<Option<u32>>,
1203 #[serde(rename = "pageToken")]
1204 #[serde(default)]
1205 page_token: Strict<Option<String>>,
1206 }
1207 let wire = __Wire::deserialize(deserializer)?;
1208 Ok(Self {
1209 page_size: wire.page_size.0,
1210 page_token: wire.page_token.0,
1211 })
1212 }
1213}
1214
1215#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
1218pub struct OrganizationAppAccess {
1219 #[serde(rename = "clients")]
1221 pub clients: Vec<ClientAppAccess>,
1222 #[serde(rename = "unlisted")]
1224 pub unlisted: UnlistedAppAccess,
1225}
1226impl<'de> DeserializeStrict<'de> for OrganizationAppAccess {
1227 fn deserialize_strict<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1228 #[derive(Deserialize)]
1229 #[serde(deny_unknown_fields)]
1230 struct __Wire {
1231 #[serde(rename = "clients")]
1232 clients: Strict<Vec<ClientAppAccess>>,
1233 #[serde(rename = "unlisted")]
1234 unlisted: Strict<UnlistedAppAccess>,
1235 }
1236 let wire = __Wire::deserialize(deserializer)?;
1237 Ok(Self {
1238 clients: wire.clients.0,
1239 unlisted: wire.unlisted.0,
1240 })
1241 }
1242}
1243
1244#[derive(Clone, Debug, PartialEq, Eq)]
1247pub enum UnlistedAppAccess {
1248 AllowReviewed,
1250 Block,
1252 Unknown(String),
1254}
1255impl Serialize for UnlistedAppAccess {
1256 fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
1257 serializer.serialize_str(match self {
1258 Self::AllowReviewed => "allow_reviewed",
1259 Self::Block => "block",
1260 Self::Unknown(value) => value,
1261 })
1262 }
1263}
1264impl<'de> Deserialize<'de> for UnlistedAppAccess {
1265 fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1266 Ok(match String::deserialize(deserializer)?.as_str() {
1267 "allow_reviewed" => Self::AllowReviewed,
1268 "block" => Self::Block,
1269 value => Self::Unknown(value.to_owned()),
1270 })
1271 }
1272}
1273impl<'de> DeserializeStrict<'de> for UnlistedAppAccess {
1274 fn deserialize_strict<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1275 #[derive(Deserialize)]
1276 enum __Known {
1277 #[serde(rename = "allow_reviewed")]
1278 AllowReviewed,
1279 #[serde(rename = "block")]
1280 Block,
1281 }
1282 Ok(match __Known::deserialize(deserializer)? {
1283 __Known::AllowReviewed => Self::AllowReviewed,
1284 __Known::Block => Self::Block,
1285 })
1286 }
1287}
1288
1289#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
1296pub struct UserInstallation {
1297 #[serde(rename = "configurationUrl")]
1299 #[serde(default, skip_serializing_if = "Option::is_none")]
1300 pub configuration_url: Option<String>,
1301 #[serde(rename = "installation")]
1303 #[serde(default, skip_serializing_if = "Option::is_none")]
1304 pub installation: Option<InstallationSummary>,
1305}
1306impl<'de> DeserializeStrict<'de> for UserInstallation {
1307 fn deserialize_strict<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
1308 #[derive(Deserialize)]
1309 #[serde(deny_unknown_fields)]
1310 struct __Wire {
1311 #[serde(rename = "configurationUrl")]
1312 #[serde(default)]
1313 configuration_url: Strict<Option<String>>,
1314 #[serde(rename = "installation")]
1315 #[serde(default)]
1316 installation: Strict<Option<InstallationSummary>>,
1317 }
1318 let wire = __Wire::deserialize(deserializer)?;
1319 Ok(Self {
1320 configuration_url: wire.configuration_url.0,
1321 installation: wire.installation.0,
1322 })
1323 }
1324}
1325
1326#[derive(Clone, Debug, PartialEq, Eq)]
1328pub enum AppsError {
1329 Conflict { application_id: String },
1331 ConsentConflict { reason: String },
1333 InvalidArgument { reason: String },
1335 InvalidConsent { reason: String },
1337 NotFound { application_id: String },
1339 RegistrationUnavailable { application_id: String },
1341}
1342impl AppsError {
1343 pub fn status(&self) -> u16 {
1345 match self {
1346 Self::Conflict { .. } => 409,
1347 Self::ConsentConflict { .. } => 409,
1348 Self::InvalidArgument { .. } => 400,
1349 Self::InvalidConsent { .. } => 400,
1350 Self::NotFound { .. } => 404,
1351 Self::RegistrationUnavailable { .. } => 500,
1352 }
1353 }
1354 pub fn envelope(&self, instance: String) -> ErrorEnvelope {
1356 match self {
1357 Self::Conflict { application_id } => {
1358 let mut envelope = ErrorEnvelope::new("CONFLICT", "Apps:Conflict", instance);
1359 envelope
1360 .parameters
1361 .insert("applicationId".into(), application_id.to_string());
1362 envelope
1363 }
1364 Self::ConsentConflict { reason } => {
1365 let mut envelope = ErrorEnvelope::new("CONFLICT", "Apps:ConsentConflict", instance);
1366 envelope
1367 .parameters
1368 .insert("reason".into(), reason.to_string());
1369 envelope
1370 }
1371 Self::InvalidArgument { reason } => {
1372 let mut envelope =
1373 ErrorEnvelope::new("INVALID_ARGUMENT", "Apps:InvalidArgument", instance);
1374 envelope
1375 .parameters
1376 .insert("reason".into(), reason.to_string());
1377 envelope
1378 }
1379 Self::InvalidConsent { reason } => {
1380 let mut envelope =
1381 ErrorEnvelope::new("INVALID_ARGUMENT", "Apps:InvalidConsent", instance);
1382 envelope
1383 .parameters
1384 .insert("reason".into(), reason.to_string());
1385 envelope
1386 }
1387 Self::NotFound { application_id } => {
1388 let mut envelope = ErrorEnvelope::new("NOT_FOUND", "Apps:NotFound", instance);
1389 envelope
1390 .parameters
1391 .insert("applicationId".into(), application_id.to_string());
1392 envelope
1393 }
1394 Self::RegistrationUnavailable { application_id } => {
1395 let mut envelope =
1396 ErrorEnvelope::new("INTERNAL", "Apps:RegistrationUnavailable", instance);
1397 envelope
1398 .parameters
1399 .insert("applicationId".into(), application_id.to_string());
1400 envelope
1401 }
1402 }
1403 }
1404 pub fn decode_envelope(envelope: &ErrorEnvelope) -> Option<Self> {
1406 if envelope.error_instance_id.len() != 36
1407 || Uuid::parse_str(&envelope.error_instance_id).is_err()
1408 {
1409 return None;
1410 }
1411 match envelope.error_name.as_str() {
1412 "Apps:Conflict" => {
1413 if envelope.error_code != "CONFLICT" {
1414 return None;
1415 }
1416 let application_id = envelope.parameters.get("applicationId")?.clone();
1417 Some(Self::Conflict { application_id })
1418 }
1419 "Apps:ConsentConflict" => {
1420 if envelope.error_code != "CONFLICT" {
1421 return None;
1422 }
1423 let reason = envelope.parameters.get("reason")?.clone();
1424 Some(Self::ConsentConflict { reason })
1425 }
1426 "Apps:InvalidArgument" => {
1427 if envelope.error_code != "INVALID_ARGUMENT" {
1428 return None;
1429 }
1430 let reason = envelope.parameters.get("reason")?.clone();
1431 Some(Self::InvalidArgument { reason })
1432 }
1433 "Apps:InvalidConsent" => {
1434 if envelope.error_code != "INVALID_ARGUMENT" {
1435 return None;
1436 }
1437 let reason = envelope.parameters.get("reason")?.clone();
1438 Some(Self::InvalidConsent { reason })
1439 }
1440 "Apps:NotFound" => {
1441 if envelope.error_code != "NOT_FOUND" {
1442 return None;
1443 }
1444 let application_id = envelope.parameters.get("applicationId")?.clone();
1445 Some(Self::NotFound { application_id })
1446 }
1447 "Apps:RegistrationUnavailable" => {
1448 if envelope.error_code != "INTERNAL" {
1449 return None;
1450 }
1451 let application_id = envelope.parameters.get("applicationId")?.clone();
1452 Some(Self::RegistrationUnavailable { application_id })
1453 }
1454 _ => None,
1455 }
1456 }
1457}
1458impl Display for AppsError {
1459 fn fmt(&self, formatter: &mut Formatter<'_>) -> fmt::Result {
1460 match self {
1461 Self::Conflict { application_id } => write!(
1462 formatter,
1463 "Apps:Conflict (applicationId: {})",
1464 application_id
1465 ),
1466 Self::ConsentConflict { reason } => {
1467 write!(formatter, "Apps:ConsentConflict (reason: {})", reason)
1468 }
1469 Self::InvalidArgument { reason } => {
1470 write!(formatter, "Apps:InvalidArgument (reason: {})", reason)
1471 }
1472 Self::InvalidConsent { reason } => {
1473 write!(formatter, "Apps:InvalidConsent (reason: {})", reason)
1474 }
1475 Self::NotFound { application_id } => write!(
1476 formatter,
1477 "Apps:NotFound (applicationId: {})",
1478 application_id
1479 ),
1480 Self::RegistrationUnavailable { application_id } => write!(
1481 formatter,
1482 "Apps:RegistrationUnavailable (applicationId: {})",
1483 application_id
1484 ),
1485 }
1486 }
1487}
1488impl StdError for AppsError {}
1489impl ServiceError for AppsError {
1490 fn to_envelope(&self, instance: String) -> ErrorEnvelope {
1491 Self::envelope(self, instance)
1492 }
1493 fn from_envelope(envelope: &ErrorEnvelope) -> Option<Self> {
1494 Self::decode_envelope(envelope)
1495 }
1496}
1497#[automatically_derived]
1498impl Default for ListApplicationsRequest {
1499 fn default() -> Self {
1500 Self {
1501 page_size: None,
1502 page_token: None,
1503 }
1504 }
1505}