async def delete_protection_group(
self,
protection_group_id: "capo_shield.types.protection_group_id.ProtectionGroupId",
*,
config_overrides: Optional[AsyncShieldClientConfig] = None,
) -> "capo_shield.types.delete_protection_group_response.DeleteProtectionGroupResponse":
"""<p>Removes the specified protection group.</p>
Args:
protection_group_id: <p>The name of the protection group. You use this to identify the protection group in lists and to manage the protection group, for example to update, delete, or describe it. </p>
Raises:
capo_shield.errors.internal_error_exception.InternalErrorException: <p>Exception that indicates that a problem occurred with the service infrastructure. You can retry the request.</p>
capo_shield.errors.optimistic_lock_exception.OptimisticLockException: <p>Exception that indicates that the resource state has been modified by another client. Retrieve the resource and then retry your request.</p>
capo_shield.errors.resource_not_found_exception.ResourceNotFoundException: <p>Exception indicating the specified resource does not exist. If available, this exception includes details in additional properties. </p>
capo_shield.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_shield.types.delete_protection_group_request.DeleteProtectionGroupRequest]",
) -> AsyncOperationResponse[
"capo_shield.types.delete_protection_group_response.DeleteProtectionGroupResponse"
]:
if req.options.protocol == "awsJson1_1":
import capo_shield._operations.aws_shield_20160616.aws_json1_1.delete_protection_group
(
output,
http_response,
) = await capo_shield._operations.aws_shield_20160616.aws_json1_1.delete_protection_group.async_delete_protection_group(
req.options, req.input
)
elif req.options.protocol == "rpcv2Cbor":
import capo_shield._operations.aws_shield_20160616.rpcv2_cbor.delete_protection_group
(
output,
http_response,
) = await capo_shield._operations.aws_shield_20160616.rpcv2_cbor.delete_protection_group.async_delete_protection_group(
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("DeleteProtectionGroup")
)
input_: capo_shield.types.delete_protection_group_request.DeleteProtectionGroupRequest = {
"protection_group_id": protection_group_id
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output