listDomainUnitsForParent method

Future<ListDomainUnitsForParentOutput> listDomainUnitsForParent({
  1. required String domainIdentifier,
  2. required String parentDomainUnitIdentifier,
  3. int? maxResults,
  4. String? nextToken,
})

Lists child domain units for the specified parent domain unit.

May throw AccessDeniedException. May throw InternalServerException. May throw ThrottlingException. May throw ValidationException.

Parameter domainIdentifier : The ID of the domain in which you want to list domain units for a parent domain unit.

Parameter parentDomainUnitIdentifier : The ID of the parent domain unit.

Parameter maxResults : The maximum number of domain units to return in a single call to ListDomainUnitsForParent. When the number of domain units to be listed is greater than the value of MaxResults, the response contains a NextToken value that you can use in a subsequent call to ListDomainUnitsForParent to list the next set of domain units.

Parameter nextToken : When the number of domain units is greater than the default value for the MaxResults parameter, or if you explicitly specify a value for MaxResults that is less than the number of domain units, the response includes a pagination token named NextToken. You can specify this NextToken value in a subsequent call to ListDomainUnitsForParent to list the next set of domain units.

Implementation

Future<ListDomainUnitsForParentOutput> listDomainUnitsForParent({
  required String domainIdentifier,
  required String parentDomainUnitIdentifier,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    25,
  );
  final $query = <String, List<String>>{
    'parentDomainUnitIdentifier': [parentDomainUnitIdentifier],
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/v2/domains/${Uri.encodeComponent(domainIdentifier)}/domain-units',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListDomainUnitsForParentOutput.fromJson(response);
}