getGuardrail method

Future<GetGuardrailResponse> getGuardrail({
  1. required String guardrailIdentifier,
  2. String? guardrailVersion,
})

Gets details about a guardrail. If you don't specify a version, the response returns details for the DRAFT version.

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

Parameter guardrailIdentifier : The unique identifier of the guardrail for which to get details. This can be an ID or the ARN.

Parameter guardrailVersion : The version of the guardrail for which to get details. If you don't specify a version, the response returns details for the DRAFT version.

Implementation

Future<GetGuardrailResponse> getGuardrail({
  required String guardrailIdentifier,
  String? guardrailVersion,
}) async {
  final $query = <String, List<String>>{
    if (guardrailVersion != null) 'guardrailVersion': [guardrailVersion],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/guardrails/${Uri.encodeComponent(guardrailIdentifier)}',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return GetGuardrailResponse.fromJson(response);
}