describeHomeRegionControls method

Future<DescribeHomeRegionControlsResult> describeHomeRegionControls({
  1. String? controlId,
  2. String? homeRegion,
  3. int? maxResults,
  4. String? nextToken,
  5. Target? target,
})

This API permits filtering on the ControlId and HomeRegion fields.

May throw InternalServerError. May throw ServiceUnavailableException. May throw AccessDeniedException. May throw ThrottlingException. May throw InvalidInputException.

Parameter controlId : The ControlID is a unique identifier string of your HomeRegionControl object.

Parameter homeRegion : The name of the home region you'd like to view.

Parameter maxResults : The maximum number of filtering results to display per page.

Parameter nextToken : If a NextToken was returned by a previous call, more results are available. To retrieve the next page of results, make the call again using the returned token in NextToken.

Parameter target : The target parameter specifies the identifier to which the home region is applied, which is always of type ACCOUNT. It applies the home region to the current ACCOUNT.

Implementation

Future<DescribeHomeRegionControlsResult> describeHomeRegionControls({
  String? controlId,
  String? homeRegion,
  int? maxResults,
  String? nextToken,
  Target? target,
}) async {
  _s.validateStringLength(
    'controlId',
    controlId,
    1,
    50,
  );
  _s.validateStringLength(
    'homeRegion',
    homeRegion,
    1,
    50,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    0,
    2048,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target':
        'AWSMigrationHubMultiAccountService.DescribeHomeRegionControls'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (controlId != null) 'ControlId': controlId,
      if (homeRegion != null) 'HomeRegion': homeRegion,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (target != null) 'Target': target,
    },
  );

  return DescribeHomeRegionControlsResult.fromJson(jsonResponse.body);
}