Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): OpenAPI spec update via Stainless API #318

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1647,7 +1647,7 @@ from cloudflare.types.dns.analytics import Report

Methods:

- <code title="get /zones/{zone_id}/dns_analytics/report">client.dns.analytics.reports.<a href="./src/cloudflare/resources/dns/analytics/reports/reports.py">get</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/dns/analytics/report_get_params.py">params</a>) -> <a href="./src/cloudflare/types/dns/analytics/report.py">Report</a></code>
- <code title="get /zones/{zone_id}/dns_analytics/report">client.dns.analytics.reports.<a href="./src/cloudflare/resources/dns/analytics/reports/reports.py">get</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/dns/analytics/report_get_params.py">params</a>) -> <a href="./src/cloudflare/types/dns/analytics/report.py">Optional</a></code>

#### Bytimes

Expand All @@ -1659,7 +1659,7 @@ from cloudflare.types.dns.analytics.reports import ByTime

Methods:

- <code title="get /zones/{zone_id}/dns_analytics/report/bytime">client.dns.analytics.reports.bytimes.<a href="./src/cloudflare/resources/dns/analytics/reports/bytimes.py">get</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/dns/analytics/reports/bytime_get_params.py">params</a>) -> <a href="./src/cloudflare/types/dns/analytics/reports/by_time.py">ByTime</a></code>
- <code title="get /zones/{zone_id}/dns_analytics/report/bytime">client.dns.analytics.reports.bytimes.<a href="./src/cloudflare/resources/dns/analytics/reports/bytimes.py">get</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/dns/analytics/reports/bytime_get_params.py">params</a>) -> <a href="./src/cloudflare/types/dns/analytics/reports/by_time.py">Optional</a></code>

## FirewallResource

Expand Down Expand Up @@ -1689,13 +1689,13 @@ Methods:

Methods:

- <code title="get /accounts/{account_id}/dns_firewall/{dns_firewall_id}/dns_analytics/report">client.dns.firewall.analytics.reports.<a href="./src/cloudflare/resources/dns/firewall/analytics/reports/reports.py">get</a>(dns_firewall_id, \*, account_id, \*\*<a href="src/cloudflare/types/dns/firewall/analytics/report_get_params.py">params</a>) -> <a href="./src/cloudflare/types/dns/analytics/report.py">Report</a></code>
- <code title="get /accounts/{account_id}/dns_firewall/{dns_firewall_id}/dns_analytics/report">client.dns.firewall.analytics.reports.<a href="./src/cloudflare/resources/dns/firewall/analytics/reports/reports.py">get</a>(dns_firewall_id, \*, account_id, \*\*<a href="src/cloudflare/types/dns/firewall/analytics/report_get_params.py">params</a>) -> <a href="./src/cloudflare/types/dns/analytics/report.py">Optional</a></code>

##### Bytimes

Methods:

- <code title="get /accounts/{account_id}/dns_firewall/{dns_firewall_id}/dns_analytics/report/bytime">client.dns.firewall.analytics.reports.bytimes.<a href="./src/cloudflare/resources/dns/firewall/analytics/reports/bytimes.py">get</a>(dns_firewall_id, \*, account_id, \*\*<a href="src/cloudflare/types/dns/firewall/analytics/reports/bytime_get_params.py">params</a>) -> <a href="./src/cloudflare/types/dns/analytics/reports/by_time.py">ByTime</a></code>
- <code title="get /accounts/{account_id}/dns_firewall/{dns_firewall_id}/dns_analytics/report/bytime">client.dns.firewall.analytics.reports.bytimes.<a href="./src/cloudflare/resources/dns/firewall/analytics/reports/bytimes.py">get</a>(dns_firewall_id, \*, account_id, \*\*<a href="src/cloudflare/types/dns/firewall/analytics/reports/bytime_get_params.py">params</a>) -> <a href="./src/cloudflare/types/dns/analytics/reports/by_time.py">Optional</a></code>

# DNSSECResource

Expand Down
10 changes: 5 additions & 5 deletions src/cloudflare/resources/dns/analytics/reports/bytimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

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

Expand Down Expand Up @@ -58,7 +58,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ByTime:
) -> Optional[ByTime]:
"""
Retrieves a list of aggregate metrics grouped by time interval.

Expand Down Expand Up @@ -118,7 +118,7 @@ def get(
),
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[ByTime], ResultWrapper[ByTime]),
cast_to=cast(Type[Optional[ByTime]], ResultWrapper[ByTime]),
)


Expand Down Expand Up @@ -150,7 +150,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ByTime:
) -> Optional[ByTime]:
"""
Retrieves a list of aggregate metrics grouped by time interval.

Expand Down Expand Up @@ -210,7 +210,7 @@ async def get(
),
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[ByTime], ResultWrapper[ByTime]),
cast_to=cast(Type[Optional[ByTime]], ResultWrapper[ByTime]),
)


Expand Down
10 changes: 5 additions & 5 deletions src/cloudflare/resources/dns/analytics/reports/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Type, Union, cast
from typing import Type, Union, Optional, cast
from datetime import datetime

import httpx
Expand Down Expand Up @@ -67,7 +67,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Report:
) -> Optional[Report]:
"""
Retrieves a list of summarised aggregate metrics over a given time period.

Expand Down Expand Up @@ -124,7 +124,7 @@ def get(
),
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Report], ResultWrapper[Report]),
cast_to=cast(Type[Optional[Report]], ResultWrapper[Report]),
)


Expand Down Expand Up @@ -158,7 +158,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Report:
) -> Optional[Report]:
"""
Retrieves a list of summarised aggregate metrics over a given time period.

Expand Down Expand Up @@ -215,7 +215,7 @@ async def get(
),
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Report], ResultWrapper[Report]),
cast_to=cast(Type[Optional[Report]], ResultWrapper[Report]),
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

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

Expand Down Expand Up @@ -60,7 +60,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ByTime:
) -> Optional[ByTime]:
"""
Retrieves a list of aggregate metrics grouped by time interval.

Expand Down Expand Up @@ -124,7 +124,7 @@ def get(
),
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[ByTime], ResultWrapper[ByTime]),
cast_to=cast(Type[Optional[ByTime]], ResultWrapper[ByTime]),
)


Expand Down Expand Up @@ -157,7 +157,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> ByTime:
) -> Optional[ByTime]:
"""
Retrieves a list of aggregate metrics grouped by time interval.

Expand Down Expand Up @@ -221,7 +221,7 @@ async def get(
),
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[ByTime], ResultWrapper[ByTime]),
cast_to=cast(Type[Optional[ByTime]], ResultWrapper[ByTime]),
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Type, Union, cast
from typing import Type, Union, Optional, cast
from datetime import datetime

import httpx
Expand Down Expand Up @@ -69,7 +69,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Report:
) -> Optional[Report]:
"""
Retrieves a list of summarised aggregate metrics over a given time period.

Expand Down Expand Up @@ -130,7 +130,7 @@ def get(
),
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Report], ResultWrapper[Report]),
cast_to=cast(Type[Optional[Report]], ResultWrapper[Report]),
)


Expand Down Expand Up @@ -165,7 +165,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Report:
) -> Optional[Report]:
"""
Retrieves a list of summarised aggregate metrics over a given time period.

Expand Down Expand Up @@ -226,7 +226,7 @@ async def get(
),
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Report], ResultWrapper[Report]),
cast_to=cast(Type[Optional[Report]], ResultWrapper[Report]),
)


Expand Down
18 changes: 9 additions & 9 deletions tests/api_resources/dns/analytics/reports/test_bytimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import annotations

import os
from typing import Any, cast
from typing import Any, Optional, cast

import pytest

Expand All @@ -24,7 +24,7 @@ def test_method_get(self, client: Cloudflare) -> None:
bytime = client.dns.analytics.reports.bytimes.get(
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(ByTime, bytime, path=["response"])
assert_matches_type(Optional[ByTime], bytime, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -40,7 +40,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None:
time_delta="hour",
until=parse_datetime("2023-11-11T13:00:00Z"),
)
assert_matches_type(ByTime, bytime, path=["response"])
assert_matches_type(Optional[ByTime], bytime, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -52,7 +52,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
bytime = response.parse()
assert_matches_type(ByTime, bytime, path=["response"])
assert_matches_type(Optional[ByTime], bytime, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -64,7 +64,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

bytime = response.parse()
assert_matches_type(ByTime, bytime, path=["response"])
assert_matches_type(Optional[ByTime], bytime, path=["response"])

assert cast(Any, response.is_closed) is True

Expand All @@ -86,7 +86,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None:
bytime = await async_client.dns.analytics.reports.bytimes.get(
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(ByTime, bytime, path=["response"])
assert_matches_type(Optional[ByTime], bytime, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -102,7 +102,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -
time_delta="hour",
until=parse_datetime("2023-11-11T13:00:00Z"),
)
assert_matches_type(ByTime, bytime, path=["response"])
assert_matches_type(Optional[ByTime], bytime, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -114,7 +114,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
bytime = await response.parse()
assert_matches_type(ByTime, bytime, path=["response"])
assert_matches_type(Optional[ByTime], bytime, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -126,7 +126,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

bytime = await response.parse()
assert_matches_type(ByTime, bytime, path=["response"])
assert_matches_type(Optional[ByTime], bytime, path=["response"])

assert cast(Any, response.is_closed) is True

Expand Down
18 changes: 9 additions & 9 deletions tests/api_resources/dns/analytics/test_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import annotations

import os
from typing import Any, cast
from typing import Any, Optional, cast

import pytest

Expand All @@ -24,7 +24,7 @@ def test_method_get(self, client: Cloudflare) -> None:
report = client.dns.analytics.reports.get(
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(Report, report, path=["response"])
assert_matches_type(Optional[Report], report, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -39,7 +39,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None:
sort="+responseCode,-queryName",
until=parse_datetime("2023-11-11T13:00:00Z"),
)
assert_matches_type(Report, report, path=["response"])
assert_matches_type(Optional[Report], report, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -51,7 +51,7 @@ def test_raw_response_get(self, client: Cloudflare) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
report = response.parse()
assert_matches_type(Report, report, path=["response"])
assert_matches_type(Optional[Report], report, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -63,7 +63,7 @@ def test_streaming_response_get(self, client: Cloudflare) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

report = response.parse()
assert_matches_type(Report, report, path=["response"])
assert_matches_type(Optional[Report], report, path=["response"])

assert cast(Any, response.is_closed) is True

Expand All @@ -85,7 +85,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None:
report = await async_client.dns.analytics.reports.get(
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(Report, report, path=["response"])
assert_matches_type(Optional[Report], report, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -100,7 +100,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -
sort="+responseCode,-queryName",
until=parse_datetime("2023-11-11T13:00:00Z"),
)
assert_matches_type(Report, report, path=["response"])
assert_matches_type(Optional[Report], report, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -112,7 +112,7 @@ async def test_raw_response_get(self, async_client: AsyncCloudflare) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
report = await response.parse()
assert_matches_type(Report, report, path=["response"])
assert_matches_type(Optional[Report], report, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -124,7 +124,7 @@ async def test_streaming_response_get(self, async_client: AsyncCloudflare) -> No
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

report = await response.parse()
assert_matches_type(Report, report, path=["response"])
assert_matches_type(Optional[Report], report, path=["response"])

assert cast(Any, response.is_closed) is True

Expand Down
Loading