describeResource method

Future<DescribeResourceResponse> describeResource({
  1. required String organizationId,
  2. required String resourceId,
})

Returns the data available for the resource.

May throw EntityNotFoundException. May throw InvalidParameterException. May throw OrganizationNotFoundException. May throw OrganizationStateException. May throw UnsupportedOperationException.

Parameter organizationId : The identifier associated with the organization for which the resource is described.

Parameter resourceId : The identifier of the resource to be described.

The identifier can accept ResourceId, Resourcename, or email. The following identity formats are available:

  • Resource ID: r-0123456789a0123456789b0123456789
  • Email address: resource@domain.tld
  • Resource name: resource

Implementation

Future<DescribeResourceResponse> describeResource({
  required String organizationId,
  required String resourceId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'WorkMailService.DescribeResource'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'OrganizationId': organizationId,
      'ResourceId': resourceId,
    },
  );

  return DescribeResourceResponse.fromJson(jsonResponse.body);
}