forked from aws/aws-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.go
9146 lines (8120 loc) · 355 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
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
// Package organizations provides a client for AWS Organizations.
package organizations
import (
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/private/protocol"
"github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
)
const opAcceptHandshake = "AcceptHandshake"
// AcceptHandshakeRequest generates a "aws/request.Request" representing the
// client's request for the AcceptHandshake operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See AcceptHandshake for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the AcceptHandshake method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the AcceptHandshakeRequest method.
// req, resp := client.AcceptHandshakeRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/AcceptHandshake
func (c *Organizations) AcceptHandshakeRequest(input *AcceptHandshakeInput) (req *request.Request, output *AcceptHandshakeOutput) {
op := &request.Operation{
Name: opAcceptHandshake,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &AcceptHandshakeInput{}
}
output = &AcceptHandshakeOutput{}
req = c.newRequest(op, input, output)
return
}
// AcceptHandshake 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.
//
// * 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.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for AWS Organizations's
// API operation AcceptHandshake for usage and error information.
//
// Returned Error Codes:
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You don't have permissions to perform the requested operation. The user or
// role that is making the request must have at least one IAM permissions policy
// attached that grants the required permissions. For more information, see
// Access Management (http://docs.aws.amazon.com/IAM/latest/UserGuide/access.html)
// in the IAM User Guide.
//
// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException"
// Your account is not a member of an organization. To make this request, you
// must use the credentials of an account that belongs to an organization.
//
// * ErrCodeHandshakeConstraintViolationException "HandshakeConstraintViolationException"
// The requested operation would violate the constraint identified in the reason
// code.
//
// * ErrCodeHandshakeNotFoundException "HandshakeNotFoundException"
// We can't find a handshake with the HandshakeId that you specified.
//
// * ErrCodeInvalidHandshakeTransitionException "InvalidHandshakeTransitionException"
// You can't perform the operation on the handshake in its current state. For
// example, you can't cancel a handshake that was already accepted, or accept
// a handshake that was already declined.
//
// * ErrCodeHandshakeAlreadyInStateException "HandshakeAlreadyInStateException"
// The specified handshake is already in the requested state. For example, you
// can't accept a handshake that was already accepted.
//
// * ErrCodeInvalidInputException "InvalidInputException"
// You provided invalid values for one or more of the request parameters.
//
// * ErrCodeConcurrentModificationException "ConcurrentModificationException"
// The target of the operation is currently being modified by a different request.
// Try again later.
//
// * ErrCodeServiceException "ServiceException"
// AWS Organizations can't complete your request because of an internal service
// error. Try again later.
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
// You've sent too many requests in too short a period of time. The limit helps
// protect against denial-of-service attacks. Try again later.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/AcceptHandshake
func (c *Organizations) AcceptHandshake(input *AcceptHandshakeInput) (*AcceptHandshakeOutput, error) {
req, out := c.AcceptHandshakeRequest(input)
return out, req.Send()
}
// AcceptHandshakeWithContext is the same as AcceptHandshake with the addition of
// the ability to pass a context and additional request options.
//
// See AcceptHandshake for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Organizations) AcceptHandshakeWithContext(ctx aws.Context, input *AcceptHandshakeInput, opts ...request.Option) (*AcceptHandshakeOutput, error) {
req, out := c.AcceptHandshakeRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opAttachPolicy = "AttachPolicy"
// AttachPolicyRequest generates a "aws/request.Request" representing the
// client's request for the AttachPolicy operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See AttachPolicy for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the AttachPolicy method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the AttachPolicyRequest method.
// req, resp := client.AttachPolicyRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/AttachPolicy
func (c *Organizations) AttachPolicyRequest(input *AttachPolicyInput) (req *request.Request, output *AttachPolicyOutput) {
op := &request.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)
return
}
// AttachPolicy API operation for AWS Organizations.
//
// Attaches a policy to a root, an organizational unit, 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.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for AWS Organizations's
// API operation AttachPolicy for usage and error information.
//
// Returned Error Codes:
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You don't have permissions to perform the requested operation. The user or
// role that is making the request must have at least one IAM permissions policy
// attached that grants the required permissions. For more information, see
// Access Management (http://docs.aws.amazon.com/IAM/latest/UserGuide/access.html)
// in the IAM User Guide.
//
// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException"
// Your account is not a member of an organization. To make this request, you
// must use the credentials of an account that belongs to an organization.
//
// * ErrCodeConcurrentModificationException "ConcurrentModificationException"
// The target of the operation is currently being modified by a different request.
// Try again later.
//
// * ErrCodeConstraintViolationException "ConstraintViolationException"
// Performing this operation violates a minimum or maximum value limit. For
// example, attempting to removing the last SCP from an OU or root, inviting
// or creating too many accounts to the organization, or attaching too many
// policies to an account, OU, or root.
//
// * ErrCodeDuplicatePolicyAttachmentException "DuplicatePolicyAttachmentException"
// The selected policy is already attached to the specified target.
//
// * ErrCodeInvalidInputException "InvalidInputException"
// You provided invalid values for one or more of the request parameters.
//
// * ErrCodePolicyNotFoundException "PolicyNotFoundException"
// We can't find a policy with the PolicyId that you specified.
//
// * ErrCodePolicyTypeNotEnabledException "PolicyTypeNotEnabledException"
// The specified policy type is not currently enabled in this root. You cannot
// attach policies of the specified type to entities in a root until you enable
// that type in the root. For more information, 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.
//
// * ErrCodeServiceException "ServiceException"
// AWS Organizations can't complete your request because of an internal service
// error. Try again later.
//
// * ErrCodeTargetNotFoundException "TargetNotFoundException"
// We can't find a root, OU, or account with the TargetId that you specified.
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
// You've sent too many requests in too short a period of time. The limit helps
// protect against denial-of-service attacks. Try again later.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/AttachPolicy
func (c *Organizations) AttachPolicy(input *AttachPolicyInput) (*AttachPolicyOutput, error) {
req, out := c.AttachPolicyRequest(input)
return out, req.Send()
}
// AttachPolicyWithContext is the same as AttachPolicy with the addition of
// the ability to pass a context and additional request options.
//
// See AttachPolicy for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Organizations) AttachPolicyWithContext(ctx aws.Context, input *AttachPolicyInput, opts ...request.Option) (*AttachPolicyOutput, error) {
req, out := c.AttachPolicyRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opCancelHandshake = "CancelHandshake"
// CancelHandshakeRequest generates a "aws/request.Request" representing the
// client's request for the CancelHandshake operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See CancelHandshake for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the CancelHandshake method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the CancelHandshakeRequest method.
// req, resp := client.CancelHandshakeRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/CancelHandshake
func (c *Organizations) CancelHandshakeRequest(input *CancelHandshakeInput) (req *request.Request, output *CancelHandshakeOutput) {
op := &request.Operation{
Name: opCancelHandshake,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CancelHandshakeInput{}
}
output = &CancelHandshakeOutput{}
req = c.newRequest(op, input, output)
return
}
// CancelHandshake 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.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for AWS Organizations's
// API operation CancelHandshake for usage and error information.
//
// Returned Error Codes:
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You don't have permissions to perform the requested operation. The user or
// role that is making the request must have at least one IAM permissions policy
// attached that grants the required permissions. For more information, see
// Access Management (http://docs.aws.amazon.com/IAM/latest/UserGuide/access.html)
// in the IAM User Guide.
//
// * ErrCodeHandshakeNotFoundException "HandshakeNotFoundException"
// We can't find a handshake with the HandshakeId that you specified.
//
// * ErrCodeInvalidHandshakeTransitionException "InvalidHandshakeTransitionException"
// You can't perform the operation on the handshake in its current state. For
// example, you can't cancel a handshake that was already accepted, or accept
// a handshake that was already declined.
//
// * ErrCodeHandshakeAlreadyInStateException "HandshakeAlreadyInStateException"
// The specified handshake is already in the requested state. For example, you
// can't accept a handshake that was already accepted.
//
// * ErrCodeInvalidInputException "InvalidInputException"
// You provided invalid values for one or more of the request parameters.
//
// * ErrCodeServiceException "ServiceException"
// AWS Organizations can't complete your request because of an internal service
// error. Try again later.
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
// You've sent too many requests in too short a period of time. The limit helps
// protect against denial-of-service attacks. Try again later.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/CancelHandshake
func (c *Organizations) CancelHandshake(input *CancelHandshakeInput) (*CancelHandshakeOutput, error) {
req, out := c.CancelHandshakeRequest(input)
return out, req.Send()
}
// CancelHandshakeWithContext is the same as CancelHandshake with the addition of
// the ability to pass a context and additional request options.
//
// See CancelHandshake for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Organizations) CancelHandshakeWithContext(ctx aws.Context, input *CancelHandshakeInput, opts ...request.Option) (*CancelHandshakeOutput, error) {
req, out := c.CancelHandshakeRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opCreateAccount = "CreateAccount"
// CreateAccountRequest generates a "aws/request.Request" representing the
// client's request for the CreateAccount operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See CreateAccount for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the CreateAccount method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the CreateAccountRequest method.
// req, resp := client.CreateAccountRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/CreateAccount
func (c *Organizations) CreateAccountRequest(input *CreateAccountInput) (req *request.Request, output *CreateAccountOutput) {
op := &request.Operation{
Name: opCreateAccount,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateAccountInput{}
}
output = &CreateAccountOutput{}
req = c.newRequest(op, input, output)
return
}
// CreateAccount 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.
//
// AWS Organizations preconfigures the new member account with a role (named
// OrganizationAccountAccessRole by default) that grants administrator permissions
// to the new 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.
//
// 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.
//
// You cannot remove accounts that are created with this operation from an organization.
// That also means that you cannot delete an organization that contains an account
// that is created with this operation.
//
// When you create a member account with this operation, the account is created
// with the IAM User and Role Access to Billing Information switch enabled.
// This allows IAM users and roles that are granted appropriate permissions
// to view billing information. If this is disabled, 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).
//
// This operation can be called only from the organization's master account.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for AWS Organizations's
// API operation CreateAccount for usage and error information.
//
// Returned Error Codes:
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You don't have permissions to perform the requested operation. The user or
// role that is making the request must have at least one IAM permissions policy
// attached that grants the required permissions. For more information, see
// Access Management (http://docs.aws.amazon.com/IAM/latest/UserGuide/access.html)
// in the IAM User Guide.
//
// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException"
// Your account is not a member of an organization. To make this request, you
// must use the credentials of an account that belongs to an organization.
//
// * ErrCodeConstraintViolationException "ConstraintViolationException"
// Performing this operation violates a minimum or maximum value limit. For
// example, attempting to removing the last SCP from an OU or root, inviting
// or creating too many accounts to the organization, or attaching too many
// policies to an account, OU, or root.
//
// * ErrCodeInvalidInputException "InvalidInputException"
// You provided invalid values for one or more of the request parameters.
//
// * ErrCodeFinalizingOrganizationException "FinalizingOrganizationException"
// AWS Organizations could not finalize the creation of your organization. Try
// again later. If this persists, contact AWS customer support.
//
// * ErrCodeServiceException "ServiceException"
// AWS Organizations can't complete your request because of an internal service
// error. Try again later.
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
// You've sent too many requests in too short a period of time. The limit helps
// protect against denial-of-service attacks. Try again later.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/CreateAccount
func (c *Organizations) CreateAccount(input *CreateAccountInput) (*CreateAccountOutput, error) {
req, out := c.CreateAccountRequest(input)
return out, req.Send()
}
// CreateAccountWithContext is the same as CreateAccount with the addition of
// the ability to pass a context and additional request options.
//
// See CreateAccount for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Organizations) CreateAccountWithContext(ctx aws.Context, input *CreateAccountInput, opts ...request.Option) (*CreateAccountOutput, error) {
req, out := c.CreateAccountRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opCreateOrganization = "CreateOrganization"
// CreateOrganizationRequest generates a "aws/request.Request" representing the
// client's request for the CreateOrganization operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See CreateOrganization for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the CreateOrganization method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the CreateOrganizationRequest method.
// req, resp := client.CreateOrganizationRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/CreateOrganization
func (c *Organizations) CreateOrganizationRequest(input *CreateOrganizationInput) (req *request.Request, output *CreateOrganizationOutput) {
op := &request.Operation{
Name: opCreateOrganization,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateOrganizationInput{}
}
output = &CreateOrganizationOutput{}
req = c.newRequest(op, input, output)
return
}
// CreateOrganization 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.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for AWS Organizations's
// API operation CreateOrganization for usage and error information.
//
// Returned Error Codes:
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You don't have permissions to perform the requested operation. The user or
// role that is making the request must have at least one IAM permissions policy
// attached that grants the required permissions. For more information, see
// Access Management (http://docs.aws.amazon.com/IAM/latest/UserGuide/access.html)
// in the IAM User Guide.
//
// * ErrCodeAlreadyInOrganizationException "AlreadyInOrganizationException"
// This account is already a member of an organization. An account can belong
// to only one organization at a time.
//
// * ErrCodeConcurrentModificationException "ConcurrentModificationException"
// The target of the operation is currently being modified by a different request.
// Try again later.
//
// * ErrCodeConstraintViolationException "ConstraintViolationException"
// Performing this operation violates a minimum or maximum value limit. For
// example, attempting to removing the last SCP from an OU or root, inviting
// or creating too many accounts to the organization, or attaching too many
// policies to an account, OU, or root.
//
// * ErrCodeInvalidInputException "InvalidInputException"
// You provided invalid values for one or more of the request parameters.
//
// * ErrCodeServiceException "ServiceException"
// AWS Organizations can't complete your request because of an internal service
// error. Try again later.
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
// You've sent too many requests in too short a period of time. The limit helps
// protect against denial-of-service attacks. Try again later.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/CreateOrganization
func (c *Organizations) CreateOrganization(input *CreateOrganizationInput) (*CreateOrganizationOutput, error) {
req, out := c.CreateOrganizationRequest(input)
return out, req.Send()
}
// CreateOrganizationWithContext is the same as CreateOrganization with the addition of
// the ability to pass a context and additional request options.
//
// See CreateOrganization for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Organizations) CreateOrganizationWithContext(ctx aws.Context, input *CreateOrganizationInput, opts ...request.Option) (*CreateOrganizationOutput, error) {
req, out := c.CreateOrganizationRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opCreateOrganizationalUnit = "CreateOrganizationalUnit"
// CreateOrganizationalUnitRequest generates a "aws/request.Request" representing the
// client's request for the CreateOrganizationalUnit operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See CreateOrganizationalUnit for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the CreateOrganizationalUnit method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the CreateOrganizationalUnitRequest method.
// req, resp := client.CreateOrganizationalUnitRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/CreateOrganizationalUnit
func (c *Organizations) CreateOrganizationalUnitRequest(input *CreateOrganizationalUnitInput) (req *request.Request, output *CreateOrganizationalUnitOutput) {
op := &request.Operation{
Name: opCreateOrganizationalUnit,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreateOrganizationalUnitInput{}
}
output = &CreateOrganizationalUnitOutput{}
req = c.newRequest(op, input, output)
return
}
// CreateOrganizationalUnit 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.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for AWS Organizations's
// API operation CreateOrganizationalUnit for usage and error information.
//
// Returned Error Codes:
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You don't have permissions to perform the requested operation. The user or
// role that is making the request must have at least one IAM permissions policy
// attached that grants the required permissions. For more information, see
// Access Management (http://docs.aws.amazon.com/IAM/latest/UserGuide/access.html)
// in the IAM User Guide.
//
// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException"
// Your account is not a member of an organization. To make this request, you
// must use the credentials of an account that belongs to an organization.
//
// * ErrCodeConstraintViolationException "ConstraintViolationException"
// Performing this operation violates a minimum or maximum value limit. For
// example, attempting to removing the last SCP from an OU or root, inviting
// or creating too many accounts to the organization, or attaching too many
// policies to an account, OU, or root.
//
// * ErrCodeDuplicateOrganizationalUnitException "DuplicateOrganizationalUnitException"
// An organizational unit (OU) with the same name already exists.
//
// * ErrCodeInvalidInputException "InvalidInputException"
// You provided invalid values for one or more of the request parameters.
//
// * ErrCodeParentNotFoundException "ParentNotFoundException"
// We can't find a root or organizational unit (OU) with the ParentId that you
// specified.
//
// * ErrCodeServiceException "ServiceException"
// AWS Organizations can't complete your request because of an internal service
// error. Try again later.
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
// You've sent too many requests in too short a period of time. The limit helps
// protect against denial-of-service attacks. Try again later.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/CreateOrganizationalUnit
func (c *Organizations) CreateOrganizationalUnit(input *CreateOrganizationalUnitInput) (*CreateOrganizationalUnitOutput, error) {
req, out := c.CreateOrganizationalUnitRequest(input)
return out, req.Send()
}
// CreateOrganizationalUnitWithContext is the same as CreateOrganizationalUnit with the addition of
// the ability to pass a context and additional request options.
//
// See CreateOrganizationalUnit for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Organizations) CreateOrganizationalUnitWithContext(ctx aws.Context, input *CreateOrganizationalUnitInput, opts ...request.Option) (*CreateOrganizationalUnitOutput, error) {
req, out := c.CreateOrganizationalUnitRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opCreatePolicy = "CreatePolicy"
// CreatePolicyRequest generates a "aws/request.Request" representing the
// client's request for the CreatePolicy operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See CreatePolicy for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the CreatePolicy method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the CreatePolicyRequest method.
// req, resp := client.CreatePolicyRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/CreatePolicy
func (c *Organizations) CreatePolicyRequest(input *CreatePolicyInput) (req *request.Request, output *CreatePolicyOutput) {
op := &request.Operation{
Name: opCreatePolicy,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &CreatePolicyInput{}
}
output = &CreatePolicyOutput{}
req = c.newRequest(op, input, output)
return
}
// CreatePolicy 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.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for AWS Organizations's
// API operation CreatePolicy for usage and error information.
//
// Returned Error Codes:
// * ErrCodeAccessDeniedException "AccessDeniedException"
// You don't have permissions to perform the requested operation. The user or
// role that is making the request must have at least one IAM permissions policy
// attached that grants the required permissions. For more information, see
// Access Management (http://docs.aws.amazon.com/IAM/latest/UserGuide/access.html)
// in the IAM User Guide.
//
// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException"
// Your account is not a member of an organization. To make this request, you
// must use the credentials of an account that belongs to an organization.
//
// * ErrCodeConcurrentModificationException "ConcurrentModificationException"
// The target of the operation is currently being modified by a different request.
// Try again later.
//
// * ErrCodeConstraintViolationException "ConstraintViolationException"
// Performing this operation violates a minimum or maximum value limit. For
// example, attempting to removing the last SCP from an OU or root, inviting
// or creating too many accounts to the organization, or attaching too many
// policies to an account, OU, or root.
//
// * ErrCodeDuplicatePolicyException "DuplicatePolicyException"
// A policy with the same name already exists.
//
// * ErrCodeInvalidInputException "InvalidInputException"
// You provided invalid values for one or more of the request parameters.
//
// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocumentException"
// The provided policy document does not meet the requirements of the specified
// policy type. For example, the syntax might be incorrect. For details about
// service control policy syntax, see Service Control Policy Syntax (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_scp-syntax.html)
// in the AWS Organizations User Guide.
//
// * ErrCodePolicyTypeNotAvailableForOrganizationException "PolicyTypeNotAvailableForOrganizationException"
// You can't use the specified policy type with the feature set currently enabled
// for this organization. For example, you can enable service control policies
// (SCPs) only after you enable all features in the organization. For more information,
// see Enabling and Disabling a Policy Type on a Root (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies.html#enable_policies_on_root)
// in the AWS Organizations User Guide.
//
// * ErrCodeServiceException "ServiceException"
// AWS Organizations can't complete your request because of an internal service
// error. Try again later.
//
// * ErrCodeTooManyRequestsException "TooManyRequestsException"
// You've sent too many requests in too short a period of time. The limit helps
// protect against denial-of-service attacks. Try again later.
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/CreatePolicy
func (c *Organizations) CreatePolicy(input *CreatePolicyInput) (*CreatePolicyOutput, error) {
req, out := c.CreatePolicyRequest(input)
return out, req.Send()
}
// CreatePolicyWithContext is the same as CreatePolicy with the addition of
// the ability to pass a context and additional request options.
//
// See CreatePolicy for details on how to use this API operation.
//
// The context must be non-nil and will be used for request cancellation. If
// the context is nil a panic will occur. In the future the SDK may create
// sub-contexts for http.Requests. See https://golang.org/pkg/context/
// for more information on using Contexts.
func (c *Organizations) CreatePolicyWithContext(ctx aws.Context, input *CreatePolicyInput, opts ...request.Option) (*CreatePolicyOutput, error) {
req, out := c.CreatePolicyRequest(input)
req.SetContext(ctx)
req.ApplyOptions(opts...)
return out, req.Send()
}
const opDeclineHandshake = "DeclineHandshake"
// DeclineHandshakeRequest generates a "aws/request.Request" representing the
// client's request for the DeclineHandshake operation. The "output" return
// value can be used to capture response data after the request's "Send" method
// is called.
//
// See DeclineHandshake for usage and error information.
//
// Creating a request object using this method should be used when you want to inject
// custom logic into the request's lifecycle using a custom handler, or if you want to
// access properties on the request object before or after sending the request. If
// you just want the service response, call the DeclineHandshake method directly
// instead.
//
// Note: You must call the "Send" method on the returned request object in order
// to execute the request.
//
// // Example sending a request using the DeclineHandshakeRequest method.
// req, resp := client.DeclineHandshakeRequest(params)
//
// err := req.Send()
// if err == nil { // resp is now filled
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DeclineHandshake
func (c *Organizations) DeclineHandshakeRequest(input *DeclineHandshakeInput) (req *request.Request, output *DeclineHandshakeOutput) {
op := &request.Operation{
Name: opDeclineHandshake,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &DeclineHandshakeInput{}
}
output = &DeclineHandshakeOutput{}
req = c.newRequest(op, input, output)
return
}
// DeclineHandshake 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.
//
// Returns awserr.Error for service API and SDK errors. Use runtime type assertions
// with awserr.Error's Code and Message methods to get detailed information about
// the error.
//
// See the AWS API reference guide for AWS Organizations's
// API operation DeclineHandshake for usage and error information.
//
// Returned Error Codes: