forked from aws/aws-sdk-go-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.go
7562 lines (6394 loc) · 265 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 organizations
import (
"time"
"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"
"github.com/aws/aws-sdk-go-v2/private/protocol/jsonrpc"
)
const opAcceptHandshake = "AcceptHandshake"
// AcceptHandshakeRequest is a API request type for the AcceptHandshake API operation.
type AcceptHandshakeRequest struct {
*aws.Request
Input *AcceptHandshakeInput
Copy func(*AcceptHandshakeInput) AcceptHandshakeRequest
}
// Send marshals and sends the AcceptHandshake API request.
func (r AcceptHandshakeRequest) Send() (*AcceptHandshakeOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*AcceptHandshakeOutput), nil
}
// AcceptHandshakeRequest returns a request value for making API operation for
// AWS Organizations.
//
// Sends a response to the originator of a handshake agreeing to the action
// proposed by the handshake request.
//
// This operation can be called only by the following principals when they also
// have the relevant IAM permissions:
//
// * Invitation to join or Approve all features request handshakes: only
// a principal from the member account.
//
// The user who calls the API for an invitation to join must have the organizations:AcceptHandshake
// permission. If you enabled all features in the organization, then the
// user must also have the iam:CreateServiceLinkedRole permission so that
// Organizations can create the required service-linked role named OrgsServiceLinkedRoleName.
// For more information, see AWS Organizations and Service-Linked Roles (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_integration_services.html#orgs_integration_service-linked-roles)
// in the AWS Organizations User Guide.
//
// * Enable all features final confirmation handshake: only a principal from
// the master account.
//
// For more information about invitations, see Inviting an AWS Account to Join
// Your Organization (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_invites.html)
// in the AWS Organizations User Guide. For more information about requests
// to enable all features in the organization, see Enabling All Features
// in Your Organization (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html)
// in the AWS Organizations User Guide.
//
// After you accept a handshake, it continues to appear in the results of relevant
// APIs for only 30 days. After that it is deleted.
//
// // Example sending a request using the AcceptHandshakeRequest method.
// req := client.AcceptHandshakeRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/AcceptHandshake
func (c *Organizations) AcceptHandshakeRequest(input *AcceptHandshakeInput) AcceptHandshakeRequest {
op := &aws.Operation{
Name: opAcceptHandshake,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &AcceptHandshakeInput{}
}
output := &AcceptHandshakeOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return AcceptHandshakeRequest{Request: req, Input: input, Copy: c.AcceptHandshakeRequest}
}
const opAttachPolicy = "AttachPolicy"
// AttachPolicyRequest is a API request type for the AttachPolicy API operation.
type AttachPolicyRequest struct {
*aws.Request
Input *AttachPolicyInput
Copy func(*AttachPolicyInput) AttachPolicyRequest
}
// Send marshals and sends the AttachPolicy API request.
func (r AttachPolicyRequest) Send() (*AttachPolicyOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*AttachPolicyOutput), nil
}
// AttachPolicyRequest returns a request value for making API operation for
// AWS Organizations.
//
// Attaches a policy to a root, an organizational unit (OU), or an individual
// account. How the policy affects accounts depends on the type of policy:
//
// * Service control policy (SCP) - An SCP specifies what permissions can
// be delegated to users in affected member accounts. The scope of influence
// for a policy depends on what you attach the policy to:
//
// If you attach an SCP to a root, it affects all accounts in the organization.
//
// If you attach an SCP to an OU, it affects all accounts in that OU and in
// any child OUs.
//
// If you attach the policy directly to an account, then it affects only that
// account.
//
// SCPs essentially are permission "filters". When you attach one SCP to a higher
// level root or OU, and you also attach a different SCP to a child OU or
// to an account, the child policy can further restrict only the permissions
// that pass through the parent filter and are available to the child. An
// SCP that is attached to a child cannot grant a permission that is not
// already granted by the parent. For example, imagine that the parent SCP
// allows permissions A, B, C, D, and E. The child SCP allows C, D, E, F,
// and G. The result is that the accounts affected by the child SCP are allowed
// to use only C, D, and E. They cannot use A or B because they were filtered
// out by the child OU. They also cannot use F and G because they were filtered
// out by the parent OU. They cannot be granted back by the child SCP; child
// SCPs can only filter the permissions they receive from the parent SCP.
//
// AWS Organizations attaches a default SCP named "FullAWSAccess to every root,
// OU, and account. This default SCP allows all services and actions, enabling
// any new child OU or account to inherit the permissions of the parent root
// or OU. If you detach the default policy, you must replace it with a policy
// that specifies the permissions that you want to allow in that OU or account.
//
// For more information about how Organizations policies permissions work, see
// Using Service Control Policies (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scp.html)
// in the AWS Organizations User Guide.
//
// This operation can be called only from the organization's master account.
//
// // Example sending a request using the AttachPolicyRequest method.
// req := client.AttachPolicyRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/AttachPolicy
func (c *Organizations) AttachPolicyRequest(input *AttachPolicyInput) AttachPolicyRequest {
op := &aws.Operation{
Name: opAttachPolicy,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &AttachPolicyInput{}
}
output := &AttachPolicyOutput{}
req := c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
output.responseMetadata = aws.Response{Request: req}
return AttachPolicyRequest{Request: req, Input: input, Copy: c.AttachPolicyRequest}
}
const opCancelHandshake = "CancelHandshake"
// CancelHandshakeRequest is a API request type for the CancelHandshake API operation.
type CancelHandshakeRequest struct {
*aws.Request
Input *CancelHandshakeInput
Copy func(*CancelHandshakeInput) CancelHandshakeRequest
}
// Send marshals and sends the CancelHandshake API request.
func (r CancelHandshakeRequest) Send() (*CancelHandshakeOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*CancelHandshakeOutput), nil
}
// CancelHandshakeRequest returns a request value for making API operation for
// AWS Organizations.
//
// Cancels a handshake. Canceling a handshake sets the handshake state to CANCELED.
//
// This operation can be called only from the account that originated the handshake.
// The recipient of the handshake can't cancel it, but can use DeclineHandshake
// instead. After a handshake is canceled, the recipient can no longer respond
// to that handshake.
//
// After you cancel a handshake, it continues to appear in the results of relevant
// APIs for only 30 days. After that it is deleted.
//
// // Example sending a request using the CancelHandshakeRequest method.
// req := client.CancelHandshakeRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/CancelHandshake
func (c *Organizations) CancelHandshakeRequest(input *CancelHandshakeInput) CancelHandshakeRequest {
op := &aws.Operation{
Name: opCancelHandshake,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CancelHandshakeInput{}
}
output := &CancelHandshakeOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return CancelHandshakeRequest{Request: req, Input: input, Copy: c.CancelHandshakeRequest}
}
const opCreateAccount = "CreateAccount"
// CreateAccountRequest is a API request type for the CreateAccount API operation.
type CreateAccountRequest struct {
*aws.Request
Input *CreateAccountInput
Copy func(*CreateAccountInput) CreateAccountRequest
}
// Send marshals and sends the CreateAccount API request.
func (r CreateAccountRequest) Send() (*CreateAccountOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*CreateAccountOutput), nil
}
// CreateAccountRequest returns a request value for making API operation for
// AWS Organizations.
//
// Creates an AWS account that is automatically a member of the organization
// whose credentials made the request. This is an asynchronous request that
// AWS performs in the background. If you want to check the status of the request
// later, you need the OperationId response element from this operation to provide
// as a parameter to the DescribeCreateAccountStatus operation.
//
// The user who calls the API for an invitation to join must have the organizations:CreateAccount
// permission. If you enabled all features in the organization, then the user
// must also have the iam:CreateServiceLinkedRole permission so that Organizations
// can create the required service-linked role named OrgsServiceLinkedRoleName.
// For more information, see AWS Organizations and Service-Linked Roles (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_integration_services.html#orgs_integration_service-linked-roles)
// in the AWS Organizations User Guide.
//
// The user in the master account who calls this API must also have the iam:CreateRole
// permission because AWS Organizations preconfigures the new member account
// with a role (named OrganizationAccountAccessRole by default) that grants
// users in the master account administrator permissions in the new member account.
// Principals in the master account can assume the role. AWS Organizations clones
// the company name and address information for the new account from the organization's
// master account.
//
// This operation can be called only from the organization's master account.
//
// For more information about creating accounts, see Creating an AWS Account
// in Your Organization (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_create.html)
// in the AWS Organizations User Guide.
//
// When you create an account in an organization using the AWS Organizations
// console, API, or CLI commands, the information required for the account to
// operate as a standalone account, such as a payment method and signing the
// End User Licence Agreement (EULA) is not automatically collected. If you
// must remove an account from your organization later, you can do so only after
// you provide the missing information. Follow the steps at To leave an organization
// when all required account information has not yet been provided (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info)
// in the AWS Organizations User Guide.
//
// If you get an exception that indicates that you exceeded your account limits
// for the organization or that the operation failed because your organization
// is still initializing, wait one hour and then try again. If the error persists
// after an hour, then contact AWS Customer Support (https://console.aws.amazon.com/support/home#/).
//
// Because CreateAccount operates asynchronously, it can return a successful
// completion message even though account initialization might still be in progress.
// You might need to wait a few minutes before you can successfully access the
// account.
//
// When you create a member account with this operation, you can choose whether
// to create the account with the IAM User and Role Access to Billing Information
// switch enabled. If you enable it, IAM users and roles that have appropriate
// permissions can view billing information for the account. If you disable
// this, then only the account root user can access billing information. For
// information about how to disable this for an account, see Granting Access
// to Your Billing Information and Tools (http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/grantaccess.html).
//
// // Example sending a request using the CreateAccountRequest method.
// req := client.CreateAccountRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/CreateAccount
func (c *Organizations) CreateAccountRequest(input *CreateAccountInput) CreateAccountRequest {
op := &aws.Operation{
Name: opCreateAccount,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateAccountInput{}
}
output := &CreateAccountOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return CreateAccountRequest{Request: req, Input: input, Copy: c.CreateAccountRequest}
}
const opCreateOrganization = "CreateOrganization"
// CreateOrganizationRequest is a API request type for the CreateOrganization API operation.
type CreateOrganizationRequest struct {
*aws.Request
Input *CreateOrganizationInput
Copy func(*CreateOrganizationInput) CreateOrganizationRequest
}
// Send marshals and sends the CreateOrganization API request.
func (r CreateOrganizationRequest) Send() (*CreateOrganizationOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*CreateOrganizationOutput), nil
}
// CreateOrganizationRequest returns a request value for making API operation for
// AWS Organizations.
//
// Creates an AWS organization. The account whose user is calling the CreateOrganization
// operation automatically becomes the master account (http://docs.aws.amazon.com/IAM/latest/UserGuide/orgs_getting-started_concepts.html#account)
// of the new organization.
//
// This operation must be called using credentials from the account that is
// to become the new organization's master account. The principal must also
// have the relevant IAM permissions.
//
// By default (or if you set the FeatureSet parameter to ALL), the new organization
// is created with all features enabled and service control policies automatically
// enabled in the root. If you instead choose to create the organization supporting
// only the consolidated billing features by setting the FeatureSet parameter
// to CONSOLIDATED_BILLING", then no policy types are enabled by default and
// you cannot use organization policies.
//
// // Example sending a request using the CreateOrganizationRequest method.
// req := client.CreateOrganizationRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/CreateOrganization
func (c *Organizations) CreateOrganizationRequest(input *CreateOrganizationInput) CreateOrganizationRequest {
op := &aws.Operation{
Name: opCreateOrganization,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateOrganizationInput{}
}
output := &CreateOrganizationOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return CreateOrganizationRequest{Request: req, Input: input, Copy: c.CreateOrganizationRequest}
}
const opCreateOrganizationalUnit = "CreateOrganizationalUnit"
// CreateOrganizationalUnitRequest is a API request type for the CreateOrganizationalUnit API operation.
type CreateOrganizationalUnitRequest struct {
*aws.Request
Input *CreateOrganizationalUnitInput
Copy func(*CreateOrganizationalUnitInput) CreateOrganizationalUnitRequest
}
// Send marshals and sends the CreateOrganizationalUnit API request.
func (r CreateOrganizationalUnitRequest) Send() (*CreateOrganizationalUnitOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*CreateOrganizationalUnitOutput), nil
}
// CreateOrganizationalUnitRequest returns a request value for making API operation for
// AWS Organizations.
//
// Creates an organizational unit (OU) within a root or parent OU. An OU is
// a container for accounts that enables you to organize your accounts to apply
// policies according to your business requirements. The number of levels deep
// that you can nest OUs is dependent upon the policy types enabled for that
// root. For service control policies, the limit is five.
//
// For more information about OUs, see Managing Organizational Units (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_ous.html)
// in the AWS Organizations User Guide.
//
// This operation can be called only from the organization's master account.
//
// // Example sending a request using the CreateOrganizationalUnitRequest method.
// req := client.CreateOrganizationalUnitRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/CreateOrganizationalUnit
func (c *Organizations) CreateOrganizationalUnitRequest(input *CreateOrganizationalUnitInput) CreateOrganizationalUnitRequest {
op := &aws.Operation{
Name: opCreateOrganizationalUnit,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateOrganizationalUnitInput{}
}
output := &CreateOrganizationalUnitOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return CreateOrganizationalUnitRequest{Request: req, Input: input, Copy: c.CreateOrganizationalUnitRequest}
}
const opCreatePolicy = "CreatePolicy"
// CreatePolicyRequest is a API request type for the CreatePolicy API operation.
type CreatePolicyRequest struct {
*aws.Request
Input *CreatePolicyInput
Copy func(*CreatePolicyInput) CreatePolicyRequest
}
// Send marshals and sends the CreatePolicy API request.
func (r CreatePolicyRequest) Send() (*CreatePolicyOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*CreatePolicyOutput), nil
}
// CreatePolicyRequest returns a request value for making API operation for
// AWS Organizations.
//
// Creates a policy of a specified type that you can attach to a root, an organizational
// unit (OU), or an individual AWS account.
//
// For more information about policies and their use, see Managing Organization
// Policies (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies.html).
//
// This operation can be called only from the organization's master account.
//
// // Example sending a request using the CreatePolicyRequest method.
// req := client.CreatePolicyRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/CreatePolicy
func (c *Organizations) CreatePolicyRequest(input *CreatePolicyInput) CreatePolicyRequest {
op := &aws.Operation{
Name: opCreatePolicy,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreatePolicyInput{}
}
output := &CreatePolicyOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return CreatePolicyRequest{Request: req, Input: input, Copy: c.CreatePolicyRequest}
}
const opDeclineHandshake = "DeclineHandshake"
// DeclineHandshakeRequest is a API request type for the DeclineHandshake API operation.
type DeclineHandshakeRequest struct {
*aws.Request
Input *DeclineHandshakeInput
Copy func(*DeclineHandshakeInput) DeclineHandshakeRequest
}
// Send marshals and sends the DeclineHandshake API request.
func (r DeclineHandshakeRequest) Send() (*DeclineHandshakeOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DeclineHandshakeOutput), nil
}
// DeclineHandshakeRequest returns a request value for making API operation for
// AWS Organizations.
//
// Declines a handshake request. This sets the handshake state to DECLINED and
// effectively deactivates the request.
//
// This operation can be called only from the account that received the handshake.
// The originator of the handshake can use CancelHandshake instead. The originator
// can't reactivate a declined request, but can re-initiate the process with
// a new handshake request.
//
// After you decline a handshake, it continues to appear in the results of relevant
// APIs for only 30 days. After that it is deleted.
//
// // Example sending a request using the DeclineHandshakeRequest method.
// req := client.DeclineHandshakeRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DeclineHandshake
func (c *Organizations) DeclineHandshakeRequest(input *DeclineHandshakeInput) DeclineHandshakeRequest {
op := &aws.Operation{
Name: opDeclineHandshake,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeclineHandshakeInput{}
}
output := &DeclineHandshakeOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return DeclineHandshakeRequest{Request: req, Input: input, Copy: c.DeclineHandshakeRequest}
}
const opDeleteOrganization = "DeleteOrganization"
// DeleteOrganizationRequest is a API request type for the DeleteOrganization API operation.
type DeleteOrganizationRequest struct {
*aws.Request
Input *DeleteOrganizationInput
Copy func(*DeleteOrganizationInput) DeleteOrganizationRequest
}
// Send marshals and sends the DeleteOrganization API request.
func (r DeleteOrganizationRequest) Send() (*DeleteOrganizationOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DeleteOrganizationOutput), nil
}
// DeleteOrganizationRequest returns a request value for making API operation for
// AWS Organizations.
//
// Deletes the organization. You can delete an organization only by using credentials
// from the master account. The organization must be empty of member accounts,
// organizational units (OUs), and policies.
//
// // Example sending a request using the DeleteOrganizationRequest method.
// req := client.DeleteOrganizationRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DeleteOrganization
func (c *Organizations) DeleteOrganizationRequest(input *DeleteOrganizationInput) DeleteOrganizationRequest {
op := &aws.Operation{
Name: opDeleteOrganization,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteOrganizationInput{}
}
output := &DeleteOrganizationOutput{}
req := c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
output.responseMetadata = aws.Response{Request: req}
return DeleteOrganizationRequest{Request: req, Input: input, Copy: c.DeleteOrganizationRequest}
}
const opDeleteOrganizationalUnit = "DeleteOrganizationalUnit"
// DeleteOrganizationalUnitRequest is a API request type for the DeleteOrganizationalUnit API operation.
type DeleteOrganizationalUnitRequest struct {
*aws.Request
Input *DeleteOrganizationalUnitInput
Copy func(*DeleteOrganizationalUnitInput) DeleteOrganizationalUnitRequest
}
// Send marshals and sends the DeleteOrganizationalUnit API request.
func (r DeleteOrganizationalUnitRequest) Send() (*DeleteOrganizationalUnitOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DeleteOrganizationalUnitOutput), nil
}
// DeleteOrganizationalUnitRequest returns a request value for making API operation for
// AWS Organizations.
//
// Deletes an organizational unit (OU) from a root or another OU. You must first
// remove all accounts and child OUs from the OU that you want to delete.
//
// This operation can be called only from the organization's master account.
//
// // Example sending a request using the DeleteOrganizationalUnitRequest method.
// req := client.DeleteOrganizationalUnitRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DeleteOrganizationalUnit
func (c *Organizations) DeleteOrganizationalUnitRequest(input *DeleteOrganizationalUnitInput) DeleteOrganizationalUnitRequest {
op := &aws.Operation{
Name: opDeleteOrganizationalUnit,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeleteOrganizationalUnitInput{}
}
output := &DeleteOrganizationalUnitOutput{}
req := c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
output.responseMetadata = aws.Response{Request: req}
return DeleteOrganizationalUnitRequest{Request: req, Input: input, Copy: c.DeleteOrganizationalUnitRequest}
}
const opDeletePolicy = "DeletePolicy"
// DeletePolicyRequest is a API request type for the DeletePolicy API operation.
type DeletePolicyRequest struct {
*aws.Request
Input *DeletePolicyInput
Copy func(*DeletePolicyInput) DeletePolicyRequest
}
// Send marshals and sends the DeletePolicy API request.
func (r DeletePolicyRequest) Send() (*DeletePolicyOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DeletePolicyOutput), nil
}
// DeletePolicyRequest returns a request value for making API operation for
// AWS Organizations.
//
// Deletes the specified policy from your organization. Before you perform this
// operation, you must first detach the policy from all organizational units
// (OUs), roots, and accounts.
//
// This operation can be called only from the organization's master account.
//
// // Example sending a request using the DeletePolicyRequest method.
// req := client.DeletePolicyRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DeletePolicy
func (c *Organizations) DeletePolicyRequest(input *DeletePolicyInput) DeletePolicyRequest {
op := &aws.Operation{
Name: opDeletePolicy,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeletePolicyInput{}
}
output := &DeletePolicyOutput{}
req := c.newRequest(op, input, output)
req.Handlers.Unmarshal.Remove(jsonrpc.UnmarshalHandler)
req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler)
output.responseMetadata = aws.Response{Request: req}
return DeletePolicyRequest{Request: req, Input: input, Copy: c.DeletePolicyRequest}
}
const opDescribeAccount = "DescribeAccount"
// DescribeAccountRequest is a API request type for the DescribeAccount API operation.
type DescribeAccountRequest struct {
*aws.Request
Input *DescribeAccountInput
Copy func(*DescribeAccountInput) DescribeAccountRequest
}
// Send marshals and sends the DescribeAccount API request.
func (r DescribeAccountRequest) Send() (*DescribeAccountOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DescribeAccountOutput), nil
}
// DescribeAccountRequest returns a request value for making API operation for
// AWS Organizations.
//
// Retrieves Organizations-related information about the specified account.
//
// This operation can be called only from the organization's master account.
//
// // Example sending a request using the DescribeAccountRequest method.
// req := client.DescribeAccountRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DescribeAccount
func (c *Organizations) DescribeAccountRequest(input *DescribeAccountInput) DescribeAccountRequest {
op := &aws.Operation{
Name: opDescribeAccount,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DescribeAccountInput{}
}
output := &DescribeAccountOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return DescribeAccountRequest{Request: req, Input: input, Copy: c.DescribeAccountRequest}
}
const opDescribeCreateAccountStatus = "DescribeCreateAccountStatus"
// DescribeCreateAccountStatusRequest is a API request type for the DescribeCreateAccountStatus API operation.
type DescribeCreateAccountStatusRequest struct {
*aws.Request
Input *DescribeCreateAccountStatusInput
Copy func(*DescribeCreateAccountStatusInput) DescribeCreateAccountStatusRequest
}
// Send marshals and sends the DescribeCreateAccountStatus API request.
func (r DescribeCreateAccountStatusRequest) Send() (*DescribeCreateAccountStatusOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DescribeCreateAccountStatusOutput), nil
}
// DescribeCreateAccountStatusRequest returns a request value for making API operation for
// AWS Organizations.
//
// Retrieves the current status of an asynchronous request to create an account.
//
// This operation can be called only from the organization's master account.
//
// // Example sending a request using the DescribeCreateAccountStatusRequest method.
// req := client.DescribeCreateAccountStatusRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DescribeCreateAccountStatus
func (c *Organizations) DescribeCreateAccountStatusRequest(input *DescribeCreateAccountStatusInput) DescribeCreateAccountStatusRequest {
op := &aws.Operation{
Name: opDescribeCreateAccountStatus,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DescribeCreateAccountStatusInput{}
}
output := &DescribeCreateAccountStatusOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return DescribeCreateAccountStatusRequest{Request: req, Input: input, Copy: c.DescribeCreateAccountStatusRequest}
}
const opDescribeHandshake = "DescribeHandshake"
// DescribeHandshakeRequest is a API request type for the DescribeHandshake API operation.
type DescribeHandshakeRequest struct {
*aws.Request
Input *DescribeHandshakeInput
Copy func(*DescribeHandshakeInput) DescribeHandshakeRequest
}
// Send marshals and sends the DescribeHandshake API request.
func (r DescribeHandshakeRequest) Send() (*DescribeHandshakeOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DescribeHandshakeOutput), nil
}
// DescribeHandshakeRequest returns a request value for making API operation for
// AWS Organizations.
//
// Retrieves information about a previously requested handshake. The handshake
// ID comes from the response to the original InviteAccountToOrganization operation
// that generated the handshake.
//
// You can access handshakes that are ACCEPTED, DECLINED, or CANCELED for only
// 30 days after they change to that state. They are then deleted and no longer
// accessible.
//
// This operation can be called from any account in the organization.
//
// // Example sending a request using the DescribeHandshakeRequest method.
// req := client.DescribeHandshakeRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DescribeHandshake
func (c *Organizations) DescribeHandshakeRequest(input *DescribeHandshakeInput) DescribeHandshakeRequest {
op := &aws.Operation{
Name: opDescribeHandshake,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DescribeHandshakeInput{}
}
output := &DescribeHandshakeOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return DescribeHandshakeRequest{Request: req, Input: input, Copy: c.DescribeHandshakeRequest}
}
const opDescribeOrganization = "DescribeOrganization"
// DescribeOrganizationRequest is a API request type for the DescribeOrganization API operation.
type DescribeOrganizationRequest struct {
*aws.Request
Input *DescribeOrganizationInput
Copy func(*DescribeOrganizationInput) DescribeOrganizationRequest
}
// Send marshals and sends the DescribeOrganization API request.
func (r DescribeOrganizationRequest) Send() (*DescribeOrganizationOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DescribeOrganizationOutput), nil
}
// DescribeOrganizationRequest returns a request value for making API operation for
// AWS Organizations.
//
// Retrieves information about the organization that the user's account belongs
// to.
//
// This operation can be called from any account in the organization.
//
// Even if a policy type is shown as available in the organization, it can be
// disabled separately at the root level with DisablePolicyType. Use ListRoots
// to see the status of policy types for a specified root.
//
// // Example sending a request using the DescribeOrganizationRequest method.
// req := client.DescribeOrganizationRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DescribeOrganization
func (c *Organizations) DescribeOrganizationRequest(input *DescribeOrganizationInput) DescribeOrganizationRequest {
op := &aws.Operation{
Name: opDescribeOrganization,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DescribeOrganizationInput{}
}
output := &DescribeOrganizationOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return DescribeOrganizationRequest{Request: req, Input: input, Copy: c.DescribeOrganizationRequest}
}
const opDescribeOrganizationalUnit = "DescribeOrganizationalUnit"
// DescribeOrganizationalUnitRequest is a API request type for the DescribeOrganizationalUnit API operation.
type DescribeOrganizationalUnitRequest struct {
*aws.Request
Input *DescribeOrganizationalUnitInput
Copy func(*DescribeOrganizationalUnitInput) DescribeOrganizationalUnitRequest
}
// Send marshals and sends the DescribeOrganizationalUnit API request.
func (r DescribeOrganizationalUnitRequest) Send() (*DescribeOrganizationalUnitOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*DescribeOrganizationalUnitOutput), nil
}
// DescribeOrganizationalUnitRequest returns a request value for making API operation for
// AWS Organizations.
//
// Retrieves information about an organizational unit (OU).
//
// This operation can be called only from the organization's master account.
//
// // Example sending a request using the DescribeOrganizationalUnitRequest method.
// req := client.DescribeOrganizationalUnitRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DescribeOrganizationalUnit
func (c *Organizations) DescribeOrganizationalUnitRequest(input *DescribeOrganizationalUnitInput) DescribeOrganizationalUnitRequest {
op := &aws.Operation{
Name: opDescribeOrganizationalUnit,
HTTPMethod: "POST",
HTTPPath: "/",