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): update via SDK Studio #342

Merged
merged 1 commit into from
Apr 18, 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 @@ -4360,15 +4360,15 @@ Methods:
Types:

```python
from cloudflare.types.stream import Watermaks, WatermarkDeleteResponse
from cloudflare.types.stream import Watermark, WatermarkDeleteResponse
```

Methods:

- <code title="post /accounts/{account_id}/stream/watermarks">client.stream.watermarks.<a href="./src/cloudflare/resources/stream/watermarks.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/stream/watermark_create_params.py">params</a>) -> <a href="./src/cloudflare/types/stream/watermaks.py">Optional</a></code>
- <code title="get /accounts/{account_id}/stream/watermarks">client.stream.watermarks.<a href="./src/cloudflare/resources/stream/watermarks.py">list</a>(\*, account_id) -> <a href="./src/cloudflare/types/stream/watermaks.py">SyncSinglePage[Watermaks]</a></code>
- <code title="post /accounts/{account_id}/stream/watermarks">client.stream.watermarks.<a href="./src/cloudflare/resources/stream/watermarks.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/stream/watermark_create_params.py">params</a>) -> <a href="./src/cloudflare/types/stream/watermark.py">Optional</a></code>
- <code title="get /accounts/{account_id}/stream/watermarks">client.stream.watermarks.<a href="./src/cloudflare/resources/stream/watermarks.py">list</a>(\*, account_id) -> <a href="./src/cloudflare/types/stream/watermark.py">SyncSinglePage[Watermark]</a></code>
- <code title="delete /accounts/{account_id}/stream/watermarks/{identifier}">client.stream.watermarks.<a href="./src/cloudflare/resources/stream/watermarks.py">delete</a>(identifier, \*, account_id, \*\*<a href="src/cloudflare/types/stream/watermark_delete_params.py">params</a>) -> <a href="./src/cloudflare/types/stream/watermark_delete_response.py">Optional</a></code>
- <code title="get /accounts/{account_id}/stream/watermarks/{identifier}">client.stream.watermarks.<a href="./src/cloudflare/resources/stream/watermarks.py">get</a>(identifier, \*, account_id) -> <a href="./src/cloudflare/types/stream/watermaks.py">Optional</a></code>
- <code title="get /accounts/{account_id}/stream/watermarks/{identifier}">client.stream.watermarks.<a href="./src/cloudflare/resources/stream/watermarks.py">get</a>(identifier, \*, account_id) -> <a href="./src/cloudflare/types/stream/watermark.py">Optional</a></code>

## Webhooks

Expand Down
38 changes: 19 additions & 19 deletions src/cloudflare/resources/stream/watermarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
AsyncPaginator,
make_request_options,
)
from ...types.stream import Watermaks, WatermarkDeleteResponse, watermark_create_params, watermark_delete_params
from ...types.stream import Watermark, WatermarkDeleteResponse, watermark_create_params, watermark_delete_params

__all__ = ["Watermarks", "AsyncWatermarks"]

Expand Down Expand Up @@ -55,7 +55,7 @@ def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[Watermaks]:
) -> Optional[Watermark]:
"""
Creates watermark profiles using a single `HTTP POST multipart/form-data`
request.
Expand Down Expand Up @@ -112,9 +112,9 @@ def create(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[Watermaks]]._unwrapper,
post_parser=ResultWrapper[Optional[Watermark]]._unwrapper,
),
cast_to=cast(Type[Optional[Watermaks]], ResultWrapper[Watermaks]),
cast_to=cast(Type[Optional[Watermark]], ResultWrapper[Watermark]),
)

def list(
Expand All @@ -127,7 +127,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SyncSinglePage[Watermaks]:
) -> SyncSinglePage[Watermark]:
"""
Lists all watermark profiles for an account.

Expand All @@ -146,11 +146,11 @@ def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
f"/accounts/{account_id}/stream/watermarks",
page=SyncSinglePage[Watermaks],
page=SyncSinglePage[Watermark],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
model=Watermaks,
model=Watermark,
)

def delete(
Expand Down Expand Up @@ -215,7 +215,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[Watermaks]:
) -> Optional[Watermark]:
"""
Retrieves details for a single watermark profile.

Expand Down Expand Up @@ -243,9 +243,9 @@ def get(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[Watermaks]]._unwrapper,
post_parser=ResultWrapper[Optional[Watermark]]._unwrapper,
),
cast_to=cast(Type[Optional[Watermaks]], ResultWrapper[Watermaks]),
cast_to=cast(Type[Optional[Watermark]], ResultWrapper[Watermark]),
)


Expand Down Expand Up @@ -274,7 +274,7 @@ async def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[Watermaks]:
) -> Optional[Watermark]:
"""
Creates watermark profiles using a single `HTTP POST multipart/form-data`
request.
Expand Down Expand Up @@ -331,9 +331,9 @@ async def create(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[Watermaks]]._unwrapper,
post_parser=ResultWrapper[Optional[Watermark]]._unwrapper,
),
cast_to=cast(Type[Optional[Watermaks]], ResultWrapper[Watermaks]),
cast_to=cast(Type[Optional[Watermark]], ResultWrapper[Watermark]),
)

def list(
Expand All @@ -346,7 +346,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncPaginator[Watermaks, AsyncSinglePage[Watermaks]]:
) -> AsyncPaginator[Watermark, AsyncSinglePage[Watermark]]:
"""
Lists all watermark profiles for an account.

Expand All @@ -365,11 +365,11 @@ def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
f"/accounts/{account_id}/stream/watermarks",
page=AsyncSinglePage[Watermaks],
page=AsyncSinglePage[Watermark],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
model=Watermaks,
model=Watermark,
)

async def delete(
Expand Down Expand Up @@ -434,7 +434,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[Watermaks]:
) -> Optional[Watermark]:
"""
Retrieves details for a single watermark profile.

Expand Down Expand Up @@ -462,9 +462,9 @@ async def get(
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
post_parser=ResultWrapper[Optional[Watermaks]]._unwrapper,
post_parser=ResultWrapper[Optional[Watermark]]._unwrapper,
),
cast_to=cast(Type[Optional[Watermaks]], ResultWrapper[Watermaks]),
cast_to=cast(Type[Optional[Watermark]], ResultWrapper[Watermark]),
)


Expand Down
2 changes: 1 addition & 1 deletion src/cloudflare/types/stream/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from .audio import Audio as Audio
from .video import Video as Video
from .caption import Caption as Caption
from .watermaks import Watermaks as Watermaks
from .watermark import Watermark as Watermark
from .live_input import LiveInput as LiveInput
from .allowed_origins import AllowedOrigins as AllowedOrigins
from .key_get_response import KeyGetResponse as KeyGetResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from pydantic import Field as FieldInfo

from ..._models import BaseModel
from .watermaks import Watermaks
from .watermark import Watermark

__all__ = ["DirectUploadCreateResponse"]

Expand All @@ -29,4 +29,4 @@ class DirectUploadCreateResponse(BaseModel):
`HTTP POST multipart/form-data` request.
"""

watermark: Optional[Watermaks] = None
watermark: Optional[Watermark] = None
4 changes: 2 additions & 2 deletions src/cloudflare/types/stream/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from pydantic import Field as FieldInfo

from ..._models import BaseModel
from .watermaks import Watermaks
from .watermark import Watermark
from .allowed_origins import AllowedOrigins

__all__ = ["Video", "Input", "Playback", "Status"]
Expand Down Expand Up @@ -177,4 +177,4 @@ class Video(BaseModel):
uploads.
"""

watermark: Optional[Watermaks] = None
watermark: Optional[Watermark] = None
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

from ..._models import BaseModel

__all__ = ["Watermaks"]
__all__ = ["Watermark"]


class Watermaks(BaseModel):
class Watermark(BaseModel):
created: Optional[datetime] = None
"""The date and a time a watermark profile was created."""

Expand Down
42 changes: 21 additions & 21 deletions tests/api_resources/stream/test_watermarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from cloudflare import Cloudflare, AsyncCloudflare
from tests.utils import assert_matches_type
from cloudflare.pagination import SyncSinglePage, AsyncSinglePage
from cloudflare.types.stream import Watermaks, WatermarkDeleteResponse
from cloudflare.types.stream import Watermark, WatermarkDeleteResponse

base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")

Expand All @@ -25,7 +25,7 @@ def test_method_create(self, client: Cloudflare) -> None:
account_id="023e105f4ecef8ad9ca31a8372d0c353",
file="@/Users/rchen/Downloads/watermark.png",
)
assert_matches_type(Optional[Watermaks], watermark, path=["response"])
assert_matches_type(Optional[Watermark], watermark, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -39,7 +39,7 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None:
position="center",
scale=0.1,
)
assert_matches_type(Optional[Watermaks], watermark, path=["response"])
assert_matches_type(Optional[Watermark], watermark, path=["response"])

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

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

watermark = response.parse()
assert_matches_type(Optional[Watermaks], watermark, path=["response"])
assert_matches_type(Optional[Watermark], watermark, path=["response"])

assert cast(Any, response.is_closed) is True

Expand All @@ -84,7 +84,7 @@ def test_method_list(self, client: Cloudflare) -> None:
watermark = client.stream.watermarks.list(
account_id="023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(SyncSinglePage[Watermaks], watermark, path=["response"])
assert_matches_type(SyncSinglePage[Watermark], watermark, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -96,7 +96,7 @@ def test_raw_response_list(self, client: Cloudflare) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
watermark = response.parse()
assert_matches_type(SyncSinglePage[Watermaks], watermark, path=["response"])
assert_matches_type(SyncSinglePage[Watermark], watermark, path=["response"])

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

watermark = response.parse()
assert_matches_type(SyncSinglePage[Watermaks], watermark, path=["response"])
assert_matches_type(SyncSinglePage[Watermark], watermark, path=["response"])

assert cast(Any, response.is_closed) is True

Expand Down Expand Up @@ -184,7 +184,7 @@ def test_method_get(self, client: Cloudflare) -> None:
"ea95132c15732412d22c1476fa83f27a",
account_id="023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(Optional[Watermaks], watermark, path=["response"])
assert_matches_type(Optional[Watermark], watermark, path=["response"])

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

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

watermark = response.parse()
assert_matches_type(Optional[Watermaks], watermark, path=["response"])
assert_matches_type(Optional[Watermark], watermark, path=["response"])

assert cast(Any, response.is_closed) is True

Expand Down Expand Up @@ -240,7 +240,7 @@ async def test_method_create(self, async_client: AsyncCloudflare) -> None:
account_id="023e105f4ecef8ad9ca31a8372d0c353",
file="@/Users/rchen/Downloads/watermark.png",
)
assert_matches_type(Optional[Watermaks], watermark, path=["response"])
assert_matches_type(Optional[Watermark], watermark, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -254,7 +254,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare
position="center",
scale=0.1,
)
assert_matches_type(Optional[Watermaks], watermark, path=["response"])
assert_matches_type(Optional[Watermark], watermark, path=["response"])

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

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

watermark = await response.parse()
assert_matches_type(Optional[Watermaks], watermark, path=["response"])
assert_matches_type(Optional[Watermark], watermark, path=["response"])

assert cast(Any, response.is_closed) is True

Expand All @@ -299,7 +299,7 @@ async def test_method_list(self, async_client: AsyncCloudflare) -> None:
watermark = await async_client.stream.watermarks.list(
account_id="023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(AsyncSinglePage[Watermaks], watermark, path=["response"])
assert_matches_type(AsyncSinglePage[Watermark], watermark, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -311,7 +311,7 @@ async def test_raw_response_list(self, async_client: AsyncCloudflare) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
watermark = await response.parse()
assert_matches_type(AsyncSinglePage[Watermaks], watermark, path=["response"])
assert_matches_type(AsyncSinglePage[Watermark], watermark, path=["response"])

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

watermark = await response.parse()
assert_matches_type(AsyncSinglePage[Watermaks], watermark, path=["response"])
assert_matches_type(AsyncSinglePage[Watermark], watermark, path=["response"])

assert cast(Any, response.is_closed) is True

Expand Down Expand Up @@ -399,7 +399,7 @@ async def test_method_get(self, async_client: AsyncCloudflare) -> None:
"ea95132c15732412d22c1476fa83f27a",
account_id="023e105f4ecef8ad9ca31a8372d0c353",
)
assert_matches_type(Optional[Watermaks], watermark, path=["response"])
assert_matches_type(Optional[Watermark], watermark, path=["response"])

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

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

watermark = await response.parse()
assert_matches_type(Optional[Watermaks], watermark, path=["response"])
assert_matches_type(Optional[Watermark], watermark, path=["response"])

assert cast(Any, response.is_closed) is True

Expand Down