taskcluster 43.1.0

API client for Taskcluster; typically used via `taskcluster`
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
#![allow(unused_imports)]
#![cfg_attr(rustfmt, rustfmt_skip)]
/* THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT */
use crate::{Client, ClientBuilder, Credentials, Retry};
use anyhow::Error;
use serde_json::Value;
use std::time::Duration;
use crate::util::urlencode;

/// Auth Service
///
/// Authentication related API end-points for Taskcluster and related
/// services. These API end-points are of interest if you wish to:
///   * Authorize a request signed with Taskcluster credentials,
///   * Manage clients and roles,
///   * Inspect or audit clients and roles,
///   * Gain access to various services guarded by this API.
///
pub struct Auth (Client);

#[allow(non_snake_case)]
impl Auth {
    /// Create a new undefined instance, based on the given client.
    pub fn new<CB: Into<ClientBuilder>>(client_builder: CB) -> Result<Self, Error> {
        Ok(Self(client_builder
            .into()
            .path_prefix("api/auth/v1/")
            .build()?))
    }

    /// Ping Server
    /// 
    /// Respond without doing anything.
    /// This endpoint is used to check that the service is up.
    pub async fn ping(&self) -> Result<(), Error> {
        let method = "GET";
        let (path, query) = Self::ping_details();
        let body = None;
        let resp = self.0.request(method, path, query, body).await?;
        resp.bytes().await?;
        Ok(())
    }

    /// Generate an unsigned URL for the ping endpoint
    pub fn ping_url(&self) -> Result<String, Error> {
        let (path, query) = Self::ping_details();
        self.0.make_url(path, query)
    }

    /// Generate a signed URL for the ping endpoint
    pub fn ping_signed_url(&self, ttl: Duration) -> Result<String, Error> {
        let (path, query) = Self::ping_details();
        self.0.make_signed_url(path, query, ttl)
    }

    /// Determine the HTTP request details for ping
    fn ping_details<'a>() -> (&'static str, Option<Vec<(&'static str, &'a str)>>) {
        let path = "ping";
        let query = None;

        (path, query)
    }

    /// List Clients
    /// 
    /// Get a list of all clients.  With `prefix`, only clients for which
    /// it is a prefix of the clientId are returned.
    /// 
    /// By default this end-point will try to return up to 1000 clients in one
    /// request. But it **may return less, even none**.
    /// It may also return a `continuationToken` even though there are no more
    /// results. However, you can only be sure to have seen all results if you
    /// keep calling `listClients` with the last `continuationToken` until you
    /// get a result without a `continuationToken`.
    pub async fn listClients(&self, prefix: Option<&str>, continuationToken: Option<&str>, limit: Option<&str>) -> Result<Value, Error> {
        let method = "GET";
        let (path, query) = Self::listClients_details(prefix, continuationToken, limit);
        let body = None;
        let resp = self.0.request(method, path, query, body).await?;
        Ok(resp.json().await?)
    }

    /// Generate an unsigned URL for the listClients endpoint
    pub fn listClients_url(&self, prefix: Option<&str>, continuationToken: Option<&str>, limit: Option<&str>) -> Result<String, Error> {
        let (path, query) = Self::listClients_details(prefix, continuationToken, limit);
        self.0.make_url(path, query)
    }

    /// Generate a signed URL for the listClients endpoint
    pub fn listClients_signed_url(&self, prefix: Option<&str>, continuationToken: Option<&str>, limit: Option<&str>, ttl: Duration) -> Result<String, Error> {
        let (path, query) = Self::listClients_details(prefix, continuationToken, limit);
        self.0.make_signed_url(path, query, ttl)
    }

    /// Determine the HTTP request details for listClients
    fn listClients_details<'a>(prefix: Option<&'a str>, continuationToken: Option<&'a str>, limit: Option<&'a str>) -> (&'static str, Option<Vec<(&'static str, &'a str)>>) {
        let path = "clients/";
        let mut query = None;
        if let Some(q) = prefix {
            query.get_or_insert_with(Vec::new).push(("prefix", q));
        }
        if let Some(q) = continuationToken {
            query.get_or_insert_with(Vec::new).push(("continuationToken", q));
        }
        if let Some(q) = limit {
            query.get_or_insert_with(Vec::new).push(("limit", q));
        }

        (path, query)
    }

    /// Get Client
    /// 
    /// Get information about a single client.
    pub async fn client(&self, clientId: &str) -> Result<Value, Error> {
        let method = "GET";
        let (path, query) = Self::client_details(clientId);
        let body = None;
        let resp = self.0.request(method, &path, query, body).await?;
        Ok(resp.json().await?)
    }

    /// Generate an unsigned URL for the client endpoint
    pub fn client_url(&self, clientId: &str) -> Result<String, Error> {
        let (path, query) = Self::client_details(clientId);
        self.0.make_url(&path, query)
    }

    /// Generate a signed URL for the client endpoint
    pub fn client_signed_url(&self, clientId: &str, ttl: Duration) -> Result<String, Error> {
        let (path, query) = Self::client_details(clientId);
        self.0.make_signed_url(&path, query, ttl)
    }

    /// Determine the HTTP request details for client
    fn client_details<'a>(clientId: &'a str) -> (String, Option<Vec<(&'static str, &'a str)>>) {
        let path = format!("clients/{}", urlencode(clientId));
        let query = None;

        (path, query)
    }

    /// Create Client
    /// 
    /// Create a new client and get the `accessToken` for this client.
    /// You should store the `accessToken` from this API call as there is no
    /// other way to retrieve it.
    /// 
    /// If you loose the `accessToken` you can call `resetAccessToken` to reset
    /// it, and a new `accessToken` will be returned, but you cannot retrieve the
    /// current `accessToken`.
    /// 
    /// If a client with the same `clientId` already exists this operation will
    /// fail. Use `updateClient` if you wish to update an existing client.
    /// 
    /// The caller's scopes must satisfy `scopes`.
    pub async fn createClient(&self, clientId: &str, payload: &Value) -> Result<Value, Error> {
        let method = "PUT";
        let (path, query) = Self::createClient_details(clientId);
        let body = Some(payload);
        let resp = self.0.request(method, &path, query, body).await?;
        Ok(resp.json().await?)
    }

    /// Determine the HTTP request details for createClient
    fn createClient_details<'a>(clientId: &'a str) -> (String, Option<Vec<(&'static str, &'a str)>>) {
        let path = format!("clients/{}", urlencode(clientId));
        let query = None;

        (path, query)
    }

    /// Reset `accessToken`
    /// 
    /// Reset a clients `accessToken`, this will revoke the existing
    /// `accessToken`, generate a new `accessToken` and return it from this
    /// call.
    /// 
    /// There is no way to retrieve an existing `accessToken`, so if you loose it
    /// you must reset the accessToken to acquire it again.
    pub async fn resetAccessToken(&self, clientId: &str) -> Result<Value, Error> {
        let method = "POST";
        let (path, query) = Self::resetAccessToken_details(clientId);
        let body = None;
        let resp = self.0.request(method, &path, query, body).await?;
        Ok(resp.json().await?)
    }

    /// Determine the HTTP request details for resetAccessToken
    fn resetAccessToken_details<'a>(clientId: &'a str) -> (String, Option<Vec<(&'static str, &'a str)>>) {
        let path = format!("clients/{}/reset", urlencode(clientId));
        let query = None;

        (path, query)
    }

    /// Update Client
    /// 
    /// Update an exisiting client. The `clientId` and `accessToken` cannot be
    /// updated, but `scopes` can be modified.  The caller's scopes must
    /// satisfy all scopes being added to the client in the update operation.
    /// If no scopes are given in the request, the client's scopes remain
    /// unchanged
    pub async fn updateClient(&self, clientId: &str, payload: &Value) -> Result<Value, Error> {
        let method = "POST";
        let (path, query) = Self::updateClient_details(clientId);
        let body = Some(payload);
        let resp = self.0.request(method, &path, query, body).await?;
        Ok(resp.json().await?)
    }

    /// Determine the HTTP request details for updateClient
    fn updateClient_details<'a>(clientId: &'a str) -> (String, Option<Vec<(&'static str, &'a str)>>) {
        let path = format!("clients/{}", urlencode(clientId));
        let query = None;

        (path, query)
    }

    /// Enable Client
    /// 
    /// Enable a client that was disabled with `disableClient`.  If the client
    /// is already enabled, this does nothing.
    /// 
    /// This is typically used by identity providers to re-enable clients that
    /// had been disabled when the corresponding identity's scopes changed.
    pub async fn enableClient(&self, clientId: &str) -> Result<Value, Error> {
        let method = "POST";
        let (path, query) = Self::enableClient_details(clientId);
        let body = None;
        let resp = self.0.request(method, &path, query, body).await?;
        Ok(resp.json().await?)
    }

    /// Determine the HTTP request details for enableClient
    fn enableClient_details<'a>(clientId: &'a str) -> (String, Option<Vec<(&'static str, &'a str)>>) {
        let path = format!("clients/{}/enable", urlencode(clientId));
        let query = None;

        (path, query)
    }

    /// Disable Client
    /// 
    /// Disable a client.  If the client is already disabled, this does nothing.
    /// 
    /// This is typically used by identity providers to disable clients when the
    /// corresponding identity's scopes no longer satisfy the client's scopes.
    pub async fn disableClient(&self, clientId: &str) -> Result<Value, Error> {
        let method = "POST";
        let (path, query) = Self::disableClient_details(clientId);
        let body = None;
        let resp = self.0.request(method, &path, query, body).await?;
        Ok(resp.json().await?)
    }

    /// Determine the HTTP request details for disableClient
    fn disableClient_details<'a>(clientId: &'a str) -> (String, Option<Vec<(&'static str, &'a str)>>) {
        let path = format!("clients/{}/disable", urlencode(clientId));
        let query = None;

        (path, query)
    }

    /// Delete Client
    /// 
    /// Delete a client, please note that any roles related to this client must
    /// be deleted independently.
    pub async fn deleteClient(&self, clientId: &str) -> Result<(), Error> {
        let method = "DELETE";
        let (path, query) = Self::deleteClient_details(clientId);
        let body = None;
        let resp = self.0.request(method, &path, query, body).await?;
        resp.bytes().await?;
        Ok(())
    }

    /// Determine the HTTP request details for deleteClient
    fn deleteClient_details<'a>(clientId: &'a str) -> (String, Option<Vec<(&'static str, &'a str)>>) {
        let path = format!("clients/{}", urlencode(clientId));
        let query = None;

        (path, query)
    }

    /// List Roles (no pagination)
    /// 
    /// Get a list of all roles. Each role object also includes the list of
    /// scopes it expands to.  This always returns all roles in a single HTTP
    /// request.
    /// 
    /// To get paginated results, use `listRoles2`.
    pub async fn listRoles(&self) -> Result<Value, Error> {
        let method = "GET";
        let (path, query) = Self::listRoles_details();
        let body = None;
        let resp = self.0.request(method, path, query, body).await?;
        Ok(resp.json().await?)
    }

    /// Generate an unsigned URL for the listRoles endpoint
    pub fn listRoles_url(&self) -> Result<String, Error> {
        let (path, query) = Self::listRoles_details();
        self.0.make_url(path, query)
    }

    /// Generate a signed URL for the listRoles endpoint
    pub fn listRoles_signed_url(&self, ttl: Duration) -> Result<String, Error> {
        let (path, query) = Self::listRoles_details();
        self.0.make_signed_url(path, query, ttl)
    }

    /// Determine the HTTP request details for listRoles
    fn listRoles_details<'a>() -> (&'static str, Option<Vec<(&'static str, &'a str)>>) {
        let path = "roles/";
        let query = None;

        (path, query)
    }

    /// List Roles
    /// 
    /// Get a list of all roles. Each role object also includes the list of
    /// scopes it expands to.  This is similar to `listRoles` but differs in the
    /// format of the response.
    /// 
    /// If no limit is given, all roles are returned. Since this
    /// list may become long, callers can use the `limit` and `continuationToken`
    /// query arguments to page through the responses.
    pub async fn listRoles2(&self, continuationToken: Option<&str>, limit: Option<&str>) -> Result<Value, Error> {
        let method = "GET";
        let (path, query) = Self::listRoles2_details(continuationToken, limit);
        let body = None;
        let resp = self.0.request(method, path, query, body).await?;
        Ok(resp.json().await?)
    }

    /// Generate an unsigned URL for the listRoles2 endpoint
    pub fn listRoles2_url(&self, continuationToken: Option<&str>, limit: Option<&str>) -> Result<String, Error> {
        let (path, query) = Self::listRoles2_details(continuationToken, limit);
        self.0.make_url(path, query)
    }

    /// Generate a signed URL for the listRoles2 endpoint
    pub fn listRoles2_signed_url(&self, continuationToken: Option<&str>, limit: Option<&str>, ttl: Duration) -> Result<String, Error> {
        let (path, query) = Self::listRoles2_details(continuationToken, limit);
        self.0.make_signed_url(path, query, ttl)
    }

    /// Determine the HTTP request details for listRoles2
    fn listRoles2_details<'a>(continuationToken: Option<&'a str>, limit: Option<&'a str>) -> (&'static str, Option<Vec<(&'static str, &'a str)>>) {
        let path = "roles2/";
        let mut query = None;
        if let Some(q) = continuationToken {
            query.get_or_insert_with(Vec::new).push(("continuationToken", q));
        }
        if let Some(q) = limit {
            query.get_or_insert_with(Vec::new).push(("limit", q));
        }

        (path, query)
    }

    /// List Role IDs
    /// 
    /// Get a list of all role IDs.
    /// 
    /// If no limit is given, the roleIds of all roles are returned. Since this
    /// list may become long, callers can use the `limit` and `continuationToken`
    /// query arguments to page through the responses.
    pub async fn listRoleIds(&self, continuationToken: Option<&str>, limit: Option<&str>) -> Result<Value, Error> {
        let method = "GET";
        let (path, query) = Self::listRoleIds_details(continuationToken, limit);
        let body = None;
        let resp = self.0.request(method, path, query, body).await?;
        Ok(resp.json().await?)
    }

    /// Generate an unsigned URL for the listRoleIds endpoint
    pub fn listRoleIds_url(&self, continuationToken: Option<&str>, limit: Option<&str>) -> Result<String, Error> {
        let (path, query) = Self::listRoleIds_details(continuationToken, limit);
        self.0.make_url(path, query)
    }

    /// Generate a signed URL for the listRoleIds endpoint
    pub fn listRoleIds_signed_url(&self, continuationToken: Option<&str>, limit: Option<&str>, ttl: Duration) -> Result<String, Error> {
        let (path, query) = Self::listRoleIds_details(continuationToken, limit);
        self.0.make_signed_url(path, query, ttl)
    }

    /// Determine the HTTP request details for listRoleIds
    fn listRoleIds_details<'a>(continuationToken: Option<&'a str>, limit: Option<&'a str>) -> (&'static str, Option<Vec<(&'static str, &'a str)>>) {
        let path = "roleids/";
        let mut query = None;
        if let Some(q) = continuationToken {
            query.get_or_insert_with(Vec::new).push(("continuationToken", q));
        }
        if let Some(q) = limit {
            query.get_or_insert_with(Vec::new).push(("limit", q));
        }

        (path, query)
    }

    /// Get Role
    /// 
    /// Get information about a single role, including the set of scopes that the
    /// role expands to.
    pub async fn role(&self, roleId: &str) -> Result<Value, Error> {
        let method = "GET";
        let (path, query) = Self::role_details(roleId);
        let body = None;
        let resp = self.0.request(method, &path, query, body).await?;
        Ok(resp.json().await?)
    }

    /// Generate an unsigned URL for the role endpoint
    pub fn role_url(&self, roleId: &str) -> Result<String, Error> {
        let (path, query) = Self::role_details(roleId);
        self.0.make_url(&path, query)
    }

    /// Generate a signed URL for the role endpoint
    pub fn role_signed_url(&self, roleId: &str, ttl: Duration) -> Result<String, Error> {
        let (path, query) = Self::role_details(roleId);
        self.0.make_signed_url(&path, query, ttl)
    }

    /// Determine the HTTP request details for role
    fn role_details<'a>(roleId: &'a str) -> (String, Option<Vec<(&'static str, &'a str)>>) {
        let path = format!("roles/{}", urlencode(roleId));
        let query = None;

        (path, query)
    }

    /// Create Role
    /// 
    /// Create a new role.
    /// 
    /// The caller's scopes must satisfy the new role's scopes.
    /// 
    /// If there already exists a role with the same `roleId` this operation
    /// will fail. Use `updateRole` to modify an existing role.
    /// 
    /// Creation of a role that will generate an infinite expansion will result
    /// in an error response.
    pub async fn createRole(&self, roleId: &str, payload: &Value) -> Result<Value, Error> {
        let method = "PUT";
        let (path, query) = Self::createRole_details(roleId);
        let body = Some(payload);
        let resp = self.0.request(method, &path, query, body).await?;
        Ok(resp.json().await?)
    }

    /// Determine the HTTP request details for createRole
    fn createRole_details<'a>(roleId: &'a str) -> (String, Option<Vec<(&'static str, &'a str)>>) {
        let path = format!("roles/{}", urlencode(roleId));
        let query = None;

        (path, query)
    }

    /// Update Role
    /// 
    /// Update an existing role.
    /// 
    /// The caller's scopes must satisfy all of the new scopes being added, but
    /// need not satisfy all of the role's existing scopes.
    /// 
    /// An update of a role that will generate an infinite expansion will result
    /// in an error response.
    pub async fn updateRole(&self, roleId: &str, payload: &Value) -> Result<Value, Error> {
        let method = "POST";
        let (path, query) = Self::updateRole_details(roleId);
        let body = Some(payload);
        let resp = self.0.request(method, &path, query, body).await?;
        Ok(resp.json().await?)
    }

    /// Determine the HTTP request details for updateRole
    fn updateRole_details<'a>(roleId: &'a str) -> (String, Option<Vec<(&'static str, &'a str)>>) {
        let path = format!("roles/{}", urlencode(roleId));
        let query = None;

        (path, query)
    }

    /// Delete Role
    /// 
    /// Delete a role. This operation will succeed regardless of whether or not
    /// the role exists.
    pub async fn deleteRole(&self, roleId: &str) -> Result<(), Error> {
        let method = "DELETE";
        let (path, query) = Self::deleteRole_details(roleId);
        let body = None;
        let resp = self.0.request(method, &path, query, body).await?;
        resp.bytes().await?;
        Ok(())
    }

    /// Determine the HTTP request details for deleteRole
    fn deleteRole_details<'a>(roleId: &'a str) -> (String, Option<Vec<(&'static str, &'a str)>>) {
        let path = format!("roles/{}", urlencode(roleId));
        let query = None;

        (path, query)
    }

    /// Expand Scopes
    /// 
    /// Return an expanded copy of the given scopeset, with scopes implied by any
    /// roles included.
    pub async fn expandScopes(&self, payload: &Value) -> Result<Value, Error> {
        let method = "POST";
        let (path, query) = Self::expandScopes_details();
        let body = Some(payload);
        let resp = self.0.request(method, path, query, body).await?;
        Ok(resp.json().await?)
    }

    /// Determine the HTTP request details for expandScopes
    fn expandScopes_details<'a>() -> (&'static str, Option<Vec<(&'static str, &'a str)>>) {
        let path = "scopes/expand";
        let query = None;

        (path, query)
    }

    /// Get Current Scopes
    /// 
    /// Return the expanded scopes available in the request, taking into account all sources
    /// of scopes and scope restrictions (temporary credentials, assumeScopes, client scopes,
    /// and roles).
    pub async fn currentScopes(&self) -> Result<Value, Error> {
        let method = "GET";
        let (path, query) = Self::currentScopes_details();
        let body = None;
        let resp = self.0.request(method, path, query, body).await?;
        Ok(resp.json().await?)
    }

    /// Generate an unsigned URL for the currentScopes endpoint
    pub fn currentScopes_url(&self) -> Result<String, Error> {
        let (path, query) = Self::currentScopes_details();
        self.0.make_url(path, query)
    }

    /// Generate a signed URL for the currentScopes endpoint
    pub fn currentScopes_signed_url(&self, ttl: Duration) -> Result<String, Error> {
        let (path, query) = Self::currentScopes_details();
        self.0.make_signed_url(path, query, ttl)
    }

    /// Determine the HTTP request details for currentScopes
    fn currentScopes_details<'a>() -> (&'static str, Option<Vec<(&'static str, &'a str)>>) {
        let path = "scopes/current";
        let query = None;

        (path, query)
    }

    /// Get Temporary Read/Write Credentials S3
    /// 
    /// Get temporary AWS credentials for `read-write` or `read-only` access to
    /// a given `bucket` and `prefix` within that bucket.
    /// The `level` parameter can be `read-write` or `read-only` and determines
    /// which type of credentials are returned. Please note that the `level`
    /// parameter is required in the scope guarding access.  The bucket name must
    /// not contain `.`, as recommended by Amazon.
    /// 
    /// This method can only allow access to a whitelisted set of buckets, as configured
    /// in the Taskcluster deployment
    /// 
    /// The credentials are set to expire after an hour, but this behavior is
    /// subject to change. Hence, you should always read the `expires` property
    /// from the response, if you intend to maintain active credentials in your
    /// application.
    /// 
    /// Please note that your `prefix` may not start with slash `/`. Such a prefix
    /// is allowed on S3, but we forbid it here to discourage bad behavior.
    /// 
    /// Also note that if your `prefix` doesn't end in a slash `/`, the STS
    /// credentials may allow access to unexpected keys, as S3 does not treat
    /// slashes specially.  For example, a prefix of `my-folder` will allow
    /// access to `my-folder/file.txt` as expected, but also to `my-folder.txt`,
    /// which may not be intended.
    /// 
    /// Finally, note that the `PutObjectAcl` call is not allowed.  Passing a canned
    /// ACL other than `private` to `PutObject` is treated as a `PutObjectAcl` call, and
    /// will result in an access-denied error from AWS.  This limitation is due to a
    /// security flaw in Amazon S3 which might otherwise allow indefinite access to
    /// uploaded objects.
    /// 
    /// **EC2 metadata compatibility**, if the querystring parameter
    /// `?format=iam-role-compat` is given, the response will be compatible
    /// with the JSON exposed by the EC2 metadata service. This aims to ease
    /// compatibility for libraries and tools built to auto-refresh credentials.
    /// For details on the format returned by EC2 metadata service see:
    /// [EC2 User Guide](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html#instance-metadata-security-credentials).
    pub async fn awsS3Credentials(&self, level: &str, bucket: &str, prefix: &str, format: Option<&str>) -> Result<Value, Error> {
        let method = "GET";
        let (path, query) = Self::awsS3Credentials_details(level, bucket, prefix, format);
        let body = None;
        let resp = self.0.request(method, &path, query, body).await?;
        Ok(resp.json().await?)
    }

    /// Generate an unsigned URL for the awsS3Credentials endpoint
    pub fn awsS3Credentials_url(&self, level: &str, bucket: &str, prefix: &str, format: Option<&str>) -> Result<String, Error> {
        let (path, query) = Self::awsS3Credentials_details(level, bucket, prefix, format);
        self.0.make_url(&path, query)
    }

    /// Generate a signed URL for the awsS3Credentials endpoint
    pub fn awsS3Credentials_signed_url(&self, level: &str, bucket: &str, prefix: &str, format: Option<&str>, ttl: Duration) -> Result<String, Error> {
        let (path, query) = Self::awsS3Credentials_details(level, bucket, prefix, format);
        self.0.make_signed_url(&path, query, ttl)
    }

    /// Determine the HTTP request details for awsS3Credentials
    fn awsS3Credentials_details<'a>(level: &'a str, bucket: &'a str, prefix: &'a str, format: Option<&'a str>) -> (String, Option<Vec<(&'static str, &'a str)>>) {
        let path = format!("aws/s3/{}/{}/{}", urlencode(level), urlencode(bucket), urlencode(prefix));
        let mut query = None;
        if let Some(q) = format {
            query.get_or_insert_with(Vec::new).push(("format", q));
        }

        (path, query)
    }

    /// List Accounts Managed by Auth
    /// 
    /// Retrieve a list of all Azure accounts managed by Taskcluster Auth.
    pub async fn azureAccounts(&self) -> Result<Value, Error> {
        let method = "GET";
        let (path, query) = Self::azureAccounts_details();
        let body = None;
        let resp = self.0.request(method, path, query, body).await?;
        Ok(resp.json().await?)
    }

    /// Generate an unsigned URL for the azureAccounts endpoint
    pub fn azureAccounts_url(&self) -> Result<String, Error> {
        let (path, query) = Self::azureAccounts_details();
        self.0.make_url(path, query)
    }

    /// Generate a signed URL for the azureAccounts endpoint
    pub fn azureAccounts_signed_url(&self, ttl: Duration) -> Result<String, Error> {
        let (path, query) = Self::azureAccounts_details();
        self.0.make_signed_url(path, query, ttl)
    }

    /// Determine the HTTP request details for azureAccounts
    fn azureAccounts_details<'a>() -> (&'static str, Option<Vec<(&'static str, &'a str)>>) {
        let path = "azure/accounts";
        let query = None;

        (path, query)
    }

    /// List Tables in an Account Managed by Auth
    /// 
    /// Retrieve a list of all tables in an account.
    pub async fn azureTables(&self, account: &str, continuationToken: Option<&str>) -> Result<Value, Error> {
        let method = "GET";
        let (path, query) = Self::azureTables_details(account, continuationToken);
        let body = None;
        let resp = self.0.request(method, &path, query, body).await?;
        Ok(resp.json().await?)
    }

    /// Generate an unsigned URL for the azureTables endpoint
    pub fn azureTables_url(&self, account: &str, continuationToken: Option<&str>) -> Result<String, Error> {
        let (path, query) = Self::azureTables_details(account, continuationToken);
        self.0.make_url(&path, query)
    }

    /// Generate a signed URL for the azureTables endpoint
    pub fn azureTables_signed_url(&self, account: &str, continuationToken: Option<&str>, ttl: Duration) -> Result<String, Error> {
        let (path, query) = Self::azureTables_details(account, continuationToken);
        self.0.make_signed_url(&path, query, ttl)
    }

    /// Determine the HTTP request details for azureTables
    fn azureTables_details<'a>(account: &'a str, continuationToken: Option<&'a str>) -> (String, Option<Vec<(&'static str, &'a str)>>) {
        let path = format!("azure/{}/tables", urlencode(account));
        let mut query = None;
        if let Some(q) = continuationToken {
            query.get_or_insert_with(Vec::new).push(("continuationToken", q));
        }

        (path, query)
    }

    /// Get Shared-Access-Signature for Azure Table
    /// 
    /// Get a shared access signature (SAS) string for use with a specific Azure
    /// Table Storage table.
    /// 
    /// The `level` parameter can be `read-write` or `read-only` and determines
    /// which type of credentials are returned.  If level is read-write, it will create the
    /// table if it doesn't already exist.
    pub async fn azureTableSAS(&self, account: &str, table: &str, level: &str) -> Result<Value, Error> {
        let method = "GET";
        let (path, query) = Self::azureTableSAS_details(account, table, level);
        let body = None;
        let resp = self.0.request(method, &path, query, body).await?;
        Ok(resp.json().await?)
    }

    /// Generate an unsigned URL for the azureTableSAS endpoint
    pub fn azureTableSAS_url(&self, account: &str, table: &str, level: &str) -> Result<String, Error> {
        let (path, query) = Self::azureTableSAS_details(account, table, level);
        self.0.make_url(&path, query)
    }

    /// Generate a signed URL for the azureTableSAS endpoint
    pub fn azureTableSAS_signed_url(&self, account: &str, table: &str, level: &str, ttl: Duration) -> Result<String, Error> {
        let (path, query) = Self::azureTableSAS_details(account, table, level);
        self.0.make_signed_url(&path, query, ttl)
    }

    /// Determine the HTTP request details for azureTableSAS
    fn azureTableSAS_details<'a>(account: &'a str, table: &'a str, level: &'a str) -> (String, Option<Vec<(&'static str, &'a str)>>) {
        let path = format!("azure/{}/table/{}/{}", urlencode(account), urlencode(table), urlencode(level));
        let query = None;

        (path, query)
    }

    /// List containers in an Account Managed by Auth
    /// 
    /// Retrieve a list of all containers in an account.
    pub async fn azureContainers(&self, account: &str, continuationToken: Option<&str>) -> Result<Value, Error> {
        let method = "GET";
        let (path, query) = Self::azureContainers_details(account, continuationToken);
        let body = None;
        let resp = self.0.request(method, &path, query, body).await?;
        Ok(resp.json().await?)
    }

    /// Generate an unsigned URL for the azureContainers endpoint
    pub fn azureContainers_url(&self, account: &str, continuationToken: Option<&str>) -> Result<String, Error> {
        let (path, query) = Self::azureContainers_details(account, continuationToken);
        self.0.make_url(&path, query)
    }

    /// Generate a signed URL for the azureContainers endpoint
    pub fn azureContainers_signed_url(&self, account: &str, continuationToken: Option<&str>, ttl: Duration) -> Result<String, Error> {
        let (path, query) = Self::azureContainers_details(account, continuationToken);
        self.0.make_signed_url(&path, query, ttl)
    }

    /// Determine the HTTP request details for azureContainers
    fn azureContainers_details<'a>(account: &'a str, continuationToken: Option<&'a str>) -> (String, Option<Vec<(&'static str, &'a str)>>) {
        let path = format!("azure/{}/containers", urlencode(account));
        let mut query = None;
        if let Some(q) = continuationToken {
            query.get_or_insert_with(Vec::new).push(("continuationToken", q));
        }

        (path, query)
    }

    /// Get Shared-Access-Signature for Azure Container
    /// 
    /// Get a shared access signature (SAS) string for use with a specific Azure
    /// Blob Storage container.
    /// 
    /// The `level` parameter can be `read-write` or `read-only` and determines
    /// which type of credentials are returned.  If level is read-write, it will create the
    /// container if it doesn't already exist.
    pub async fn azureContainerSAS(&self, account: &str, container: &str, level: &str) -> Result<Value, Error> {
        let method = "GET";
        let (path, query) = Self::azureContainerSAS_details(account, container, level);
        let body = None;
        let resp = self.0.request(method, &path, query, body).await?;
        Ok(resp.json().await?)
    }

    /// Generate an unsigned URL for the azureContainerSAS endpoint
    pub fn azureContainerSAS_url(&self, account: &str, container: &str, level: &str) -> Result<String, Error> {
        let (path, query) = Self::azureContainerSAS_details(account, container, level);
        self.0.make_url(&path, query)
    }

    /// Generate a signed URL for the azureContainerSAS endpoint
    pub fn azureContainerSAS_signed_url(&self, account: &str, container: &str, level: &str, ttl: Duration) -> Result<String, Error> {
        let (path, query) = Self::azureContainerSAS_details(account, container, level);
        self.0.make_signed_url(&path, query, ttl)
    }

    /// Determine the HTTP request details for azureContainerSAS
    fn azureContainerSAS_details<'a>(account: &'a str, container: &'a str, level: &'a str) -> (String, Option<Vec<(&'static str, &'a str)>>) {
        let path = format!("azure/{}/containers/{}/{}", urlencode(account), urlencode(container), urlencode(level));
        let query = None;

        (path, query)
    }

    /// Get DSN for Sentry Project
    /// 
    /// Get temporary DSN (access credentials) for a sentry project.
    /// The credentials returned can be used with any Sentry client for up to
    /// 24 hours, after which the credentials will be automatically disabled.
    /// 
    /// If the project doesn't exist it will be created, and assigned to the
    /// initial team configured for this component. Contact a Sentry admin
    /// to have the project transferred to a team you have access to if needed
    pub async fn sentryDSN(&self, project: &str) -> Result<Value, Error> {
        let method = "GET";
        let (path, query) = Self::sentryDSN_details(project);
        let body = None;
        let resp = self.0.request(method, &path, query, body).await?;
        Ok(resp.json().await?)
    }

    /// Generate an unsigned URL for the sentryDSN endpoint
    pub fn sentryDSN_url(&self, project: &str) -> Result<String, Error> {
        let (path, query) = Self::sentryDSN_details(project);
        self.0.make_url(&path, query)
    }

    /// Generate a signed URL for the sentryDSN endpoint
    pub fn sentryDSN_signed_url(&self, project: &str, ttl: Duration) -> Result<String, Error> {
        let (path, query) = Self::sentryDSN_details(project);
        self.0.make_signed_url(&path, query, ttl)
    }

    /// Determine the HTTP request details for sentryDSN
    fn sentryDSN_details<'a>(project: &'a str) -> (String, Option<Vec<(&'static str, &'a str)>>) {
        let path = format!("sentry/{}/dsn", urlencode(project));
        let query = None;

        (path, query)
    }

    /// Get a client token for the Websocktunnel service
    /// 
    /// Get a temporary token suitable for use connecting to a
    /// [websocktunnel](https://github.com/taskcluster/taskcluster/tree/main/tools/websocktunnel) server.
    /// 
    /// The resulting token will only be accepted by servers with a matching audience
    /// value.  Reaching such a server is the callers responsibility.  In general,
    /// a server URL or set of URLs should be provided to the caller as configuration
    /// along with the audience value.
    /// 
    /// The token is valid for a limited time (on the scale of hours). Callers should
    /// refresh it before expiration.
    pub async fn websocktunnelToken(&self, wstAudience: &str, wstClient: &str) -> Result<Value, Error> {
        let method = "GET";
        let (path, query) = Self::websocktunnelToken_details(wstAudience, wstClient);
        let body = None;
        let resp = self.0.request(method, &path, query, body).await?;
        Ok(resp.json().await?)
    }

    /// Generate an unsigned URL for the websocktunnelToken endpoint
    pub fn websocktunnelToken_url(&self, wstAudience: &str, wstClient: &str) -> Result<String, Error> {
        let (path, query) = Self::websocktunnelToken_details(wstAudience, wstClient);
        self.0.make_url(&path, query)
    }

    /// Generate a signed URL for the websocktunnelToken endpoint
    pub fn websocktunnelToken_signed_url(&self, wstAudience: &str, wstClient: &str, ttl: Duration) -> Result<String, Error> {
        let (path, query) = Self::websocktunnelToken_details(wstAudience, wstClient);
        self.0.make_signed_url(&path, query, ttl)
    }

    /// Determine the HTTP request details for websocktunnelToken
    fn websocktunnelToken_details<'a>(wstAudience: &'a str, wstClient: &'a str) -> (String, Option<Vec<(&'static str, &'a str)>>) {
        let path = format!("websocktunnel/{}/{}", urlencode(wstAudience), urlencode(wstClient));
        let query = None;

        (path, query)
    }

    /// Get Temporary GCP Credentials
    /// 
    /// Get temporary GCP credentials for the given serviceAccount in the given project.
    /// 
    /// Only preconfigured projects and serviceAccounts are allowed, as defined in the
    /// deployment of the Taskcluster services.
    /// 
    /// The credentials are set to expire after an hour, but this behavior is
    /// subject to change. Hence, you should always read the `expires` property
    /// from the response, if you intend to maintain active credentials in your
    /// application.
    pub async fn gcpCredentials(&self, projectId: &str, serviceAccount: &str) -> Result<Value, Error> {
        let method = "GET";
        let (path, query) = Self::gcpCredentials_details(projectId, serviceAccount);
        let body = None;
        let resp = self.0.request(method, &path, query, body).await?;
        Ok(resp.json().await?)
    }

    /// Generate an unsigned URL for the gcpCredentials endpoint
    pub fn gcpCredentials_url(&self, projectId: &str, serviceAccount: &str) -> Result<String, Error> {
        let (path, query) = Self::gcpCredentials_details(projectId, serviceAccount);
        self.0.make_url(&path, query)
    }

    /// Generate a signed URL for the gcpCredentials endpoint
    pub fn gcpCredentials_signed_url(&self, projectId: &str, serviceAccount: &str, ttl: Duration) -> Result<String, Error> {
        let (path, query) = Self::gcpCredentials_details(projectId, serviceAccount);
        self.0.make_signed_url(&path, query, ttl)
    }

    /// Determine the HTTP request details for gcpCredentials
    fn gcpCredentials_details<'a>(projectId: &'a str, serviceAccount: &'a str) -> (String, Option<Vec<(&'static str, &'a str)>>) {
        let path = format!("gcp/credentials/{}/{}", urlencode(projectId), urlencode(serviceAccount));
        let query = None;

        (path, query)
    }

    /// Authenticate Hawk Request
    /// 
    /// Validate the request signature given on input and return list of scopes
    /// that the authenticating client has.
    /// 
    /// This method is used by other services that wish rely on Taskcluster
    /// credentials for authentication. This way we can use Hawk without having
    /// the secret credentials leave this service.
    pub async fn authenticateHawk(&self, payload: &Value) -> Result<Value, Error> {
        let method = "POST";
        let (path, query) = Self::authenticateHawk_details();
        let body = Some(payload);
        let resp = self.0.request(method, path, query, body).await?;
        Ok(resp.json().await?)
    }

    /// Determine the HTTP request details for authenticateHawk
    fn authenticateHawk_details<'a>() -> (&'static str, Option<Vec<(&'static str, &'a str)>>) {
        let path = "authenticate-hawk";
        let query = None;

        (path, query)
    }

    /// Test Authentication
    /// 
    /// Utility method to test client implementations of Taskcluster
    /// authentication.
    /// 
    /// Rather than using real credentials, this endpoint accepts requests with
    /// clientId `tester` and accessToken `no-secret`. That client's scopes are
    /// based on `clientScopes` in the request body.
    /// 
    /// The request is validated, with any certificate, authorizedScopes, etc.
    /// applied, and the resulting scopes are checked against `requiredScopes`
    /// from the request body. On success, the response contains the clientId
    /// and scopes as seen by the API method.
    pub async fn testAuthenticate(&self, payload: &Value) -> Result<Value, Error> {
        let method = "POST";
        let (path, query) = Self::testAuthenticate_details();
        let body = Some(payload);
        let resp = self.0.request(method, path, query, body).await?;
        Ok(resp.json().await?)
    }

    /// Determine the HTTP request details for testAuthenticate
    fn testAuthenticate_details<'a>() -> (&'static str, Option<Vec<(&'static str, &'a str)>>) {
        let path = "test-authenticate";
        let query = None;

        (path, query)
    }

    /// Test Authentication (GET)
    /// 
    /// Utility method similar to `testAuthenticate`, but with the GET method,
    /// so it can be used with signed URLs (bewits).
    /// 
    /// Rather than using real credentials, this endpoint accepts requests with
    /// clientId `tester` and accessToken `no-secret`. That client's scopes are
    /// `['test:*', 'auth:create-client:test:*']`.  The call fails if the 
    /// `test:authenticate-get` scope is not available.
    /// 
    /// The request is validated, with any certificate, authorizedScopes, etc.
    /// applied, and the resulting scopes are checked, just like any API call.
    /// On success, the response contains the clientId and scopes as seen by
    /// the API method.
    /// 
    /// This method may later be extended to allow specification of client and
    /// required scopes via query arguments.
    pub async fn testAuthenticateGet(&self) -> Result<Value, Error> {
        let method = "GET";
        let (path, query) = Self::testAuthenticateGet_details();
        let body = None;
        let resp = self.0.request(method, path, query, body).await?;
        Ok(resp.json().await?)
    }

    /// Generate an unsigned URL for the testAuthenticateGet endpoint
    pub fn testAuthenticateGet_url(&self) -> Result<String, Error> {
        let (path, query) = Self::testAuthenticateGet_details();
        self.0.make_url(path, query)
    }

    /// Generate a signed URL for the testAuthenticateGet endpoint
    pub fn testAuthenticateGet_signed_url(&self, ttl: Duration) -> Result<String, Error> {
        let (path, query) = Self::testAuthenticateGet_details();
        self.0.make_signed_url(path, query, ttl)
    }

    /// Determine the HTTP request details for testAuthenticateGet
    fn testAuthenticateGet_details<'a>() -> (&'static str, Option<Vec<(&'static str, &'a str)>>) {
        let path = "test-authenticate-get/";
        let query = None;

        (path, query)
    }
}