"""Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""

from __future__ import annotations
import dataclasses
import requests as requests_http
from ..shared import metricsinfo as shared_metricsinfo
from typing import Optional



@dataclasses.dataclass
class QueryMetricsRequest:
    earliest: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'earliest', 'style': 'form', 'explode': True }})
    r"""earliest time to query against"""
    filter_expr: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'filterExpr', 'style': 'form', 'explode': True }})
    r"""a js expression to apply against the metrics returned (can filter dimensions)"""
    latest: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'latest', 'style': 'form', 'explode': True }})
    r"""latest time to query against"""
    metric_name_filter: Optional[str] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'metricNameFilter', 'style': 'form', 'explode': True }})
    r"""can be a regex or an array of metric names"""
    num_buckets: Optional[int] = dataclasses.field(default=None, metadata={'query_param': { 'field_name': 'numBuckets', 'style': 'form', 'explode': True }})
    r"""buckets in the past to include in the query results"""
    




@dataclasses.dataclass
class QueryMetricsResponse:
    content_type: str = dataclasses.field()
    status_code: int = dataclasses.field()
    metrics_info: Optional[shared_metricsinfo.MetricsInfo] = dataclasses.field(default=None)
    r"""a list of MetricNameInfo objects"""
    raw_response: Optional[requests_http.Response] = dataclasses.field(default=None)
    

