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

Merged
merged 1 commit into from
Mar 26, 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
2 changes: 1 addition & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4446,7 +4446,7 @@ from cloudflare.types.stream import EmbedGetResponse

Methods:

- <code title="get /accounts/{account_id}/stream/{identifier}/embed">client.stream.embed.<a href="./src/cloudflare/resources/stream/embed.py">get</a>(identifier, \*, account_id) -> <a href="./src/cloudflare/types/stream/embed_get_response.py">object</a></code>
- <code title="get /accounts/{account_id}/stream/{identifier}/embed">client.stream.embed.<a href="./src/cloudflare/resources/stream/embed.py">get</a>(identifier, \*, account_id) -> str</code>

## Token

Expand Down
12 changes: 6 additions & 6 deletions src/cloudflare/resources/dns/records.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ def create(
self,
*,
zone_id: str,
content: object,
content: str,
name: str,
type: Literal["NS"],
comment: str | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -1958,7 +1958,7 @@ def update(
dns_record_id: str,
*,
zone_id: str,
content: object,
content: str,
name: str,
type: Literal["NS"],
comment: str | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -3417,7 +3417,7 @@ def edit(
dns_record_id: str,
*,
zone_id: str,
content: object,
content: str,
name: str,
type: Literal["NS"],
comment: str | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -4890,7 +4890,7 @@ async def create(
self,
*,
zone_id: str,
content: object,
content: str,
name: str,
type: Literal["NS"],
comment: str | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -6160,7 +6160,7 @@ async def update(
dns_record_id: str,
*,
zone_id: str,
content: object,
content: str,
name: str,
type: Literal["NS"],
comment: str | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -7619,7 +7619,7 @@ async def edit(
dns_record_id: str,
*,
zone_id: str,
content: object,
content: str,
name: str,
type: Literal["NS"],
comment: str | NotGiven = NOT_GIVEN,
Expand Down
16 changes: 12 additions & 4 deletions src/cloudflare/resources/images/v1/keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def with_streaming_response(self) -> KeysWithStreamingResponse:

def update(
self,
signing_key_name: object,
signing_key_name: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand All @@ -62,6 +62,8 @@ def update(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not signing_key_name:
raise ValueError(f"Expected a non-empty value for `signing_key_name` but received {signing_key_name!r}")
return self._put(
f"/accounts/{account_id}/images/v1/keys/{signing_key_name}",
options=make_request_options(
Expand Down Expand Up @@ -116,7 +118,7 @@ def list(

def delete(
self,
signing_key_name: object,
signing_key_name: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -144,6 +146,8 @@ def delete(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not signing_key_name:
raise ValueError(f"Expected a non-empty value for `signing_key_name` but received {signing_key_name!r}")
return self._delete(
f"/accounts/{account_id}/images/v1/keys/{signing_key_name}",
options=make_request_options(
Expand All @@ -168,7 +172,7 @@ def with_streaming_response(self) -> AsyncKeysWithStreamingResponse:

async def update(
self,
signing_key_name: object,
signing_key_name: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand All @@ -195,6 +199,8 @@ async def update(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not signing_key_name:
raise ValueError(f"Expected a non-empty value for `signing_key_name` but received {signing_key_name!r}")
return await self._put(
f"/accounts/{account_id}/images/v1/keys/{signing_key_name}",
options=make_request_options(
Expand Down Expand Up @@ -249,7 +255,7 @@ async def list(

async def delete(
self,
signing_key_name: object,
signing_key_name: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -277,6 +283,8 @@ async def delete(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not signing_key_name:
raise ValueError(f"Expected a non-empty value for `signing_key_name` but received {signing_key_name!r}")
return await self._delete(
f"/accounts/{account_id}/images/v1/keys/{signing_key_name}",
options=make_request_options(
Expand Down
28 changes: 20 additions & 8 deletions src/cloudflare/resources/images/v1/variants.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def create(
self,
*,
account_id: str,
id: object,
id: str,
options: variant_create_params.Options,
never_require_signed_urls: bool | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -139,7 +139,7 @@ def list(

def delete(
self,
variant_id: object,
variant_id: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand All @@ -165,6 +165,8 @@ def delete(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not variant_id:
raise ValueError(f"Expected a non-empty value for `variant_id` but received {variant_id!r}")
return cast(
VariantDeleteResponse,
self._delete(
Expand All @@ -184,7 +186,7 @@ def delete(

def edit(
self,
variant_id: object,
variant_id: str,
*,
account_id: str,
options: variant_edit_params.Options,
Expand Down Expand Up @@ -217,6 +219,8 @@ def edit(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not variant_id:
raise ValueError(f"Expected a non-empty value for `variant_id` but received {variant_id!r}")
return self._patch(
f"/accounts/{account_id}/images/v1/variants/{variant_id}",
body=maybe_transform(
Expand All @@ -238,7 +242,7 @@ def edit(

def get(
self,
variant_id: object,
variant_id: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand All @@ -264,6 +268,8 @@ def get(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not variant_id:
raise ValueError(f"Expected a non-empty value for `variant_id` but received {variant_id!r}")
return self._get(
f"/accounts/{account_id}/images/v1/variants/{variant_id}",
options=make_request_options(
Expand All @@ -290,7 +296,7 @@ async def create(
self,
*,
account_id: str,
id: object,
id: str,
options: variant_create_params.Options,
never_require_signed_urls: bool | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand Down Expand Up @@ -382,7 +388,7 @@ async def list(

async def delete(
self,
variant_id: object,
variant_id: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand All @@ -408,6 +414,8 @@ async def delete(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not variant_id:
raise ValueError(f"Expected a non-empty value for `variant_id` but received {variant_id!r}")
return cast(
VariantDeleteResponse,
await self._delete(
Expand All @@ -427,7 +435,7 @@ async def delete(

async def edit(
self,
variant_id: object,
variant_id: str,
*,
account_id: str,
options: variant_edit_params.Options,
Expand Down Expand Up @@ -460,6 +468,8 @@ async def edit(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not variant_id:
raise ValueError(f"Expected a non-empty value for `variant_id` but received {variant_id!r}")
return await self._patch(
f"/accounts/{account_id}/images/v1/variants/{variant_id}",
body=await async_maybe_transform(
Expand All @@ -481,7 +491,7 @@ async def edit(

async def get(
self,
variant_id: object,
variant_id: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand All @@ -507,6 +517,8 @@ async def get(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not variant_id:
raise ValueError(f"Expected a non-empty value for `variant_id` but received {variant_id!r}")
return await self._get(
f"/accounts/{account_id}/images/v1/variants/{variant_id}",
options=make_request_options(
Expand Down
4 changes: 2 additions & 2 deletions src/cloudflare/resources/intel/domain_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def get(
self,
*,
account_id: str,
domain: object | NotGiven = NOT_GIVEN,
domain: str | NotGiven = NOT_GIVEN,
# 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,
Expand Down Expand Up @@ -92,7 +92,7 @@ async def get(
self,
*,
account_id: str,
domain: object | NotGiven = NOT_GIVEN,
domain: str | NotGiven = NOT_GIVEN,
# 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,
Expand Down
18 changes: 9 additions & 9 deletions src/cloudflare/resources/intel/miscategorizations.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, cast
from typing import Any, Iterable, cast
from typing_extensions import Literal

import httpx
Expand Down Expand Up @@ -42,12 +42,12 @@ def create(
self,
*,
account_id: str,
content_adds: object | NotGiven = NOT_GIVEN,
content_removes: object | NotGiven = NOT_GIVEN,
content_adds: Iterable[float] | NotGiven = NOT_GIVEN,
content_removes: Iterable[float] | NotGiven = NOT_GIVEN,
indicator_type: Literal["domain", "ipv4", "ipv6", "url"] | NotGiven = NOT_GIVEN,
ip: object | NotGiven = NOT_GIVEN,
security_adds: object | NotGiven = NOT_GIVEN,
security_removes: object | NotGiven = NOT_GIVEN,
security_adds: Iterable[float] | NotGiven = NOT_GIVEN,
security_removes: Iterable[float] | NotGiven = NOT_GIVEN,
url: str | NotGiven = NOT_GIVEN,
# 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.
Expand Down Expand Up @@ -129,12 +129,12 @@ async def create(
self,
*,
account_id: str,
content_adds: object | NotGiven = NOT_GIVEN,
content_removes: object | NotGiven = NOT_GIVEN,
content_adds: Iterable[float] | NotGiven = NOT_GIVEN,
content_removes: Iterable[float] | NotGiven = NOT_GIVEN,
indicator_type: Literal["domain", "ipv4", "ipv6", "url"] | NotGiven = NOT_GIVEN,
ip: object | NotGiven = NOT_GIVEN,
security_adds: object | NotGiven = NOT_GIVEN,
security_removes: object | NotGiven = NOT_GIVEN,
security_adds: Iterable[float] | NotGiven = NOT_GIVEN,
security_removes: Iterable[float] | NotGiven = NOT_GIVEN,
url: str | NotGiven = NOT_GIVEN,
# 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.
Expand Down
8 changes: 6 additions & 2 deletions src/cloudflare/resources/load_balancers/previews.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def with_streaming_response(self) -> PreviewsWithStreamingResponse:

def get(
self,
preview_id: object,
preview_id: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand All @@ -61,6 +61,8 @@ def get(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not preview_id:
raise ValueError(f"Expected a non-empty value for `preview_id` but received {preview_id!r}")
return self._get(
f"/accounts/{account_id}/load_balancers/preview/{preview_id}",
options=make_request_options(
Expand All @@ -85,7 +87,7 @@ def with_streaming_response(self) -> AsyncPreviewsWithStreamingResponse:

async def get(
self,
preview_id: object,
preview_id: str,
*,
account_id: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand All @@ -111,6 +113,8 @@ async def get(
"""
if not account_id:
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
if not preview_id:
raise ValueError(f"Expected a non-empty value for `preview_id` but received {preview_id!r}")
return await self._get(
f"/accounts/{account_id}/load_balancers/preview/{preview_id}",
options=make_request_options(
Expand Down
Loading