"""
@generated by mypy-protobuf.  Do not edit manually!
isort:skip_file
"""

import builtins
import collections.abc
import google.protobuf.descriptor
import google.protobuf.internal.containers
import google.protobuf.message
import google.protobuf.timestamp_pb2
import sentry_protos.snuba.v1.request_common_pb2
import sentry_protos.snuba.v1.trace_item_attribute_pb2
import sentry_protos.snuba.v1.trace_item_filter_pb2
import typing

DESCRIPTOR: google.protobuf.descriptor.FileDescriptor

@typing.final
class TimeSeriesRequest(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    META_FIELD_NUMBER: builtins.int
    FILTER_FIELD_NUMBER: builtins.int
    AGGREGATIONS_FIELD_NUMBER: builtins.int
    GRANULARITY_SECS_FIELD_NUMBER: builtins.int
    GROUP_BY_FIELD_NUMBER: builtins.int
    granularity_secs: builtins.int
    @property
    def meta(self) -> sentry_protos.snuba.v1.request_common_pb2.RequestMeta: ...
    @property
    def filter(self) -> sentry_protos.snuba.v1.trace_item_filter_pb2.TraceItemFilter: ...
    @property
    def aggregations(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[sentry_protos.snuba.v1.trace_item_attribute_pb2.AttributeAggregation]: ...
    @property
    def group_by(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[sentry_protos.snuba.v1.trace_item_attribute_pb2.AttributeKey]: ...
    def __init__(
        self,
        *,
        meta: sentry_protos.snuba.v1.request_common_pb2.RequestMeta | None = ...,
        filter: sentry_protos.snuba.v1.trace_item_filter_pb2.TraceItemFilter | None = ...,
        aggregations: collections.abc.Iterable[sentry_protos.snuba.v1.trace_item_attribute_pb2.AttributeAggregation] | None = ...,
        granularity_secs: builtins.int = ...,
        group_by: collections.abc.Iterable[sentry_protos.snuba.v1.trace_item_attribute_pb2.AttributeKey] | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["filter", b"filter", "meta", b"meta"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["aggregations", b"aggregations", "filter", b"filter", "granularity_secs", b"granularity_secs", "group_by", b"group_by", "meta", b"meta"]) -> None: ...

global___TimeSeriesRequest = TimeSeriesRequest

@typing.final
class DataPoint(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    DATA_FIELD_NUMBER: builtins.int
    DATA_PRESENT_FIELD_NUMBER: builtins.int
    AVG_SAMPLING_RATE_FIELD_NUMBER: builtins.int
    IS_RELIABLE_FIELD_NUMBER: builtins.int
    RELIABILITY_FIELD_NUMBER: builtins.int
    data: builtins.float
    data_present: builtins.bool
    """optional, if not set, assume true. Accounts for sparse time series"""
    avg_sampling_rate: builtins.float
    is_reliable: builtins.bool
    reliability: sentry_protos.snuba.v1.trace_item_attribute_pb2.Reliability.ValueType
    """determines the reliability of the aggregation using math based on confidence intervals and sample size"""
    def __init__(
        self,
        *,
        data: builtins.float = ...,
        data_present: builtins.bool = ...,
        avg_sampling_rate: builtins.float = ...,
        is_reliable: builtins.bool = ...,
        reliability: sentry_protos.snuba.v1.trace_item_attribute_pb2.Reliability.ValueType = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing.Literal["avg_sampling_rate", b"avg_sampling_rate", "data", b"data", "data_present", b"data_present", "is_reliable", b"is_reliable", "reliability", b"reliability"]) -> None: ...

global___DataPoint = DataPoint

@typing.final
class TimeSeries(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    @typing.final
    class GroupByAttributesEntry(google.protobuf.message.Message):
        DESCRIPTOR: google.protobuf.descriptor.Descriptor

        KEY_FIELD_NUMBER: builtins.int
        VALUE_FIELD_NUMBER: builtins.int
        key: builtins.str
        value: builtins.str
        def __init__(
            self,
            *,
            key: builtins.str = ...,
            value: builtins.str = ...,
        ) -> None: ...
        def ClearField(self, field_name: typing.Literal["key", b"key", "value", b"value"]) -> None: ...

    LABEL_FIELD_NUMBER: builtins.int
    GROUP_BY_ATTRIBUTES_FIELD_NUMBER: builtins.int
    BUCKETS_FIELD_NUMBER: builtins.int
    DATA_POINTS_FIELD_NUMBER: builtins.int
    NUM_EVENTS_FIELD_NUMBER: builtins.int
    AVG_SAMPLING_RATE_FIELD_NUMBER: builtins.int
    label: builtins.str
    num_events: builtins.int
    """number of events used to calculate this timeseries"""
    avg_sampling_rate: builtins.float
    @property
    def group_by_attributes(self) -> google.protobuf.internal.containers.ScalarMap[builtins.str, builtins.str]:
        """the names and values of the attribute keys which
        were in the group by
        """

    @property
    def buckets(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[google.protobuf.timestamp_pb2.Timestamp]:
        """time bucket for each data point in the timeseries"""

    @property
    def data_points(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___DataPoint]: ...
    def __init__(
        self,
        *,
        label: builtins.str = ...,
        group_by_attributes: collections.abc.Mapping[builtins.str, builtins.str] | None = ...,
        buckets: collections.abc.Iterable[google.protobuf.timestamp_pb2.Timestamp] | None = ...,
        data_points: collections.abc.Iterable[global___DataPoint] | None = ...,
        num_events: builtins.int = ...,
        avg_sampling_rate: builtins.float = ...,
    ) -> None: ...
    def ClearField(self, field_name: typing.Literal["avg_sampling_rate", b"avg_sampling_rate", "buckets", b"buckets", "data_points", b"data_points", "group_by_attributes", b"group_by_attributes", "label", b"label", "num_events", b"num_events"]) -> None: ...

global___TimeSeries = TimeSeries

@typing.final
class TimeSeriesResponse(google.protobuf.message.Message):
    DESCRIPTOR: google.protobuf.descriptor.Descriptor

    RESULT_TIMESERIES_FIELD_NUMBER: builtins.int
    META_FIELD_NUMBER: builtins.int
    @property
    def result_timeseries(self) -> google.protobuf.internal.containers.RepeatedCompositeFieldContainer[global___TimeSeries]: ...
    @property
    def meta(self) -> sentry_protos.snuba.v1.request_common_pb2.ResponseMeta: ...
    def __init__(
        self,
        *,
        result_timeseries: collections.abc.Iterable[global___TimeSeries] | None = ...,
        meta: sentry_protos.snuba.v1.request_common_pb2.ResponseMeta | None = ...,
    ) -> None: ...
    def HasField(self, field_name: typing.Literal["meta", b"meta"]) -> builtins.bool: ...
    def ClearField(self, field_name: typing.Literal["meta", b"meta", "result_timeseries", b"result_timeseries"]) -> None: ...

global___TimeSeriesResponse = TimeSeriesResponse
