describeRegion method

Future<DescribeRegionResponse> describeRegion({
  1. required String instanceArn,
  2. required String regionName,
})

Retrieves details about a specific Region enabled in an IAM Identity Center instance. Details include the Region name, current status (ACTIVE, ADDING, or REMOVING), the date when the Region was added, and whether it is the primary Region. The request must be made from one of the enabled Regions of the IAM Identity Center instance.

The following actions are related to DescribeRegion:

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

Parameter instanceArn : The Amazon Resource Name (ARN) of the IAM Identity Center instance.

Parameter regionName : The name of the Amazon Web Services Region to retrieve information about. The Region name must be 1-32 characters long and follow the pattern of Amazon Web Services Region names (for example, us-east-1).

Implementation

Future<DescribeRegionResponse> describeRegion({
  required String instanceArn,
  required String regionName,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SWBExternalService.DescribeRegion'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'InstanceArn': instanceArn,
      'RegionName': regionName,
    },
  );

  return DescribeRegionResponse.fromJson(jsonResponse.body);
}