Skip to content

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)
    ...
  1. See AcceptHandshakeResponseTypeDef
# accept_handshake method usage example with argument unpacking

kwargs: AcceptHandshakeRequestRequestTypeDef = {  # (1)
    "HandshakeId": ...,
}

parent.accept_handshake(**kwargs)
  1. See AcceptHandshakeRequestRequestTypeDef

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)
    ...
  1. See EmptyResponseMetadataTypeDef
# attach_policy method usage example with argument unpacking

kwargs: AttachPolicyRequestRequestTypeDef = {  # (1)
    "PolicyId": ...,
    "TargetId": ...,
}

parent.attach_policy(**kwargs)
  1. See AttachPolicyRequestRequestTypeDef

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)
    ...
  1. See CancelHandshakeResponseTypeDef
# cancel_handshake method usage example with argument unpacking

kwargs: CancelHandshakeRequestRequestTypeDef = {  # (1)
    "HandshakeId": ...,
}

parent.cancel_handshake(**kwargs)
  1. See CancelHandshakeRequestRequestTypeDef

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