async def get_policy(
self,
policy_id: "capo_fms.types.policy_id.PolicyId",
*,
config_overrides: Optional[AsyncFMSClientConfig] = None,
) -> "capo_fms.types.get_policy_response.GetPolicyResponse":
"""<p>Returns information about the specified Firewall Manager policy.</p>
Args:
policy_id: <p>The ID of the Firewall Manager policy that you want the details for.</p>
Raises:
capo_fms.errors.internal_error_exception.InternalErrorException: <p>The operation failed because of a system problem, even though the request was valid. Retry your request.</p>
capo_fms.errors.invalid_operation_exception.InvalidOperationException: <p>The operation failed because there was nothing to do or the operation wasn't possible. For example, you might have submitted an <code>AssociateAdminAccount</code> request for an account ID that was already set as the Firewall Manager administrator. Or you might have tried to access a Region that's disabled by default, and that you need to enable for the Firewall Manager administrator account and for Organizations before you can access it.</p>
capo_fms.errors.invalid_type_exception.InvalidTypeException: <p>The value of the <code>Type</code> parameter is invalid.</p>
capo_fms.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
capo_fms.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_fms.types.get_policy_request.GetPolicyRequest]",
) -> AsyncOperationResponse[
"capo_fms.types.get_policy_response.GetPolicyResponse"
]:
if req.options.protocol == "awsJson1_1":
import capo_fms._operations.awsfms_20180101.aws_json1_1.get_policy
(
output,
http_response,
) = await capo_fms._operations.awsfms_20180101.aws_json1_1.get_policy.async_get_policy(
req.options, req.input
)
elif req.options.protocol == "rpcv2Cbor":
import capo_fms._operations.awsfms_20180101.rpcv2_cbor.get_policy
(
output,
http_response,
) = await capo_fms._operations.awsfms_20180101.rpcv2_cbor.get_policy.async_get_policy(
req.options, req.input
)
else:
raise ValueError(f"unknown protocol {req.options.protocol!r}")
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetPolicy")
)
input_: capo_fms.types.get_policy_request.GetPolicyRequest = {
"policy_id": policy_id
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output