forked from aws/aws-sdk-go-v2
/
api.go
2309 lines (1886 loc) · 65 KB
/
api.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 private/model/cli/gen-api/main.go. DO NOT EDIT.
package resourcegroups
import (
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
"github.com/aws/aws-sdk-go-v2/private/protocol"
)
const opCreateGroup = "CreateGroup"
// CreateGroupRequest is a API request type for the CreateGroup API operation.
type CreateGroupRequest struct {
*aws.Request
Input *CreateGroupInput
Copy func(*CreateGroupInput) CreateGroupRequest
}
// Send marshals and sends the CreateGroup API request.
func (r CreateGroupRequest) Send() (*CreateGroupOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*CreateGroupOutput), nil
}
// CreateGroupRequest returns a request value for making API operation for
// AWS Resource Groups.
//
// Creates a group with a specified name, description, and resource query.
//
// // Example sending a request using the CreateGroupRequest method.
// req := client.CreateGroupRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/CreateGroup
func (c *ResourceGroups) CreateGroupRequest(input *CreateGroupInput) CreateGroupRequest {
op := &aws.Operation{
Name: opCreateGroup,
HTTPMethod: "POST",
HTTPPath: "/groups",
}
if input == nil {
input = &CreateGroupInput{}
}
output := &CreateGroupOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return CreateGroupRequest{Request: req, Input: input, Copy: c.CreateGroupRequest}
}
const opDeleteGroup = "DeleteGroup"
// DeleteGroupRequest is a API request type for the DeleteGroup API operation.
type DeleteGroupRequest struct {
*aws.Request
Input *DeleteGroupInput
Copy func(*DeleteGroupInput) DeleteGroupRequest
}
// Send marshals and sends the DeleteGroup API request.
func (r DeleteGroupRequest) Send() (*DeleteGroupOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DeleteGroupOutput), nil
}
// DeleteGroupRequest returns a request value for making API operation for
// AWS Resource Groups.
//
// Deletes a specified resource group. Deleting a resource group does not delete
// resources that are members of the group; it only deletes the group structure.
//
// // Example sending a request using the DeleteGroupRequest method.
// req := client.DeleteGroupRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/DeleteGroup
func (c *ResourceGroups) DeleteGroupRequest(input *DeleteGroupInput) DeleteGroupRequest {
op := &aws.Operation{
Name: opDeleteGroup,
HTTPMethod: "DELETE",
HTTPPath: "/groups/{GroupName}",
}
if input == nil {
input = &DeleteGroupInput{}
}
output := &DeleteGroupOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return DeleteGroupRequest{Request: req, Input: input, Copy: c.DeleteGroupRequest}
}
const opGetGroup = "GetGroup"
// GetGroupRequest is a API request type for the GetGroup API operation.
type GetGroupRequest struct {
*aws.Request
Input *GetGroupInput
Copy func(*GetGroupInput) GetGroupRequest
}
// Send marshals and sends the GetGroup API request.
func (r GetGroupRequest) Send() (*GetGroupOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*GetGroupOutput), nil
}
// GetGroupRequest returns a request value for making API operation for
// AWS Resource Groups.
//
// Returns information about a specified resource group.
//
// // Example sending a request using the GetGroupRequest method.
// req := client.GetGroupRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/GetGroup
func (c *ResourceGroups) GetGroupRequest(input *GetGroupInput) GetGroupRequest {
op := &aws.Operation{
Name: opGetGroup,
HTTPMethod: "GET",
HTTPPath: "/groups/{GroupName}",
}
if input == nil {
input = &GetGroupInput{}
}
output := &GetGroupOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return GetGroupRequest{Request: req, Input: input, Copy: c.GetGroupRequest}
}
const opGetGroupQuery = "GetGroupQuery"
// GetGroupQueryRequest is a API request type for the GetGroupQuery API operation.
type GetGroupQueryRequest struct {
*aws.Request
Input *GetGroupQueryInput
Copy func(*GetGroupQueryInput) GetGroupQueryRequest
}
// Send marshals and sends the GetGroupQuery API request.
func (r GetGroupQueryRequest) Send() (*GetGroupQueryOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*GetGroupQueryOutput), nil
}
// GetGroupQueryRequest returns a request value for making API operation for
// AWS Resource Groups.
//
// Returns the resource query associated with the specified resource group.
//
// // Example sending a request using the GetGroupQueryRequest method.
// req := client.GetGroupQueryRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/GetGroupQuery
func (c *ResourceGroups) GetGroupQueryRequest(input *GetGroupQueryInput) GetGroupQueryRequest {
op := &aws.Operation{
Name: opGetGroupQuery,
HTTPMethod: "GET",
HTTPPath: "/groups/{GroupName}/query",
}
if input == nil {
input = &GetGroupQueryInput{}
}
output := &GetGroupQueryOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return GetGroupQueryRequest{Request: req, Input: input, Copy: c.GetGroupQueryRequest}
}
const opGetTags = "GetTags"
// GetTagsRequest is a API request type for the GetTags API operation.
type GetTagsRequest struct {
*aws.Request
Input *GetTagsInput
Copy func(*GetTagsInput) GetTagsRequest
}
// Send marshals and sends the GetTags API request.
func (r GetTagsRequest) Send() (*GetTagsOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*GetTagsOutput), nil
}
// GetTagsRequest returns a request value for making API operation for
// AWS Resource Groups.
//
// Returns a list of tags that are associated with a resource, specified by
// an ARN.
//
// // Example sending a request using the GetTagsRequest method.
// req := client.GetTagsRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/GetTags
func (c *ResourceGroups) GetTagsRequest(input *GetTagsInput) GetTagsRequest {
op := &aws.Operation{
Name: opGetTags,
HTTPMethod: "GET",
HTTPPath: "/resources/{Arn}/tags",
}
if input == nil {
input = &GetTagsInput{}
}
output := &GetTagsOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return GetTagsRequest{Request: req, Input: input, Copy: c.GetTagsRequest}
}
const opListGroupResources = "ListGroupResources"
// ListGroupResourcesRequest is a API request type for the ListGroupResources API operation.
type ListGroupResourcesRequest struct {
*aws.Request
Input *ListGroupResourcesInput
Copy func(*ListGroupResourcesInput) ListGroupResourcesRequest
}
// Send marshals and sends the ListGroupResources API request.
func (r ListGroupResourcesRequest) Send() (*ListGroupResourcesOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*ListGroupResourcesOutput), nil
}
// ListGroupResourcesRequest returns a request value for making API operation for
// AWS Resource Groups.
//
// Returns a list of ARNs of resources that are members of a specified resource
// group.
//
// // Example sending a request using the ListGroupResourcesRequest method.
// req := client.ListGroupResourcesRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/ListGroupResources
func (c *ResourceGroups) ListGroupResourcesRequest(input *ListGroupResourcesInput) ListGroupResourcesRequest {
op := &aws.Operation{
Name: opListGroupResources,
HTTPMethod: "GET",
HTTPPath: "/groups/{GroupName}/resource-identifiers",
Paginator: &aws.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &ListGroupResourcesInput{}
}
output := &ListGroupResourcesOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return ListGroupResourcesRequest{Request: req, Input: input, Copy: c.ListGroupResourcesRequest}
}
// Paginate pages iterates over the pages of a ListGroupResourcesRequest operation,
// calling the Next method for each page. Using the paginators Next
// method will depict whether or not there are more pages.
//
// Note: This operation can generate multiple requests to a service.
//
// // Example iterating over at most 3 pages of a ListGroupResources operation.
// req := client.ListGroupResourcesRequest(input)
// p := req.Paginate()
// for p.Next() {
// page := p.CurrentPage()
// }
//
// if err := p.Err(); err != nil {
// return err
// }
//
func (p *ListGroupResourcesRequest) Paginate(opts ...aws.Option) ListGroupResourcesPager {
return ListGroupResourcesPager{
Pager: aws.Pager{
NewRequest: func() (*aws.Request, error) {
var inCpy *ListGroupResourcesInput
if p.Input != nil {
tmp := *p.Input
inCpy = &tmp
}
req := p.Copy(inCpy)
req.ApplyOptions(opts...)
return req.Request, nil
},
},
}
}
// ListGroupResourcesPager is used to paginate the request. This can be done by
// calling Next and CurrentPage.
type ListGroupResourcesPager struct {
aws.Pager
}
func (p *ListGroupResourcesPager) CurrentPage() *ListGroupResourcesOutput {
return p.Pager.CurrentPage().(*ListGroupResourcesOutput)
}
const opListGroups = "ListGroups"
// ListGroupsRequest is a API request type for the ListGroups API operation.
type ListGroupsRequest struct {
*aws.Request
Input *ListGroupsInput
Copy func(*ListGroupsInput) ListGroupsRequest
}
// Send marshals and sends the ListGroups API request.
func (r ListGroupsRequest) Send() (*ListGroupsOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*ListGroupsOutput), nil
}
// ListGroupsRequest returns a request value for making API operation for
// AWS Resource Groups.
//
// Returns a list of existing resource groups in your account.
//
// // Example sending a request using the ListGroupsRequest method.
// req := client.ListGroupsRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/ListGroups
func (c *ResourceGroups) ListGroupsRequest(input *ListGroupsInput) ListGroupsRequest {
op := &aws.Operation{
Name: opListGroups,
HTTPMethod: "GET",
HTTPPath: "/groups",
Paginator: &aws.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &ListGroupsInput{}
}
output := &ListGroupsOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return ListGroupsRequest{Request: req, Input: input, Copy: c.ListGroupsRequest}
}
// Paginate pages iterates over the pages of a ListGroupsRequest operation,
// calling the Next method for each page. Using the paginators Next
// method will depict whether or not there are more pages.
//
// Note: This operation can generate multiple requests to a service.
//
// // Example iterating over at most 3 pages of a ListGroups operation.
// req := client.ListGroupsRequest(input)
// p := req.Paginate()
// for p.Next() {
// page := p.CurrentPage()
// }
//
// if err := p.Err(); err != nil {
// return err
// }
//
func (p *ListGroupsRequest) Paginate(opts ...aws.Option) ListGroupsPager {
return ListGroupsPager{
Pager: aws.Pager{
NewRequest: func() (*aws.Request, error) {
var inCpy *ListGroupsInput
if p.Input != nil {
tmp := *p.Input
inCpy = &tmp
}
req := p.Copy(inCpy)
req.ApplyOptions(opts...)
return req.Request, nil
},
},
}
}
// ListGroupsPager is used to paginate the request. This can be done by
// calling Next and CurrentPage.
type ListGroupsPager struct {
aws.Pager
}
func (p *ListGroupsPager) CurrentPage() *ListGroupsOutput {
return p.Pager.CurrentPage().(*ListGroupsOutput)
}
const opSearchResources = "SearchResources"
// SearchResourcesRequest is a API request type for the SearchResources API operation.
type SearchResourcesRequest struct {
*aws.Request
Input *SearchResourcesInput
Copy func(*SearchResourcesInput) SearchResourcesRequest
}
// Send marshals and sends the SearchResources API request.
func (r SearchResourcesRequest) Send() (*SearchResourcesOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*SearchResourcesOutput), nil
}
// SearchResourcesRequest returns a request value for making API operation for
// AWS Resource Groups.
//
// Returns a list of AWS resource identifiers that matches a specified query.
// The query uses the same format as a resource query in a CreateGroup or UpdateGroupQuery
// operation.
//
// // Example sending a request using the SearchResourcesRequest method.
// req := client.SearchResourcesRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/SearchResources
func (c *ResourceGroups) SearchResourcesRequest(input *SearchResourcesInput) SearchResourcesRequest {
op := &aws.Operation{
Name: opSearchResources,
HTTPMethod: "POST",
HTTPPath: "/resources/search",
Paginator: &aws.Paginator{
InputTokens: []string{"NextToken"},
OutputTokens: []string{"NextToken"},
LimitToken: "MaxResults",
TruncationToken: "",
},
}
if input == nil {
input = &SearchResourcesInput{}
}
output := &SearchResourcesOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return SearchResourcesRequest{Request: req, Input: input, Copy: c.SearchResourcesRequest}
}
// Paginate pages iterates over the pages of a SearchResourcesRequest operation,
// calling the Next method for each page. Using the paginators Next
// method will depict whether or not there are more pages.
//
// Note: This operation can generate multiple requests to a service.
//
// // Example iterating over at most 3 pages of a SearchResources operation.
// req := client.SearchResourcesRequest(input)
// p := req.Paginate()
// for p.Next() {
// page := p.CurrentPage()
// }
//
// if err := p.Err(); err != nil {
// return err
// }
//
func (p *SearchResourcesRequest) Paginate(opts ...aws.Option) SearchResourcesPager {
return SearchResourcesPager{
Pager: aws.Pager{
NewRequest: func() (*aws.Request, error) {
var inCpy *SearchResourcesInput
if p.Input != nil {
tmp := *p.Input
inCpy = &tmp
}
req := p.Copy(inCpy)
req.ApplyOptions(opts...)
return req.Request, nil
},
},
}
}
// SearchResourcesPager is used to paginate the request. This can be done by
// calling Next and CurrentPage.
type SearchResourcesPager struct {
aws.Pager
}
func (p *SearchResourcesPager) CurrentPage() *SearchResourcesOutput {
return p.Pager.CurrentPage().(*SearchResourcesOutput)
}
const opTag = "Tag"
// TagRequest is a API request type for the Tag API operation.
type TagRequest struct {
*aws.Request
Input *TagInput
Copy func(*TagInput) TagRequest
}
// Send marshals and sends the Tag API request.
func (r TagRequest) Send() (*TagOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*TagOutput), nil
}
// TagRequest returns a request value for making API operation for
// AWS Resource Groups.
//
// Adds specified tags to a resource with the specified ARN. Existing tags on
// a resource are not changed if they are not specified in the request parameters.
//
// // Example sending a request using the TagRequest method.
// req := client.TagRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/Tag
func (c *ResourceGroups) TagRequest(input *TagInput) TagRequest {
op := &aws.Operation{
Name: opTag,
HTTPMethod: "PUT",
HTTPPath: "/resources/{Arn}/tags",
}
if input == nil {
input = &TagInput{}
}
output := &TagOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return TagRequest{Request: req, Input: input, Copy: c.TagRequest}
}
const opUntag = "Untag"
// UntagRequest is a API request type for the Untag API operation.
type UntagRequest struct {
*aws.Request
Input *UntagInput
Copy func(*UntagInput) UntagRequest
}
// Send marshals and sends the Untag API request.
func (r UntagRequest) Send() (*UntagOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*UntagOutput), nil
}
// UntagRequest returns a request value for making API operation for
// AWS Resource Groups.
//
// Deletes specified tags from a specified resource.
//
// // Example sending a request using the UntagRequest method.
// req := client.UntagRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/Untag
func (c *ResourceGroups) UntagRequest(input *UntagInput) UntagRequest {
op := &aws.Operation{
Name: opUntag,
HTTPMethod: "PATCH",
HTTPPath: "/resources/{Arn}/tags",
}
if input == nil {
input = &UntagInput{}
}
output := &UntagOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return UntagRequest{Request: req, Input: input, Copy: c.UntagRequest}
}
const opUpdateGroup = "UpdateGroup"
// UpdateGroupRequest is a API request type for the UpdateGroup API operation.
type UpdateGroupRequest struct {
*aws.Request
Input *UpdateGroupInput
Copy func(*UpdateGroupInput) UpdateGroupRequest
}
// Send marshals and sends the UpdateGroup API request.
func (r UpdateGroupRequest) Send() (*UpdateGroupOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*UpdateGroupOutput), nil
}
// UpdateGroupRequest returns a request value for making API operation for
// AWS Resource Groups.
//
// Updates an existing group with a new or changed description. You cannot update
// the name of a resource group.
//
// // Example sending a request using the UpdateGroupRequest method.
// req := client.UpdateGroupRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/UpdateGroup
func (c *ResourceGroups) UpdateGroupRequest(input *UpdateGroupInput) UpdateGroupRequest {
op := &aws.Operation{
Name: opUpdateGroup,
HTTPMethod: "PUT",
HTTPPath: "/groups/{GroupName}",
}
if input == nil {
input = &UpdateGroupInput{}
}
output := &UpdateGroupOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return UpdateGroupRequest{Request: req, Input: input, Copy: c.UpdateGroupRequest}
}
const opUpdateGroupQuery = "UpdateGroupQuery"
// UpdateGroupQueryRequest is a API request type for the UpdateGroupQuery API operation.
type UpdateGroupQueryRequest struct {
*aws.Request
Input *UpdateGroupQueryInput
Copy func(*UpdateGroupQueryInput) UpdateGroupQueryRequest
}
// Send marshals and sends the UpdateGroupQuery API request.
func (r UpdateGroupQueryRequest) Send() (*UpdateGroupQueryOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*UpdateGroupQueryOutput), nil
}
// UpdateGroupQueryRequest returns a request value for making API operation for
// AWS Resource Groups.
//
// Updates the resource query of a group.
//
// // Example sending a request using the UpdateGroupQueryRequest method.
// req := client.UpdateGroupQueryRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/UpdateGroupQuery
func (c *ResourceGroups) UpdateGroupQueryRequest(input *UpdateGroupQueryInput) UpdateGroupQueryRequest {
op := &aws.Operation{
Name: opUpdateGroupQuery,
HTTPMethod: "PUT",
HTTPPath: "/groups/{GroupName}/query",
}
if input == nil {
input = &UpdateGroupQueryInput{}
}
output := &UpdateGroupQueryOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return UpdateGroupQueryRequest{Request: req, Input: input, Copy: c.UpdateGroupQueryRequest}
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/CreateGroupInput
type CreateGroupInput struct {
_ struct{} `type:"structure"`
// The description of the resource group. Descriptions can have a maximum of
// 511 characters, including letters, numbers, hyphens, underscores, punctuation,
// and spaces.
Description *string `type:"string"`
// The name of the group, which is the identifier of the group in other operations.
// A resource group name cannot be updated after it is created. A resource group
// name can have a maximum of 127 characters, including letters, numbers, hyphens,
// dots, and underscores. The name cannot start with AWS or aws; these are reserved.
// A resource group name must be unique within your account.
//
// Name is a required field
Name *string `min:"1" type:"string" required:"true"`
// The resource query that determines which AWS resources are members of this
// group.
//
// ResourceQuery is a required field
ResourceQuery *ResourceQuery `type:"structure" required:"true"`
// The tags to add to the group. A tag is a string-to-string map of key-value
// pairs. Tag keys can have a maximum character length of 127 characters, and
// tag values can have a maximum length of 255 characters.
Tags map[string]string `type:"map"`
}
// String returns the string representation
func (s CreateGroupInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s CreateGroupInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *CreateGroupInput) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "CreateGroupInput"}
if s.Name == nil {
invalidParams.Add(aws.NewErrParamRequired("Name"))
}
if s.Name != nil && len(*s.Name) < 1 {
invalidParams.Add(aws.NewErrParamMinLen("Name", 1))
}
if s.ResourceQuery == nil {
invalidParams.Add(aws.NewErrParamRequired("ResourceQuery"))
}
if s.ResourceQuery != nil {
if err := s.ResourceQuery.Validate(); err != nil {
invalidParams.AddNested("ResourceQuery", err.(aws.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s CreateGroupInput) MarshalFields(e protocol.FieldEncoder) error {
if s.Description != nil {
v := *s.Description
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "Description", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if s.Name != nil {
v := *s.Name
metadata := protocol.Metadata{}
e.SetValue(protocol.BodyTarget, "Name", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
if s.ResourceQuery != nil {
v := s.ResourceQuery
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "ResourceQuery", v, metadata)
}
if len(s.Tags) > 0 {
v := s.Tags
metadata := protocol.Metadata{}
ms0 := e.Map(protocol.BodyTarget, "Tags", metadata)
ms0.Start()
for k1, v1 := range v {
ms0.MapSetValue(k1, protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})
}
ms0.End()
}
return nil
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/CreateGroupOutput
type CreateGroupOutput struct {
_ struct{} `type:"structure"`
responseMetadata aws.Response
// A full description of the resource group after it is created.
Group *Group `type:"structure"`
// The resource query associated with the group.
ResourceQuery *ResourceQuery `type:"structure"`
// The tags associated with the group.
Tags map[string]string `type:"map"`
}
// String returns the string representation
func (s CreateGroupOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s CreateGroupOutput) GoString() string {
return s.String()
}
// SDKResponseMetdata return sthe response metadata for the API.
func (s CreateGroupOutput) SDKResponseMetadata() aws.Response {
return s.responseMetadata
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s CreateGroupOutput) MarshalFields(e protocol.FieldEncoder) error {
if s.Group != nil {
v := s.Group
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "Group", v, metadata)
}
if s.ResourceQuery != nil {
v := s.ResourceQuery
metadata := protocol.Metadata{}
e.SetFields(protocol.BodyTarget, "ResourceQuery", v, metadata)
}
if len(s.Tags) > 0 {
v := s.Tags
metadata := protocol.Metadata{}
ms0 := e.Map(protocol.BodyTarget, "Tags", metadata)
ms0.Start()
for k1, v1 := range v {
ms0.MapSetValue(k1, protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v1)})
}
ms0.End()
}
return nil
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/DeleteGroupInput
type DeleteGroupInput struct {
_ struct{} `type:"structure"`
// The name of the resource group to delete.
//
// GroupName is a required field
GroupName *string `location:"uri" locationName:"GroupName" min:"1" type:"string" required:"true"`
}
// String returns the string representation
func (s DeleteGroupInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DeleteGroupInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DeleteGroupInput) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "DeleteGroupInput"}
if s.GroupName == nil {
invalidParams.Add(aws.NewErrParamRequired("GroupName"))
}
if s.GroupName != nil && len(*s.GroupName) < 1 {
invalidParams.Add(aws.NewErrParamMinLen("GroupName", 1))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// MarshalFields encodes the AWS API shape using the passed in protocol encoder.
func (s DeleteGroupInput) MarshalFields(e protocol.FieldEncoder) error {
if s.GroupName != nil {
v := *s.GroupName
metadata := protocol.Metadata{}
e.SetValue(protocol.PathTarget, "GroupName", protocol.QuotedValue{ValueMarshaler: protocol.StringValue(v)}, metadata)
}
return nil
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/DeleteGroupOutput
type DeleteGroupOutput struct {
_ struct{} `type:"structure"`
responseMetadata aws.Response
// A full description of the deleted resource group.
Group *Group `type:"structure"`
}
// String returns the string representation
func (s DeleteGroupOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation