This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
/
commands.go
3173 lines (2905 loc) · 105 KB
/
commands.go
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
// Code generated by goagen v1.3.0, DO NOT EDIT.
//
// API "auth": CLI Commands
//
// Command:
// $ goagen
// --design=github.com/fabric8-services/fabric8-auth/design
// --out=$(GOPATH)/src/github.com/fabric8-services/fabric8-auth-client
// --pkg=auth
// --version=v1.3.0
package cli
import (
"context"
"encoding/json"
"fmt"
"github.com/fabric8-services/fabric8-auth-client/auth"
"github.com/goadesign/goa"
goaclient "github.com/goadesign/goa/client"
uuid "github.com/goadesign/goa/uuid"
"github.com/spf13/cobra"
"log"
"net/url"
"os"
"strconv"
"strings"
"time"
)
type (
// AuthorizeAuthorizeCommand is the command line data structure for the authorize action of authorize
AuthorizeAuthorizeCommand struct {
// The name of the api client which is requesting a token
APIClient string
ClientID string
// This is where authorization provider will send authorization_code
RedirectURI string
// Informs the Authorization Server of the mechanism to be used for returning Authorization Response parameters. If response_mode=query then response parameters are encoded in the query string added to the redirect_uri when redirecting back to the Client. If response_mode=fragment then response parameters are encoded in the fragment added to the redirect_uri when redirecting back to the Client. The default Response Mode for the code Response Type is the query encoding
ResponseMode string
// response_type=code for grant_type authorization_code
ResponseType string
Scope string
State string
PrettyPrint bool
}
// CallbackAuthorizeCommand is the command line data structure for the callback action of authorize
CallbackAuthorizeCommand struct {
// authorization_code
Code string
State string
PrettyPrint bool
}
// ShowClustersCommand is the command line data structure for the show action of clusters
ShowClustersCommand struct {
PrettyPrint bool
}
// AddCollaboratorsCommand is the command line data structure for the add action of collaborators
AddCollaboratorsCommand struct {
IdentityID string
// ID of the space
SpaceID string
PrettyPrint bool
}
// AddManyCollaboratorsCommand is the command line data structure for the add-many action of collaborators
AddManyCollaboratorsCommand struct {
Payload string
ContentType string
// ID of the space
SpaceID string
PrettyPrint bool
}
// ListCollaboratorsCommand is the command line data structure for the list action of collaborators
ListCollaboratorsCommand struct {
// ID of the space
SpaceID string
// Paging size
PageLimit int
// Paging start position
PageOffset string
IfModifiedSince string
IfNoneMatch string
PrettyPrint bool
}
// RemoveCollaboratorsCommand is the command line data structure for the remove action of collaborators
RemoveCollaboratorsCommand struct {
IdentityID string
// ID of the space
SpaceID string
PrettyPrint bool
}
// RemoveManyCollaboratorsCommand is the command line data structure for the remove-many action of collaborators
RemoveManyCollaboratorsCommand struct {
Payload string
ContentType string
// ID of the space
SpaceID string
PrettyPrint bool
}
// AcceptInviteInvitationCommand is the command line data structure for the acceptInvite action of invitation
AcceptInviteInvitationCommand struct {
// Unique acceptance code for a user to accept a previously extended invitation
AcceptCode string
PrettyPrint bool
}
// CreateInviteInvitationCommand is the command line data structure for the createInvite action of invitation
CreateInviteInvitationCommand struct {
Payload string
ContentType string
// Unique identifier of the organization, team, security group or resource
InviteTo string
PrettyPrint bool
}
// RescindInviteInvitationCommand is the command line data structure for the rescindInvite action of invitation
RescindInviteInvitationCommand struct {
// Unique identifier for the invitation to the organization, team, security group or resource
InviteTo string
PrettyPrint bool
}
// CallbackLoginCommand is the command line data structure for the callback action of login
CallbackLoginCommand struct {
// Authorization code
Code string
// state value
State string
PrettyPrint bool
}
// LoginLoginCommand is the command line data structure for the login action of login
LoginLoginCommand struct {
// The name of the api client which is requesting a token
APIClient string
// URL to be redirected to after successful login. If not set then will redirect to the referrer instead.
Redirect string
// If scope=offline_access then an offline token will be issued instead of a regular refresh token
Scope string
PrettyPrint bool
}
// LogoutLogoutCommand is the command line data structure for the logout action of logout
LogoutLogoutCommand struct {
// URL to be redirected to after successful logout. If not set then will redirect to the referrer instead.
Redirect string
Referer string
PrettyPrint bool
}
// Logoutv2LogoutCommand is the command line data structure for the logoutv2 action of logout
Logoutv2LogoutCommand struct {
// URL to be redirected to after successful logout. If not set then will redirect to the referrer instead.
Redirect string
Referer string
PrettyPrint bool
}
// BanNamedusersCommand is the command line data structure for the ban action of namedusers
BanNamedusersCommand struct {
// Username
Username string
PrettyPrint bool
}
// DeactivateNamedusersCommand is the command line data structure for the deactivate action of namedusers
DeactivateNamedusersCommand struct {
// Username
Username string
PrettyPrint bool
}
// DeprovisionNamedusersCommand is the command line data structure for the deprovision action of namedusers
DeprovisionNamedusersCommand struct {
// Username
Username string
PrettyPrint bool
}
// ShowOpenidConfigurationCommand is the command line data structure for the show action of openid_configuration
ShowOpenidConfigurationCommand struct {
PrettyPrint bool
}
// CreateOrganizationCommand is the command line data structure for the create action of organization
CreateOrganizationCommand struct {
Payload string
ContentType string
PrettyPrint bool
}
// ListOrganizationCommand is the command line data structure for the list action of organization
ListOrganizationCommand struct {
PrettyPrint bool
}
// DeleteResourceCommand is the command line data structure for the delete action of resource
DeleteResourceCommand struct {
// Identifier of the resource to delete
ResourceID string
PrettyPrint bool
}
// RegisterResourceCommand is the command line data structure for the register action of resource
RegisterResourceCommand struct {
Payload string
ContentType string
PrettyPrint bool
}
// ScopesResourceCommand is the command line data structure for the scopes action of resource
ScopesResourceCommand struct {
// Identifier of the resource to list scopes for
ResourceID string
PrettyPrint bool
}
// ShowResourceCommand is the command line data structure for the show action of resource
ShowResourceCommand struct {
// The identifier of the resource to read
ResourceID string
PrettyPrint bool
}
// AssignRoleResourceRolesCommand is the command line data structure for the assignRole action of resource_roles
AssignRoleResourceRolesCommand struct {
Payload string
ContentType string
ResourceID string
PrettyPrint bool
}
// HasScopeResourceRolesCommand is the command line data structure for the hasScope action of resource_roles
HasScopeResourceRolesCommand struct {
// The identifier of the resource to check for a user scope
ResourceID string
// The name of the scope to check for the user
ScopeName string
PrettyPrint bool
}
// ListAssignedResourceRolesCommand is the command line data structure for the listAssigned action of resource_roles
ListAssignedResourceRolesCommand struct {
ResourceID string
PrettyPrint bool
}
// ListAssignedByRoleNameResourceRolesCommand is the command line data structure for the listAssignedByRoleName action of resource_roles
ListAssignedByRoleNameResourceRolesCommand struct {
ResourceID string
RoleName string
PrettyPrint bool
}
// ListRolesCommand is the command line data structure for the list action of roles
ListRolesCommand struct {
// resource type for which roles are being listed
ResourceType string
PrettyPrint bool
}
// UsersSearchCommand is the command line data structure for the users action of search
UsersSearchCommand struct {
// Paging size
PageLimit int
// Paging start position
PageOffset string
Q string
PrettyPrint bool
}
// CreateSpaceCommand is the command line data structure for the create action of space
CreateSpaceCommand struct {
// ID of the space
SpaceID string
PrettyPrint bool
}
// DeleteSpaceCommand is the command line data structure for the delete action of space
DeleteSpaceCommand struct {
// ID of the space
SpaceID string
PrettyPrint bool
}
// ListTeamsSpaceCommand is the command line data structure for the listTeams action of space
ListTeamsSpaceCommand struct {
// ID of the space
SpaceID string
PrettyPrint bool
}
// ShowStatusCommand is the command line data structure for the show action of status
ShowStatusCommand struct {
PrettyPrint bool
}
// CreateTeamCommand is the command line data structure for the create action of team
CreateTeamCommand struct {
Payload string
ContentType string
PrettyPrint bool
}
// ListTeamCommand is the command line data structure for the list action of team
ListTeamCommand struct {
PrettyPrint bool
}
// DeleteTokenCommand is the command line data structure for the Delete action of token
DeleteTokenCommand struct {
// The resource for which the external token is being deleted, example https://github.com or https://api.starter-us-east-2.openshift.com
For string
PrettyPrint bool
}
// ExchangeTokenCommand is the command line data structure for the Exchange action of token
ExchangeTokenCommand struct {
Payload string
ContentType string
PrettyPrint bool
}
// LinkCallbackTokenCommand is the command line data structure for the LinkCallback action of token
LinkCallbackTokenCommand struct {
// Code provided by an external oauth2 resource provider
Code string
// State generated by the link request
State string
PrettyPrint bool
}
// RetrieveTokenCommand is the command line data structure for the Retrieve action of token
RetrieveTokenCommand struct {
// The resource for which the external token is being fetched, example https://github.com or https://api.starter-us-east-2.openshift.com
For string
// Pull the user's details for the specific connected account, example, the user's updated github username would be fetched from github. If this is not set or false, then the user profile will be pulled only if the stored user's details did not have the username
ForcePull string
PrettyPrint bool
}
// StatusTokenCommand is the command line data structure for the Status action of token
StatusTokenCommand struct {
// The resource for which the external token is being checked, example https://github.com or https://api.starter-us-east-2.openshift.com
For string
// Pull the user's details for the specific connected account, example, the user's updated github username would be fetched from github. If this is not set or false, then the user profile will be pulled only if the stored user's details did not have the username
ForcePull string
PrettyPrint bool
}
// AuditTokenCommand is the command line data structure for the audit action of token
AuditTokenCommand struct {
// Resource ID of a resource on which the user wishes to perform an operation
ResourceID string
PrettyPrint bool
}
// KeysTokenCommand is the command line data structure for the keys action of token
KeysTokenCommand struct {
// Key format. If set to "jwk" (used by default) then JSON Web Key format will be used. If "pem" then a PEM-like format (PEM without header and footer) will be used.
Format string
PrettyPrint bool
}
// LinkTokenCommand is the command line data structure for the link action of token
LinkTokenCommand struct {
// Resource we need to link accounts for. Multiple resources should be separated by comma.
For string
// URL to be redirected to after successful account linking. If not set then will redirect to the referrer instead.
Redirect string
PrettyPrint bool
}
// RefreshTokenCommand is the command line data structure for the refresh action of token
RefreshTokenCommand struct {
Payload string
ContentType string
PrettyPrint bool
}
// ListResourcesUserCommand is the command line data structure for the listResources action of user
ListResourcesUserCommand struct {
// the type of resource to list
Type string
PrettyPrint bool
}
// ShowUserCommand is the command line data structure for the show action of user
ShowUserCommand struct {
IfModifiedSince string
IfNoneMatch string
PrettyPrint bool
}
// ShowUserinfoCommand is the command line data structure for the show action of userinfo
ShowUserinfoCommand struct {
PrettyPrint bool
}
// RevokeAllTokensUsersCommand is the command line data structure for the RevokeAllTokens action of users
RevokeAllTokensUsersCommand struct {
// Identifier of the identity for which all tokens will be revoked
ID string
PrettyPrint bool
}
// CreateUsersCommand is the command line data structure for the create action of users
CreateUsersCommand struct {
Payload string
ContentType string
PrettyPrint bool
}
// ListUsersCommand is the command line data structure for the list action of users
ListUsersCommand struct {
// email to search users
FilterEmail string
// username to search users
FilterUsername string
IfModifiedSince string
IfNoneMatch string
PrettyPrint bool
}
// ListTokensUsersCommand is the command line data structure for the listTokens action of users
ListTokensUsersCommand struct {
// the ID value of the user's identity
ID string
PrettyPrint bool
}
// SendEmailVerificationCodeUsersCommand is the command line data structure for the sendEmailVerificationCode action of users
SendEmailVerificationCodeUsersCommand struct {
PrettyPrint bool
}
// ShowUsersCommand is the command line data structure for the show action of users
ShowUsersCommand struct {
// Identity ID
ID string
IfModifiedSince string
IfNoneMatch string
PrettyPrint bool
}
// UpdateUsersCommand is the command line data structure for the update action of users
UpdateUsersCommand struct {
Payload string
ContentType string
PrettyPrint bool
}
// VerifyEmailUsersCommand is the command line data structure for the verifyEmail action of users
VerifyEmailUsersCommand struct {
// code
Code string
PrettyPrint bool
}
)
// RegisterCommands registers the resource action CLI commands.
func RegisterCommands(app *cobra.Command, c *auth.Client) {
var command, sub *cobra.Command
command = &cobra.Command{
Use: "accept-invite",
Short: ``,
}
tmp1 := new(AcceptInviteInvitationCommand)
sub = &cobra.Command{
Use: `invitation ["/api/invitations/accept/ACCEPTCODE"]`,
Short: ``,
RunE: func(cmd *cobra.Command, args []string) error { return tmp1.Run(c, args) },
}
tmp1.RegisterFlags(sub, c)
sub.PersistentFlags().BoolVar(&tmp1.PrettyPrint, "pp", false, "Pretty print response body")
command.AddCommand(sub)
app.AddCommand(command)
command = &cobra.Command{
Use: "add",
Short: `Add a user to the list of space collaborators.`,
}
tmp2 := new(AddCollaboratorsCommand)
sub = &cobra.Command{
Use: `collaborators ["/api/spaces/SPACEID/collaborators/IDENTITYID"]`,
Short: ``,
RunE: func(cmd *cobra.Command, args []string) error { return tmp2.Run(c, args) },
}
tmp2.RegisterFlags(sub, c)
sub.PersistentFlags().BoolVar(&tmp2.PrettyPrint, "pp", false, "Pretty print response body")
command.AddCommand(sub)
app.AddCommand(command)
command = &cobra.Command{
Use: "add-many",
Short: `Add users to the list of space collaborators.`,
}
tmp3 := new(AddManyCollaboratorsCommand)
sub = &cobra.Command{
Use: `collaborators ["/api/spaces/SPACEID/collaborators"]`,
Short: ``,
Long: `
Payload example:
{
"data": [
{
"id": "Provident illo aut.",
"type": "identities"
},
{
"id": "Provident illo aut.",
"type": "identities"
},
{
"id": "Provident illo aut.",
"type": "identities"
}
],
"included": [
3058677049130590579,
3058677049130590579,
3058677049130590579
]
}`,
RunE: func(cmd *cobra.Command, args []string) error { return tmp3.Run(c, args) },
}
tmp3.RegisterFlags(sub, c)
sub.PersistentFlags().BoolVar(&tmp3.PrettyPrint, "pp", false, "Pretty print response body")
command.AddCommand(sub)
app.AddCommand(command)
command = &cobra.Command{
Use: "assign-role",
Short: `Assigns roles to one or more identities, for a specific resource`,
}
tmp4 := new(AssignRoleResourceRolesCommand)
sub = &cobra.Command{
Use: `resource-roles ["/api/resources/RESOURCEID/roles"]`,
Short: ``,
Long: `
Payload example:
{
"data": [
{
"ids": [
"Enim suscipit sapiente vitae."
],
"role": "Beatae magni voluptate sit aspernatur odit."
},
{
"ids": [
"Enim suscipit sapiente vitae."
],
"role": "Beatae magni voluptate sit aspernatur odit."
}
]
}`,
RunE: func(cmd *cobra.Command, args []string) error { return tmp4.Run(c, args) },
}
tmp4.RegisterFlags(sub, c)
sub.PersistentFlags().BoolVar(&tmp4.PrettyPrint, "pp", false, "Pretty print response body")
command.AddCommand(sub)
app.AddCommand(command)
command = &cobra.Command{
Use: "audit",
Short: `Verifies the state of an existing token in respect to its privileges for a specified resource, and issues a new token if required`,
}
tmp5 := new(AuditTokenCommand)
sub = &cobra.Command{
Use: `token ["/api/token/audit"]`,
Short: ``,
RunE: func(cmd *cobra.Command, args []string) error { return tmp5.Run(c, args) },
}
tmp5.RegisterFlags(sub, c)
sub.PersistentFlags().BoolVar(&tmp5.PrettyPrint, "pp", false, "Pretty print response body")
command.AddCommand(sub)
app.AddCommand(command)
command = &cobra.Command{
Use: "authorize",
Short: `Authorize service client`,
}
tmp6 := new(AuthorizeAuthorizeCommand)
sub = &cobra.Command{
Use: `authorize ["/api/authorize"]`,
Short: ``,
RunE: func(cmd *cobra.Command, args []string) error { return tmp6.Run(c, args) },
}
tmp6.RegisterFlags(sub, c)
sub.PersistentFlags().BoolVar(&tmp6.PrettyPrint, "pp", false, "Pretty print response body")
command.AddCommand(sub)
app.AddCommand(command)
command = &cobra.Command{
Use: "ban",
Short: `ban the user`,
}
tmp7 := new(BanNamedusersCommand)
sub = &cobra.Command{
Use: `namedusers ["/api/namedusers/USERNAME/ban"]`,
Short: ``,
RunE: func(cmd *cobra.Command, args []string) error { return tmp7.Run(c, args) },
}
tmp7.RegisterFlags(sub, c)
sub.PersistentFlags().BoolVar(&tmp7.PrettyPrint, "pp", false, "Pretty print response body")
command.AddCommand(sub)
app.AddCommand(command)
command = &cobra.Command{
Use: "callback",
Short: `callback action`,
}
tmp8 := new(CallbackAuthorizeCommand)
sub = &cobra.Command{
Use: `authorize ["/api/authorize/callback"]`,
Short: ``,
RunE: func(cmd *cobra.Command, args []string) error { return tmp8.Run(c, args) },
}
tmp8.RegisterFlags(sub, c)
sub.PersistentFlags().BoolVar(&tmp8.PrettyPrint, "pp", false, "Pretty print response body")
command.AddCommand(sub)
tmp9 := new(CallbackLoginCommand)
sub = &cobra.Command{
Use: `login ["/api/login/callback"]`,
Short: ``,
RunE: func(cmd *cobra.Command, args []string) error { return tmp9.Run(c, args) },
}
tmp9.RegisterFlags(sub, c)
sub.PersistentFlags().BoolVar(&tmp9.PrettyPrint, "pp", false, "Pretty print response body")
command.AddCommand(sub)
app.AddCommand(command)
command = &cobra.Command{
Use: "create",
Short: `create action`,
}
tmp10 := new(CreateOrganizationCommand)
sub = &cobra.Command{
Use: `organization ["/api/organizations"]`,
Short: ``,
Long: `
Payload example:
{
"name": "Consequatur consectetur et."
}`,
RunE: func(cmd *cobra.Command, args []string) error { return tmp10.Run(c, args) },
}
tmp10.RegisterFlags(sub, c)
sub.PersistentFlags().BoolVar(&tmp10.PrettyPrint, "pp", false, "Pretty print response body")
command.AddCommand(sub)
tmp11 := new(CreateSpaceCommand)
sub = &cobra.Command{
Use: `space ["/api/spaces/SPACEID"]`,
Short: ``,
RunE: func(cmd *cobra.Command, args []string) error { return tmp11.Run(c, args) },
}
tmp11.RegisterFlags(sub, c)
sub.PersistentFlags().BoolVar(&tmp11.PrettyPrint, "pp", false, "Pretty print response body")
command.AddCommand(sub)
tmp12 := new(CreateTeamCommand)
sub = &cobra.Command{
Use: `team ["/api/teams"]`,
Short: ``,
Long: `
Payload example:
{
"name": "Molestias laudantium sequi hic perspiciatis nobis.",
"space_id": "Quibusdam dolor numquam ut odit."
}`,
RunE: func(cmd *cobra.Command, args []string) error { return tmp12.Run(c, args) },
}
tmp12.RegisterFlags(sub, c)
sub.PersistentFlags().BoolVar(&tmp12.PrettyPrint, "pp", false, "Pretty print response body")
command.AddCommand(sub)
tmp13 := new(CreateUsersCommand)
sub = &cobra.Command{
Use: `users ["/api/users"]`,
Short: ``,
Long: `
Payload example:
{
"data": {
"attributes": {
"approved": false,
"bio": "Magnam placeat error sed qui.",
"cluster": "Ad inventore at omnis.",
"company": "Commodi voluptatem alias dolore est.",
"contextInformation": {
"last_visited_url": "https://a.openshift.io",
"space": "3d6dab8d-f204-42e8-ab29-cdb1c93130ad"
},
"email": "Consequatur sit sit doloremque.",
"emailVerified": true,
"enabled": false,
"featureLevel": "Est quibusdam eaque et nulla commodi architecto.",
"fullName": "Dolorem distinctio.",
"imageURL": "Laborum quam.",
"providerType": "Quia sapiente est sed accusamus temporibus.",
"registrationCompleted": false,
"rhd_user_id": "Rerum aperiam commodi fugit et.",
"rhd_username": "Soluta necessitatibus.",
"url": "Illum ut repellendus velit qui.",
"username": "Vero qui voluptatibus illum natus dignissimos."
},
"links": {
"meta": {
"Et et qui maiores.": 4880951199939673999
},
"related": "Rem eligendi consectetur voluptas.",
"self": "Error doloremque."
},
"type": "Deserunt repudiandae quod."
}
}`,
RunE: func(cmd *cobra.Command, args []string) error { return tmp13.Run(c, args) },
}
tmp13.RegisterFlags(sub, c)
sub.PersistentFlags().BoolVar(&tmp13.PrettyPrint, "pp", false, "Pretty print response body")
command.AddCommand(sub)
app.AddCommand(command)
command = &cobra.Command{
Use: "create-invite",
Short: `Create a new invitation for a user to join an organization, team or security group, or accept a role for a resource`,
}
tmp14 := new(CreateInviteInvitationCommand)
sub = &cobra.Command{
Use: `invitation ["/api/invitations/INVITETO"]`,
Short: ``,
Long: `
Payload example:
{
"data": [
{
"identity-id": "Consequatur maiores at cupiditate.",
"member": false,
"roles": [
"Cum perspiciatis error quasi autem tenetur et."
]
}
],
"links": {
"OnFailure": "Possimus asperiores ea pariatur.",
"OnSuccess": "Excepturi repellendus rerum tempore."
}
}`,
RunE: func(cmd *cobra.Command, args []string) error { return tmp14.Run(c, args) },
}
tmp14.RegisterFlags(sub, c)
sub.PersistentFlags().BoolVar(&tmp14.PrettyPrint, "pp", false, "Pretty print response body")
command.AddCommand(sub)
app.AddCommand(command)
command = &cobra.Command{
Use: "deactivate",
Short: `deactivate the user`,
}
tmp15 := new(DeactivateNamedusersCommand)
sub = &cobra.Command{
Use: `namedusers ["/api/namedusers/USERNAME/deactivate"]`,
Short: ``,
RunE: func(cmd *cobra.Command, args []string) error { return tmp15.Run(c, args) },
}
tmp15.RegisterFlags(sub, c)
sub.PersistentFlags().BoolVar(&tmp15.PrettyPrint, "pp", false, "Pretty print response body")
command.AddCommand(sub)
app.AddCommand(command)
command = &cobra.Command{
Use: "delete",
Short: `delete action`,
}
tmp16 := new(DeleteResourceCommand)
sub = &cobra.Command{
Use: `resource ["/api/resource/RESOURCEID"]`,
Short: ``,
RunE: func(cmd *cobra.Command, args []string) error { return tmp16.Run(c, args) },
}
tmp16.RegisterFlags(sub, c)
sub.PersistentFlags().BoolVar(&tmp16.PrettyPrint, "pp", false, "Pretty print response body")
command.AddCommand(sub)
tmp17 := new(DeleteSpaceCommand)
sub = &cobra.Command{
Use: `space ["/api/spaces/SPACEID"]`,
Short: ``,
RunE: func(cmd *cobra.Command, args []string) error { return tmp17.Run(c, args) },
}
tmp17.RegisterFlags(sub, c)
sub.PersistentFlags().BoolVar(&tmp17.PrettyPrint, "pp", false, "Pretty print response body")
command.AddCommand(sub)
tmp18 := new(DeleteTokenCommand)
sub = &cobra.Command{
Use: `token ["/api/token"]`,
Short: ``,
RunE: func(cmd *cobra.Command, args []string) error { return tmp18.Run(c, args) },
}
tmp18.RegisterFlags(sub, c)
sub.PersistentFlags().BoolVar(&tmp18.PrettyPrint, "pp", false, "Pretty print response body")
command.AddCommand(sub)
app.AddCommand(command)
command = &cobra.Command{
Use: "deprovision",
Short: `deprovision the user`,
}
tmp19 := new(DeprovisionNamedusersCommand)
sub = &cobra.Command{
Use: `namedusers ["/api/namedusers/USERNAME/deprovision"]`,
Short: ``,
RunE: func(cmd *cobra.Command, args []string) error { return tmp19.Run(c, args) },
}
tmp19.RegisterFlags(sub, c)
sub.PersistentFlags().BoolVar(&tmp19.PrettyPrint, "pp", false, "Pretty print response body")
command.AddCommand(sub)
app.AddCommand(command)
command = &cobra.Command{
Use: "exchange",
Short: `Obtain a security token`,
}
tmp20 := new(ExchangeTokenCommand)
sub = &cobra.Command{
Use: `token ["/api/token"]`,
Short: ``,
Long: `
Payload example:
{
"client_id": "Quia quae ut ipsam rerum corporis est.",
"client_secret": "Debitis nemo.",
"code": "Ut itaque.",
"grant_type": "authorization_code",
"redirect_uri": "Voluptate voluptatum nostrum quidem eos quis.",
"refresh_token": "Quam facilis esse fuga corporis quas optio."
}`,
RunE: func(cmd *cobra.Command, args []string) error { return tmp20.Run(c, args) },
}
tmp20.RegisterFlags(sub, c)
sub.PersistentFlags().BoolVar(&tmp20.PrettyPrint, "pp", false, "Pretty print response body")
command.AddCommand(sub)
app.AddCommand(command)
command = &cobra.Command{
Use: "has-scope",
Short: `Checks if the user has the given scope on the requested resource`,
}
tmp21 := new(HasScopeResourceRolesCommand)
sub = &cobra.Command{
Use: `resource-roles ["/api/resources/RESOURCEID/scopes/SCOPENAME"]`,
Short: ``,
RunE: func(cmd *cobra.Command, args []string) error { return tmp21.Run(c, args) },
}
tmp21.RegisterFlags(sub, c)
sub.PersistentFlags().BoolVar(&tmp21.PrettyPrint, "pp", false, "Pretty print response body")
command.AddCommand(sub)
app.AddCommand(command)
command = &cobra.Command{
Use: "keys",
Short: `Returns public keys which should be used to verify tokens`,
}
tmp22 := new(KeysTokenCommand)
sub = &cobra.Command{
Use: `token ["/api/token/keys"]`,
Short: ``,
RunE: func(cmd *cobra.Command, args []string) error { return tmp22.Run(c, args) },
}
tmp22.RegisterFlags(sub, c)
sub.PersistentFlags().BoolVar(&tmp22.PrettyPrint, "pp", false, "Pretty print response body")
command.AddCommand(sub)
app.AddCommand(command)
command = &cobra.Command{
Use: "link",
Short: `Get a redirect location which should be used to initiate account linking between the user account and an external resource provider such as GitHub`,
}
tmp23 := new(LinkTokenCommand)
sub = &cobra.Command{
Use: `token ["/api/token/link"]`,
Short: ``,
RunE: func(cmd *cobra.Command, args []string) error { return tmp23.Run(c, args) },
}
tmp23.RegisterFlags(sub, c)
sub.PersistentFlags().BoolVar(&tmp23.PrettyPrint, "pp", false, "Pretty print response body")
command.AddCommand(sub)
app.AddCommand(command)
command = &cobra.Command{
Use: "link-callback",
Short: `Callback from an external oauth2 resource provider such as GitHub as part of user's account linking`,
}
tmp24 := new(LinkCallbackTokenCommand)
sub = &cobra.Command{
Use: `token ["/api/token/link/callback"]`,
Short: ``,
RunE: func(cmd *cobra.Command, args []string) error { return tmp24.Run(c, args) },
}
tmp24.RegisterFlags(sub, c)
sub.PersistentFlags().BoolVar(&tmp24.PrettyPrint, "pp", false, "Pretty print response body")
command.AddCommand(sub)
app.AddCommand(command)
command = &cobra.Command{
Use: "list",
Short: `list action`,
}
tmp25 := new(ListCollaboratorsCommand)
sub = &cobra.Command{
Use: `collaborators ["/api/spaces/SPACEID/collaborators"]`,
Short: ``,
RunE: func(cmd *cobra.Command, args []string) error { return tmp25.Run(c, args) },
}
tmp25.RegisterFlags(sub, c)
sub.PersistentFlags().BoolVar(&tmp25.PrettyPrint, "pp", false, "Pretty print response body")
command.AddCommand(sub)
tmp26 := new(ListOrganizationCommand)
sub = &cobra.Command{
Use: `organization ["/api/organizations"]`,
Short: ``,
RunE: func(cmd *cobra.Command, args []string) error { return tmp26.Run(c, args) },
}
tmp26.RegisterFlags(sub, c)
sub.PersistentFlags().BoolVar(&tmp26.PrettyPrint, "pp", false, "Pretty print response body")
command.AddCommand(sub)
tmp27 := new(ListRolesCommand)
sub = &cobra.Command{
Use: `roles ["/api/roles"]`,
Short: ``,
RunE: func(cmd *cobra.Command, args []string) error { return tmp27.Run(c, args) },
}
tmp27.RegisterFlags(sub, c)
sub.PersistentFlags().BoolVar(&tmp27.PrettyPrint, "pp", false, "Pretty print response body")
command.AddCommand(sub)
tmp28 := new(ListTeamCommand)
sub = &cobra.Command{
Use: `team ["/api/teams"]`,
Short: ``,
RunE: func(cmd *cobra.Command, args []string) error { return tmp28.Run(c, args) },
}
tmp28.RegisterFlags(sub, c)
sub.PersistentFlags().BoolVar(&tmp28.PrettyPrint, "pp", false, "Pretty print response body")
command.AddCommand(sub)
tmp29 := new(ListUsersCommand)
sub = &cobra.Command{
Use: `users ["/api/users"]`,
Short: ``,
RunE: func(cmd *cobra.Command, args []string) error { return tmp29.Run(c, args) },
}
tmp29.RegisterFlags(sub, c)
sub.PersistentFlags().BoolVar(&tmp29.PrettyPrint, "pp", false, "Pretty print response body")
command.AddCommand(sub)
app.AddCommand(command)
command = &cobra.Command{
Use: "list-assigned",
Short: `List assigned roles by resource`,
}
tmp30 := new(ListAssignedResourceRolesCommand)
sub = &cobra.Command{
Use: `resource-roles ["/api/resources/RESOURCEID/roles"]`,
Short: ``,
RunE: func(cmd *cobra.Command, args []string) error { return tmp30.Run(c, args) },
}
tmp30.RegisterFlags(sub, c)
sub.PersistentFlags().BoolVar(&tmp30.PrettyPrint, "pp", false, "Pretty print response body")
command.AddCommand(sub)
app.AddCommand(command)
command = &cobra.Command{
Use: "list-assigned-by-role-name",
Short: `List assigned roles for a specific role name, for a specific resource`,
}
tmp31 := new(ListAssignedByRoleNameResourceRolesCommand)
sub = &cobra.Command{
Use: `resource-roles ["/api/resources/RESOURCEID/roles/ROLENAME"]`,
Short: ``,
RunE: func(cmd *cobra.Command, args []string) error { return tmp31.Run(c, args) },
}
tmp31.RegisterFlags(sub, c)
sub.PersistentFlags().BoolVar(&tmp31.PrettyPrint, "pp", false, "Pretty print response body")
command.AddCommand(sub)
app.AddCommand(command)
command = &cobra.Command{
Use: "list-resources",
Short: `List resources of a given type with a role for the current user`,
}
tmp32 := new(ListResourcesUserCommand)
sub = &cobra.Command{
Use: `user ["/api/user/resources"]`,
Short: ``,
RunE: func(cmd *cobra.Command, args []string) error { return tmp32.Run(c, args) },
}
tmp32.RegisterFlags(sub, c)
sub.PersistentFlags().BoolVar(&tmp32.PrettyPrint, "pp", false, "Pretty print response body")
command.AddCommand(sub)
app.AddCommand(command)
command = &cobra.Command{
Use: "list-teams",