mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-30 04:20:53 +00:00
Conver to regular Go vendor + dep tool
This commit is contained in:
+9146
File diff suppressed because it is too large
Load Diff
+274
@@ -0,0 +1,274 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
|
||||
package organizations
|
||||
|
||||
const (
|
||||
|
||||
// ErrCodeAWSOrganizationsNotInUseException for service response error code
|
||||
// "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.
|
||||
ErrCodeAWSOrganizationsNotInUseException = "AWSOrganizationsNotInUseException"
|
||||
|
||||
// ErrCodeAccessDeniedException for service response error code
|
||||
// "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.
|
||||
ErrCodeAccessDeniedException = "AccessDeniedException"
|
||||
|
||||
// ErrCodeAccountNotFoundException for service response error code
|
||||
// "AccountNotFoundException".
|
||||
//
|
||||
// We can't find an AWS account with the AccountId that you specified, or the
|
||||
// account whose credentials you used to make this request is not a member of
|
||||
// an organization.
|
||||
ErrCodeAccountNotFoundException = "AccountNotFoundException"
|
||||
|
||||
// ErrCodeAlreadyInOrganizationException for service response error code
|
||||
// "AlreadyInOrganizationException".
|
||||
//
|
||||
// This account is already a member of an organization. An account can belong
|
||||
// to only one organization at a time.
|
||||
ErrCodeAlreadyInOrganizationException = "AlreadyInOrganizationException"
|
||||
|
||||
// ErrCodeChildNotFoundException for service response error code
|
||||
// "ChildNotFoundException".
|
||||
//
|
||||
// We can't find an organizational unit (OU) or AWS account with the ChildId
|
||||
// that you specified.
|
||||
ErrCodeChildNotFoundException = "ChildNotFoundException"
|
||||
|
||||
// ErrCodeConcurrentModificationException for service response error code
|
||||
// "ConcurrentModificationException".
|
||||
//
|
||||
// The target of the operation is currently being modified by a different request.
|
||||
// Try again later.
|
||||
ErrCodeConcurrentModificationException = "ConcurrentModificationException"
|
||||
|
||||
// ErrCodeConstraintViolationException for service response error code
|
||||
// "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.
|
||||
ErrCodeConstraintViolationException = "ConstraintViolationException"
|
||||
|
||||
// ErrCodeCreateAccountStatusNotFoundException for service response error code
|
||||
// "CreateAccountStatusNotFoundException".
|
||||
//
|
||||
// We can't find an create account request with the CreateAccountRequestId that
|
||||
// you specified.
|
||||
ErrCodeCreateAccountStatusNotFoundException = "CreateAccountStatusNotFoundException"
|
||||
|
||||
// ErrCodeDestinationParentNotFoundException for service response error code
|
||||
// "DestinationParentNotFoundException".
|
||||
//
|
||||
// We can't find the destination container (a root or OU) with the ParentId
|
||||
// that you specified.
|
||||
ErrCodeDestinationParentNotFoundException = "DestinationParentNotFoundException"
|
||||
|
||||
// ErrCodeDuplicateAccountException for service response error code
|
||||
// "DuplicateAccountException".
|
||||
//
|
||||
// That account is already present in the specified destination.
|
||||
ErrCodeDuplicateAccountException = "DuplicateAccountException"
|
||||
|
||||
// ErrCodeDuplicateHandshakeException for service response error code
|
||||
// "DuplicateHandshakeException".
|
||||
//
|
||||
// A handshake with the same action and target already exists. For example,
|
||||
// if you invited an account to join your organization, the invited account
|
||||
// might already have a pending invitation from this organization. If you intend
|
||||
// to resend an invitation to an account, ensure that existing handshakes that
|
||||
// might be considered duplicates are canceled or declined.
|
||||
ErrCodeDuplicateHandshakeException = "DuplicateHandshakeException"
|
||||
|
||||
// ErrCodeDuplicateOrganizationalUnitException for service response error code
|
||||
// "DuplicateOrganizationalUnitException".
|
||||
//
|
||||
// An organizational unit (OU) with the same name already exists.
|
||||
ErrCodeDuplicateOrganizationalUnitException = "DuplicateOrganizationalUnitException"
|
||||
|
||||
// ErrCodeDuplicatePolicyAttachmentException for service response error code
|
||||
// "DuplicatePolicyAttachmentException".
|
||||
//
|
||||
// The selected policy is already attached to the specified target.
|
||||
ErrCodeDuplicatePolicyAttachmentException = "DuplicatePolicyAttachmentException"
|
||||
|
||||
// ErrCodeDuplicatePolicyException for service response error code
|
||||
// "DuplicatePolicyException".
|
||||
//
|
||||
// A policy with the same name already exists.
|
||||
ErrCodeDuplicatePolicyException = "DuplicatePolicyException"
|
||||
|
||||
// ErrCodeFinalizingOrganizationException for service response error code
|
||||
// "FinalizingOrganizationException".
|
||||
//
|
||||
// AWS Organizations could not finalize the creation of your organization. Try
|
||||
// again later. If this persists, contact AWS customer support.
|
||||
ErrCodeFinalizingOrganizationException = "FinalizingOrganizationException"
|
||||
|
||||
// ErrCodeHandshakeAlreadyInStateException for service response error code
|
||||
// "HandshakeAlreadyInStateException".
|
||||
//
|
||||
// The specified handshake is already in the requested state. For example, you
|
||||
// can't accept a handshake that was already accepted.
|
||||
ErrCodeHandshakeAlreadyInStateException = "HandshakeAlreadyInStateException"
|
||||
|
||||
// ErrCodeHandshakeConstraintViolationException for service response error code
|
||||
// "HandshakeConstraintViolationException".
|
||||
//
|
||||
// The requested operation would violate the constraint identified in the reason
|
||||
// code.
|
||||
ErrCodeHandshakeConstraintViolationException = "HandshakeConstraintViolationException"
|
||||
|
||||
// ErrCodeHandshakeNotFoundException for service response error code
|
||||
// "HandshakeNotFoundException".
|
||||
//
|
||||
// We can't find a handshake with the HandshakeId that you specified.
|
||||
ErrCodeHandshakeNotFoundException = "HandshakeNotFoundException"
|
||||
|
||||
// ErrCodeInvalidHandshakeTransitionException for service response error code
|
||||
// "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.
|
||||
ErrCodeInvalidHandshakeTransitionException = "InvalidHandshakeTransitionException"
|
||||
|
||||
// ErrCodeInvalidInputException for service response error code
|
||||
// "InvalidInputException".
|
||||
//
|
||||
// You provided invalid values for one or more of the request parameters.
|
||||
ErrCodeInvalidInputException = "InvalidInputException"
|
||||
|
||||
// ErrCodeMalformedPolicyDocumentException for service response error code
|
||||
// "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.
|
||||
ErrCodeMalformedPolicyDocumentException = "MalformedPolicyDocumentException"
|
||||
|
||||
// ErrCodeMasterCannotLeaveOrganizationException for service response error code
|
||||
// "MasterCannotLeaveOrganizationException".
|
||||
//
|
||||
// You can't remove a master account from an organization. If you want the master
|
||||
// account to become a member account in another organization, you must first
|
||||
// delete the current organization of the master account.
|
||||
ErrCodeMasterCannotLeaveOrganizationException = "MasterCannotLeaveOrganizationException"
|
||||
|
||||
// ErrCodeOrganizationNotEmptyException for service response error code
|
||||
// "OrganizationNotEmptyException".
|
||||
//
|
||||
// The organization isn't empty. To delete an organization, you must first remove
|
||||
// all accounts except the master account, delete all organizational units (OUs),
|
||||
// and delete all policies.
|
||||
ErrCodeOrganizationNotEmptyException = "OrganizationNotEmptyException"
|
||||
|
||||
// ErrCodeOrganizationalUnitNotEmptyException for service response error code
|
||||
// "OrganizationalUnitNotEmptyException".
|
||||
//
|
||||
// The specified organizational unit (OU) is not empty. Move all accounts to
|
||||
// another root or to other OUs, remove all child OUs, and then try the operation
|
||||
// again.
|
||||
ErrCodeOrganizationalUnitNotEmptyException = "OrganizationalUnitNotEmptyException"
|
||||
|
||||
// ErrCodeOrganizationalUnitNotFoundException for service response error code
|
||||
// "OrganizationalUnitNotFoundException".
|
||||
//
|
||||
// We can't find an organizational unit (OU) with the OrganizationalUnitId that
|
||||
// you specified.
|
||||
ErrCodeOrganizationalUnitNotFoundException = "OrganizationalUnitNotFoundException"
|
||||
|
||||
// ErrCodeParentNotFoundException for service response error code
|
||||
// "ParentNotFoundException".
|
||||
//
|
||||
// We can't find a root or organizational unit (OU) with the ParentId that you
|
||||
// specified.
|
||||
ErrCodeParentNotFoundException = "ParentNotFoundException"
|
||||
|
||||
// ErrCodePolicyInUseException for service response error code
|
||||
// "PolicyInUseException".
|
||||
//
|
||||
// The policy is attached to one or more entities. You must detach it from all
|
||||
// roots, organizational units (OUs), and accounts before performing this operation.
|
||||
ErrCodePolicyInUseException = "PolicyInUseException"
|
||||
|
||||
// ErrCodePolicyNotAttachedException for service response error code
|
||||
// "PolicyNotAttachedException".
|
||||
//
|
||||
// The policy isn't attached to the specified target in the specified root.
|
||||
ErrCodePolicyNotAttachedException = "PolicyNotAttachedException"
|
||||
|
||||
// ErrCodePolicyNotFoundException for service response error code
|
||||
// "PolicyNotFoundException".
|
||||
//
|
||||
// We can't find a policy with the PolicyId that you specified.
|
||||
ErrCodePolicyNotFoundException = "PolicyNotFoundException"
|
||||
|
||||
// ErrCodePolicyTypeAlreadyEnabledException for service response error code
|
||||
// "PolicyTypeAlreadyEnabledException".
|
||||
//
|
||||
// The specified policy type is already enabled in the specified root.
|
||||
ErrCodePolicyTypeAlreadyEnabledException = "PolicyTypeAlreadyEnabledException"
|
||||
|
||||
// ErrCodePolicyTypeNotAvailableForOrganizationException for service response error code
|
||||
// "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.
|
||||
ErrCodePolicyTypeNotAvailableForOrganizationException = "PolicyTypeNotAvailableForOrganizationException"
|
||||
|
||||
// ErrCodePolicyTypeNotEnabledException for service response error code
|
||||
// "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.
|
||||
ErrCodePolicyTypeNotEnabledException = "PolicyTypeNotEnabledException"
|
||||
|
||||
// ErrCodeRootNotFoundException for service response error code
|
||||
// "RootNotFoundException".
|
||||
//
|
||||
// We can't find a root with the RootId that you specified.
|
||||
ErrCodeRootNotFoundException = "RootNotFoundException"
|
||||
|
||||
// ErrCodeServiceException for service response error code
|
||||
// "ServiceException".
|
||||
//
|
||||
// AWS Organizations can't complete your request because of an internal service
|
||||
// error. Try again later.
|
||||
ErrCodeServiceException = "ServiceException"
|
||||
|
||||
// ErrCodeSourceParentNotFoundException for service response error code
|
||||
// "SourceParentNotFoundException".
|
||||
//
|
||||
// We can't find a source root or OU with the ParentId that you specified.
|
||||
ErrCodeSourceParentNotFoundException = "SourceParentNotFoundException"
|
||||
|
||||
// ErrCodeTargetNotFoundException for service response error code
|
||||
// "TargetNotFoundException".
|
||||
//
|
||||
// We can't find a root, OU, or account with the TargetId that you specified.
|
||||
ErrCodeTargetNotFoundException = "TargetNotFoundException"
|
||||
|
||||
// ErrCodeTooManyRequestsException for service response error code
|
||||
// "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.
|
||||
ErrCodeTooManyRequestsException = "TooManyRequestsException"
|
||||
)
|
||||
+881
@@ -0,0 +1,881 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
|
||||
package organizations_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/session"
|
||||
"github.com/aws/aws-sdk-go/service/organizations"
|
||||
)
|
||||
|
||||
var _ time.Duration
|
||||
var _ bytes.Buffer
|
||||
|
||||
func ExampleOrganizations_AcceptHandshake() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.AcceptHandshakeInput{
|
||||
HandshakeId: aws.String("HandshakeId"), // Required
|
||||
}
|
||||
resp, err := svc.AcceptHandshake(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_AttachPolicy() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.AttachPolicyInput{
|
||||
PolicyId: aws.String("PolicyId"), // Required
|
||||
TargetId: aws.String("PolicyTargetId"), // Required
|
||||
}
|
||||
resp, err := svc.AttachPolicy(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_CancelHandshake() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.CancelHandshakeInput{
|
||||
HandshakeId: aws.String("HandshakeId"), // Required
|
||||
}
|
||||
resp, err := svc.CancelHandshake(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_CreateAccount() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.CreateAccountInput{
|
||||
AccountName: aws.String("AccountName"), // Required
|
||||
Email: aws.String("Email"), // Required
|
||||
IamUserAccessToBilling: aws.String("IAMUserAccessToBilling"),
|
||||
RoleName: aws.String("RoleName"),
|
||||
}
|
||||
resp, err := svc.CreateAccount(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_CreateOrganization() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.CreateOrganizationInput{
|
||||
FeatureSet: aws.String("OrganizationFeatureSet"),
|
||||
}
|
||||
resp, err := svc.CreateOrganization(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_CreateOrganizationalUnit() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.CreateOrganizationalUnitInput{
|
||||
Name: aws.String("OrganizationalUnitName"), // Required
|
||||
ParentId: aws.String("ParentId"), // Required
|
||||
}
|
||||
resp, err := svc.CreateOrganizationalUnit(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_CreatePolicy() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.CreatePolicyInput{
|
||||
Content: aws.String("PolicyContent"), // Required
|
||||
Description: aws.String("PolicyDescription"), // Required
|
||||
Name: aws.String("PolicyName"), // Required
|
||||
Type: aws.String("PolicyType"), // Required
|
||||
}
|
||||
resp, err := svc.CreatePolicy(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_DeclineHandshake() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.DeclineHandshakeInput{
|
||||
HandshakeId: aws.String("HandshakeId"), // Required
|
||||
}
|
||||
resp, err := svc.DeclineHandshake(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_DeleteOrganization() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
var params *organizations.DeleteOrganizationInput
|
||||
resp, err := svc.DeleteOrganization(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_DeleteOrganizationalUnit() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.DeleteOrganizationalUnitInput{
|
||||
OrganizationalUnitId: aws.String("OrganizationalUnitId"), // Required
|
||||
}
|
||||
resp, err := svc.DeleteOrganizationalUnit(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_DeletePolicy() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.DeletePolicyInput{
|
||||
PolicyId: aws.String("PolicyId"), // Required
|
||||
}
|
||||
resp, err := svc.DeletePolicy(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_DescribeAccount() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.DescribeAccountInput{
|
||||
AccountId: aws.String("AccountId"), // Required
|
||||
}
|
||||
resp, err := svc.DescribeAccount(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_DescribeCreateAccountStatus() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.DescribeCreateAccountStatusInput{
|
||||
CreateAccountRequestId: aws.String("CreateAccountRequestId"), // Required
|
||||
}
|
||||
resp, err := svc.DescribeCreateAccountStatus(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_DescribeHandshake() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.DescribeHandshakeInput{
|
||||
HandshakeId: aws.String("HandshakeId"), // Required
|
||||
}
|
||||
resp, err := svc.DescribeHandshake(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_DescribeOrganization() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
var params *organizations.DescribeOrganizationInput
|
||||
resp, err := svc.DescribeOrganization(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_DescribeOrganizationalUnit() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.DescribeOrganizationalUnitInput{
|
||||
OrganizationalUnitId: aws.String("OrganizationalUnitId"), // Required
|
||||
}
|
||||
resp, err := svc.DescribeOrganizationalUnit(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_DescribePolicy() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.DescribePolicyInput{
|
||||
PolicyId: aws.String("PolicyId"), // Required
|
||||
}
|
||||
resp, err := svc.DescribePolicy(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_DetachPolicy() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.DetachPolicyInput{
|
||||
PolicyId: aws.String("PolicyId"), // Required
|
||||
TargetId: aws.String("PolicyTargetId"), // Required
|
||||
}
|
||||
resp, err := svc.DetachPolicy(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_DisablePolicyType() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.DisablePolicyTypeInput{
|
||||
PolicyType: aws.String("PolicyType"), // Required
|
||||
RootId: aws.String("RootId"), // Required
|
||||
}
|
||||
resp, err := svc.DisablePolicyType(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_EnableAllFeatures() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
var params *organizations.EnableAllFeaturesInput
|
||||
resp, err := svc.EnableAllFeatures(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_EnablePolicyType() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.EnablePolicyTypeInput{
|
||||
PolicyType: aws.String("PolicyType"), // Required
|
||||
RootId: aws.String("RootId"), // Required
|
||||
}
|
||||
resp, err := svc.EnablePolicyType(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_InviteAccountToOrganization() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.InviteAccountToOrganizationInput{
|
||||
Target: &organizations.HandshakeParty{ // Required
|
||||
Id: aws.String("HandshakePartyId"),
|
||||
Type: aws.String("HandshakePartyType"),
|
||||
},
|
||||
Notes: aws.String("HandshakeNotes"),
|
||||
}
|
||||
resp, err := svc.InviteAccountToOrganization(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_LeaveOrganization() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
var params *organizations.LeaveOrganizationInput
|
||||
resp, err := svc.LeaveOrganization(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_ListAccounts() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.ListAccountsInput{
|
||||
MaxResults: aws.Int64(1),
|
||||
NextToken: aws.String("NextToken"),
|
||||
}
|
||||
resp, err := svc.ListAccounts(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_ListAccountsForParent() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.ListAccountsForParentInput{
|
||||
ParentId: aws.String("ParentId"), // Required
|
||||
MaxResults: aws.Int64(1),
|
||||
NextToken: aws.String("NextToken"),
|
||||
}
|
||||
resp, err := svc.ListAccountsForParent(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_ListChildren() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.ListChildrenInput{
|
||||
ChildType: aws.String("ChildType"), // Required
|
||||
ParentId: aws.String("ParentId"), // Required
|
||||
MaxResults: aws.Int64(1),
|
||||
NextToken: aws.String("NextToken"),
|
||||
}
|
||||
resp, err := svc.ListChildren(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_ListCreateAccountStatus() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.ListCreateAccountStatusInput{
|
||||
MaxResults: aws.Int64(1),
|
||||
NextToken: aws.String("NextToken"),
|
||||
States: []*string{
|
||||
aws.String("CreateAccountState"), // Required
|
||||
// More values...
|
||||
},
|
||||
}
|
||||
resp, err := svc.ListCreateAccountStatus(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_ListHandshakesForAccount() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.ListHandshakesForAccountInput{
|
||||
Filter: &organizations.HandshakeFilter{
|
||||
ActionType: aws.String("ActionType"),
|
||||
ParentHandshakeId: aws.String("HandshakeId"),
|
||||
},
|
||||
MaxResults: aws.Int64(1),
|
||||
NextToken: aws.String("NextToken"),
|
||||
}
|
||||
resp, err := svc.ListHandshakesForAccount(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_ListHandshakesForOrganization() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.ListHandshakesForOrganizationInput{
|
||||
Filter: &organizations.HandshakeFilter{
|
||||
ActionType: aws.String("ActionType"),
|
||||
ParentHandshakeId: aws.String("HandshakeId"),
|
||||
},
|
||||
MaxResults: aws.Int64(1),
|
||||
NextToken: aws.String("NextToken"),
|
||||
}
|
||||
resp, err := svc.ListHandshakesForOrganization(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_ListOrganizationalUnitsForParent() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.ListOrganizationalUnitsForParentInput{
|
||||
ParentId: aws.String("ParentId"), // Required
|
||||
MaxResults: aws.Int64(1),
|
||||
NextToken: aws.String("NextToken"),
|
||||
}
|
||||
resp, err := svc.ListOrganizationalUnitsForParent(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_ListParents() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.ListParentsInput{
|
||||
ChildId: aws.String("ChildId"), // Required
|
||||
MaxResults: aws.Int64(1),
|
||||
NextToken: aws.String("NextToken"),
|
||||
}
|
||||
resp, err := svc.ListParents(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_ListPolicies() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.ListPoliciesInput{
|
||||
Filter: aws.String("PolicyType"), // Required
|
||||
MaxResults: aws.Int64(1),
|
||||
NextToken: aws.String("NextToken"),
|
||||
}
|
||||
resp, err := svc.ListPolicies(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_ListPoliciesForTarget() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.ListPoliciesForTargetInput{
|
||||
Filter: aws.String("PolicyType"), // Required
|
||||
TargetId: aws.String("PolicyTargetId"), // Required
|
||||
MaxResults: aws.Int64(1),
|
||||
NextToken: aws.String("NextToken"),
|
||||
}
|
||||
resp, err := svc.ListPoliciesForTarget(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_ListRoots() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.ListRootsInput{
|
||||
MaxResults: aws.Int64(1),
|
||||
NextToken: aws.String("NextToken"),
|
||||
}
|
||||
resp, err := svc.ListRoots(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_ListTargetsForPolicy() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.ListTargetsForPolicyInput{
|
||||
PolicyId: aws.String("PolicyId"), // Required
|
||||
MaxResults: aws.Int64(1),
|
||||
NextToken: aws.String("NextToken"),
|
||||
}
|
||||
resp, err := svc.ListTargetsForPolicy(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_MoveAccount() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.MoveAccountInput{
|
||||
AccountId: aws.String("AccountId"), // Required
|
||||
DestinationParentId: aws.String("ParentId"), // Required
|
||||
SourceParentId: aws.String("ParentId"), // Required
|
||||
}
|
||||
resp, err := svc.MoveAccount(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_RemoveAccountFromOrganization() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.RemoveAccountFromOrganizationInput{
|
||||
AccountId: aws.String("AccountId"), // Required
|
||||
}
|
||||
resp, err := svc.RemoveAccountFromOrganization(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_UpdateOrganizationalUnit() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.UpdateOrganizationalUnitInput{
|
||||
OrganizationalUnitId: aws.String("OrganizationalUnitId"), // Required
|
||||
Name: aws.String("OrganizationalUnitName"),
|
||||
}
|
||||
resp, err := svc.UpdateOrganizationalUnit(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
|
||||
func ExampleOrganizations_UpdatePolicy() {
|
||||
sess := session.Must(session.NewSession())
|
||||
|
||||
svc := organizations.New(sess)
|
||||
|
||||
params := &organizations.UpdatePolicyInput{
|
||||
PolicyId: aws.String("PolicyId"), // Required
|
||||
Content: aws.String("PolicyContent"),
|
||||
Description: aws.String("PolicyDescription"),
|
||||
Name: aws.String("PolicyName"),
|
||||
}
|
||||
resp, err := svc.UpdatePolicy(params)
|
||||
|
||||
if err != nil {
|
||||
// Print the error, cast err to awserr.Error to get the Code and
|
||||
// Message from an error.
|
||||
fmt.Println(err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// Pretty-print the response data.
|
||||
fmt.Println(resp)
|
||||
}
|
||||
Generated
Vendored
+220
@@ -0,0 +1,220 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
|
||||
// Package organizationsiface provides an interface to enable mocking the AWS Organizations service client
|
||||
// for testing your code.
|
||||
//
|
||||
// It is important to note that this interface will have breaking changes
|
||||
// when the service model is updated and adds new API operations, paginators,
|
||||
// and waiters.
|
||||
package organizationsiface
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/service/organizations"
|
||||
)
|
||||
|
||||
// OrganizationsAPI provides an interface to enable mocking the
|
||||
// organizations.Organizations service client's API operation,
|
||||
// paginators, and waiters. This make unit testing your code that calls out
|
||||
// to the SDK's service client's calls easier.
|
||||
//
|
||||
// The best way to use this interface is so the SDK's service client's calls
|
||||
// can be stubbed out for unit testing your code with the SDK without needing
|
||||
// to inject custom request handlers into the the SDK's request pipeline.
|
||||
//
|
||||
// // myFunc uses an SDK service client to make a request to
|
||||
// // AWS Organizations.
|
||||
// func myFunc(svc organizationsiface.OrganizationsAPI) bool {
|
||||
// // Make svc.AcceptHandshake request
|
||||
// }
|
||||
//
|
||||
// func main() {
|
||||
// sess := session.New()
|
||||
// svc := organizations.New(sess)
|
||||
//
|
||||
// myFunc(svc)
|
||||
// }
|
||||
//
|
||||
// In your _test.go file:
|
||||
//
|
||||
// // Define a mock struct to be used in your unit tests of myFunc.
|
||||
// type mockOrganizationsClient struct {
|
||||
// organizationsiface.OrganizationsAPI
|
||||
// }
|
||||
// func (m *mockOrganizationsClient) AcceptHandshake(input *organizations.AcceptHandshakeInput) (*organizations.AcceptHandshakeOutput, error) {
|
||||
// // mock response/functionality
|
||||
// }
|
||||
//
|
||||
// func TestMyFunc(t *testing.T) {
|
||||
// // Setup Test
|
||||
// mockSvc := &mockOrganizationsClient{}
|
||||
//
|
||||
// myfunc(mockSvc)
|
||||
//
|
||||
// // Verify myFunc's functionality
|
||||
// }
|
||||
//
|
||||
// It is important to note that this interface will have breaking changes
|
||||
// when the service model is updated and adds new API operations, paginators,
|
||||
// and waiters. Its suggested to use the pattern above for testing, or using
|
||||
// tooling to generate mocks to satisfy the interfaces.
|
||||
type OrganizationsAPI interface {
|
||||
AcceptHandshake(*organizations.AcceptHandshakeInput) (*organizations.AcceptHandshakeOutput, error)
|
||||
AcceptHandshakeWithContext(aws.Context, *organizations.AcceptHandshakeInput, ...request.Option) (*organizations.AcceptHandshakeOutput, error)
|
||||
AcceptHandshakeRequest(*organizations.AcceptHandshakeInput) (*request.Request, *organizations.AcceptHandshakeOutput)
|
||||
|
||||
AttachPolicy(*organizations.AttachPolicyInput) (*organizations.AttachPolicyOutput, error)
|
||||
AttachPolicyWithContext(aws.Context, *organizations.AttachPolicyInput, ...request.Option) (*organizations.AttachPolicyOutput, error)
|
||||
AttachPolicyRequest(*organizations.AttachPolicyInput) (*request.Request, *organizations.AttachPolicyOutput)
|
||||
|
||||
CancelHandshake(*organizations.CancelHandshakeInput) (*organizations.CancelHandshakeOutput, error)
|
||||
CancelHandshakeWithContext(aws.Context, *organizations.CancelHandshakeInput, ...request.Option) (*organizations.CancelHandshakeOutput, error)
|
||||
CancelHandshakeRequest(*organizations.CancelHandshakeInput) (*request.Request, *organizations.CancelHandshakeOutput)
|
||||
|
||||
CreateAccount(*organizations.CreateAccountInput) (*organizations.CreateAccountOutput, error)
|
||||
CreateAccountWithContext(aws.Context, *organizations.CreateAccountInput, ...request.Option) (*organizations.CreateAccountOutput, error)
|
||||
CreateAccountRequest(*organizations.CreateAccountInput) (*request.Request, *organizations.CreateAccountOutput)
|
||||
|
||||
CreateOrganization(*organizations.CreateOrganizationInput) (*organizations.CreateOrganizationOutput, error)
|
||||
CreateOrganizationWithContext(aws.Context, *organizations.CreateOrganizationInput, ...request.Option) (*organizations.CreateOrganizationOutput, error)
|
||||
CreateOrganizationRequest(*organizations.CreateOrganizationInput) (*request.Request, *organizations.CreateOrganizationOutput)
|
||||
|
||||
CreateOrganizationalUnit(*organizations.CreateOrganizationalUnitInput) (*organizations.CreateOrganizationalUnitOutput, error)
|
||||
CreateOrganizationalUnitWithContext(aws.Context, *organizations.CreateOrganizationalUnitInput, ...request.Option) (*organizations.CreateOrganizationalUnitOutput, error)
|
||||
CreateOrganizationalUnitRequest(*organizations.CreateOrganizationalUnitInput) (*request.Request, *organizations.CreateOrganizationalUnitOutput)
|
||||
|
||||
CreatePolicy(*organizations.CreatePolicyInput) (*organizations.CreatePolicyOutput, error)
|
||||
CreatePolicyWithContext(aws.Context, *organizations.CreatePolicyInput, ...request.Option) (*organizations.CreatePolicyOutput, error)
|
||||
CreatePolicyRequest(*organizations.CreatePolicyInput) (*request.Request, *organizations.CreatePolicyOutput)
|
||||
|
||||
DeclineHandshake(*organizations.DeclineHandshakeInput) (*organizations.DeclineHandshakeOutput, error)
|
||||
DeclineHandshakeWithContext(aws.Context, *organizations.DeclineHandshakeInput, ...request.Option) (*organizations.DeclineHandshakeOutput, error)
|
||||
DeclineHandshakeRequest(*organizations.DeclineHandshakeInput) (*request.Request, *organizations.DeclineHandshakeOutput)
|
||||
|
||||
DeleteOrganization(*organizations.DeleteOrganizationInput) (*organizations.DeleteOrganizationOutput, error)
|
||||
DeleteOrganizationWithContext(aws.Context, *organizations.DeleteOrganizationInput, ...request.Option) (*organizations.DeleteOrganizationOutput, error)
|
||||
DeleteOrganizationRequest(*organizations.DeleteOrganizationInput) (*request.Request, *organizations.DeleteOrganizationOutput)
|
||||
|
||||
DeleteOrganizationalUnit(*organizations.DeleteOrganizationalUnitInput) (*organizations.DeleteOrganizationalUnitOutput, error)
|
||||
DeleteOrganizationalUnitWithContext(aws.Context, *organizations.DeleteOrganizationalUnitInput, ...request.Option) (*organizations.DeleteOrganizationalUnitOutput, error)
|
||||
DeleteOrganizationalUnitRequest(*organizations.DeleteOrganizationalUnitInput) (*request.Request, *organizations.DeleteOrganizationalUnitOutput)
|
||||
|
||||
DeletePolicy(*organizations.DeletePolicyInput) (*organizations.DeletePolicyOutput, error)
|
||||
DeletePolicyWithContext(aws.Context, *organizations.DeletePolicyInput, ...request.Option) (*organizations.DeletePolicyOutput, error)
|
||||
DeletePolicyRequest(*organizations.DeletePolicyInput) (*request.Request, *organizations.DeletePolicyOutput)
|
||||
|
||||
DescribeAccount(*organizations.DescribeAccountInput) (*organizations.DescribeAccountOutput, error)
|
||||
DescribeAccountWithContext(aws.Context, *organizations.DescribeAccountInput, ...request.Option) (*organizations.DescribeAccountOutput, error)
|
||||
DescribeAccountRequest(*organizations.DescribeAccountInput) (*request.Request, *organizations.DescribeAccountOutput)
|
||||
|
||||
DescribeCreateAccountStatus(*organizations.DescribeCreateAccountStatusInput) (*organizations.DescribeCreateAccountStatusOutput, error)
|
||||
DescribeCreateAccountStatusWithContext(aws.Context, *organizations.DescribeCreateAccountStatusInput, ...request.Option) (*organizations.DescribeCreateAccountStatusOutput, error)
|
||||
DescribeCreateAccountStatusRequest(*organizations.DescribeCreateAccountStatusInput) (*request.Request, *organizations.DescribeCreateAccountStatusOutput)
|
||||
|
||||
DescribeHandshake(*organizations.DescribeHandshakeInput) (*organizations.DescribeHandshakeOutput, error)
|
||||
DescribeHandshakeWithContext(aws.Context, *organizations.DescribeHandshakeInput, ...request.Option) (*organizations.DescribeHandshakeOutput, error)
|
||||
DescribeHandshakeRequest(*organizations.DescribeHandshakeInput) (*request.Request, *organizations.DescribeHandshakeOutput)
|
||||
|
||||
DescribeOrganization(*organizations.DescribeOrganizationInput) (*organizations.DescribeOrganizationOutput, error)
|
||||
DescribeOrganizationWithContext(aws.Context, *organizations.DescribeOrganizationInput, ...request.Option) (*organizations.DescribeOrganizationOutput, error)
|
||||
DescribeOrganizationRequest(*organizations.DescribeOrganizationInput) (*request.Request, *organizations.DescribeOrganizationOutput)
|
||||
|
||||
DescribeOrganizationalUnit(*organizations.DescribeOrganizationalUnitInput) (*organizations.DescribeOrganizationalUnitOutput, error)
|
||||
DescribeOrganizationalUnitWithContext(aws.Context, *organizations.DescribeOrganizationalUnitInput, ...request.Option) (*organizations.DescribeOrganizationalUnitOutput, error)
|
||||
DescribeOrganizationalUnitRequest(*organizations.DescribeOrganizationalUnitInput) (*request.Request, *organizations.DescribeOrganizationalUnitOutput)
|
||||
|
||||
DescribePolicy(*organizations.DescribePolicyInput) (*organizations.DescribePolicyOutput, error)
|
||||
DescribePolicyWithContext(aws.Context, *organizations.DescribePolicyInput, ...request.Option) (*organizations.DescribePolicyOutput, error)
|
||||
DescribePolicyRequest(*organizations.DescribePolicyInput) (*request.Request, *organizations.DescribePolicyOutput)
|
||||
|
||||
DetachPolicy(*organizations.DetachPolicyInput) (*organizations.DetachPolicyOutput, error)
|
||||
DetachPolicyWithContext(aws.Context, *organizations.DetachPolicyInput, ...request.Option) (*organizations.DetachPolicyOutput, error)
|
||||
DetachPolicyRequest(*organizations.DetachPolicyInput) (*request.Request, *organizations.DetachPolicyOutput)
|
||||
|
||||
DisablePolicyType(*organizations.DisablePolicyTypeInput) (*organizations.DisablePolicyTypeOutput, error)
|
||||
DisablePolicyTypeWithContext(aws.Context, *organizations.DisablePolicyTypeInput, ...request.Option) (*organizations.DisablePolicyTypeOutput, error)
|
||||
DisablePolicyTypeRequest(*organizations.DisablePolicyTypeInput) (*request.Request, *organizations.DisablePolicyTypeOutput)
|
||||
|
||||
EnableAllFeatures(*organizations.EnableAllFeaturesInput) (*organizations.EnableAllFeaturesOutput, error)
|
||||
EnableAllFeaturesWithContext(aws.Context, *organizations.EnableAllFeaturesInput, ...request.Option) (*organizations.EnableAllFeaturesOutput, error)
|
||||
EnableAllFeaturesRequest(*organizations.EnableAllFeaturesInput) (*request.Request, *organizations.EnableAllFeaturesOutput)
|
||||
|
||||
EnablePolicyType(*organizations.EnablePolicyTypeInput) (*organizations.EnablePolicyTypeOutput, error)
|
||||
EnablePolicyTypeWithContext(aws.Context, *organizations.EnablePolicyTypeInput, ...request.Option) (*organizations.EnablePolicyTypeOutput, error)
|
||||
EnablePolicyTypeRequest(*organizations.EnablePolicyTypeInput) (*request.Request, *organizations.EnablePolicyTypeOutput)
|
||||
|
||||
InviteAccountToOrganization(*organizations.InviteAccountToOrganizationInput) (*organizations.InviteAccountToOrganizationOutput, error)
|
||||
InviteAccountToOrganizationWithContext(aws.Context, *organizations.InviteAccountToOrganizationInput, ...request.Option) (*organizations.InviteAccountToOrganizationOutput, error)
|
||||
InviteAccountToOrganizationRequest(*organizations.InviteAccountToOrganizationInput) (*request.Request, *organizations.InviteAccountToOrganizationOutput)
|
||||
|
||||
LeaveOrganization(*organizations.LeaveOrganizationInput) (*organizations.LeaveOrganizationOutput, error)
|
||||
LeaveOrganizationWithContext(aws.Context, *organizations.LeaveOrganizationInput, ...request.Option) (*organizations.LeaveOrganizationOutput, error)
|
||||
LeaveOrganizationRequest(*organizations.LeaveOrganizationInput) (*request.Request, *organizations.LeaveOrganizationOutput)
|
||||
|
||||
ListAccounts(*organizations.ListAccountsInput) (*organizations.ListAccountsOutput, error)
|
||||
ListAccountsWithContext(aws.Context, *organizations.ListAccountsInput, ...request.Option) (*organizations.ListAccountsOutput, error)
|
||||
ListAccountsRequest(*organizations.ListAccountsInput) (*request.Request, *organizations.ListAccountsOutput)
|
||||
|
||||
ListAccountsForParent(*organizations.ListAccountsForParentInput) (*organizations.ListAccountsForParentOutput, error)
|
||||
ListAccountsForParentWithContext(aws.Context, *organizations.ListAccountsForParentInput, ...request.Option) (*organizations.ListAccountsForParentOutput, error)
|
||||
ListAccountsForParentRequest(*organizations.ListAccountsForParentInput) (*request.Request, *organizations.ListAccountsForParentOutput)
|
||||
|
||||
ListChildren(*organizations.ListChildrenInput) (*organizations.ListChildrenOutput, error)
|
||||
ListChildrenWithContext(aws.Context, *organizations.ListChildrenInput, ...request.Option) (*organizations.ListChildrenOutput, error)
|
||||
ListChildrenRequest(*organizations.ListChildrenInput) (*request.Request, *organizations.ListChildrenOutput)
|
||||
|
||||
ListCreateAccountStatus(*organizations.ListCreateAccountStatusInput) (*organizations.ListCreateAccountStatusOutput, error)
|
||||
ListCreateAccountStatusWithContext(aws.Context, *organizations.ListCreateAccountStatusInput, ...request.Option) (*organizations.ListCreateAccountStatusOutput, error)
|
||||
ListCreateAccountStatusRequest(*organizations.ListCreateAccountStatusInput) (*request.Request, *organizations.ListCreateAccountStatusOutput)
|
||||
|
||||
ListHandshakesForAccount(*organizations.ListHandshakesForAccountInput) (*organizations.ListHandshakesForAccountOutput, error)
|
||||
ListHandshakesForAccountWithContext(aws.Context, *organizations.ListHandshakesForAccountInput, ...request.Option) (*organizations.ListHandshakesForAccountOutput, error)
|
||||
ListHandshakesForAccountRequest(*organizations.ListHandshakesForAccountInput) (*request.Request, *organizations.ListHandshakesForAccountOutput)
|
||||
|
||||
ListHandshakesForOrganization(*organizations.ListHandshakesForOrganizationInput) (*organizations.ListHandshakesForOrganizationOutput, error)
|
||||
ListHandshakesForOrganizationWithContext(aws.Context, *organizations.ListHandshakesForOrganizationInput, ...request.Option) (*organizations.ListHandshakesForOrganizationOutput, error)
|
||||
ListHandshakesForOrganizationRequest(*organizations.ListHandshakesForOrganizationInput) (*request.Request, *organizations.ListHandshakesForOrganizationOutput)
|
||||
|
||||
ListOrganizationalUnitsForParent(*organizations.ListOrganizationalUnitsForParentInput) (*organizations.ListOrganizationalUnitsForParentOutput, error)
|
||||
ListOrganizationalUnitsForParentWithContext(aws.Context, *organizations.ListOrganizationalUnitsForParentInput, ...request.Option) (*organizations.ListOrganizationalUnitsForParentOutput, error)
|
||||
ListOrganizationalUnitsForParentRequest(*organizations.ListOrganizationalUnitsForParentInput) (*request.Request, *organizations.ListOrganizationalUnitsForParentOutput)
|
||||
|
||||
ListParents(*organizations.ListParentsInput) (*organizations.ListParentsOutput, error)
|
||||
ListParentsWithContext(aws.Context, *organizations.ListParentsInput, ...request.Option) (*organizations.ListParentsOutput, error)
|
||||
ListParentsRequest(*organizations.ListParentsInput) (*request.Request, *organizations.ListParentsOutput)
|
||||
|
||||
ListPolicies(*organizations.ListPoliciesInput) (*organizations.ListPoliciesOutput, error)
|
||||
ListPoliciesWithContext(aws.Context, *organizations.ListPoliciesInput, ...request.Option) (*organizations.ListPoliciesOutput, error)
|
||||
ListPoliciesRequest(*organizations.ListPoliciesInput) (*request.Request, *organizations.ListPoliciesOutput)
|
||||
|
||||
ListPoliciesForTarget(*organizations.ListPoliciesForTargetInput) (*organizations.ListPoliciesForTargetOutput, error)
|
||||
ListPoliciesForTargetWithContext(aws.Context, *organizations.ListPoliciesForTargetInput, ...request.Option) (*organizations.ListPoliciesForTargetOutput, error)
|
||||
ListPoliciesForTargetRequest(*organizations.ListPoliciesForTargetInput) (*request.Request, *organizations.ListPoliciesForTargetOutput)
|
||||
|
||||
ListRoots(*organizations.ListRootsInput) (*organizations.ListRootsOutput, error)
|
||||
ListRootsWithContext(aws.Context, *organizations.ListRootsInput, ...request.Option) (*organizations.ListRootsOutput, error)
|
||||
ListRootsRequest(*organizations.ListRootsInput) (*request.Request, *organizations.ListRootsOutput)
|
||||
|
||||
ListTargetsForPolicy(*organizations.ListTargetsForPolicyInput) (*organizations.ListTargetsForPolicyOutput, error)
|
||||
ListTargetsForPolicyWithContext(aws.Context, *organizations.ListTargetsForPolicyInput, ...request.Option) (*organizations.ListTargetsForPolicyOutput, error)
|
||||
ListTargetsForPolicyRequest(*organizations.ListTargetsForPolicyInput) (*request.Request, *organizations.ListTargetsForPolicyOutput)
|
||||
|
||||
MoveAccount(*organizations.MoveAccountInput) (*organizations.MoveAccountOutput, error)
|
||||
MoveAccountWithContext(aws.Context, *organizations.MoveAccountInput, ...request.Option) (*organizations.MoveAccountOutput, error)
|
||||
MoveAccountRequest(*organizations.MoveAccountInput) (*request.Request, *organizations.MoveAccountOutput)
|
||||
|
||||
RemoveAccountFromOrganization(*organizations.RemoveAccountFromOrganizationInput) (*organizations.RemoveAccountFromOrganizationOutput, error)
|
||||
RemoveAccountFromOrganizationWithContext(aws.Context, *organizations.RemoveAccountFromOrganizationInput, ...request.Option) (*organizations.RemoveAccountFromOrganizationOutput, error)
|
||||
RemoveAccountFromOrganizationRequest(*organizations.RemoveAccountFromOrganizationInput) (*request.Request, *organizations.RemoveAccountFromOrganizationOutput)
|
||||
|
||||
UpdateOrganizationalUnit(*organizations.UpdateOrganizationalUnitInput) (*organizations.UpdateOrganizationalUnitOutput, error)
|
||||
UpdateOrganizationalUnitWithContext(aws.Context, *organizations.UpdateOrganizationalUnitInput, ...request.Option) (*organizations.UpdateOrganizationalUnitOutput, error)
|
||||
UpdateOrganizationalUnitRequest(*organizations.UpdateOrganizationalUnitInput) (*request.Request, *organizations.UpdateOrganizationalUnitOutput)
|
||||
|
||||
UpdatePolicy(*organizations.UpdatePolicyInput) (*organizations.UpdatePolicyOutput, error)
|
||||
UpdatePolicyWithContext(aws.Context, *organizations.UpdatePolicyInput, ...request.Option) (*organizations.UpdatePolicyOutput, error)
|
||||
UpdatePolicyRequest(*organizations.UpdatePolicyInput) (*request.Request, *organizations.UpdatePolicyOutput)
|
||||
}
|
||||
|
||||
var _ OrganizationsAPI = (*organizations.Organizations)(nil)
|
||||
+204
@@ -0,0 +1,204 @@
|
||||
// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
|
||||
|
||||
package organizations
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/client"
|
||||
"github.com/aws/aws-sdk-go/aws/client/metadata"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/aws/signer/v4"
|
||||
"github.com/aws/aws-sdk-go/private/protocol/jsonrpc"
|
||||
)
|
||||
|
||||
// AWS Organizations is a web service that enables you to consolidate your multiple
|
||||
// AWS accounts into an organization and centrally manage your accounts and
|
||||
// their resources.
|
||||
//
|
||||
// This guide provides descriptions of the Organizations API. For more information
|
||||
// about using this service, see the AWS Organizations User Guide (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_introduction.html).
|
||||
//
|
||||
// API Version
|
||||
//
|
||||
// This version of the Organizations API Reference documents the Organizations
|
||||
// API version 2016-11-28.
|
||||
//
|
||||
// As an alternative to using the API directly, you can use one of the AWS SDKs,
|
||||
// which consist of libraries and sample code for various programming languages
|
||||
// and platforms (Java, Ruby, .NET, iOS, Android, and more). The SDKs provide
|
||||
// a convenient way to create programmatic access to AWS Organizations. For
|
||||
// example, the SDKs take care of cryptographically signing requests, managing
|
||||
// errors, and retrying requests automatically. For more information about the
|
||||
// AWS SDKs, including how to download and install them, see Tools for Amazon
|
||||
// Web Services (http://aws.amazon.com/tools/).
|
||||
//
|
||||
// We recommend that you use the AWS SDKs to make programmatic API calls to
|
||||
// Organizations. However, you also can use the Organizations Query API to make
|
||||
// direct calls to the Organizations web service. To learn more about the Organizations
|
||||
// Query API, see Making Query Requests (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_query-requests.html)
|
||||
// in the AWS Organizations User Guide. Organizations supports GET and POST
|
||||
// requests for all actions. That is, the API does not require you to use GET
|
||||
// for some actions and POST for others. However, GET requests are subject to
|
||||
// the limitation size of a URL. Therefore, for operations that require larger
|
||||
// sizes, use a POST request.
|
||||
//
|
||||
// Signing Requests
|
||||
//
|
||||
// When you send HTTP requests to AWS, you must sign the requests so that AWS
|
||||
// can identify who sent them. You sign requests with your AWS access key, which
|
||||
// consists of an access key ID and a secret access key. We strongly recommend
|
||||
// that you do not create an access key for your root account. Anyone who has
|
||||
// the access key for your root account has unrestricted access to all the resources
|
||||
// in your account. Instead, create an access key for an IAM user account that
|
||||
// has administrative privileges. As another option, use AWS Security Token
|
||||
// Service to generate temporary security credentials, and use those credentials
|
||||
// to sign requests.
|
||||
//
|
||||
// To sign requests, we recommend that you use Signature Version 4 (http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html).
|
||||
// If you have an existing application that uses Signature Version 2, you do
|
||||
// not have to update it to use Signature Version 4. However, some operations
|
||||
// now require Signature Version 4. The documentation for operations that require
|
||||
// version 4 indicate this requirement.
|
||||
//
|
||||
// When you use the AWS Command Line Interface (AWS CLI) or one of the AWS SDKs
|
||||
// to make requests to AWS, these tools automatically sign the requests for
|
||||
// you with the access key that you specify when you configure the tools.
|
||||
//
|
||||
// In this release, each organization can have only one root. In a future release,
|
||||
// a single organization will support multiple roots.
|
||||
//
|
||||
// Support and Feedback for AWS Organizations
|
||||
//
|
||||
// We welcome your feedback. Send your comments to feedback-awsorganizations@amazon.com
|
||||
// (mailto:feedback-awsorganizations@amazon.com) or post your feedback and questions
|
||||
// in our private AWS Organizations support forum (http://forums.aws.amazon.com/forum.jspa?forumID=219).
|
||||
// If you don't have access to the forum, send a request for access to the email
|
||||
// address, along with your forum user ID. For more information about the AWS
|
||||
// support forums, see Forums Help (http://forums.aws.amazon.com/help.jspa).
|
||||
//
|
||||
// Endpoint to Call When Using the CLI or the AWS API
|
||||
//
|
||||
// For the current release of Organizations, you must specify the us-east-1
|
||||
// region for all AWS API and CLI calls. You can do this in the CLI by using
|
||||
// these parameters and commands:
|
||||
//
|
||||
// * Use the following parameter with each command to specify both the endpoint
|
||||
// and its region:
|
||||
//
|
||||
// --endpoint-url https://organizations.us-east-1.amazonaws.com
|
||||
//
|
||||
// * Use the default endpoint, but configure your default region with this
|
||||
// command:
|
||||
//
|
||||
// aws configure set default.region us-east-1
|
||||
//
|
||||
// * Use the following parameter with each command to specify the endpoint:
|
||||
//
|
||||
// --region us-east-1
|
||||
//
|
||||
// For the various SDKs used to call the APIs, see the documentation for the
|
||||
// SDK of interest to learn how to direct the requests to a specific endpoint.
|
||||
// For more information, see Regions and Endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html#sts_region)
|
||||
// in the AWS General Reference.
|
||||
//
|
||||
// How examples are presented
|
||||
//
|
||||
// The JSON returned by the AWS Organizations service as response to your requests
|
||||
// is returned as a single long string without line breaks or formatting whitespace.
|
||||
// Both line breaks and whitespace are included in the examples in this guide
|
||||
// to improve readability. When example input parameters also would result in
|
||||
// long strings that would extend beyond the screen, we insert line breaks to
|
||||
// enhance readability. You should always submit the input as a single JSON
|
||||
// text string.
|
||||
//
|
||||
// Recording API Requests
|
||||
//
|
||||
// AWS Organizations supports AWS CloudTrail, a service that records AWS API
|
||||
// calls for your AWS account and delivers log files to an Amazon S3 bucket.
|
||||
// By using information collected by AWS CloudTrail, you can determine which
|
||||
// requests were successfully made to Organizations, who made the request, when
|
||||
// it was made, and so on. For more about AWS Organizations and its support
|
||||
// for AWS CloudTrail, see Logging AWS Organizations Events with AWS CloudTrail
|
||||
// (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_cloudtrail-integration.html)
|
||||
// in the AWS Organizations User Guide. To learn more about CloudTrail, including
|
||||
// how to turn it on and find your log files, see the AWS CloudTrail User Guide
|
||||
// (http://docs.aws.amazon.com/awscloudtrail/latest/userguide/what_is_cloud_trail_top_level.html).
|
||||
// The service client's operations are safe to be used concurrently.
|
||||
// It is not safe to mutate any of the client's properties though.
|
||||
// Please also see https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28
|
||||
type Organizations struct {
|
||||
*client.Client
|
||||
}
|
||||
|
||||
// Used for custom client initialization logic
|
||||
var initClient func(*client.Client)
|
||||
|
||||
// Used for custom request initialization logic
|
||||
var initRequest func(*request.Request)
|
||||
|
||||
// Service information constants
|
||||
const (
|
||||
ServiceName = "organizations" // Service endpoint prefix API calls made to.
|
||||
EndpointsID = ServiceName // Service ID for Regions and Endpoints metadata.
|
||||
)
|
||||
|
||||
// New creates a new instance of the Organizations client with a session.
|
||||
// If additional configuration is needed for the client instance use the optional
|
||||
// aws.Config parameter to add your extra config.
|
||||
//
|
||||
// Example:
|
||||
// // Create a Organizations client from just a session.
|
||||
// svc := organizations.New(mySession)
|
||||
//
|
||||
// // Create a Organizations client with additional configuration
|
||||
// svc := organizations.New(mySession, aws.NewConfig().WithRegion("us-west-2"))
|
||||
func New(p client.ConfigProvider, cfgs ...*aws.Config) *Organizations {
|
||||
c := p.ClientConfig(EndpointsID, cfgs...)
|
||||
return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName)
|
||||
}
|
||||
|
||||
// newClient creates, initializes and returns a new service client instance.
|
||||
func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *Organizations {
|
||||
svc := &Organizations{
|
||||
Client: client.New(
|
||||
cfg,
|
||||
metadata.ClientInfo{
|
||||
ServiceName: ServiceName,
|
||||
SigningName: signingName,
|
||||
SigningRegion: signingRegion,
|
||||
Endpoint: endpoint,
|
||||
APIVersion: "2016-11-28",
|
||||
JSONVersion: "1.1",
|
||||
TargetPrefix: "AWSOrganizationsV20161128",
|
||||
},
|
||||
handlers,
|
||||
),
|
||||
}
|
||||
|
||||
// Handlers
|
||||
svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler)
|
||||
svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler)
|
||||
svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler)
|
||||
svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler)
|
||||
svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler)
|
||||
|
||||
// Run custom client initialization if present
|
||||
if initClient != nil {
|
||||
initClient(svc.Client)
|
||||
}
|
||||
|
||||
return svc
|
||||
}
|
||||
|
||||
// newRequest creates a new request for a Organizations operation and runs any
|
||||
// custom request initialization.
|
||||
func (c *Organizations) newRequest(op *request.Operation, params, data interface{}) *request.Request {
|
||||
req := c.NewRequest(op, params, data)
|
||||
|
||||
// Run custom request initialization if present
|
||||
if initRequest != nil {
|
||||
initRequest(req)
|
||||
}
|
||||
|
||||
return req
|
||||
}
|
||||
Reference in New Issue
Block a user