describeOrganizationalUnit method

Future<DescribeOrganizationalUnitResponse> describeOrganizationalUnit({
  1. required String organizationalUnitId,
})

Retrieves information about an organizational unit (OU).

You can only call this operation from the management account or a member account that is a delegated administrator.

May throw AccessDeniedException. May throw AWSOrganizationsNotInUseException. May throw InvalidInputException. May throw OrganizationalUnitNotFoundException. May throw ServiceException. May throw TooManyRequestsException.

Parameter organizationalUnitId : ID for the organizational unit that you want details about. You can get the ID from the ListOrganizationalUnitsForParent operation.

The regex pattern for an organizational unit ID string requires "ou-" followed by from 4 to 32 lowercase letters or digits (the ID of the root that contains the OU). This string is followed by a second "-" dash and from 8 to 32 additional lowercase letters or digits.

Implementation

Future<DescribeOrganizationalUnitResponse> describeOrganizationalUnit({
  required String organizationalUnitId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSOrganizationsV20161128.DescribeOrganizationalUnit'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'OrganizationalUnitId': organizationalUnitId,
    },
  );

  return DescribeOrganizationalUnitResponse.fromJson(jsonResponse.body);
}