Skip to content

batch_get_metric_data

batch_get_metric_data(
    queries: BatchGetMetricDataQueries,
    *,
    config_overrides: Optional[SESv2ClientConfig] = None,
) -> BatchGetMetricDataResponse

Retrieves batches of metric data collected based on your sending activity.

You can execute this operation no more than 16 times per second, and with at most 160 queries from the batches per second (cumulative).

Parameters:

Raises:

Source code in docs_src/capo_sesv2/_services/se_sv2.py
def batch_get_metric_data(
    self,
    queries: "capo_sesv2.types.batch_get_metric_data_queries.BatchGetMetricDataQueries",
    *,
    config_overrides: Optional[SESv2ClientConfig] = None,
) -> "capo_sesv2.types.batch_get_metric_data_response.BatchGetMetricDataResponse":
    """<p>Retrieves batches of metric data collected based on your sending activity.</p> <p>You can execute this operation no more than 16 times per second, and with at most 160 queries from the batches per second (cumulative).</p>

    Args:
        queries: <p>A list of queries for metrics to be retrieved.</p>

    Raises:
        capo_sesv2.errors.bad_request_exception.BadRequestException: <p>The input you provided is invalid.</p>
        capo_sesv2.errors.internal_service_error_exception.InternalServiceErrorException: <p>The request couldn't be processed because an error occurred with the Amazon SES API v2.</p>
        capo_sesv2.errors.not_found_exception.NotFoundException: <p>The resource you attempted to access doesn't exist.</p>
        capo_sesv2.errors.too_many_requests_exception.TooManyRequestsException: <p>Too many requests have been made to the operation.</p>
        capo_sesv2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sesv2.types.batch_get_metric_data_request.BatchGetMetricDataRequest]",
    ) -> OperationResponse[
        "capo_sesv2.types.batch_get_metric_data_response.BatchGetMetricDataResponse"
    ]:
        import capo_sesv2._operations.simple_email_service_v2.batch_get_metric_data

        output, http_response = (
            capo_sesv2._operations.simple_email_service_v2.batch_get_metric_data.batch_get_metric_data(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("BatchGetMetricData")
    )
    input_: capo_sesv2.types.batch_get_metric_data_request.BatchGetMetricDataRequest = {
        "queries": queries
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output