harmont_cloud_raw/lib.rs
1//! GENERATED by `make codegen-sdk-rs` (progenitor). Do not edit by hand.
2mod progenitor_client;
3
4#[allow(unused_imports)]
5use progenitor_client::{encode_path, ClientHooks, OperationInfo, RequestBuilderExt};
6#[allow(unused_imports)]
7pub use progenitor_client::{ByteStream, ClientInfo, Error, ResponseValue};
8/// Types used as operation parameters and responses.
9#[allow(clippy::all)]
10pub mod types {
11 /// Error types.
12 pub mod error {
13 /// Error from a `TryFrom` or `FromStr` implementation.
14 pub struct ConversionError(::std::borrow::Cow<'static, str>);
15 impl ::std::error::Error for ConversionError {}
16 impl ::std::fmt::Display for ConversionError {
17 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
18 ::std::fmt::Display::fmt(&self.0, f)
19 }
20 }
21
22 impl ::std::fmt::Debug for ConversionError {
23 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
24 ::std::fmt::Debug::fmt(&self.0, f)
25 }
26 }
27
28 impl From<&'static str> for ConversionError {
29 fn from(value: &'static str) -> Self {
30 Self(value.into())
31 }
32 }
33
34 impl From<String> for ConversionError {
35 fn from(value: String) -> Self {
36 Self(value.into())
37 }
38 }
39 }
40
41 ///`AcceptInviteRequest`
42 ///
43 /// <details><summary>JSON schema</summary>
44 ///
45 /// ```json
46 ///{
47 /// "title": "AcceptInviteRequest",
48 /// "type": "object",
49 /// "required": [
50 /// "token"
51 /// ],
52 /// "properties": {
53 /// "token": {
54 /// "type": "string"
55 /// }
56 /// }
57 ///}
58 /// ```
59 /// </details>
60 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
61 pub struct AcceptInviteRequest {
62 pub token: ::std::string::String,
63 }
64
65 ///A personal API key. The secret is returned only once, at creation.
66 ///
67 /// <details><summary>JSON schema</summary>
68 ///
69 /// ```json
70 ///{
71 /// "title": "ApiToken",
72 /// "description": "A personal API key. The secret is returned only once,
73 /// at creation.",
74 /// "type": "object",
75 /// "required": [
76 /// "created_at",
77 /// "id"
78 /// ],
79 /// "properties": {
80 /// "created_at": {
81 /// "description": "When the key was created.",
82 /// "type": "string",
83 /// "format": "date-time"
84 /// },
85 /// "description": {
86 /// "description": "Human label for the key.",
87 /// "type": [
88 /// "string",
89 /// "null"
90 /// ]
91 /// },
92 /// "expires_at": {
93 /// "description": "When the key expires, or null if it never
94 /// expires.",
95 /// "type": [
96 /// "string",
97 /// "null"
98 /// ],
99 /// "format": "date-time"
100 /// },
101 /// "id": {
102 /// "description": "Stable key id.",
103 /// "type": "string",
104 /// "format": "uuid"
105 /// },
106 /// "last_used_at": {
107 /// "description": "When the key was last used to authenticate, if
108 /// ever.",
109 /// "type": [
110 /// "string",
111 /// "null"
112 /// ],
113 /// "format": "date-time"
114 /// }
115 /// }
116 ///}
117 /// ```
118 /// </details>
119 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
120 pub struct ApiToken {
121 ///When the key was created.
122 pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
123 ///Human label for the key.
124 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
125 pub description: ::std::option::Option<::std::string::String>,
126 ///When the key expires, or null if it never expires.
127 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
128 pub expires_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
129 ///Stable key id.
130 pub id: ::uuid::Uuid,
131 ///When the key was last used to authenticate, if ever.
132 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
133 pub last_used_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
134 }
135
136 ///Creates a personal API key.
137 ///
138 /// <details><summary>JSON schema</summary>
139 ///
140 /// ```json
141 ///{
142 /// "title": "ApiTokenCreateRequest",
143 /// "description": "Creates a personal API key.",
144 /// "examples": [
145 /// {
146 /// "description": "Laptop CLI",
147 /// "expires_at": null
148 /// }
149 /// ],
150 /// "type": "object",
151 /// "required": [
152 /// "description"
153 /// ],
154 /// "properties": {
155 /// "description": {
156 /// "description": "Human label for the key.",
157 /// "type": "string"
158 /// },
159 /// "expires_at": {
160 /// "description": "Optional expiry; null or omitted means the key
161 /// never expires.",
162 /// "type": [
163 /// "string",
164 /// "null"
165 /// ],
166 /// "format": "date-time"
167 /// }
168 /// }
169 ///}
170 /// ```
171 /// </details>
172 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
173 pub struct ApiTokenCreateRequest {
174 ///Human label for the key.
175 pub description: ::std::string::String,
176 ///Optional expiry; null or omitted means the key never expires.
177 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
178 pub expires_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
179 }
180
181 ///The created key and its raw secret. The secret is shown only here, once.
182 ///
183 /// <details><summary>JSON schema</summary>
184 ///
185 /// ```json
186 ///{
187 /// "title": "ApiTokenCreateResponse",
188 /// "description": "The created key and its raw secret. The secret is shown
189 /// only here, once.",
190 /// "type": "object",
191 /// "required": [
192 /// "api_token",
193 /// "token"
194 /// ],
195 /// "properties": {
196 /// "api_token": {
197 /// "$ref": "#/components/schemas/ApiToken"
198 /// },
199 /// "token": {
200 /// "description": "The raw API key secret. Store it now; it is never
201 /// shown again.",
202 /// "type": "string"
203 /// }
204 /// }
205 ///}
206 /// ```
207 /// </details>
208 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
209 pub struct ApiTokenCreateResponse {
210 pub api_token: ApiToken,
211 ///The raw API key secret. Store it now; it is never shown again.
212 pub token: ::std::string::String,
213 }
214
215 ///Every personal API key belonging to the current user.
216 ///
217 /// <details><summary>JSON schema</summary>
218 ///
219 /// ```json
220 ///{
221 /// "title": "ApiTokenListResponse",
222 /// "description": "Every personal API key belonging to the current user.",
223 /// "type": "object",
224 /// "required": [
225 /// "api_tokens"
226 /// ],
227 /// "properties": {
228 /// "api_tokens": {
229 /// "description": "The user's personal API keys.",
230 /// "type": "array",
231 /// "items": {
232 /// "$ref": "#/components/schemas/ApiToken"
233 /// }
234 /// }
235 /// }
236 ///}
237 /// ```
238 /// </details>
239 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
240 pub struct ApiTokenListResponse {
241 ///The user's personal API keys.
242 pub api_tokens: ::std::vec::Vec<ApiToken>,
243 }
244
245 ///GitHub OAuth callback payload from the SPA.
246 ///
247 /// <details><summary>JSON schema</summary>
248 ///
249 /// ```json
250 ///{
251 /// "title": "AuthGithubRequest",
252 /// "description": "GitHub OAuth callback payload from the SPA.",
253 /// "examples": [
254 /// {
255 /// "code": "abc123def456"
256 /// }
257 /// ],
258 /// "type": "object",
259 /// "required": [
260 /// "code"
261 /// ],
262 /// "properties": {
263 /// "code": {
264 /// "description": "The authorization code returned by GitHub to the
265 /// SPA.",
266 /// "type": "string"
267 /// }
268 /// }
269 ///}
270 /// ```
271 /// </details>
272 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
273 pub struct AuthGithubRequest {
274 ///The authorization code returned by GitHub to the SPA.
275 pub code: ::std::string::String,
276 }
277
278 ///Google OAuth callback payload from the SPA.
279 ///
280 /// <details><summary>JSON schema</summary>
281 ///
282 /// ```json
283 ///{
284 /// "title": "AuthGoogleRequest",
285 /// "description": "Google OAuth callback payload from the SPA.",
286 /// "examples": [
287 /// {
288 /// "code": "4/0Afg...",
289 /// "redirect_uri": "https://app.harmont.dev/auth/google/callback"
290 /// }
291 /// ],
292 /// "type": "object",
293 /// "required": [
294 /// "code",
295 /// "redirect_uri"
296 /// ],
297 /// "properties": {
298 /// "code": {
299 /// "description": "The authorization code returned by Google to the
300 /// SPA.",
301 /// "type": "string"
302 /// },
303 /// "redirect_uri": {
304 /// "description": "The redirect URI the SPA used; must match the OAuth
305 /// client config.",
306 /// "type": "string"
307 /// }
308 /// }
309 ///}
310 /// ```
311 /// </details>
312 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
313 pub struct AuthGoogleRequest {
314 ///The authorization code returned by Google to the SPA.
315 pub code: ::std::string::String,
316 ///The redirect URI the SPA used; must match the OAuth client config.
317 pub redirect_uri: ::std::string::String,
318 }
319
320 ///A freshly minted session bearer token and the authenticated user.
321 ///
322 /// <details><summary>JSON schema</summary>
323 ///
324 /// ```json
325 ///{
326 /// "title": "AuthTokenResponse",
327 /// "description": "A freshly minted session bearer token and the
328 /// authenticated user.",
329 /// "type": "object",
330 /// "required": [
331 /// "token",
332 /// "user"
333 /// ],
334 /// "properties": {
335 /// "token": {
336 /// "description": "The raw session bearer token. Send it as
337 /// `Authorization: Bearer <token>`.",
338 /// "type": "string"
339 /// },
340 /// "user": {
341 /// "$ref": "#/components/schemas/User"
342 /// }
343 /// }
344 ///}
345 /// ```
346 /// </details>
347 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
348 pub struct AuthTokenResponse {
349 ///The raw session bearer token. Send it as `Authorization: Bearer
350 /// <token>`.
351 pub token: ::std::string::String,
352 pub user: User,
353 }
354
355 ///The organization's current balance — the sum of every ledger entry
356 /// (credits positive, debits negative). May be negative.
357 ///
358 /// <details><summary>JSON schema</summary>
359 ///
360 /// ```json
361 ///{
362 /// "title": "BalanceResponse",
363 /// "description": "The organization's current balance — the sum of every
364 /// ledger entry (credits positive, debits negative). May be negative.",
365 /// "type": "object",
366 /// "required": [
367 /// "balance_cents"
368 /// ],
369 /// "properties": {
370 /// "balance_cents": {
371 /// "description": "Current balance in cents (credits − debits). May be
372 /// negative.",
373 /// "type": "integer"
374 /// }
375 /// }
376 ///}
377 /// ```
378 /// </details>
379 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
380 pub struct BalanceResponse {
381 ///Current balance in cents (credits − debits). May be negative.
382 pub balance_cents: i64,
383 }
384
385 ///The Bitbucket authorize URL the SPA should open.
386 ///
387 /// <details><summary>JSON schema</summary>
388 ///
389 /// ```json
390 ///{
391 /// "title": "BitbucketOAuthUrlResponse",
392 /// "description": "The Bitbucket authorize URL the SPA should open.",
393 /// "examples": [
394 /// {
395 /// "url": "https://bitbucket.org/site/oauth2/authorize?client_id=...&response_type=code"
396 /// }
397 /// ],
398 /// "type": "object",
399 /// "required": [
400 /// "url"
401 /// ],
402 /// "properties": {
403 /// "url": {
404 /// "description": "Bitbucket OAuth authorize URL.",
405 /// "type": "string"
406 /// }
407 /// }
408 ///}
409 /// ```
410 /// </details>
411 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
412 pub struct BitbucketOAuthUrlResponse {
413 ///Bitbucket OAuth authorize URL.
414 pub url: ::std::string::String,
415 }
416
417 ///A Bitbucket repository visible to the connected OAuth token.
418 ///
419 /// <details><summary>JSON schema</summary>
420 ///
421 /// ```json
422 ///{
423 /// "title": "BitbucketRepo",
424 /// "description": "A Bitbucket repository visible to the connected OAuth
425 /// token.",
426 /// "examples": [
427 /// {
428 /// "clone_url": "https://bitbucket.org/acme/widget.git",
429 /// "default_branch": "main",
430 /// "full_name": "acme/widget",
431 /// "name": "widget",
432 /// "private": true
433 /// }
434 /// ],
435 /// "type": "object",
436 /// "required": [
437 /// "full_name",
438 /// "name"
439 /// ],
440 /// "properties": {
441 /// "clone_url": {
442 /// "description": "HTTPS clone URL.",
443 /// "type": [
444 /// "string",
445 /// "null"
446 /// ]
447 /// },
448 /// "default_branch": {
449 /// "description": "Default branch name.",
450 /// "type": [
451 /// "string",
452 /// "null"
453 /// ]
454 /// },
455 /// "full_name": {
456 /// "description": "Workspace-qualified repo name, e.g.
457 /// `acme/widget`.",
458 /// "type": "string"
459 /// },
460 /// "name": {
461 /// "description": "Repository slug.",
462 /// "type": "string"
463 /// },
464 /// "private": {
465 /// "description": "Whether the repository is private.",
466 /// "type": "boolean"
467 /// }
468 /// }
469 ///}
470 /// ```
471 /// </details>
472 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
473 pub struct BitbucketRepo {
474 ///HTTPS clone URL.
475 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
476 pub clone_url: ::std::option::Option<::std::string::String>,
477 ///Default branch name.
478 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
479 pub default_branch: ::std::option::Option<::std::string::String>,
480 ///Workspace-qualified repo name, e.g. `acme/widget`.
481 pub full_name: ::std::string::String,
482 ///Repository slug.
483 pub name: ::std::string::String,
484 ///Whether the repository is private.
485 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
486 pub private: ::std::option::Option<bool>,
487 }
488
489 ///Bitbucket repositories visible within the requested workspace.
490 ///
491 /// <details><summary>JSON schema</summary>
492 ///
493 /// ```json
494 ///{
495 /// "title": "BitbucketRepoList",
496 /// "description": "Bitbucket repositories visible within the requested
497 /// workspace.",
498 /// "examples": [
499 /// {
500 /// "repos": []
501 /// }
502 /// ],
503 /// "type": "object",
504 /// "required": [
505 /// "repos"
506 /// ],
507 /// "properties": {
508 /// "repos": {
509 /// "description": "The repositories.",
510 /// "type": "array",
511 /// "items": {
512 /// "$ref": "#/components/schemas/BitbucketRepo"
513 /// }
514 /// }
515 /// }
516 ///}
517 /// ```
518 /// </details>
519 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
520 pub struct BitbucketRepoList {
521 ///The repositories.
522 pub repos: ::std::vec::Vec<BitbucketRepo>,
523 }
524
525 ///A connected Bitbucket workspace.
526 ///
527 /// <details><summary>JSON schema</summary>
528 ///
529 /// ```json
530 ///{
531 /// "title": "BitbucketWorkspace",
532 /// "description": "A connected Bitbucket workspace.",
533 /// "examples": [
534 /// {
535 /// "name": "Acme Inc",
536 /// "slug": "acme"
537 /// }
538 /// ],
539 /// "type": "object",
540 /// "required": [
541 /// "slug"
542 /// ],
543 /// "properties": {
544 /// "name": {
545 /// "description": "Display name of the workspace.",
546 /// "type": "string"
547 /// },
548 /// "slug": {
549 /// "description": "Unique workspace slug.",
550 /// "type": "string"
551 /// }
552 /// }
553 ///}
554 /// ```
555 /// </details>
556 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
557 pub struct BitbucketWorkspace {
558 ///Display name of the workspace.
559 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
560 pub name: ::std::option::Option<::std::string::String>,
561 ///Unique workspace slug.
562 pub slug: ::std::string::String,
563 }
564
565 ///All Bitbucket workspaces the connected OAuth token can access.
566 ///
567 /// <details><summary>JSON schema</summary>
568 ///
569 /// ```json
570 ///{
571 /// "title": "BitbucketWorkspaceList",
572 /// "description": "All Bitbucket workspaces the connected OAuth token can
573 /// access.",
574 /// "examples": [
575 /// {
576 /// "workspaces": [
577 /// {
578 /// "name": "Acme Inc",
579 /// "slug": "acme"
580 /// }
581 /// ]
582 /// }
583 /// ],
584 /// "type": "object",
585 /// "required": [
586 /// "workspaces"
587 /// ],
588 /// "properties": {
589 /// "workspaces": {
590 /// "description": "The connected workspaces.",
591 /// "type": "array",
592 /// "items": {
593 /// "$ref": "#/components/schemas/BitbucketWorkspace"
594 /// }
595 /// }
596 /// }
597 ///}
598 /// ```
599 /// </details>
600 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
601 pub struct BitbucketWorkspaceList {
602 ///The connected workspaces.
603 pub workspaces: ::std::vec::Vec<BitbucketWorkspace>,
604 }
605
606 ///One run of a pipeline, identified by its pipeline-scoped number.
607 ///
608 /// <details><summary>JSON schema</summary>
609 ///
610 /// ```json
611 ///{
612 /// "title": "Build",
613 /// "description": "One run of a pipeline, identified by its
614 /// pipeline-scoped number.",
615 /// "type": "object",
616 /// "required": [
617 /// "created_at",
618 /// "number",
619 /// "pipeline_slug",
620 /// "state"
621 /// ],
622 /// "properties": {
623 /// "branch": {
624 /// "description": "Source branch.",
625 /// "type": [
626 /// "string",
627 /// "null"
628 /// ]
629 /// },
630 /// "commit": {
631 /// "description": "Source commit SHA.",
632 /// "type": [
633 /// "string",
634 /// "null"
635 /// ]
636 /// },
637 /// "created_at": {
638 /// "description": "When the build row was created.",
639 /// "type": "string",
640 /// "format": "date-time"
641 /// },
642 /// "error_code": {
643 /// "description": "Stable build-level error code, if the build failed
644 /// at the build level.",
645 /// "type": [
646 /// "string",
647 /// "null"
648 /// ]
649 /// },
650 /// "error_message": {
651 /// "description": "Human-readable build-level error message, if any.",
652 /// "type": [
653 /// "string",
654 /// "null"
655 /// ]
656 /// },
657 /// "finished_at": {
658 /// "description": "When the build reached a terminal state.",
659 /// "type": [
660 /// "string",
661 /// "null"
662 /// ],
663 /// "format": "date-time"
664 /// },
665 /// "message": {
666 /// "description": "Commit/build message.",
667 /// "type": [
668 /// "string",
669 /// "null"
670 /// ]
671 /// },
672 /// "number": {
673 /// "description": "The build's number, sequential and unique within
674 /// its pipeline.",
675 /// "type": "integer"
676 /// },
677 /// "pipeline_slug": {
678 /// "description": "The global slug of the pipeline this build belongs
679 /// to.",
680 /// "type": "string"
681 /// },
682 /// "scheduled_at": {
683 /// "description": "When the build was queued.",
684 /// "type": [
685 /// "string",
686 /// "null"
687 /// ],
688 /// "format": "date-time"
689 /// },
690 /// "source": {
691 /// "description": "How the build was triggered (e.g. `api`, `webhook`,
692 /// `ui`).",
693 /// "type": [
694 /// "string",
695 /// "null"
696 /// ]
697 /// },
698 /// "started_at": {
699 /// "description": "When the build started running.",
700 /// "type": [
701 /// "string",
702 /// "null"
703 /// ],
704 /// "format": "date-time"
705 /// },
706 /// "state": {
707 /// "description": "The rolled-up build state.",
708 /// "type": "string",
709 /// "enum": [
710 /// "scheduled",
711 /// "running",
712 /// "failing",
713 /// "passed",
714 /// "failed",
715 /// "canceling",
716 /// "canceled"
717 /// ]
718 /// }
719 /// }
720 ///}
721 /// ```
722 /// </details>
723 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
724 pub struct Build {
725 ///Source branch.
726 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
727 pub branch: ::std::option::Option<::std::string::String>,
728 ///Source commit SHA.
729 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
730 pub commit: ::std::option::Option<::std::string::String>,
731 ///When the build row was created.
732 pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
733 ///Stable build-level error code, if the build failed at the build
734 /// level.
735 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
736 pub error_code: ::std::option::Option<::std::string::String>,
737 ///Human-readable build-level error message, if any.
738 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
739 pub error_message: ::std::option::Option<::std::string::String>,
740 ///When the build reached a terminal state.
741 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
742 pub finished_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
743 ///Commit/build message.
744 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
745 pub message: ::std::option::Option<::std::string::String>,
746 ///The build's number, sequential and unique within its pipeline.
747 pub number: i64,
748 ///The global slug of the pipeline this build belongs to.
749 pub pipeline_slug: ::std::string::String,
750 ///When the build was queued.
751 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
752 pub scheduled_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
753 ///How the build was triggered (e.g. `api`, `webhook`, `ui`).
754 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
755 pub source: ::std::option::Option<::std::string::String>,
756 ///When the build started running.
757 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
758 pub started_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
759 ///The rolled-up build state.
760 pub state: BuildState,
761 }
762
763 ///A page of a pipeline's builds (newest first), with an opaque cursor.
764 ///
765 /// <details><summary>JSON schema</summary>
766 ///
767 /// ```json
768 ///{
769 /// "title": "BuildList",
770 /// "description": "A page of a pipeline's builds (newest first), with an
771 /// opaque cursor.",
772 /// "type": "object",
773 /// "required": [
774 /// "data",
775 /// "next_cursor"
776 /// ],
777 /// "properties": {
778 /// "data": {
779 /// "description": "The builds on this page, newest first.",
780 /// "type": "array",
781 /// "items": {
782 /// "$ref": "#/components/schemas/Build"
783 /// }
784 /// },
785 /// "next_cursor": {
786 /// "description": "Opaque cursor for the next page. Pass it as the
787 /// `cursor` query parameter; `null` when there are no more pages.",
788 /// "type": [
789 /// "string",
790 /// "null"
791 /// ]
792 /// }
793 /// }
794 ///}
795 /// ```
796 /// </details>
797 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
798 pub struct BuildList {
799 ///The builds on this page, newest first.
800 pub data: ::std::vec::Vec<Build>,
801 ///Opaque cursor for the next page. Pass it as the `cursor` query
802 /// parameter; `null` when there are no more pages.
803 pub next_cursor: ::std::option::Option<::std::string::String>,
804 }
805
806 ///The rolled-up build state.
807 ///
808 /// <details><summary>JSON schema</summary>
809 ///
810 /// ```json
811 ///{
812 /// "description": "The rolled-up build state.",
813 /// "type": "string",
814 /// "enum": [
815 /// "scheduled",
816 /// "running",
817 /// "failing",
818 /// "passed",
819 /// "failed",
820 /// "canceling",
821 /// "canceled"
822 /// ]
823 ///}
824 /// ```
825 /// </details>
826 #[derive(
827 :: serde :: Deserialize,
828 :: serde :: Serialize,
829 Clone,
830 Copy,
831 Debug,
832 Eq,
833 Hash,
834 Ord,
835 PartialEq,
836 PartialOrd,
837 )]
838 pub enum BuildState {
839 #[serde(rename = "scheduled")]
840 Scheduled,
841 #[serde(rename = "running")]
842 Running,
843 #[serde(rename = "failing")]
844 Failing,
845 #[serde(rename = "passed")]
846 Passed,
847 #[serde(rename = "failed")]
848 Failed,
849 #[serde(rename = "canceling")]
850 Canceling,
851 #[serde(rename = "canceled")]
852 Canceled,
853 }
854
855 impl ::std::fmt::Display for BuildState {
856 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
857 match *self {
858 Self::Scheduled => f.write_str("scheduled"),
859 Self::Running => f.write_str("running"),
860 Self::Failing => f.write_str("failing"),
861 Self::Passed => f.write_str("passed"),
862 Self::Failed => f.write_str("failed"),
863 Self::Canceling => f.write_str("canceling"),
864 Self::Canceled => f.write_str("canceled"),
865 }
866 }
867 }
868
869 impl ::std::str::FromStr for BuildState {
870 type Err = self::error::ConversionError;
871 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
872 match value {
873 "scheduled" => Ok(Self::Scheduled),
874 "running" => Ok(Self::Running),
875 "failing" => Ok(Self::Failing),
876 "passed" => Ok(Self::Passed),
877 "failed" => Ok(Self::Failed),
878 "canceling" => Ok(Self::Canceling),
879 "canceled" => Ok(Self::Canceled),
880 _ => Err("invalid value".into()),
881 }
882 }
883 }
884
885 impl ::std::convert::TryFrom<&str> for BuildState {
886 type Error = self::error::ConversionError;
887 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
888 value.parse()
889 }
890 }
891
892 impl ::std::convert::TryFrom<&::std::string::String> for BuildState {
893 type Error = self::error::ConversionError;
894 fn try_from(
895 value: &::std::string::String,
896 ) -> ::std::result::Result<Self, self::error::ConversionError> {
897 value.parse()
898 }
899 }
900
901 impl ::std::convert::TryFrom<::std::string::String> for BuildState {
902 type Error = self::error::ConversionError;
903 fn try_from(
904 value: ::std::string::String,
905 ) -> ::std::result::Result<Self, self::error::ConversionError> {
906 value.parse()
907 }
908 }
909
910 ///Starts a Stripe Checkout Session crediting the organization identified
911 /// by the path (`:org`). The body carries only the top-up amount in cents.
912 ///
913 /// <details><summary>JSON schema</summary>
914 ///
915 /// ```json
916 ///{
917 /// "title": "CheckoutRequest",
918 /// "description": "Starts a Stripe Checkout Session crediting the
919 /// organization identified by the path (`:org`). The body carries only the
920 /// top-up amount in cents.",
921 /// "type": "object",
922 /// "required": [
923 /// "amount_cents"
924 /// ],
925 /// "properties": {
926 /// "amount_cents": {
927 /// "description": "The credit top-up amount in cents. Must be a
928 /// positive integer within the supported bounds (100–1,000,000).",
929 /// "type": "integer",
930 /// "maximum": 1000000.0,
931 /// "minimum": 100.0
932 /// }
933 /// }
934 ///}
935 /// ```
936 /// </details>
937 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
938 pub struct CheckoutRequest {
939 ///The credit top-up amount in cents. Must be a positive integer within
940 /// the supported bounds (100–1,000,000).
941 pub amount_cents: i64,
942 }
943
944 ///The hosted Stripe Checkout URL. Redirect the customer here to complete
945 /// the top-up; on success Stripe fires a webhook that posts the matching
946 /// credit.
947 ///
948 /// <details><summary>JSON schema</summary>
949 ///
950 /// ```json
951 ///{
952 /// "title": "CheckoutResponse",
953 /// "description": "The hosted Stripe Checkout URL. Redirect the customer
954 /// here to complete the top-up; on success Stripe fires a webhook that
955 /// posts the matching credit.",
956 /// "type": "object",
957 /// "required": [
958 /// "checkout_url"
959 /// ],
960 /// "properties": {
961 /// "checkout_url": {
962 /// "description": "The hosted Stripe Checkout Session URL.",
963 /// "type": "string"
964 /// }
965 /// }
966 ///}
967 /// ```
968 /// </details>
969 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
970 pub struct CheckoutResponse {
971 ///The hosted Stripe Checkout Session URL.
972 pub checkout_url: ::std::string::String,
973 }
974
975 ///The CLI polls with its nonce to claim the session token the SPA
976 /// transferred.
977 ///
978 /// <details><summary>JSON schema</summary>
979 ///
980 /// ```json
981 ///{
982 /// "title": "CliClaimRequest",
983 /// "description": "The CLI polls with its nonce to claim the session token
984 /// the SPA transferred.",
985 /// "examples": [
986 /// {
987 /// "nonce": "a7Kp...random"
988 /// }
989 /// ],
990 /// "type": "object",
991 /// "required": [
992 /// "nonce"
993 /// ],
994 /// "properties": {
995 /// "nonce": {
996 /// "description": "The nonce the CLI generated for this loopback
997 /// handoff.",
998 /// "type": "string"
999 /// }
1000 /// }
1001 ///}
1002 /// ```
1003 /// </details>
1004 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
1005 pub struct CliClaimRequest {
1006 ///The nonce the CLI generated for this loopback handoff.
1007 pub nonce: ::std::string::String,
1008 }
1009
1010 ///A short, human-typeable code the user re-types into the CLI.
1011 ///
1012 /// <details><summary>JSON schema</summary>
1013 ///
1014 /// ```json
1015 ///{
1016 /// "title": "CliCodeResponse",
1017 /// "description": "A short, human-typeable code the user re-types into the
1018 /// CLI.",
1019 /// "examples": [
1020 /// {
1021 /// "code": "K7P2QR9MX3WZ4NTV"
1022 /// }
1023 /// ],
1024 /// "type": "object",
1025 /// "required": [
1026 /// "code"
1027 /// ],
1028 /// "properties": {
1029 /// "code": {
1030 /// "description": "The single-use paste code. Valid for five
1031 /// minutes.",
1032 /// "type": "string"
1033 /// }
1034 /// }
1035 ///}
1036 /// ```
1037 /// </details>
1038 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
1039 pub struct CliCodeResponse {
1040 ///The single-use paste code. Valid for five minutes.
1041 pub code: ::std::string::String,
1042 }
1043
1044 ///The CLI redeems a paste code the user typed in, receiving the session
1045 /// token.
1046 ///
1047 /// <details><summary>JSON schema</summary>
1048 ///
1049 /// ```json
1050 ///{
1051 /// "title": "CliRedeemRequest",
1052 /// "description": "The CLI redeems a paste code the user typed in,
1053 /// receiving the session token.",
1054 /// "examples": [
1055 /// {
1056 /// "code": "K7P2QR9MX3WZ4NTV"
1057 /// }
1058 /// ],
1059 /// "type": "object",
1060 /// "required": [
1061 /// "code"
1062 /// ],
1063 /// "properties": {
1064 /// "code": {
1065 /// "description": "The paste code shown by the SPA.",
1066 /// "type": "string"
1067 /// }
1068 /// }
1069 ///}
1070 /// ```
1071 /// </details>
1072 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
1073 pub struct CliRedeemRequest {
1074 ///The paste code shown by the SPA.
1075 pub code: ::std::string::String,
1076 }
1077
1078 ///The raw session bearer token handed to the CLI.
1079 ///
1080 /// <details><summary>JSON schema</summary>
1081 ///
1082 /// ```json
1083 ///{
1084 /// "title": "CliTokenResponse",
1085 /// "description": "The raw session bearer token handed to the CLI.",
1086 /// "type": "object",
1087 /// "required": [
1088 /// "token"
1089 /// ],
1090 /// "properties": {
1091 /// "token": {
1092 /// "description": "The raw session bearer token. Send it as
1093 /// `Authorization: Bearer <token>`.",
1094 /// "type": "string"
1095 /// }
1096 /// }
1097 ///}
1098 /// ```
1099 /// </details>
1100 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
1101 pub struct CliTokenResponse {
1102 ///The raw session bearer token. Send it as `Authorization: Bearer
1103 /// <token>`.
1104 pub token: ::std::string::String,
1105 }
1106
1107 ///The SPA hands a fresh session token to a locally-running CLI that
1108 /// generated `nonce` and is polling the claim endpoint.
1109 ///
1110 /// <details><summary>JSON schema</summary>
1111 ///
1112 /// ```json
1113 ///{
1114 /// "title": "CliTransferRequest",
1115 /// "description": "The SPA hands a fresh session token to a
1116 /// locally-running CLI that generated `nonce` and is polling the claim
1117 /// endpoint.",
1118 /// "examples": [
1119 /// {
1120 /// "nonce": "a7Kp...random"
1121 /// }
1122 /// ],
1123 /// "type": "object",
1124 /// "required": [
1125 /// "nonce"
1126 /// ],
1127 /// "properties": {
1128 /// "nonce": {
1129 /// "description": "The opaque nonce the CLI generated and is polling
1130 /// claim with.",
1131 /// "type": "string"
1132 /// }
1133 /// }
1134 ///}
1135 /// ```
1136 /// </details>
1137 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
1138 pub struct CliTransferRequest {
1139 ///The opaque nonce the CLI generated and is polling claim with.
1140 pub nonce: ::std::string::String,
1141 }
1142
1143 ///OAuth callback payload from the SPA.
1144 ///
1145 /// <details><summary>JSON schema</summary>
1146 ///
1147 /// ```json
1148 ///{
1149 /// "title": "ConnectBitbucketRequest",
1150 /// "description": "OAuth callback payload from the SPA.",
1151 /// "examples": [
1152 /// {
1153 /// "code": "abc123",
1154 /// "state": "SFMyNTY..."
1155 /// }
1156 /// ],
1157 /// "type": "object",
1158 /// "required": [
1159 /// "code",
1160 /// "state"
1161 /// ],
1162 /// "properties": {
1163 /// "code": {
1164 /// "description": "Authorization code from Bitbucket.",
1165 /// "type": "string"
1166 /// },
1167 /// "state": {
1168 /// "description": "The signed CSRF state nonce echoed back by
1169 /// Bitbucket on the callback. Issued by the `oauth-url` endpoint and bound
1170 /// to the authenticated user.",
1171 /// "type": "string"
1172 /// }
1173 /// }
1174 ///}
1175 /// ```
1176 /// </details>
1177 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
1178 pub struct ConnectBitbucketRequest {
1179 ///Authorization code from Bitbucket.
1180 pub code: ::std::string::String,
1181 ///The signed CSRF state nonce echoed back by Bitbucket on the
1182 /// callback. Issued by the `oauth-url` endpoint and bound to the
1183 /// authenticated user.
1184 pub state: ::std::string::String,
1185 }
1186
1187 ///The workspaces connected by the OAuth callback, plus the org slug.
1188 ///
1189 /// <details><summary>JSON schema</summary>
1190 ///
1191 /// ```json
1192 ///{
1193 /// "title": "ConnectBitbucketResponse",
1194 /// "description": "The workspaces connected by the OAuth callback, plus
1195 /// the org slug.",
1196 /// "examples": [
1197 /// {
1198 /// "org": "acme",
1199 /// "workspaces": [
1200 /// {
1201 /// "name": "Acme Inc",
1202 /// "slug": "acme"
1203 /// }
1204 /// ]
1205 /// }
1206 /// ],
1207 /// "type": "object",
1208 /// "required": [
1209 /// "org",
1210 /// "workspaces"
1211 /// ],
1212 /// "properties": {
1213 /// "org": {
1214 /// "description": "The org slug the workspaces were connected to,
1215 /// recovered from the signed OAuth state. The SPA navigates to this org's
1216 /// repos view.",
1217 /// "type": "string"
1218 /// },
1219 /// "workspaces": {
1220 /// "description": "The connected workspaces.",
1221 /// "type": "array",
1222 /// "items": {
1223 /// "$ref": "#/components/schemas/BitbucketWorkspace"
1224 /// }
1225 /// }
1226 /// }
1227 ///}
1228 /// ```
1229 /// </details>
1230 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
1231 pub struct ConnectBitbucketResponse {
1232 ///The org slug the workspaces were connected to, recovered from the
1233 /// signed OAuth state. The SPA navigates to this org's repos view.
1234 pub org: ::std::string::String,
1235 ///The connected workspaces.
1236 pub workspaces: ::std::vec::Vec<BitbucketWorkspace>,
1237 }
1238
1239 ///Binds an existing GitHub App installation (identified by its GitHub
1240 /// numeric installation id) to this organization.
1241 ///
1242 /// <details><summary>JSON schema</summary>
1243 ///
1244 /// ```json
1245 ///{
1246 /// "title": "ConnectInstallationRequest",
1247 /// "description": "Binds an existing GitHub App installation (identified
1248 /// by its GitHub numeric installation id) to this organization.",
1249 /// "type": "object",
1250 /// "required": [
1251 /// "installation_id"
1252 /// ],
1253 /// "properties": {
1254 /// "installation_id": {
1255 /// "description": "GitHub's numeric installation id to bind.",
1256 /// "type": "integer"
1257 /// }
1258 /// }
1259 ///}
1260 /// ```
1261 /// </details>
1262 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
1263 pub struct ConnectInstallationRequest {
1264 ///GitHub's numeric installation id to bind.
1265 pub installation_id: i64,
1266 }
1267
1268 ///Creates a build for a pipeline. Two paths: supply pre-rendered v0 IR
1269 /// JSON in `pipeline_ir` (the `hm run` / API path), or omit `pipeline_ir`
1270 /// to have the engine render the registered pipeline's IR in a sandbox VM
1271 /// (decision #5 — rendering never happens on the API host). The IR is then
1272 /// parsed and planned in-process; on a plan/render rejection the build row
1273 /// is created with its error fields set and the request returns 422.
1274 ///
1275 /// <details><summary>JSON schema</summary>
1276 ///
1277 /// ```json
1278 ///{
1279 /// "title": "CreateBuildRequest",
1280 /// "description": "Creates a build for a pipeline. Two paths: supply
1281 /// pre-rendered v0 IR JSON in `pipeline_ir` (the `hm run` / API path), or
1282 /// omit `pipeline_ir` to have the engine render the registered pipeline's
1283 /// IR in a sandbox VM (decision #5 — rendering never happens on the API
1284 /// host). The IR is then parsed and planned in-process; on a plan/render
1285 /// rejection the build row is created with its error fields set and the
1286 /// request returns 422.",
1287 /// "type": "object",
1288 /// "required": [
1289 /// "branch",
1290 /// "commit"
1291 /// ],
1292 /// "properties": {
1293 /// "branch": {
1294 /// "description": "Source branch.",
1295 /// "type": "string"
1296 /// },
1297 /// "commit": {
1298 /// "description": "Source commit SHA.",
1299 /// "type": "string"
1300 /// },
1301 /// "env": {
1302 /// "description": "Build-level environment variables.",
1303 /// "type": [
1304 /// "object",
1305 /// "null"
1306 /// ],
1307 /// "additionalProperties": {
1308 /// "type": "string"
1309 /// }
1310 /// },
1311 /// "message": {
1312 /// "description": "Optional build/commit message.",
1313 /// "type": [
1314 /// "string",
1315 /// "null"
1316 /// ]
1317 /// },
1318 /// "pipeline_ir": {
1319 /// "description": "The pre-rendered v0 IR JSON the engine materialises
1320 /// into jobs. When absent/blank the engine renders the pipeline's IR in a
1321 /// sandbox VM instead.",
1322 /// "type": [
1323 /// "string",
1324 /// "null"
1325 /// ]
1326 /// },
1327 /// "source": {
1328 /// "description": "How the build was triggered (e.g. `api`, `ui`).
1329 /// Defaults to `api`.",
1330 /// "type": [
1331 /// "string",
1332 /// "null"
1333 /// ]
1334 /// },
1335 /// "source_b64": {
1336 /// "description": "Base64-encoded source tarball (expected to be
1337 /// gzipped; the API validates only that it is valid base64, not the archive
1338 /// format) — the `hm run` local-code upload path. When present, the API
1339 /// stores it at the build's key and derives the internal,
1340 /// runner-token-authenticated `source_url`; it takes precedence over any
1341 /// caller-supplied `source_url`.",
1342 /// "type": [
1343 /// "string",
1344 /// "null"
1345 /// ]
1346 /// },
1347 /// "source_sha256": {
1348 /// "description": "SHA-256 of the source archive, verified by the
1349 /// sandbox before rendering (in-sandbox-render path). Defaults to empty
1350 /// when omitted.",
1351 /// "type": [
1352 /// "string",
1353 /// "null"
1354 /// ]
1355 /// },
1356 /// "source_url": {
1357 /// "description": "URL to the build's source archive, fetched by the
1358 /// sandbox. Ignored when `source_b64` is supplied (the API derives this
1359 /// internally).",
1360 /// "type": [
1361 /// "string",
1362 /// "null"
1363 /// ]
1364 /// }
1365 /// }
1366 ///}
1367 /// ```
1368 /// </details>
1369 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
1370 pub struct CreateBuildRequest {
1371 ///Source branch.
1372 pub branch: ::std::string::String,
1373 ///Source commit SHA.
1374 pub commit: ::std::string::String,
1375 ///Build-level environment variables.
1376 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1377 pub env: ::std::option::Option<
1378 ::std::collections::HashMap<::std::string::String, ::std::string::String>,
1379 >,
1380 ///Optional build/commit message.
1381 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1382 pub message: ::std::option::Option<::std::string::String>,
1383 ///The pre-rendered v0 IR JSON the engine materialises into jobs. When
1384 /// absent/blank the engine renders the pipeline's IR in a sandbox VM
1385 /// instead.
1386 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1387 pub pipeline_ir: ::std::option::Option<::std::string::String>,
1388 ///How the build was triggered (e.g. `api`, `ui`). Defaults to `api`.
1389 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1390 pub source: ::std::option::Option<::std::string::String>,
1391 ///Base64-encoded source tarball (expected to be gzipped; the API
1392 /// validates only that it is valid base64, not the archive format) —
1393 /// the `hm run` local-code upload path. When present, the API stores it
1394 /// at the build's key and derives the internal,
1395 /// runner-token-authenticated `source_url`; it takes precedence over
1396 /// any caller-supplied `source_url`.
1397 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1398 pub source_b64: ::std::option::Option<::std::string::String>,
1399 ///SHA-256 of the source archive, verified by the sandbox before
1400 /// rendering (in-sandbox-render path). Defaults to empty when omitted.
1401 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1402 pub source_sha256: ::std::option::Option<::std::string::String>,
1403 ///URL to the build's source archive, fetched by the sandbox. Ignored
1404 /// when `source_b64` is supplied (the API derives this internally).
1405 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1406 pub source_url: ::std::option::Option<::std::string::String>,
1407 }
1408
1409 ///`CreateInviteRequest`
1410 ///
1411 /// <details><summary>JSON schema</summary>
1412 ///
1413 /// ```json
1414 ///{
1415 /// "title": "CreateInviteRequest",
1416 /// "type": "object",
1417 /// "required": [
1418 /// "email",
1419 /// "role"
1420 /// ],
1421 /// "properties": {
1422 /// "email": {
1423 /// "type": "string"
1424 /// },
1425 /// "role": {
1426 /// "type": "string",
1427 /// "enum": [
1428 /// "admin",
1429 /// "member"
1430 /// ]
1431 /// }
1432 /// }
1433 ///}
1434 /// ```
1435 /// </details>
1436 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
1437 pub struct CreateInviteRequest {
1438 pub email: ::std::string::String,
1439 pub role: CreateInviteRequestRole,
1440 }
1441
1442 ///`CreateInviteRequestRole`
1443 ///
1444 /// <details><summary>JSON schema</summary>
1445 ///
1446 /// ```json
1447 ///{
1448 /// "type": "string",
1449 /// "enum": [
1450 /// "admin",
1451 /// "member"
1452 /// ]
1453 ///}
1454 /// ```
1455 /// </details>
1456 #[derive(
1457 :: serde :: Deserialize,
1458 :: serde :: Serialize,
1459 Clone,
1460 Copy,
1461 Debug,
1462 Eq,
1463 Hash,
1464 Ord,
1465 PartialEq,
1466 PartialOrd,
1467 )]
1468 pub enum CreateInviteRequestRole {
1469 #[serde(rename = "admin")]
1470 Admin,
1471 #[serde(rename = "member")]
1472 Member,
1473 }
1474
1475 impl ::std::fmt::Display for CreateInviteRequestRole {
1476 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
1477 match *self {
1478 Self::Admin => f.write_str("admin"),
1479 Self::Member => f.write_str("member"),
1480 }
1481 }
1482 }
1483
1484 impl ::std::str::FromStr for CreateInviteRequestRole {
1485 type Err = self::error::ConversionError;
1486 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1487 match value {
1488 "admin" => Ok(Self::Admin),
1489 "member" => Ok(Self::Member),
1490 _ => Err("invalid value".into()),
1491 }
1492 }
1493 }
1494
1495 impl ::std::convert::TryFrom<&str> for CreateInviteRequestRole {
1496 type Error = self::error::ConversionError;
1497 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1498 value.parse()
1499 }
1500 }
1501
1502 impl ::std::convert::TryFrom<&::std::string::String> for CreateInviteRequestRole {
1503 type Error = self::error::ConversionError;
1504 fn try_from(
1505 value: &::std::string::String,
1506 ) -> ::std::result::Result<Self, self::error::ConversionError> {
1507 value.parse()
1508 }
1509 }
1510
1511 impl ::std::convert::TryFrom<::std::string::String> for CreateInviteRequestRole {
1512 type Error = self::error::ConversionError;
1513 fn try_from(
1514 value: ::std::string::String,
1515 ) -> ::std::result::Result<Self, self::error::ConversionError> {
1516 value.parse()
1517 }
1518 }
1519
1520 ///Create a new organization owned by the authenticated user.
1521 ///
1522 /// <details><summary>JSON schema</summary>
1523 ///
1524 /// ```json
1525 ///{
1526 /// "title": "CreateOrganizationRequest",
1527 /// "description": "Create a new organization owned by the authenticated
1528 /// user.",
1529 /// "type": "object",
1530 /// "required": [
1531 /// "name"
1532 /// ],
1533 /// "properties": {
1534 /// "name": {
1535 /// "description": "Display name. The slug is derived from this.",
1536 /// "type": "string",
1537 /// "minLength": 1
1538 /// },
1539 /// "url": {
1540 /// "description": "Optional website URL.",
1541 /// "type": [
1542 /// "string",
1543 /// "null"
1544 /// ]
1545 /// }
1546 /// }
1547 ///}
1548 /// ```
1549 /// </details>
1550 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
1551 pub struct CreateOrganizationRequest {
1552 ///Display name. The slug is derived from this.
1553 pub name: CreateOrganizationRequestName,
1554 ///Optional website URL.
1555 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1556 pub url: ::std::option::Option<::std::string::String>,
1557 }
1558
1559 ///Display name. The slug is derived from this.
1560 ///
1561 /// <details><summary>JSON schema</summary>
1562 ///
1563 /// ```json
1564 ///{
1565 /// "description": "Display name. The slug is derived from this.",
1566 /// "type": "string",
1567 /// "minLength": 1
1568 ///}
1569 /// ```
1570 /// </details>
1571 #[derive(:: serde :: Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
1572 #[serde(transparent)]
1573 pub struct CreateOrganizationRequestName(::std::string::String);
1574 impl ::std::ops::Deref for CreateOrganizationRequestName {
1575 type Target = ::std::string::String;
1576 fn deref(&self) -> &::std::string::String {
1577 &self.0
1578 }
1579 }
1580
1581 impl ::std::convert::From<CreateOrganizationRequestName> for ::std::string::String {
1582 fn from(value: CreateOrganizationRequestName) -> Self {
1583 value.0
1584 }
1585 }
1586
1587 impl ::std::str::FromStr for CreateOrganizationRequestName {
1588 type Err = self::error::ConversionError;
1589 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1590 if value.chars().count() < 1usize {
1591 return Err("shorter than 1 characters".into());
1592 }
1593 Ok(Self(value.to_string()))
1594 }
1595 }
1596
1597 impl ::std::convert::TryFrom<&str> for CreateOrganizationRequestName {
1598 type Error = self::error::ConversionError;
1599 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
1600 value.parse()
1601 }
1602 }
1603
1604 impl ::std::convert::TryFrom<&::std::string::String> for CreateOrganizationRequestName {
1605 type Error = self::error::ConversionError;
1606 fn try_from(
1607 value: &::std::string::String,
1608 ) -> ::std::result::Result<Self, self::error::ConversionError> {
1609 value.parse()
1610 }
1611 }
1612
1613 impl ::std::convert::TryFrom<::std::string::String> for CreateOrganizationRequestName {
1614 type Error = self::error::ConversionError;
1615 fn try_from(
1616 value: ::std::string::String,
1617 ) -> ::std::result::Result<Self, self::error::ConversionError> {
1618 value.parse()
1619 }
1620 }
1621
1622 impl<'de> ::serde::Deserialize<'de> for CreateOrganizationRequestName {
1623 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
1624 where
1625 D: ::serde::Deserializer<'de>,
1626 {
1627 ::std::string::String::deserialize(deserializer)?
1628 .parse()
1629 .map_err(|e: self::error::ConversionError| {
1630 <D::Error as ::serde::de::Error>::custom(e.to_string())
1631 })
1632 }
1633 }
1634
1635 ///Creates a pipeline within an organization. The slug is derived from the
1636 /// name; a slug collision within the organization is rejected.
1637 ///
1638 /// <details><summary>JSON schema</summary>
1639 ///
1640 /// ```json
1641 ///{
1642 /// "title": "CreatePipelineRequest",
1643 /// "description": "Creates a pipeline within an organization. The slug is
1644 /// derived from the name; a slug collision within the organization is
1645 /// rejected.",
1646 /// "type": "object",
1647 /// "required": [
1648 /// "default_branch",
1649 /// "name",
1650 /// "repository"
1651 /// ],
1652 /// "properties": {
1653 /// "default_branch": {
1654 /// "description": "The branch built by default.",
1655 /// "type": "string"
1656 /// },
1657 /// "description": {
1658 /// "description": "Optional human description.",
1659 /// "type": [
1660 /// "string",
1661 /// "null"
1662 /// ]
1663 /// },
1664 /// "name": {
1665 /// "description": "Display name.",
1666 /// "type": "string"
1667 /// },
1668 /// "repo_name": {
1669 /// "description": "Optional `owner/repo` label. When omitted it is
1670 /// derived from `repository`.",
1671 /// "type": [
1672 /// "string",
1673 /// "null"
1674 /// ]
1675 /// },
1676 /// "repository": {
1677 /// "description": "The source repository this pipeline builds.",
1678 /// "type": "string"
1679 /// }
1680 /// }
1681 ///}
1682 /// ```
1683 /// </details>
1684 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
1685 pub struct CreatePipelineRequest {
1686 ///The branch built by default.
1687 pub default_branch: ::std::string::String,
1688 ///Optional human description.
1689 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1690 pub description: ::std::option::Option<::std::string::String>,
1691 ///Display name.
1692 pub name: ::std::string::String,
1693 ///Optional `owner/repo` label. When omitted it is derived from
1694 /// `repository`.
1695 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1696 pub repo_name: ::std::option::Option<::std::string::String>,
1697 ///The source repository this pipeline builds.
1698 pub repository: ::std::string::String,
1699 }
1700
1701 ///Creates a build by addressing the pipeline through its repo-natural
1702 /// identity — `repo_name` (`owner/repo`) plus `source_slug` (the in-repo
1703 /// `@hm.pipeline("…")` name) — rather than the org-global slug. This is the
1704 /// `hm run` path: a repo-local client knows its git remote and its pipeline
1705 /// name but not the namespaced slug. Build semantics are otherwise
1706 /// identical to `createBuild`.
1707 ///
1708 /// <details><summary>JSON schema</summary>
1709 ///
1710 /// ```json
1711 ///{
1712 /// "title": "CreateRepoBuildRequest",
1713 /// "description": "Creates a build by addressing the pipeline through its
1714 /// repo-natural identity — `repo_name` (`owner/repo`) plus `source_slug`
1715 /// (the in-repo `@hm.pipeline(\"…\")` name) — rather than the org-global
1716 /// slug. This is the `hm run` path: a repo-local client knows its git
1717 /// remote and its pipeline name but not the namespaced slug. Build
1718 /// semantics are otherwise identical to `createBuild`.",
1719 /// "type": "object",
1720 /// "required": [
1721 /// "branch",
1722 /// "commit",
1723 /// "repo_name",
1724 /// "source_slug"
1725 /// ],
1726 /// "properties": {
1727 /// "branch": {
1728 /// "description": "Source branch.",
1729 /// "type": "string"
1730 /// },
1731 /// "commit": {
1732 /// "description": "Source commit SHA.",
1733 /// "type": "string"
1734 /// },
1735 /// "env": {
1736 /// "description": "Build-level environment variables.",
1737 /// "type": [
1738 /// "object",
1739 /// "null"
1740 /// ],
1741 /// "additionalProperties": {
1742 /// "type": "string"
1743 /// }
1744 /// },
1745 /// "message": {
1746 /// "description": "Optional build/commit message.",
1747 /// "type": [
1748 /// "string",
1749 /// "null"
1750 /// ]
1751 /// },
1752 /// "pipeline_ir": {
1753 /// "description": "The pre-rendered v0 IR JSON the engine materialises
1754 /// into jobs. When absent/blank the engine renders the pipeline's IR in a
1755 /// sandbox VM instead.",
1756 /// "type": [
1757 /// "string",
1758 /// "null"
1759 /// ]
1760 /// },
1761 /// "repo_name": {
1762 /// "description": "The worktree's repository as `owner/repo` (from its
1763 /// git remote).",
1764 /// "type": "string"
1765 /// },
1766 /// "source": {
1767 /// "description": "How the build was triggered (e.g. `api`, `ui`).
1768 /// Defaults to `api`.",
1769 /// "type": [
1770 /// "string",
1771 /// "null"
1772 /// ]
1773 /// },
1774 /// "source_b64": {
1775 /// "description": "Base64-encoded source tarball (the `hm run`
1776 /// local-code upload). When present, the API stores it at the build's key
1777 /// and derives the internal, runner-token-authenticated `source_url`.",
1778 /// "type": [
1779 /// "string",
1780 /// "null"
1781 /// ]
1782 /// },
1783 /// "source_slug": {
1784 /// "description": "The in-repo pipeline name — the
1785 /// `@hm.pipeline(\"…\")` slug.",
1786 /// "type": "string"
1787 /// }
1788 /// }
1789 ///}
1790 /// ```
1791 /// </details>
1792 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
1793 pub struct CreateRepoBuildRequest {
1794 ///Source branch.
1795 pub branch: ::std::string::String,
1796 ///Source commit SHA.
1797 pub commit: ::std::string::String,
1798 ///Build-level environment variables.
1799 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1800 pub env: ::std::option::Option<
1801 ::std::collections::HashMap<::std::string::String, ::std::string::String>,
1802 >,
1803 ///Optional build/commit message.
1804 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1805 pub message: ::std::option::Option<::std::string::String>,
1806 ///The pre-rendered v0 IR JSON the engine materialises into jobs. When
1807 /// absent/blank the engine renders the pipeline's IR in a sandbox VM
1808 /// instead.
1809 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1810 pub pipeline_ir: ::std::option::Option<::std::string::String>,
1811 ///The worktree's repository as `owner/repo` (from its git remote).
1812 pub repo_name: ::std::string::String,
1813 ///How the build was triggered (e.g. `api`, `ui`). Defaults to `api`.
1814 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1815 pub source: ::std::option::Option<::std::string::String>,
1816 ///Base64-encoded source tarball (the `hm run` local-code upload). When
1817 /// present, the API stores it at the build's key and derives the
1818 /// internal, runner-token-authenticated `source_url`.
1819 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1820 pub source_b64: ::std::option::Option<::std::string::String>,
1821 ///The in-repo pipeline name — the `@hm.pipeline("…")` slug.
1822 pub source_slug: ::std::string::String,
1823 }
1824
1825 ///The authenticated Harmont user and their personal-org slug.
1826 ///
1827 /// <details><summary>JSON schema</summary>
1828 ///
1829 /// ```json
1830 ///{
1831 /// "title": "CurrentUserResponse",
1832 /// "description": "The authenticated Harmont user and their personal-org
1833 /// slug.",
1834 /// "type": "object",
1835 /// "required": [
1836 /// "email",
1837 /// "uuid"
1838 /// ],
1839 /// "properties": {
1840 /// "email": {
1841 /// "description": "The user's email address.",
1842 /// "type": "string"
1843 /// },
1844 /// "name": {
1845 /// "description": "Display name.",
1846 /// "type": [
1847 /// "string",
1848 /// "null"
1849 /// ]
1850 /// },
1851 /// "personal_org_slug": {
1852 /// "description": "Slug of the user's personal organization.",
1853 /// "type": [
1854 /// "string",
1855 /// "null"
1856 /// ]
1857 /// },
1858 /// "uuid": {
1859 /// "description": "Stable user id.",
1860 /// "type": "string",
1861 /// "format": "uuid"
1862 /// }
1863 /// }
1864 ///}
1865 /// ```
1866 /// </details>
1867 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
1868 pub struct CurrentUserResponse {
1869 ///The user's email address.
1870 pub email: ::std::string::String,
1871 ///Display name.
1872 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1873 pub name: ::std::option::Option<::std::string::String>,
1874 ///Slug of the user's personal organization.
1875 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1876 pub personal_org_slug: ::std::option::Option<::std::string::String>,
1877 ///Stable user id.
1878 pub uuid: ::uuid::Uuid,
1879 }
1880
1881 ///The Harmont error envelope.
1882 ///
1883 /// <details><summary>JSON schema</summary>
1884 ///
1885 /// ```json
1886 ///{
1887 /// "title": "Error",
1888 /// "description": "The Harmont error envelope.",
1889 /// "type": "object",
1890 /// "required": [
1891 /// "error"
1892 /// ],
1893 /// "properties": {
1894 /// "error": {
1895 /// "type": "object",
1896 /// "required": [
1897 /// "code",
1898 /// "message",
1899 /// "type"
1900 /// ],
1901 /// "properties": {
1902 /// "code": {
1903 /// "description": "Catalog code.",
1904 /// "type": "string"
1905 /// },
1906 /// "doc_url": {
1907 /// "description": "Docs link for this error.",
1908 /// "type": "string"
1909 /// },
1910 /// "message": {
1911 /// "description": "Human-readable message.",
1912 /// "type": "string"
1913 /// },
1914 /// "request_id": {
1915 /// "description": "Correlates with server logs/traces.",
1916 /// "type": "string"
1917 /// },
1918 /// "type": {
1919 /// "description": "Stable machine error type.",
1920 /// "type": "string"
1921 /// }
1922 /// }
1923 /// }
1924 /// }
1925 ///}
1926 /// ```
1927 /// </details>
1928 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
1929 pub struct Error {
1930 pub error: ErrorError,
1931 }
1932
1933 ///`ErrorError`
1934 ///
1935 /// <details><summary>JSON schema</summary>
1936 ///
1937 /// ```json
1938 ///{
1939 /// "type": "object",
1940 /// "required": [
1941 /// "code",
1942 /// "message",
1943 /// "type"
1944 /// ],
1945 /// "properties": {
1946 /// "code": {
1947 /// "description": "Catalog code.",
1948 /// "type": "string"
1949 /// },
1950 /// "doc_url": {
1951 /// "description": "Docs link for this error.",
1952 /// "type": "string"
1953 /// },
1954 /// "message": {
1955 /// "description": "Human-readable message.",
1956 /// "type": "string"
1957 /// },
1958 /// "request_id": {
1959 /// "description": "Correlates with server logs/traces.",
1960 /// "type": "string"
1961 /// },
1962 /// "type": {
1963 /// "description": "Stable machine error type.",
1964 /// "type": "string"
1965 /// }
1966 /// }
1967 ///}
1968 /// ```
1969 /// </details>
1970 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
1971 pub struct ErrorError {
1972 ///Catalog code.
1973 pub code: ::std::string::String,
1974 ///Docs link for this error.
1975 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1976 pub doc_url: ::std::option::Option<::std::string::String>,
1977 ///Human-readable message.
1978 pub message: ::std::string::String,
1979 ///Correlates with server logs/traces.
1980 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
1981 pub request_id: ::std::option::Option<::std::string::String>,
1982 ///Stable machine error type.
1983 #[serde(rename = "type")]
1984 pub type_: ::std::string::String,
1985 }
1986
1987 ///A GitHub App installation the organization has connected. The numeric
1988 /// `installation_id` is GitHub's installation id (used to address
1989 /// sync/unbind), while `id` is Harmont's internal row id.
1990 ///
1991 /// <details><summary>JSON schema</summary>
1992 ///
1993 /// ```json
1994 ///{
1995 /// "title": "GithubInstallation",
1996 /// "description": "A GitHub App installation the organization has
1997 /// connected. The numeric `installation_id` is GitHub's installation id
1998 /// (used to address sync/unbind), while `id` is Harmont's internal row
1999 /// id.",
2000 /// "type": "object",
2001 /// "required": [
2002 /// "account_login",
2003 /// "account_type",
2004 /// "created_at",
2005 /// "id",
2006 /// "installation_id",
2007 /// "updated_at"
2008 /// ],
2009 /// "properties": {
2010 /// "account_login": {
2011 /// "description": "The GitHub account (org or user) the App is
2012 /// installed on.",
2013 /// "type": "string"
2014 /// },
2015 /// "account_type": {
2016 /// "description": "`Organization` or `User`.",
2017 /// "type": "string"
2018 /// },
2019 /// "created_at": {
2020 /// "description": "When the installation row was first mirrored.",
2021 /// "type": "string",
2022 /// "format": "date-time"
2023 /// },
2024 /// "id": {
2025 /// "description": "Harmont's internal installation row id.",
2026 /// "type": "integer"
2027 /// },
2028 /// "installation_id": {
2029 /// "description": "GitHub's numeric installation id.",
2030 /// "type": "integer"
2031 /// },
2032 /// "updated_at": {
2033 /// "description": "When the installation row was last updated.",
2034 /// "type": "string",
2035 /// "format": "date-time"
2036 /// }
2037 /// }
2038 ///}
2039 /// ```
2040 /// </details>
2041 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
2042 pub struct GithubInstallation {
2043 ///The GitHub account (org or user) the App is installed on.
2044 pub account_login: ::std::string::String,
2045 ///`Organization` or `User`.
2046 pub account_type: ::std::string::String,
2047 ///When the installation row was first mirrored.
2048 pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
2049 ///Harmont's internal installation row id.
2050 pub id: i64,
2051 ///GitHub's numeric installation id.
2052 pub installation_id: i64,
2053 ///When the installation row was last updated.
2054 pub updated_at: ::chrono::DateTime<::chrono::offset::Utc>,
2055 }
2056
2057 ///The organization's connected GitHub App installations.
2058 ///
2059 /// <details><summary>JSON schema</summary>
2060 ///
2061 /// ```json
2062 ///{
2063 /// "title": "GithubInstallationList",
2064 /// "description": "The organization's connected GitHub App
2065 /// installations.",
2066 /// "type": "object",
2067 /// "required": [
2068 /// "data"
2069 /// ],
2070 /// "properties": {
2071 /// "data": {
2072 /// "description": "The connected installations.",
2073 /// "type": "array",
2074 /// "items": {
2075 /// "$ref": "#/components/schemas/GithubInstallation"
2076 /// }
2077 /// }
2078 /// }
2079 ///}
2080 /// ```
2081 /// </details>
2082 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
2083 pub struct GithubInstallationList {
2084 ///The connected installations.
2085 pub data: ::std::vec::Vec<GithubInstallation>,
2086 }
2087
2088 ///A repository Harmont mirrors from a connected GitHub installation.
2089 /// `installation_id` is Harmont's internal installation row id (FK), not
2090 /// GitHub's installation id.
2091 ///
2092 /// <details><summary>JSON schema</summary>
2093 ///
2094 /// ```json
2095 ///{
2096 /// "title": "GithubRepo",
2097 /// "description": "A repository Harmont mirrors from a connected GitHub
2098 /// installation. `installation_id` is Harmont's internal installation row
2099 /// id (FK), not GitHub's installation id.",
2100 /// "type": "object",
2101 /// "required": [
2102 /// "clone_url",
2103 /// "default_branch",
2104 /// "full_name",
2105 /// "gh_repo_id",
2106 /// "id",
2107 /// "installation_id",
2108 /// "name",
2109 /// "owner",
2110 /// "private"
2111 /// ],
2112 /// "properties": {
2113 /// "clone_url": {
2114 /// "description": "HTTPS clone URL.",
2115 /// "type": "string"
2116 /// },
2117 /// "default_branch": {
2118 /// "description": "Default branch name.",
2119 /// "type": "string"
2120 /// },
2121 /// "full_name": {
2122 /// "description": "`owner/name` GitHub full name.",
2123 /// "type": "string"
2124 /// },
2125 /// "gh_repo_id": {
2126 /// "description": "GitHub's numeric repo id.",
2127 /// "type": "integer"
2128 /// },
2129 /// "id": {
2130 /// "description": "Harmont's internal repo row id.",
2131 /// "type": "integer"
2132 /// },
2133 /// "installation_id": {
2134 /// "description": "FK onto the internal installation row id.",
2135 /// "type": "integer"
2136 /// },
2137 /// "last_synced_at": {
2138 /// "description": "When the repo was last synced from GitHub.",
2139 /// "type": [
2140 /// "string",
2141 /// "null"
2142 /// ],
2143 /// "format": "date-time"
2144 /// },
2145 /// "name": {
2146 /// "description": "Short repo name.",
2147 /// "type": "string"
2148 /// },
2149 /// "owner": {
2150 /// "description": "GitHub owner login.",
2151 /// "type": "string"
2152 /// },
2153 /// "private": {
2154 /// "description": "Whether the repo is private.",
2155 /// "type": "boolean"
2156 /// }
2157 /// }
2158 ///}
2159 /// ```
2160 /// </details>
2161 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
2162 pub struct GithubRepo {
2163 ///HTTPS clone URL.
2164 pub clone_url: ::std::string::String,
2165 ///Default branch name.
2166 pub default_branch: ::std::string::String,
2167 ///`owner/name` GitHub full name.
2168 pub full_name: ::std::string::String,
2169 ///GitHub's numeric repo id.
2170 pub gh_repo_id: i64,
2171 ///Harmont's internal repo row id.
2172 pub id: i64,
2173 ///FK onto the internal installation row id.
2174 pub installation_id: i64,
2175 ///When the repo was last synced from GitHub.
2176 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2177 pub last_synced_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
2178 ///Short repo name.
2179 pub name: ::std::string::String,
2180 ///GitHub owner login.
2181 pub owner: ::std::string::String,
2182 ///Whether the repo is private.
2183 pub private: bool,
2184 }
2185
2186 ///Mirrored repositories for an installation or across an organization.
2187 ///
2188 /// <details><summary>JSON schema</summary>
2189 ///
2190 /// ```json
2191 ///{
2192 /// "title": "GithubRepoList",
2193 /// "description": "Mirrored repositories for an installation or across an
2194 /// organization.",
2195 /// "type": "object",
2196 /// "required": [
2197 /// "data"
2198 /// ],
2199 /// "properties": {
2200 /// "data": {
2201 /// "description": "The mirrored repositories.",
2202 /// "type": "array",
2203 /// "items": {
2204 /// "$ref": "#/components/schemas/GithubRepo"
2205 /// }
2206 /// }
2207 /// }
2208 ///}
2209 /// ```
2210 /// </details>
2211 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
2212 pub struct GithubRepoList {
2213 ///The mirrored repositories.
2214 pub data: ::std::vec::Vec<GithubRepo>,
2215 }
2216
2217 ///`Invite`
2218 ///
2219 /// <details><summary>JSON schema</summary>
2220 ///
2221 /// ```json
2222 ///{
2223 /// "title": "Invite",
2224 /// "type": "object",
2225 /// "required": [
2226 /// "email",
2227 /// "expires_at",
2228 /// "id",
2229 /// "role"
2230 /// ],
2231 /// "properties": {
2232 /// "email": {
2233 /// "type": "string"
2234 /// },
2235 /// "expires_at": {
2236 /// "type": "string",
2237 /// "format": "date-time"
2238 /// },
2239 /// "id": {
2240 /// "type": "string",
2241 /// "format": "uuid"
2242 /// },
2243 /// "role": {
2244 /// "type": "string",
2245 /// "enum": [
2246 /// "admin",
2247 /// "member"
2248 /// ]
2249 /// },
2250 /// "token": {
2251 /// "type": [
2252 /// "string",
2253 /// "null"
2254 /// ]
2255 /// }
2256 /// }
2257 ///}
2258 /// ```
2259 /// </details>
2260 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
2261 pub struct Invite {
2262 pub email: ::std::string::String,
2263 pub expires_at: ::chrono::DateTime<::chrono::offset::Utc>,
2264 pub id: ::uuid::Uuid,
2265 pub role: InviteRole,
2266 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2267 pub token: ::std::option::Option<::std::string::String>,
2268 }
2269
2270 ///`InviteList`
2271 ///
2272 /// <details><summary>JSON schema</summary>
2273 ///
2274 /// ```json
2275 ///{
2276 /// "title": "InviteList",
2277 /// "type": "object",
2278 /// "required": [
2279 /// "data"
2280 /// ],
2281 /// "properties": {
2282 /// "data": {
2283 /// "type": "array",
2284 /// "items": {
2285 /// "$ref": "#/components/schemas/Invite"
2286 /// }
2287 /// }
2288 /// }
2289 ///}
2290 /// ```
2291 /// </details>
2292 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
2293 pub struct InviteList {
2294 pub data: ::std::vec::Vec<Invite>,
2295 }
2296
2297 ///`InviteRole`
2298 ///
2299 /// <details><summary>JSON schema</summary>
2300 ///
2301 /// ```json
2302 ///{
2303 /// "type": "string",
2304 /// "enum": [
2305 /// "admin",
2306 /// "member"
2307 /// ]
2308 ///}
2309 /// ```
2310 /// </details>
2311 #[derive(
2312 :: serde :: Deserialize,
2313 :: serde :: Serialize,
2314 Clone,
2315 Copy,
2316 Debug,
2317 Eq,
2318 Hash,
2319 Ord,
2320 PartialEq,
2321 PartialOrd,
2322 )]
2323 pub enum InviteRole {
2324 #[serde(rename = "admin")]
2325 Admin,
2326 #[serde(rename = "member")]
2327 Member,
2328 }
2329
2330 impl ::std::fmt::Display for InviteRole {
2331 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
2332 match *self {
2333 Self::Admin => f.write_str("admin"),
2334 Self::Member => f.write_str("member"),
2335 }
2336 }
2337 }
2338
2339 impl ::std::str::FromStr for InviteRole {
2340 type Err = self::error::ConversionError;
2341 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2342 match value {
2343 "admin" => Ok(Self::Admin),
2344 "member" => Ok(Self::Member),
2345 _ => Err("invalid value".into()),
2346 }
2347 }
2348 }
2349
2350 impl ::std::convert::TryFrom<&str> for InviteRole {
2351 type Error = self::error::ConversionError;
2352 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2353 value.parse()
2354 }
2355 }
2356
2357 impl ::std::convert::TryFrom<&::std::string::String> for InviteRole {
2358 type Error = self::error::ConversionError;
2359 fn try_from(
2360 value: &::std::string::String,
2361 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2362 value.parse()
2363 }
2364 }
2365
2366 impl ::std::convert::TryFrom<::std::string::String> for InviteRole {
2367 type Error = self::error::ConversionError;
2368 fn try_from(
2369 value: ::std::string::String,
2370 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2371 value.parse()
2372 }
2373 }
2374
2375 ///One job (DAG node) of a build.
2376 ///
2377 /// <details><summary>JSON schema</summary>
2378 ///
2379 /// ```json
2380 ///{
2381 /// "title": "Job",
2382 /// "description": "One job (DAG node) of a build.",
2383 /// "type": "object",
2384 /// "required": [
2385 /// "created_at",
2386 /// "depends_on",
2387 /// "id",
2388 /// "soft_failed",
2389 /// "state"
2390 /// ],
2391 /// "properties": {
2392 /// "command": {
2393 /// "description": "The shell command the job runs.",
2394 /// "type": [
2395 /// "string",
2396 /// "null"
2397 /// ]
2398 /// },
2399 /// "created_at": {
2400 /// "description": "When the job row was created.",
2401 /// "type": "string",
2402 /// "format": "date-time"
2403 /// },
2404 /// "depends_on": {
2405 /// "description": "Ids of this job's prerequisite jobs (its DAG
2406 /// in-edges), spanning both `depends_on` and `builds_in` dependency kinds.
2407 /// Empty when the job has no prerequisites.",
2408 /// "type": "array",
2409 /// "items": {
2410 /// "type": "string",
2411 /// "format": "uuid"
2412 /// }
2413 /// },
2414 /// "error_code": {
2415 /// "description": "Stable job-level error code, if the job failed.",
2416 /// "type": [
2417 /// "string",
2418 /// "null"
2419 /// ]
2420 /// },
2421 /// "error_message": {
2422 /// "description": "Human-readable job-level error message, if any.",
2423 /// "type": [
2424 /// "string",
2425 /// "null"
2426 /// ]
2427 /// },
2428 /// "exit_code": {
2429 /// "description": "The command's exit status, once finished.",
2430 /// "type": [
2431 /// "integer",
2432 /// "null"
2433 /// ]
2434 /// },
2435 /// "finished_at": {
2436 /// "description": "When the job reached a terminal state.",
2437 /// "type": [
2438 /// "string",
2439 /// "null"
2440 /// ],
2441 /// "format": "date-time"
2442 /// },
2443 /// "id": {
2444 /// "description": "The job's id.",
2445 /// "type": "string",
2446 /// "format": "uuid"
2447 /// },
2448 /// "name": {
2449 /// "description": "Human-readable job name.",
2450 /// "type": [
2451 /// "string",
2452 /// "null"
2453 /// ]
2454 /// },
2455 /// "retry_policy": {
2456 /// "description": "The job's retry policy, if any.",
2457 /// "type": [
2458 /// "object",
2459 /// "null"
2460 /// ],
2461 /// "additionalProperties": true
2462 /// },
2463 /// "soft_fail_policy": {
2464 /// "description": "The job's soft-fail policy, if any.",
2465 /// "type": [
2466 /// "object",
2467 /// "null"
2468 /// ],
2469 /// "additionalProperties": true
2470 /// },
2471 /// "soft_failed": {
2472 /// "description": "Whether the job failed but the build was allowed to
2473 /// continue.",
2474 /// "type": "boolean"
2475 /// },
2476 /// "started_at": {
2477 /// "description": "When the job started running.",
2478 /// "type": [
2479 /// "string",
2480 /// "null"
2481 /// ],
2482 /// "format": "date-time"
2483 /// },
2484 /// "state": {
2485 /// "description": "The job's FSM state.",
2486 /// "type": "string",
2487 /// "enum": [
2488 /// "pending",
2489 /// "scheduled",
2490 /// "assigned",
2491 /// "running",
2492 /// "passed",
2493 /// "failed",
2494 /// "skipped",
2495 /// "canceling",
2496 /// "canceled",
2497 /// "timing_out",
2498 /// "timed_out"
2499 /// ]
2500 /// },
2501 /// "step_key": {
2502 /// "description": "The job's stable key within the build's DAG.",
2503 /// "type": [
2504 /// "string",
2505 /// "null"
2506 /// ]
2507 /// }
2508 /// }
2509 ///}
2510 /// ```
2511 /// </details>
2512 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
2513 pub struct Job {
2514 ///The shell command the job runs.
2515 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2516 pub command: ::std::option::Option<::std::string::String>,
2517 ///When the job row was created.
2518 pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
2519 ///Ids of this job's prerequisite jobs (its DAG in-edges), spanning
2520 /// both `depends_on` and `builds_in` dependency kinds. Empty when the
2521 /// job has no prerequisites.
2522 pub depends_on: ::std::vec::Vec<::uuid::Uuid>,
2523 ///Stable job-level error code, if the job failed.
2524 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2525 pub error_code: ::std::option::Option<::std::string::String>,
2526 ///Human-readable job-level error message, if any.
2527 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2528 pub error_message: ::std::option::Option<::std::string::String>,
2529 ///The command's exit status, once finished.
2530 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2531 pub exit_code: ::std::option::Option<i64>,
2532 ///When the job reached a terminal state.
2533 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2534 pub finished_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
2535 ///The job's id.
2536 pub id: ::uuid::Uuid,
2537 ///Human-readable job name.
2538 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2539 pub name: ::std::option::Option<::std::string::String>,
2540 ///The job's retry policy, if any.
2541 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2542 pub retry_policy:
2543 ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
2544 ///The job's soft-fail policy, if any.
2545 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2546 pub soft_fail_policy:
2547 ::std::option::Option<::serde_json::Map<::std::string::String, ::serde_json::Value>>,
2548 ///Whether the job failed but the build was allowed to continue.
2549 pub soft_failed: bool,
2550 ///When the job started running.
2551 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2552 pub started_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
2553 ///The job's FSM state.
2554 pub state: JobState,
2555 ///The job's stable key within the build's DAG.
2556 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2557 pub step_key: ::std::option::Option<::std::string::String>,
2558 }
2559
2560 ///A build's jobs, in DAG creation order.
2561 ///
2562 /// <details><summary>JSON schema</summary>
2563 ///
2564 /// ```json
2565 ///{
2566 /// "title": "JobList",
2567 /// "description": "A build's jobs, in DAG creation order.",
2568 /// "type": "object",
2569 /// "required": [
2570 /// "data"
2571 /// ],
2572 /// "properties": {
2573 /// "data": {
2574 /// "description": "The build's jobs.",
2575 /// "type": "array",
2576 /// "items": {
2577 /// "$ref": "#/components/schemas/Job"
2578 /// }
2579 /// }
2580 /// }
2581 ///}
2582 /// ```
2583 /// </details>
2584 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
2585 pub struct JobList {
2586 ///The build's jobs.
2587 pub data: ::std::vec::Vec<Job>,
2588 }
2589
2590 ///The job's FSM state.
2591 ///
2592 /// <details><summary>JSON schema</summary>
2593 ///
2594 /// ```json
2595 ///{
2596 /// "description": "The job's FSM state.",
2597 /// "type": "string",
2598 /// "enum": [
2599 /// "pending",
2600 /// "scheduled",
2601 /// "assigned",
2602 /// "running",
2603 /// "passed",
2604 /// "failed",
2605 /// "skipped",
2606 /// "canceling",
2607 /// "canceled",
2608 /// "timing_out",
2609 /// "timed_out"
2610 /// ]
2611 ///}
2612 /// ```
2613 /// </details>
2614 #[derive(
2615 :: serde :: Deserialize,
2616 :: serde :: Serialize,
2617 Clone,
2618 Copy,
2619 Debug,
2620 Eq,
2621 Hash,
2622 Ord,
2623 PartialEq,
2624 PartialOrd,
2625 )]
2626 pub enum JobState {
2627 #[serde(rename = "pending")]
2628 Pending,
2629 #[serde(rename = "scheduled")]
2630 Scheduled,
2631 #[serde(rename = "assigned")]
2632 Assigned,
2633 #[serde(rename = "running")]
2634 Running,
2635 #[serde(rename = "passed")]
2636 Passed,
2637 #[serde(rename = "failed")]
2638 Failed,
2639 #[serde(rename = "skipped")]
2640 Skipped,
2641 #[serde(rename = "canceling")]
2642 Canceling,
2643 #[serde(rename = "canceled")]
2644 Canceled,
2645 #[serde(rename = "timing_out")]
2646 TimingOut,
2647 #[serde(rename = "timed_out")]
2648 TimedOut,
2649 }
2650
2651 impl ::std::fmt::Display for JobState {
2652 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
2653 match *self {
2654 Self::Pending => f.write_str("pending"),
2655 Self::Scheduled => f.write_str("scheduled"),
2656 Self::Assigned => f.write_str("assigned"),
2657 Self::Running => f.write_str("running"),
2658 Self::Passed => f.write_str("passed"),
2659 Self::Failed => f.write_str("failed"),
2660 Self::Skipped => f.write_str("skipped"),
2661 Self::Canceling => f.write_str("canceling"),
2662 Self::Canceled => f.write_str("canceled"),
2663 Self::TimingOut => f.write_str("timing_out"),
2664 Self::TimedOut => f.write_str("timed_out"),
2665 }
2666 }
2667 }
2668
2669 impl ::std::str::FromStr for JobState {
2670 type Err = self::error::ConversionError;
2671 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2672 match value {
2673 "pending" => Ok(Self::Pending),
2674 "scheduled" => Ok(Self::Scheduled),
2675 "assigned" => Ok(Self::Assigned),
2676 "running" => Ok(Self::Running),
2677 "passed" => Ok(Self::Passed),
2678 "failed" => Ok(Self::Failed),
2679 "skipped" => Ok(Self::Skipped),
2680 "canceling" => Ok(Self::Canceling),
2681 "canceled" => Ok(Self::Canceled),
2682 "timing_out" => Ok(Self::TimingOut),
2683 "timed_out" => Ok(Self::TimedOut),
2684 _ => Err("invalid value".into()),
2685 }
2686 }
2687 }
2688
2689 impl ::std::convert::TryFrom<&str> for JobState {
2690 type Error = self::error::ConversionError;
2691 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2692 value.parse()
2693 }
2694 }
2695
2696 impl ::std::convert::TryFrom<&::std::string::String> for JobState {
2697 type Error = self::error::ConversionError;
2698 fn try_from(
2699 value: &::std::string::String,
2700 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2701 value.parse()
2702 }
2703 }
2704
2705 impl ::std::convert::TryFrom<::std::string::String> for JobState {
2706 type Error = self::error::ConversionError;
2707 fn try_from(
2708 value: ::std::string::String,
2709 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2710 value.parse()
2711 }
2712 }
2713
2714 ///A build-scoped HMAC token the SSE log stream accepts, plus its expiry.
2715 /// Pass the token as the `token` query parameter when opening the log
2716 /// stream.
2717 ///
2718 /// <details><summary>JSON schema</summary>
2719 ///
2720 /// ```json
2721 ///{
2722 /// "title": "LogTokenResponse",
2723 /// "description": "A build-scoped HMAC token the SSE log stream accepts,
2724 /// plus its expiry. Pass the token as the `token` query parameter when
2725 /// opening the log stream.",
2726 /// "type": "object",
2727 /// "required": [
2728 /// "expires_at",
2729 /// "token"
2730 /// ],
2731 /// "properties": {
2732 /// "expires_at": {
2733 /// "description": "When the token expires (~1 hour out).",
2734 /// "type": "string",
2735 /// "format": "date-time"
2736 /// },
2737 /// "token": {
2738 /// "description": "The opaque, build-scoped log token.",
2739 /// "type": "string"
2740 /// }
2741 /// }
2742 ///}
2743 /// ```
2744 /// </details>
2745 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
2746 pub struct LogTokenResponse {
2747 ///When the token expires (~1 hour out).
2748 pub expires_at: ::chrono::DateTime<::chrono::offset::Utc>,
2749 ///The opaque, build-scoped log token.
2750 pub token: ::std::string::String,
2751 }
2752
2753 ///`OrgMember`
2754 ///
2755 /// <details><summary>JSON schema</summary>
2756 ///
2757 /// ```json
2758 ///{
2759 /// "title": "OrgMember",
2760 /// "type": "object",
2761 /// "required": [
2762 /// "email",
2763 /// "role",
2764 /// "user_uuid"
2765 /// ],
2766 /// "properties": {
2767 /// "email": {
2768 /// "type": "string"
2769 /// },
2770 /// "name": {
2771 /// "type": [
2772 /// "string",
2773 /// "null"
2774 /// ]
2775 /// },
2776 /// "role": {
2777 /// "type": "string",
2778 /// "enum": [
2779 /// "owner",
2780 /// "admin",
2781 /// "member"
2782 /// ]
2783 /// },
2784 /// "user_uuid": {
2785 /// "type": "string",
2786 /// "format": "uuid"
2787 /// }
2788 /// }
2789 ///}
2790 /// ```
2791 /// </details>
2792 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
2793 pub struct OrgMember {
2794 pub email: ::std::string::String,
2795 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2796 pub name: ::std::option::Option<::std::string::String>,
2797 pub role: OrgMemberRole,
2798 pub user_uuid: ::uuid::Uuid,
2799 }
2800
2801 ///`OrgMemberList`
2802 ///
2803 /// <details><summary>JSON schema</summary>
2804 ///
2805 /// ```json
2806 ///{
2807 /// "title": "OrgMemberList",
2808 /// "type": "object",
2809 /// "required": [
2810 /// "data"
2811 /// ],
2812 /// "properties": {
2813 /// "data": {
2814 /// "type": "array",
2815 /// "items": {
2816 /// "$ref": "#/components/schemas/OrgMember"
2817 /// }
2818 /// }
2819 /// }
2820 ///}
2821 /// ```
2822 /// </details>
2823 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
2824 pub struct OrgMemberList {
2825 pub data: ::std::vec::Vec<OrgMember>,
2826 }
2827
2828 ///`OrgMemberRole`
2829 ///
2830 /// <details><summary>JSON schema</summary>
2831 ///
2832 /// ```json
2833 ///{
2834 /// "type": "string",
2835 /// "enum": [
2836 /// "owner",
2837 /// "admin",
2838 /// "member"
2839 /// ]
2840 ///}
2841 /// ```
2842 /// </details>
2843 #[derive(
2844 :: serde :: Deserialize,
2845 :: serde :: Serialize,
2846 Clone,
2847 Copy,
2848 Debug,
2849 Eq,
2850 Hash,
2851 Ord,
2852 PartialEq,
2853 PartialOrd,
2854 )]
2855 pub enum OrgMemberRole {
2856 #[serde(rename = "owner")]
2857 Owner,
2858 #[serde(rename = "admin")]
2859 Admin,
2860 #[serde(rename = "member")]
2861 Member,
2862 }
2863
2864 impl ::std::fmt::Display for OrgMemberRole {
2865 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
2866 match *self {
2867 Self::Owner => f.write_str("owner"),
2868 Self::Admin => f.write_str("admin"),
2869 Self::Member => f.write_str("member"),
2870 }
2871 }
2872 }
2873
2874 impl ::std::str::FromStr for OrgMemberRole {
2875 type Err = self::error::ConversionError;
2876 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2877 match value {
2878 "owner" => Ok(Self::Owner),
2879 "admin" => Ok(Self::Admin),
2880 "member" => Ok(Self::Member),
2881 _ => Err("invalid value".into()),
2882 }
2883 }
2884 }
2885
2886 impl ::std::convert::TryFrom<&str> for OrgMemberRole {
2887 type Error = self::error::ConversionError;
2888 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
2889 value.parse()
2890 }
2891 }
2892
2893 impl ::std::convert::TryFrom<&::std::string::String> for OrgMemberRole {
2894 type Error = self::error::ConversionError;
2895 fn try_from(
2896 value: &::std::string::String,
2897 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2898 value.parse()
2899 }
2900 }
2901
2902 impl ::std::convert::TryFrom<::std::string::String> for OrgMemberRole {
2903 type Error = self::error::ConversionError;
2904 fn try_from(
2905 value: ::std::string::String,
2906 ) -> ::std::result::Result<Self, self::error::ConversionError> {
2907 value.parse()
2908 }
2909 }
2910
2911 ///A Harmont organization the authenticated user is a member of.
2912 ///
2913 /// <details><summary>JSON schema</summary>
2914 ///
2915 /// ```json
2916 ///{
2917 /// "title": "Organization",
2918 /// "description": "A Harmont organization the authenticated user is a
2919 /// member of.",
2920 /// "type": "object",
2921 /// "required": [
2922 /// "created_at",
2923 /// "name",
2924 /// "slug"
2925 /// ],
2926 /// "properties": {
2927 /// "created_at": {
2928 /// "description": "When the organization was created.",
2929 /// "type": "string",
2930 /// "format": "date-time"
2931 /// },
2932 /// "name": {
2933 /// "description": "Display name.",
2934 /// "type": "string"
2935 /// },
2936 /// "slug": {
2937 /// "description": "URL-safe unique slug identifying the
2938 /// organization.",
2939 /// "type": "string"
2940 /// },
2941 /// "url": {
2942 /// "description": "The organization's website, if set.",
2943 /// "type": [
2944 /// "string",
2945 /// "null"
2946 /// ]
2947 /// }
2948 /// }
2949 ///}
2950 /// ```
2951 /// </details>
2952 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
2953 pub struct Organization {
2954 ///When the organization was created.
2955 pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
2956 ///Display name.
2957 pub name: ::std::string::String,
2958 ///URL-safe unique slug identifying the organization.
2959 pub slug: ::std::string::String,
2960 ///The organization's website, if set.
2961 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
2962 pub url: ::std::option::Option<::std::string::String>,
2963 }
2964
2965 ///A page of the current user's organizations, with an opaque cursor.
2966 ///
2967 /// <details><summary>JSON schema</summary>
2968 ///
2969 /// ```json
2970 ///{
2971 /// "title": "OrganizationList",
2972 /// "description": "A page of the current user's organizations, with an
2973 /// opaque cursor.",
2974 /// "type": "object",
2975 /// "required": [
2976 /// "data",
2977 /// "next_cursor"
2978 /// ],
2979 /// "properties": {
2980 /// "data": {
2981 /// "description": "The organizations on this page.",
2982 /// "type": "array",
2983 /// "items": {
2984 /// "$ref": "#/components/schemas/Organization"
2985 /// }
2986 /// },
2987 /// "next_cursor": {
2988 /// "description": "Opaque cursor for the next page. Pass it as the
2989 /// `cursor` query parameter; `null` when there are no more pages.",
2990 /// "type": [
2991 /// "string",
2992 /// "null"
2993 /// ]
2994 /// }
2995 /// }
2996 ///}
2997 /// ```
2998 /// </details>
2999 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
3000 pub struct OrganizationList {
3001 ///The organizations on this page.
3002 pub data: ::std::vec::Vec<Organization>,
3003 ///Opaque cursor for the next page. Pass it as the `cursor` query
3004 /// parameter; `null` when there are no more pages.
3005 pub next_cursor: ::std::option::Option<::std::string::String>,
3006 }
3007
3008 ///A WebAuthn credential registered to the current user.
3009 ///
3010 /// <details><summary>JSON schema</summary>
3011 ///
3012 /// ```json
3013 ///{
3014 /// "title": "Passkey",
3015 /// "description": "A WebAuthn credential registered to the current user.",
3016 /// "type": "object",
3017 /// "required": [
3018 /// "created_at",
3019 /// "uuid"
3020 /// ],
3021 /// "properties": {
3022 /// "aaguid": {
3023 /// "description": "The authenticator's AAGUID (model identifier), if
3024 /// reported.",
3025 /// "type": [
3026 /// "string",
3027 /// "null"
3028 /// ]
3029 /// },
3030 /// "created_at": {
3031 /// "description": "When the passkey was registered.",
3032 /// "type": "string",
3033 /// "format": "date-time"
3034 /// },
3035 /// "last_used_at": {
3036 /// "description": "When the passkey was last used to authenticate, if
3037 /// ever.",
3038 /// "type": [
3039 /// "string",
3040 /// "null"
3041 /// ],
3042 /// "format": "date-time"
3043 /// },
3044 /// "nickname": {
3045 /// "description": "Human label for the passkey.",
3046 /// "type": [
3047 /// "string",
3048 /// "null"
3049 /// ]
3050 /// },
3051 /// "uuid": {
3052 /// "description": "Stable passkey id.",
3053 /// "type": "string",
3054 /// "format": "uuid"
3055 /// }
3056 /// }
3057 ///}
3058 /// ```
3059 /// </details>
3060 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
3061 pub struct Passkey {
3062 ///The authenticator's AAGUID (model identifier), if reported.
3063 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3064 pub aaguid: ::std::option::Option<::std::string::String>,
3065 ///When the passkey was registered.
3066 pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
3067 ///When the passkey was last used to authenticate, if ever.
3068 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3069 pub last_used_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
3070 ///Human label for the passkey.
3071 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3072 pub nickname: ::std::option::Option<::std::string::String>,
3073 ///Stable passkey id.
3074 pub uuid: ::uuid::Uuid,
3075 }
3076
3077 ///The server-side challenge id (correlate it on finalize) and the
3078 /// PublicKeyCredential*Options the browser WebAuthn API consumes.
3079 ///
3080 /// <details><summary>JSON schema</summary>
3081 ///
3082 /// ```json
3083 ///{
3084 /// "title": "PasskeyChallengeResponse",
3085 /// "description": "The server-side challenge id (correlate it on finalize) and the PublicKeyCredential*Options the browser WebAuthn API consumes.",
3086 /// "type": "object",
3087 /// "required": [
3088 /// "challenge_id",
3089 /// "options"
3090 /// ],
3091 /// "properties": {
3092 /// "challenge_id": {
3093 /// "description": "Opaque id of the stored, single-use challenge. Echo
3094 /// it back on finalize.",
3095 /// "type": "string",
3096 /// "format": "uuid"
3097 /// },
3098 /// "options": {
3099 /// "description": "The PublicKeyCredentialCreationOptions /
3100 /// RequestOptions for the browser.",
3101 /// "type": "object",
3102 /// "additionalProperties": true
3103 /// }
3104 /// }
3105 ///}
3106 /// ```
3107 /// </details>
3108 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
3109 pub struct PasskeyChallengeResponse {
3110 ///Opaque id of the stored, single-use challenge. Echo it back on
3111 /// finalize.
3112 pub challenge_id: ::uuid::Uuid,
3113 ///The PublicKeyCredentialCreationOptions / RequestOptions for the
3114 /// browser.
3115 pub options: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
3116 }
3117
3118 ///Every passkey registered to the current user.
3119 ///
3120 /// <details><summary>JSON schema</summary>
3121 ///
3122 /// ```json
3123 ///{
3124 /// "title": "PasskeyListResponse",
3125 /// "description": "Every passkey registered to the current user.",
3126 /// "type": "object",
3127 /// "required": [
3128 /// "passkeys"
3129 /// ],
3130 /// "properties": {
3131 /// "passkeys": {
3132 /// "description": "The user's registered passkeys.",
3133 /// "type": "array",
3134 /// "items": {
3135 /// "$ref": "#/components/schemas/Passkey"
3136 /// }
3137 /// }
3138 /// }
3139 ///}
3140 /// ```
3141 /// </details>
3142 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
3143 pub struct PasskeyListResponse {
3144 ///The user's registered passkeys.
3145 pub passkeys: ::std::vec::Vec<Passkey>,
3146 }
3147
3148 ///Completes passkey login by submitting the assertion for the challenge.
3149 ///
3150 /// <details><summary>JSON schema</summary>
3151 ///
3152 /// ```json
3153 ///{
3154 /// "title": "PasskeyLoginFinalizeRequest",
3155 /// "description": "Completes passkey login by submitting the assertion for
3156 /// the challenge.",
3157 /// "type": "object",
3158 /// "required": [
3159 /// "assertion",
3160 /// "challenge_id"
3161 /// ],
3162 /// "properties": {
3163 /// "assertion": {
3164 /// "description": "The WebAuthn assertion response from
3165 /// navigator.credentials.get.",
3166 /// "type": "object",
3167 /// "additionalProperties": true
3168 /// },
3169 /// "challenge_id": {
3170 /// "description": "The challenge id returned by the login-options
3171 /// call.",
3172 /// "type": "string",
3173 /// "format": "uuid"
3174 /// }
3175 /// }
3176 ///}
3177 /// ```
3178 /// </details>
3179 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
3180 pub struct PasskeyLoginFinalizeRequest {
3181 ///The WebAuthn assertion response from navigator.credentials.get.
3182 pub assertion: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
3183 ///The challenge id returned by the login-options call.
3184 pub challenge_id: ::uuid::Uuid,
3185 }
3186
3187 ///Starts a discoverable-credential (passkey) login. No fields required.
3188 ///
3189 /// <details><summary>JSON schema</summary>
3190 ///
3191 /// ```json
3192 ///{
3193 /// "title": "PasskeyLoginOptionsRequest",
3194 /// "description": "Starts a discoverable-credential (passkey) login. No
3195 /// fields required.",
3196 /// "type": "object"
3197 ///}
3198 /// ```
3199 /// </details>
3200 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
3201 #[serde(transparent)]
3202 pub struct PasskeyLoginOptionsRequest(
3203 pub ::serde_json::Map<::std::string::String, ::serde_json::Value>,
3204 );
3205 impl ::std::ops::Deref for PasskeyLoginOptionsRequest {
3206 type Target = ::serde_json::Map<::std::string::String, ::serde_json::Value>;
3207 fn deref(&self) -> &::serde_json::Map<::std::string::String, ::serde_json::Value> {
3208 &self.0
3209 }
3210 }
3211
3212 impl ::std::convert::From<PasskeyLoginOptionsRequest>
3213 for ::serde_json::Map<::std::string::String, ::serde_json::Value>
3214 {
3215 fn from(value: PasskeyLoginOptionsRequest) -> Self {
3216 value.0
3217 }
3218 }
3219
3220 impl ::std::convert::From<::serde_json::Map<::std::string::String, ::serde_json::Value>>
3221 for PasskeyLoginOptionsRequest
3222 {
3223 fn from(value: ::serde_json::Map<::std::string::String, ::serde_json::Value>) -> Self {
3224 Self(value)
3225 }
3226 }
3227
3228 ///Completes adding a passkey by submitting the attestation for the
3229 /// challenge.
3230 ///
3231 /// <details><summary>JSON schema</summary>
3232 ///
3233 /// ```json
3234 ///{
3235 /// "title": "PasskeyRegisterFinalizeRequest",
3236 /// "description": "Completes adding a passkey by submitting the
3237 /// attestation for the challenge.",
3238 /// "type": "object",
3239 /// "required": [
3240 /// "attestation",
3241 /// "challenge_id"
3242 /// ],
3243 /// "properties": {
3244 /// "attestation": {
3245 /// "description": "The WebAuthn attestation response from
3246 /// navigator.credentials.create.",
3247 /// "type": "object",
3248 /// "additionalProperties": true
3249 /// },
3250 /// "challenge_id": {
3251 /// "description": "The challenge id returned by the register-options
3252 /// call.",
3253 /// "type": "string",
3254 /// "format": "uuid"
3255 /// },
3256 /// "nickname": {
3257 /// "description": "Optional human label for the new passkey.",
3258 /// "type": [
3259 /// "string",
3260 /// "null"
3261 /// ]
3262 /// }
3263 /// }
3264 ///}
3265 /// ```
3266 /// </details>
3267 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
3268 pub struct PasskeyRegisterFinalizeRequest {
3269 ///The WebAuthn attestation response from navigator.credentials.create.
3270 pub attestation: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
3271 ///The challenge id returned by the register-options call.
3272 pub challenge_id: ::uuid::Uuid,
3273 ///Optional human label for the new passkey.
3274 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3275 pub nickname: ::std::option::Option<::std::string::String>,
3276 }
3277
3278 ///WebAuthn credential-creation options for adding a passkey to the current
3279 /// user, plus the server-side challenge id to echo back on finalize.
3280 /// `excludeCredentials` lists the user's already-registered authenticators.
3281 ///
3282 /// <details><summary>JSON schema</summary>
3283 ///
3284 /// ```json
3285 ///{
3286 /// "title": "PasskeyRegisterOptionsResponse",
3287 /// "description": "WebAuthn credential-creation options for adding a
3288 /// passkey to the current user, plus the server-side challenge id to echo
3289 /// back on finalize. `excludeCredentials` lists the user's
3290 /// already-registered authenticators.",
3291 /// "type": "object",
3292 /// "required": [
3293 /// "challenge_id",
3294 /// "options"
3295 /// ],
3296 /// "properties": {
3297 /// "challenge_id": {
3298 /// "description": "Opaque id of the stored, single-use challenge. Echo
3299 /// it back on finalize.",
3300 /// "type": "string",
3301 /// "format": "uuid"
3302 /// },
3303 /// "options": {
3304 /// "description": "The PublicKeyCredentialCreationOptions for the
3305 /// browser.",
3306 /// "type": "object",
3307 /// "additionalProperties": true
3308 /// }
3309 /// }
3310 ///}
3311 /// ```
3312 /// </details>
3313 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
3314 pub struct PasskeyRegisterOptionsResponse {
3315 ///Opaque id of the stored, single-use challenge. Echo it back on
3316 /// finalize.
3317 pub challenge_id: ::uuid::Uuid,
3318 ///The PublicKeyCredentialCreationOptions for the browser.
3319 pub options: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
3320 }
3321
3322 ///Starts passkey sign-up: runs the access gate and emails a verification
3323 /// link.
3324 ///
3325 /// <details><summary>JSON schema</summary>
3326 ///
3327 /// ```json
3328 ///{
3329 /// "title": "PasskeySignupBeginRequest",
3330 /// "description": "Starts passkey sign-up: runs the access gate and emails
3331 /// a verification link.",
3332 /// "examples": [
3333 /// {
3334 /// "email": "alice@harmont.dev",
3335 /// "name": "Alice"
3336 /// }
3337 /// ],
3338 /// "type": "object",
3339 /// "required": [
3340 /// "email",
3341 /// "name"
3342 /// ],
3343 /// "properties": {
3344 /// "email": {
3345 /// "description": "The email to sign up with.",
3346 /// "type": "string"
3347 /// },
3348 /// "name": {
3349 /// "description": "The new user's display name.",
3350 /// "type": "string"
3351 /// }
3352 /// }
3353 ///}
3354 /// ```
3355 /// </details>
3356 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
3357 pub struct PasskeySignupBeginRequest {
3358 ///The email to sign up with.
3359 pub email: ::std::string::String,
3360 ///The new user's display name.
3361 pub name: ::std::string::String,
3362 }
3363
3364 ///Completes passkey sign-up by submitting the attestation for the
3365 /// challenge.
3366 ///
3367 /// <details><summary>JSON schema</summary>
3368 ///
3369 /// ```json
3370 ///{
3371 /// "title": "PasskeySignupFinalizeRequest",
3372 /// "description": "Completes passkey sign-up by submitting the attestation
3373 /// for the challenge.",
3374 /// "type": "object",
3375 /// "required": [
3376 /// "attestation",
3377 /// "challenge_id",
3378 /// "verification_token"
3379 /// ],
3380 /// "properties": {
3381 /// "attestation": {
3382 /// "description": "The WebAuthn attestation response from
3383 /// navigator.credentials.create.",
3384 /// "type": "object",
3385 /// "additionalProperties": true
3386 /// },
3387 /// "challenge_id": {
3388 /// "description": "The challenge id returned by the options call.",
3389 /// "type": "string",
3390 /// "format": "uuid"
3391 /// },
3392 /// "verification_token": {
3393 /// "description": "The raw verification token (consumed here).",
3394 /// "type": "string"
3395 /// }
3396 /// }
3397 ///}
3398 /// ```
3399 /// </details>
3400 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
3401 pub struct PasskeySignupFinalizeRequest {
3402 ///The WebAuthn attestation response from navigator.credentials.create.
3403 pub attestation: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
3404 ///The challenge id returned by the options call.
3405 pub challenge_id: ::uuid::Uuid,
3406 ///The raw verification token (consumed here).
3407 pub verification_token: ::std::string::String,
3408 }
3409
3410 ///Exchanges a verification token for WebAuthn credential-creation options.
3411 ///
3412 /// <details><summary>JSON schema</summary>
3413 ///
3414 /// ```json
3415 ///{
3416 /// "title": "PasskeySignupOptionsRequest",
3417 /// "description": "Exchanges a verification token for WebAuthn
3418 /// credential-creation options.",
3419 /// "type": "object",
3420 /// "required": [
3421 /// "verification_token"
3422 /// ],
3423 /// "properties": {
3424 /// "verification_token": {
3425 /// "description": "The raw token from the verification email.",
3426 /// "type": "string"
3427 /// }
3428 /// }
3429 ///}
3430 /// ```
3431 /// </details>
3432 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
3433 pub struct PasskeySignupOptionsRequest {
3434 ///The raw token from the verification email.
3435 pub verification_token: ::std::string::String,
3436 }
3437
3438 ///`PingResponse`
3439 ///
3440 /// <details><summary>JSON schema</summary>
3441 ///
3442 /// ```json
3443 ///{
3444 /// "type": "object",
3445 /// "required": [
3446 /// "status"
3447 /// ],
3448 /// "properties": {
3449 /// "status": {
3450 /// "examples": [
3451 /// "ok"
3452 /// ],
3453 /// "type": "string"
3454 /// }
3455 /// }
3456 ///}
3457 /// ```
3458 /// </details>
3459 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
3460 pub struct PingResponse {
3461 pub status: ::std::string::String,
3462 }
3463
3464 ///A repeatable CI workflow belonging to an organization.
3465 ///
3466 /// <details><summary>JSON schema</summary>
3467 ///
3468 /// ```json
3469 ///{
3470 /// "title": "Pipeline",
3471 /// "description": "A repeatable CI workflow belonging to an
3472 /// organization.",
3473 /// "type": "object",
3474 /// "required": [
3475 /// "allow_manual",
3476 /// "created_at",
3477 /// "default_branch",
3478 /// "name",
3479 /// "repository",
3480 /// "slug",
3481 /// "visibility"
3482 /// ],
3483 /// "properties": {
3484 /// "allow_manual": {
3485 /// "description": "Whether manual (e.g. `hm run`) builds are
3486 /// permitted.",
3487 /// "type": "boolean"
3488 /// },
3489 /// "created_at": {
3490 /// "description": "When the pipeline was created.",
3491 /// "type": "string",
3492 /// "format": "date-time"
3493 /// },
3494 /// "default_branch": {
3495 /// "description": "The branch built by default.",
3496 /// "type": "string"
3497 /// },
3498 /// "description": {
3499 /// "description": "Optional human description.",
3500 /// "type": [
3501 /// "string",
3502 /// "null"
3503 /// ]
3504 /// },
3505 /// "name": {
3506 /// "description": "Display name.",
3507 /// "type": "string"
3508 /// },
3509 /// "repo_name": {
3510 /// "description": "The pipeline's repo as `owner/repo` — from the
3511 /// mirrored GitHub repo when known, else parsed from the clone URL. `null`
3512 /// when unknown.",
3513 /// "type": [
3514 /// "string",
3515 /// "null"
3516 /// ]
3517 /// },
3518 /// "repository": {
3519 /// "description": "The source repository this pipeline builds.",
3520 /// "type": "string"
3521 /// },
3522 /// "slug": {
3523 /// "description": "URL-safe slug, unique within the organization.
3524 /// Derived from the name.",
3525 /// "type": "string"
3526 /// },
3527 /// "visibility": {
3528 /// "description": "Whether the pipeline is private or public.",
3529 /// "type": "string",
3530 /// "enum": [
3531 /// "private",
3532 /// "public"
3533 /// ]
3534 /// }
3535 /// }
3536 ///}
3537 /// ```
3538 /// </details>
3539 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
3540 pub struct Pipeline {
3541 ///Whether manual (e.g. `hm run`) builds are permitted.
3542 pub allow_manual: bool,
3543 ///When the pipeline was created.
3544 pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
3545 ///The branch built by default.
3546 pub default_branch: ::std::string::String,
3547 ///Optional human description.
3548 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3549 pub description: ::std::option::Option<::std::string::String>,
3550 ///Display name.
3551 pub name: ::std::string::String,
3552 ///The pipeline's repo as `owner/repo` — from the mirrored GitHub repo
3553 /// when known, else parsed from the clone URL. `null` when unknown.
3554 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3555 pub repo_name: ::std::option::Option<::std::string::String>,
3556 ///The source repository this pipeline builds.
3557 pub repository: ::std::string::String,
3558 ///URL-safe slug, unique within the organization. Derived from the
3559 /// name.
3560 pub slug: ::std::string::String,
3561 ///Whether the pipeline is private or public.
3562 pub visibility: PipelineVisibility,
3563 }
3564
3565 ///A page of an organization's pipelines, with an opaque cursor.
3566 ///
3567 /// <details><summary>JSON schema</summary>
3568 ///
3569 /// ```json
3570 ///{
3571 /// "title": "PipelineList",
3572 /// "description": "A page of an organization's pipelines, with an opaque
3573 /// cursor.",
3574 /// "type": "object",
3575 /// "required": [
3576 /// "data",
3577 /// "next_cursor"
3578 /// ],
3579 /// "properties": {
3580 /// "data": {
3581 /// "description": "The pipelines on this page.",
3582 /// "type": "array",
3583 /// "items": {
3584 /// "$ref": "#/components/schemas/Pipeline"
3585 /// }
3586 /// },
3587 /// "next_cursor": {
3588 /// "description": "Opaque cursor for the next page. Pass it as the
3589 /// `cursor` query parameter; `null` when there are no more pages.",
3590 /// "type": [
3591 /// "string",
3592 /// "null"
3593 /// ]
3594 /// }
3595 /// }
3596 ///}
3597 /// ```
3598 /// </details>
3599 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
3600 pub struct PipelineList {
3601 ///The pipelines on this page.
3602 pub data: ::std::vec::Vec<Pipeline>,
3603 ///Opaque cursor for the next page. Pass it as the `cursor` query
3604 /// parameter; `null` when there are no more pages.
3605 pub next_cursor: ::std::option::Option<::std::string::String>,
3606 }
3607
3608 ///Whether the pipeline is private or public.
3609 ///
3610 /// <details><summary>JSON schema</summary>
3611 ///
3612 /// ```json
3613 ///{
3614 /// "description": "Whether the pipeline is private or public.",
3615 /// "type": "string",
3616 /// "enum": [
3617 /// "private",
3618 /// "public"
3619 /// ]
3620 ///}
3621 /// ```
3622 /// </details>
3623 #[derive(
3624 :: serde :: Deserialize,
3625 :: serde :: Serialize,
3626 Clone,
3627 Copy,
3628 Debug,
3629 Eq,
3630 Hash,
3631 Ord,
3632 PartialEq,
3633 PartialOrd,
3634 )]
3635 pub enum PipelineVisibility {
3636 #[serde(rename = "private")]
3637 Private,
3638 #[serde(rename = "public")]
3639 Public,
3640 }
3641
3642 impl ::std::fmt::Display for PipelineVisibility {
3643 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
3644 match *self {
3645 Self::Private => f.write_str("private"),
3646 Self::Public => f.write_str("public"),
3647 }
3648 }
3649 }
3650
3651 impl ::std::str::FromStr for PipelineVisibility {
3652 type Err = self::error::ConversionError;
3653 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3654 match value {
3655 "private" => Ok(Self::Private),
3656 "public" => Ok(Self::Public),
3657 _ => Err("invalid value".into()),
3658 }
3659 }
3660 }
3661
3662 impl ::std::convert::TryFrom<&str> for PipelineVisibility {
3663 type Error = self::error::ConversionError;
3664 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
3665 value.parse()
3666 }
3667 }
3668
3669 impl ::std::convert::TryFrom<&::std::string::String> for PipelineVisibility {
3670 type Error = self::error::ConversionError;
3671 fn try_from(
3672 value: &::std::string::String,
3673 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3674 value.parse()
3675 }
3676 }
3677
3678 impl ::std::convert::TryFrom<::std::string::String> for PipelineVisibility {
3679 type Error = self::error::ConversionError;
3680 fn try_from(
3681 value: ::std::string::String,
3682 ) -> ::std::result::Result<Self, self::error::ConversionError> {
3683 value.parse()
3684 }
3685 }
3686
3687 ///Starts magic-link account recovery. Always 204 (never leaks account
3688 /// existence).
3689 ///
3690 /// <details><summary>JSON schema</summary>
3691 ///
3692 /// ```json
3693 ///{
3694 /// "title": "RecoverBeginRequest",
3695 /// "description": "Starts magic-link account recovery. Always 204 (never
3696 /// leaks account existence).",
3697 /// "examples": [
3698 /// {
3699 /// "email": "alice@harmont.dev"
3700 /// }
3701 /// ],
3702 /// "type": "object",
3703 /// "required": [
3704 /// "email"
3705 /// ],
3706 /// "properties": {
3707 /// "email": {
3708 /// "description": "The email to recover access for.",
3709 /// "type": "string"
3710 /// }
3711 /// }
3712 ///}
3713 /// ```
3714 /// </details>
3715 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
3716 pub struct RecoverBeginRequest {
3717 ///The email to recover access for.
3718 pub email: ::std::string::String,
3719 }
3720
3721 ///Completes recovery: consumes the magic-link token + challenge, registers
3722 /// a new passkey, and mints a session token.
3723 ///
3724 /// <details><summary>JSON schema</summary>
3725 ///
3726 /// ```json
3727 ///{
3728 /// "title": "RecoverFinalizeRequest",
3729 /// "description": "Completes recovery: consumes the magic-link token +
3730 /// challenge, registers a new passkey, and mints a session token.",
3731 /// "type": "object",
3732 /// "required": [
3733 /// "attestation",
3734 /// "challenge_id",
3735 /// "magic_link_token"
3736 /// ],
3737 /// "properties": {
3738 /// "attestation": {
3739 /// "description": "The WebAuthn attestation response from
3740 /// navigator.credentials.create.",
3741 /// "type": "object",
3742 /// "additionalProperties": true
3743 /// },
3744 /// "challenge_id": {
3745 /// "description": "The challenge id returned by the recover-options
3746 /// call.",
3747 /// "type": "string",
3748 /// "format": "uuid"
3749 /// },
3750 /// "magic_link_token": {
3751 /// "description": "The raw recovery token (consumed here).",
3752 /// "type": "string"
3753 /// }
3754 /// }
3755 ///}
3756 /// ```
3757 /// </details>
3758 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
3759 pub struct RecoverFinalizeRequest {
3760 ///The WebAuthn attestation response from navigator.credentials.create.
3761 pub attestation: ::serde_json::Map<::std::string::String, ::serde_json::Value>,
3762 ///The challenge id returned by the recover-options call.
3763 pub challenge_id: ::uuid::Uuid,
3764 ///The raw recovery token (consumed here).
3765 pub magic_link_token: ::std::string::String,
3766 }
3767
3768 ///Validates a magic-link token (without consuming it) and returns WebAuthn
3769 /// credential-creation options to enroll a fresh passkey.
3770 ///
3771 /// <details><summary>JSON schema</summary>
3772 ///
3773 /// ```json
3774 ///{
3775 /// "title": "RecoverOptionsRequest",
3776 /// "description": "Validates a magic-link token (without consuming it) and
3777 /// returns WebAuthn credential-creation options to enroll a fresh
3778 /// passkey.",
3779 /// "type": "object",
3780 /// "required": [
3781 /// "magic_link_token"
3782 /// ],
3783 /// "properties": {
3784 /// "magic_link_token": {
3785 /// "description": "The raw token from the recovery email.",
3786 /// "type": "string"
3787 /// }
3788 /// }
3789 ///}
3790 /// ```
3791 /// </details>
3792 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
3793 pub struct RecoverOptionsRequest {
3794 ///The raw token from the recovery email.
3795 pub magic_link_token: ::std::string::String,
3796 }
3797
3798 ///Redeems a coupon for the organization identified by the path. The org is
3799 /// taken from the route (`:org`); the body carries only the coupon code.
3800 ///
3801 /// <details><summary>JSON schema</summary>
3802 ///
3803 /// ```json
3804 ///{
3805 /// "title": "RedeemCouponRequest",
3806 /// "description": "Redeems a coupon for the organization identified by the
3807 /// path. The org is taken from the route (`:org`); the body carries only
3808 /// the coupon code.",
3809 /// "type": "object",
3810 /// "required": [
3811 /// "code"
3812 /// ],
3813 /// "properties": {
3814 /// "code": {
3815 /// "description": "The coupon code to redeem.",
3816 /// "type": "string"
3817 /// }
3818 /// }
3819 ///}
3820 /// ```
3821 /// </details>
3822 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
3823 pub struct RedeemCouponRequest {
3824 ///The coupon code to redeem.
3825 pub code: ::std::string::String,
3826 }
3827
3828 ///The credit granted by the coupon and the organization's resulting
3829 /// balance, both in cents.
3830 ///
3831 /// <details><summary>JSON schema</summary>
3832 ///
3833 /// ```json
3834 ///{
3835 /// "title": "RedeemCouponResponse",
3836 /// "description": "The credit granted by the coupon and the organization's
3837 /// resulting balance, both in cents.",
3838 /// "type": "object",
3839 /// "required": [
3840 /// "balance_cents",
3841 /// "credit_cents"
3842 /// ],
3843 /// "properties": {
3844 /// "balance_cents": {
3845 /// "description": "The organization's balance after the credit, in
3846 /// cents.",
3847 /// "type": "integer"
3848 /// },
3849 /// "credit_cents": {
3850 /// "description": "The credit granted by the coupon, in cents.",
3851 /// "type": "integer"
3852 /// }
3853 /// }
3854 ///}
3855 /// ```
3856 /// </details>
3857 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
3858 pub struct RedeemCouponResponse {
3859 ///The organization's balance after the credit, in cents.
3860 pub balance_cents: i64,
3861 ///The credit granted by the coupon, in cents.
3862 pub credit_cents: i64,
3863 }
3864
3865 ///A single registration channel for a repository. `provider` is the
3866 /// channel the repo was connected through: `github` (the GitHub App),
3867 /// `bitbucket` (Bitbucket OAuth), or `cli` (reserved for direct CLI
3868 /// registration — not yet emitted). `account` is the connecting
3869 /// account/workspace login.
3870 ///
3871 /// <details><summary>JSON schema</summary>
3872 ///
3873 /// ```json
3874 ///{
3875 /// "title": "RepoRegistration",
3876 /// "description": "A single registration channel for a repository.
3877 /// `provider` is the channel the repo was connected through: `github` (the
3878 /// GitHub App), `bitbucket` (Bitbucket OAuth), or `cli` (reserved for
3879 /// direct CLI registration — not yet emitted). `account` is the connecting
3880 /// account/workspace login.",
3881 /// "type": "object",
3882 /// "required": [
3883 /// "account",
3884 /// "provider"
3885 /// ],
3886 /// "properties": {
3887 /// "account": {
3888 /// "description": "The account/workspace login the repo was registered
3889 /// under.",
3890 /// "type": "string"
3891 /// },
3892 /// "provider": {
3893 /// "description": "The registration channel: `github`, `bitbucket`, or
3894 /// `cli`.",
3895 /// "type": "string"
3896 /// }
3897 /// }
3898 ///}
3899 /// ```
3900 /// </details>
3901 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
3902 pub struct RepoRegistration {
3903 ///The account/workspace login the repo was registered under.
3904 pub account: ::std::string::String,
3905 ///The registration channel: `github`, `bitbucket`, or `cli`.
3906 pub provider: ::std::string::String,
3907 }
3908
3909 ///A repository visible to the organization, identified by its canonical
3910 /// clone URL. One logical repository may be registered through several
3911 /// channels (e.g. the GitHub App and the CLI); each appears in
3912 /// `registrations`.
3913 ///
3914 /// <details><summary>JSON schema</summary>
3915 ///
3916 /// ```json
3917 ///{
3918 /// "title": "RepoSummary",
3919 /// "description": "A repository visible to the organization, identified by
3920 /// its canonical clone URL. One logical repository may be registered
3921 /// through several channels (e.g. the GitHub App and the CLI); each appears
3922 /// in `registrations`.",
3923 /// "type": "object",
3924 /// "required": [
3925 /// "full_name",
3926 /// "name",
3927 /// "owner",
3928 /// "private",
3929 /// "registrations"
3930 /// ],
3931 /// "properties": {
3932 /// "clone_url": {
3933 /// "description": "HTTPS clone URL (may be null for some providers).",
3934 /// "type": [
3935 /// "string",
3936 /// "null"
3937 /// ]
3938 /// },
3939 /// "default_branch": {
3940 /// "description": "Default branch name.",
3941 /// "type": [
3942 /// "string",
3943 /// "null"
3944 /// ]
3945 /// },
3946 /// "full_name": {
3947 /// "description": "`owner/name` full name.",
3948 /// "type": "string"
3949 /// },
3950 /// "last_synced_at": {
3951 /// "description": "Most recent sync across this repo's
3952 /// registrations.",
3953 /// "type": [
3954 /// "string",
3955 /// "null"
3956 /// ],
3957 /// "format": "date-time"
3958 /// },
3959 /// "name": {
3960 /// "description": "Short repo name.",
3961 /// "type": "string"
3962 /// },
3963 /// "owner": {
3964 /// "description": "Owner/namespace login.",
3965 /// "type": "string"
3966 /// },
3967 /// "private": {
3968 /// "description": "Whether the repo is private.",
3969 /// "type": "boolean"
3970 /// },
3971 /// "registrations": {
3972 /// "description": "Every channel through which this repo is
3973 /// registered.",
3974 /// "type": "array",
3975 /// "items": {
3976 /// "$ref": "#/components/schemas/RepoRegistration"
3977 /// }
3978 /// }
3979 /// }
3980 ///}
3981 /// ```
3982 /// </details>
3983 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
3984 pub struct RepoSummary {
3985 ///HTTPS clone URL (may be null for some providers).
3986 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3987 pub clone_url: ::std::option::Option<::std::string::String>,
3988 ///Default branch name.
3989 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3990 pub default_branch: ::std::option::Option<::std::string::String>,
3991 ///`owner/name` full name.
3992 pub full_name: ::std::string::String,
3993 ///Most recent sync across this repo's registrations.
3994 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
3995 pub last_synced_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
3996 ///Short repo name.
3997 pub name: ::std::string::String,
3998 ///Owner/namespace login.
3999 pub owner: ::std::string::String,
4000 ///Whether the repo is private.
4001 pub private: bool,
4002 ///Every channel through which this repo is registered.
4003 pub registrations: ::std::vec::Vec<RepoRegistration>,
4004 }
4005
4006 ///All repositories visible to the organization, across all providers.
4007 ///
4008 /// <details><summary>JSON schema</summary>
4009 ///
4010 /// ```json
4011 ///{
4012 /// "title": "RepoSummaryList",
4013 /// "description": "All repositories visible to the organization, across
4014 /// all providers.",
4015 /// "type": "object",
4016 /// "required": [
4017 /// "data"
4018 /// ],
4019 /// "properties": {
4020 /// "data": {
4021 /// "description": "The repositories.",
4022 /// "type": "array",
4023 /// "items": {
4024 /// "$ref": "#/components/schemas/RepoSummary"
4025 /// }
4026 /// }
4027 /// }
4028 ///}
4029 /// ```
4030 /// </details>
4031 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
4032 pub struct RepoSummaryList {
4033 ///The repositories.
4034 pub data: ::std::vec::Vec<RepoSummary>,
4035 }
4036
4037 ///Acknowledges that a Stripe webhook event verified and was recorded
4038 /// (idempotently). Returned for any verified event — handled or not — so
4039 /// Stripe stops retrying.
4040 ///
4041 /// <details><summary>JSON schema</summary>
4042 ///
4043 /// ```json
4044 ///{
4045 /// "title": "StripeWebhookResponse",
4046 /// "description": "Acknowledges that a Stripe webhook event verified and
4047 /// was recorded (idempotently). Returned for any verified event — handled
4048 /// or not — so Stripe stops retrying.",
4049 /// "type": "object",
4050 /// "required": [
4051 /// "status"
4052 /// ],
4053 /// "properties": {
4054 /// "status": {
4055 /// "description": "Always `\"ok\"` on a verified, recorded event.",
4056 /// "type": "string",
4057 /// "enum": [
4058 /// "ok"
4059 /// ]
4060 /// }
4061 /// }
4062 ///}
4063 /// ```
4064 /// </details>
4065 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
4066 pub struct StripeWebhookResponse {
4067 ///Always `"ok"` on a verified, recorded event.
4068 pub status: StripeWebhookResponseStatus,
4069 }
4070
4071 ///Always `"ok"` on a verified, recorded event.
4072 ///
4073 /// <details><summary>JSON schema</summary>
4074 ///
4075 /// ```json
4076 ///{
4077 /// "description": "Always `\"ok\"` on a verified, recorded event.",
4078 /// "type": "string",
4079 /// "enum": [
4080 /// "ok"
4081 /// ]
4082 ///}
4083 /// ```
4084 /// </details>
4085 #[derive(
4086 :: serde :: Deserialize,
4087 :: serde :: Serialize,
4088 Clone,
4089 Copy,
4090 Debug,
4091 Eq,
4092 Hash,
4093 Ord,
4094 PartialEq,
4095 PartialOrd,
4096 )]
4097 pub enum StripeWebhookResponseStatus {
4098 #[serde(rename = "ok")]
4099 Ok,
4100 }
4101
4102 impl ::std::fmt::Display for StripeWebhookResponseStatus {
4103 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
4104 match *self {
4105 Self::Ok => f.write_str("ok"),
4106 }
4107 }
4108 }
4109
4110 impl ::std::str::FromStr for StripeWebhookResponseStatus {
4111 type Err = self::error::ConversionError;
4112 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4113 match value {
4114 "ok" => Ok(Self::Ok),
4115 _ => Err("invalid value".into()),
4116 }
4117 }
4118 }
4119
4120 impl ::std::convert::TryFrom<&str> for StripeWebhookResponseStatus {
4121 type Error = self::error::ConversionError;
4122 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4123 value.parse()
4124 }
4125 }
4126
4127 impl ::std::convert::TryFrom<&::std::string::String> for StripeWebhookResponseStatus {
4128 type Error = self::error::ConversionError;
4129 fn try_from(
4130 value: &::std::string::String,
4131 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4132 value.parse()
4133 }
4134 }
4135
4136 impl ::std::convert::TryFrom<::std::string::String> for StripeWebhookResponseStatus {
4137 type Error = self::error::ConversionError;
4138 fn try_from(
4139 value: ::std::string::String,
4140 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4141 value.parse()
4142 }
4143 }
4144
4145 ///A freshly minted session bearer token.
4146 ///
4147 /// <details><summary>JSON schema</summary>
4148 ///
4149 /// ```json
4150 ///{
4151 /// "title": "TokenResponse",
4152 /// "description": "A freshly minted session bearer token.",
4153 /// "type": "object",
4154 /// "required": [
4155 /// "token"
4156 /// ],
4157 /// "properties": {
4158 /// "token": {
4159 /// "description": "The raw session bearer token. Send it as
4160 /// `Authorization: Bearer <token>`.",
4161 /// "type": "string"
4162 /// }
4163 /// }
4164 ///}
4165 /// ```
4166 /// </details>
4167 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
4168 pub struct TokenResponse {
4169 ///The raw session bearer token. Send it as `Authorization: Bearer
4170 /// <token>`.
4171 pub token: ::std::string::String,
4172 }
4173
4174 ///One append-only ledger entry — a credit (positive) or debit (negative).
4175 ///
4176 /// <details><summary>JSON schema</summary>
4177 ///
4178 /// ```json
4179 ///{
4180 /// "title": "Transaction",
4181 /// "description": "One append-only ledger entry — a credit (positive) or
4182 /// debit (negative).",
4183 /// "type": "object",
4184 /// "required": [
4185 /// "amount_cents",
4186 /// "created_at",
4187 /// "id",
4188 /// "source"
4189 /// ],
4190 /// "properties": {
4191 /// "amount_cents": {
4192 /// "description": "Signed amount in cents: positive for credits,
4193 /// negative for debits.",
4194 /// "type": "integer"
4195 /// },
4196 /// "created_at": {
4197 /// "description": "When the entry was recorded.",
4198 /// "type": "string",
4199 /// "format": "date-time"
4200 /// },
4201 /// "description": {
4202 /// "description": "Optional human-readable note.",
4203 /// "type": [
4204 /// "string",
4205 /// "null"
4206 /// ]
4207 /// },
4208 /// "id": {
4209 /// "description": "The entry's id.",
4210 /// "type": "string",
4211 /// "format": "uuid"
4212 /// },
4213 /// "source": {
4214 /// "description": "What produced the entry.",
4215 /// "type": "string",
4216 /// "enum": [
4217 /// "stripe_topup",
4218 /// "coupon_redemption",
4219 /// "admin_grant",
4220 /// "vm_lease_debit",
4221 /// "refund"
4222 /// ]
4223 /// }
4224 /// }
4225 ///}
4226 /// ```
4227 /// </details>
4228 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
4229 pub struct Transaction {
4230 ///Signed amount in cents: positive for credits, negative for debits.
4231 pub amount_cents: i64,
4232 ///When the entry was recorded.
4233 pub created_at: ::chrono::DateTime<::chrono::offset::Utc>,
4234 ///Optional human-readable note.
4235 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4236 pub description: ::std::option::Option<::std::string::String>,
4237 ///The entry's id.
4238 pub id: ::uuid::Uuid,
4239 ///What produced the entry.
4240 pub source: TransactionSource,
4241 }
4242
4243 ///A page of an organization's ledger entries (newest first), with an
4244 /// opaque cursor.
4245 ///
4246 /// <details><summary>JSON schema</summary>
4247 ///
4248 /// ```json
4249 ///{
4250 /// "title": "TransactionList",
4251 /// "description": "A page of an organization's ledger entries (newest
4252 /// first), with an opaque cursor.",
4253 /// "type": "object",
4254 /// "required": [
4255 /// "data",
4256 /// "next_cursor"
4257 /// ],
4258 /// "properties": {
4259 /// "data": {
4260 /// "description": "The ledger entries on this page, newest first.",
4261 /// "type": "array",
4262 /// "items": {
4263 /// "$ref": "#/components/schemas/Transaction"
4264 /// }
4265 /// },
4266 /// "next_cursor": {
4267 /// "description": "Opaque cursor for the next page. Pass it as the
4268 /// `cursor` query parameter; `null` when there are no more pages.",
4269 /// "type": [
4270 /// "string",
4271 /// "null"
4272 /// ]
4273 /// }
4274 /// }
4275 ///}
4276 /// ```
4277 /// </details>
4278 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
4279 pub struct TransactionList {
4280 ///The ledger entries on this page, newest first.
4281 pub data: ::std::vec::Vec<Transaction>,
4282 ///Opaque cursor for the next page. Pass it as the `cursor` query
4283 /// parameter; `null` when there are no more pages.
4284 pub next_cursor: ::std::option::Option<::std::string::String>,
4285 }
4286
4287 ///What produced the entry.
4288 ///
4289 /// <details><summary>JSON schema</summary>
4290 ///
4291 /// ```json
4292 ///{
4293 /// "description": "What produced the entry.",
4294 /// "type": "string",
4295 /// "enum": [
4296 /// "stripe_topup",
4297 /// "coupon_redemption",
4298 /// "admin_grant",
4299 /// "vm_lease_debit",
4300 /// "refund"
4301 /// ]
4302 ///}
4303 /// ```
4304 /// </details>
4305 #[derive(
4306 :: serde :: Deserialize,
4307 :: serde :: Serialize,
4308 Clone,
4309 Copy,
4310 Debug,
4311 Eq,
4312 Hash,
4313 Ord,
4314 PartialEq,
4315 PartialOrd,
4316 )]
4317 pub enum TransactionSource {
4318 #[serde(rename = "stripe_topup")]
4319 StripeTopup,
4320 #[serde(rename = "coupon_redemption")]
4321 CouponRedemption,
4322 #[serde(rename = "admin_grant")]
4323 AdminGrant,
4324 #[serde(rename = "vm_lease_debit")]
4325 VmLeaseDebit,
4326 #[serde(rename = "refund")]
4327 Refund,
4328 }
4329
4330 impl ::std::fmt::Display for TransactionSource {
4331 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
4332 match *self {
4333 Self::StripeTopup => f.write_str("stripe_topup"),
4334 Self::CouponRedemption => f.write_str("coupon_redemption"),
4335 Self::AdminGrant => f.write_str("admin_grant"),
4336 Self::VmLeaseDebit => f.write_str("vm_lease_debit"),
4337 Self::Refund => f.write_str("refund"),
4338 }
4339 }
4340 }
4341
4342 impl ::std::str::FromStr for TransactionSource {
4343 type Err = self::error::ConversionError;
4344 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4345 match value {
4346 "stripe_topup" => Ok(Self::StripeTopup),
4347 "coupon_redemption" => Ok(Self::CouponRedemption),
4348 "admin_grant" => Ok(Self::AdminGrant),
4349 "vm_lease_debit" => Ok(Self::VmLeaseDebit),
4350 "refund" => Ok(Self::Refund),
4351 _ => Err("invalid value".into()),
4352 }
4353 }
4354 }
4355
4356 impl ::std::convert::TryFrom<&str> for TransactionSource {
4357 type Error = self::error::ConversionError;
4358 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4359 value.parse()
4360 }
4361 }
4362
4363 impl ::std::convert::TryFrom<&::std::string::String> for TransactionSource {
4364 type Error = self::error::ConversionError;
4365 fn try_from(
4366 value: &::std::string::String,
4367 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4368 value.parse()
4369 }
4370 }
4371
4372 impl ::std::convert::TryFrom<::std::string::String> for TransactionSource {
4373 type Error = self::error::ConversionError;
4374 fn try_from(
4375 value: ::std::string::String,
4376 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4377 value.parse()
4378 }
4379 }
4380
4381 ///`UpdateMemberRoleRequest`
4382 ///
4383 /// <details><summary>JSON schema</summary>
4384 ///
4385 /// ```json
4386 ///{
4387 /// "title": "UpdateMemberRoleRequest",
4388 /// "type": "object",
4389 /// "required": [
4390 /// "role"
4391 /// ],
4392 /// "properties": {
4393 /// "role": {
4394 /// "type": "string",
4395 /// "enum": [
4396 /// "owner",
4397 /// "admin",
4398 /// "member"
4399 /// ]
4400 /// }
4401 /// }
4402 ///}
4403 /// ```
4404 /// </details>
4405 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
4406 pub struct UpdateMemberRoleRequest {
4407 pub role: UpdateMemberRoleRequestRole,
4408 }
4409
4410 ///`UpdateMemberRoleRequestRole`
4411 ///
4412 /// <details><summary>JSON schema</summary>
4413 ///
4414 /// ```json
4415 ///{
4416 /// "type": "string",
4417 /// "enum": [
4418 /// "owner",
4419 /// "admin",
4420 /// "member"
4421 /// ]
4422 ///}
4423 /// ```
4424 /// </details>
4425 #[derive(
4426 :: serde :: Deserialize,
4427 :: serde :: Serialize,
4428 Clone,
4429 Copy,
4430 Debug,
4431 Eq,
4432 Hash,
4433 Ord,
4434 PartialEq,
4435 PartialOrd,
4436 )]
4437 pub enum UpdateMemberRoleRequestRole {
4438 #[serde(rename = "owner")]
4439 Owner,
4440 #[serde(rename = "admin")]
4441 Admin,
4442 #[serde(rename = "member")]
4443 Member,
4444 }
4445
4446 impl ::std::fmt::Display for UpdateMemberRoleRequestRole {
4447 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
4448 match *self {
4449 Self::Owner => f.write_str("owner"),
4450 Self::Admin => f.write_str("admin"),
4451 Self::Member => f.write_str("member"),
4452 }
4453 }
4454 }
4455
4456 impl ::std::str::FromStr for UpdateMemberRoleRequestRole {
4457 type Err = self::error::ConversionError;
4458 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4459 match value {
4460 "owner" => Ok(Self::Owner),
4461 "admin" => Ok(Self::Admin),
4462 "member" => Ok(Self::Member),
4463 _ => Err("invalid value".into()),
4464 }
4465 }
4466 }
4467
4468 impl ::std::convert::TryFrom<&str> for UpdateMemberRoleRequestRole {
4469 type Error = self::error::ConversionError;
4470 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
4471 value.parse()
4472 }
4473 }
4474
4475 impl ::std::convert::TryFrom<&::std::string::String> for UpdateMemberRoleRequestRole {
4476 type Error = self::error::ConversionError;
4477 fn try_from(
4478 value: &::std::string::String,
4479 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4480 value.parse()
4481 }
4482 }
4483
4484 impl ::std::convert::TryFrom<::std::string::String> for UpdateMemberRoleRequestRole {
4485 type Error = self::error::ConversionError;
4486 fn try_from(
4487 value: ::std::string::String,
4488 ) -> ::std::result::Result<Self, self::error::ConversionError> {
4489 value.parse()
4490 }
4491 }
4492
4493 ///All VM usage attributed to one build, rolled up and broken down per job.
4494 ///
4495 /// <details><summary>JSON schema</summary>
4496 ///
4497 /// ```json
4498 ///{
4499 /// "title": "UsageBreakdownBuild",
4500 /// "description": "All VM usage attributed to one build, rolled up and
4501 /// broken down per job.",
4502 /// "type": "object",
4503 /// "required": [
4504 /// "job_count",
4505 /// "jobs",
4506 /// "started_at",
4507 /// "total_cents"
4508 /// ],
4509 /// "properties": {
4510 /// "build_external_id": {
4511 /// "description": "The build's public external id.",
4512 /// "type": [
4513 /// "string",
4514 /// "null"
4515 /// ],
4516 /// "format": "uuid"
4517 /// },
4518 /// "build_id": {
4519 /// "description": "The build's id (null for leases with no build).",
4520 /// "type": [
4521 /// "string",
4522 /// "null"
4523 /// ],
4524 /// "format": "uuid"
4525 /// },
4526 /// "build_number": {
4527 /// "description": "The per-pipeline build number.",
4528 /// "type": [
4529 /// "integer",
4530 /// "null"
4531 /// ]
4532 /// },
4533 /// "finished_at": {
4534 /// "description": "Latest finish among the build's completed leases
4535 /// (null only if no lease has finished yet).",
4536 /// "type": [
4537 /// "string",
4538 /// "null"
4539 /// ],
4540 /// "format": "date-time"
4541 /// },
4542 /// "job_count": {
4543 /// "description": "Number of job leases in the build.",
4544 /// "type": "integer"
4545 /// },
4546 /// "jobs": {
4547 /// "description": "Per-job leases, oldest first.",
4548 /// "type": "array",
4549 /// "items": {
4550 /// "$ref": "#/components/schemas/UsageBreakdownJob"
4551 /// }
4552 /// },
4553 /// "pipeline_id": {
4554 /// "description": "The pipeline's id.",
4555 /// "type": [
4556 /// "string",
4557 /// "null"
4558 /// ],
4559 /// "format": "uuid"
4560 /// },
4561 /// "pipeline_name": {
4562 /// "description": "The pipeline's name.",
4563 /// "type": [
4564 /// "string",
4565 /// "null"
4566 /// ]
4567 /// },
4568 /// "pipeline_slug": {
4569 /// "description": "The pipeline's routing slug (for linking).",
4570 /// "type": [
4571 /// "string",
4572 /// "null"
4573 /// ]
4574 /// },
4575 /// "started_at": {
4576 /// "description": "Earliest lease start in the build.",
4577 /// "type": "string",
4578 /// "format": "date-time"
4579 /// },
4580 /// "total_cents": {
4581 /// "description": "Sum of this build's lease debits, in cents
4582 /// (negative).",
4583 /// "type": "integer"
4584 /// }
4585 /// }
4586 ///}
4587 /// ```
4588 /// </details>
4589 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
4590 pub struct UsageBreakdownBuild {
4591 ///The build's public external id.
4592 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4593 pub build_external_id: ::std::option::Option<::uuid::Uuid>,
4594 ///The build's id (null for leases with no build).
4595 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4596 pub build_id: ::std::option::Option<::uuid::Uuid>,
4597 ///The per-pipeline build number.
4598 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4599 pub build_number: ::std::option::Option<i64>,
4600 ///Latest finish among the build's completed leases (null only if no
4601 /// lease has finished yet).
4602 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4603 pub finished_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
4604 ///Number of job leases in the build.
4605 pub job_count: i64,
4606 ///Per-job leases, oldest first.
4607 pub jobs: ::std::vec::Vec<UsageBreakdownJob>,
4608 ///The pipeline's id.
4609 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4610 pub pipeline_id: ::std::option::Option<::uuid::Uuid>,
4611 ///The pipeline's name.
4612 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4613 pub pipeline_name: ::std::option::Option<::std::string::String>,
4614 ///The pipeline's routing slug (for linking).
4615 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4616 pub pipeline_slug: ::std::option::Option<::std::string::String>,
4617 ///Earliest lease start in the build.
4618 pub started_at: ::chrono::DateTime<::chrono::offset::Utc>,
4619 ///Sum of this build's lease debits, in cents (negative).
4620 pub total_cents: i64,
4621 }
4622
4623 ///A single job's VM lease: the VM that ran it, its shape, how long it ran,
4624 /// and what it cost.
4625 ///
4626 /// <details><summary>JSON schema</summary>
4627 ///
4628 /// ```json
4629 ///{
4630 /// "title": "UsageBreakdownJob",
4631 /// "description": "A single job's VM lease: the VM that ran it, its shape,
4632 /// how long it ran, and what it cost.",
4633 /// "type": "object",
4634 /// "required": [
4635 /// "amount_cents",
4636 /// "cpu_count",
4637 /// "disk_gb",
4638 /// "memory_gb",
4639 /// "started_at"
4640 /// ],
4641 /// "properties": {
4642 /// "amount_cents": {
4643 /// "description": "The debit for this lease, in cents (negative).",
4644 /// "type": "integer"
4645 /// },
4646 /// "cpu_count": {
4647 /// "description": "vCPUs leased.",
4648 /// "type": "integer"
4649 /// },
4650 /// "disk_gb": {
4651 /// "description": "GB of disk leased.",
4652 /// "type": "integer"
4653 /// },
4654 /// "duration_seconds": {
4655 /// "description": "Lease duration in seconds (null while still
4656 /// running).",
4657 /// "type": [
4658 /// "integer",
4659 /// "null"
4660 /// ]
4661 /// },
4662 /// "finished_at": {
4663 /// "description": "When the lease finished (null if still running).",
4664 /// "type": [
4665 /// "string",
4666 /// "null"
4667 /// ],
4668 /// "format": "date-time"
4669 /// },
4670 /// "job_id": {
4671 /// "description": "The job's id.",
4672 /// "type": [
4673 /// "string",
4674 /// "null"
4675 /// ],
4676 /// "format": "uuid"
4677 /// },
4678 /// "job_name": {
4679 /// "description": "The job's human-readable name.",
4680 /// "type": [
4681 /// "string",
4682 /// "null"
4683 /// ]
4684 /// },
4685 /// "memory_gb": {
4686 /// "description": "GB of RAM leased.",
4687 /// "type": "integer"
4688 /// },
4689 /// "started_at": {
4690 /// "description": "When the lease started.",
4691 /// "type": "string",
4692 /// "format": "date-time"
4693 /// },
4694 /// "step_key": {
4695 /// "description": "The job's DAG step key.",
4696 /// "type": [
4697 /// "string",
4698 /// "null"
4699 /// ]
4700 /// },
4701 /// "vm_handle": {
4702 /// "description": "The backend VM identifier that ran the job.",
4703 /// "type": [
4704 /// "string",
4705 /// "null"
4706 /// ]
4707 /// }
4708 /// }
4709 ///}
4710 /// ```
4711 /// </details>
4712 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
4713 pub struct UsageBreakdownJob {
4714 ///The debit for this lease, in cents (negative).
4715 pub amount_cents: i64,
4716 ///vCPUs leased.
4717 pub cpu_count: i64,
4718 ///GB of disk leased.
4719 pub disk_gb: i64,
4720 ///Lease duration in seconds (null while still running).
4721 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4722 pub duration_seconds: ::std::option::Option<i64>,
4723 ///When the lease finished (null if still running).
4724 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4725 pub finished_at: ::std::option::Option<::chrono::DateTime<::chrono::offset::Utc>>,
4726 ///The job's id.
4727 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4728 pub job_id: ::std::option::Option<::uuid::Uuid>,
4729 ///The job's human-readable name.
4730 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4731 pub job_name: ::std::option::Option<::std::string::String>,
4732 ///GB of RAM leased.
4733 pub memory_gb: i64,
4734 ///When the lease started.
4735 pub started_at: ::chrono::DateTime<::chrono::offset::Utc>,
4736 ///The job's DAG step key.
4737 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4738 pub step_key: ::std::option::Option<::std::string::String>,
4739 ///The backend VM identifier that ran the job.
4740 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4741 pub vm_handle: ::std::option::Option<::std::string::String>,
4742 }
4743
4744 ///An organization's VM usage over a window, grouped by build (newest
4745 /// first).
4746 ///
4747 /// <details><summary>JSON schema</summary>
4748 ///
4749 /// ```json
4750 ///{
4751 /// "title": "UsageBreakdownResponse",
4752 /// "description": "An organization's VM usage over a window, grouped by
4753 /// build (newest first).",
4754 /// "type": "object",
4755 /// "required": [
4756 /// "data"
4757 /// ],
4758 /// "properties": {
4759 /// "data": {
4760 /// "type": "array",
4761 /// "items": {
4762 /// "$ref": "#/components/schemas/UsageBreakdownBuild"
4763 /// }
4764 /// }
4765 /// }
4766 ///}
4767 /// ```
4768 /// </details>
4769 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
4770 pub struct UsageBreakdownResponse {
4771 pub data: ::std::vec::Vec<UsageBreakdownBuild>,
4772 }
4773
4774 ///Aggregated VM-lease usage for an organization over the requested `[from,
4775 /// to)` window: resource-seconds per dimension and the total billed cost in
4776 /// cents.
4777 ///
4778 /// <details><summary>JSON schema</summary>
4779 ///
4780 /// ```json
4781 ///{
4782 /// "title": "UsageResponse",
4783 /// "description": "Aggregated VM-lease usage for an organization over the
4784 /// requested `[from, to)` window: resource-seconds per dimension and the
4785 /// total billed cost in cents.",
4786 /// "type": "object",
4787 /// "required": [
4788 /// "cpu_seconds",
4789 /// "disk_gb_seconds",
4790 /// "memory_gb_seconds",
4791 /// "total_cents"
4792 /// ],
4793 /// "properties": {
4794 /// "cpu_seconds": {
4795 /// "description": "Σ (cpu_count × duration_seconds) over leases in the
4796 /// window.",
4797 /// "type": "integer"
4798 /// },
4799 /// "disk_gb_seconds": {
4800 /// "description": "Σ (disk_gb × duration_seconds) over leases in the
4801 /// window.",
4802 /// "type": "integer"
4803 /// },
4804 /// "memory_gb_seconds": {
4805 /// "description": "Σ (memory_gb × duration_seconds) over leases in the
4806 /// window.",
4807 /// "type": "integer"
4808 /// },
4809 /// "total_cents": {
4810 /// "description": "Σ rate-card cost of the leases in the window, in
4811 /// cents.",
4812 /// "type": "integer"
4813 /// }
4814 /// }
4815 ///}
4816 /// ```
4817 /// </details>
4818 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
4819 pub struct UsageResponse {
4820 ///Σ (cpu_count × duration_seconds) over leases in the window.
4821 pub cpu_seconds: i64,
4822 ///Σ (disk_gb × duration_seconds) over leases in the window.
4823 pub disk_gb_seconds: i64,
4824 ///Σ (memory_gb × duration_seconds) over leases in the window.
4825 pub memory_gb_seconds: i64,
4826 ///Σ rate-card cost of the leases in the window, in cents.
4827 pub total_cents: i64,
4828 }
4829
4830 ///`UsageSeriesBucket`
4831 ///
4832 /// <details><summary>JSON schema</summary>
4833 ///
4834 /// ```json
4835 ///{
4836 /// "title": "UsageSeriesBucket",
4837 /// "type": "object",
4838 /// "required": [
4839 /// "cpu_seconds",
4840 /// "date",
4841 /// "disk_gb_seconds",
4842 /// "memory_gb_seconds",
4843 /// "total_cents"
4844 /// ],
4845 /// "properties": {
4846 /// "cpu_seconds": {
4847 /// "type": "integer"
4848 /// },
4849 /// "date": {
4850 /// "description": "Bucket day (UTC).",
4851 /// "type": "string",
4852 /// "format": "date"
4853 /// },
4854 /// "disk_gb_seconds": {
4855 /// "type": "integer"
4856 /// },
4857 /// "memory_gb_seconds": {
4858 /// "type": "integer"
4859 /// },
4860 /// "total_cents": {
4861 /// "description": "Rate-card cost for the day, in cents.",
4862 /// "type": "integer"
4863 /// }
4864 /// }
4865 ///}
4866 /// ```
4867 /// </details>
4868 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
4869 pub struct UsageSeriesBucket {
4870 pub cpu_seconds: i64,
4871 ///Bucket day (UTC).
4872 pub date: ::chrono::naive::NaiveDate,
4873 pub disk_gb_seconds: i64,
4874 pub memory_gb_seconds: i64,
4875 ///Rate-card cost for the day, in cents.
4876 pub total_cents: i64,
4877 }
4878
4879 ///`UsageSeriesResponse`
4880 ///
4881 /// <details><summary>JSON schema</summary>
4882 ///
4883 /// ```json
4884 ///{
4885 /// "title": "UsageSeriesResponse",
4886 /// "type": "object",
4887 /// "required": [
4888 /// "data"
4889 /// ],
4890 /// "properties": {
4891 /// "data": {
4892 /// "type": "array",
4893 /// "items": {
4894 /// "$ref": "#/components/schemas/UsageSeriesBucket"
4895 /// }
4896 /// }
4897 /// }
4898 ///}
4899 /// ```
4900 /// </details>
4901 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
4902 pub struct UsageSeriesResponse {
4903 pub data: ::std::vec::Vec<UsageSeriesBucket>,
4904 }
4905
4906 ///The authenticated Harmont user.
4907 ///
4908 /// <details><summary>JSON schema</summary>
4909 ///
4910 /// ```json
4911 ///{
4912 /// "title": "User",
4913 /// "description": "The authenticated Harmont user.",
4914 /// "type": "object",
4915 /// "required": [
4916 /// "email",
4917 /// "uuid"
4918 /// ],
4919 /// "properties": {
4920 /// "email": {
4921 /// "description": "The user's email address.",
4922 /// "type": "string"
4923 /// },
4924 /// "name": {
4925 /// "description": "Display name.",
4926 /// "type": [
4927 /// "string",
4928 /// "null"
4929 /// ]
4930 /// },
4931 /// "uuid": {
4932 /// "description": "Stable user id.",
4933 /// "type": "string",
4934 /// "format": "uuid"
4935 /// }
4936 /// }
4937 ///}
4938 /// ```
4939 /// </details>
4940 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
4941 pub struct User {
4942 ///The user's email address.
4943 pub email: ::std::string::String,
4944 ///Display name.
4945 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
4946 pub name: ::std::option::Option<::std::string::String>,
4947 ///Stable user id.
4948 pub uuid: ::uuid::Uuid,
4949 }
4950
4951 ///Updates the current user's editable profile fields.
4952 ///
4953 /// <details><summary>JSON schema</summary>
4954 ///
4955 /// ```json
4956 ///{
4957 /// "title": "UserUpdateRequest",
4958 /// "description": "Updates the current user's editable profile fields.",
4959 /// "examples": [
4960 /// {
4961 /// "name": "Ada Lovelace"
4962 /// }
4963 /// ],
4964 /// "type": "object",
4965 /// "required": [
4966 /// "name"
4967 /// ],
4968 /// "properties": {
4969 /// "name": {
4970 /// "description": "New display name.",
4971 /// "type": "string",
4972 /// "maxLength": 255,
4973 /// "minLength": 1
4974 /// }
4975 /// }
4976 ///}
4977 /// ```
4978 /// </details>
4979 #[derive(:: serde :: Deserialize, :: serde :: Serialize, Clone, Debug)]
4980 pub struct UserUpdateRequest {
4981 ///New display name.
4982 pub name: UserUpdateRequestName,
4983 }
4984
4985 ///New display name.
4986 ///
4987 /// <details><summary>JSON schema</summary>
4988 ///
4989 /// ```json
4990 ///{
4991 /// "description": "New display name.",
4992 /// "type": "string",
4993 /// "maxLength": 255,
4994 /// "minLength": 1
4995 ///}
4996 /// ```
4997 /// </details>
4998 #[derive(:: serde :: Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
4999 #[serde(transparent)]
5000 pub struct UserUpdateRequestName(::std::string::String);
5001 impl ::std::ops::Deref for UserUpdateRequestName {
5002 type Target = ::std::string::String;
5003 fn deref(&self) -> &::std::string::String {
5004 &self.0
5005 }
5006 }
5007
5008 impl ::std::convert::From<UserUpdateRequestName> for ::std::string::String {
5009 fn from(value: UserUpdateRequestName) -> Self {
5010 value.0
5011 }
5012 }
5013
5014 impl ::std::str::FromStr for UserUpdateRequestName {
5015 type Err = self::error::ConversionError;
5016 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5017 if value.chars().count() > 255usize {
5018 return Err("longer than 255 characters".into());
5019 }
5020 if value.chars().count() < 1usize {
5021 return Err("shorter than 1 characters".into());
5022 }
5023 Ok(Self(value.to_string()))
5024 }
5025 }
5026
5027 impl ::std::convert::TryFrom<&str> for UserUpdateRequestName {
5028 type Error = self::error::ConversionError;
5029 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
5030 value.parse()
5031 }
5032 }
5033
5034 impl ::std::convert::TryFrom<&::std::string::String> for UserUpdateRequestName {
5035 type Error = self::error::ConversionError;
5036 fn try_from(
5037 value: &::std::string::String,
5038 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5039 value.parse()
5040 }
5041 }
5042
5043 impl ::std::convert::TryFrom<::std::string::String> for UserUpdateRequestName {
5044 type Error = self::error::ConversionError;
5045 fn try_from(
5046 value: ::std::string::String,
5047 ) -> ::std::result::Result<Self, self::error::ConversionError> {
5048 value.parse()
5049 }
5050 }
5051
5052 impl<'de> ::serde::Deserialize<'de> for UserUpdateRequestName {
5053 fn deserialize<D>(deserializer: D) -> ::std::result::Result<Self, D::Error>
5054 where
5055 D: ::serde::Deserializer<'de>,
5056 {
5057 ::std::string::String::deserialize(deserializer)?
5058 .parse()
5059 .map_err(|e: self::error::ConversionError| {
5060 <D::Error as ::serde::de::Error>::custom(e.to_string())
5061 })
5062 }
5063 }
5064}
5065
5066#[derive(Clone, Debug)]
5067///Client for Harmont API
5068///
5069///Harmont's user-facing REST authentication API.
5070///
5071///Version: 0
5072pub struct Client {
5073 pub(crate) baseurl: String,
5074 pub(crate) client: reqwest::Client,
5075}
5076
5077impl Client {
5078 /// Create a new client.
5079 ///
5080 /// `baseurl` is the base URL provided to the internal
5081 /// `reqwest::Client`, and should include a scheme and hostname,
5082 /// as well as port and a path stem if applicable.
5083 pub fn new(baseurl: &str) -> Self {
5084 #[cfg(not(target_arch = "wasm32"))]
5085 let client = {
5086 let dur = ::std::time::Duration::from_secs(15u64);
5087 reqwest::ClientBuilder::new()
5088 .connect_timeout(dur)
5089 .timeout(dur)
5090 };
5091 #[cfg(target_arch = "wasm32")]
5092 let client = reqwest::ClientBuilder::new();
5093 Self::new_with_client(baseurl, client.build().unwrap())
5094 }
5095
5096 /// Construct a new client with an existing `reqwest::Client`,
5097 /// allowing more control over its configuration.
5098 ///
5099 /// `baseurl` is the base URL provided to the internal
5100 /// `reqwest::Client`, and should include a scheme and hostname,
5101 /// as well as port and a path stem if applicable.
5102 pub fn new_with_client(baseurl: &str, client: reqwest::Client) -> Self {
5103 Self {
5104 baseurl: baseurl.to_string(),
5105 client,
5106 }
5107 }
5108}
5109
5110impl ClientInfo<()> for Client {
5111 fn api_version() -> &'static str {
5112 "0"
5113 }
5114
5115 fn baseurl(&self) -> &str {
5116 self.baseurl.as_str()
5117 }
5118
5119 fn client(&self) -> &reqwest::Client {
5120 &self.client
5121 }
5122
5123 fn inner(&self) -> &() {
5124 &()
5125 }
5126}
5127
5128impl ClientHooks<()> for &Client {}
5129#[allow(clippy::all)]
5130impl Client {
5131 ///Revoke a pending invite
5132 ///
5133 ///Sends a `DELETE` request to `/api/v0/organizations/{org}/invites/{id}`
5134 ///
5135 ///Arguments:
5136 /// - `org`:
5137 /// - `id`:
5138 pub async fn revoke_invite<'a>(
5139 &'a self,
5140 org: &'a str,
5141 id: &'a str,
5142 ) -> Result<ResponseValue<()>, Error<()>> {
5143 let url = format!(
5144 "{}/api/v0/organizations/{}/invites/{}",
5145 self.baseurl,
5146 encode_path(&org.to_string()),
5147 encode_path(&id.to_string()),
5148 );
5149 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
5150 header_map.append(
5151 ::reqwest::header::HeaderName::from_static("api-version"),
5152 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
5153 );
5154 #[allow(unused_mut)]
5155 let mut request = self.client.delete(url).headers(header_map).build()?;
5156 let info = OperationInfo {
5157 operation_id: "revoke_invite",
5158 };
5159 self.pre(&mut request, &info).await?;
5160 let result = self.exec(request, &info).await;
5161 self.post(&result, &info).await?;
5162 let response = result?;
5163 match response.status().as_u16() {
5164 204u16 => Ok(ResponseValue::empty(response)),
5165 _ => Err(Error::UnexpectedResponse(response)),
5166 }
5167 }
5168
5169 ///Finalize account recovery
5170 ///
5171 ///Consumes the magic link + challenge, registers a fresh passkey, and
5172 /// returns a session token.
5173 ///
5174 ///Sends a `POST` request to `/api/v0/auth/recover/finalize`
5175 ///
5176 ///Arguments:
5177 /// - `body`: Finalize request
5178 pub async fn recover_finalize<'a>(
5179 &'a self,
5180 body: &'a types::RecoverFinalizeRequest,
5181 ) -> Result<ResponseValue<types::AuthTokenResponse>, Error<types::Error>> {
5182 let url = format!("{}/api/v0/auth/recover/finalize", self.baseurl,);
5183 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
5184 header_map.append(
5185 ::reqwest::header::HeaderName::from_static("api-version"),
5186 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
5187 );
5188 #[allow(unused_mut)]
5189 let mut request = self
5190 .client
5191 .post(url)
5192 .header(
5193 ::reqwest::header::ACCEPT,
5194 ::reqwest::header::HeaderValue::from_static("application/json"),
5195 )
5196 .json(&body)
5197 .headers(header_map)
5198 .build()?;
5199 let info = OperationInfo {
5200 operation_id: "recover_finalize",
5201 };
5202 self.pre(&mut request, &info).await?;
5203 let result = self.exec(request, &info).await;
5204 self.post(&result, &info).await?;
5205 let response = result?;
5206 match response.status().as_u16() {
5207 200u16 => ResponseValue::from_response(response).await,
5208 400u16 => Err(Error::ErrorResponse(
5209 ResponseValue::from_response(response).await?,
5210 )),
5211 _ => Err(Error::UnexpectedResponse(response)),
5212 }
5213 }
5214
5215 ///Disconnect a GitHub installation from the organization
5216 ///
5217 ///Unbinds the installation (by GitHub numeric id) from this organization.
5218 /// Idempotent: a 204 is returned whether or not the installation was bound
5219 /// to this organization.
5220 ///
5221 ///Sends a `DELETE` request to
5222 /// `/api/v0/organizations/{org}/github/installations/{id}`
5223 ///
5224 ///Arguments:
5225 /// - `org`: The organization slug.
5226 /// - `id`: The GitHub numeric installation id.
5227 pub async fn disconnect_github_installation<'a>(
5228 &'a self,
5229 org: &'a str,
5230 id: i64,
5231 ) -> Result<ResponseValue<()>, Error<types::Error>> {
5232 let url = format!(
5233 "{}/api/v0/organizations/{}/github/installations/{}",
5234 self.baseurl,
5235 encode_path(&org.to_string()),
5236 encode_path(&id.to_string()),
5237 );
5238 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
5239 header_map.append(
5240 ::reqwest::header::HeaderName::from_static("api-version"),
5241 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
5242 );
5243 #[allow(unused_mut)]
5244 let mut request = self
5245 .client
5246 .delete(url)
5247 .header(
5248 ::reqwest::header::ACCEPT,
5249 ::reqwest::header::HeaderValue::from_static("application/json"),
5250 )
5251 .headers(header_map)
5252 .build()?;
5253 let info = OperationInfo {
5254 operation_id: "disconnect_github_installation",
5255 };
5256 self.pre(&mut request, &info).await?;
5257 let result = self.exec(request, &info).await;
5258 self.post(&result, &info).await?;
5259 let response = result?;
5260 match response.status().as_u16() {
5261 204u16 => Ok(ResponseValue::empty(response)),
5262 404u16 => Err(Error::ErrorResponse(
5263 ResponseValue::from_response(response).await?,
5264 )),
5265 _ => Err(Error::UnexpectedResponse(response)),
5266 }
5267 }
5268
5269 ///List repositories for a connected workspace
5270 ///
5271 ///Returns the synced repositories for one Bitbucket workspace, scoped to
5272 /// this organization. A workspace owned by another organization (or
5273 /// unknown) yields 404.
5274 ///
5275 ///Sends a `GET` request to
5276 /// `/api/v0/organizations/{org}/bitbucket/workspaces/{id}/repos`
5277 ///
5278 ///Arguments:
5279 /// - `org`: The organization slug.
5280 /// - `id`: The Bitbucket workspace slug.
5281 pub async fn list_bitbucket_repos<'a>(
5282 &'a self,
5283 org: &'a str,
5284 id: &'a str,
5285 ) -> Result<ResponseValue<types::BitbucketRepoList>, Error<types::Error>> {
5286 let url = format!(
5287 "{}/api/v0/organizations/{}/bitbucket/workspaces/{}/repos",
5288 self.baseurl,
5289 encode_path(&org.to_string()),
5290 encode_path(&id.to_string()),
5291 );
5292 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
5293 header_map.append(
5294 ::reqwest::header::HeaderName::from_static("api-version"),
5295 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
5296 );
5297 #[allow(unused_mut)]
5298 let mut request = self
5299 .client
5300 .get(url)
5301 .header(
5302 ::reqwest::header::ACCEPT,
5303 ::reqwest::header::HeaderValue::from_static("application/json"),
5304 )
5305 .headers(header_map)
5306 .build()?;
5307 let info = OperationInfo {
5308 operation_id: "list_bitbucket_repos",
5309 };
5310 self.pre(&mut request, &info).await?;
5311 let result = self.exec(request, &info).await;
5312 self.post(&result, &info).await?;
5313 let response = result?;
5314 match response.status().as_u16() {
5315 200u16 => ResponseValue::from_response(response).await,
5316 404u16 => Err(Error::ErrorResponse(
5317 ResponseValue::from_response(response).await?,
5318 )),
5319 _ => Err(Error::UnexpectedResponse(response)),
5320 }
5321 }
5322
5323 ///Connect Bitbucket workspaces to the organization
5324 ///
5325 ///Completes the OAuth callback from the static `/bitbucket/setup` page.
5326 /// Recovers the org from the signed `state`, re-checks membership,
5327 /// exchanges the authorization `code`, binds every workspace the token can
5328 /// access to that org (skipping any already connected to a different org),
5329 /// and syncs their repositories. The response carries the org slug so the
5330 /// SPA can navigate to the org-scoped repos view. Yields 403 when the state
5331 /// is missing/expired/forged or the org is no longer the user's; 409 when
5332 /// every accessible workspace is already connected to another org; 502 if
5333 /// the OAuth exchange fails upstream.
5334 ///
5335 ///Sends a `POST` request to `/api/v0/integrations/bitbucket/connect`
5336 ///
5337 ///Arguments:
5338 /// - `body`: The OAuth callback payload
5339 pub async fn connect_bitbucket<'a>(
5340 &'a self,
5341 body: &'a types::ConnectBitbucketRequest,
5342 ) -> Result<ResponseValue<types::ConnectBitbucketResponse>, Error<types::Error>> {
5343 let url = format!("{}/api/v0/integrations/bitbucket/connect", self.baseurl,);
5344 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
5345 header_map.append(
5346 ::reqwest::header::HeaderName::from_static("api-version"),
5347 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
5348 );
5349 #[allow(unused_mut)]
5350 let mut request = self
5351 .client
5352 .post(url)
5353 .header(
5354 ::reqwest::header::ACCEPT,
5355 ::reqwest::header::HeaderValue::from_static("application/json"),
5356 )
5357 .json(&body)
5358 .headers(header_map)
5359 .build()?;
5360 let info = OperationInfo {
5361 operation_id: "connect_bitbucket",
5362 };
5363 self.pre(&mut request, &info).await?;
5364 let result = self.exec(request, &info).await;
5365 self.post(&result, &info).await?;
5366 let response = result?;
5367 match response.status().as_u16() {
5368 201u16 => ResponseValue::from_response(response).await,
5369 403u16 => Err(Error::ErrorResponse(
5370 ResponseValue::from_response(response).await?,
5371 )),
5372 409u16 => Err(Error::ErrorResponse(
5373 ResponseValue::from_response(response).await?,
5374 )),
5375 502u16 => Err(Error::ErrorResponse(
5376 ResponseValue::from_response(response).await?,
5377 )),
5378 _ => Err(Error::UnexpectedResponse(response)),
5379 }
5380 }
5381
5382 ///Claim a transferred session token (CLI loopback poll)
5383 ///
5384 ///The CLI polls with the nonce it generated; on a match within the 60s
5385 /// window it receives the raw session token (single-use).
5386 ///
5387 ///Sends a `POST` request to `/api/v0/auth/cli/claim`
5388 ///
5389 ///Arguments:
5390 /// - `body`: Claim request
5391 pub async fn cli_claim<'a>(
5392 &'a self,
5393 body: &'a types::CliClaimRequest,
5394 ) -> Result<ResponseValue<types::CliTokenResponse>, Error<types::Error>> {
5395 let url = format!("{}/api/v0/auth/cli/claim", self.baseurl,);
5396 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
5397 header_map.append(
5398 ::reqwest::header::HeaderName::from_static("api-version"),
5399 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
5400 );
5401 #[allow(unused_mut)]
5402 let mut request = self
5403 .client
5404 .post(url)
5405 .header(
5406 ::reqwest::header::ACCEPT,
5407 ::reqwest::header::HeaderValue::from_static("application/json"),
5408 )
5409 .json(&body)
5410 .headers(header_map)
5411 .build()?;
5412 let info = OperationInfo {
5413 operation_id: "cli_claim",
5414 };
5415 self.pre(&mut request, &info).await?;
5416 let result = self.exec(request, &info).await;
5417 self.post(&result, &info).await?;
5418 let response = result?;
5419 match response.status().as_u16() {
5420 200u16 => ResponseValue::from_response(response).await,
5421 400u16 => Err(Error::ErrorResponse(
5422 ResponseValue::from_response(response).await?,
5423 )),
5424 _ => Err(Error::UnexpectedResponse(response)),
5425 }
5426 }
5427
5428 ///List the organization's repositories across all providers
5429 ///
5430 ///Returns every repository visible to the organization, regardless of VCS
5431 /// provider, grouped by canonical clone URL. Each row lists every channel
5432 /// the repo is registered through in `registrations`.
5433 ///
5434 ///Sends a `GET` request to `/api/v0/organizations/{org}/repos`
5435 ///
5436 ///Arguments:
5437 /// - `org`: The organization slug.
5438 pub async fn list_org_repos<'a>(
5439 &'a self,
5440 org: &'a str,
5441 ) -> Result<ResponseValue<types::RepoSummaryList>, Error<types::Error>> {
5442 let url = format!(
5443 "{}/api/v0/organizations/{}/repos",
5444 self.baseurl,
5445 encode_path(&org.to_string()),
5446 );
5447 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
5448 header_map.append(
5449 ::reqwest::header::HeaderName::from_static("api-version"),
5450 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
5451 );
5452 #[allow(unused_mut)]
5453 let mut request = self
5454 .client
5455 .get(url)
5456 .header(
5457 ::reqwest::header::ACCEPT,
5458 ::reqwest::header::HeaderValue::from_static("application/json"),
5459 )
5460 .headers(header_map)
5461 .build()?;
5462 let info = OperationInfo {
5463 operation_id: "list_org_repos",
5464 };
5465 self.pre(&mut request, &info).await?;
5466 let result = self.exec(request, &info).await;
5467 self.post(&result, &info).await?;
5468 let response = result?;
5469 match response.status().as_u16() {
5470 200u16 => ResponseValue::from_response(response).await,
5471 404u16 => Err(Error::ErrorResponse(
5472 ResponseValue::from_response(response).await?,
5473 )),
5474 _ => Err(Error::UnexpectedResponse(response)),
5475 }
5476 }
5477
5478 ///List a build's jobs
5479 ///
5480 ///Returns the build's jobs in DAG creation order.
5481 ///
5482 ///Sends a `GET` request to
5483 /// `/api/v0/organizations/{org}/pipelines/{pipeline}/builds/{number}/jobs`
5484 ///
5485 ///Arguments:
5486 /// - `org`: The organization slug.
5487 /// - `pipeline`: The pipeline slug.
5488 /// - `number`: The build number.
5489 pub async fn list_jobs<'a>(
5490 &'a self,
5491 org: &'a str,
5492 pipeline: &'a str,
5493 number: i64,
5494 ) -> Result<ResponseValue<types::JobList>, Error<types::Error>> {
5495 let url = format!(
5496 "{}/api/v0/organizations/{}/pipelines/{}/builds/{}/jobs",
5497 self.baseurl,
5498 encode_path(&org.to_string()),
5499 encode_path(&pipeline.to_string()),
5500 encode_path(&number.to_string()),
5501 );
5502 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
5503 header_map.append(
5504 ::reqwest::header::HeaderName::from_static("api-version"),
5505 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
5506 );
5507 #[allow(unused_mut)]
5508 let mut request = self
5509 .client
5510 .get(url)
5511 .header(
5512 ::reqwest::header::ACCEPT,
5513 ::reqwest::header::HeaderValue::from_static("application/json"),
5514 )
5515 .headers(header_map)
5516 .build()?;
5517 let info = OperationInfo {
5518 operation_id: "list_jobs",
5519 };
5520 self.pre(&mut request, &info).await?;
5521 let result = self.exec(request, &info).await;
5522 self.post(&result, &info).await?;
5523 let response = result?;
5524 match response.status().as_u16() {
5525 200u16 => ResponseValue::from_response(response).await,
5526 404u16 => Err(Error::ErrorResponse(
5527 ResponseValue::from_response(response).await?,
5528 )),
5529 _ => Err(Error::UnexpectedResponse(response)),
5530 }
5531 }
5532
5533 ///List the current user's passkeys
5534 ///
5535 ///Sends a `GET` request to `/api/v0/user/passkeys`
5536 pub async fn list_passkeys<'a>(
5537 &'a self,
5538 ) -> Result<ResponseValue<types::PasskeyListResponse>, Error<()>> {
5539 let url = format!("{}/api/v0/user/passkeys", self.baseurl,);
5540 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
5541 header_map.append(
5542 ::reqwest::header::HeaderName::from_static("api-version"),
5543 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
5544 );
5545 #[allow(unused_mut)]
5546 let mut request = self
5547 .client
5548 .get(url)
5549 .header(
5550 ::reqwest::header::ACCEPT,
5551 ::reqwest::header::HeaderValue::from_static("application/json"),
5552 )
5553 .headers(header_map)
5554 .build()?;
5555 let info = OperationInfo {
5556 operation_id: "list_passkeys",
5557 };
5558 self.pre(&mut request, &info).await?;
5559 let result = self.exec(request, &info).await;
5560 self.post(&result, &info).await?;
5561 let response = result?;
5562 match response.status().as_u16() {
5563 200u16 => ResponseValue::from_response(response).await,
5564 _ => Err(Error::UnexpectedResponse(response)),
5565 }
5566 }
5567
5568 ///Finalize passkey login
5569 ///
5570 ///Verifies the assertion against the resolved credential, advances the
5571 /// sign-counter, and returns a session token.
5572 ///
5573 ///Sends a `POST` request to `/api/v0/auth/passkey/login/finalize`
5574 ///
5575 ///Arguments:
5576 /// - `body`: Login finalize request
5577 pub async fn passkey_login_finalize<'a>(
5578 &'a self,
5579 body: &'a types::PasskeyLoginFinalizeRequest,
5580 ) -> Result<ResponseValue<types::TokenResponse>, Error<types::Error>> {
5581 let url = format!("{}/api/v0/auth/passkey/login/finalize", self.baseurl,);
5582 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
5583 header_map.append(
5584 ::reqwest::header::HeaderName::from_static("api-version"),
5585 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
5586 );
5587 #[allow(unused_mut)]
5588 let mut request = self
5589 .client
5590 .post(url)
5591 .header(
5592 ::reqwest::header::ACCEPT,
5593 ::reqwest::header::HeaderValue::from_static("application/json"),
5594 )
5595 .json(&body)
5596 .headers(header_map)
5597 .build()?;
5598 let info = OperationInfo {
5599 operation_id: "passkey_login_finalize",
5600 };
5601 self.pre(&mut request, &info).await?;
5602 let result = self.exec(request, &info).await;
5603 self.post(&result, &info).await?;
5604 let response = result?;
5605 match response.status().as_u16() {
5606 200u16 => ResponseValue::from_response(response).await,
5607 400u16 => Err(Error::ErrorResponse(
5608 ResponseValue::from_response(response).await?,
5609 )),
5610 _ => Err(Error::UnexpectedResponse(response)),
5611 }
5612 }
5613
5614 ///Serve a build's source archive (runner-token auth)
5615 ///
5616 ///Streams the gzipped source tarball uploaded for a build to the in-VM
5617 /// sandbox/agent. Authenticated with the build's runner token via
5618 /// `Authorization: Bearer <runner_token>` (NOT a session bearer token); the
5619 /// token is validated against the build's stored hash with a constant-time
5620 /// compare and is NOT consumed.
5621 ///
5622 ///Sends a `GET` request to
5623 /// `/api/v0/internal/builds/{build_uuid}/source.tar.gz`
5624 ///
5625 ///Arguments:
5626 /// - `build_uuid`: The build's external id (UUID).
5627 pub async fn get_build_source<'a>(
5628 &'a self,
5629 build_uuid: &'a str,
5630 ) -> Result<ResponseValue<ByteStream>, Error<types::Error>> {
5631 let url = format!(
5632 "{}/api/v0/internal/builds/{}/source.tar.gz",
5633 self.baseurl,
5634 encode_path(&build_uuid.to_string()),
5635 );
5636 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
5637 header_map.append(
5638 ::reqwest::header::HeaderName::from_static("api-version"),
5639 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
5640 );
5641 #[allow(unused_mut)]
5642 let mut request = self.client.get(url).headers(header_map).build()?;
5643 let info = OperationInfo {
5644 operation_id: "get_build_source",
5645 };
5646 self.pre(&mut request, &info).await?;
5647 let result = self.exec(request, &info).await;
5648 self.post(&result, &info).await?;
5649 let response = result?;
5650 match response.status().as_u16() {
5651 200u16 => Ok(ResponseValue::stream(response)),
5652 401u16 => Err(Error::ErrorResponse(
5653 ResponseValue::from_response(response).await?,
5654 )),
5655 404u16 => Err(Error::ErrorResponse(
5656 ResponseValue::from_response(response).await?,
5657 )),
5658 _ => Err(Error::UnexpectedResponse(response)),
5659 }
5660 }
5661
5662 ///Sign in with GitHub
5663 ///
5664 ///Exchanges a GitHub authorization code for a Harmont session token,
5665 /// creating the user and their personal org on first sign-in.
5666 ///
5667 ///Sends a `POST` request to `/api/v0/auth/github`
5668 ///
5669 ///Arguments:
5670 /// - `body`: GitHub OAuth callback
5671 pub async fn auth_github<'a>(
5672 &'a self,
5673 body: &'a types::AuthGithubRequest,
5674 ) -> Result<ResponseValue<types::AuthTokenResponse>, Error<types::Error>> {
5675 let url = format!("{}/api/v0/auth/github", self.baseurl,);
5676 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
5677 header_map.append(
5678 ::reqwest::header::HeaderName::from_static("api-version"),
5679 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
5680 );
5681 #[allow(unused_mut)]
5682 let mut request = self
5683 .client
5684 .post(url)
5685 .header(
5686 ::reqwest::header::ACCEPT,
5687 ::reqwest::header::HeaderValue::from_static("application/json"),
5688 )
5689 .json(&body)
5690 .headers(header_map)
5691 .build()?;
5692 let info = OperationInfo {
5693 operation_id: "auth_github",
5694 };
5695 self.pre(&mut request, &info).await?;
5696 let result = self.exec(request, &info).await;
5697 self.post(&result, &info).await?;
5698 let response = result?;
5699 match response.status().as_u16() {
5700 200u16 => ResponseValue::from_response(response).await,
5701 500u16 => Err(Error::ErrorResponse(
5702 ResponseValue::from_response(response).await?,
5703 )),
5704 502u16 => Err(Error::ErrorResponse(
5705 ResponseValue::from_response(response).await?,
5706 )),
5707 503u16 => Err(Error::ErrorResponse(
5708 ResponseValue::from_response(response).await?,
5709 )),
5710 _ => Err(Error::UnexpectedResponse(response)),
5711 }
5712 }
5713
5714 ///Log out (revoke the current bearer token)
5715 ///
5716 ///Revokes the bearer token used for this request. The token can no longer
5717 /// be used to authenticate. Idempotent.
5718 ///
5719 ///Sends a `POST` request to `/api/v0/auth/logout`
5720 pub async fn logout<'a>(&'a self) -> Result<ResponseValue<()>, Error<()>> {
5721 let url = format!("{}/api/v0/auth/logout", self.baseurl,);
5722 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
5723 header_map.append(
5724 ::reqwest::header::HeaderName::from_static("api-version"),
5725 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
5726 );
5727 #[allow(unused_mut)]
5728 let mut request = self.client.post(url).headers(header_map).build()?;
5729 let info = OperationInfo {
5730 operation_id: "logout",
5731 };
5732 self.pre(&mut request, &info).await?;
5733 let result = self.exec(request, &info).await;
5734 self.post(&result, &info).await?;
5735 let response = result?;
5736 match response.status().as_u16() {
5737 204u16 => Ok(ResponseValue::empty(response)),
5738 _ => Err(Error::UnexpectedResponse(response)),
5739 }
5740 }
5741
5742 ///Disconnect a Bitbucket workspace from the organization
5743 ///
5744 ///Tombstones the workspace's installation for this organization. A
5745 /// workspace owned by another organization (or unknown) yields 404.
5746 ///
5747 ///Sends a `DELETE` request to
5748 /// `/api/v0/organizations/{org}/bitbucket/workspaces/{id}`
5749 ///
5750 ///Arguments:
5751 /// - `org`: The organization slug.
5752 /// - `id`: The Bitbucket workspace slug.
5753 pub async fn disconnect_bitbucket<'a>(
5754 &'a self,
5755 org: &'a str,
5756 id: &'a str,
5757 ) -> Result<ResponseValue<()>, Error<types::Error>> {
5758 let url = format!(
5759 "{}/api/v0/organizations/{}/bitbucket/workspaces/{}",
5760 self.baseurl,
5761 encode_path(&org.to_string()),
5762 encode_path(&id.to_string()),
5763 );
5764 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
5765 header_map.append(
5766 ::reqwest::header::HeaderName::from_static("api-version"),
5767 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
5768 );
5769 #[allow(unused_mut)]
5770 let mut request = self
5771 .client
5772 .delete(url)
5773 .header(
5774 ::reqwest::header::ACCEPT,
5775 ::reqwest::header::HeaderValue::from_static("application/json"),
5776 )
5777 .headers(header_map)
5778 .build()?;
5779 let info = OperationInfo {
5780 operation_id: "disconnect_bitbucket",
5781 };
5782 self.pre(&mut request, &info).await?;
5783 let result = self.exec(request, &info).await;
5784 self.post(&result, &info).await?;
5785 let response = result?;
5786 match response.status().as_u16() {
5787 204u16 => Ok(ResponseValue::empty(response)),
5788 404u16 => Err(Error::ErrorResponse(
5789 ResponseValue::from_response(response).await?,
5790 )),
5791 _ => Err(Error::UnexpectedResponse(response)),
5792 }
5793 }
5794
5795 ///List repositories for a connected installation
5796 ///
5797 ///Returns the mirrored repositories for one installation, scoped to this
5798 /// organization. An installation bound to another organization (or unknown)
5799 /// yields an empty list.
5800 ///
5801 ///Sends a `GET` request to
5802 /// `/api/v0/organizations/{org}/github/installations/{id}/repos`
5803 ///
5804 ///Arguments:
5805 /// - `org`: The organization slug.
5806 /// - `id`: The GitHub numeric installation id.
5807 pub async fn list_github_installation_repos<'a>(
5808 &'a self,
5809 org: &'a str,
5810 id: i64,
5811 ) -> Result<ResponseValue<types::GithubRepoList>, Error<types::Error>> {
5812 let url = format!(
5813 "{}/api/v0/organizations/{}/github/installations/{}/repos",
5814 self.baseurl,
5815 encode_path(&org.to_string()),
5816 encode_path(&id.to_string()),
5817 );
5818 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
5819 header_map.append(
5820 ::reqwest::header::HeaderName::from_static("api-version"),
5821 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
5822 );
5823 #[allow(unused_mut)]
5824 let mut request = self
5825 .client
5826 .get(url)
5827 .header(
5828 ::reqwest::header::ACCEPT,
5829 ::reqwest::header::HeaderValue::from_static("application/json"),
5830 )
5831 .headers(header_map)
5832 .build()?;
5833 let info = OperationInfo {
5834 operation_id: "list_github_installation_repos",
5835 };
5836 self.pre(&mut request, &info).await?;
5837 let result = self.exec(request, &info).await;
5838 self.post(&result, &info).await?;
5839 let response = result?;
5840 match response.status().as_u16() {
5841 200u16 => ResponseValue::from_response(response).await,
5842 404u16 => Err(Error::ErrorResponse(
5843 ResponseValue::from_response(response).await?,
5844 )),
5845 _ => Err(Error::UnexpectedResponse(response)),
5846 }
5847 }
5848
5849 ///List connected GitHub installations
5850 ///
5851 ///Returns the organization's connected, non-deleted GitHub App
5852 /// installations.
5853 ///
5854 ///Sends a `GET` request to
5855 /// `/api/v0/organizations/{org}/github/installations`
5856 ///
5857 ///Arguments:
5858 /// - `org`: The organization slug.
5859 pub async fn list_github_installations<'a>(
5860 &'a self,
5861 org: &'a str,
5862 ) -> Result<ResponseValue<types::GithubInstallationList>, Error<types::Error>> {
5863 let url = format!(
5864 "{}/api/v0/organizations/{}/github/installations",
5865 self.baseurl,
5866 encode_path(&org.to_string()),
5867 );
5868 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
5869 header_map.append(
5870 ::reqwest::header::HeaderName::from_static("api-version"),
5871 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
5872 );
5873 #[allow(unused_mut)]
5874 let mut request = self
5875 .client
5876 .get(url)
5877 .header(
5878 ::reqwest::header::ACCEPT,
5879 ::reqwest::header::HeaderValue::from_static("application/json"),
5880 )
5881 .headers(header_map)
5882 .build()?;
5883 let info = OperationInfo {
5884 operation_id: "list_github_installations",
5885 };
5886 self.pre(&mut request, &info).await?;
5887 let result = self.exec(request, &info).await;
5888 self.post(&result, &info).await?;
5889 let response = result?;
5890 match response.status().as_u16() {
5891 200u16 => ResponseValue::from_response(response).await,
5892 404u16 => Err(Error::ErrorResponse(
5893 ResponseValue::from_response(response).await?,
5894 )),
5895 _ => Err(Error::UnexpectedResponse(response)),
5896 }
5897 }
5898
5899 ///Connect a GitHub installation to the organization
5900 ///
5901 ///Binds an existing GitHub App installation (by GitHub numeric id) to this
5902 /// organization. The installation must already be mirrored from a prior
5903 /// `installation.created` webhook. Binding an installation that is
5904 /// connected to a different organization yields 409; an unknown
5905 /// installation yields 404.
5906 ///
5907 ///Sends a `POST` request to
5908 /// `/api/v0/organizations/{org}/github/installations`
5909 ///
5910 ///Arguments:
5911 /// - `org`: The organization slug.
5912 /// - `body`: The GitHub installation to connect
5913 pub async fn connect_github_installation<'a>(
5914 &'a self,
5915 org: &'a str,
5916 body: &'a types::ConnectInstallationRequest,
5917 ) -> Result<ResponseValue<types::GithubInstallation>, Error<types::Error>> {
5918 let url = format!(
5919 "{}/api/v0/organizations/{}/github/installations",
5920 self.baseurl,
5921 encode_path(&org.to_string()),
5922 );
5923 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
5924 header_map.append(
5925 ::reqwest::header::HeaderName::from_static("api-version"),
5926 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
5927 );
5928 #[allow(unused_mut)]
5929 let mut request = self
5930 .client
5931 .post(url)
5932 .header(
5933 ::reqwest::header::ACCEPT,
5934 ::reqwest::header::HeaderValue::from_static("application/json"),
5935 )
5936 .json(&body)
5937 .headers(header_map)
5938 .build()?;
5939 let info = OperationInfo {
5940 operation_id: "connect_github_installation",
5941 };
5942 self.pre(&mut request, &info).await?;
5943 let result = self.exec(request, &info).await;
5944 self.post(&result, &info).await?;
5945 let response = result?;
5946 match response.status().as_u16() {
5947 201u16 => ResponseValue::from_response(response).await,
5948 404u16 => Err(Error::ErrorResponse(
5949 ResponseValue::from_response(response).await?,
5950 )),
5951 409u16 => Err(Error::ErrorResponse(
5952 ResponseValue::from_response(response).await?,
5953 )),
5954 422u16 => Err(Error::ErrorResponse(
5955 ResponseValue::from_response(response).await?,
5956 )),
5957 _ => Err(Error::UnexpectedResponse(response)),
5958 }
5959 }
5960
5961 ///Get passkey sign-up creation options
5962 ///
5963 ///Validates the verification token and returns WebAuthn
5964 /// credential-creation options plus the server-side challenge id to echo
5965 /// back on finalize.
5966 ///
5967 ///Sends a `POST` request to `/api/v0/auth/passkey/signup/options`
5968 ///
5969 ///Arguments:
5970 /// - `body`: Options request
5971 pub async fn passkey_signup_options<'a>(
5972 &'a self,
5973 body: &'a types::PasskeySignupOptionsRequest,
5974 ) -> Result<ResponseValue<types::PasskeyChallengeResponse>, Error<types::Error>> {
5975 let url = format!("{}/api/v0/auth/passkey/signup/options", self.baseurl,);
5976 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
5977 header_map.append(
5978 ::reqwest::header::HeaderName::from_static("api-version"),
5979 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
5980 );
5981 #[allow(unused_mut)]
5982 let mut request = self
5983 .client
5984 .post(url)
5985 .header(
5986 ::reqwest::header::ACCEPT,
5987 ::reqwest::header::HeaderValue::from_static("application/json"),
5988 )
5989 .json(&body)
5990 .headers(header_map)
5991 .build()?;
5992 let info = OperationInfo {
5993 operation_id: "passkey_signup_options",
5994 };
5995 self.pre(&mut request, &info).await?;
5996 let result = self.exec(request, &info).await;
5997 self.post(&result, &info).await?;
5998 let response = result?;
5999 match response.status().as_u16() {
6000 200u16 => ResponseValue::from_response(response).await,
6001 400u16 => Err(Error::ErrorResponse(
6002 ResponseValue::from_response(response).await?,
6003 )),
6004 _ => Err(Error::UnexpectedResponse(response)),
6005 }
6006 }
6007
6008 ///List organization members
6009 ///
6010 ///Sends a `GET` request to `/api/v0/organizations/{org}/members`
6011 ///
6012 ///Arguments:
6013 /// - `org`:
6014 pub async fn list_org_members<'a>(
6015 &'a self,
6016 org: &'a str,
6017 ) -> Result<ResponseValue<types::OrgMemberList>, Error<types::Error>> {
6018 let url = format!(
6019 "{}/api/v0/organizations/{}/members",
6020 self.baseurl,
6021 encode_path(&org.to_string()),
6022 );
6023 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6024 header_map.append(
6025 ::reqwest::header::HeaderName::from_static("api-version"),
6026 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6027 );
6028 #[allow(unused_mut)]
6029 let mut request = self
6030 .client
6031 .get(url)
6032 .header(
6033 ::reqwest::header::ACCEPT,
6034 ::reqwest::header::HeaderValue::from_static("application/json"),
6035 )
6036 .headers(header_map)
6037 .build()?;
6038 let info = OperationInfo {
6039 operation_id: "list_org_members",
6040 };
6041 self.pre(&mut request, &info).await?;
6042 let result = self.exec(request, &info).await;
6043 self.post(&result, &info).await?;
6044 let response = result?;
6045 match response.status().as_u16() {
6046 200u16 => ResponseValue::from_response(response).await,
6047 404u16 => Err(Error::ErrorResponse(
6048 ResponseValue::from_response(response).await?,
6049 )),
6050 _ => Err(Error::UnexpectedResponse(response)),
6051 }
6052 }
6053
6054 ///Accept an invite
6055 ///
6056 ///Sends a `POST` request to `/api/v0/invites/accept`
6057 ///
6058 ///Arguments:
6059 /// - `body`: Token
6060 pub async fn accept_invite<'a>(
6061 &'a self,
6062 body: &'a types::AcceptInviteRequest,
6063 ) -> Result<ResponseValue<types::Organization>, Error<types::Error>> {
6064 let url = format!("{}/api/v0/invites/accept", self.baseurl,);
6065 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6066 header_map.append(
6067 ::reqwest::header::HeaderName::from_static("api-version"),
6068 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6069 );
6070 #[allow(unused_mut)]
6071 let mut request = self
6072 .client
6073 .post(url)
6074 .header(
6075 ::reqwest::header::ACCEPT,
6076 ::reqwest::header::HeaderValue::from_static("application/json"),
6077 )
6078 .json(&body)
6079 .headers(header_map)
6080 .build()?;
6081 let info = OperationInfo {
6082 operation_id: "accept_invite",
6083 };
6084 self.pre(&mut request, &info).await?;
6085 let result = self.exec(request, &info).await;
6086 self.post(&result, &info).await?;
6087 let response = result?;
6088 match response.status().as_u16() {
6089 200u16 => ResponseValue::from_response(response).await,
6090 422u16 => Err(Error::ErrorResponse(
6091 ResponseValue::from_response(response).await?,
6092 )),
6093 _ => Err(Error::UnexpectedResponse(response)),
6094 }
6095 }
6096
6097 ///Get options to add a passkey
6098 ///
6099 ///Returns WebAuthn credential-creation options for the current user,
6100 /// excluding their already-registered credentials, plus the challenge id.
6101 ///
6102 ///Sends a `POST` request to `/api/v0/auth/passkey/register/options`
6103 pub async fn passkey_register_options<'a>(
6104 &'a self,
6105 ) -> Result<ResponseValue<types::PasskeyRegisterOptionsResponse>, Error<types::Error>> {
6106 let url = format!("{}/api/v0/auth/passkey/register/options", self.baseurl,);
6107 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6108 header_map.append(
6109 ::reqwest::header::HeaderName::from_static("api-version"),
6110 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6111 );
6112 #[allow(unused_mut)]
6113 let mut request = self
6114 .client
6115 .post(url)
6116 .header(
6117 ::reqwest::header::ACCEPT,
6118 ::reqwest::header::HeaderValue::from_static("application/json"),
6119 )
6120 .headers(header_map)
6121 .build()?;
6122 let info = OperationInfo {
6123 operation_id: "passkey_register_options",
6124 };
6125 self.pre(&mut request, &info).await?;
6126 let result = self.exec(request, &info).await;
6127 self.post(&result, &info).await?;
6128 let response = result?;
6129 match response.status().as_u16() {
6130 200u16 => ResponseValue::from_response(response).await,
6131 401u16 => Err(Error::ErrorResponse(
6132 ResponseValue::from_response(response).await?,
6133 )),
6134 _ => Err(Error::UnexpectedResponse(response)),
6135 }
6136 }
6137
6138 ///List the current user's API keys
6139 ///
6140 ///Sends a `GET` request to `/api/v0/user/api-tokens`
6141 pub async fn list_api_tokens<'a>(
6142 &'a self,
6143 ) -> Result<ResponseValue<types::ApiTokenListResponse>, Error<()>> {
6144 let url = format!("{}/api/v0/user/api-tokens", self.baseurl,);
6145 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6146 header_map.append(
6147 ::reqwest::header::HeaderName::from_static("api-version"),
6148 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6149 );
6150 #[allow(unused_mut)]
6151 let mut request = self
6152 .client
6153 .get(url)
6154 .header(
6155 ::reqwest::header::ACCEPT,
6156 ::reqwest::header::HeaderValue::from_static("application/json"),
6157 )
6158 .headers(header_map)
6159 .build()?;
6160 let info = OperationInfo {
6161 operation_id: "list_api_tokens",
6162 };
6163 self.pre(&mut request, &info).await?;
6164 let result = self.exec(request, &info).await;
6165 self.post(&result, &info).await?;
6166 let response = result?;
6167 match response.status().as_u16() {
6168 200u16 => ResponseValue::from_response(response).await,
6169 _ => Err(Error::UnexpectedResponse(response)),
6170 }
6171 }
6172
6173 ///Create a personal API key
6174 ///
6175 ///Returns the raw secret in the response body. It is shown only once and
6176 /// cannot be retrieved later.
6177 ///
6178 ///Sends a `POST` request to `/api/v0/user/api-tokens`
6179 ///
6180 ///Arguments:
6181 /// - `body`: Create request
6182 pub async fn create_api_token<'a>(
6183 &'a self,
6184 body: &'a types::ApiTokenCreateRequest,
6185 ) -> Result<ResponseValue<types::ApiTokenCreateResponse>, Error<()>> {
6186 let url = format!("{}/api/v0/user/api-tokens", self.baseurl,);
6187 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6188 header_map.append(
6189 ::reqwest::header::HeaderName::from_static("api-version"),
6190 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6191 );
6192 #[allow(unused_mut)]
6193 let mut request = self
6194 .client
6195 .post(url)
6196 .header(
6197 ::reqwest::header::ACCEPT,
6198 ::reqwest::header::HeaderValue::from_static("application/json"),
6199 )
6200 .json(&body)
6201 .headers(header_map)
6202 .build()?;
6203 let info = OperationInfo {
6204 operation_id: "create_api_token",
6205 };
6206 self.pre(&mut request, &info).await?;
6207 let result = self.exec(request, &info).await;
6208 self.post(&result, &info).await?;
6209 let response = result?;
6210 match response.status().as_u16() {
6211 201u16 => ResponseValue::from_response(response).await,
6212 _ => Err(Error::UnexpectedResponse(response)),
6213 }
6214 }
6215
6216 ///Finalize passkey sign-up
6217 ///
6218 ///Verifies the attestation, consumes the verification token, creates the
6219 /// user + passkey, and returns a session token.
6220 ///
6221 ///Sends a `POST` request to `/api/v0/auth/passkey/signup/finalize`
6222 ///
6223 ///Arguments:
6224 /// - `body`: Finalize request
6225 pub async fn passkey_signup_finalize<'a>(
6226 &'a self,
6227 body: &'a types::PasskeySignupFinalizeRequest,
6228 ) -> Result<ResponseValue<types::AuthTokenResponse>, Error<types::Error>> {
6229 let url = format!("{}/api/v0/auth/passkey/signup/finalize", self.baseurl,);
6230 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6231 header_map.append(
6232 ::reqwest::header::HeaderName::from_static("api-version"),
6233 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6234 );
6235 #[allow(unused_mut)]
6236 let mut request = self
6237 .client
6238 .post(url)
6239 .header(
6240 ::reqwest::header::ACCEPT,
6241 ::reqwest::header::HeaderValue::from_static("application/json"),
6242 )
6243 .json(&body)
6244 .headers(header_map)
6245 .build()?;
6246 let info = OperationInfo {
6247 operation_id: "passkey_signup_finalize",
6248 };
6249 self.pre(&mut request, &info).await?;
6250 let result = self.exec(request, &info).await;
6251 self.post(&result, &info).await?;
6252 let response = result?;
6253 match response.status().as_u16() {
6254 200u16 => ResponseValue::from_response(response).await,
6255 400u16 => Err(Error::ErrorResponse(
6256 ResponseValue::from_response(response).await?,
6257 )),
6258 409u16 => Err(Error::ErrorResponse(
6259 ResponseValue::from_response(response).await?,
6260 )),
6261 503u16 => Err(Error::ErrorResponse(
6262 ResponseValue::from_response(response).await?,
6263 )),
6264 _ => Err(Error::UnexpectedResponse(response)),
6265 }
6266 }
6267
6268 ///Hand a session token to a locally-running CLI (loopback)
6269 ///
6270 ///Mints a fresh session token for the current user and parks it under the
6271 /// CLI-supplied nonce for 60 seconds. The CLI claims it via the claim
6272 /// endpoint.
6273 ///
6274 ///Sends a `POST` request to `/api/v0/auth/cli/transfer`
6275 ///
6276 ///Arguments:
6277 /// - `body`: Transfer request
6278 pub async fn cli_transfer<'a>(
6279 &'a self,
6280 body: &'a types::CliTransferRequest,
6281 ) -> Result<ResponseValue<()>, Error<()>> {
6282 let url = format!("{}/api/v0/auth/cli/transfer", self.baseurl,);
6283 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6284 header_map.append(
6285 ::reqwest::header::HeaderName::from_static("api-version"),
6286 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6287 );
6288 #[allow(unused_mut)]
6289 let mut request = self
6290 .client
6291 .post(url)
6292 .json(&body)
6293 .headers(header_map)
6294 .build()?;
6295 let info = OperationInfo {
6296 operation_id: "cli_transfer",
6297 };
6298 self.pre(&mut request, &info).await?;
6299 let result = self.exec(request, &info).await;
6300 self.post(&result, &info).await?;
6301 let response = result?;
6302 match response.status().as_u16() {
6303 204u16 => Ok(ResponseValue::empty(response)),
6304 _ => Err(Error::UnexpectedResponse(response)),
6305 }
6306 }
6307
6308 ///List an organization's ledger entries
6309 ///
6310 ///Returns the organization's ledger entries, newest first,
6311 /// cursor-paginated.
6312 ///
6313 ///Sends a `GET` request to `/api/v0/billing/transactions/{org}`
6314 ///
6315 ///Arguments:
6316 /// - `org`: The organization slug.
6317 /// - `cursor`: Opaque cursor from a previous page's `next_cursor`.
6318 /// - `limit`: Page size (1–100, default 50).
6319 pub async fn list_billing_transactions<'a>(
6320 &'a self,
6321 org: &'a str,
6322 cursor: Option<&'a str>,
6323 limit: Option<i64>,
6324 ) -> Result<ResponseValue<types::TransactionList>, Error<types::Error>> {
6325 let url = format!(
6326 "{}/api/v0/billing/transactions/{}",
6327 self.baseurl,
6328 encode_path(&org.to_string()),
6329 );
6330 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6331 header_map.append(
6332 ::reqwest::header::HeaderName::from_static("api-version"),
6333 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6334 );
6335 #[allow(unused_mut)]
6336 let mut request = self
6337 .client
6338 .get(url)
6339 .header(
6340 ::reqwest::header::ACCEPT,
6341 ::reqwest::header::HeaderValue::from_static("application/json"),
6342 )
6343 .query(&progenitor_client::QueryParam::new("cursor", &cursor))
6344 .query(&progenitor_client::QueryParam::new("limit", &limit))
6345 .headers(header_map)
6346 .build()?;
6347 let info = OperationInfo {
6348 operation_id: "list_billing_transactions",
6349 };
6350 self.pre(&mut request, &info).await?;
6351 let result = self.exec(request, &info).await;
6352 self.post(&result, &info).await?;
6353 let response = result?;
6354 match response.status().as_u16() {
6355 200u16 => ResponseValue::from_response(response).await,
6356 404u16 => Err(Error::ErrorResponse(
6357 ResponseValue::from_response(response).await?,
6358 )),
6359 _ => Err(Error::UnexpectedResponse(response)),
6360 }
6361 }
6362
6363 ///List a pipeline's builds
6364 ///
6365 ///Returns the pipeline's builds, newest first, paginated.
6366 ///
6367 ///Sends a `GET` request to
6368 /// `/api/v0/organizations/{org}/pipelines/{pipeline}/builds`
6369 ///
6370 ///Arguments:
6371 /// - `org`: The organization slug.
6372 /// - `pipeline`: The pipeline slug.
6373 /// - `cursor`: Opaque cursor from a previous page's `next_cursor`.
6374 /// - `limit`: Page size (1–100, default 50).
6375 pub async fn list_builds<'a>(
6376 &'a self,
6377 org: &'a str,
6378 pipeline: &'a str,
6379 cursor: Option<&'a str>,
6380 limit: Option<i64>,
6381 ) -> Result<ResponseValue<types::BuildList>, Error<types::Error>> {
6382 let url = format!(
6383 "{}/api/v0/organizations/{}/pipelines/{}/builds",
6384 self.baseurl,
6385 encode_path(&org.to_string()),
6386 encode_path(&pipeline.to_string()),
6387 );
6388 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6389 header_map.append(
6390 ::reqwest::header::HeaderName::from_static("api-version"),
6391 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6392 );
6393 #[allow(unused_mut)]
6394 let mut request = self
6395 .client
6396 .get(url)
6397 .header(
6398 ::reqwest::header::ACCEPT,
6399 ::reqwest::header::HeaderValue::from_static("application/json"),
6400 )
6401 .query(&progenitor_client::QueryParam::new("cursor", &cursor))
6402 .query(&progenitor_client::QueryParam::new("limit", &limit))
6403 .headers(header_map)
6404 .build()?;
6405 let info = OperationInfo {
6406 operation_id: "list_builds",
6407 };
6408 self.pre(&mut request, &info).await?;
6409 let result = self.exec(request, &info).await;
6410 self.post(&result, &info).await?;
6411 let response = result?;
6412 match response.status().as_u16() {
6413 200u16 => ResponseValue::from_response(response).await,
6414 404u16 => Err(Error::ErrorResponse(
6415 ResponseValue::from_response(response).await?,
6416 )),
6417 _ => Err(Error::UnexpectedResponse(response)),
6418 }
6419 }
6420
6421 ///Create a build
6422 ///
6423 ///Creates a build for the pipeline and starts execution in-process. When
6424 /// `pipeline_ir` is supplied the IR is materialised directly; when it is
6425 /// absent the engine renders the pipeline's IR in a sandbox VM first
6426 /// (rendering never happens on the API host). A manual build against a
6427 /// pipeline that disallows manual builds yields 403; an IR that fails to
6428 /// render/parse/plan yields 422 (the build row is created with its error
6429 /// fields set).
6430 ///
6431 ///Sends a `POST` request to
6432 /// `/api/v0/organizations/{org}/pipelines/{pipeline}/builds`
6433 ///
6434 ///Arguments:
6435 /// - `org`: The organization slug.
6436 /// - `pipeline`: The pipeline slug.
6437 /// - `body`: Build attributes
6438 pub async fn create_build<'a>(
6439 &'a self,
6440 org: &'a str,
6441 pipeline: &'a str,
6442 body: &'a types::CreateBuildRequest,
6443 ) -> Result<ResponseValue<types::Build>, Error<types::Error>> {
6444 let url = format!(
6445 "{}/api/v0/organizations/{}/pipelines/{}/builds",
6446 self.baseurl,
6447 encode_path(&org.to_string()),
6448 encode_path(&pipeline.to_string()),
6449 );
6450 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6451 header_map.append(
6452 ::reqwest::header::HeaderName::from_static("api-version"),
6453 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6454 );
6455 #[allow(unused_mut)]
6456 let mut request = self
6457 .client
6458 .post(url)
6459 .header(
6460 ::reqwest::header::ACCEPT,
6461 ::reqwest::header::HeaderValue::from_static("application/json"),
6462 )
6463 .json(&body)
6464 .headers(header_map)
6465 .build()?;
6466 let info = OperationInfo {
6467 operation_id: "create_build",
6468 };
6469 self.pre(&mut request, &info).await?;
6470 let result = self.exec(request, &info).await;
6471 self.post(&result, &info).await?;
6472 let response = result?;
6473 match response.status().as_u16() {
6474 201u16 => ResponseValue::from_response(response).await,
6475 402u16 => Err(Error::ErrorResponse(
6476 ResponseValue::from_response(response).await?,
6477 )),
6478 403u16 => Err(Error::ErrorResponse(
6479 ResponseValue::from_response(response).await?,
6480 )),
6481 404u16 => Err(Error::ErrorResponse(
6482 ResponseValue::from_response(response).await?,
6483 )),
6484 422u16 => Err(Error::ErrorResponse(
6485 ResponseValue::from_response(response).await?,
6486 )),
6487 _ => Err(Error::UnexpectedResponse(response)),
6488 }
6489 }
6490
6491 ///Redeem a CLI paste code for a session token
6492 ///
6493 ///The CLI submits the paste code the user typed in; on a match within the
6494 /// 5m window it receives the raw session token (single-use).
6495 ///
6496 ///Sends a `POST` request to `/api/v0/auth/cli/redeem`
6497 ///
6498 ///Arguments:
6499 /// - `body`: Redeem request
6500 pub async fn cli_redeem<'a>(
6501 &'a self,
6502 body: &'a types::CliRedeemRequest,
6503 ) -> Result<ResponseValue<types::CliTokenResponse>, Error<types::Error>> {
6504 let url = format!("{}/api/v0/auth/cli/redeem", self.baseurl,);
6505 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6506 header_map.append(
6507 ::reqwest::header::HeaderName::from_static("api-version"),
6508 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6509 );
6510 #[allow(unused_mut)]
6511 let mut request = self
6512 .client
6513 .post(url)
6514 .header(
6515 ::reqwest::header::ACCEPT,
6516 ::reqwest::header::HeaderValue::from_static("application/json"),
6517 )
6518 .json(&body)
6519 .headers(header_map)
6520 .build()?;
6521 let info = OperationInfo {
6522 operation_id: "cli_redeem",
6523 };
6524 self.pre(&mut request, &info).await?;
6525 let result = self.exec(request, &info).await;
6526 self.post(&result, &info).await?;
6527 let response = result?;
6528 match response.status().as_u16() {
6529 200u16 => ResponseValue::from_response(response).await,
6530 400u16 => Err(Error::ErrorResponse(
6531 ResponseValue::from_response(response).await?,
6532 )),
6533 _ => Err(Error::UnexpectedResponse(response)),
6534 }
6535 }
6536
6537 ///Mint a build-scoped log token
6538 ///
6539 ///Returns a short-lived (~1 hour) HMAC token the SSE log stream accepts,
6540 /// scoped to this build. Pass it as the stream's `token` query parameter.
6541 ///
6542 ///Sends a `GET` request to
6543 /// `/api/v0/organizations/{org}/pipelines/{pipeline}/builds/{number}/
6544 /// log-token`
6545 ///
6546 ///Arguments:
6547 /// - `org`: The organization slug.
6548 /// - `pipeline`: The pipeline slug.
6549 /// - `number`: The build number.
6550 pub async fn get_build_log_token<'a>(
6551 &'a self,
6552 org: &'a str,
6553 pipeline: &'a str,
6554 number: i64,
6555 ) -> Result<ResponseValue<types::LogTokenResponse>, Error<types::Error>> {
6556 let url = format!(
6557 "{}/api/v0/organizations/{}/pipelines/{}/builds/{}/log-token",
6558 self.baseurl,
6559 encode_path(&org.to_string()),
6560 encode_path(&pipeline.to_string()),
6561 encode_path(&number.to_string()),
6562 );
6563 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6564 header_map.append(
6565 ::reqwest::header::HeaderName::from_static("api-version"),
6566 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6567 );
6568 #[allow(unused_mut)]
6569 let mut request = self
6570 .client
6571 .get(url)
6572 .header(
6573 ::reqwest::header::ACCEPT,
6574 ::reqwest::header::HeaderValue::from_static("application/json"),
6575 )
6576 .headers(header_map)
6577 .build()?;
6578 let info = OperationInfo {
6579 operation_id: "get_build_log_token",
6580 };
6581 self.pre(&mut request, &info).await?;
6582 let result = self.exec(request, &info).await;
6583 self.post(&result, &info).await?;
6584 let response = result?;
6585 match response.status().as_u16() {
6586 200u16 => ResponseValue::from_response(response).await,
6587 404u16 => Err(Error::ErrorResponse(
6588 ResponseValue::from_response(response).await?,
6589 )),
6590 _ => Err(Error::UnexpectedResponse(response)),
6591 }
6592 }
6593
6594 ///Get the Bitbucket OAuth authorize URL
6595 ///
6596 ///Returns the Bitbucket authorize URL the SPA should open to start the
6597 /// OAuth consent flow. The signed `state` carries this org so the static
6598 /// callback can recover it server-side. Yields 503 when Bitbucket
6599 /// integration is not configured on this server.
6600 ///
6601 ///Sends a `GET` request to
6602 /// `/api/v0/organizations/{org}/bitbucket/oauth-url`
6603 ///
6604 ///Arguments:
6605 /// - `org`: The organization slug.
6606 pub async fn bitbucket_o_auth_url<'a>(
6607 &'a self,
6608 org: &'a str,
6609 ) -> Result<ResponseValue<types::BitbucketOAuthUrlResponse>, Error<types::Error>> {
6610 let url = format!(
6611 "{}/api/v0/organizations/{}/bitbucket/oauth-url",
6612 self.baseurl,
6613 encode_path(&org.to_string()),
6614 );
6615 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6616 header_map.append(
6617 ::reqwest::header::HeaderName::from_static("api-version"),
6618 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6619 );
6620 #[allow(unused_mut)]
6621 let mut request = self
6622 .client
6623 .get(url)
6624 .header(
6625 ::reqwest::header::ACCEPT,
6626 ::reqwest::header::HeaderValue::from_static("application/json"),
6627 )
6628 .headers(header_map)
6629 .build()?;
6630 let info = OperationInfo {
6631 operation_id: "bitbucket_o_auth_url",
6632 };
6633 self.pre(&mut request, &info).await?;
6634 let result = self.exec(request, &info).await;
6635 self.post(&result, &info).await?;
6636 let response = result?;
6637 match response.status().as_u16() {
6638 200u16 => ResponseValue::from_response(response).await,
6639 404u16 => Err(Error::ErrorResponse(
6640 ResponseValue::from_response(response).await?,
6641 )),
6642 503u16 => Err(Error::ErrorResponse(
6643 ResponseValue::from_response(response).await?,
6644 )),
6645 _ => Err(Error::UnexpectedResponse(response)),
6646 }
6647 }
6648
6649 ///Get a job
6650 ///
6651 ///Returns a single job within the build. A `job_id` that belongs to
6652 /// another build is reported as 404.
6653 ///
6654 ///Sends a `GET` request to
6655 /// `/api/v0/organizations/{org}/pipelines/{pipeline}/builds/{number}/jobs/
6656 /// {job_id}`
6657 ///
6658 ///Arguments:
6659 /// - `org`: The organization slug.
6660 /// - `pipeline`: The pipeline slug.
6661 /// - `number`: The build number.
6662 /// - `job_id`: The job id.
6663 pub async fn get_job<'a>(
6664 &'a self,
6665 org: &'a str,
6666 pipeline: &'a str,
6667 number: i64,
6668 job_id: &'a str,
6669 ) -> Result<ResponseValue<types::Job>, Error<types::Error>> {
6670 let url = format!(
6671 "{}/api/v0/organizations/{}/pipelines/{}/builds/{}/jobs/{}",
6672 self.baseurl,
6673 encode_path(&org.to_string()),
6674 encode_path(&pipeline.to_string()),
6675 encode_path(&number.to_string()),
6676 encode_path(&job_id.to_string()),
6677 );
6678 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6679 header_map.append(
6680 ::reqwest::header::HeaderName::from_static("api-version"),
6681 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6682 );
6683 #[allow(unused_mut)]
6684 let mut request = self
6685 .client
6686 .get(url)
6687 .header(
6688 ::reqwest::header::ACCEPT,
6689 ::reqwest::header::HeaderValue::from_static("application/json"),
6690 )
6691 .headers(header_map)
6692 .build()?;
6693 let info = OperationInfo {
6694 operation_id: "get_job",
6695 };
6696 self.pre(&mut request, &info).await?;
6697 let result = self.exec(request, &info).await;
6698 self.post(&result, &info).await?;
6699 let response = result?;
6700 match response.status().as_u16() {
6701 200u16 => ResponseValue::from_response(response).await,
6702 404u16 => Err(Error::ErrorResponse(
6703 ResponseValue::from_response(response).await?,
6704 )),
6705 _ => Err(Error::UnexpectedResponse(response)),
6706 }
6707 }
6708
6709 ///Sync a connected installation's repositories
6710 ///
6711 ///Triggers a live sync: lists the installation's repositories from GitHub
6712 /// and reconciles the mirror. Returns the installation. The installation
6713 /// must be connected to this organization.
6714 ///
6715 ///Sends a `POST` request to
6716 /// `/api/v0/organizations/{org}/github/installations/{id}/sync`
6717 ///
6718 ///Arguments:
6719 /// - `org`: The organization slug.
6720 /// - `id`: The GitHub numeric installation id.
6721 pub async fn sync_github_installation<'a>(
6722 &'a self,
6723 org: &'a str,
6724 id: i64,
6725 ) -> Result<ResponseValue<types::GithubInstallation>, Error<types::Error>> {
6726 let url = format!(
6727 "{}/api/v0/organizations/{}/github/installations/{}/sync",
6728 self.baseurl,
6729 encode_path(&org.to_string()),
6730 encode_path(&id.to_string()),
6731 );
6732 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6733 header_map.append(
6734 ::reqwest::header::HeaderName::from_static("api-version"),
6735 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6736 );
6737 #[allow(unused_mut)]
6738 let mut request = self
6739 .client
6740 .post(url)
6741 .header(
6742 ::reqwest::header::ACCEPT,
6743 ::reqwest::header::HeaderValue::from_static("application/json"),
6744 )
6745 .headers(header_map)
6746 .build()?;
6747 let info = OperationInfo {
6748 operation_id: "sync_github_installation",
6749 };
6750 self.pre(&mut request, &info).await?;
6751 let result = self.exec(request, &info).await;
6752 self.post(&result, &info).await?;
6753 let response = result?;
6754 match response.status().as_u16() {
6755 200u16 => ResponseValue::from_response(response).await,
6756 404u16 => Err(Error::ErrorResponse(
6757 ResponseValue::from_response(response).await?,
6758 )),
6759 503u16 => Err(Error::ErrorResponse(
6760 ResponseValue::from_response(response).await?,
6761 )),
6762 _ => Err(Error::UnexpectedResponse(response)),
6763 }
6764 }
6765
6766 ///Begin passkey sign-up
6767 ///
6768 ///Checks capacity and emails a verification link; 503 when at capacity
6769 /// (never reveals whether the email already has an account).
6770 ///
6771 ///Sends a `POST` request to `/api/v0/auth/passkey/signup/begin`
6772 ///
6773 ///Arguments:
6774 /// - `body`: Sign-up request
6775 pub async fn passkey_signup_begin<'a>(
6776 &'a self,
6777 body: &'a types::PasskeySignupBeginRequest,
6778 ) -> Result<ResponseValue<()>, Error<types::Error>> {
6779 let url = format!("{}/api/v0/auth/passkey/signup/begin", self.baseurl,);
6780 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6781 header_map.append(
6782 ::reqwest::header::HeaderName::from_static("api-version"),
6783 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6784 );
6785 #[allow(unused_mut)]
6786 let mut request = self
6787 .client
6788 .post(url)
6789 .header(
6790 ::reqwest::header::ACCEPT,
6791 ::reqwest::header::HeaderValue::from_static("application/json"),
6792 )
6793 .json(&body)
6794 .headers(header_map)
6795 .build()?;
6796 let info = OperationInfo {
6797 operation_id: "passkey_signup_begin",
6798 };
6799 self.pre(&mut request, &info).await?;
6800 let result = self.exec(request, &info).await;
6801 self.post(&result, &info).await?;
6802 let response = result?;
6803 match response.status().as_u16() {
6804 204u16 => Ok(ResponseValue::empty(response)),
6805 503u16 => Err(Error::ErrorResponse(
6806 ResponseValue::from_response(response).await?,
6807 )),
6808 _ => Err(Error::UnexpectedResponse(response)),
6809 }
6810 }
6811
6812 ///Sign in with Google
6813 ///
6814 ///Exchanges a Google authorization code for a Harmont session token,
6815 /// creating the user and their personal org on first sign-in.
6816 ///
6817 ///Sends a `POST` request to `/api/v0/auth/google`
6818 ///
6819 ///Arguments:
6820 /// - `body`: Google OAuth callback
6821 pub async fn auth_google<'a>(
6822 &'a self,
6823 body: &'a types::AuthGoogleRequest,
6824 ) -> Result<ResponseValue<types::AuthTokenResponse>, Error<types::Error>> {
6825 let url = format!("{}/api/v0/auth/google", self.baseurl,);
6826 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6827 header_map.append(
6828 ::reqwest::header::HeaderName::from_static("api-version"),
6829 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6830 );
6831 #[allow(unused_mut)]
6832 let mut request = self
6833 .client
6834 .post(url)
6835 .header(
6836 ::reqwest::header::ACCEPT,
6837 ::reqwest::header::HeaderValue::from_static("application/json"),
6838 )
6839 .json(&body)
6840 .headers(header_map)
6841 .build()?;
6842 let info = OperationInfo {
6843 operation_id: "auth_google",
6844 };
6845 self.pre(&mut request, &info).await?;
6846 let result = self.exec(request, &info).await;
6847 self.post(&result, &info).await?;
6848 let response = result?;
6849 match response.status().as_u16() {
6850 200u16 => ResponseValue::from_response(response).await,
6851 500u16 => Err(Error::ErrorResponse(
6852 ResponseValue::from_response(response).await?,
6853 )),
6854 502u16 => Err(Error::ErrorResponse(
6855 ResponseValue::from_response(response).await?,
6856 )),
6857 503u16 => Err(Error::ErrorResponse(
6858 ResponseValue::from_response(response).await?,
6859 )),
6860 _ => Err(Error::UnexpectedResponse(response)),
6861 }
6862 }
6863
6864 ///Mint a human-typeable CLI paste code
6865 ///
6866 ///Mints a fresh session token for the current user and a short paste code
6867 /// (valid 5 minutes) the user re-types into the CLI to redeem it.
6868 ///
6869 ///Sends a `POST` request to `/api/v0/auth/cli/code`
6870 pub async fn cli_code<'a>(
6871 &'a self,
6872 ) -> Result<ResponseValue<types::CliCodeResponse>, Error<()>> {
6873 let url = format!("{}/api/v0/auth/cli/code", self.baseurl,);
6874 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6875 header_map.append(
6876 ::reqwest::header::HeaderName::from_static("api-version"),
6877 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6878 );
6879 #[allow(unused_mut)]
6880 let mut request = self
6881 .client
6882 .post(url)
6883 .header(
6884 ::reqwest::header::ACCEPT,
6885 ::reqwest::header::HeaderValue::from_static("application/json"),
6886 )
6887 .headers(header_map)
6888 .build()?;
6889 let info = OperationInfo {
6890 operation_id: "cli_code",
6891 };
6892 self.pre(&mut request, &info).await?;
6893 let result = self.exec(request, &info).await;
6894 self.post(&result, &info).await?;
6895 let response = result?;
6896 match response.status().as_u16() {
6897 200u16 => ResponseValue::from_response(response).await,
6898 _ => Err(Error::UnexpectedResponse(response)),
6899 }
6900 }
6901
6902 ///Per-build VM usage breakdown
6903 ///
6904 ///Returns the organization's VM usage over the half-open `[from, to)`
6905 /// window (both ISO-8601), grouped by build (newest first) and broken down
6906 /// per job lease — pipeline, build number, job, VM handle, resource shape,
6907 /// duration and cost — so a charge can be traced to its source.
6908 ///
6909 ///Sends a `GET` request to `/api/v0/billing/usage/{org}/breakdown`
6910 ///
6911 ///Arguments:
6912 /// - `org`: Organization slug.
6913 /// - `from`: ISO-8601 window start (inclusive).
6914 /// - `to`: ISO-8601 window end (exclusive).
6915 pub async fn get_billing_usage_breakdown<'a>(
6916 &'a self,
6917 org: &'a str,
6918 from: &'a str,
6919 to: &'a str,
6920 ) -> Result<ResponseValue<types::UsageBreakdownResponse>, Error<types::Error>> {
6921 let url = format!(
6922 "{}/api/v0/billing/usage/{}/breakdown",
6923 self.baseurl,
6924 encode_path(&org.to_string()),
6925 );
6926 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6927 header_map.append(
6928 ::reqwest::header::HeaderName::from_static("api-version"),
6929 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6930 );
6931 #[allow(unused_mut)]
6932 let mut request = self
6933 .client
6934 .get(url)
6935 .header(
6936 ::reqwest::header::ACCEPT,
6937 ::reqwest::header::HeaderValue::from_static("application/json"),
6938 )
6939 .query(&progenitor_client::QueryParam::new("from", &from))
6940 .query(&progenitor_client::QueryParam::new("to", &to))
6941 .headers(header_map)
6942 .build()?;
6943 let info = OperationInfo {
6944 operation_id: "get_billing_usage_breakdown",
6945 };
6946 self.pre(&mut request, &info).await?;
6947 let result = self.exec(request, &info).await;
6948 self.post(&result, &info).await?;
6949 let response = result?;
6950 match response.status().as_u16() {
6951 200u16 => ResponseValue::from_response(response).await,
6952 404u16 => Err(Error::ErrorResponse(
6953 ResponseValue::from_response(response).await?,
6954 )),
6955 422u16 => Err(Error::ErrorResponse(
6956 ResponseValue::from_response(response).await?,
6957 )),
6958 _ => Err(Error::UnexpectedResponse(response)),
6959 }
6960 }
6961
6962 ///Cancel a build
6963 ///
6964 ///Cancels an in-flight build in-process (transitions non-terminal jobs and
6965 /// tears down their sandboxes). Idempotent: cancelling an already-terminal
6966 /// build is a no-op. Returns the reloaded build with its updated state.
6967 ///
6968 ///Sends a `PUT` request to
6969 /// `/api/v0/organizations/{org}/pipelines/{pipeline}/builds/{number}/
6970 /// cancel`
6971 ///
6972 ///Arguments:
6973 /// - `org`: The organization slug.
6974 /// - `pipeline`: The pipeline slug.
6975 /// - `number`: The build number.
6976 pub async fn cancel_build<'a>(
6977 &'a self,
6978 org: &'a str,
6979 pipeline: &'a str,
6980 number: i64,
6981 ) -> Result<ResponseValue<types::Build>, Error<types::Error>> {
6982 let url = format!(
6983 "{}/api/v0/organizations/{}/pipelines/{}/builds/{}/cancel",
6984 self.baseurl,
6985 encode_path(&org.to_string()),
6986 encode_path(&pipeline.to_string()),
6987 encode_path(&number.to_string()),
6988 );
6989 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
6990 header_map.append(
6991 ::reqwest::header::HeaderName::from_static("api-version"),
6992 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
6993 );
6994 #[allow(unused_mut)]
6995 let mut request = self
6996 .client
6997 .put(url)
6998 .header(
6999 ::reqwest::header::ACCEPT,
7000 ::reqwest::header::HeaderValue::from_static("application/json"),
7001 )
7002 .headers(header_map)
7003 .build()?;
7004 let info = OperationInfo {
7005 operation_id: "cancel_build",
7006 };
7007 self.pre(&mut request, &info).await?;
7008 let result = self.exec(request, &info).await;
7009 self.post(&result, &info).await?;
7010 let response = result?;
7011 match response.status().as_u16() {
7012 200u16 => ResponseValue::from_response(response).await,
7013 404u16 => Err(Error::ErrorResponse(
7014 ResponseValue::from_response(response).await?,
7015 )),
7016 _ => Err(Error::UnexpectedResponse(response)),
7017 }
7018 }
7019
7020 ///List the current user's organizations
7021 ///
7022 ///Returns the organizations the authenticated user is a member of,
7023 /// paginated.
7024 ///
7025 ///Sends a `GET` request to `/api/v0/organizations`
7026 ///
7027 ///Arguments:
7028 /// - `cursor`: Opaque cursor from a previous page's `next_cursor`.
7029 /// - `limit`: Page size (1–100, default 50).
7030 pub async fn list_organizations<'a>(
7031 &'a self,
7032 cursor: Option<&'a str>,
7033 limit: Option<i64>,
7034 ) -> Result<ResponseValue<types::OrganizationList>, Error<()>> {
7035 let url = format!("{}/api/v0/organizations", self.baseurl,);
7036 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7037 header_map.append(
7038 ::reqwest::header::HeaderName::from_static("api-version"),
7039 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7040 );
7041 #[allow(unused_mut)]
7042 let mut request = self
7043 .client
7044 .get(url)
7045 .header(
7046 ::reqwest::header::ACCEPT,
7047 ::reqwest::header::HeaderValue::from_static("application/json"),
7048 )
7049 .query(&progenitor_client::QueryParam::new("cursor", &cursor))
7050 .query(&progenitor_client::QueryParam::new("limit", &limit))
7051 .headers(header_map)
7052 .build()?;
7053 let info = OperationInfo {
7054 operation_id: "list_organizations",
7055 };
7056 self.pre(&mut request, &info).await?;
7057 let result = self.exec(request, &info).await;
7058 self.post(&result, &info).await?;
7059 let response = result?;
7060 match response.status().as_u16() {
7061 200u16 => ResponseValue::from_response(response).await,
7062 _ => Err(Error::UnexpectedResponse(response)),
7063 }
7064 }
7065
7066 ///Create an organization
7067 ///
7068 ///Creates a new organization with the authenticated user as its owner.
7069 ///
7070 ///Sends a `POST` request to `/api/v0/organizations`
7071 ///
7072 ///Arguments:
7073 /// - `body`: Organization to create
7074 pub async fn create_organization<'a>(
7075 &'a self,
7076 body: &'a types::CreateOrganizationRequest,
7077 ) -> Result<ResponseValue<types::Organization>, Error<types::Error>> {
7078 let url = format!("{}/api/v0/organizations", self.baseurl,);
7079 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7080 header_map.append(
7081 ::reqwest::header::HeaderName::from_static("api-version"),
7082 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7083 );
7084 #[allow(unused_mut)]
7085 let mut request = self
7086 .client
7087 .post(url)
7088 .header(
7089 ::reqwest::header::ACCEPT,
7090 ::reqwest::header::HeaderValue::from_static("application/json"),
7091 )
7092 .json(&body)
7093 .headers(header_map)
7094 .build()?;
7095 let info = OperationInfo {
7096 operation_id: "create_organization",
7097 };
7098 self.pre(&mut request, &info).await?;
7099 let result = self.exec(request, &info).await;
7100 self.post(&result, &info).await?;
7101 let response = result?;
7102 match response.status().as_u16() {
7103 201u16 => ResponseValue::from_response(response).await,
7104 422u16 => Err(Error::ErrorResponse(
7105 ResponseValue::from_response(response).await?,
7106 )),
7107 _ => Err(Error::UnexpectedResponse(response)),
7108 }
7109 }
7110
7111 ///Start a Stripe Checkout Session for a credit top-up
7112 ///
7113 ///Creates a Stripe Checkout Session crediting the organization identified
7114 /// by the path (`:org`) and returns the hosted checkout URL to redirect the
7115 /// customer to. The body carries only the top-up `amount_cents` (a positive
7116 /// integer within supported bounds). The credit itself is posted
7117 /// asynchronously when Stripe fires the matching webhook.
7118 ///
7119 ///Sends a `POST` request to `/api/v0/billing/checkout/{org}`
7120 ///
7121 ///Arguments:
7122 /// - `org`: The organization slug.
7123 /// - `body`: The top-up amount
7124 pub async fn create_checkout<'a>(
7125 &'a self,
7126 org: &'a str,
7127 body: &'a types::CheckoutRequest,
7128 ) -> Result<ResponseValue<types::CheckoutResponse>, Error<types::Error>> {
7129 let url = format!(
7130 "{}/api/v0/billing/checkout/{}",
7131 self.baseurl,
7132 encode_path(&org.to_string()),
7133 );
7134 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7135 header_map.append(
7136 ::reqwest::header::HeaderName::from_static("api-version"),
7137 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7138 );
7139 #[allow(unused_mut)]
7140 let mut request = self
7141 .client
7142 .post(url)
7143 .header(
7144 ::reqwest::header::ACCEPT,
7145 ::reqwest::header::HeaderValue::from_static("application/json"),
7146 )
7147 .json(&body)
7148 .headers(header_map)
7149 .build()?;
7150 let info = OperationInfo {
7151 operation_id: "create_checkout",
7152 };
7153 self.pre(&mut request, &info).await?;
7154 let result = self.exec(request, &info).await;
7155 self.post(&result, &info).await?;
7156 let response = result?;
7157 match response.status().as_u16() {
7158 200u16 => ResponseValue::from_response(response).await,
7159 404u16 => Err(Error::ErrorResponse(
7160 ResponseValue::from_response(response).await?,
7161 )),
7162 422u16 => Err(Error::ErrorResponse(
7163 ResponseValue::from_response(response).await?,
7164 )),
7165 502u16 => Err(Error::ErrorResponse(
7166 ResponseValue::from_response(response).await?,
7167 )),
7168 503u16 => Err(Error::ErrorResponse(
7169 ResponseValue::from_response(response).await?,
7170 )),
7171 _ => Err(Error::UnexpectedResponse(response)),
7172 }
7173 }
7174
7175 ///List pending invites
7176 ///
7177 ///Sends a `GET` request to `/api/v0/organizations/{org}/invites`
7178 ///
7179 ///Arguments:
7180 /// - `org`:
7181 pub async fn list_invites<'a>(
7182 &'a self,
7183 org: &'a str,
7184 ) -> Result<ResponseValue<types::InviteList>, Error<()>> {
7185 let url = format!(
7186 "{}/api/v0/organizations/{}/invites",
7187 self.baseurl,
7188 encode_path(&org.to_string()),
7189 );
7190 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7191 header_map.append(
7192 ::reqwest::header::HeaderName::from_static("api-version"),
7193 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7194 );
7195 #[allow(unused_mut)]
7196 let mut request = self
7197 .client
7198 .get(url)
7199 .header(
7200 ::reqwest::header::ACCEPT,
7201 ::reqwest::header::HeaderValue::from_static("application/json"),
7202 )
7203 .headers(header_map)
7204 .build()?;
7205 let info = OperationInfo {
7206 operation_id: "list_invites",
7207 };
7208 self.pre(&mut request, &info).await?;
7209 let result = self.exec(request, &info).await;
7210 self.post(&result, &info).await?;
7211 let response = result?;
7212 match response.status().as_u16() {
7213 200u16 => ResponseValue::from_response(response).await,
7214 _ => Err(Error::UnexpectedResponse(response)),
7215 }
7216 }
7217
7218 ///Invite an email to the organization
7219 ///
7220 ///Sends a `POST` request to `/api/v0/organizations/{org}/invites`
7221 ///
7222 ///Arguments:
7223 /// - `org`:
7224 /// - `body`: Invite
7225 pub async fn create_invite<'a>(
7226 &'a self,
7227 org: &'a str,
7228 body: &'a types::CreateInviteRequest,
7229 ) -> Result<ResponseValue<types::Invite>, Error<types::Error>> {
7230 let url = format!(
7231 "{}/api/v0/organizations/{}/invites",
7232 self.baseurl,
7233 encode_path(&org.to_string()),
7234 );
7235 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7236 header_map.append(
7237 ::reqwest::header::HeaderName::from_static("api-version"),
7238 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7239 );
7240 #[allow(unused_mut)]
7241 let mut request = self
7242 .client
7243 .post(url)
7244 .header(
7245 ::reqwest::header::ACCEPT,
7246 ::reqwest::header::HeaderValue::from_static("application/json"),
7247 )
7248 .json(&body)
7249 .headers(header_map)
7250 .build()?;
7251 let info = OperationInfo {
7252 operation_id: "create_invite",
7253 };
7254 self.pre(&mut request, &info).await?;
7255 let result = self.exec(request, &info).await;
7256 self.post(&result, &info).await?;
7257 let response = result?;
7258 match response.status().as_u16() {
7259 201u16 => ResponseValue::from_response(response).await,
7260 403u16 => Err(Error::ErrorResponse(
7261 ResponseValue::from_response(response).await?,
7262 )),
7263 422u16 => Err(Error::ErrorResponse(
7264 ResponseValue::from_response(response).await?,
7265 )),
7266 _ => Err(Error::UnexpectedResponse(response)),
7267 }
7268 }
7269
7270 ///Get recovery passkey-creation options
7271 ///
7272 ///Validates the magic-link token (without consuming it) and returns
7273 /// WebAuthn credential-creation options plus the challenge id to echo back
7274 /// on finalize.
7275 ///
7276 ///Sends a `POST` request to `/api/v0/auth/recover/options`
7277 ///
7278 ///Arguments:
7279 /// - `body`: Options request
7280 pub async fn recover_options<'a>(
7281 &'a self,
7282 body: &'a types::RecoverOptionsRequest,
7283 ) -> Result<ResponseValue<types::PasskeyChallengeResponse>, Error<types::Error>> {
7284 let url = format!("{}/api/v0/auth/recover/options", self.baseurl,);
7285 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7286 header_map.append(
7287 ::reqwest::header::HeaderName::from_static("api-version"),
7288 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7289 );
7290 #[allow(unused_mut)]
7291 let mut request = self
7292 .client
7293 .post(url)
7294 .header(
7295 ::reqwest::header::ACCEPT,
7296 ::reqwest::header::HeaderValue::from_static("application/json"),
7297 )
7298 .json(&body)
7299 .headers(header_map)
7300 .build()?;
7301 let info = OperationInfo {
7302 operation_id: "recover_options",
7303 };
7304 self.pre(&mut request, &info).await?;
7305 let result = self.exec(request, &info).await;
7306 self.post(&result, &info).await?;
7307 let response = result?;
7308 match response.status().as_u16() {
7309 200u16 => ResponseValue::from_response(response).await,
7310 400u16 => Err(Error::ErrorResponse(
7311 ResponseValue::from_response(response).await?,
7312 )),
7313 _ => Err(Error::UnexpectedResponse(response)),
7314 }
7315 }
7316
7317 ///Receive a Stripe webhook event
7318 ///
7319 ///Receives a Stripe webhook event and, for `checkout.session.completed`,
7320 /// posts the matching credit to the organization's ledger and marks the
7321 /// checkout session complete. **Not** bearer-authenticated: the request is
7322 /// authenticated by Stripe's `Stripe-Signature` header, verified against
7323 /// the raw request body and the endpoint's webhook signing secret. Credit
7324 /// posting is idempotent — replaying the same event id posts the credit
7325 /// only once. Returns 200 for any verified event (handled or not) so Stripe
7326 /// stops retrying; a signature failure returns 400.
7327 ///
7328 ///Sends a `POST` request to `/api/v0/stripe/webhook`
7329 pub async fn stripe_webhook<'a>(
7330 &'a self,
7331 ) -> Result<ResponseValue<types::StripeWebhookResponse>, Error<types::Error>> {
7332 let url = format!("{}/api/v0/stripe/webhook", self.baseurl,);
7333 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7334 header_map.append(
7335 ::reqwest::header::HeaderName::from_static("api-version"),
7336 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7337 );
7338 #[allow(unused_mut)]
7339 let mut request = self
7340 .client
7341 .post(url)
7342 .header(
7343 ::reqwest::header::ACCEPT,
7344 ::reqwest::header::HeaderValue::from_static("application/json"),
7345 )
7346 .headers(header_map)
7347 .build()?;
7348 let info = OperationInfo {
7349 operation_id: "stripe_webhook",
7350 };
7351 self.pre(&mut request, &info).await?;
7352 let result = self.exec(request, &info).await;
7353 self.post(&result, &info).await?;
7354 let response = result?;
7355 match response.status().as_u16() {
7356 200u16 => ResponseValue::from_response(response).await,
7357 400u16 => Err(Error::ErrorResponse(
7358 ResponseValue::from_response(response).await?,
7359 )),
7360 _ => Err(Error::UnexpectedResponse(response)),
7361 }
7362 }
7363
7364 ///Get the current authenticated user
7365 ///
7366 ///Returns the bearer-authenticated user and their personal-organization
7367 /// slug.
7368 ///
7369 ///Sends a `GET` request to `/api/v0/user`
7370 pub async fn get_current_user<'a>(
7371 &'a self,
7372 ) -> Result<ResponseValue<types::CurrentUserResponse>, Error<()>> {
7373 let url = format!("{}/api/v0/user", self.baseurl,);
7374 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7375 header_map.append(
7376 ::reqwest::header::HeaderName::from_static("api-version"),
7377 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7378 );
7379 #[allow(unused_mut)]
7380 let mut request = self
7381 .client
7382 .get(url)
7383 .header(
7384 ::reqwest::header::ACCEPT,
7385 ::reqwest::header::HeaderValue::from_static("application/json"),
7386 )
7387 .headers(header_map)
7388 .build()?;
7389 let info = OperationInfo {
7390 operation_id: "get_current_user",
7391 };
7392 self.pre(&mut request, &info).await?;
7393 let result = self.exec(request, &info).await;
7394 self.post(&result, &info).await?;
7395 let response = result?;
7396 match response.status().as_u16() {
7397 200u16 => ResponseValue::from_response(response).await,
7398 _ => Err(Error::UnexpectedResponse(response)),
7399 }
7400 }
7401
7402 ///Delete the current user's account
7403 ///
7404 ///Sends a `DELETE` request to `/api/v0/user`
7405 pub async fn delete_current_user<'a>(
7406 &'a self,
7407 ) -> Result<ResponseValue<()>, Error<types::Error>> {
7408 let url = format!("{}/api/v0/user", self.baseurl,);
7409 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7410 header_map.append(
7411 ::reqwest::header::HeaderName::from_static("api-version"),
7412 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7413 );
7414 #[allow(unused_mut)]
7415 let mut request = self
7416 .client
7417 .delete(url)
7418 .header(
7419 ::reqwest::header::ACCEPT,
7420 ::reqwest::header::HeaderValue::from_static("application/json"),
7421 )
7422 .headers(header_map)
7423 .build()?;
7424 let info = OperationInfo {
7425 operation_id: "delete_current_user",
7426 };
7427 self.pre(&mut request, &info).await?;
7428 let result = self.exec(request, &info).await;
7429 self.post(&result, &info).await?;
7430 let response = result?;
7431 match response.status().as_u16() {
7432 204u16 => Ok(ResponseValue::empty(response)),
7433 409u16 => Err(Error::ErrorResponse(
7434 ResponseValue::from_response(response).await?,
7435 )),
7436 _ => Err(Error::UnexpectedResponse(response)),
7437 }
7438 }
7439
7440 ///Update the current user's display name
7441 ///
7442 ///Sends a `PATCH` request to `/api/v0/user`
7443 ///
7444 ///Arguments:
7445 /// - `body`: Profile update
7446 pub async fn update_current_user<'a>(
7447 &'a self,
7448 body: &'a types::UserUpdateRequest,
7449 ) -> Result<ResponseValue<types::CurrentUserResponse>, Error<types::Error>> {
7450 let url = format!("{}/api/v0/user", self.baseurl,);
7451 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7452 header_map.append(
7453 ::reqwest::header::HeaderName::from_static("api-version"),
7454 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7455 );
7456 #[allow(unused_mut)]
7457 let mut request = self
7458 .client
7459 .patch(url)
7460 .header(
7461 ::reqwest::header::ACCEPT,
7462 ::reqwest::header::HeaderValue::from_static("application/json"),
7463 )
7464 .json(&body)
7465 .headers(header_map)
7466 .build()?;
7467 let info = OperationInfo {
7468 operation_id: "update_current_user",
7469 };
7470 self.pre(&mut request, &info).await?;
7471 let result = self.exec(request, &info).await;
7472 self.post(&result, &info).await?;
7473 let response = result?;
7474 match response.status().as_u16() {
7475 200u16 => ResponseValue::from_response(response).await,
7476 422u16 => Err(Error::ErrorResponse(
7477 ResponseValue::from_response(response).await?,
7478 )),
7479 _ => Err(Error::UnexpectedResponse(response)),
7480 }
7481 }
7482
7483 ///List connected Bitbucket workspaces
7484 ///
7485 ///Returns the organization's connected, non-deleted Bitbucket workspaces.
7486 ///
7487 ///Sends a `GET` request to
7488 /// `/api/v0/organizations/{org}/bitbucket/workspaces`
7489 ///
7490 ///Arguments:
7491 /// - `org`: The organization slug.
7492 pub async fn list_bitbucket_workspaces<'a>(
7493 &'a self,
7494 org: &'a str,
7495 ) -> Result<ResponseValue<types::BitbucketWorkspaceList>, Error<types::Error>> {
7496 let url = format!(
7497 "{}/api/v0/organizations/{}/bitbucket/workspaces",
7498 self.baseurl,
7499 encode_path(&org.to_string()),
7500 );
7501 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7502 header_map.append(
7503 ::reqwest::header::HeaderName::from_static("api-version"),
7504 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7505 );
7506 #[allow(unused_mut)]
7507 let mut request = self
7508 .client
7509 .get(url)
7510 .header(
7511 ::reqwest::header::ACCEPT,
7512 ::reqwest::header::HeaderValue::from_static("application/json"),
7513 )
7514 .headers(header_map)
7515 .build()?;
7516 let info = OperationInfo {
7517 operation_id: "list_bitbucket_workspaces",
7518 };
7519 self.pre(&mut request, &info).await?;
7520 let result = self.exec(request, &info).await;
7521 self.post(&result, &info).await?;
7522 let response = result?;
7523 match response.status().as_u16() {
7524 200u16 => ResponseValue::from_response(response).await,
7525 404u16 => Err(Error::ErrorResponse(
7526 ResponseValue::from_response(response).await?,
7527 )),
7528 _ => Err(Error::UnexpectedResponse(response)),
7529 }
7530 }
7531
7532 ///Remove a member
7533 ///
7534 ///Sends a `DELETE` request to
7535 /// `/api/v0/organizations/{org}/members/{user_id}`
7536 ///
7537 ///Arguments:
7538 /// - `org`:
7539 /// - `user_id`:
7540 pub async fn remove_org_member<'a>(
7541 &'a self,
7542 org: &'a str,
7543 user_id: &'a str,
7544 ) -> Result<ResponseValue<()>, Error<types::Error>> {
7545 let url = format!(
7546 "{}/api/v0/organizations/{}/members/{}",
7547 self.baseurl,
7548 encode_path(&org.to_string()),
7549 encode_path(&user_id.to_string()),
7550 );
7551 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7552 header_map.append(
7553 ::reqwest::header::HeaderName::from_static("api-version"),
7554 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7555 );
7556 #[allow(unused_mut)]
7557 let mut request = self
7558 .client
7559 .delete(url)
7560 .header(
7561 ::reqwest::header::ACCEPT,
7562 ::reqwest::header::HeaderValue::from_static("application/json"),
7563 )
7564 .headers(header_map)
7565 .build()?;
7566 let info = OperationInfo {
7567 operation_id: "remove_org_member",
7568 };
7569 self.pre(&mut request, &info).await?;
7570 let result = self.exec(request, &info).await;
7571 self.post(&result, &info).await?;
7572 let response = result?;
7573 match response.status().as_u16() {
7574 204u16 => Ok(ResponseValue::empty(response)),
7575 403u16 => Err(Error::ErrorResponse(
7576 ResponseValue::from_response(response).await?,
7577 )),
7578 404u16 => Err(Error::ErrorResponse(
7579 ResponseValue::from_response(response).await?,
7580 )),
7581 409u16 => Err(Error::ErrorResponse(
7582 ResponseValue::from_response(response).await?,
7583 )),
7584 _ => Err(Error::UnexpectedResponse(response)),
7585 }
7586 }
7587
7588 ///Change a member's role
7589 ///
7590 ///Sends a `PATCH` request to
7591 /// `/api/v0/organizations/{org}/members/{user_id}`
7592 ///
7593 ///Arguments:
7594 /// - `org`:
7595 /// - `user_id`:
7596 /// - `body`: New role
7597 pub async fn update_org_member<'a>(
7598 &'a self,
7599 org: &'a str,
7600 user_id: &'a str,
7601 body: &'a types::UpdateMemberRoleRequest,
7602 ) -> Result<ResponseValue<types::OrgMember>, Error<types::Error>> {
7603 let url = format!(
7604 "{}/api/v0/organizations/{}/members/{}",
7605 self.baseurl,
7606 encode_path(&org.to_string()),
7607 encode_path(&user_id.to_string()),
7608 );
7609 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7610 header_map.append(
7611 ::reqwest::header::HeaderName::from_static("api-version"),
7612 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7613 );
7614 #[allow(unused_mut)]
7615 let mut request = self
7616 .client
7617 .patch(url)
7618 .header(
7619 ::reqwest::header::ACCEPT,
7620 ::reqwest::header::HeaderValue::from_static("application/json"),
7621 )
7622 .json(&body)
7623 .headers(header_map)
7624 .build()?;
7625 let info = OperationInfo {
7626 operation_id: "update_org_member",
7627 };
7628 self.pre(&mut request, &info).await?;
7629 let result = self.exec(request, &info).await;
7630 self.post(&result, &info).await?;
7631 let response = result?;
7632 match response.status().as_u16() {
7633 200u16 => ResponseValue::from_response(response).await,
7634 403u16 => Err(Error::ErrorResponse(
7635 ResponseValue::from_response(response).await?,
7636 )),
7637 404u16 => Err(Error::ErrorResponse(
7638 ResponseValue::from_response(response).await?,
7639 )),
7640 409u16 => Err(Error::ErrorResponse(
7641 ResponseValue::from_response(response).await?,
7642 )),
7643 422u16 => Err(Error::ErrorResponse(
7644 ResponseValue::from_response(response).await?,
7645 )),
7646 _ => Err(Error::UnexpectedResponse(response)),
7647 }
7648 }
7649
7650 ///List an organization's pipelines
7651 ///
7652 ///Returns the organization's non-archived pipelines, paginated. A slug the
7653 /// user cannot access is reported as 404.
7654 ///
7655 ///Sends a `GET` request to `/api/v0/organizations/{org}/pipelines`
7656 ///
7657 ///Arguments:
7658 /// - `org`: The organization slug.
7659 /// - `cursor`: Opaque cursor from a previous page's `next_cursor`.
7660 /// - `limit`: Page size (1–100, default 50).
7661 pub async fn list_pipelines<'a>(
7662 &'a self,
7663 org: &'a str,
7664 cursor: Option<&'a str>,
7665 limit: Option<i64>,
7666 ) -> Result<ResponseValue<types::PipelineList>, Error<types::Error>> {
7667 let url = format!(
7668 "{}/api/v0/organizations/{}/pipelines",
7669 self.baseurl,
7670 encode_path(&org.to_string()),
7671 );
7672 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7673 header_map.append(
7674 ::reqwest::header::HeaderName::from_static("api-version"),
7675 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7676 );
7677 #[allow(unused_mut)]
7678 let mut request = self
7679 .client
7680 .get(url)
7681 .header(
7682 ::reqwest::header::ACCEPT,
7683 ::reqwest::header::HeaderValue::from_static("application/json"),
7684 )
7685 .query(&progenitor_client::QueryParam::new("cursor", &cursor))
7686 .query(&progenitor_client::QueryParam::new("limit", &limit))
7687 .headers(header_map)
7688 .build()?;
7689 let info = OperationInfo {
7690 operation_id: "list_pipelines",
7691 };
7692 self.pre(&mut request, &info).await?;
7693 let result = self.exec(request, &info).await;
7694 self.post(&result, &info).await?;
7695 let response = result?;
7696 match response.status().as_u16() {
7697 200u16 => ResponseValue::from_response(response).await,
7698 404u16 => Err(Error::ErrorResponse(
7699 ResponseValue::from_response(response).await?,
7700 )),
7701 _ => Err(Error::UnexpectedResponse(response)),
7702 }
7703 }
7704
7705 ///Create a pipeline
7706 ///
7707 ///Creates a pipeline in the organization. The slug is derived from the
7708 /// name; a colliding slug within the organization yields 422.
7709 ///
7710 ///Sends a `POST` request to `/api/v0/organizations/{org}/pipelines`
7711 ///
7712 ///Arguments:
7713 /// - `org`: The organization slug.
7714 /// - `body`: Pipeline attributes
7715 pub async fn create_pipeline<'a>(
7716 &'a self,
7717 org: &'a str,
7718 body: &'a types::CreatePipelineRequest,
7719 ) -> Result<ResponseValue<types::Pipeline>, Error<types::Error>> {
7720 let url = format!(
7721 "{}/api/v0/organizations/{}/pipelines",
7722 self.baseurl,
7723 encode_path(&org.to_string()),
7724 );
7725 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7726 header_map.append(
7727 ::reqwest::header::HeaderName::from_static("api-version"),
7728 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7729 );
7730 #[allow(unused_mut)]
7731 let mut request = self
7732 .client
7733 .post(url)
7734 .header(
7735 ::reqwest::header::ACCEPT,
7736 ::reqwest::header::HeaderValue::from_static("application/json"),
7737 )
7738 .json(&body)
7739 .headers(header_map)
7740 .build()?;
7741 let info = OperationInfo {
7742 operation_id: "create_pipeline",
7743 };
7744 self.pre(&mut request, &info).await?;
7745 let result = self.exec(request, &info).await;
7746 self.post(&result, &info).await?;
7747 let response = result?;
7748 match response.status().as_u16() {
7749 201u16 => ResponseValue::from_response(response).await,
7750 404u16 => Err(Error::ErrorResponse(
7751 ResponseValue::from_response(response).await?,
7752 )),
7753 422u16 => Err(Error::ErrorResponse(
7754 ResponseValue::from_response(response).await?,
7755 )),
7756 _ => Err(Error::UnexpectedResponse(response)),
7757 }
7758 }
7759
7760 ///Liveness probe
7761 ///
7762 ///Returns `{"status": "ok"}` if the API is up. No auth required.
7763 ///
7764 ///Sends a `GET` request to `/api/v0/ping`
7765 pub async fn ping<'a>(&'a self) -> Result<ResponseValue<types::PingResponse>, Error<()>> {
7766 let url = format!("{}/api/v0/ping", self.baseurl,);
7767 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7768 header_map.append(
7769 ::reqwest::header::HeaderName::from_static("api-version"),
7770 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7771 );
7772 #[allow(unused_mut)]
7773 let mut request = self
7774 .client
7775 .get(url)
7776 .header(
7777 ::reqwest::header::ACCEPT,
7778 ::reqwest::header::HeaderValue::from_static("application/json"),
7779 )
7780 .headers(header_map)
7781 .build()?;
7782 let info = OperationInfo {
7783 operation_id: "ping",
7784 };
7785 self.pre(&mut request, &info).await?;
7786 let result = self.exec(request, &info).await;
7787 self.post(&result, &info).await?;
7788 let response = result?;
7789 match response.status().as_u16() {
7790 200u16 => ResponseValue::from_response(response).await,
7791 _ => Err(Error::UnexpectedResponse(response)),
7792 }
7793 }
7794
7795 ///Delete one of the current user's passkeys
7796 ///
7797 ///Removes the passkey. Refused with 409 `passkey_last_credential` when it
7798 /// would leave the account with no passkeys. A passkey belonging to another
7799 /// user is 404.
7800 ///
7801 ///Sends a `DELETE` request to `/api/v0/user/passkeys/{uuid}`
7802 ///
7803 ///Arguments:
7804 /// - `uuid`: The passkey id.
7805 pub async fn delete_passkey<'a>(
7806 &'a self,
7807 uuid: &'a str,
7808 ) -> Result<ResponseValue<()>, Error<types::Error>> {
7809 let url = format!(
7810 "{}/api/v0/user/passkeys/{}",
7811 self.baseurl,
7812 encode_path(&uuid.to_string()),
7813 );
7814 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7815 header_map.append(
7816 ::reqwest::header::HeaderName::from_static("api-version"),
7817 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7818 );
7819 #[allow(unused_mut)]
7820 let mut request = self
7821 .client
7822 .delete(url)
7823 .header(
7824 ::reqwest::header::ACCEPT,
7825 ::reqwest::header::HeaderValue::from_static("application/json"),
7826 )
7827 .headers(header_map)
7828 .build()?;
7829 let info = OperationInfo {
7830 operation_id: "delete_passkey",
7831 };
7832 self.pre(&mut request, &info).await?;
7833 let result = self.exec(request, &info).await;
7834 self.post(&result, &info).await?;
7835 let response = result?;
7836 match response.status().as_u16() {
7837 204u16 => Ok(ResponseValue::empty(response)),
7838 404u16 => Err(Error::ErrorResponse(
7839 ResponseValue::from_response(response).await?,
7840 )),
7841 409u16 => Err(Error::ErrorResponse(
7842 ResponseValue::from_response(response).await?,
7843 )),
7844 _ => Err(Error::UnexpectedResponse(response)),
7845 }
7846 }
7847
7848 ///Get an organization
7849 ///
7850 ///Returns the organization identified by the path slug. A slug that does
7851 /// not exist or that the user is not a member of is reported as 404.
7852 ///
7853 ///Sends a `GET` request to `/api/v0/organizations/{org}`
7854 ///
7855 ///Arguments:
7856 /// - `org`: The organization slug.
7857 pub async fn get_organization<'a>(
7858 &'a self,
7859 org: &'a str,
7860 ) -> Result<ResponseValue<types::Organization>, Error<types::Error>> {
7861 let url = format!(
7862 "{}/api/v0/organizations/{}",
7863 self.baseurl,
7864 encode_path(&org.to_string()),
7865 );
7866 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7867 header_map.append(
7868 ::reqwest::header::HeaderName::from_static("api-version"),
7869 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7870 );
7871 #[allow(unused_mut)]
7872 let mut request = self
7873 .client
7874 .get(url)
7875 .header(
7876 ::reqwest::header::ACCEPT,
7877 ::reqwest::header::HeaderValue::from_static("application/json"),
7878 )
7879 .headers(header_map)
7880 .build()?;
7881 let info = OperationInfo {
7882 operation_id: "get_organization",
7883 };
7884 self.pre(&mut request, &info).await?;
7885 let result = self.exec(request, &info).await;
7886 self.post(&result, &info).await?;
7887 let response = result?;
7888 match response.status().as_u16() {
7889 200u16 => ResponseValue::from_response(response).await,
7890 404u16 => Err(Error::ErrorResponse(
7891 ResponseValue::from_response(response).await?,
7892 )),
7893 _ => Err(Error::UnexpectedResponse(response)),
7894 }
7895 }
7896
7897 ///Begin account recovery
7898 ///
7899 ///Emails a magic-link to the address if it maps to an account. Always
7900 /// returns 204 (never reveals whether the email has an account).
7901 ///
7902 ///Sends a `POST` request to `/api/v0/auth/recover/begin`
7903 ///
7904 ///Arguments:
7905 /// - `body`: Recovery request
7906 pub async fn recover_begin<'a>(
7907 &'a self,
7908 body: &'a types::RecoverBeginRequest,
7909 ) -> Result<ResponseValue<()>, Error<()>> {
7910 let url = format!("{}/api/v0/auth/recover/begin", self.baseurl,);
7911 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7912 header_map.append(
7913 ::reqwest::header::HeaderName::from_static("api-version"),
7914 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7915 );
7916 #[allow(unused_mut)]
7917 let mut request = self
7918 .client
7919 .post(url)
7920 .json(&body)
7921 .headers(header_map)
7922 .build()?;
7923 let info = OperationInfo {
7924 operation_id: "recover_begin",
7925 };
7926 self.pre(&mut request, &info).await?;
7927 let result = self.exec(request, &info).await;
7928 self.post(&result, &info).await?;
7929 let response = result?;
7930 match response.status().as_u16() {
7931 204u16 => Ok(ResponseValue::empty(response)),
7932 _ => Err(Error::UnexpectedResponse(response)),
7933 }
7934 }
7935
7936 ///Create a build by repo + source slug
7937 ///
7938 ///Creates a build by addressing the pipeline through its repo-natural
7939 /// identity (`repo_name` + `source_slug`) rather than the org-global slug.
7940 /// This is the `hm run` path. Resolution, manual-build gating, billing, and
7941 /// IR handling are otherwise identical to `createBuild`. A repo/source slug
7942 /// that matches no pipeline yields 404.
7943 ///
7944 ///Sends a `POST` request to `/api/v0/organizations/{org}/builds`
7945 ///
7946 ///Arguments:
7947 /// - `org`: The organization slug.
7948 /// - `body`: Build attributes
7949 pub async fn create_build_by_source<'a>(
7950 &'a self,
7951 org: &'a str,
7952 body: &'a types::CreateRepoBuildRequest,
7953 ) -> Result<ResponseValue<types::Build>, Error<types::Error>> {
7954 let url = format!(
7955 "{}/api/v0/organizations/{}/builds",
7956 self.baseurl,
7957 encode_path(&org.to_string()),
7958 );
7959 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
7960 header_map.append(
7961 ::reqwest::header::HeaderName::from_static("api-version"),
7962 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
7963 );
7964 #[allow(unused_mut)]
7965 let mut request = self
7966 .client
7967 .post(url)
7968 .header(
7969 ::reqwest::header::ACCEPT,
7970 ::reqwest::header::HeaderValue::from_static("application/json"),
7971 )
7972 .json(&body)
7973 .headers(header_map)
7974 .build()?;
7975 let info = OperationInfo {
7976 operation_id: "create_build_by_source",
7977 };
7978 self.pre(&mut request, &info).await?;
7979 let result = self.exec(request, &info).await;
7980 self.post(&result, &info).await?;
7981 let response = result?;
7982 match response.status().as_u16() {
7983 201u16 => ResponseValue::from_response(response).await,
7984 402u16 => Err(Error::ErrorResponse(
7985 ResponseValue::from_response(response).await?,
7986 )),
7987 403u16 => Err(Error::ErrorResponse(
7988 ResponseValue::from_response(response).await?,
7989 )),
7990 404u16 => Err(Error::ErrorResponse(
7991 ResponseValue::from_response(response).await?,
7992 )),
7993 422u16 => Err(Error::ErrorResponse(
7994 ResponseValue::from_response(response).await?,
7995 )),
7996 _ => Err(Error::UnexpectedResponse(response)),
7997 }
7998 }
7999
8000 ///Get a build
8001 ///
8002 ///Returns the build identified by its pipeline-scoped number. An unknown
8003 /// number (or one in another pipeline) is reported as 404.
8004 ///
8005 ///Sends a `GET` request to
8006 /// `/api/v0/organizations/{org}/pipelines/{pipeline}/builds/{number}`
8007 ///
8008 ///Arguments:
8009 /// - `org`: The organization slug.
8010 /// - `pipeline`: The pipeline slug.
8011 /// - `number`: The build number.
8012 pub async fn get_build<'a>(
8013 &'a self,
8014 org: &'a str,
8015 pipeline: &'a str,
8016 number: i64,
8017 ) -> Result<ResponseValue<types::Build>, Error<types::Error>> {
8018 let url = format!(
8019 "{}/api/v0/organizations/{}/pipelines/{}/builds/{}",
8020 self.baseurl,
8021 encode_path(&org.to_string()),
8022 encode_path(&pipeline.to_string()),
8023 encode_path(&number.to_string()),
8024 );
8025 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8026 header_map.append(
8027 ::reqwest::header::HeaderName::from_static("api-version"),
8028 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8029 );
8030 #[allow(unused_mut)]
8031 let mut request = self
8032 .client
8033 .get(url)
8034 .header(
8035 ::reqwest::header::ACCEPT,
8036 ::reqwest::header::HeaderValue::from_static("application/json"),
8037 )
8038 .headers(header_map)
8039 .build()?;
8040 let info = OperationInfo {
8041 operation_id: "get_build",
8042 };
8043 self.pre(&mut request, &info).await?;
8044 let result = self.exec(request, &info).await;
8045 self.post(&result, &info).await?;
8046 let response = result?;
8047 match response.status().as_u16() {
8048 200u16 => ResponseValue::from_response(response).await,
8049 404u16 => Err(Error::ErrorResponse(
8050 ResponseValue::from_response(response).await?,
8051 )),
8052 _ => Err(Error::UnexpectedResponse(response)),
8053 }
8054 }
8055
8056 ///Get an organization's VM usage
8057 ///
8058 ///Aggregates the organization's VM-lease usage over the half-open window
8059 /// `[from, to)` (both ISO-8601 timestamps): resource-seconds per dimension
8060 /// and the total billed cost in cents. Both `from` and `to` are required.
8061 ///
8062 ///Sends a `GET` request to `/api/v0/billing/usage/{org}`
8063 ///
8064 ///Arguments:
8065 /// - `org`: The organization slug.
8066 /// - `from`: Window start (inclusive), ISO-8601.
8067 /// - `to`: Window end (exclusive), ISO-8601.
8068 pub async fn get_billing_usage<'a>(
8069 &'a self,
8070 org: &'a str,
8071 from: &'a str,
8072 to: &'a str,
8073 ) -> Result<ResponseValue<types::UsageResponse>, Error<types::Error>> {
8074 let url = format!(
8075 "{}/api/v0/billing/usage/{}",
8076 self.baseurl,
8077 encode_path(&org.to_string()),
8078 );
8079 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8080 header_map.append(
8081 ::reqwest::header::HeaderName::from_static("api-version"),
8082 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8083 );
8084 #[allow(unused_mut)]
8085 let mut request = self
8086 .client
8087 .get(url)
8088 .header(
8089 ::reqwest::header::ACCEPT,
8090 ::reqwest::header::HeaderValue::from_static("application/json"),
8091 )
8092 .query(&progenitor_client::QueryParam::new("from", &from))
8093 .query(&progenitor_client::QueryParam::new("to", &to))
8094 .headers(header_map)
8095 .build()?;
8096 let info = OperationInfo {
8097 operation_id: "get_billing_usage",
8098 };
8099 self.pre(&mut request, &info).await?;
8100 let result = self.exec(request, &info).await;
8101 self.post(&result, &info).await?;
8102 let response = result?;
8103 match response.status().as_u16() {
8104 200u16 => ResponseValue::from_response(response).await,
8105 404u16 => Err(Error::ErrorResponse(
8106 ResponseValue::from_response(response).await?,
8107 )),
8108 422u16 => Err(Error::ErrorResponse(
8109 ResponseValue::from_response(response).await?,
8110 )),
8111 _ => Err(Error::UnexpectedResponse(response)),
8112 }
8113 }
8114
8115 ///Get a pipeline
8116 ///
8117 ///Returns the pipeline identified by the path slug within the
8118 /// organization. An unknown slug (or one in another organization) is
8119 /// reported as 404.
8120 ///
8121 ///Sends a `GET` request to
8122 /// `/api/v0/organizations/{org}/pipelines/{pipeline}`
8123 ///
8124 ///Arguments:
8125 /// - `org`: The organization slug.
8126 /// - `pipeline`: The pipeline slug.
8127 pub async fn get_pipeline<'a>(
8128 &'a self,
8129 org: &'a str,
8130 pipeline: &'a str,
8131 ) -> Result<ResponseValue<types::Pipeline>, Error<types::Error>> {
8132 let url = format!(
8133 "{}/api/v0/organizations/{}/pipelines/{}",
8134 self.baseurl,
8135 encode_path(&org.to_string()),
8136 encode_path(&pipeline.to_string()),
8137 );
8138 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8139 header_map.append(
8140 ::reqwest::header::HeaderName::from_static("api-version"),
8141 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8142 );
8143 #[allow(unused_mut)]
8144 let mut request = self
8145 .client
8146 .get(url)
8147 .header(
8148 ::reqwest::header::ACCEPT,
8149 ::reqwest::header::HeaderValue::from_static("application/json"),
8150 )
8151 .headers(header_map)
8152 .build()?;
8153 let info = OperationInfo {
8154 operation_id: "get_pipeline",
8155 };
8156 self.pre(&mut request, &info).await?;
8157 let result = self.exec(request, &info).await;
8158 self.post(&result, &info).await?;
8159 let response = result?;
8160 match response.status().as_u16() {
8161 200u16 => ResponseValue::from_response(response).await,
8162 404u16 => Err(Error::ErrorResponse(
8163 ResponseValue::from_response(response).await?,
8164 )),
8165 _ => Err(Error::UnexpectedResponse(response)),
8166 }
8167 }
8168
8169 ///Finalize adding a passkey
8170 ///
8171 ///Verifies the attestation against the register challenge and stores the
8172 /// new passkey for the current user.
8173 ///
8174 ///Sends a `POST` request to `/api/v0/auth/passkey/register/finalize`
8175 ///
8176 ///Arguments:
8177 /// - `body`: Finalize request
8178 pub async fn passkey_register_finalize<'a>(
8179 &'a self,
8180 body: &'a types::PasskeyRegisterFinalizeRequest,
8181 ) -> Result<ResponseValue<types::Passkey>, Error<types::Error>> {
8182 let url = format!("{}/api/v0/auth/passkey/register/finalize", self.baseurl,);
8183 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8184 header_map.append(
8185 ::reqwest::header::HeaderName::from_static("api-version"),
8186 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8187 );
8188 #[allow(unused_mut)]
8189 let mut request = self
8190 .client
8191 .post(url)
8192 .header(
8193 ::reqwest::header::ACCEPT,
8194 ::reqwest::header::HeaderValue::from_static("application/json"),
8195 )
8196 .json(&body)
8197 .headers(header_map)
8198 .build()?;
8199 let info = OperationInfo {
8200 operation_id: "passkey_register_finalize",
8201 };
8202 self.pre(&mut request, &info).await?;
8203 let result = self.exec(request, &info).await;
8204 self.post(&result, &info).await?;
8205 let response = result?;
8206 match response.status().as_u16() {
8207 200u16 => ResponseValue::from_response(response).await,
8208 400u16 => Err(Error::ErrorResponse(
8209 ResponseValue::from_response(response).await?,
8210 )),
8211 401u16 => Err(Error::ErrorResponse(
8212 ResponseValue::from_response(response).await?,
8213 )),
8214 409u16 => Err(Error::ErrorResponse(
8215 ResponseValue::from_response(response).await?,
8216 )),
8217 _ => Err(Error::UnexpectedResponse(response)),
8218 }
8219 }
8220
8221 ///Revoke one of the current user's API keys
8222 ///
8223 ///Sends a `DELETE` request to `/api/v0/user/api-tokens/{id}`
8224 ///
8225 ///Arguments:
8226 /// - `id`: The API key id.
8227 pub async fn revoke_api_token<'a>(
8228 &'a self,
8229 id: &'a str,
8230 ) -> Result<ResponseValue<()>, Error<types::Error>> {
8231 let url = format!(
8232 "{}/api/v0/user/api-tokens/{}",
8233 self.baseurl,
8234 encode_path(&id.to_string()),
8235 );
8236 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8237 header_map.append(
8238 ::reqwest::header::HeaderName::from_static("api-version"),
8239 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8240 );
8241 #[allow(unused_mut)]
8242 let mut request = self
8243 .client
8244 .delete(url)
8245 .header(
8246 ::reqwest::header::ACCEPT,
8247 ::reqwest::header::HeaderValue::from_static("application/json"),
8248 )
8249 .headers(header_map)
8250 .build()?;
8251 let info = OperationInfo {
8252 operation_id: "revoke_api_token",
8253 };
8254 self.pre(&mut request, &info).await?;
8255 let result = self.exec(request, &info).await;
8256 self.post(&result, &info).await?;
8257 let response = result?;
8258 match response.status().as_u16() {
8259 204u16 => Ok(ResponseValue::empty(response)),
8260 404u16 => Err(Error::ErrorResponse(
8261 ResponseValue::from_response(response).await?,
8262 )),
8263 _ => Err(Error::UnexpectedResponse(response)),
8264 }
8265 }
8266
8267 ///Get an organization's balance
8268 ///
8269 ///Returns the organization's current balance in cents — the sum of every
8270 /// ledger entry (credits positive, debits negative). May be negative.
8271 ///
8272 ///Sends a `GET` request to `/api/v0/billing/balance/{org}`
8273 ///
8274 ///Arguments:
8275 /// - `org`: The organization slug.
8276 pub async fn get_billing_balance<'a>(
8277 &'a self,
8278 org: &'a str,
8279 ) -> Result<ResponseValue<types::BalanceResponse>, Error<types::Error>> {
8280 let url = format!(
8281 "{}/api/v0/billing/balance/{}",
8282 self.baseurl,
8283 encode_path(&org.to_string()),
8284 );
8285 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8286 header_map.append(
8287 ::reqwest::header::HeaderName::from_static("api-version"),
8288 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8289 );
8290 #[allow(unused_mut)]
8291 let mut request = self
8292 .client
8293 .get(url)
8294 .header(
8295 ::reqwest::header::ACCEPT,
8296 ::reqwest::header::HeaderValue::from_static("application/json"),
8297 )
8298 .headers(header_map)
8299 .build()?;
8300 let info = OperationInfo {
8301 operation_id: "get_billing_balance",
8302 };
8303 self.pre(&mut request, &info).await?;
8304 let result = self.exec(request, &info).await;
8305 self.post(&result, &info).await?;
8306 let response = result?;
8307 match response.status().as_u16() {
8308 200u16 => ResponseValue::from_response(response).await,
8309 404u16 => Err(Error::ErrorResponse(
8310 ResponseValue::from_response(response).await?,
8311 )),
8312 _ => Err(Error::UnexpectedResponse(response)),
8313 }
8314 }
8315
8316 ///Get passkey login options
8317 ///
8318 ///Starts a discoverable-credential login: returns WebAuthn request options
8319 /// with an empty allow-list plus the server-side challenge id.
8320 ///
8321 ///Sends a `POST` request to `/api/v0/auth/passkey/login/options`
8322 ///
8323 ///Arguments:
8324 /// - `body`: Login options request
8325 pub async fn passkey_login_options<'a>(
8326 &'a self,
8327 body: &'a types::PasskeyLoginOptionsRequest,
8328 ) -> Result<ResponseValue<types::PasskeyChallengeResponse>, Error<()>> {
8329 let url = format!("{}/api/v0/auth/passkey/login/options", self.baseurl,);
8330 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8331 header_map.append(
8332 ::reqwest::header::HeaderName::from_static("api-version"),
8333 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8334 );
8335 #[allow(unused_mut)]
8336 let mut request = self
8337 .client
8338 .post(url)
8339 .header(
8340 ::reqwest::header::ACCEPT,
8341 ::reqwest::header::HeaderValue::from_static("application/json"),
8342 )
8343 .json(&body)
8344 .headers(header_map)
8345 .build()?;
8346 let info = OperationInfo {
8347 operation_id: "passkey_login_options",
8348 };
8349 self.pre(&mut request, &info).await?;
8350 let result = self.exec(request, &info).await;
8351 self.post(&result, &info).await?;
8352 let response = result?;
8353 match response.status().as_u16() {
8354 200u16 => ResponseValue::from_response(response).await,
8355 _ => Err(Error::UnexpectedResponse(response)),
8356 }
8357 }
8358
8359 ///Redeem a coupon for an organization
8360 ///
8361 ///Redeems a coupon code for the organization identified by the path,
8362 /// crediting the org and returning the credit and resulting balance. The
8363 /// org is taken from the route; the body carries only the coupon `code`.
8364 /// Idempotent per org: a second redemption of the same coupon returns `409
8365 /// coupon_already_claimed`.
8366 ///
8367 ///Sends a `POST` request to `/api/v0/billing/coupon/redeem/{org}`
8368 ///
8369 ///Arguments:
8370 /// - `org`: The organization slug.
8371 /// - `body`: The coupon to redeem
8372 pub async fn redeem_coupon<'a>(
8373 &'a self,
8374 org: &'a str,
8375 body: &'a types::RedeemCouponRequest,
8376 ) -> Result<ResponseValue<types::RedeemCouponResponse>, Error<types::Error>> {
8377 let url = format!(
8378 "{}/api/v0/billing/coupon/redeem/{}",
8379 self.baseurl,
8380 encode_path(&org.to_string()),
8381 );
8382 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8383 header_map.append(
8384 ::reqwest::header::HeaderName::from_static("api-version"),
8385 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8386 );
8387 #[allow(unused_mut)]
8388 let mut request = self
8389 .client
8390 .post(url)
8391 .header(
8392 ::reqwest::header::ACCEPT,
8393 ::reqwest::header::HeaderValue::from_static("application/json"),
8394 )
8395 .json(&body)
8396 .headers(header_map)
8397 .build()?;
8398 let info = OperationInfo {
8399 operation_id: "redeem_coupon",
8400 };
8401 self.pre(&mut request, &info).await?;
8402 let result = self.exec(request, &info).await;
8403 self.post(&result, &info).await?;
8404 let response = result?;
8405 match response.status().as_u16() {
8406 200u16 => ResponseValue::from_response(response).await,
8407 404u16 => Err(Error::ErrorResponse(
8408 ResponseValue::from_response(response).await?,
8409 )),
8410 409u16 => Err(Error::ErrorResponse(
8411 ResponseValue::from_response(response).await?,
8412 )),
8413 422u16 => Err(Error::ErrorResponse(
8414 ResponseValue::from_response(response).await?,
8415 )),
8416 _ => Err(Error::UnexpectedResponse(response)),
8417 }
8418 }
8419
8420 ///Per-day usage time-series
8421 ///
8422 ///Sends a `GET` request to `/api/v0/billing/usage/{org}/series`
8423 ///
8424 ///Arguments:
8425 /// - `org`: Organization slug.
8426 /// - `from`: ISO-8601 window start (inclusive).
8427 /// - `to`: ISO-8601 window end (exclusive).
8428 pub async fn get_billing_usage_series<'a>(
8429 &'a self,
8430 org: &'a str,
8431 from: &'a str,
8432 to: &'a str,
8433 ) -> Result<ResponseValue<types::UsageSeriesResponse>, Error<types::Error>> {
8434 let url = format!(
8435 "{}/api/v0/billing/usage/{}/series",
8436 self.baseurl,
8437 encode_path(&org.to_string()),
8438 );
8439 let mut header_map = ::reqwest::header::HeaderMap::with_capacity(1usize);
8440 header_map.append(
8441 ::reqwest::header::HeaderName::from_static("api-version"),
8442 ::reqwest::header::HeaderValue::from_static(Self::api_version()),
8443 );
8444 #[allow(unused_mut)]
8445 let mut request = self
8446 .client
8447 .get(url)
8448 .header(
8449 ::reqwest::header::ACCEPT,
8450 ::reqwest::header::HeaderValue::from_static("application/json"),
8451 )
8452 .query(&progenitor_client::QueryParam::new("from", &from))
8453 .query(&progenitor_client::QueryParam::new("to", &to))
8454 .headers(header_map)
8455 .build()?;
8456 let info = OperationInfo {
8457 operation_id: "get_billing_usage_series",
8458 };
8459 self.pre(&mut request, &info).await?;
8460 let result = self.exec(request, &info).await;
8461 self.post(&result, &info).await?;
8462 let response = result?;
8463 match response.status().as_u16() {
8464 200u16 => ResponseValue::from_response(response).await,
8465 404u16 => Err(Error::ErrorResponse(
8466 ResponseValue::from_response(response).await?,
8467 )),
8468 422u16 => Err(Error::ErrorResponse(
8469 ResponseValue::from_response(response).await?,
8470 )),
8471 _ => Err(Error::UnexpectedResponse(response)),
8472 }
8473 }
8474}
8475
8476/// Items consumers will typically use such as the Client.
8477pub mod prelude {
8478 #[allow(unused_imports)]
8479 pub use super::Client;
8480}