# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

import typing_extensions
from typing import List, Type, Union, cast
from datetime import datetime
from typing_extensions import Literal

import httpx

from ....._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
from ....._utils import maybe_transform, async_maybe_transform
from ....._compat import cached_property
from ....._resource import SyncAPIResource, AsyncAPIResource
from ....._response import (
    to_raw_response_wrapper,
    to_streamed_response_wrapper,
    async_to_raw_response_wrapper,
    async_to_streamed_response_wrapper,
)
from ....._wrappers import ResultWrapper
from ....._base_client import make_request_options
from .....types.radar.attacks.layer3 import (
    summary_vector_params,
    summary_bitrate_params,
    summary_duration_params,
    summary_industry_params,
    summary_protocol_params,
    summary_vertical_params,
    summary_ip_version_params,
)
from .....types.radar.attacks.layer3.summary_vector_response import SummaryVectorResponse
from .....types.radar.attacks.layer3.summary_bitrate_response import SummaryBitrateResponse
from .....types.radar.attacks.layer3.summary_duration_response import SummaryDurationResponse
from .....types.radar.attacks.layer3.summary_industry_response import SummaryIndustryResponse
from .....types.radar.attacks.layer3.summary_protocol_response import SummaryProtocolResponse
from .....types.radar.attacks.layer3.summary_vertical_response import SummaryVerticalResponse
from .....types.radar.attacks.layer3.summary_ip_version_response import SummaryIPVersionResponse

__all__ = ["SummaryResource", "AsyncSummaryResource"]


class SummaryResource(SyncAPIResource):
    @cached_property
    def with_raw_response(self) -> SummaryResourceWithRawResponse:
        """
        This property can be used as a prefix for any HTTP method call to return
        the raw response object instead of the parsed content.

        For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
        """
        return SummaryResourceWithRawResponse(self)

    @cached_property
    def with_streaming_response(self) -> SummaryResourceWithStreamingResponse:
        """
        An alternative to `.with_raw_response` that doesn't eagerly read the response body.

        For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
        """
        return SummaryResourceWithStreamingResponse(self)

    @typing_extensions.deprecated(
        "Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead."
    )
    def bitrate(
        self,
        *,
        continent: SequenceNotStr[str] | Omit = omit,
        date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit,
        date_range: SequenceNotStr[str] | Omit = omit,
        date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit,
        direction: Literal["ORIGIN", "TARGET"] | Omit = omit,
        format: Literal["JSON", "CSV"] | Omit = omit,
        ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit,
        location: SequenceNotStr[str] | Omit = omit,
        name: SequenceNotStr[str] | Omit = omit,
        protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit,
        # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
        # The extra values given here take precedence over values defined on the client or passed to this method.
        extra_headers: Headers | None = None,
        extra_query: Query | None = None,
        extra_body: Body | None = None,
        timeout: float | httpx.Timeout | None | NotGiven = not_given,
    ) -> SummaryBitrateResponse:
        """
        Retrieves the distribution of layer 3 attacks by bitrate.

        Args:
          continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes.
              Prefix with `-` to exclude continents from results. For example, `-EU,NA`
              excludes results from EU, but includes results from NA.

          date_end: End of the date range (inclusive). Alternative to `dateRange`; provide together
              with `dateStart`. When requesting comparison series, every series must resolve
              to the same duration as the main series. Each `dateStart`/`dateEnd` is floored
              to the nearest 15 minutes before evaluation, so windows whose durations match
              only before alignment may be rejected.

          date_range: Filters results by relative date range ending at the current time, with each
              value producing a separate series. Use `<n>d` for days (up to `364d`) or `<n>w`
              for weeks (up to `52w`). Append `control` to request the equivalent previous
              period for comparison: the comparison window is shifted back by the current
              window's length rounded up to a whole number of weeks, so it keeps the same
              weekday alignment and does not overlap the current window (e.g. `7dcontrol`
              covers days -14 to -7, `10dcontrol` covers days -24 to -14). For example, pass
              `7d` and `7dcontrol` to compare this week with the previous week. All series
              must resolve to the same duration as the main series; relative ranges (including
              `control`) satisfy this automatically. Use this parameter or set specific start
              and end dates (`dateStart` and `dateEnd` parameters).

          date_start: Start of the date range. Alternative to `dateRange`; provide together with
              `dateEnd`. When requesting comparison series, every series must resolve to the
              same duration as the main series. Each `dateStart`/`dateEnd` is floored to the
              nearest 15 minutes before evaluation, so windows whose durations match only
              before alignment may be rejected.

          direction: Specifies whether the `location` filter applies to the source or target
              location.

          format: Format in which results will be returned.

          ip_version: Filters results by IP version (Ipv4 vs. IPv6).

          location: Filters results by location. Specify a comma-separated list of alpha-2 codes.
              Prefix with `-` to exclude locations from results. For example, `-US,PT`
              excludes results from the US, but includes results from PT.

          name: Array of names used to label the series in the response.

          protocol: Filters the results by layer 3/4 protocol.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        """
        return self._get(
            "/radar/attacks/layer3/summary/bitrate",
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                query=maybe_transform(
                    {
                        "continent": continent,
                        "date_end": date_end,
                        "date_range": date_range,
                        "date_start": date_start,
                        "direction": direction,
                        "format": format,
                        "ip_version": ip_version,
                        "location": location,
                        "name": name,
                        "protocol": protocol,
                    },
                    summary_bitrate_params.SummaryBitrateParams,
                ),
                post_parser=ResultWrapper[SummaryBitrateResponse]._unwrapper,
            ),
            cast_to=cast(Type[SummaryBitrateResponse], ResultWrapper[SummaryBitrateResponse]),
        )

    @typing_extensions.deprecated(
        "Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead."
    )
    def duration(
        self,
        *,
        continent: SequenceNotStr[str] | Omit = omit,
        date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit,
        date_range: SequenceNotStr[str] | Omit = omit,
        date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit,
        direction: Literal["ORIGIN", "TARGET"] | Omit = omit,
        format: Literal["JSON", "CSV"] | Omit = omit,
        ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit,
        location: SequenceNotStr[str] | Omit = omit,
        name: SequenceNotStr[str] | Omit = omit,
        protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit,
        # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
        # The extra values given here take precedence over values defined on the client or passed to this method.
        extra_headers: Headers | None = None,
        extra_query: Query | None = None,
        extra_body: Body | None = None,
        timeout: float | httpx.Timeout | None | NotGiven = not_given,
    ) -> SummaryDurationResponse:
        """
        Retrieves the distribution of layer 3 attacks by duration.

        Args:
          continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes.
              Prefix with `-` to exclude continents from results. For example, `-EU,NA`
              excludes results from EU, but includes results from NA.

          date_end: End of the date range (inclusive). Alternative to `dateRange`; provide together
              with `dateStart`. When requesting comparison series, every series must resolve
              to the same duration as the main series. Each `dateStart`/`dateEnd` is floored
              to the nearest 15 minutes before evaluation, so windows whose durations match
              only before alignment may be rejected.

          date_range: Filters results by relative date range ending at the current time, with each
              value producing a separate series. Use `<n>d` for days (up to `364d`) or `<n>w`
              for weeks (up to `52w`). Append `control` to request the equivalent previous
              period for comparison: the comparison window is shifted back by the current
              window's length rounded up to a whole number of weeks, so it keeps the same
              weekday alignment and does not overlap the current window (e.g. `7dcontrol`
              covers days -14 to -7, `10dcontrol` covers days -24 to -14). For example, pass
              `7d` and `7dcontrol` to compare this week with the previous week. All series
              must resolve to the same duration as the main series; relative ranges (including
              `control`) satisfy this automatically. Use this parameter or set specific start
              and end dates (`dateStart` and `dateEnd` parameters).

          date_start: Start of the date range. Alternative to `dateRange`; provide together with
              `dateEnd`. When requesting comparison series, every series must resolve to the
              same duration as the main series. Each `dateStart`/`dateEnd` is floored to the
              nearest 15 minutes before evaluation, so windows whose durations match only
              before alignment may be rejected.

          direction: Specifies whether the `location` filter applies to the source or target
              location.

          format: Format in which results will be returned.

          ip_version: Filters results by IP version (Ipv4 vs. IPv6).

          location: Filters results by location. Specify a comma-separated list of alpha-2 codes.
              Prefix with `-` to exclude locations from results. For example, `-US,PT`
              excludes results from the US, but includes results from PT.

          name: Array of names used to label the series in the response.

          protocol: Filters the results by layer 3/4 protocol.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        """
        return self._get(
            "/radar/attacks/layer3/summary/duration",
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                query=maybe_transform(
                    {
                        "continent": continent,
                        "date_end": date_end,
                        "date_range": date_range,
                        "date_start": date_start,
                        "direction": direction,
                        "format": format,
                        "ip_version": ip_version,
                        "location": location,
                        "name": name,
                        "protocol": protocol,
                    },
                    summary_duration_params.SummaryDurationParams,
                ),
                post_parser=ResultWrapper[SummaryDurationResponse]._unwrapper,
            ),
            cast_to=cast(Type[SummaryDurationResponse], ResultWrapper[SummaryDurationResponse]),
        )

    @typing_extensions.deprecated(
        "Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead."
    )
    def industry(
        self,
        *,
        continent: SequenceNotStr[str] | Omit = omit,
        date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit,
        date_range: SequenceNotStr[str] | Omit = omit,
        date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit,
        direction: Literal["ORIGIN", "TARGET"] | Omit = omit,
        format: Literal["JSON", "CSV"] | Omit = omit,
        ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit,
        limit_per_group: int | Omit = omit,
        location: SequenceNotStr[str] | Omit = omit,
        name: SequenceNotStr[str] | Omit = omit,
        protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit,
        # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
        # The extra values given here take precedence over values defined on the client or passed to this method.
        extra_headers: Headers | None = None,
        extra_query: Query | None = None,
        extra_body: Body | None = None,
        timeout: float | httpx.Timeout | None | NotGiven = not_given,
    ) -> SummaryIndustryResponse:
        """
        Retrieves the distribution of layer 3 attacks by targeted industry.

        Args:
          continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes.
              Prefix with `-` to exclude continents from results. For example, `-EU,NA`
              excludes results from EU, but includes results from NA.

          date_end: End of the date range (inclusive). Alternative to `dateRange`; provide together
              with `dateStart`. When requesting comparison series, every series must resolve
              to the same duration as the main series. Each `dateStart`/`dateEnd` is floored
              to the nearest 15 minutes before evaluation, so windows whose durations match
              only before alignment may be rejected.

          date_range: Filters results by relative date range ending at the current time, with each
              value producing a separate series. Use `<n>d` for days (up to `364d`) or `<n>w`
              for weeks (up to `52w`). Append `control` to request the equivalent previous
              period for comparison: the comparison window is shifted back by the current
              window's length rounded up to a whole number of weeks, so it keeps the same
              weekday alignment and does not overlap the current window (e.g. `7dcontrol`
              covers days -14 to -7, `10dcontrol` covers days -24 to -14). For example, pass
              `7d` and `7dcontrol` to compare this week with the previous week. All series
              must resolve to the same duration as the main series; relative ranges (including
              `control`) satisfy this automatically. Use this parameter or set specific start
              and end dates (`dateStart` and `dateEnd` parameters).

          date_start: Start of the date range. Alternative to `dateRange`; provide together with
              `dateEnd`. When requesting comparison series, every series must resolve to the
              same duration as the main series. Each `dateStart`/`dateEnd` is floored to the
              nearest 15 minutes before evaluation, so windows whose durations match only
              before alignment may be rejected.

          direction: Specifies whether the `location` filter applies to the source or target
              location.

          format: Format in which results will be returned.

          ip_version: Filters results by IP version (Ipv4 vs. IPv6).

          limit_per_group: Limits the number of objects per group to the top items within the specified
              time range. When item count exceeds the limit, extra items appear grouped under
              an "other" category. Only supported on high-cardinality dimensions; otherwise
              the request is rejected. Minimum value is 2.

          location: Filters results by location. Specify a comma-separated list of alpha-2 codes.
              Prefix with `-` to exclude locations from results. For example, `-US,PT`
              excludes results from the US, but includes results from PT.

          name: Array of names used to label the series in the response.

          protocol: Filters the results by layer 3/4 protocol.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        """
        return self._get(
            "/radar/attacks/layer3/summary/industry",
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                query=maybe_transform(
                    {
                        "continent": continent,
                        "date_end": date_end,
                        "date_range": date_range,
                        "date_start": date_start,
                        "direction": direction,
                        "format": format,
                        "ip_version": ip_version,
                        "limit_per_group": limit_per_group,
                        "location": location,
                        "name": name,
                        "protocol": protocol,
                    },
                    summary_industry_params.SummaryIndustryParams,
                ),
                post_parser=ResultWrapper[SummaryIndustryResponse]._unwrapper,
            ),
            cast_to=cast(Type[SummaryIndustryResponse], ResultWrapper[SummaryIndustryResponse]),
        )

    @typing_extensions.deprecated(
        "Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead."
    )
    def ip_version(
        self,
        *,
        continent: SequenceNotStr[str] | Omit = omit,
        date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit,
        date_range: SequenceNotStr[str] | Omit = omit,
        date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit,
        direction: Literal["ORIGIN", "TARGET"] | Omit = omit,
        format: Literal["JSON", "CSV"] | Omit = omit,
        location: SequenceNotStr[str] | Omit = omit,
        name: SequenceNotStr[str] | Omit = omit,
        protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit,
        # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
        # The extra values given here take precedence over values defined on the client or passed to this method.
        extra_headers: Headers | None = None,
        extra_query: Query | None = None,
        extra_body: Body | None = None,
        timeout: float | httpx.Timeout | None | NotGiven = not_given,
    ) -> SummaryIPVersionResponse:
        """
        Retrieves the distribution of layer 3 attacks by IP version.

        Args:
          continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes.
              Prefix with `-` to exclude continents from results. For example, `-EU,NA`
              excludes results from EU, but includes results from NA.

          date_end: End of the date range (inclusive). Alternative to `dateRange`; provide together
              with `dateStart`. When requesting comparison series, every series must resolve
              to the same duration as the main series. Each `dateStart`/`dateEnd` is floored
              to the nearest 15 minutes before evaluation, so windows whose durations match
              only before alignment may be rejected.

          date_range: Filters results by relative date range ending at the current time, with each
              value producing a separate series. Use `<n>d` for days (up to `364d`) or `<n>w`
              for weeks (up to `52w`). Append `control` to request the equivalent previous
              period for comparison: the comparison window is shifted back by the current
              window's length rounded up to a whole number of weeks, so it keeps the same
              weekday alignment and does not overlap the current window (e.g. `7dcontrol`
              covers days -14 to -7, `10dcontrol` covers days -24 to -14). For example, pass
              `7d` and `7dcontrol` to compare this week with the previous week. All series
              must resolve to the same duration as the main series; relative ranges (including
              `control`) satisfy this automatically. Use this parameter or set specific start
              and end dates (`dateStart` and `dateEnd` parameters).

          date_start: Start of the date range. Alternative to `dateRange`; provide together with
              `dateEnd`. When requesting comparison series, every series must resolve to the
              same duration as the main series. Each `dateStart`/`dateEnd` is floored to the
              nearest 15 minutes before evaluation, so windows whose durations match only
              before alignment may be rejected.

          direction: Specifies whether the `location` filter applies to the source or target
              location.

          format: Format in which results will be returned.

          location: Filters results by location. Specify a comma-separated list of alpha-2 codes.
              Prefix with `-` to exclude locations from results. For example, `-US,PT`
              excludes results from the US, but includes results from PT.

          name: Array of names used to label the series in the response.

          protocol: Filters the results by layer 3/4 protocol.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        """
        return self._get(
            "/radar/attacks/layer3/summary/ip_version",
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                query=maybe_transform(
                    {
                        "continent": continent,
                        "date_end": date_end,
                        "date_range": date_range,
                        "date_start": date_start,
                        "direction": direction,
                        "format": format,
                        "location": location,
                        "name": name,
                        "protocol": protocol,
                    },
                    summary_ip_version_params.SummaryIPVersionParams,
                ),
                post_parser=ResultWrapper[SummaryIPVersionResponse]._unwrapper,
            ),
            cast_to=cast(Type[SummaryIPVersionResponse], ResultWrapper[SummaryIPVersionResponse]),
        )

    @typing_extensions.deprecated(
        "Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead."
    )
    def protocol(
        self,
        *,
        continent: SequenceNotStr[str] | Omit = omit,
        date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit,
        date_range: SequenceNotStr[str] | Omit = omit,
        date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit,
        direction: Literal["ORIGIN", "TARGET"] | Omit = omit,
        format: Literal["JSON", "CSV"] | Omit = omit,
        ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit,
        location: SequenceNotStr[str] | Omit = omit,
        name: SequenceNotStr[str] | Omit = omit,
        # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
        # The extra values given here take precedence over values defined on the client or passed to this method.
        extra_headers: Headers | None = None,
        extra_query: Query | None = None,
        extra_body: Body | None = None,
        timeout: float | httpx.Timeout | None | NotGiven = not_given,
    ) -> SummaryProtocolResponse:
        """
        Retrieves the distribution of layer 3 attacks by protocol.

        Args:
          continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes.
              Prefix with `-` to exclude continents from results. For example, `-EU,NA`
              excludes results from EU, but includes results from NA.

          date_end: End of the date range (inclusive). Alternative to `dateRange`; provide together
              with `dateStart`. When requesting comparison series, every series must resolve
              to the same duration as the main series. Each `dateStart`/`dateEnd` is floored
              to the nearest 15 minutes before evaluation, so windows whose durations match
              only before alignment may be rejected.

          date_range: Filters results by relative date range ending at the current time, with each
              value producing a separate series. Use `<n>d` for days (up to `364d`) or `<n>w`
              for weeks (up to `52w`). Append `control` to request the equivalent previous
              period for comparison: the comparison window is shifted back by the current
              window's length rounded up to a whole number of weeks, so it keeps the same
              weekday alignment and does not overlap the current window (e.g. `7dcontrol`
              covers days -14 to -7, `10dcontrol` covers days -24 to -14). For example, pass
              `7d` and `7dcontrol` to compare this week with the previous week. All series
              must resolve to the same duration as the main series; relative ranges (including
              `control`) satisfy this automatically. Use this parameter or set specific start
              and end dates (`dateStart` and `dateEnd` parameters).

          date_start: Start of the date range. Alternative to `dateRange`; provide together with
              `dateEnd`. When requesting comparison series, every series must resolve to the
              same duration as the main series. Each `dateStart`/`dateEnd` is floored to the
              nearest 15 minutes before evaluation, so windows whose durations match only
              before alignment may be rejected.

          direction: Specifies whether the `location` filter applies to the source or target
              location.

          format: Format in which results will be returned.

          ip_version: Filters results by IP version (Ipv4 vs. IPv6).

          location: Filters results by location. Specify a comma-separated list of alpha-2 codes.
              Prefix with `-` to exclude locations from results. For example, `-US,PT`
              excludes results from the US, but includes results from PT.

          name: Array of names used to label the series in the response.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        """
        return self._get(
            "/radar/attacks/layer3/summary/protocol",
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                query=maybe_transform(
                    {
                        "continent": continent,
                        "date_end": date_end,
                        "date_range": date_range,
                        "date_start": date_start,
                        "direction": direction,
                        "format": format,
                        "ip_version": ip_version,
                        "location": location,
                        "name": name,
                    },
                    summary_protocol_params.SummaryProtocolParams,
                ),
                post_parser=ResultWrapper[SummaryProtocolResponse]._unwrapper,
            ),
            cast_to=cast(Type[SummaryProtocolResponse], ResultWrapper[SummaryProtocolResponse]),
        )

    @typing_extensions.deprecated(
        "Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead."
    )
    def vector(
        self,
        *,
        continent: SequenceNotStr[str] | Omit = omit,
        date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit,
        date_range: SequenceNotStr[str] | Omit = omit,
        date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit,
        direction: Literal["ORIGIN", "TARGET"] | Omit = omit,
        format: Literal["JSON", "CSV"] | Omit = omit,
        ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit,
        limit_per_group: int | Omit = omit,
        location: SequenceNotStr[str] | Omit = omit,
        name: SequenceNotStr[str] | Omit = omit,
        protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit,
        # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
        # The extra values given here take precedence over values defined on the client or passed to this method.
        extra_headers: Headers | None = None,
        extra_query: Query | None = None,
        extra_body: Body | None = None,
        timeout: float | httpx.Timeout | None | NotGiven = not_given,
    ) -> SummaryVectorResponse:
        """
        Retrieves the distribution of layer 3 attacks by vector.

        Args:
          continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes.
              Prefix with `-` to exclude continents from results. For example, `-EU,NA`
              excludes results from EU, but includes results from NA.

          date_end: End of the date range (inclusive). Alternative to `dateRange`; provide together
              with `dateStart`. When requesting comparison series, every series must resolve
              to the same duration as the main series. Each `dateStart`/`dateEnd` is floored
              to the nearest 15 minutes before evaluation, so windows whose durations match
              only before alignment may be rejected.

          date_range: Filters results by relative date range ending at the current time, with each
              value producing a separate series. Use `<n>d` for days (up to `364d`) or `<n>w`
              for weeks (up to `52w`). Append `control` to request the equivalent previous
              period for comparison: the comparison window is shifted back by the current
              window's length rounded up to a whole number of weeks, so it keeps the same
              weekday alignment and does not overlap the current window (e.g. `7dcontrol`
              covers days -14 to -7, `10dcontrol` covers days -24 to -14). For example, pass
              `7d` and `7dcontrol` to compare this week with the previous week. All series
              must resolve to the same duration as the main series; relative ranges (including
              `control`) satisfy this automatically. Use this parameter or set specific start
              and end dates (`dateStart` and `dateEnd` parameters).

          date_start: Start of the date range. Alternative to `dateRange`; provide together with
              `dateEnd`. When requesting comparison series, every series must resolve to the
              same duration as the main series. Each `dateStart`/`dateEnd` is floored to the
              nearest 15 minutes before evaluation, so windows whose durations match only
              before alignment may be rejected.

          direction: Specifies whether the `location` filter applies to the source or target
              location.

          format: Format in which results will be returned.

          ip_version: Filters results by IP version (Ipv4 vs. IPv6).

          limit_per_group: Limits the number of objects per group to the top items within the specified
              time range. When item count exceeds the limit, extra items appear grouped under
              an "other" category. Only supported on high-cardinality dimensions; otherwise
              the request is rejected. Minimum value is 2.

          location: Filters results by location. Specify a comma-separated list of alpha-2 codes.
              Prefix with `-` to exclude locations from results. For example, `-US,PT`
              excludes results from the US, but includes results from PT.

          name: Array of names used to label the series in the response.

          protocol: Filters the results by layer 3/4 protocol.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        """
        return self._get(
            "/radar/attacks/layer3/summary/vector",
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                query=maybe_transform(
                    {
                        "continent": continent,
                        "date_end": date_end,
                        "date_range": date_range,
                        "date_start": date_start,
                        "direction": direction,
                        "format": format,
                        "ip_version": ip_version,
                        "limit_per_group": limit_per_group,
                        "location": location,
                        "name": name,
                        "protocol": protocol,
                    },
                    summary_vector_params.SummaryVectorParams,
                ),
                post_parser=ResultWrapper[SummaryVectorResponse]._unwrapper,
            ),
            cast_to=cast(Type[SummaryVectorResponse], ResultWrapper[SummaryVectorResponse]),
        )

    @typing_extensions.deprecated(
        "Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead."
    )
    def vertical(
        self,
        *,
        continent: SequenceNotStr[str] | Omit = omit,
        date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit,
        date_range: SequenceNotStr[str] | Omit = omit,
        date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit,
        direction: Literal["ORIGIN", "TARGET"] | Omit = omit,
        format: Literal["JSON", "CSV"] | Omit = omit,
        ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit,
        limit_per_group: int | Omit = omit,
        location: SequenceNotStr[str] | Omit = omit,
        name: SequenceNotStr[str] | Omit = omit,
        protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit,
        # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
        # The extra values given here take precedence over values defined on the client or passed to this method.
        extra_headers: Headers | None = None,
        extra_query: Query | None = None,
        extra_body: Body | None = None,
        timeout: float | httpx.Timeout | None | NotGiven = not_given,
    ) -> SummaryVerticalResponse:
        """
        Retrieves the distribution of layer 3 attacks by targeted vertical.

        Args:
          continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes.
              Prefix with `-` to exclude continents from results. For example, `-EU,NA`
              excludes results from EU, but includes results from NA.

          date_end: End of the date range (inclusive). Alternative to `dateRange`; provide together
              with `dateStart`. When requesting comparison series, every series must resolve
              to the same duration as the main series. Each `dateStart`/`dateEnd` is floored
              to the nearest 15 minutes before evaluation, so windows whose durations match
              only before alignment may be rejected.

          date_range: Filters results by relative date range ending at the current time, with each
              value producing a separate series. Use `<n>d` for days (up to `364d`) or `<n>w`
              for weeks (up to `52w`). Append `control` to request the equivalent previous
              period for comparison: the comparison window is shifted back by the current
              window's length rounded up to a whole number of weeks, so it keeps the same
              weekday alignment and does not overlap the current window (e.g. `7dcontrol`
              covers days -14 to -7, `10dcontrol` covers days -24 to -14). For example, pass
              `7d` and `7dcontrol` to compare this week with the previous week. All series
              must resolve to the same duration as the main series; relative ranges (including
              `control`) satisfy this automatically. Use this parameter or set specific start
              and end dates (`dateStart` and `dateEnd` parameters).

          date_start: Start of the date range. Alternative to `dateRange`; provide together with
              `dateEnd`. When requesting comparison series, every series must resolve to the
              same duration as the main series. Each `dateStart`/`dateEnd` is floored to the
              nearest 15 minutes before evaluation, so windows whose durations match only
              before alignment may be rejected.

          direction: Specifies whether the `location` filter applies to the source or target
              location.

          format: Format in which results will be returned.

          ip_version: Filters results by IP version (Ipv4 vs. IPv6).

          limit_per_group: Limits the number of objects per group to the top items within the specified
              time range. When item count exceeds the limit, extra items appear grouped under
              an "other" category. Only supported on high-cardinality dimensions; otherwise
              the request is rejected. Minimum value is 2.

          location: Filters results by location. Specify a comma-separated list of alpha-2 codes.
              Prefix with `-` to exclude locations from results. For example, `-US,PT`
              excludes results from the US, but includes results from PT.

          name: Array of names used to label the series in the response.

          protocol: Filters the results by layer 3/4 protocol.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        """
        return self._get(
            "/radar/attacks/layer3/summary/vertical",
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                query=maybe_transform(
                    {
                        "continent": continent,
                        "date_end": date_end,
                        "date_range": date_range,
                        "date_start": date_start,
                        "direction": direction,
                        "format": format,
                        "ip_version": ip_version,
                        "limit_per_group": limit_per_group,
                        "location": location,
                        "name": name,
                        "protocol": protocol,
                    },
                    summary_vertical_params.SummaryVerticalParams,
                ),
                post_parser=ResultWrapper[SummaryVerticalResponse]._unwrapper,
            ),
            cast_to=cast(Type[SummaryVerticalResponse], ResultWrapper[SummaryVerticalResponse]),
        )


class AsyncSummaryResource(AsyncAPIResource):
    @cached_property
    def with_raw_response(self) -> AsyncSummaryResourceWithRawResponse:
        """
        This property can be used as a prefix for any HTTP method call to return
        the raw response object instead of the parsed content.

        For more information, see https://www.github.com/cloudflare/cloudflare-python#accessing-raw-response-data-eg-headers
        """
        return AsyncSummaryResourceWithRawResponse(self)

    @cached_property
    def with_streaming_response(self) -> AsyncSummaryResourceWithStreamingResponse:
        """
        An alternative to `.with_raw_response` that doesn't eagerly read the response body.

        For more information, see https://www.github.com/cloudflare/cloudflare-python#with_streaming_response
        """
        return AsyncSummaryResourceWithStreamingResponse(self)

    @typing_extensions.deprecated(
        "Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead."
    )
    async def bitrate(
        self,
        *,
        continent: SequenceNotStr[str] | Omit = omit,
        date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit,
        date_range: SequenceNotStr[str] | Omit = omit,
        date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit,
        direction: Literal["ORIGIN", "TARGET"] | Omit = omit,
        format: Literal["JSON", "CSV"] | Omit = omit,
        ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit,
        location: SequenceNotStr[str] | Omit = omit,
        name: SequenceNotStr[str] | Omit = omit,
        protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit,
        # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
        # The extra values given here take precedence over values defined on the client or passed to this method.
        extra_headers: Headers | None = None,
        extra_query: Query | None = None,
        extra_body: Body | None = None,
        timeout: float | httpx.Timeout | None | NotGiven = not_given,
    ) -> SummaryBitrateResponse:
        """
        Retrieves the distribution of layer 3 attacks by bitrate.

        Args:
          continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes.
              Prefix with `-` to exclude continents from results. For example, `-EU,NA`
              excludes results from EU, but includes results from NA.

          date_end: End of the date range (inclusive). Alternative to `dateRange`; provide together
              with `dateStart`. When requesting comparison series, every series must resolve
              to the same duration as the main series. Each `dateStart`/`dateEnd` is floored
              to the nearest 15 minutes before evaluation, so windows whose durations match
              only before alignment may be rejected.

          date_range: Filters results by relative date range ending at the current time, with each
              value producing a separate series. Use `<n>d` for days (up to `364d`) or `<n>w`
              for weeks (up to `52w`). Append `control` to request the equivalent previous
              period for comparison: the comparison window is shifted back by the current
              window's length rounded up to a whole number of weeks, so it keeps the same
              weekday alignment and does not overlap the current window (e.g. `7dcontrol`
              covers days -14 to -7, `10dcontrol` covers days -24 to -14). For example, pass
              `7d` and `7dcontrol` to compare this week with the previous week. All series
              must resolve to the same duration as the main series; relative ranges (including
              `control`) satisfy this automatically. Use this parameter or set specific start
              and end dates (`dateStart` and `dateEnd` parameters).

          date_start: Start of the date range. Alternative to `dateRange`; provide together with
              `dateEnd`. When requesting comparison series, every series must resolve to the
              same duration as the main series. Each `dateStart`/`dateEnd` is floored to the
              nearest 15 minutes before evaluation, so windows whose durations match only
              before alignment may be rejected.

          direction: Specifies whether the `location` filter applies to the source or target
              location.

          format: Format in which results will be returned.

          ip_version: Filters results by IP version (Ipv4 vs. IPv6).

          location: Filters results by location. Specify a comma-separated list of alpha-2 codes.
              Prefix with `-` to exclude locations from results. For example, `-US,PT`
              excludes results from the US, but includes results from PT.

          name: Array of names used to label the series in the response.

          protocol: Filters the results by layer 3/4 protocol.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        """
        return await self._get(
            "/radar/attacks/layer3/summary/bitrate",
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                query=await async_maybe_transform(
                    {
                        "continent": continent,
                        "date_end": date_end,
                        "date_range": date_range,
                        "date_start": date_start,
                        "direction": direction,
                        "format": format,
                        "ip_version": ip_version,
                        "location": location,
                        "name": name,
                        "protocol": protocol,
                    },
                    summary_bitrate_params.SummaryBitrateParams,
                ),
                post_parser=ResultWrapper[SummaryBitrateResponse]._unwrapper,
            ),
            cast_to=cast(Type[SummaryBitrateResponse], ResultWrapper[SummaryBitrateResponse]),
        )

    @typing_extensions.deprecated(
        "Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead."
    )
    async def duration(
        self,
        *,
        continent: SequenceNotStr[str] | Omit = omit,
        date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit,
        date_range: SequenceNotStr[str] | Omit = omit,
        date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit,
        direction: Literal["ORIGIN", "TARGET"] | Omit = omit,
        format: Literal["JSON", "CSV"] | Omit = omit,
        ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit,
        location: SequenceNotStr[str] | Omit = omit,
        name: SequenceNotStr[str] | Omit = omit,
        protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit,
        # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
        # The extra values given here take precedence over values defined on the client or passed to this method.
        extra_headers: Headers | None = None,
        extra_query: Query | None = None,
        extra_body: Body | None = None,
        timeout: float | httpx.Timeout | None | NotGiven = not_given,
    ) -> SummaryDurationResponse:
        """
        Retrieves the distribution of layer 3 attacks by duration.

        Args:
          continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes.
              Prefix with `-` to exclude continents from results. For example, `-EU,NA`
              excludes results from EU, but includes results from NA.

          date_end: End of the date range (inclusive). Alternative to `dateRange`; provide together
              with `dateStart`. When requesting comparison series, every series must resolve
              to the same duration as the main series. Each `dateStart`/`dateEnd` is floored
              to the nearest 15 minutes before evaluation, so windows whose durations match
              only before alignment may be rejected.

          date_range: Filters results by relative date range ending at the current time, with each
              value producing a separate series. Use `<n>d` for days (up to `364d`) or `<n>w`
              for weeks (up to `52w`). Append `control` to request the equivalent previous
              period for comparison: the comparison window is shifted back by the current
              window's length rounded up to a whole number of weeks, so it keeps the same
              weekday alignment and does not overlap the current window (e.g. `7dcontrol`
              covers days -14 to -7, `10dcontrol` covers days -24 to -14). For example, pass
              `7d` and `7dcontrol` to compare this week with the previous week. All series
              must resolve to the same duration as the main series; relative ranges (including
              `control`) satisfy this automatically. Use this parameter or set specific start
              and end dates (`dateStart` and `dateEnd` parameters).

          date_start: Start of the date range. Alternative to `dateRange`; provide together with
              `dateEnd`. When requesting comparison series, every series must resolve to the
              same duration as the main series. Each `dateStart`/`dateEnd` is floored to the
              nearest 15 minutes before evaluation, so windows whose durations match only
              before alignment may be rejected.

          direction: Specifies whether the `location` filter applies to the source or target
              location.

          format: Format in which results will be returned.

          ip_version: Filters results by IP version (Ipv4 vs. IPv6).

          location: Filters results by location. Specify a comma-separated list of alpha-2 codes.
              Prefix with `-` to exclude locations from results. For example, `-US,PT`
              excludes results from the US, but includes results from PT.

          name: Array of names used to label the series in the response.

          protocol: Filters the results by layer 3/4 protocol.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        """
        return await self._get(
            "/radar/attacks/layer3/summary/duration",
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                query=await async_maybe_transform(
                    {
                        "continent": continent,
                        "date_end": date_end,
                        "date_range": date_range,
                        "date_start": date_start,
                        "direction": direction,
                        "format": format,
                        "ip_version": ip_version,
                        "location": location,
                        "name": name,
                        "protocol": protocol,
                    },
                    summary_duration_params.SummaryDurationParams,
                ),
                post_parser=ResultWrapper[SummaryDurationResponse]._unwrapper,
            ),
            cast_to=cast(Type[SummaryDurationResponse], ResultWrapper[SummaryDurationResponse]),
        )

    @typing_extensions.deprecated(
        "Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead."
    )
    async def industry(
        self,
        *,
        continent: SequenceNotStr[str] | Omit = omit,
        date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit,
        date_range: SequenceNotStr[str] | Omit = omit,
        date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit,
        direction: Literal["ORIGIN", "TARGET"] | Omit = omit,
        format: Literal["JSON", "CSV"] | Omit = omit,
        ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit,
        limit_per_group: int | Omit = omit,
        location: SequenceNotStr[str] | Omit = omit,
        name: SequenceNotStr[str] | Omit = omit,
        protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit,
        # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
        # The extra values given here take precedence over values defined on the client or passed to this method.
        extra_headers: Headers | None = None,
        extra_query: Query | None = None,
        extra_body: Body | None = None,
        timeout: float | httpx.Timeout | None | NotGiven = not_given,
    ) -> SummaryIndustryResponse:
        """
        Retrieves the distribution of layer 3 attacks by targeted industry.

        Args:
          continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes.
              Prefix with `-` to exclude continents from results. For example, `-EU,NA`
              excludes results from EU, but includes results from NA.

          date_end: End of the date range (inclusive). Alternative to `dateRange`; provide together
              with `dateStart`. When requesting comparison series, every series must resolve
              to the same duration as the main series. Each `dateStart`/`dateEnd` is floored
              to the nearest 15 minutes before evaluation, so windows whose durations match
              only before alignment may be rejected.

          date_range: Filters results by relative date range ending at the current time, with each
              value producing a separate series. Use `<n>d` for days (up to `364d`) or `<n>w`
              for weeks (up to `52w`). Append `control` to request the equivalent previous
              period for comparison: the comparison window is shifted back by the current
              window's length rounded up to a whole number of weeks, so it keeps the same
              weekday alignment and does not overlap the current window (e.g. `7dcontrol`
              covers days -14 to -7, `10dcontrol` covers days -24 to -14). For example, pass
              `7d` and `7dcontrol` to compare this week with the previous week. All series
              must resolve to the same duration as the main series; relative ranges (including
              `control`) satisfy this automatically. Use this parameter or set specific start
              and end dates (`dateStart` and `dateEnd` parameters).

          date_start: Start of the date range. Alternative to `dateRange`; provide together with
              `dateEnd`. When requesting comparison series, every series must resolve to the
              same duration as the main series. Each `dateStart`/`dateEnd` is floored to the
              nearest 15 minutes before evaluation, so windows whose durations match only
              before alignment may be rejected.

          direction: Specifies whether the `location` filter applies to the source or target
              location.

          format: Format in which results will be returned.

          ip_version: Filters results by IP version (Ipv4 vs. IPv6).

          limit_per_group: Limits the number of objects per group to the top items within the specified
              time range. When item count exceeds the limit, extra items appear grouped under
              an "other" category. Only supported on high-cardinality dimensions; otherwise
              the request is rejected. Minimum value is 2.

          location: Filters results by location. Specify a comma-separated list of alpha-2 codes.
              Prefix with `-` to exclude locations from results. For example, `-US,PT`
              excludes results from the US, but includes results from PT.

          name: Array of names used to label the series in the response.

          protocol: Filters the results by layer 3/4 protocol.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        """
        return await self._get(
            "/radar/attacks/layer3/summary/industry",
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                query=await async_maybe_transform(
                    {
                        "continent": continent,
                        "date_end": date_end,
                        "date_range": date_range,
                        "date_start": date_start,
                        "direction": direction,
                        "format": format,
                        "ip_version": ip_version,
                        "limit_per_group": limit_per_group,
                        "location": location,
                        "name": name,
                        "protocol": protocol,
                    },
                    summary_industry_params.SummaryIndustryParams,
                ),
                post_parser=ResultWrapper[SummaryIndustryResponse]._unwrapper,
            ),
            cast_to=cast(Type[SummaryIndustryResponse], ResultWrapper[SummaryIndustryResponse]),
        )

    @typing_extensions.deprecated(
        "Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead."
    )
    async def ip_version(
        self,
        *,
        continent: SequenceNotStr[str] | Omit = omit,
        date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit,
        date_range: SequenceNotStr[str] | Omit = omit,
        date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit,
        direction: Literal["ORIGIN", "TARGET"] | Omit = omit,
        format: Literal["JSON", "CSV"] | Omit = omit,
        location: SequenceNotStr[str] | Omit = omit,
        name: SequenceNotStr[str] | Omit = omit,
        protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit,
        # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
        # The extra values given here take precedence over values defined on the client or passed to this method.
        extra_headers: Headers | None = None,
        extra_query: Query | None = None,
        extra_body: Body | None = None,
        timeout: float | httpx.Timeout | None | NotGiven = not_given,
    ) -> SummaryIPVersionResponse:
        """
        Retrieves the distribution of layer 3 attacks by IP version.

        Args:
          continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes.
              Prefix with `-` to exclude continents from results. For example, `-EU,NA`
              excludes results from EU, but includes results from NA.

          date_end: End of the date range (inclusive). Alternative to `dateRange`; provide together
              with `dateStart`. When requesting comparison series, every series must resolve
              to the same duration as the main series. Each `dateStart`/`dateEnd` is floored
              to the nearest 15 minutes before evaluation, so windows whose durations match
              only before alignment may be rejected.

          date_range: Filters results by relative date range ending at the current time, with each
              value producing a separate series. Use `<n>d` for days (up to `364d`) or `<n>w`
              for weeks (up to `52w`). Append `control` to request the equivalent previous
              period for comparison: the comparison window is shifted back by the current
              window's length rounded up to a whole number of weeks, so it keeps the same
              weekday alignment and does not overlap the current window (e.g. `7dcontrol`
              covers days -14 to -7, `10dcontrol` covers days -24 to -14). For example, pass
              `7d` and `7dcontrol` to compare this week with the previous week. All series
              must resolve to the same duration as the main series; relative ranges (including
              `control`) satisfy this automatically. Use this parameter or set specific start
              and end dates (`dateStart` and `dateEnd` parameters).

          date_start: Start of the date range. Alternative to `dateRange`; provide together with
              `dateEnd`. When requesting comparison series, every series must resolve to the
              same duration as the main series. Each `dateStart`/`dateEnd` is floored to the
              nearest 15 minutes before evaluation, so windows whose durations match only
              before alignment may be rejected.

          direction: Specifies whether the `location` filter applies to the source or target
              location.

          format: Format in which results will be returned.

          location: Filters results by location. Specify a comma-separated list of alpha-2 codes.
              Prefix with `-` to exclude locations from results. For example, `-US,PT`
              excludes results from the US, but includes results from PT.

          name: Array of names used to label the series in the response.

          protocol: Filters the results by layer 3/4 protocol.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        """
        return await self._get(
            "/radar/attacks/layer3/summary/ip_version",
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                query=await async_maybe_transform(
                    {
                        "continent": continent,
                        "date_end": date_end,
                        "date_range": date_range,
                        "date_start": date_start,
                        "direction": direction,
                        "format": format,
                        "location": location,
                        "name": name,
                        "protocol": protocol,
                    },
                    summary_ip_version_params.SummaryIPVersionParams,
                ),
                post_parser=ResultWrapper[SummaryIPVersionResponse]._unwrapper,
            ),
            cast_to=cast(Type[SummaryIPVersionResponse], ResultWrapper[SummaryIPVersionResponse]),
        )

    @typing_extensions.deprecated(
        "Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead."
    )
    async def protocol(
        self,
        *,
        continent: SequenceNotStr[str] | Omit = omit,
        date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit,
        date_range: SequenceNotStr[str] | Omit = omit,
        date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit,
        direction: Literal["ORIGIN", "TARGET"] | Omit = omit,
        format: Literal["JSON", "CSV"] | Omit = omit,
        ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit,
        location: SequenceNotStr[str] | Omit = omit,
        name: SequenceNotStr[str] | Omit = omit,
        # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
        # The extra values given here take precedence over values defined on the client or passed to this method.
        extra_headers: Headers | None = None,
        extra_query: Query | None = None,
        extra_body: Body | None = None,
        timeout: float | httpx.Timeout | None | NotGiven = not_given,
    ) -> SummaryProtocolResponse:
        """
        Retrieves the distribution of layer 3 attacks by protocol.

        Args:
          continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes.
              Prefix with `-` to exclude continents from results. For example, `-EU,NA`
              excludes results from EU, but includes results from NA.

          date_end: End of the date range (inclusive). Alternative to `dateRange`; provide together
              with `dateStart`. When requesting comparison series, every series must resolve
              to the same duration as the main series. Each `dateStart`/`dateEnd` is floored
              to the nearest 15 minutes before evaluation, so windows whose durations match
              only before alignment may be rejected.

          date_range: Filters results by relative date range ending at the current time, with each
              value producing a separate series. Use `<n>d` for days (up to `364d`) or `<n>w`
              for weeks (up to `52w`). Append `control` to request the equivalent previous
              period for comparison: the comparison window is shifted back by the current
              window's length rounded up to a whole number of weeks, so it keeps the same
              weekday alignment and does not overlap the current window (e.g. `7dcontrol`
              covers days -14 to -7, `10dcontrol` covers days -24 to -14). For example, pass
              `7d` and `7dcontrol` to compare this week with the previous week. All series
              must resolve to the same duration as the main series; relative ranges (including
              `control`) satisfy this automatically. Use this parameter or set specific start
              and end dates (`dateStart` and `dateEnd` parameters).

          date_start: Start of the date range. Alternative to `dateRange`; provide together with
              `dateEnd`. When requesting comparison series, every series must resolve to the
              same duration as the main series. Each `dateStart`/`dateEnd` is floored to the
              nearest 15 minutes before evaluation, so windows whose durations match only
              before alignment may be rejected.

          direction: Specifies whether the `location` filter applies to the source or target
              location.

          format: Format in which results will be returned.

          ip_version: Filters results by IP version (Ipv4 vs. IPv6).

          location: Filters results by location. Specify a comma-separated list of alpha-2 codes.
              Prefix with `-` to exclude locations from results. For example, `-US,PT`
              excludes results from the US, but includes results from PT.

          name: Array of names used to label the series in the response.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        """
        return await self._get(
            "/radar/attacks/layer3/summary/protocol",
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                query=await async_maybe_transform(
                    {
                        "continent": continent,
                        "date_end": date_end,
                        "date_range": date_range,
                        "date_start": date_start,
                        "direction": direction,
                        "format": format,
                        "ip_version": ip_version,
                        "location": location,
                        "name": name,
                    },
                    summary_protocol_params.SummaryProtocolParams,
                ),
                post_parser=ResultWrapper[SummaryProtocolResponse]._unwrapper,
            ),
            cast_to=cast(Type[SummaryProtocolResponse], ResultWrapper[SummaryProtocolResponse]),
        )

    @typing_extensions.deprecated(
        "Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead."
    )
    async def vector(
        self,
        *,
        continent: SequenceNotStr[str] | Omit = omit,
        date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit,
        date_range: SequenceNotStr[str] | Omit = omit,
        date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit,
        direction: Literal["ORIGIN", "TARGET"] | Omit = omit,
        format: Literal["JSON", "CSV"] | Omit = omit,
        ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit,
        limit_per_group: int | Omit = omit,
        location: SequenceNotStr[str] | Omit = omit,
        name: SequenceNotStr[str] | Omit = omit,
        protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit,
        # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
        # The extra values given here take precedence over values defined on the client or passed to this method.
        extra_headers: Headers | None = None,
        extra_query: Query | None = None,
        extra_body: Body | None = None,
        timeout: float | httpx.Timeout | None | NotGiven = not_given,
    ) -> SummaryVectorResponse:
        """
        Retrieves the distribution of layer 3 attacks by vector.

        Args:
          continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes.
              Prefix with `-` to exclude continents from results. For example, `-EU,NA`
              excludes results from EU, but includes results from NA.

          date_end: End of the date range (inclusive). Alternative to `dateRange`; provide together
              with `dateStart`. When requesting comparison series, every series must resolve
              to the same duration as the main series. Each `dateStart`/`dateEnd` is floored
              to the nearest 15 minutes before evaluation, so windows whose durations match
              only before alignment may be rejected.

          date_range: Filters results by relative date range ending at the current time, with each
              value producing a separate series. Use `<n>d` for days (up to `364d`) or `<n>w`
              for weeks (up to `52w`). Append `control` to request the equivalent previous
              period for comparison: the comparison window is shifted back by the current
              window's length rounded up to a whole number of weeks, so it keeps the same
              weekday alignment and does not overlap the current window (e.g. `7dcontrol`
              covers days -14 to -7, `10dcontrol` covers days -24 to -14). For example, pass
              `7d` and `7dcontrol` to compare this week with the previous week. All series
              must resolve to the same duration as the main series; relative ranges (including
              `control`) satisfy this automatically. Use this parameter or set specific start
              and end dates (`dateStart` and `dateEnd` parameters).

          date_start: Start of the date range. Alternative to `dateRange`; provide together with
              `dateEnd`. When requesting comparison series, every series must resolve to the
              same duration as the main series. Each `dateStart`/`dateEnd` is floored to the
              nearest 15 minutes before evaluation, so windows whose durations match only
              before alignment may be rejected.

          direction: Specifies whether the `location` filter applies to the source or target
              location.

          format: Format in which results will be returned.

          ip_version: Filters results by IP version (Ipv4 vs. IPv6).

          limit_per_group: Limits the number of objects per group to the top items within the specified
              time range. When item count exceeds the limit, extra items appear grouped under
              an "other" category. Only supported on high-cardinality dimensions; otherwise
              the request is rejected. Minimum value is 2.

          location: Filters results by location. Specify a comma-separated list of alpha-2 codes.
              Prefix with `-` to exclude locations from results. For example, `-US,PT`
              excludes results from the US, but includes results from PT.

          name: Array of names used to label the series in the response.

          protocol: Filters the results by layer 3/4 protocol.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        """
        return await self._get(
            "/radar/attacks/layer3/summary/vector",
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                query=await async_maybe_transform(
                    {
                        "continent": continent,
                        "date_end": date_end,
                        "date_range": date_range,
                        "date_start": date_start,
                        "direction": direction,
                        "format": format,
                        "ip_version": ip_version,
                        "limit_per_group": limit_per_group,
                        "location": location,
                        "name": name,
                        "protocol": protocol,
                    },
                    summary_vector_params.SummaryVectorParams,
                ),
                post_parser=ResultWrapper[SummaryVectorResponse]._unwrapper,
            ),
            cast_to=cast(Type[SummaryVectorResponse], ResultWrapper[SummaryVectorResponse]),
        )

    @typing_extensions.deprecated(
        "Use [Radar Attacks Layer 3 Summary By Dimension](https://developers.cloudflare.com/api/resources/radar/subresources/attacks/subresources/layer3/methods/summary_v2/) instead."
    )
    async def vertical(
        self,
        *,
        continent: SequenceNotStr[str] | Omit = omit,
        date_end: SequenceNotStr[Union[str, datetime]] | Omit = omit,
        date_range: SequenceNotStr[str] | Omit = omit,
        date_start: SequenceNotStr[Union[str, datetime]] | Omit = omit,
        direction: Literal["ORIGIN", "TARGET"] | Omit = omit,
        format: Literal["JSON", "CSV"] | Omit = omit,
        ip_version: List[Literal["IPv4", "IPv6"]] | Omit = omit,
        limit_per_group: int | Omit = omit,
        location: SequenceNotStr[str] | Omit = omit,
        name: SequenceNotStr[str] | Omit = omit,
        protocol: List[Literal["UDP", "TCP", "ICMP", "GRE"]] | Omit = omit,
        # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
        # The extra values given here take precedence over values defined on the client or passed to this method.
        extra_headers: Headers | None = None,
        extra_query: Query | None = None,
        extra_body: Body | None = None,
        timeout: float | httpx.Timeout | None | NotGiven = not_given,
    ) -> SummaryVerticalResponse:
        """
        Retrieves the distribution of layer 3 attacks by targeted vertical.

        Args:
          continent: Filters results by continent. Specify a comma-separated list of alpha-2 codes.
              Prefix with `-` to exclude continents from results. For example, `-EU,NA`
              excludes results from EU, but includes results from NA.

          date_end: End of the date range (inclusive). Alternative to `dateRange`; provide together
              with `dateStart`. When requesting comparison series, every series must resolve
              to the same duration as the main series. Each `dateStart`/`dateEnd` is floored
              to the nearest 15 minutes before evaluation, so windows whose durations match
              only before alignment may be rejected.

          date_range: Filters results by relative date range ending at the current time, with each
              value producing a separate series. Use `<n>d` for days (up to `364d`) or `<n>w`
              for weeks (up to `52w`). Append `control` to request the equivalent previous
              period for comparison: the comparison window is shifted back by the current
              window's length rounded up to a whole number of weeks, so it keeps the same
              weekday alignment and does not overlap the current window (e.g. `7dcontrol`
              covers days -14 to -7, `10dcontrol` covers days -24 to -14). For example, pass
              `7d` and `7dcontrol` to compare this week with the previous week. All series
              must resolve to the same duration as the main series; relative ranges (including
              `control`) satisfy this automatically. Use this parameter or set specific start
              and end dates (`dateStart` and `dateEnd` parameters).

          date_start: Start of the date range. Alternative to `dateRange`; provide together with
              `dateEnd`. When requesting comparison series, every series must resolve to the
              same duration as the main series. Each `dateStart`/`dateEnd` is floored to the
              nearest 15 minutes before evaluation, so windows whose durations match only
              before alignment may be rejected.

          direction: Specifies whether the `location` filter applies to the source or target
              location.

          format: Format in which results will be returned.

          ip_version: Filters results by IP version (Ipv4 vs. IPv6).

          limit_per_group: Limits the number of objects per group to the top items within the specified
              time range. When item count exceeds the limit, extra items appear grouped under
              an "other" category. Only supported on high-cardinality dimensions; otherwise
              the request is rejected. Minimum value is 2.

          location: Filters results by location. Specify a comma-separated list of alpha-2 codes.
              Prefix with `-` to exclude locations from results. For example, `-US,PT`
              excludes results from the US, but includes results from PT.

          name: Array of names used to label the series in the response.

          protocol: Filters the results by layer 3/4 protocol.

          extra_headers: Send extra headers

          extra_query: Add additional query parameters to the request

          extra_body: Add additional JSON properties to the request

          timeout: Override the client-level default timeout for this request, in seconds
        """
        return await self._get(
            "/radar/attacks/layer3/summary/vertical",
            options=make_request_options(
                extra_headers=extra_headers,
                extra_query=extra_query,
                extra_body=extra_body,
                timeout=timeout,
                query=await async_maybe_transform(
                    {
                        "continent": continent,
                        "date_end": date_end,
                        "date_range": date_range,
                        "date_start": date_start,
                        "direction": direction,
                        "format": format,
                        "ip_version": ip_version,
                        "limit_per_group": limit_per_group,
                        "location": location,
                        "name": name,
                        "protocol": protocol,
                    },
                    summary_vertical_params.SummaryVerticalParams,
                ),
                post_parser=ResultWrapper[SummaryVerticalResponse]._unwrapper,
            ),
            cast_to=cast(Type[SummaryVerticalResponse], ResultWrapper[SummaryVerticalResponse]),
        )


class SummaryResourceWithRawResponse:
    def __init__(self, summary: SummaryResource) -> None:
        self._summary = summary

        self.bitrate = (  # pyright: ignore[reportDeprecated]
            to_raw_response_wrapper(
                summary.bitrate,  # pyright: ignore[reportDeprecated],
            )
        )
        self.duration = (  # pyright: ignore[reportDeprecated]
            to_raw_response_wrapper(
                summary.duration,  # pyright: ignore[reportDeprecated],
            )
        )
        self.industry = (  # pyright: ignore[reportDeprecated]
            to_raw_response_wrapper(
                summary.industry,  # pyright: ignore[reportDeprecated],
            )
        )
        self.ip_version = (  # pyright: ignore[reportDeprecated]
            to_raw_response_wrapper(
                summary.ip_version,  # pyright: ignore[reportDeprecated],
            )
        )
        self.protocol = (  # pyright: ignore[reportDeprecated]
            to_raw_response_wrapper(
                summary.protocol,  # pyright: ignore[reportDeprecated],
            )
        )
        self.vector = (  # pyright: ignore[reportDeprecated]
            to_raw_response_wrapper(
                summary.vector,  # pyright: ignore[reportDeprecated],
            )
        )
        self.vertical = (  # pyright: ignore[reportDeprecated]
            to_raw_response_wrapper(
                summary.vertical,  # pyright: ignore[reportDeprecated],
            )
        )


class AsyncSummaryResourceWithRawResponse:
    def __init__(self, summary: AsyncSummaryResource) -> None:
        self._summary = summary

        self.bitrate = (  # pyright: ignore[reportDeprecated]
            async_to_raw_response_wrapper(
                summary.bitrate,  # pyright: ignore[reportDeprecated],
            )
        )
        self.duration = (  # pyright: ignore[reportDeprecated]
            async_to_raw_response_wrapper(
                summary.duration,  # pyright: ignore[reportDeprecated],
            )
        )
        self.industry = (  # pyright: ignore[reportDeprecated]
            async_to_raw_response_wrapper(
                summary.industry,  # pyright: ignore[reportDeprecated],
            )
        )
        self.ip_version = (  # pyright: ignore[reportDeprecated]
            async_to_raw_response_wrapper(
                summary.ip_version,  # pyright: ignore[reportDeprecated],
            )
        )
        self.protocol = (  # pyright: ignore[reportDeprecated]
            async_to_raw_response_wrapper(
                summary.protocol,  # pyright: ignore[reportDeprecated],
            )
        )
        self.vector = (  # pyright: ignore[reportDeprecated]
            async_to_raw_response_wrapper(
                summary.vector,  # pyright: ignore[reportDeprecated],
            )
        )
        self.vertical = (  # pyright: ignore[reportDeprecated]
            async_to_raw_response_wrapper(
                summary.vertical,  # pyright: ignore[reportDeprecated],
            )
        )


class SummaryResourceWithStreamingResponse:
    def __init__(self, summary: SummaryResource) -> None:
        self._summary = summary

        self.bitrate = (  # pyright: ignore[reportDeprecated]
            to_streamed_response_wrapper(
                summary.bitrate,  # pyright: ignore[reportDeprecated],
            )
        )
        self.duration = (  # pyright: ignore[reportDeprecated]
            to_streamed_response_wrapper(
                summary.duration,  # pyright: ignore[reportDeprecated],
            )
        )
        self.industry = (  # pyright: ignore[reportDeprecated]
            to_streamed_response_wrapper(
                summary.industry,  # pyright: ignore[reportDeprecated],
            )
        )
        self.ip_version = (  # pyright: ignore[reportDeprecated]
            to_streamed_response_wrapper(
                summary.ip_version,  # pyright: ignore[reportDeprecated],
            )
        )
        self.protocol = (  # pyright: ignore[reportDeprecated]
            to_streamed_response_wrapper(
                summary.protocol,  # pyright: ignore[reportDeprecated],
            )
        )
        self.vector = (  # pyright: ignore[reportDeprecated]
            to_streamed_response_wrapper(
                summary.vector,  # pyright: ignore[reportDeprecated],
            )
        )
        self.vertical = (  # pyright: ignore[reportDeprecated]
            to_streamed_response_wrapper(
                summary.vertical,  # pyright: ignore[reportDeprecated],
            )
        )


class AsyncSummaryResourceWithStreamingResponse:
    def __init__(self, summary: AsyncSummaryResource) -> None:
        self._summary = summary

        self.bitrate = (  # pyright: ignore[reportDeprecated]
            async_to_streamed_response_wrapper(
                summary.bitrate,  # pyright: ignore[reportDeprecated],
            )
        )
        self.duration = (  # pyright: ignore[reportDeprecated]
            async_to_streamed_response_wrapper(
                summary.duration,  # pyright: ignore[reportDeprecated],
            )
        )
        self.industry = (  # pyright: ignore[reportDeprecated]
            async_to_streamed_response_wrapper(
                summary.industry,  # pyright: ignore[reportDeprecated],
            )
        )
        self.ip_version = (  # pyright: ignore[reportDeprecated]
            async_to_streamed_response_wrapper(
                summary.ip_version,  # pyright: ignore[reportDeprecated],
            )
        )
        self.protocol = (  # pyright: ignore[reportDeprecated]
            async_to_streamed_response_wrapper(
                summary.protocol,  # pyright: ignore[reportDeprecated],
            )
        )
        self.vector = (  # pyright: ignore[reportDeprecated]
            async_to_streamed_response_wrapper(
                summary.vector,  # pyright: ignore[reportDeprecated],
            )
        )
        self.vertical = (  # pyright: ignore[reportDeprecated]
            async_to_streamed_response_wrapper(
                summary.vertical,  # pyright: ignore[reportDeprecated],
            )
        )
