@@ -516,73 +516,97 @@ class ApiMethods {
516
516
return response . data ;
517
517
} ;
518
518
519
+ /**
520
+ * @param organization Can be the organization's ID or name
521
+ */
519
522
updateOrganization = async (
520
- organizationId : string ,
523
+ organization : string ,
521
524
params : TypesGen . UpdateOrganizationRequest ,
522
525
) => {
523
526
const response = await this . axios . patch < TypesGen . Organization > (
524
- `/api/v2/organizations/${ organizationId } ` ,
527
+ `/api/v2/organizations/${ organization } ` ,
525
528
params ,
526
529
) ;
527
530
return response . data ;
528
531
} ;
529
532
530
- deleteOrganization = async ( organizationId : string ) => {
533
+ /**
534
+ * @param organization Can be the organization's ID or name
535
+ */
536
+ deleteOrganization = async ( organization : string ) => {
531
537
await this . axios . delete < TypesGen . Organization > (
532
- `/api/v2/organizations/${ organizationId } ` ,
538
+ `/api/v2/organizations/${ organization } ` ,
533
539
) ;
534
540
} ;
535
541
542
+ /**
543
+ * @param organization Can be the organization's ID or name
544
+ */
536
545
getOrganization = async (
537
- organizationId : string ,
546
+ organization : string ,
538
547
) : Promise < TypesGen . Organization > => {
539
548
const response = await this . axios . get < TypesGen . Organization > (
540
- `/api/v2/organizations/${ organizationId } ` ,
549
+ `/api/v2/organizations/${ organization } ` ,
541
550
) ;
542
551
543
552
return response . data ;
544
553
} ;
545
554
546
- getOrganizationMembers = async ( organizationId : string ) => {
555
+ /**
556
+ * @param organization Can be the organization's ID or name
557
+ */
558
+ getOrganizationMembers = async ( organization : string ) => {
547
559
const response = await this . axios . get <
548
560
TypesGen . OrganizationMemberWithUserData [ ]
549
- > ( `/api/v2/organizations/${ organizationId } /members` ) ;
561
+ > ( `/api/v2/organizations/${ organization } /members` ) ;
550
562
551
563
return response . data ;
552
564
} ;
553
565
554
- getOrganizationRoles = async ( organizationId : string ) => {
566
+ /**
567
+ * @param organization Can be the organization's ID or name
568
+ */
569
+ getOrganizationRoles = async ( organization : string ) => {
555
570
const response = await this . axios . get < TypesGen . AssignableRoles [ ] > (
556
- `/api/v2/organizations/${ organizationId } /members/roles` ,
571
+ `/api/v2/organizations/${ organization } /members/roles` ,
557
572
) ;
558
573
559
574
return response . data ;
560
575
} ;
561
576
577
+ /**
578
+ * @param organization Can be the organization's ID or name
579
+ */
562
580
updateOrganizationMemberRoles = async (
563
- organizationId : string ,
581
+ organization : string ,
564
582
userId : string ,
565
583
roles : TypesGen . SlimRole [ "name" ] [ ] ,
566
584
) : Promise < TypesGen . User > => {
567
585
const response = await this . axios . put < TypesGen . User > (
568
- `/api/v2/organizations/${ organizationId } /members/${ userId } /roles` ,
586
+ `/api/v2/organizations/${ organization } /members/${ userId } /roles` ,
569
587
{ roles } ,
570
588
) ;
571
589
572
590
return response . data ;
573
591
} ;
574
592
575
- addOrganizationMember = async ( organizationId : string , userId : string ) => {
593
+ /**
594
+ * @param organization Can be the organization's ID or name
595
+ */
596
+ addOrganizationMember = async ( organization : string , userId : string ) => {
576
597
const response = await this . axios . post < TypesGen . OrganizationMember > (
577
- `/api/v2/organizations/${ organizationId } /members/${ userId } ` ,
598
+ `/api/v2/organizations/${ organization } /members/${ userId } ` ,
578
599
) ;
579
600
580
601
return response . data ;
581
602
} ;
582
603
583
- removeOrganizationMember = async ( organizationId : string , userId : string ) => {
604
+ /**
605
+ * @param organization Can be the organization's ID or name
606
+ */
607
+ removeOrganizationMember = async ( organization : string , userId : string ) => {
584
608
await this . axios . delete (
585
- `/api/v2/organizations/${ organizationId } /members/${ userId } ` ,
609
+ `/api/v2/organizations/${ organization } /members/${ userId } ` ,
586
610
) ;
587
611
} ;
588
612
@@ -601,8 +625,11 @@ class ApiMethods {
601
625
return response . data ;
602
626
} ;
603
627
628
+ /**
629
+ * @param organization Can be the organization's ID or name
630
+ */
604
631
getTemplates = async (
605
- organizationId : string ,
632
+ organization : string ,
606
633
options ?: TemplateOptions ,
607
634
) : Promise < TypesGen . Template [ ] > => {
608
635
const params : Record < string , string > = { } ;
@@ -614,19 +641,22 @@ class ApiMethods {
614
641
}
615
642
616
643
const response = await this . axios . get < TypesGen . Template [ ] > (
617
- `/api/v2/organizations/${ organizationId } /templates` ,
644
+ `/api/v2/organizations/${ organization } /templates` ,
618
645
{ params } ,
619
646
) ;
620
647
621
648
return response . data ;
622
649
} ;
623
650
651
+ /**
652
+ * @param organization Can be the organization's ID or name
653
+ */
624
654
getTemplateByName = async (
625
- organizationId : string ,
655
+ organization : string ,
626
656
name : string ,
627
657
) : Promise < TypesGen . Template > => {
628
658
const response = await this . axios . get < TypesGen . Template > (
629
- `/api/v2/organizations/${ organizationId } /templates/${ name } ` ,
659
+ `/api/v2/organizations/${ organization } /templates/${ name } ` ,
630
660
) ;
631
661
632
662
return response . data ;
@@ -675,26 +705,32 @@ class ApiMethods {
675
705
return response . data ;
676
706
} ;
677
707
708
+ /**
709
+ * @param organization Can be the organization's ID or name
710
+ */
678
711
getTemplateVersionByName = async (
679
- organizationId : string ,
712
+ organization : string ,
680
713
templateName : string ,
681
714
versionName : string ,
682
715
) : Promise < TypesGen . TemplateVersion > => {
683
716
const response = await this . axios . get < TypesGen . TemplateVersion > (
684
- `/api/v2/organizations/${ organizationId } /templates/${ templateName } /versions/${ versionName } ` ,
717
+ `/api/v2/organizations/${ organization } /templates/${ templateName } /versions/${ versionName } ` ,
685
718
) ;
686
719
687
720
return response . data ;
688
721
} ;
689
722
723
+ /**
724
+ * @param organization Can be the organization's ID or name
725
+ */
690
726
getPreviousTemplateVersionByName = async (
691
- organizationId : string ,
727
+ organization : string ,
692
728
templateName : string ,
693
729
versionName : string ,
694
730
) => {
695
731
try {
696
732
const response = await this . axios . get < TypesGen . TemplateVersion > (
697
- `/api/v2/organizations/${ organizationId } /templates/${ templateName } /versions/${ versionName } /previous` ,
733
+ `/api/v2/organizations/${ organization } /templates/${ templateName } /versions/${ versionName } /previous` ,
698
734
) ;
699
735
700
736
return response . data ;
@@ -713,12 +749,15 @@ class ApiMethods {
713
749
}
714
750
} ;
715
751
752
+ /**
753
+ * @param organization Can be the organization's ID or name
754
+ */
716
755
createTemplateVersion = async (
717
- organizationId : string ,
756
+ organization : string ,
718
757
data : TypesGen . CreateTemplateVersionRequest ,
719
758
) : Promise < TypesGen . TemplateVersion > => {
720
759
const response = await this . axios . post < TypesGen . TemplateVersion > (
721
- `/api/v2/organizations/${ organizationId } /templateversions` ,
760
+ `/api/v2/organizations/${ organization } /templateversions` ,
722
761
data ,
723
762
) ;
724
763
@@ -744,12 +783,15 @@ class ApiMethods {
744
783
return response . data ;
745
784
} ;
746
785
786
+ /**
787
+ * @param organization Can be the organization's ID or name
788
+ */
747
789
createTemplate = async (
748
- organizationId : string ,
790
+ organization : string ,
749
791
data : TypesGen . CreateTemplateRequest ,
750
792
) : Promise < TypesGen . Template > => {
751
793
const response = await this . axios . post (
752
- `/api/v2/organizations/${ organizationId } /templates` ,
794
+ `/api/v2/organizations/${ organization } /templates` ,
753
795
data ,
754
796
) ;
755
797
@@ -1480,31 +1522,40 @@ class ApiMethods {
1480
1522
return response . data ;
1481
1523
} ;
1482
1524
1483
- getGroups = async ( organizationId : string ) : Promise < TypesGen . Group [ ] > => {
1525
+ /**
1526
+ * @param organization Can be the organization's ID or name
1527
+ */
1528
+ getGroups = async ( organization : string ) : Promise < TypesGen . Group [ ] > => {
1484
1529
const response = await this . axios . get (
1485
- `/api/v2/organizations/${ organizationId } /groups` ,
1530
+ `/api/v2/organizations/${ organization } /groups` ,
1486
1531
) ;
1487
1532
1488
1533
return response . data ;
1489
1534
} ;
1490
1535
1536
+ /**
1537
+ * @param organization Can be the organization's ID or name
1538
+ */
1491
1539
createGroup = async (
1492
- organizationId : string ,
1540
+ organization : string ,
1493
1541
data : TypesGen . CreateGroupRequest ,
1494
1542
) : Promise < TypesGen . Group > => {
1495
1543
const response = await this . axios . post (
1496
- `/api/v2/organizations/${ organizationId } /groups` ,
1544
+ `/api/v2/organizations/${ organization } /groups` ,
1497
1545
data ,
1498
1546
) ;
1499
1547
return response . data ;
1500
1548
} ;
1501
1549
1550
+ /**
1551
+ * @param organization Can be the organization's ID or name
1552
+ */
1502
1553
getGroup = async (
1503
- organizationId : string ,
1554
+ organization : string ,
1504
1555
groupName : string ,
1505
1556
) : Promise < TypesGen . Group > => {
1506
1557
const response = await this . axios . get (
1507
- `/api/v2/organizations/${ organizationId } /groups/${ groupName } ` ,
1558
+ `/api/v2/organizations/${ organization } /groups/${ groupName } ` ,
1508
1559
) ;
1509
1560
return response . data ;
1510
1561
} ;
@@ -1673,11 +1724,14 @@ class ApiMethods {
1673
1724
return response . data ;
1674
1725
} ;
1675
1726
1727
+ /**
1728
+ * @param organization Can be the organization's ID or name
1729
+ */
1676
1730
getTemplateExamples = async (
1677
- organizationId : string ,
1731
+ organization : string ,
1678
1732
) : Promise < TypesGen . TemplateExample [ ] > => {
1679
1733
const response = await this . axios . get (
1680
- `/api/v2/organizations/${ organizationId } /templates/examples` ,
1734
+ `/api/v2/organizations/${ organization } /templates/examples` ,
1681
1735
) ;
1682
1736
1683
1737
return response . data ;
0 commit comments