1#![allow(clippy::too_many_arguments)]
5
6use reqwest::Method;
7
8use crate::client::{json_body, Request, RequestOptions, Wellfriend};
9use crate::error::Result;
10#[allow(unused_imports)]
11use crate::generated::models::*;
12#[allow(unused_imports)]
13use crate::models::*;
14#[allow(unused_imports)]
15use crate::webhooks::Webhooks;
16#[allow(unused_imports)]
17use crate::{Download, FileInput, Object, Page, PageStream};
18
19#[derive(Clone, Debug)]
21pub struct Platform {
22 pub(crate) client: Wellfriend,
23 pub(crate) options: RequestOptions,
24}
25
26impl Platform {
27 pub fn with_options(mut self, options: RequestOptions) -> Self {
29 self.options = options;
30 self
31 }
32
33 pub async fn capabilities_list(&self, params: Option<ListParams>) -> Result<Page<Object>> {
37 let request = Request::new(Method::GET, ["capabilities".to_owned()])
38 .query("limit", params.as_ref().and_then(|p| p.limit.as_ref()))
39 .query("cursor", params.as_ref().and_then(|p| p.cursor.as_ref()));
40 self.client.json(&self.options, request).await
41 }
42
43 pub fn capabilities_stream(&self, params: Option<ListParams>) -> PageStream<Object> {
45 let this = self.clone();
46 let params = params.unwrap_or_default();
47 crate::pagination::paginate(move |cursor| {
48 let this = this.clone();
49 let mut params = params.clone();
50 if cursor.is_some() {
51 params.cursor = cursor;
52 }
53 Box::pin(async move { this.capabilities_list(Some(params)).await })
54 })
55 }
56}
57
58#[derive(Clone, Debug)]
60pub struct Pricing {
61 pub(crate) client: Wellfriend,
62 pub(crate) options: RequestOptions,
63}
64
65impl Pricing {
66 pub fn with_options(mut self, options: RequestOptions) -> Self {
68 self.options = options;
69 self
70 }
71
72 pub async fn quote(&self, body: Option<PricingQuoteRequest>) -> Result<Quote> {
76 let request = Request::new(Method::POST, ["quote".to_owned()])
77 .json(json_body(&body.unwrap_or_default(), None)?);
78 self.client
79 .json_field(&self.options, request, "quote")
80 .await
81 }
82}
83
84#[derive(Clone, Debug)]
86pub struct Workflows {
87 pub(crate) client: Wellfriend,
88 pub(crate) options: RequestOptions,
89}
90
91impl Workflows {
92 pub fn with_options(mut self, options: RequestOptions) -> Self {
94 self.options = options;
95 self
96 }
97
98 pub async fn validate(&self, body: WorkflowsValidateRequest) -> Result<Object> {
102 let request = Request::new(
103 Method::POST,
104 ["workflows".to_owned(), "validate".to_owned()],
105 )
106 .json(json_body(&body, None)?);
107 self.client.json(&self.options, request).await
108 }
109
110 pub async fn create(&self, body: WorkflowsCreateRequest) -> Result<Workflow> {
114 let key = self.options.key();
115 let request = Request::new(Method::POST, ["workflows".to_owned()])
116 .json(json_body(&body, Some(&key))?)
117 .idempotency_key(key);
118 self.client
119 .json_field(&self.options, request, "workflow")
120 .await
121 }
122
123 pub async fn list(&self, params: Option<ListParams>) -> Result<Page<Workflow>> {
127 let request = Request::new(Method::GET, ["workflows".to_owned()])
128 .query("limit", params.as_ref().and_then(|p| p.limit.as_ref()))
129 .query("cursor", params.as_ref().and_then(|p| p.cursor.as_ref()));
130 self.client.json(&self.options, request).await
131 }
132
133 pub fn stream(&self, params: Option<ListParams>) -> PageStream<Workflow> {
135 let this = self.clone();
136 let params = params.unwrap_or_default();
137 crate::pagination::paginate(move |cursor| {
138 let this = this.clone();
139 let mut params = params.clone();
140 if cursor.is_some() {
141 params.cursor = cursor;
142 }
143 Box::pin(async move { this.list(Some(params)).await })
144 })
145 }
146
147 pub async fn get(&self, workflow_id: &str) -> Result<Workflow> {
151 let request = Request::new(
152 Method::GET,
153 ["workflows".to_owned(), workflow_id.to_owned()],
154 );
155 self.client
156 .json_field(&self.options, request, "workflow")
157 .await
158 }
159
160 pub async fn update(
164 &self,
165 workflow_id: &str,
166 body: WorkflowsUpdateRequest,
167 ) -> Result<Workflow> {
168 let request = Request::new(
169 Method::PATCH,
170 ["workflows".to_owned(), workflow_id.to_owned()],
171 )
172 .json(json_body(&body, None)?);
173 self.client
174 .json_field(&self.options, request, "workflow")
175 .await
176 }
177
178 pub async fn publish(
182 &self,
183 workflow_id: &str,
184 body: WorkflowsPublishRequest,
185 ) -> Result<Workflow> {
186 let request = Request::new(
187 Method::POST,
188 [
189 "workflows".to_owned(),
190 workflow_id.to_owned(),
191 "publish".to_owned(),
192 ],
193 )
194 .json(json_body(&body, None)?);
195 self.client
196 .json_field(&self.options, request, "workflow")
197 .await
198 }
199}
200
201impl Webhooks {
202 pub async fn verify_remote(&self, body: Option<WebhooksVerifyRemoteRequest>) -> Result<Object> {
206 let request = Request::new(Method::POST, ["webhooks".to_owned(), "verify".to_owned()])
207 .json(json_body(&body.unwrap_or_default(), None)?);
208 self.client.json(&self.options, request).await
209 }
210
211 pub async fn endpoints_create(&self, body: WebhooksEndpointsCreateRequest) -> Result<Object> {
215 let key = self.options.key();
216 let request = Request::new(Method::POST, ["webhook-endpoints".to_owned()])
217 .json(json_body(&body, Some(&key))?)
218 .idempotency_key(key);
219 self.client.json(&self.options, request).await
220 }
221
222 pub async fn endpoints_list(&self, params: Option<ListParams>) -> Result<Page<Object>> {
226 let request = Request::new(Method::GET, ["webhook-endpoints".to_owned()])
227 .query("limit", params.as_ref().and_then(|p| p.limit.as_ref()))
228 .query("cursor", params.as_ref().and_then(|p| p.cursor.as_ref()));
229 self.client.json(&self.options, request).await
230 }
231
232 pub fn endpoints_stream(&self, params: Option<ListParams>) -> PageStream<Object> {
234 let this = self.clone();
235 let params = params.unwrap_or_default();
236 crate::pagination::paginate(move |cursor| {
237 let this = this.clone();
238 let mut params = params.clone();
239 if cursor.is_some() {
240 params.cursor = cursor;
241 }
242 Box::pin(async move { this.endpoints_list(Some(params)).await })
243 })
244 }
245
246 pub async fn endpoints_get(&self, endpoint_id: &str) -> Result<WebhooksEndpointsGetResponse> {
250 let request = Request::new(
251 Method::GET,
252 ["webhook-endpoints".to_owned(), endpoint_id.to_owned()],
253 );
254 self.client.json(&self.options, request).await
255 }
256
257 pub async fn endpoints_update(
261 &self,
262 endpoint_id: &str,
263 body: Option<WebhooksEndpointsUpdateRequest>,
264 ) -> Result<WebhooksEndpointsGetResponse> {
265 let request = Request::new(
266 Method::PATCH,
267 ["webhook-endpoints".to_owned(), endpoint_id.to_owned()],
268 )
269 .json(json_body(&body.unwrap_or_default(), None)?);
270 self.client.json(&self.options, request).await
271 }
272
273 pub async fn endpoints_delete(
277 &self,
278 endpoint_id: &str,
279 body: WebhooksEndpointsDeleteRequest,
280 ) -> Result<WebhooksEndpointsDeleteResponse> {
281 let request = Request::new(
282 Method::DELETE,
283 ["webhook-endpoints".to_owned(), endpoint_id.to_owned()],
284 )
285 .json(json_body(&body, None)?);
286 self.client.json(&self.options, request).await
287 }
288
289 pub async fn endpoints_test(
293 &self,
294 endpoint_id: &str,
295 body: WebhooksEndpointsTestRequest,
296 ) -> Result<Object> {
297 let request = Request::new(
298 Method::POST,
299 [
300 "webhook-endpoints".to_owned(),
301 endpoint_id.to_owned(),
302 "test".to_owned(),
303 ],
304 )
305 .json(json_body(&body, None)?);
306 self.client.json(&self.options, request).await
307 }
308
309 pub async fn deliveries_list(
313 &self,
314 params: Option<ListParams>,
315 ) -> Result<Page<WebhooksDeliveriesListItem>> {
316 let request = Request::new(Method::GET, ["webhook-deliveries".to_owned()])
317 .query("limit", params.as_ref().and_then(|p| p.limit.as_ref()))
318 .query("cursor", params.as_ref().and_then(|p| p.cursor.as_ref()));
319 self.client.json(&self.options, request).await
320 }
321
322 pub fn deliveries_stream(
324 &self,
325 params: Option<ListParams>,
326 ) -> PageStream<WebhooksDeliveriesListItem> {
327 let this = self.clone();
328 let params = params.unwrap_or_default();
329 crate::pagination::paginate(move |cursor| {
330 let this = this.clone();
331 let mut params = params.clone();
332 if cursor.is_some() {
333 params.cursor = cursor;
334 }
335 Box::pin(async move { this.deliveries_list(Some(params)).await })
336 })
337 }
338
339 pub async fn deliveries_replay(
343 &self,
344 delivery_id: &str,
345 body: Option<WebhooksDeliveriesReplayRequest>,
346 ) -> Result<Object> {
347 let request = Request::new(
348 Method::POST,
349 [
350 "webhook-deliveries".to_owned(),
351 delivery_id.to_owned(),
352 "replay".to_owned(),
353 ],
354 )
355 .json(json_body(&body.unwrap_or_default(), None)?);
356 self.client.json(&self.options, request).await
357 }
358
359 pub async fn endpoints_rotate_secret(
363 &self,
364 endpoint_id: &str,
365 body: Option<WebhooksEndpointsRotateSecretRequest>,
366 ) -> Result<WebhooksEndpointsRotateSecretResponse> {
367 let request = Request::new(
368 Method::POST,
369 [
370 "webhook-endpoints".to_owned(),
371 endpoint_id.to_owned(),
372 "rotate-secret".to_owned(),
373 ],
374 )
375 .json(json_body(&body.unwrap_or_default(), None)?);
376 self.client.json(&self.options, request).await
377 }
378
379 pub async fn endpoints_replay(
383 &self,
384 endpoint_id: &str,
385 body: WebhooksEndpointsReplayRequest,
386 ) -> Result<WebhooksEndpointsReplayResponse> {
387 let request = Request::new(
388 Method::POST,
389 [
390 "webhook-endpoints".to_owned(),
391 endpoint_id.to_owned(),
392 "replay".to_owned(),
393 ],
394 )
395 .json(json_body(&body, None)?);
396 self.client.json(&self.options, request).await
397 }
398
399 pub async fn endpoints_insights(
403 &self,
404 endpoint_id: &str,
405 ) -> Result<WebhooksEndpointsInsightsResponse> {
406 let request = Request::new(
407 Method::GET,
408 [
409 "webhook-endpoints".to_owned(),
410 endpoint_id.to_owned(),
411 "insights".to_owned(),
412 ],
413 );
414 self.client.json(&self.options, request).await
415 }
416
417 pub async fn deliveries_get(&self, delivery_id: &str) -> Result<WebhooksDeliveriesGetResponse> {
421 let request = Request::new(
422 Method::GET,
423 ["webhook-deliveries".to_owned(), delivery_id.to_owned()],
424 );
425 self.client.json(&self.options, request).await
426 }
427}
428
429#[derive(Clone, Debug)]
431pub struct Documents {
432 pub(crate) client: Wellfriend,
433 pub(crate) options: RequestOptions,
434}
435
436impl Documents {
437 pub fn with_options(mut self, options: RequestOptions) -> Self {
439 self.options = options;
440 self
441 }
442
443 pub async fn create(&self, input: impl Into<FileInput>) -> Result<Document> {
449 crate::uploads::upload_document(&self.client, &self.options, input.into()).await
450 }
451
452 pub async fn list(&self, params: Option<DocumentsListParams>) -> Result<Page<Document>> {
456 let request = Request::new(Method::GET, ["documents".to_owned()])
457 .query("limit", params.as_ref().and_then(|p| p.limit.as_ref()))
458 .query("cursor", params.as_ref().and_then(|p| p.cursor.as_ref()))
459 .query("q", params.as_ref().and_then(|p| p.q.as_ref()));
460 self.client.json(&self.options, request).await
461 }
462
463 pub fn stream(&self, params: Option<DocumentsListParams>) -> PageStream<Document> {
465 let this = self.clone();
466 let params = params.unwrap_or_default();
467 crate::pagination::paginate(move |cursor| {
468 let this = this.clone();
469 let mut params = params.clone();
470 if cursor.is_some() {
471 params.cursor = cursor;
472 }
473 Box::pin(async move { this.list(Some(params)).await })
474 })
475 }
476
477 pub async fn get(&self, document_id: &str) -> Result<Document> {
481 let request = Request::new(
482 Method::GET,
483 ["documents".to_owned(), document_id.to_owned()],
484 );
485 self.client
486 .json_field(&self.options, request, "document")
487 .await
488 }
489}
490
491#[derive(Clone, Debug)]
493pub struct Uploads {
494 pub(crate) client: Wellfriend,
495 pub(crate) options: RequestOptions,
496}
497
498impl Uploads {
499 pub fn with_options(mut self, options: RequestOptions) -> Self {
501 self.options = options;
502 self
503 }
504
505 pub async fn create(&self, body: UploadsCreateRequest) -> Result<Upload> {
509 let key = self.options.key();
510 let request = Request::new(Method::POST, ["uploads".to_owned()])
511 .json(json_body(&body, None)?)
512 .idempotency_key(key);
513 self.client.json(&self.options, request).await
514 }
515
516 pub async fn get(&self, upload_id: &str) -> Result<Upload> {
520 let request = Request::new(Method::GET, ["uploads".to_owned(), upload_id.to_owned()]);
521 self.client.json(&self.options, request).await
522 }
523
524 pub async fn abort(&self, upload_id: &str, body: UploadsAbortRequest) -> Result<Upload> {
528 let request = Request::new(Method::DELETE, ["uploads".to_owned(), upload_id.to_owned()])
529 .json(json_body(&body, None)?);
530 self.client.json(&self.options, request).await
531 }
532
533 pub async fn parts_put(
537 &self,
538 upload_id: &str,
539 index: &str,
540 part: bytes::Bytes,
541 ) -> Result<UploadPart> {
542 let request = Request::new(
543 Method::PUT,
544 [
545 "uploads".to_owned(),
546 upload_id.to_owned(),
547 "parts".to_owned(),
548 index.to_owned(),
549 ],
550 )
551 .header(
552 "x-part-sha256",
553 &crate::util::hex(&<sha2::Sha256 as sha2::Digest>::digest(&part)),
554 )
555 .body(crate::client::RequestBody::Bytes {
556 data: part,
557 content_type: "application/octet-stream".into(),
558 })
559 .retry_always();
560 self.client.json(&self.options, request).await
561 }
562
563 pub async fn complete(
567 &self,
568 upload_id: &str,
569 body: Option<UploadsCompleteRequest>,
570 ) -> Result<UploadCompletion> {
571 let request = Request::new(
572 Method::POST,
573 [
574 "uploads".to_owned(),
575 upload_id.to_owned(),
576 "complete".to_owned(),
577 ],
578 )
579 .json(json_body(&body.unwrap_or_default(), None)?)
580 .retry_always();
581 self.client.json(&self.options, request).await
582 }
583}
584
585#[derive(Clone, Debug)]
587pub struct DocumentOperations {
588 pub(crate) client: Wellfriend,
589 pub(crate) options: RequestOptions,
590}
591
592impl DocumentOperations {
593 pub fn with_options(mut self, options: RequestOptions) -> Self {
595 self.options = options;
596 self
597 }
598
599 pub async fn create(&self, body: DocumentOperationsCreateRequest) -> Result<Operation> {
603 let key = self.options.key();
604 let request = Request::new(Method::POST, ["document-operations".to_owned()])
605 .json(json_body(&body, Some(&key))?)
606 .idempotency_key(key);
607 self.client
608 .json_field(&self.options, request, "operation")
609 .await
610 }
611
612 pub async fn get(&self, operation_id: &str) -> Result<Operation> {
616 let request = Request::new(
617 Method::GET,
618 ["document-operations".to_owned(), operation_id.to_owned()],
619 );
620 self.client
621 .json_field(&self.options, request, "operation")
622 .await
623 }
624
625 pub async fn outputs(&self, operation_id: &str) -> Result<OperationOutputs> {
629 let request = Request::new(
630 Method::GET,
631 [
632 "document-operations".to_owned(),
633 operation_id.to_owned(),
634 "outputs".to_owned(),
635 ],
636 );
637 self.client.json(&self.options, request).await
638 }
639}
640
641#[derive(Clone, Debug)]
643pub struct SecureLinks {
644 pub(crate) client: Wellfriend,
645 pub(crate) options: RequestOptions,
646}
647
648impl SecureLinks {
649 pub fn with_options(mut self, options: RequestOptions) -> Self {
651 self.options = options;
652 self
653 }
654
655 pub async fn create(&self, body: SecureLinksCreateRequest) -> Result<Object> {
659 let key = self.options.key();
660 let request = Request::new(Method::POST, ["secure-links".to_owned()])
661 .json(json_body(&body, Some(&key))?)
662 .idempotency_key(key);
663 self.client.json(&self.options, request).await
664 }
665
666 pub async fn list(&self) -> Result<Object> {
670 let request = Request::new(Method::GET, ["secure-links".to_owned()]);
671 self.client.json(&self.options, request).await
672 }
673
674 pub async fn get(&self, link_id: &str) -> Result<Object> {
678 let request = Request::new(Method::GET, ["secure-links".to_owned(), link_id.to_owned()]);
679 self.client.json(&self.options, request).await
680 }
681
682 pub async fn update(
686 &self,
687 link_id: &str,
688 body: Option<SecureLinksUpdateRequest>,
689 ) -> Result<Object> {
690 let request = Request::new(
691 Method::PATCH,
692 ["secure-links".to_owned(), link_id.to_owned()],
693 )
694 .json(json_body(&body.unwrap_or_default(), None)?);
695 self.client.json(&self.options, request).await
696 }
697
698 pub async fn revoke(&self, link_id: &str, body: SecureLinksRevokeRequest) -> Result<Object> {
702 let request = Request::new(
703 Method::POST,
704 [
705 "secure-links".to_owned(),
706 link_id.to_owned(),
707 "revoke".to_owned(),
708 ],
709 )
710 .json(json_body(&body, None)?);
711 self.client.json(&self.options, request).await
712 }
713
714 pub async fn version(&self, link_id: &str, body: SecureLinksVersionRequest) -> Result<Object> {
718 let request = Request::new(
719 Method::POST,
720 [
721 "secure-links".to_owned(),
722 link_id.to_owned(),
723 "version".to_owned(),
724 ],
725 )
726 .json(json_body(&body, None)?);
727 self.client.json(&self.options, request).await
728 }
729
730 pub async fn recipients_list(&self, link_id: &str) -> Result<Object> {
734 let request = Request::new(
735 Method::GET,
736 [
737 "secure-links".to_owned(),
738 link_id.to_owned(),
739 "recipients".to_owned(),
740 ],
741 );
742 self.client.json(&self.options, request).await
743 }
744
745 pub async fn recipients_add(
749 &self,
750 link_id: &str,
751 body: SecureLinksRecipientsAddRequest,
752 ) -> Result<Object> {
753 let request = Request::new(
754 Method::POST,
755 [
756 "secure-links".to_owned(),
757 link_id.to_owned(),
758 "recipients".to_owned(),
759 ],
760 )
761 .json(json_body(&body, None)?);
762 self.client.json(&self.options, request).await
763 }
764
765 pub async fn password(
769 &self,
770 link_id: &str,
771 body: SecureLinksPasswordRequest,
772 ) -> Result<Object> {
773 let request = Request::new(
774 Method::POST,
775 [
776 "secure-links".to_owned(),
777 link_id.to_owned(),
778 "password".to_owned(),
779 ],
780 )
781 .json(json_body(&body, None)?);
782 self.client.json(&self.options, request).await
783 }
784
785 pub async fn sessions_list(&self, link_id: &str) -> Result<Object> {
789 let request = Request::new(
790 Method::GET,
791 [
792 "secure-links".to_owned(),
793 link_id.to_owned(),
794 "sessions".to_owned(),
795 ],
796 );
797 self.client.json(&self.options, request).await
798 }
799
800 pub async fn sessions_revoke(
804 &self,
805 link_id: &str,
806 session_id: &str,
807 body: Option<SecureLinksSessionsRevokeRequest>,
808 ) -> Result<Object> {
809 let request = Request::new(
810 Method::POST,
811 [
812 "secure-links".to_owned(),
813 link_id.to_owned(),
814 "sessions".to_owned(),
815 session_id.to_owned(),
816 "revoke".to_owned(),
817 ],
818 )
819 .json(json_body(&body.unwrap_or_default(), None)?);
820 self.client.json(&self.options, request).await
821 }
822
823 pub async fn analytics(&self, link_id: &str) -> Result<Object> {
827 let request = Request::new(
828 Method::GET,
829 [
830 "secure-links".to_owned(),
831 link_id.to_owned(),
832 "analytics".to_owned(),
833 ],
834 );
835 self.client.json(&self.options, request).await
836 }
837}
838
839#[derive(Clone, Debug)]
841pub struct WorkflowRuns {
842 pub(crate) client: Wellfriend,
843 pub(crate) options: RequestOptions,
844}
845
846impl WorkflowRuns {
847 pub fn with_options(mut self, options: RequestOptions) -> Self {
849 self.options = options;
850 self
851 }
852
853 pub async fn create(
857 &self,
858 workflow_id: &str,
859 body: WorkflowRunsCreateRequest,
860 ) -> Result<WorkflowRun> {
861 let key = self.options.key();
862 let request = Request::new(
863 Method::POST,
864 [
865 "workflows".to_owned(),
866 workflow_id.to_owned(),
867 "runs".to_owned(),
868 ],
869 )
870 .json(json_body(&body, Some(&key))?)
871 .idempotency_key(key);
872 self.client.json_field(&self.options, request, "run").await
873 }
874
875 pub async fn get(&self, run_id: &str) -> Result<WorkflowRun> {
879 let request = Request::new(Method::GET, ["workflow-runs".to_owned(), run_id.to_owned()]);
880 self.client.json_field(&self.options, request, "run").await
881 }
882
883 pub async fn cancel(
887 &self,
888 run_id: &str,
889 body: WorkflowRunsCancelRequest,
890 ) -> Result<WorkflowRun> {
891 let request = Request::new(
892 Method::POST,
893 [
894 "workflow-runs".to_owned(),
895 run_id.to_owned(),
896 "cancel".to_owned(),
897 ],
898 )
899 .json(json_body(&body, None)?);
900 self.client.json_field(&self.options, request, "run").await
901 }
902
903 pub async fn replay(
907 &self,
908 run_id: &str,
909 body: WorkflowRunsReplayRequest,
910 ) -> Result<WorkflowRun> {
911 let request = Request::new(
912 Method::POST,
913 [
914 "workflow-runs".to_owned(),
915 run_id.to_owned(),
916 "replay".to_owned(),
917 ],
918 )
919 .json(json_body(&body, None)?);
920 self.client.json_field(&self.options, request, "run").await
921 }
922}
923
924#[derive(Clone, Debug)]
926pub struct WorkflowApprovals {
927 pub(crate) client: Wellfriend,
928 pub(crate) options: RequestOptions,
929}
930
931impl WorkflowApprovals {
932 pub fn with_options(mut self, options: RequestOptions) -> Self {
934 self.options = options;
935 self
936 }
937
938 pub async fn decide(
942 &self,
943 approval_id: &str,
944 body: WorkflowApprovalsDecideRequest,
945 ) -> Result<Object> {
946 let key = self.options.key();
947 let request = Request::new(
948 Method::POST,
949 [
950 "workflow-approvals".to_owned(),
951 approval_id.to_owned(),
952 "decision".to_owned(),
953 ],
954 )
955 .json(json_body(&body, Some(&key))?)
956 .idempotency_key(key);
957 self.client.json(&self.options, request).await
958 }
959}
960
961#[derive(Clone, Debug)]
963pub struct Connectors {
964 pub(crate) client: Wellfriend,
965 pub(crate) options: RequestOptions,
966}
967
968impl Connectors {
969 pub fn with_options(mut self, options: RequestOptions) -> Self {
971 self.options = options;
972 self
973 }
974
975 pub async fn accounts_list(&self, params: Option<ListParams>) -> Result<Page<Object>> {
979 let request = Request::new(Method::GET, ["connector-accounts".to_owned()])
980 .query("limit", params.as_ref().and_then(|p| p.limit.as_ref()))
981 .query("cursor", params.as_ref().and_then(|p| p.cursor.as_ref()));
982 self.client.json(&self.options, request).await
983 }
984
985 pub fn accounts_stream(&self, params: Option<ListParams>) -> PageStream<Object> {
987 let this = self.clone();
988 let params = params.unwrap_or_default();
989 crate::pagination::paginate(move |cursor| {
990 let this = this.clone();
991 let mut params = params.clone();
992 if cursor.is_some() {
993 params.cursor = cursor;
994 }
995 Box::pin(async move { this.accounts_list(Some(params)).await })
996 })
997 }
998
999 pub async fn accounts_test(
1003 &self,
1004 account_id: &str,
1005 body: ConnectorsAccountsTestRequest,
1006 ) -> Result<Object> {
1007 let request = Request::new(
1008 Method::POST,
1009 [
1010 "connector-accounts".to_owned(),
1011 account_id.to_owned(),
1012 "test".to_owned(),
1013 ],
1014 )
1015 .json(json_body(&body, None)?);
1016 self.client.json(&self.options, request).await
1017 }
1018
1019 pub async fn accounts_disconnect(
1023 &self,
1024 account_id: &str,
1025 body: ConnectorsAccountsDisconnectRequest,
1026 ) -> Result<Object> {
1027 let request = Request::new(
1028 Method::POST,
1029 [
1030 "connector-accounts".to_owned(),
1031 account_id.to_owned(),
1032 "disconnect".to_owned(),
1033 ],
1034 )
1035 .json(json_body(&body, None)?);
1036 self.client.json(&self.options, request).await
1037 }
1038
1039 pub async fn items_list(
1043 &self,
1044 account_id: &str,
1045 params: Option<ListParams>,
1046 ) -> Result<Page<Object>> {
1047 let request = Request::new(
1048 Method::GET,
1049 [
1050 "connector-accounts".to_owned(),
1051 account_id.to_owned(),
1052 "items".to_owned(),
1053 ],
1054 )
1055 .query("limit", params.as_ref().and_then(|p| p.limit.as_ref()))
1056 .query("cursor", params.as_ref().and_then(|p| p.cursor.as_ref()));
1057 self.client.json(&self.options, request).await
1058 }
1059
1060 pub fn items_stream(
1062 &self,
1063 account_id: impl Into<String>,
1064 params: Option<ListParams>,
1065 ) -> PageStream<Object> {
1066 let this = self.clone();
1067 let account_id: String = account_id.into();
1068 let params = params.unwrap_or_default();
1069 crate::pagination::paginate(move |cursor| {
1070 let this = this.clone();
1071 let account_id = account_id.clone();
1072 let mut params = params.clone();
1073 if cursor.is_some() {
1074 params.cursor = cursor;
1075 }
1076 Box::pin(async move { this.items_list(&account_id, Some(params)).await })
1077 })
1078 }
1079
1080 pub async fn operations_list(&self, params: Option<ListParams>) -> Result<Page<Object>> {
1084 let request = Request::new(Method::GET, ["connector-operations".to_owned()])
1085 .query("limit", params.as_ref().and_then(|p| p.limit.as_ref()))
1086 .query("cursor", params.as_ref().and_then(|p| p.cursor.as_ref()));
1087 self.client.json(&self.options, request).await
1088 }
1089
1090 pub fn operations_stream(&self, params: Option<ListParams>) -> PageStream<Object> {
1092 let this = self.clone();
1093 let params = params.unwrap_or_default();
1094 crate::pagination::paginate(move |cursor| {
1095 let this = this.clone();
1096 let mut params = params.clone();
1097 if cursor.is_some() {
1098 params.cursor = cursor;
1099 }
1100 Box::pin(async move { this.operations_list(Some(params)).await })
1101 })
1102 }
1103
1104 pub async fn import(&self, body: Option<ConnectorsImportRequest>) -> Result<Object> {
1108 let request = Request::new(Method::POST, ["connector-imports".to_owned()])
1109 .json(json_body(&body.unwrap_or_default(), None)?);
1110 self.client.json(&self.options, request).await
1111 }
1112
1113 pub async fn send(&self, body: Option<ConnectorsSendRequest>) -> Result<Object> {
1117 let request = Request::new(Method::POST, ["connector-sends".to_owned()])
1118 .json(json_body(&body.unwrap_or_default(), None)?);
1119 self.client.json(&self.options, request).await
1120 }
1121
1122 pub async fn export(&self, body: Option<ConnectorsExportRequest>) -> Result<Object> {
1126 let request = Request::new(Method::POST, ["connector-exports".to_owned()])
1127 .json(json_body(&body.unwrap_or_default(), None)?);
1128 self.client.json(&self.options, request).await
1129 }
1130
1131 pub async fn generic_create(&self, body: ConnectorsGenericCreateRequest) -> Result<Object> {
1135 let key = self.options.key();
1136 let request = Request::new(Method::POST, ["generic-http-connections".to_owned()])
1137 .json(json_body(&body, Some(&key))?)
1138 .idempotency_key(key);
1139 self.client.json(&self.options, request).await
1140 }
1141
1142 pub async fn generic_trigger(
1146 &self,
1147 account_id: &str,
1148 body: ConnectorsGenericTriggerRequest,
1149 ) -> Result<Object> {
1150 let request = Request::new(
1151 Method::POST,
1152 ["generic-http-triggers".to_owned(), account_id.to_owned()],
1153 )
1154 .json(json_body(&body, None)?);
1155 self.client.json(&self.options, request).await
1156 }
1157}
1158
1159#[derive(Clone, Debug)]
1161pub struct Templates {
1162 pub(crate) client: Wellfriend,
1163 pub(crate) options: RequestOptions,
1164}
1165
1166impl Templates {
1167 pub fn with_options(mut self, options: RequestOptions) -> Self {
1169 self.options = options;
1170 self
1171 }
1172
1173 pub async fn list(&self, params: Option<ListParams>) -> Result<Page<Object>> {
1177 let request = Request::new(Method::GET, ["templates".to_owned()])
1178 .query("limit", params.as_ref().and_then(|p| p.limit.as_ref()))
1179 .query("cursor", params.as_ref().and_then(|p| p.cursor.as_ref()));
1180 self.client.json(&self.options, request).await
1181 }
1182
1183 pub fn stream(&self, params: Option<ListParams>) -> PageStream<Object> {
1185 let this = self.clone();
1186 let params = params.unwrap_or_default();
1187 crate::pagination::paginate(move |cursor| {
1188 let this = this.clone();
1189 let mut params = params.clone();
1190 if cursor.is_some() {
1191 params.cursor = cursor;
1192 }
1193 Box::pin(async move { this.list(Some(params)).await })
1194 })
1195 }
1196
1197 pub async fn create(&self, body: TemplatesCreateRequest) -> Result<Object> {
1201 let key = self.options.key();
1202 let request = Request::new(Method::POST, ["templates".to_owned()])
1203 .json(json_body(&body, Some(&key))?)
1204 .idempotency_key(key);
1205 self.client.json(&self.options, request).await
1206 }
1207
1208 pub async fn get(&self, resource_id: &str) -> Result<Object> {
1212 let request = Request::new(
1213 Method::GET,
1214 ["templates".to_owned(), resource_id.to_owned()],
1215 );
1216 self.client.json(&self.options, request).await
1217 }
1218
1219 pub async fn update(&self, resource_id: &str, body: TemplatesUpdateRequest) -> Result<Object> {
1223 let request = Request::new(
1224 Method::PATCH,
1225 ["templates".to_owned(), resource_id.to_owned()],
1226 )
1227 .json(json_body(&body, None)?);
1228 self.client.json(&self.options, request).await
1229 }
1230
1231 pub async fn transition(
1235 &self,
1236 resource_id: &str,
1237 body: TemplatesTransitionRequest,
1238 ) -> Result<Object> {
1239 let key = self.options.key();
1240 let request = Request::new(
1241 Method::POST,
1242 [
1243 "templates".to_owned(),
1244 resource_id.to_owned(),
1245 "actions".to_owned(),
1246 ],
1247 )
1248 .json(json_body(&body, Some(&key))?)
1249 .idempotency_key(key);
1250 self.client.json(&self.options, request).await
1251 }
1252}
1253
1254#[derive(Clone, Debug)]
1256pub struct SignatureRequests {
1257 pub(crate) client: Wellfriend,
1258 pub(crate) options: RequestOptions,
1259}
1260
1261impl SignatureRequests {
1262 pub fn with_options(mut self, options: RequestOptions) -> Self {
1264 self.options = options;
1265 self
1266 }
1267
1268 pub async fn list(&self, params: Option<ListParams>) -> Result<Page<Object>> {
1272 let request = Request::new(Method::GET, ["signature-requests".to_owned()])
1273 .query("limit", params.as_ref().and_then(|p| p.limit.as_ref()))
1274 .query("cursor", params.as_ref().and_then(|p| p.cursor.as_ref()));
1275 self.client.json(&self.options, request).await
1276 }
1277
1278 pub fn stream(&self, params: Option<ListParams>) -> PageStream<Object> {
1280 let this = self.clone();
1281 let params = params.unwrap_or_default();
1282 crate::pagination::paginate(move |cursor| {
1283 let this = this.clone();
1284 let mut params = params.clone();
1285 if cursor.is_some() {
1286 params.cursor = cursor;
1287 }
1288 Box::pin(async move { this.list(Some(params)).await })
1289 })
1290 }
1291
1292 pub async fn create(&self, body: SignatureRequestsCreateRequest) -> Result<Object> {
1296 let key = self.options.key();
1297 let request = Request::new(Method::POST, ["signature-requests".to_owned()])
1298 .json(json_body(&body, Some(&key))?)
1299 .idempotency_key(key);
1300 self.client.json(&self.options, request).await
1301 }
1302
1303 pub async fn get(&self, resource_id: &str) -> Result<Object> {
1307 let request = Request::new(
1308 Method::GET,
1309 ["signature-requests".to_owned(), resource_id.to_owned()],
1310 );
1311 self.client.json(&self.options, request).await
1312 }
1313
1314 pub async fn update(
1318 &self,
1319 resource_id: &str,
1320 body: SignatureRequestsUpdateRequest,
1321 ) -> Result<Object> {
1322 let request = Request::new(
1323 Method::PATCH,
1324 ["signature-requests".to_owned(), resource_id.to_owned()],
1325 )
1326 .json(json_body(&body, None)?);
1327 self.client.json(&self.options, request).await
1328 }
1329
1330 pub async fn transition(
1334 &self,
1335 resource_id: &str,
1336 body: SignatureRequestsTransitionRequest,
1337 ) -> Result<Object> {
1338 let key = self.options.key();
1339 let request = Request::new(
1340 Method::POST,
1341 [
1342 "signature-requests".to_owned(),
1343 resource_id.to_owned(),
1344 "actions".to_owned(),
1345 ],
1346 )
1347 .json(json_body(&body, Some(&key))?)
1348 .idempotency_key(key);
1349 self.client.json(&self.options, request).await
1350 }
1351}
1352
1353#[derive(Clone, Debug)]
1355pub struct Annotations {
1356 pub(crate) client: Wellfriend,
1357 pub(crate) options: RequestOptions,
1358}
1359
1360impl Annotations {
1361 pub fn with_options(mut self, options: RequestOptions) -> Self {
1363 self.options = options;
1364 self
1365 }
1366
1367 pub async fn list(&self, params: Option<ListParams>) -> Result<Page<Object>> {
1371 let request = Request::new(Method::GET, ["annotations".to_owned()])
1372 .query("limit", params.as_ref().and_then(|p| p.limit.as_ref()))
1373 .query("cursor", params.as_ref().and_then(|p| p.cursor.as_ref()));
1374 self.client.json(&self.options, request).await
1375 }
1376
1377 pub fn stream(&self, params: Option<ListParams>) -> PageStream<Object> {
1379 let this = self.clone();
1380 let params = params.unwrap_or_default();
1381 crate::pagination::paginate(move |cursor| {
1382 let this = this.clone();
1383 let mut params = params.clone();
1384 if cursor.is_some() {
1385 params.cursor = cursor;
1386 }
1387 Box::pin(async move { this.list(Some(params)).await })
1388 })
1389 }
1390
1391 pub async fn create(&self, body: AnnotationsCreateRequest) -> Result<Object> {
1395 let key = self.options.key();
1396 let request = Request::new(Method::POST, ["annotations".to_owned()])
1397 .json(json_body(&body, Some(&key))?)
1398 .idempotency_key(key);
1399 self.client.json(&self.options, request).await
1400 }
1401
1402 pub async fn get(&self, resource_id: &str) -> Result<Object> {
1406 let request = Request::new(
1407 Method::GET,
1408 ["annotations".to_owned(), resource_id.to_owned()],
1409 );
1410 self.client.json(&self.options, request).await
1411 }
1412
1413 pub async fn update(
1417 &self,
1418 resource_id: &str,
1419 body: AnnotationsUpdateRequest,
1420 ) -> Result<Object> {
1421 let request = Request::new(
1422 Method::PATCH,
1423 ["annotations".to_owned(), resource_id.to_owned()],
1424 )
1425 .json(json_body(&body, None)?);
1426 self.client.json(&self.options, request).await
1427 }
1428
1429 pub async fn transition(
1433 &self,
1434 resource_id: &str,
1435 body: AnnotationsTransitionRequest,
1436 ) -> Result<Object> {
1437 let key = self.options.key();
1438 let request = Request::new(
1439 Method::POST,
1440 [
1441 "annotations".to_owned(),
1442 resource_id.to_owned(),
1443 "actions".to_owned(),
1444 ],
1445 )
1446 .json(json_body(&body, Some(&key))?)
1447 .idempotency_key(key);
1448 self.client.json(&self.options, request).await
1449 }
1450}
1451
1452#[derive(Clone, Debug)]
1454pub struct Forms {
1455 pub(crate) client: Wellfriend,
1456 pub(crate) options: RequestOptions,
1457}
1458
1459impl Forms {
1460 pub fn with_options(mut self, options: RequestOptions) -> Self {
1462 self.options = options;
1463 self
1464 }
1465
1466 pub async fn list(&self, params: Option<ListParams>) -> Result<Page<Object>> {
1470 let request = Request::new(Method::GET, ["forms".to_owned()])
1471 .query("limit", params.as_ref().and_then(|p| p.limit.as_ref()))
1472 .query("cursor", params.as_ref().and_then(|p| p.cursor.as_ref()));
1473 self.client.json(&self.options, request).await
1474 }
1475
1476 pub fn stream(&self, params: Option<ListParams>) -> PageStream<Object> {
1478 let this = self.clone();
1479 let params = params.unwrap_or_default();
1480 crate::pagination::paginate(move |cursor| {
1481 let this = this.clone();
1482 let mut params = params.clone();
1483 if cursor.is_some() {
1484 params.cursor = cursor;
1485 }
1486 Box::pin(async move { this.list(Some(params)).await })
1487 })
1488 }
1489
1490 pub async fn create(&self, body: FormsCreateRequest) -> Result<Object> {
1494 let key = self.options.key();
1495 let request = Request::new(Method::POST, ["forms".to_owned()])
1496 .json(json_body(&body, Some(&key))?)
1497 .idempotency_key(key);
1498 self.client.json(&self.options, request).await
1499 }
1500
1501 pub async fn get(&self, resource_id: &str) -> Result<Object> {
1505 let request = Request::new(Method::GET, ["forms".to_owned(), resource_id.to_owned()]);
1506 self.client.json(&self.options, request).await
1507 }
1508
1509 pub async fn update(&self, resource_id: &str, body: FormsUpdateRequest) -> Result<Object> {
1513 let request = Request::new(Method::PATCH, ["forms".to_owned(), resource_id.to_owned()])
1514 .json(json_body(&body, None)?);
1515 self.client.json(&self.options, request).await
1516 }
1517
1518 pub async fn transition(
1522 &self,
1523 resource_id: &str,
1524 body: FormsTransitionRequest,
1525 ) -> Result<Object> {
1526 let key = self.options.key();
1527 let request = Request::new(
1528 Method::POST,
1529 [
1530 "forms".to_owned(),
1531 resource_id.to_owned(),
1532 "actions".to_owned(),
1533 ],
1534 )
1535 .json(json_body(&body, Some(&key))?)
1536 .idempotency_key(key);
1537 self.client.json(&self.options, request).await
1538 }
1539}
1540
1541#[derive(Clone, Debug)]
1543pub struct DealRooms {
1544 pub(crate) client: Wellfriend,
1545 pub(crate) options: RequestOptions,
1546}
1547
1548impl DealRooms {
1549 pub fn with_options(mut self, options: RequestOptions) -> Self {
1551 self.options = options;
1552 self
1553 }
1554
1555 pub async fn list(&self, params: Option<ListParams>) -> Result<Page<Object>> {
1559 let request = Request::new(Method::GET, ["deal-rooms".to_owned()])
1560 .query("limit", params.as_ref().and_then(|p| p.limit.as_ref()))
1561 .query("cursor", params.as_ref().and_then(|p| p.cursor.as_ref()));
1562 self.client.json(&self.options, request).await
1563 }
1564
1565 pub fn stream(&self, params: Option<ListParams>) -> PageStream<Object> {
1567 let this = self.clone();
1568 let params = params.unwrap_or_default();
1569 crate::pagination::paginate(move |cursor| {
1570 let this = this.clone();
1571 let mut params = params.clone();
1572 if cursor.is_some() {
1573 params.cursor = cursor;
1574 }
1575 Box::pin(async move { this.list(Some(params)).await })
1576 })
1577 }
1578
1579 pub async fn create(&self, body: DealRoomsCreateRequest) -> Result<Object> {
1583 let key = self.options.key();
1584 let request = Request::new(Method::POST, ["deal-rooms".to_owned()])
1585 .json(json_body(&body, Some(&key))?)
1586 .idempotency_key(key);
1587 self.client.json(&self.options, request).await
1588 }
1589
1590 pub async fn get(&self, resource_id: &str) -> Result<Object> {
1594 let request = Request::new(
1595 Method::GET,
1596 ["deal-rooms".to_owned(), resource_id.to_owned()],
1597 );
1598 self.client.json(&self.options, request).await
1599 }
1600
1601 pub async fn update(&self, resource_id: &str, body: DealRoomsUpdateRequest) -> Result<Object> {
1605 let request = Request::new(
1606 Method::PATCH,
1607 ["deal-rooms".to_owned(), resource_id.to_owned()],
1608 )
1609 .json(json_body(&body, None)?);
1610 self.client.json(&self.options, request).await
1611 }
1612
1613 pub async fn transition(
1617 &self,
1618 resource_id: &str,
1619 body: DealRoomsTransitionRequest,
1620 ) -> Result<Object> {
1621 let key = self.options.key();
1622 let request = Request::new(
1623 Method::POST,
1624 [
1625 "deal-rooms".to_owned(),
1626 resource_id.to_owned(),
1627 "actions".to_owned(),
1628 ],
1629 )
1630 .json(json_body(&body, Some(&key))?)
1631 .idempotency_key(key);
1632 self.client.json(&self.options, request).await
1633 }
1634}
1635
1636#[derive(Clone, Debug)]
1638pub struct Embeds {
1639 pub(crate) client: Wellfriend,
1640 pub(crate) options: RequestOptions,
1641}
1642
1643impl Embeds {
1644 pub fn with_options(mut self, options: RequestOptions) -> Self {
1646 self.options = options;
1647 self
1648 }
1649
1650 pub async fn list(&self, params: Option<ListParams>) -> Result<Page<Object>> {
1654 let request = Request::new(Method::GET, ["embeds".to_owned()])
1655 .query("limit", params.as_ref().and_then(|p| p.limit.as_ref()))
1656 .query("cursor", params.as_ref().and_then(|p| p.cursor.as_ref()));
1657 self.client.json(&self.options, request).await
1658 }
1659
1660 pub fn stream(&self, params: Option<ListParams>) -> PageStream<Object> {
1662 let this = self.clone();
1663 let params = params.unwrap_or_default();
1664 crate::pagination::paginate(move |cursor| {
1665 let this = this.clone();
1666 let mut params = params.clone();
1667 if cursor.is_some() {
1668 params.cursor = cursor;
1669 }
1670 Box::pin(async move { this.list(Some(params)).await })
1671 })
1672 }
1673
1674 pub async fn create(&self, body: EmbedsCreateRequest) -> Result<Object> {
1678 let key = self.options.key();
1679 let request = Request::new(Method::POST, ["embeds".to_owned()])
1680 .json(json_body(&body, Some(&key))?)
1681 .idempotency_key(key);
1682 self.client.json(&self.options, request).await
1683 }
1684
1685 pub async fn get(&self, resource_id: &str) -> Result<Object> {
1689 let request = Request::new(Method::GET, ["embeds".to_owned(), resource_id.to_owned()]);
1690 self.client.json(&self.options, request).await
1691 }
1692
1693 pub async fn update(&self, resource_id: &str, body: EmbedsUpdateRequest) -> Result<Object> {
1697 let request = Request::new(Method::PATCH, ["embeds".to_owned(), resource_id.to_owned()])
1698 .json(json_body(&body, None)?);
1699 self.client.json(&self.options, request).await
1700 }
1701
1702 pub async fn transition(
1706 &self,
1707 resource_id: &str,
1708 body: EmbedsTransitionRequest,
1709 ) -> Result<Object> {
1710 let key = self.options.key();
1711 let request = Request::new(
1712 Method::POST,
1713 [
1714 "embeds".to_owned(),
1715 resource_id.to_owned(),
1716 "actions".to_owned(),
1717 ],
1718 )
1719 .json(json_body(&body, Some(&key))?)
1720 .idempotency_key(key);
1721 self.client.json(&self.options, request).await
1722 }
1723}
1724
1725#[derive(Clone, Debug)]
1727pub struct DocumentVersions {
1728 pub(crate) client: Wellfriend,
1729 pub(crate) options: RequestOptions,
1730}
1731
1732impl DocumentVersions {
1733 pub fn with_options(mut self, options: RequestOptions) -> Self {
1735 self.options = options;
1736 self
1737 }
1738
1739 pub async fn list(
1743 &self,
1744 document_id: &str,
1745 params: Option<ListParams>,
1746 ) -> Result<Page<DocumentVersion>> {
1747 let request = Request::new(
1748 Method::GET,
1749 [
1750 "documents".to_owned(),
1751 document_id.to_owned(),
1752 "versions".to_owned(),
1753 ],
1754 )
1755 .query("limit", params.as_ref().and_then(|p| p.limit.as_ref()))
1756 .query("cursor", params.as_ref().and_then(|p| p.cursor.as_ref()));
1757 self.client.json(&self.options, request).await
1758 }
1759
1760 pub fn stream(
1762 &self,
1763 document_id: impl Into<String>,
1764 params: Option<ListParams>,
1765 ) -> PageStream<DocumentVersion> {
1766 let this = self.clone();
1767 let document_id: String = document_id.into();
1768 let params = params.unwrap_or_default();
1769 crate::pagination::paginate(move |cursor| {
1770 let this = this.clone();
1771 let document_id = document_id.clone();
1772 let mut params = params.clone();
1773 if cursor.is_some() {
1774 params.cursor = cursor;
1775 }
1776 Box::pin(async move { this.list(&document_id, Some(params)).await })
1777 })
1778 }
1779
1780 pub async fn get(&self, document_id: &str, version_id: &str) -> Result<DocumentVersion> {
1784 let request = Request::new(
1785 Method::GET,
1786 [
1787 "documents".to_owned(),
1788 document_id.to_owned(),
1789 "versions".to_owned(),
1790 version_id.to_owned(),
1791 ],
1792 );
1793 self.client.json(&self.options, request).await
1794 }
1795
1796 pub async fn download(&self, document_id: &str, version_id: &str) -> Result<Download> {
1800 let request = Request::new(
1801 Method::GET,
1802 [
1803 "documents".to_owned(),
1804 document_id.to_owned(),
1805 "versions".to_owned(),
1806 version_id.to_owned(),
1807 "content".to_owned(),
1808 ],
1809 );
1810 Ok(Download::new(
1811 self.client.send(&self.options, request).await?,
1812 ))
1813 }
1814
1815 pub async fn render_page(
1819 &self,
1820 document_id: &str,
1821 version_id: &str,
1822 page: &str,
1823 ) -> Result<Download> {
1824 let request = Request::new(
1825 Method::GET,
1826 [
1827 "documents".to_owned(),
1828 document_id.to_owned(),
1829 "versions".to_owned(),
1830 version_id.to_owned(),
1831 "pages".to_owned(),
1832 page.to_owned(),
1833 "render".to_owned(),
1834 ],
1835 );
1836 Ok(Download::new(
1837 self.client.send(&self.options, request).await?,
1838 ))
1839 }
1840}
1841
1842#[derive(Clone, Debug)]
1844pub struct DocumentAnalytics {
1845 pub(crate) client: Wellfriend,
1846 pub(crate) options: RequestOptions,
1847}
1848
1849impl DocumentAnalytics {
1850 pub fn with_options(mut self, options: RequestOptions) -> Self {
1852 self.options = options;
1853 self
1854 }
1855
1856 pub async fn get(&self, document_id: &str) -> Result<Object> {
1860 let request = Request::new(
1861 Method::GET,
1862 [
1863 "documents".to_owned(),
1864 document_id.to_owned(),
1865 "analytics".to_owned(),
1866 ],
1867 );
1868 self.client.json(&self.options, request).await
1869 }
1870}
1871
1872#[derive(Clone, Debug)]
1874pub struct Keys {
1875 pub(crate) client: Wellfriend,
1876 pub(crate) options: RequestOptions,
1877}
1878
1879impl Keys {
1880 pub fn with_options(mut self, options: RequestOptions) -> Self {
1882 self.options = options;
1883 self
1884 }
1885
1886 pub async fn list(&self, params: Option<ListParams>) -> Result<Page<Object>> {
1890 let request = Request::new(Method::GET, ["keys".to_owned()])
1891 .query("limit", params.as_ref().and_then(|p| p.limit.as_ref()))
1892 .query("cursor", params.as_ref().and_then(|p| p.cursor.as_ref()));
1893 self.client.json(&self.options, request).await
1894 }
1895
1896 pub fn stream(&self, params: Option<ListParams>) -> PageStream<Object> {
1898 let this = self.clone();
1899 let params = params.unwrap_or_default();
1900 crate::pagination::paginate(move |cursor| {
1901 let this = this.clone();
1902 let mut params = params.clone();
1903 if cursor.is_some() {
1904 params.cursor = cursor;
1905 }
1906 Box::pin(async move { this.list(Some(params)).await })
1907 })
1908 }
1909
1910 pub async fn create(&self, body: KeysCreateRequest) -> Result<Object> {
1914 let request = Request::new(Method::POST, ["keys".to_owned()]).json(json_body(&body, None)?);
1915 self.client.json(&self.options, request).await
1916 }
1917
1918 pub async fn revoke(&self, key_id: &str, body: KeysRevokeRequest) -> Result<Object> {
1922 let request = Request::new(
1923 Method::POST,
1924 ["keys".to_owned(), key_id.to_owned(), "revoke".to_owned()],
1925 )
1926 .json(json_body(&body, None)?);
1927 self.client.json(&self.options, request).await
1928 }
1929
1930 pub async fn rotate(&self, key_id: &str, body: KeysRotateRequest) -> Result<Object> {
1934 let request = Request::new(
1935 Method::POST,
1936 ["keys".to_owned(), key_id.to_owned(), "rotate".to_owned()],
1937 )
1938 .json(json_body(&body, None)?);
1939 self.client.json(&self.options, request).await
1940 }
1941}
1942
1943#[derive(Clone, Debug)]
1945pub struct Usage {
1946 pub(crate) client: Wellfriend,
1947 pub(crate) options: RequestOptions,
1948}
1949
1950impl Usage {
1951 pub fn with_options(mut self, options: RequestOptions) -> Self {
1953 self.options = options;
1954 self
1955 }
1956
1957 pub async fn get(&self) -> Result<Object> {
1961 let request = Request::new(Method::GET, ["usage".to_owned()]);
1962 self.client.json(&self.options, request).await
1963 }
1964}
1965
1966#[derive(Clone, Debug)]
1968pub struct Logs {
1969 pub(crate) client: Wellfriend,
1970 pub(crate) options: RequestOptions,
1971}
1972
1973impl Logs {
1974 pub fn with_options(mut self, options: RequestOptions) -> Self {
1976 self.options = options;
1977 self
1978 }
1979
1980 pub async fn list(&self, params: Option<ListParams>) -> Result<Page<Object>> {
1984 let request = Request::new(Method::GET, ["logs".to_owned()])
1985 .query("limit", params.as_ref().and_then(|p| p.limit.as_ref()))
1986 .query("cursor", params.as_ref().and_then(|p| p.cursor.as_ref()));
1987 self.client.json(&self.options, request).await
1988 }
1989
1990 pub fn stream(&self, params: Option<ListParams>) -> PageStream<Object> {
1992 let this = self.clone();
1993 let params = params.unwrap_or_default();
1994 crate::pagination::paginate(move |cursor| {
1995 let this = this.clone();
1996 let mut params = params.clone();
1997 if cursor.is_some() {
1998 params.cursor = cursor;
1999 }
2000 Box::pin(async move { this.list(Some(params)).await })
2001 })
2002 }
2003}
2004
2005#[derive(Clone, Debug)]
2007pub struct Rooms {
2008 pub(crate) client: Wellfriend,
2009 pub(crate) options: RequestOptions,
2010}
2011
2012impl Rooms {
2013 pub fn with_options(mut self, options: RequestOptions) -> Self {
2015 self.options = options;
2016 self
2017 }
2018
2019 pub async fn list(&self) -> Result<Object> {
2023 let request = Request::new(Method::GET, ["rooms".to_owned()]);
2024 self.client.json(&self.options, request).await
2025 }
2026
2027 pub async fn create(&self, body: RoomsCreateRequest) -> Result<Object> {
2031 let request =
2032 Request::new(Method::POST, ["rooms".to_owned()]).json(json_body(&body, None)?);
2033 self.client.json(&self.options, request).await
2034 }
2035
2036 pub async fn get(&self, room_id: &str) -> Result<Object> {
2040 let request = Request::new(Method::GET, ["rooms".to_owned(), room_id.to_owned()]);
2041 self.client.json(&self.options, request).await
2042 }
2043
2044 pub async fn contents(&self, room_id: &str) -> Result<Object> {
2048 let request = Request::new(
2049 Method::GET,
2050 [
2051 "rooms".to_owned(),
2052 room_id.to_owned(),
2053 "contents".to_owned(),
2054 ],
2055 );
2056 self.client.json(&self.options, request).await
2057 }
2058
2059 pub async fn transition(&self, room_id: &str, body: RoomsTransitionRequest) -> Result<Object> {
2063 let request = Request::new(
2064 Method::POST,
2065 ["rooms".to_owned(), room_id.to_owned(), "actions".to_owned()],
2066 )
2067 .json(json_body(&body, None)?);
2068 self.client.json(&self.options, request).await
2069 }
2070
2071 pub async fn folders_create(
2075 &self,
2076 room_id: &str,
2077 body: RoomsFoldersCreateRequest,
2078 ) -> Result<Object> {
2079 let request = Request::new(
2080 Method::POST,
2081 ["rooms".to_owned(), room_id.to_owned(), "folders".to_owned()],
2082 )
2083 .json(json_body(&body, None)?);
2084 self.client.json(&self.options, request).await
2085 }
2086
2087 pub async fn folders_update(
2091 &self,
2092 room_id: &str,
2093 folder_id: &str,
2094 body: Option<RoomsFoldersUpdateRequest>,
2095 ) -> Result<Object> {
2096 let request = Request::new(
2097 Method::PATCH,
2098 [
2099 "rooms".to_owned(),
2100 room_id.to_owned(),
2101 "folders".to_owned(),
2102 folder_id.to_owned(),
2103 ],
2104 )
2105 .json(json_body(&body.unwrap_or_default(), None)?);
2106 self.client.json(&self.options, request).await
2107 }
2108
2109 pub async fn documents_add(
2113 &self,
2114 room_id: &str,
2115 body: RoomsDocumentsAddRequest,
2116 ) -> Result<Object> {
2117 let request = Request::new(
2118 Method::POST,
2119 [
2120 "rooms".to_owned(),
2121 room_id.to_owned(),
2122 "documents".to_owned(),
2123 ],
2124 )
2125 .json(json_body(&body, None)?);
2126 self.client.json(&self.options, request).await
2127 }
2128
2129 pub async fn documents_update(
2133 &self,
2134 room_id: &str,
2135 room_document_id: &str,
2136 body: Option<RoomsDocumentsUpdateRequest>,
2137 ) -> Result<Object> {
2138 let request = Request::new(
2139 Method::PATCH,
2140 [
2141 "rooms".to_owned(),
2142 room_id.to_owned(),
2143 "documents".to_owned(),
2144 room_document_id.to_owned(),
2145 ],
2146 )
2147 .json(json_body(&body.unwrap_or_default(), None)?);
2148 self.client.json(&self.options, request).await
2149 }
2150
2151 pub async fn participants_add(
2155 &self,
2156 room_id: &str,
2157 body: RoomsParticipantsAddRequest,
2158 ) -> Result<Object> {
2159 let request = Request::new(
2160 Method::POST,
2161 [
2162 "rooms".to_owned(),
2163 room_id.to_owned(),
2164 "participants".to_owned(),
2165 ],
2166 )
2167 .json(json_body(&body, None)?);
2168 self.client.json(&self.options, request).await
2169 }
2170
2171 pub async fn participants_update(
2175 &self,
2176 room_id: &str,
2177 participant_id: &str,
2178 body: RoomsParticipantsUpdateRequest,
2179 ) -> Result<Object> {
2180 let request = Request::new(
2181 Method::PATCH,
2182 [
2183 "rooms".to_owned(),
2184 room_id.to_owned(),
2185 "participants".to_owned(),
2186 participant_id.to_owned(),
2187 ],
2188 )
2189 .json(json_body(&body, None)?);
2190 self.client.json(&self.options, request).await
2191 }
2192
2193 pub async fn permissions_set(
2197 &self,
2198 room_id: &str,
2199 body: RoomsPermissionsSetRequest,
2200 ) -> Result<Object> {
2201 let request = Request::new(
2202 Method::POST,
2203 [
2204 "rooms".to_owned(),
2205 room_id.to_owned(),
2206 "permissions".to_owned(),
2207 ],
2208 )
2209 .json(json_body(&body, None)?);
2210 self.client.json(&self.options, request).await
2211 }
2212
2213 pub async fn permissions_revoke(
2217 &self,
2218 room_id: &str,
2219 permission_id: &str,
2220 body: Option<RoomsPermissionsRevokeRequest>,
2221 ) -> Result<Object> {
2222 let request = Request::new(
2223 Method::DELETE,
2224 [
2225 "rooms".to_owned(),
2226 room_id.to_owned(),
2227 "permissions".to_owned(),
2228 permission_id.to_owned(),
2229 ],
2230 )
2231 .json(json_body(&body.unwrap_or_default(), None)?);
2232 self.client.json(&self.options, request).await
2233 }
2234
2235 pub async fn requests_create(
2239 &self,
2240 room_id: &str,
2241 body: RoomsRequestsCreateRequest,
2242 ) -> Result<Object> {
2243 let request = Request::new(
2244 Method::POST,
2245 [
2246 "rooms".to_owned(),
2247 room_id.to_owned(),
2248 "requests".to_owned(),
2249 ],
2250 )
2251 .json(json_body(&body, None)?);
2252 self.client.json(&self.options, request).await
2253 }
2254
2255 pub async fn questions_create(
2259 &self,
2260 room_id: &str,
2261 body: RoomsQuestionsCreateRequest,
2262 ) -> Result<Object> {
2263 let request = Request::new(
2264 Method::POST,
2265 [
2266 "rooms".to_owned(),
2267 room_id.to_owned(),
2268 "questions".to_owned(),
2269 ],
2270 )
2271 .json(json_body(&body, None)?);
2272 self.client.json(&self.options, request).await
2273 }
2274
2275 pub async fn questions_answer(
2279 &self,
2280 room_id: &str,
2281 question_id: &str,
2282 body: RoomsQuestionsAnswerRequest,
2283 ) -> Result<Object> {
2284 let request = Request::new(
2285 Method::POST,
2286 [
2287 "rooms".to_owned(),
2288 room_id.to_owned(),
2289 "questions".to_owned(),
2290 question_id.to_owned(),
2291 "answers".to_owned(),
2292 ],
2293 )
2294 .json(json_body(&body, None)?);
2295 self.client.json(&self.options, request).await
2296 }
2297
2298 pub async fn analytics(&self, room_id: &str) -> Result<Object> {
2302 let request = Request::new(
2303 Method::GET,
2304 [
2305 "rooms".to_owned(),
2306 room_id.to_owned(),
2307 "analytics".to_owned(),
2308 ],
2309 );
2310 self.client.json(&self.options, request).await
2311 }
2312}
2313
2314#[derive(Clone, Debug)]
2316pub struct Portals {
2317 pub(crate) client: Wellfriend,
2318 pub(crate) options: RequestOptions,
2319}
2320
2321impl Portals {
2322 pub fn with_options(mut self, options: RequestOptions) -> Self {
2324 self.options = options;
2325 self
2326 }
2327
2328 pub async fn list(&self) -> Result<Object> {
2332 let request = Request::new(Method::GET, ["portals".to_owned()]);
2333 self.client.json(&self.options, request).await
2334 }
2335
2336 pub async fn create(&self, body: PortalsCreateRequest) -> Result<Object> {
2340 let request =
2341 Request::new(Method::POST, ["portals".to_owned()]).json(json_body(&body, None)?);
2342 self.client.json(&self.options, request).await
2343 }
2344
2345 pub async fn get(&self, portal_id: &str) -> Result<Object> {
2349 let request = Request::new(Method::GET, ["portals".to_owned(), portal_id.to_owned()]);
2350 self.client.json(&self.options, request).await
2351 }
2352
2353 pub async fn update(
2357 &self,
2358 portal_id: &str,
2359 body: Option<PortalsUpdateRequest>,
2360 ) -> Result<Object> {
2361 let request = Request::new(Method::PATCH, ["portals".to_owned(), portal_id.to_owned()])
2362 .json(json_body(&body.unwrap_or_default(), None)?);
2363 self.client.json(&self.options, request).await
2364 }
2365
2366 pub async fn publish(
2370 &self,
2371 portal_id: &str,
2372 body: Option<PortalsPublishRequest>,
2373 ) -> Result<Object> {
2374 let request = Request::new(
2375 Method::POST,
2376 [
2377 "portals".to_owned(),
2378 portal_id.to_owned(),
2379 "actions".to_owned(),
2380 ],
2381 )
2382 .json(json_body(&body.unwrap_or_default(), None)?);
2383 self.client.json(&self.options, request).await
2384 }
2385
2386 pub async fn rooms_add(&self, portal_id: &str, body: PortalsRoomsAddRequest) -> Result<Object> {
2390 let request = Request::new(
2391 Method::POST,
2392 [
2393 "portals".to_owned(),
2394 portal_id.to_owned(),
2395 "rooms".to_owned(),
2396 ],
2397 )
2398 .json(json_body(&body, None)?);
2399 self.client.json(&self.options, request).await
2400 }
2401
2402 pub async fn announcements_create(
2406 &self,
2407 portal_id: &str,
2408 body: PortalsAnnouncementsCreateRequest,
2409 ) -> Result<Object> {
2410 let request = Request::new(
2411 Method::POST,
2412 [
2413 "portals".to_owned(),
2414 portal_id.to_owned(),
2415 "announcements".to_owned(),
2416 ],
2417 )
2418 .json(json_body(&body, None)?);
2419 self.client.json(&self.options, request).await
2420 }
2421
2422 pub async fn resources_create(
2426 &self,
2427 portal_id: &str,
2428 body: PortalsResourcesCreateRequest,
2429 ) -> Result<Object> {
2430 let request = Request::new(
2431 Method::POST,
2432 [
2433 "portals".to_owned(),
2434 portal_id.to_owned(),
2435 "resources".to_owned(),
2436 ],
2437 )
2438 .json(json_body(&body, None)?);
2439 self.client.json(&self.options, request).await
2440 }
2441
2442 pub async fn analytics(&self, portal_id: &str) -> Result<Object> {
2446 let request = Request::new(
2447 Method::GET,
2448 [
2449 "portals".to_owned(),
2450 portal_id.to_owned(),
2451 "analytics".to_owned(),
2452 ],
2453 );
2454 self.client.json(&self.options, request).await
2455 }
2456}
2457
2458#[derive(Clone, Debug)]
2460pub struct EmbedSessions {
2461 pub(crate) client: Wellfriend,
2462 pub(crate) options: RequestOptions,
2463}
2464
2465impl EmbedSessions {
2466 pub fn with_options(mut self, options: RequestOptions) -> Self {
2468 self.options = options;
2469 self
2470 }
2471
2472 pub async fn create(&self, body: EmbedSessionsCreateRequest) -> Result<Object> {
2476 let request =
2477 Request::new(Method::POST, ["embed-sessions".to_owned()]).json(json_body(&body, None)?);
2478 self.client.json(&self.options, request).await
2479 }
2480
2481 pub async fn get(&self, session_id: &str) -> Result<Object> {
2485 let request = Request::new(
2486 Method::GET,
2487 ["embed-sessions".to_owned(), session_id.to_owned()],
2488 );
2489 self.client.json(&self.options, request).await
2490 }
2491
2492 pub async fn refresh(
2496 &self,
2497 session_id: &str,
2498 body: Option<EmbedSessionsRefreshRequest>,
2499 ) -> Result<Object> {
2500 let request = Request::new(
2501 Method::POST,
2502 [
2503 "embed-sessions".to_owned(),
2504 session_id.to_owned(),
2505 "refresh".to_owned(),
2506 ],
2507 )
2508 .json(json_body(&body.unwrap_or_default(), None)?);
2509 self.client.json(&self.options, request).await
2510 }
2511
2512 pub async fn revoke(
2516 &self,
2517 session_id: &str,
2518 body: Option<EmbedSessionsRevokeRequest>,
2519 ) -> Result<Object> {
2520 let request = Request::new(
2521 Method::POST,
2522 [
2523 "embed-sessions".to_owned(),
2524 session_id.to_owned(),
2525 "revoke".to_owned(),
2526 ],
2527 )
2528 .json(json_body(&body.unwrap_or_default(), None)?);
2529 self.client.json(&self.options, request).await
2530 }
2531}
2532
2533#[derive(Clone, Debug)]
2535pub struct Esign {
2536 pub(crate) client: Wellfriend,
2537 pub(crate) options: RequestOptions,
2538}
2539
2540impl Esign {
2541 pub fn with_options(mut self, options: RequestOptions) -> Self {
2543 self.options = options;
2544 self
2545 }
2546
2547 pub async fn levels(&self) -> Result<EsignLevelsResponse> {
2551 let request = Request::new(Method::GET, ["esign".to_owned(), "levels".to_owned()]);
2552 self.client.json(&self.options, request).await
2553 }
2554
2555 pub async fn envelopes_list(
2559 &self,
2560 params: Option<EsignEnvelopesListParams>,
2561 ) -> Result<Page<EsignEnvelopesListItem>> {
2562 let request = Request::new(Method::GET, ["esign".to_owned(), "envelopes".to_owned()])
2563 .query(
2564 "documentId",
2565 params.as_ref().and_then(|p| p.document_id.as_ref()),
2566 )
2567 .query("limit", params.as_ref().and_then(|p| p.limit.as_ref()))
2568 .query("cursor", params.as_ref().and_then(|p| p.cursor.as_ref()));
2569 self.client.json(&self.options, request).await
2570 }
2571
2572 pub fn envelopes_stream(
2574 &self,
2575 params: Option<EsignEnvelopesListParams>,
2576 ) -> PageStream<EsignEnvelopesListItem> {
2577 let this = self.clone();
2578 let params = params.unwrap_or_default();
2579 crate::pagination::paginate(move |cursor| {
2580 let this = this.clone();
2581 let mut params = params.clone();
2582 if cursor.is_some() {
2583 params.cursor = cursor;
2584 }
2585 Box::pin(async move { this.envelopes_list(Some(params)).await })
2586 })
2587 }
2588
2589 pub async fn envelopes_create(
2593 &self,
2594 body: EsignEnvelopesCreateRequest,
2595 ) -> Result<EsignEnvelopesCreateResponse> {
2596 let key = self.options.key();
2597 let request = Request::new(Method::POST, ["esign".to_owned(), "envelopes".to_owned()])
2598 .json(json_body(&body, Some(&key))?)
2599 .idempotency_key(key);
2600 self.client.json(&self.options, request).await
2601 }
2602
2603 pub async fn envelopes_get(&self, envelope_id: &str) -> Result<EsignEnvelopesGetResponse> {
2607 let request = Request::new(
2608 Method::GET,
2609 [
2610 "esign".to_owned(),
2611 "envelopes".to_owned(),
2612 envelope_id.to_owned(),
2613 ],
2614 );
2615 self.client.json(&self.options, request).await
2616 }
2617
2618 pub async fn envelopes_cancel(
2622 &self,
2623 envelope_id: &str,
2624 body: Option<EsignEnvelopesCancelRequest>,
2625 ) -> Result<EsignEnvelopesGetResponse> {
2626 let request = Request::new(
2627 Method::POST,
2628 [
2629 "esign".to_owned(),
2630 "envelopes".to_owned(),
2631 envelope_id.to_owned(),
2632 "cancel".to_owned(),
2633 ],
2634 )
2635 .json(json_body(&body.unwrap_or_default(), None)?);
2636 self.client.json(&self.options, request).await
2637 }
2638
2639 pub async fn envelopes_certificate(&self, envelope_id: &str) -> Result<Download> {
2643 let request = Request::new(
2644 Method::GET,
2645 [
2646 "esign".to_owned(),
2647 "envelopes".to_owned(),
2648 envelope_id.to_owned(),
2649 "certificate".to_owned(),
2650 ],
2651 );
2652 Ok(Download::new(
2653 self.client.send(&self.options, request).await?,
2654 ))
2655 }
2656
2657 pub async fn validate(&self, input: impl Into<FileInput>) -> Result<EsignValidateResponse> {
2661 let request = Request::new(Method::POST, ["esign".to_owned(), "validate".to_owned()])
2662 .body(crate::uploads::file_body(input.into(), "application/pdf").await?);
2663 self.client.json(&self.options, request).await
2664 }
2665}
2666
2667impl Wellfriend {
2668 pub fn platform(&self) -> Platform {
2670 Platform {
2671 client: self.clone(),
2672 options: RequestOptions::default(),
2673 }
2674 }
2675
2676 pub fn pricing(&self) -> Pricing {
2678 Pricing {
2679 client: self.clone(),
2680 options: RequestOptions::default(),
2681 }
2682 }
2683
2684 pub fn workflows(&self) -> Workflows {
2686 Workflows {
2687 client: self.clone(),
2688 options: RequestOptions::default(),
2689 }
2690 }
2691
2692 pub fn documents(&self) -> Documents {
2694 Documents {
2695 client: self.clone(),
2696 options: RequestOptions::default(),
2697 }
2698 }
2699
2700 pub fn uploads(&self) -> Uploads {
2702 Uploads {
2703 client: self.clone(),
2704 options: RequestOptions::default(),
2705 }
2706 }
2707
2708 pub fn document_operations(&self) -> DocumentOperations {
2710 DocumentOperations {
2711 client: self.clone(),
2712 options: RequestOptions::default(),
2713 }
2714 }
2715
2716 pub fn secure_links(&self) -> SecureLinks {
2718 SecureLinks {
2719 client: self.clone(),
2720 options: RequestOptions::default(),
2721 }
2722 }
2723
2724 pub fn workflow_runs(&self) -> WorkflowRuns {
2726 WorkflowRuns {
2727 client: self.clone(),
2728 options: RequestOptions::default(),
2729 }
2730 }
2731
2732 pub fn workflow_approvals(&self) -> WorkflowApprovals {
2734 WorkflowApprovals {
2735 client: self.clone(),
2736 options: RequestOptions::default(),
2737 }
2738 }
2739
2740 pub fn connectors(&self) -> Connectors {
2742 Connectors {
2743 client: self.clone(),
2744 options: RequestOptions::default(),
2745 }
2746 }
2747
2748 pub fn templates(&self) -> Templates {
2750 Templates {
2751 client: self.clone(),
2752 options: RequestOptions::default(),
2753 }
2754 }
2755
2756 pub fn signature_requests(&self) -> SignatureRequests {
2758 SignatureRequests {
2759 client: self.clone(),
2760 options: RequestOptions::default(),
2761 }
2762 }
2763
2764 pub fn annotations(&self) -> Annotations {
2766 Annotations {
2767 client: self.clone(),
2768 options: RequestOptions::default(),
2769 }
2770 }
2771
2772 pub fn forms(&self) -> Forms {
2774 Forms {
2775 client: self.clone(),
2776 options: RequestOptions::default(),
2777 }
2778 }
2779
2780 pub fn deal_rooms(&self) -> DealRooms {
2782 DealRooms {
2783 client: self.clone(),
2784 options: RequestOptions::default(),
2785 }
2786 }
2787
2788 pub fn embeds(&self) -> Embeds {
2790 Embeds {
2791 client: self.clone(),
2792 options: RequestOptions::default(),
2793 }
2794 }
2795
2796 pub fn document_versions(&self) -> DocumentVersions {
2798 DocumentVersions {
2799 client: self.clone(),
2800 options: RequestOptions::default(),
2801 }
2802 }
2803
2804 pub fn document_analytics(&self) -> DocumentAnalytics {
2806 DocumentAnalytics {
2807 client: self.clone(),
2808 options: RequestOptions::default(),
2809 }
2810 }
2811
2812 pub fn keys(&self) -> Keys {
2814 Keys {
2815 client: self.clone(),
2816 options: RequestOptions::default(),
2817 }
2818 }
2819
2820 pub fn usage(&self) -> Usage {
2822 Usage {
2823 client: self.clone(),
2824 options: RequestOptions::default(),
2825 }
2826 }
2827
2828 pub fn logs(&self) -> Logs {
2830 Logs {
2831 client: self.clone(),
2832 options: RequestOptions::default(),
2833 }
2834 }
2835
2836 pub fn rooms(&self) -> Rooms {
2838 Rooms {
2839 client: self.clone(),
2840 options: RequestOptions::default(),
2841 }
2842 }
2843
2844 pub fn portals(&self) -> Portals {
2846 Portals {
2847 client: self.clone(),
2848 options: RequestOptions::default(),
2849 }
2850 }
2851
2852 pub fn embed_sessions(&self) -> EmbedSessions {
2854 EmbedSessions {
2855 client: self.clone(),
2856 options: RequestOptions::default(),
2857 }
2858 }
2859
2860 pub fn esign(&self) -> Esign {
2862 Esign {
2863 client: self.clone(),
2864 options: RequestOptions::default(),
2865 }
2866 }
2867}