describeProtection method

Future<DescribeProtectionResponse> describeProtection({
  1. String? protectionId,
  2. String? resourceArn,
})

Lists the details of a Protection object.

May throw InternalErrorException. May throw InvalidParameterException. May throw ResourceNotFoundException.

Parameter protectionId : The unique identifier (ID) for the Protection object to describe. You must provide either the ResourceArn of the protected resource or the ProtectionID of the protection, but not both.

Parameter resourceArn : The ARN (Amazon Resource Name) of the protected Amazon Web Services resource. You must provide either the ResourceArn of the protected resource or the ProtectionID of the protection, but not both.

Implementation

Future<DescribeProtectionResponse> describeProtection({
  String? protectionId,
  String? resourceArn,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSShield_20160616.DescribeProtection'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (protectionId != null) 'ProtectionId': protectionId,
      if (resourceArn != null) 'ResourceArn': resourceArn,
    },
  );

  return DescribeProtectionResponse.fromJson(jsonResponse.body);
}