Gets a list of response headers policies.
You can optionally apply a filter to get only the managed policies created by Amazon Web Services, or only the custom policies created in your Amazon Web Services account.
You can optionally specify the maximum number of items to receive in the response. If the total number of items in the list exceeds the maximum that you specify, or the default maximum, the response is paginated. To get the next page of items, send a subsequent request that specifies the NextMarker value from the current response as the Marker value in the subsequent request.
Parameters:
-
type
(Optional[ResponseHeadersPolicyType], default:
None
)
–
A filter to get only the specified kind of response headers policies. Valid values are:
-
marker
(Optional[string], default:
None
)
–
Use this field when paginating results to indicate where to begin in your list of response headers policies. The response includes response headers policies in the list that occur after the marker. To get the next page of the list, set this field's value to the value of NextMarker from the current page's response.
-
max_items
(Optional[integer], default:
None
)
–
The maximum number of response headers policies that you want to get in the response.
Raises:
Source code in docs_src/capo_cloudfront/_services/async_cloud_front.py
| async def list_response_headers_policies(
self,
*,
config_overrides: Optional[AsyncCloudFrontClientConfig] = None,
type: Optional[
"capo_cloudfront.types.response_headers_policy_type.ResponseHeadersPolicyType"
] = None,
marker: Optional["capo_cloudfront.types.string.string"] = None,
max_items: Optional["capo_cloudfront.types.integer.integer"] = None,
) -> "capo_cloudfront.types.list_response_headers_policies_result.ListResponseHeadersPoliciesResult":
"""<p>Gets a list of response headers policies.</p> <p>You can optionally apply a filter to get only the managed policies created by Amazon Web Services, or only the custom policies created in your Amazon Web Services account.</p> <p>You can optionally specify the maximum number of items to receive in the response. If the total number of items in the list exceeds the maximum that you specify, or the default maximum, the response is paginated. To get the next page of items, send a subsequent request that specifies the <code>NextMarker</code> value from the current response as the <code>Marker</code> value in the subsequent request.</p>
Args:
type: <p>A filter to get only the specified kind of response headers policies. Valid values are:</p> <ul> <li> <p> <code>managed</code> – Gets only the managed policies created by Amazon Web Services.</p> </li> <li> <p> <code>custom</code> – Gets only the custom policies created in your Amazon Web Services account.</p> </li> </ul>
marker: <p>Use this field when paginating results to indicate where to begin in your list of response headers policies. The response includes response headers policies in the list that occur after the marker. To get the next page of the list, set this field's value to the value of <code>NextMarker</code> from the current page's response.</p>
max_items: <p>The maximum number of response headers policies that you want to get in the response.</p>
Raises:
capo_cloudfront.errors.access_denied.AccessDenied: <p>Access denied.</p>
capo_cloudfront.errors.invalid_argument.InvalidArgument: <p>An argument is invalid.</p>
capo_cloudfront.errors.no_such_response_headers_policy.NoSuchResponseHeadersPolicy: <p>The response headers policy does not exist.</p>
capo_cloudfront.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_cloudfront.types.list_response_headers_policies_request.ListResponseHeadersPoliciesRequest]",
) -> AsyncOperationResponse[
"capo_cloudfront.types.list_response_headers_policies_result.ListResponseHeadersPoliciesResult"
]:
import capo_cloudfront._operations.cloudfront2020_05_31.list_response_headers_policies
(
output,
http_response,
) = await capo_cloudfront._operations.cloudfront2020_05_31.list_response_headers_policies.async_list_response_headers_policies(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ListResponseHeadersPolicies")
)
input_: capo_cloudfront.types.list_response_headers_policies_request.ListResponseHeadersPoliciesRequest = {}
if type is not None:
input_["type"] = type
if marker is not None:
input_["marker"] = marker
if max_items is not None:
input_["max_items"] = max_items
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|