getOriginRequestPolicy2020_05_31 method

Future<GetOriginRequestPolicyResult> getOriginRequestPolicy2020_05_31({
  1. required String id,
})

Gets an origin request policy, including the following metadata:

  • The policy’s identifier.
  • The date and time when the policy was last modified.
To get an origin request policy, you must provide the policy’s identifier. If the origin request policy is attached to a distribution’s cache behavior, you can get the policy’s identifier using ListDistributions or GetDistribution. If the origin request policy is not attached to a cache behavior, you can get the identifier using ListOriginRequestPolicies.

May throw AccessDenied. May throw NoSuchOriginRequestPolicy.

Parameter id : The unique identifier for the origin request policy. If the origin request policy is attached to a distribution’s cache behavior, you can get the policy’s identifier using ListDistributions or GetDistribution. If the origin request policy is not attached to a cache behavior, you can get the identifier using ListOriginRequestPolicies.

Implementation

Future<GetOriginRequestPolicyResult> getOriginRequestPolicy2020_05_31({
  required String id,
}) async {
  ArgumentError.checkNotNull(id, 'id');
  final $result = await _protocol.sendRaw(
    method: 'GET',
    requestUri:
        '/2020-05-31/origin-request-policy/${Uri.encodeComponent(id)}',
    exceptionFnMap: _exceptionFns,
  );
  final $elem = await _s.xmlFromResponse($result);
  return GetOriginRequestPolicyResult(
    originRequestPolicy: OriginRequestPolicy.fromXml($elem),
    eTag: _s.extractHeaderStringValue($result.headers, 'ETag'),
  );
}