getCachePolicy2020_05_31 method
Gets a cache policy, including the following metadata:
- The policy’s identifier.
- The date and time when the policy was last modified.
ListDistributions
or
GetDistribution
. If the cache policy is not attached to a
cache behavior, you can get the identifier using
ListCachePolicies
.
May throw AccessDenied. May throw NoSuchCachePolicy.
Parameter id
:
The unique identifier for the cache policy. If the cache policy is
attached to a distribution’s cache behavior, you can get the policy’s
identifier using ListDistributions
or
GetDistribution
. If the cache policy is not attached to a
cache behavior, you can get the identifier using
ListCachePolicies
.
Implementation
Future<GetCachePolicyResult> getCachePolicy2020_05_31({
required String id,
}) async {
ArgumentError.checkNotNull(id, 'id');
final $result = await _protocol.sendRaw(
method: 'GET',
requestUri: '/2020-05-31/cache-policy/${Uri.encodeComponent(id)}',
exceptionFnMap: _exceptionFns,
);
final $elem = await _s.xmlFromResponse($result);
return GetCachePolicyResult(
cachePolicy: CachePolicy.fromXml($elem),
eTag: _s.extractHeaderStringValue($result.headers, 'ETag'),
);
}