getResponseHeadersPolicy method

Future<GetResponseHeadersPolicyResult> getResponseHeadersPolicy({
  1. required String id,
})

Gets a response headers policy, including metadata (the policy's identifier and the date and time when the policy was last modified).

To get a response headers policy, you must provide the policy's identifier. If the response headers policy is attached to a distribution's cache behavior, you can get the policy's identifier using ListDistributions or GetDistribution. If the response headers policy is not attached to a cache behavior, you can get the identifier using ListResponseHeadersPolicies.

May throw AccessDenied. May throw NoSuchResponseHeadersPolicy.

Parameter id : The identifier for the response headers policy.

If the response headers policy is attached to a distribution's cache behavior, you can get the policy's identifier using ListDistributions or GetDistribution. If the response headers policy is not attached to a cache behavior, you can get the identifier using ListResponseHeadersPolicies.

Implementation

Future<GetResponseHeadersPolicyResult> getResponseHeadersPolicy({
  required String id,
}) async {
  final $result = await _protocol.sendRaw(
    method: 'GET',
    requestUri:
        '/2020-05-31/response-headers-policy/${Uri.encodeComponent(id)}',
    exceptionFnMap: _exceptionFns,
  );
  final $elem = await _s.xmlFromResponse($result);
  return GetResponseHeadersPolicyResult(
    responseHeadersPolicy: ResponseHeadersPolicy.fromXml($elem),
    eTag: _s.extractHeaderStringValue($result.headers, 'ETag'),
  );
}