OrganizationsClient#
Index > Organizations > OrganizationsClient
Auto-generated documentation for Organizations type annotations stubs module mypy-boto3-organizations.
OrganizationsClient#
Type annotations and code completion for boto3.client("organizations")
.
boto3 documentation
# OrganizationsClient usage example
from boto3.session import Session
from mypy_boto3_organizations.client import OrganizationsClient
def get_organizations_client() -> OrganizationsClient:
return Session().client("organizations")
Exceptions#
boto3
client exceptions are generated in runtime.
This class provides code completion for boto3.client("organizations").exceptions
structure.
# Exceptions.exceptions usage example
client = boto3.client("organizations")
try:
do_something(client)
except (
client.exceptions.AWSOrganizationsNotInUseException,
client.exceptions.AccessDeniedException,
client.exceptions.AccessDeniedForDependencyException,
client.exceptions.AccountAlreadyClosedException,
client.exceptions.AccountAlreadyRegisteredException,
client.exceptions.AccountNotFoundException,
client.exceptions.AccountNotRegisteredException,
client.exceptions.AccountOwnerNotVerifiedException,
client.exceptions.AlreadyInOrganizationException,
client.exceptions.ChildNotFoundException,
client.exceptions.ClientError,
client.exceptions.ConcurrentModificationException,
client.exceptions.ConflictException,
client.exceptions.ConstraintViolationException,
client.exceptions.CreateAccountStatusNotFoundException,
client.exceptions.DestinationParentNotFoundException,
client.exceptions.DuplicateAccountException,
client.exceptions.DuplicateHandshakeException,
client.exceptions.DuplicateOrganizationalUnitException,
client.exceptions.DuplicatePolicyAttachmentException,
client.exceptions.DuplicatePolicyException,
client.exceptions.EffectivePolicyNotFoundException,
client.exceptions.FinalizingOrganizationException,
client.exceptions.HandshakeAlreadyInStateException,
client.exceptions.HandshakeConstraintViolationException,
client.exceptions.HandshakeNotFoundException,
client.exceptions.InvalidHandshakeTransitionException,
client.exceptions.InvalidInputException,
client.exceptions.MalformedPolicyDocumentException,
client.exceptions.MasterCannotLeaveOrganizationException,
client.exceptions.OrganizationNotEmptyException,
client.exceptions.OrganizationalUnitNotEmptyException,
client.exceptions.OrganizationalUnitNotFoundException,
client.exceptions.ParentNotFoundException,
client.exceptions.PolicyChangesInProgressException,
client.exceptions.PolicyInUseException,
client.exceptions.PolicyNotAttachedException,
client.exceptions.PolicyNotFoundException,
client.exceptions.PolicyTypeAlreadyEnabledException,
client.exceptions.PolicyTypeNotAvailableForOrganizationException,
client.exceptions.PolicyTypeNotEnabledException,
client.exceptions.ResourcePolicyNotFoundException,
client.exceptions.RootNotFoundException,
client.exceptions.ServiceException,
client.exceptions.SourceParentNotFoundException,
client.exceptions.TargetNotFoundException,
client.exceptions.TooManyRequestsException,
client.exceptions.UnsupportedAPIEndpointException,
) as e:
print(e)
# Exceptions.exceptions type checking example
from mypy_boto3_organizations.client import Exceptions
def handle_error(exc: Exceptions.AWSOrganizationsNotInUseException) -> None:
...
Methods#
accept_handshake#
Sends a response to the originator of a handshake agreeing to the action proposed by the handshake request.
Type annotations and code completion for boto3.client("organizations").accept_handshake
method.
boto3 documentation
# accept_handshake method definition
def accept_handshake(
self,
*,
HandshakeId: str,
) -> AcceptHandshakeResponseTypeDef: # (1)
...
# accept_handshake method usage example with argument unpacking
kwargs: AcceptHandshakeRequestRequestTypeDef = { # (1)
"HandshakeId": ...,
}
parent.accept_handshake(**kwargs)
attach_policy#
Attaches a policy to a root, an organizational unit (OU), or an individual account.
Type annotations and code completion for boto3.client("organizations").attach_policy
method.
boto3 documentation
# attach_policy method definition
def attach_policy(
self,
*,
PolicyId: str,
TargetId: str,
) -> EmptyResponseMetadataTypeDef: # (1)
...
# attach_policy method usage example with argument unpacking
kwargs: AttachPolicyRequestRequestTypeDef = { # (1)
"PolicyId": ...,
"TargetId": ...,
}
parent.attach_policy(**kwargs)
can_paginate#
Check if an operation can be paginated.
Type annotations and code completion for boto3.client("organizations").can_paginate
method.
boto3 documentation
# can_paginate method definition
def can_paginate(
self,
operation_name: str,
) -> bool:
...
cancel_handshake#
Cancels a handshake.
Type annotations and code completion for boto3.client("organizations").cancel_handshake
method.
boto3 documentation
# cancel_handshake method definition
def cancel_handshake(
self,
*,
HandshakeId: str,
) -> CancelHandshakeResponseTypeDef: # (1)
...
# cancel_handshake method usage example with argument unpacking
kwargs: CancelHandshakeRequestRequestTypeDef = { # (1)
"HandshakeId": ...,
}
parent.cancel_handshake(**kwargs)
close#
Closes underlying endpoint connections.
Type annotations and code completion for boto3.client("organizations").close
method.
boto3 documentation
# close method definition
def close(
self,
) -> None:
...
close_account#
Closes an Amazon Web Services member account within an organization.
Type annotations and code completion for boto3.client("organizations").close_account
method.
boto3 documentation
# close_account method definition
def close_account(
self,
*,
AccountId: str,
) -> EmptyResponseMetadataTypeDef: # (1)
...
# close_account method usage example with argument unpacking
kwargs: CloseAccountRequestRequestTypeDef = { # (1)
"AccountId": ...,
}
parent.close_account(**kwargs)
create_account#
Creates an Amazon Web Services account that is automatically a member of the organization whose credentials made the request.
Type annotations and code completion for boto3.client("organizations").create_account
method.
boto3 documentation
# create_account method definition
def create_account(
self,
*,
Email: str,
AccountName: str,
RoleName: str = ...,
IamUserAccessToBilling: IAMUserAccessToBillingType = ..., # (1)
Tags: Sequence[TagTypeDef] = ..., # (2)
) -> CreateAccountResponseTypeDef: # (3)
...
# create_account method usage example with argument unpacking
kwargs: CreateAccountRequestRequestTypeDef = { # (1)
"Email": ...,
"AccountName": ...,
}
parent.create_account(**kwargs)
create_gov_cloud_account#
This action is available if all of the following are true: * You're authorized to create accounts in the Amazon Web Services GovCloud (US) Region.
Type annotations and code completion for boto3.client("organizations").create_gov_cloud_account
method.
boto3 documentation
# create_gov_cloud_account method definition
def create_gov_cloud_account(
self,
*,
Email: str,
AccountName: str,
RoleName: str = ...,
IamUserAccessToBilling: IAMUserAccessToBillingType = ..., # (1)
Tags: Sequence[TagTypeDef] = ..., # (2)
) -> CreateGovCloudAccountResponseTypeDef: # (3)
...
# create_gov_cloud_account method usage example with argument unpacking
kwargs: CreateGovCloudAccountRequestRequestTypeDef = { # (1)
"Email": ...,
"AccountName": ...,
}
parent.create_gov_cloud_account(**kwargs)
create_organization#
Creates an Amazon Web Services organization.
Type annotations and code completion for boto3.client("organizations").create_organization
method.
boto3 documentation
# create_organization method definition
def create_organization(
self,
*,
FeatureSet: OrganizationFeatureSetType = ..., # (1)
) -> CreateOrganizationResponseTypeDef: # (2)
...
# create_organization method usage example with argument unpacking
kwargs: CreateOrganizationRequestRequestTypeDef = { # (1)
"FeatureSet": ...,
}
parent.create_organization(**kwargs)
create_organizational_unit#
Creates an organizational unit (OU) within a root or parent OU.
Type annotations and code completion for boto3.client("organizations").create_organizational_unit
method.
boto3 documentation
# create_organizational_unit method definition
def create_organizational_unit(
self,
*,
ParentId: str,
Name: str,
Tags: Sequence[TagTypeDef] = ..., # (1)
) -> CreateOrganizationalUnitResponseTypeDef: # (2)
...
# create_organizational_unit method usage example with argument unpacking
kwargs: CreateOrganizationalUnitRequestRequestTypeDef = { # (1)
"ParentId": ...,
"Name": ...,
}
parent.create_organizational_unit(**kwargs)
create_policy#
Creates a policy of a specified type that you can attach to a root, an organizational unit (OU), or an individual Amazon Web Services account.
Type annotations and code completion for boto3.client("organizations").create_policy
method.
boto3 documentation
# create_policy method definition
def create_policy(
self,
*,
Content: str,
Description: str,
Name: str,
Type: PolicyTypeType, # (1)
Tags: Sequence[TagTypeDef] = ..., # (2)
) -> CreatePolicyResponseTypeDef: # (3)
...
- See PolicyTypeType
- See TagTypeDef
- See CreatePolicyResponseTypeDef
# create_policy method usage example with argument unpacking
kwargs: CreatePolicyRequestRequestTypeDef = { # (1)
"Content": ...,
"Description": ...,
"Name": ...,
"Type": ...,
}
parent.create_policy(**kwargs)
decline_handshake#
Declines a handshake request.
Type annotations and code completion for boto3.client("organizations").decline_handshake
method.
boto3 documentation
# decline_handshake method definition
def decline_handshake(
self,
*,
HandshakeId: str,
) -> DeclineHandshakeResponseTypeDef: # (1)
...
# decline_handshake method usage example with argument unpacking
kwargs: DeclineHandshakeRequestRequestTypeDef = { # (1)
"HandshakeId": ...,
}
parent.decline_handshake(**kwargs)
delete_organization#
Deletes the organization.
Type annotations and code completion for boto3.client("organizations").delete_organization
method.
boto3 documentation
# delete_organization method definition
def delete_organization(
self,
) -> EmptyResponseMetadataTypeDef: # (1)
...
delete_organizational_unit#
Deletes an organizational unit (OU) from a root or another OU.
Type annotations and code completion for boto3.client("organizations").delete_organizational_unit
method.
boto3 documentation
# delete_organizational_unit method definition
def delete_organizational_unit(
self,
*,
OrganizationalUnitId: str,
) -> EmptyResponseMetadataTypeDef: # (1)
...
# delete_organizational_unit method usage example with argument unpacking
kwargs: DeleteOrganizationalUnitRequestRequestTypeDef = { # (1)
"OrganizationalUnitId": ...,
}
parent.delete_organizational_unit(**kwargs)