Lists trails that are in the current account.
Parameters:
-
next_token
(Optional[String], default:
None
)
–
The token to use to get the next page of results after a previous API call. This token must be passed in with the same parameters that were specified in the original call. For example, if the original call specified an AttributeKey of 'Username' with a value of 'root', the call with NextToken should include those same parameters.
Raises:
Source code in docs_src/capo_cloudtrail/_services/cloud_trail.py
| def list_trails(
self,
*,
config_overrides: Optional[CloudTrailClientConfig] = None,
next_token: Optional["capo_cloudtrail.types.string.String"] = None,
) -> "capo_cloudtrail.types.list_trails_response.ListTrailsResponse":
"""<p>Lists trails that are in the current account.</p>
Args:
next_token: <p>The token to use to get the next page of results after a previous API call. This token must be passed in with the same parameters that were specified in the original call. For example, if the original call specified an AttributeKey of 'Username' with a value of 'root', the call with NextToken should include those same parameters.</p>
Raises:
capo_cloudtrail.errors.operation_not_permitted_exception.OperationNotPermittedException: <p>This exception is thrown when the requested operation is not permitted.</p>
capo_cloudtrail.errors.unsupported_operation_exception.UnsupportedOperationException: <p>This exception is thrown when the requested operation is not supported.</p>
capo_cloudtrail.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_cloudtrail.types.list_trails_request.ListTrailsRequest]",
) -> OperationResponse[
"capo_cloudtrail.types.list_trails_response.ListTrailsResponse"
]:
import capo_cloudtrail._operations.cloud_trail_20131101.list_trails
output, http_response = (
capo_cloudtrail._operations.cloud_trail_20131101.list_trails.list_trails(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ListTrails")
)
input_: capo_cloudtrail.types.list_trails_request.ListTrailsRequest = {}
if next_token is not None:
input_["next_token"] = next_token
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|