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 #330

Merged
merged 1 commit into from
Apr 16, 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
6 changes: 3 additions & 3 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2050,7 +2050,7 @@ from cloudflare.types.logpush.datasets import JobGetResponse

Methods:

- <code title="get /{account_or_zone}/{account_or_zone_id}/logpush/datasets/{dataset_id}/jobs">client.logpush.datasets.jobs.<a href="./src/cloudflare/resources/logpush/datasets/jobs.py">get</a>(dataset_id, \*, account_id, zone_id) -> <a href="./src/cloudflare/types/logpush/datasets/job_get_response.py">JobGetResponse</a></code>
- <code title="get /{account_or_zone}/{account_or_zone_id}/logpush/datasets/{dataset_id}/jobs">client.logpush.datasets.jobs.<a href="./src/cloudflare/resources/logpush/datasets/jobs.py">get</a>(dataset_id, \*, account_id, zone_id) -> <a href="./src/cloudflare/types/logpush/datasets/job_get_response.py">Optional</a></code>

## Edge

Expand All @@ -2063,7 +2063,7 @@ from cloudflare.types.logpush import InstantLogpushJob, EdgeGetResponse
Methods:

- <code title="post /zones/{zone_id}/logpush/edge">client.logpush.edge.<a href="./src/cloudflare/resources/logpush/edge.py">create</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/logpush/edge_create_params.py">params</a>) -> <a href="./src/cloudflare/types/logpush/instant_logpush_job.py">Optional</a></code>
- <code title="get /zones/{zone_id}/logpush/edge">client.logpush.edge.<a href="./src/cloudflare/resources/logpush/edge.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/logpush/edge_get_response.py">EdgeGetResponse</a></code>
- <code title="get /zones/{zone_id}/logpush/edge">client.logpush.edge.<a href="./src/cloudflare/resources/logpush/edge.py">get</a>(\*, zone_id) -> <a href="./src/cloudflare/types/logpush/edge_get_response.py">Optional</a></code>

## Jobs

Expand All @@ -2078,7 +2078,7 @@ Methods:
- <code title="post /{account_or_zone}/{account_or_zone_id}/logpush/jobs">client.logpush.jobs.<a href="./src/cloudflare/resources/logpush/jobs.py">create</a>(\*, account_id, zone_id, \*\*<a href="src/cloudflare/types/logpush/job_create_params.py">params</a>) -> <a href="./src/cloudflare/types/logpush/logpush_job.py">Optional</a></code>
- <code title="put /{account_or_zone}/{account_or_zone_id}/logpush/jobs/{job_id}">client.logpush.jobs.<a href="./src/cloudflare/resources/logpush/jobs.py">update</a>(job_id, \*, account_id, zone_id, \*\*<a href="src/cloudflare/types/logpush/job_update_params.py">params</a>) -> <a href="./src/cloudflare/types/logpush/logpush_job.py">Optional</a></code>
- <code title="get /{account_or_zone}/{account_or_zone_id}/logpush/jobs">client.logpush.jobs.<a href="./src/cloudflare/resources/logpush/jobs.py">list</a>(\*, account_id, zone_id) -> <a href="./src/cloudflare/types/logpush/logpush_job.py">SyncSinglePage[Optional]</a></code>
- <code title="delete /{account_or_zone}/{account_or_zone_id}/logpush/jobs/{job_id}">client.logpush.jobs.<a href="./src/cloudflare/resources/logpush/jobs.py">delete</a>(job_id, \*, account_id, zone_id, \*\*<a href="src/cloudflare/types/logpush/job_delete_params.py">params</a>) -> <a href="./src/cloudflare/types/logpush/job_delete_response.py">Optional</a></code>
- <code title="delete /{account_or_zone}/{account_or_zone_id}/logpush/jobs/{job_id}">client.logpush.jobs.<a href="./src/cloudflare/resources/logpush/jobs.py">delete</a>(job_id, \*, account_id, zone_id, \*\*<a href="src/cloudflare/types/logpush/job_delete_params.py">params</a>) -> <a href="./src/cloudflare/types/logpush/job_delete_response.py">object</a></code>
- <code title="get /{account_or_zone}/{account_or_zone_id}/logpush/jobs/{job_id}">client.logpush.jobs.<a href="./src/cloudflare/resources/logpush/jobs.py">get</a>(job_id, \*, account_id, zone_id) -> <a href="./src/cloudflare/types/logpush/logpush_job.py">Optional</a></code>

## Ownership
Expand Down
8 changes: 4 additions & 4 deletions src/cloudflare/resources/logpush/datasets/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> JobGetResponse:
) -> Optional[JobGetResponse]:
"""
Lists Logpush jobs for an account or zone for a dataset.
Expand Down Expand Up @@ -87,7 +87,7 @@ def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[JobGetResponse], ResultWrapper[JobGetResponse]),
cast_to=cast(Type[Optional[JobGetResponse]], ResultWrapper[JobGetResponse]),
)


Expand All @@ -112,7 +112,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> JobGetResponse:
) -> Optional[JobGetResponse]:
"""
Lists Logpush jobs for an account or zone for a dataset.
Expand Down Expand Up @@ -154,7 +154,7 @@ async def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[JobGetResponse], ResultWrapper[JobGetResponse]),
cast_to=cast(Type[Optional[JobGetResponse]], ResultWrapper[JobGetResponse]),
)


Expand Down
8 changes: 4 additions & 4 deletions src/cloudflare/resources/logpush/edge.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> EdgeGetResponse:
) -> Optional[EdgeGetResponse]:
"""
Lists Instant Logs jobs for a zone.
Expand All @@ -131,7 +131,7 @@ def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[EdgeGetResponse], ResultWrapper[EdgeGetResponse]),
cast_to=cast(Type[Optional[EdgeGetResponse]], ResultWrapper[EdgeGetResponse]),
)


Expand Down Expand Up @@ -212,7 +212,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> EdgeGetResponse:
) -> Optional[EdgeGetResponse]:
"""
Lists Instant Logs jobs for a zone.
Expand All @@ -238,7 +238,7 @@ async def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[EdgeGetResponse], ResultWrapper[EdgeGetResponse]),
cast_to=cast(Type[Optional[EdgeGetResponse]], ResultWrapper[EdgeGetResponse]),
)


Expand Down
57 changes: 23 additions & 34 deletions src/cloudflare/resources/logpush/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from __future__ import annotations

from typing import Any, Type, Optional, cast
from typing import Type, Optional, cast
from typing_extensions import Literal

import httpx
Expand All @@ -28,7 +28,6 @@
)
from ...types.logpush import (
LogpushJob,
JobDeleteResponse,
OutputOptionsParam,
job_create_params,
job_delete_params,
Expand Down Expand Up @@ -302,7 +301,7 @@ def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[JobDeleteResponse]:
) -> object:
"""
Deletes a Logpush job.

Expand Down Expand Up @@ -333,22 +332,17 @@ def delete(

account_or_zone = "zones"
account_or_zone_id = zone_id
return cast(
Optional[JobDeleteResponse],
self._delete(
f"/{account_or_zone}/{account_or_zone_id}/logpush/jobs/{job_id}",
body=maybe_transform(body, job_delete_params.JobDeleteParams),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(
Any, ResultWrapper[JobDeleteResponse]
), # Union types cannot be passed in as arguments in the type system
return self._delete(
f"/{account_or_zone}/{account_or_zone_id}/logpush/jobs/{job_id}",
body=maybe_transform(body, job_delete_params.JobDeleteParams),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[object], ResultWrapper[object]),
)

def get(
Expand Down Expand Up @@ -671,7 +665,7 @@ async def delete(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[JobDeleteResponse]:
) -> object:
"""
Deletes a Logpush job.

Expand Down Expand Up @@ -702,22 +696,17 @@ async def delete(

account_or_zone = "zones"
account_or_zone_id = zone_id
return cast(
Optional[JobDeleteResponse],
await self._delete(
f"/{account_or_zone}/{account_or_zone_id}/logpush/jobs/{job_id}",
body=await async_maybe_transform(body, job_delete_params.JobDeleteParams),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(
Any, ResultWrapper[JobDeleteResponse]
), # Union types cannot be passed in as arguments in the type system
return await self._delete(
f"/{account_or_zone}/{account_or_zone_id}/logpush/jobs/{job_id}",
body=await async_maybe_transform(body, job_delete_params.JobDeleteParams),
options=make_request_options(
extra_headers=extra_headers,
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[object], ResultWrapper[object]),
)

async def get(
Expand Down
1 change: 0 additions & 1 deletion src/cloudflare/types/logpush/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from .job_update_params import JobUpdateParams as JobUpdateParams
from .edge_create_params import EdgeCreateParams as EdgeCreateParams
from .instant_logpush_job import InstantLogpushJob as InstantLogpushJob
from .job_delete_response import JobDeleteResponse as JobDeleteResponse
from .output_options_param import OutputOptionsParam as OutputOptionsParam
from .ownership_validation import OwnershipValidation as OwnershipValidation
from .validate_origin_params import ValidateOriginParams as ValidateOriginParams
Expand Down
7 changes: 0 additions & 7 deletions src/cloudflare/types/logpush/job_delete_response.py

This file was deleted.

3 changes: 1 addition & 2 deletions src/cloudflare/types/secondary_dns/outgoing_status.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Optional
from typing_extensions import Literal

__all__ = ["OutgoingStatus"]

OutgoingStatus = Optional[Literal]
OutgoingStatus = Optional[str]
18 changes: 9 additions & 9 deletions tests/api_resources/logpush/datasets/test_jobs.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 @@ -25,7 +25,7 @@ def test_method_get(self, client: Cloudflare) -> None:
account_id="string",
zone_id="string",
)
assert_matches_type(JobGetResponse, job, path=["response"])
assert_matches_type(Optional[JobGetResponse], job, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -35,7 +35,7 @@ def test_method_get_with_all_params(self, client: Cloudflare) -> None:
account_id="string",
zone_id="string",
)
assert_matches_type(JobGetResponse, job, path=["response"])
assert_matches_type(Optional[JobGetResponse], job, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -49,7 +49,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"
job = response.parse()
assert_matches_type(JobGetResponse, job, path=["response"])
assert_matches_type(Optional[JobGetResponse], job, 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"

job = response.parse()
assert_matches_type(JobGetResponse, job, path=["response"])
assert_matches_type(Optional[JobGetResponse], job, path=["response"])

assert cast(Any, response.is_closed) is True

Expand Down Expand Up @@ -103,7 +103,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None:
account_id="string",
zone_id="string",
)
assert_matches_type(JobGetResponse, job, path=["response"])
assert_matches_type(Optional[JobGetResponse], job, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -113,7 +113,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCloudflare) -
account_id="string",
zone_id="string",
)
assert_matches_type(JobGetResponse, job, path=["response"])
assert_matches_type(Optional[JobGetResponse], job, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -127,7 +127,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"
job = await response.parse()
assert_matches_type(JobGetResponse, job, path=["response"])
assert_matches_type(Optional[JobGetResponse], job, path=["response"])

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

job = await response.parse()
assert_matches_type(JobGetResponse, job, path=["response"])
assert_matches_type(Optional[JobGetResponse], job, path=["response"])

assert cast(Any, response.is_closed) is True

Expand Down
12 changes: 6 additions & 6 deletions tests/api_resources/logpush/test_edge.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def test_method_get(self, client: Cloudflare) -> None:
edge = client.logpush.edge.get(
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(EdgeGetResponse, edge, path=["response"])
assert_matches_type(Optional[EdgeGetResponse], edge, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -88,7 +88,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"
edge = response.parse()
assert_matches_type(EdgeGetResponse, edge, path=["response"])
assert_matches_type(Optional[EdgeGetResponse], edge, path=["response"])

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

edge = response.parse()
assert_matches_type(EdgeGetResponse, edge, path=["response"])
assert_matches_type(Optional[EdgeGetResponse], edge, path=["response"])

assert cast(Any, response.is_closed) is True

Expand Down Expand Up @@ -175,7 +175,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None:
edge = await async_client.logpush.edge.get(
zone_id="023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(EdgeGetResponse, edge, path=["response"])
assert_matches_type(Optional[EdgeGetResponse], edge, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -187,7 +187,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"
edge = await response.parse()
assert_matches_type(EdgeGetResponse, edge, path=["response"])
assert_matches_type(Optional[EdgeGetResponse], edge, path=["response"])

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

edge = await response.parse()
assert_matches_type(EdgeGetResponse, edge, path=["response"])
assert_matches_type(Optional[EdgeGetResponse], edge, path=["response"])

assert cast(Any, response.is_closed) is True

Expand Down
Loading