Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Apr 24, 2024
1 parent 555aa02 commit cc6ec6d
Show file tree
Hide file tree
Showing 138 changed files with 2,077 additions and 3,618 deletions.
107 changes: 63 additions & 44 deletions api.md

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions src/cloudflare/resources/accounts/members.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
)
from ...types.accounts import (
Member,
RoleParam,
MemberWithCode,
MemberListResponse,
MemberDeleteResponse,
Expand Down Expand Up @@ -105,7 +104,7 @@ def update(
member_id: str,
*,
account_id: object,
roles: Iterable[RoleParam],
roles: Iterable[member_update_params.Role],
# 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 @@ -351,7 +350,7 @@ async def update(
member_id: str,
*,
account_id: object,
roles: Iterable[RoleParam],
roles: Iterable[member_update_params.Role],
# 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
14 changes: 7 additions & 7 deletions src/cloudflare/resources/accounts/roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
make_request_options,
)
from ...types.shared import UnnamedSchemaRef9444735ca60712dbcf8afd832eb5716a
from ...types.accounts import RoleListResponse
from ...types.accounts import Role

__all__ = ["Roles", "AsyncRoles"]

Expand All @@ -46,7 +46,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SyncSinglePage[RoleListResponse]:
) -> SyncSinglePage[Role]:
"""
Get all available roles for an account.
Expand All @@ -61,11 +61,11 @@ def list(
"""
return self._get_api_list(
f"/accounts/{account_id}/roles",
page=SyncSinglePage[RoleListResponse],
page=SyncSinglePage[Role],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
model=RoleListResponse,
model=Role,
)

def get(
Expand Down Expand Up @@ -129,7 +129,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncPaginator[RoleListResponse, AsyncSinglePage[RoleListResponse]]:
) -> AsyncPaginator[Role, AsyncSinglePage[Role]]:
"""
Get all available roles for an account.
Expand All @@ -144,11 +144,11 @@ def list(
"""
return self._get_api_list(
f"/accounts/{account_id}/roles",
page=AsyncSinglePage[RoleListResponse],
page=AsyncSinglePage[Role],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
model=RoleListResponse,
model=Role,
)

async def get(
Expand Down
24 changes: 12 additions & 12 deletions src/cloudflare/resources/alerting/destinations/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
AsyncWebhooksWithStreamingResponse,
)
from .pagerduty import (
Pagerduty,
AsyncPagerduty,
PagerdutyWithRawResponse,
AsyncPagerdutyWithRawResponse,
PagerdutyWithStreamingResponse,
AsyncPagerdutyWithStreamingResponse,
PagerdutyResource,
AsyncPagerdutyResource,
PagerdutyResourceWithRawResponse,
AsyncPagerdutyResourceWithRawResponse,
PagerdutyResourceWithStreamingResponse,
AsyncPagerdutyResourceWithStreamingResponse,
)
from .destinations import (
Destinations,
Expand All @@ -40,12 +40,12 @@
"AsyncEligibleWithRawResponse",
"EligibleWithStreamingResponse",
"AsyncEligibleWithStreamingResponse",
"Pagerduty",
"AsyncPagerduty",
"PagerdutyWithRawResponse",
"AsyncPagerdutyWithRawResponse",
"PagerdutyWithStreamingResponse",
"AsyncPagerdutyWithStreamingResponse",
"PagerdutyResource",
"AsyncPagerdutyResource",
"PagerdutyResourceWithRawResponse",
"AsyncPagerdutyResourceWithRawResponse",
"PagerdutyResourceWithStreamingResponse",
"AsyncPagerdutyResourceWithStreamingResponse",
"Webhooks",
"AsyncWebhooks",
"WebhooksWithRawResponse",
Expand Down
36 changes: 18 additions & 18 deletions src/cloudflare/resources/alerting/destinations/destinations.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
AsyncWebhooksWithStreamingResponse,
)
from .pagerduty import (
Pagerduty,
AsyncPagerduty,
PagerdutyWithRawResponse,
AsyncPagerdutyWithRawResponse,
PagerdutyWithStreamingResponse,
AsyncPagerdutyWithStreamingResponse,
PagerdutyResource,
AsyncPagerdutyResource,
PagerdutyResourceWithRawResponse,
AsyncPagerdutyResourceWithRawResponse,
PagerdutyResourceWithStreamingResponse,
AsyncPagerdutyResourceWithStreamingResponse,
)
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
Expand All @@ -38,8 +38,8 @@ def eligible(self) -> Eligible:
return Eligible(self._client)

@cached_property
def pagerduty(self) -> Pagerduty:
return Pagerduty(self._client)
def pagerduty(self) -> PagerdutyResource:
return PagerdutyResource(self._client)

@cached_property
def webhooks(self) -> Webhooks:
Expand All @@ -60,8 +60,8 @@ def eligible(self) -> AsyncEligible:
return AsyncEligible(self._client)

@cached_property
def pagerduty(self) -> AsyncPagerduty:
return AsyncPagerduty(self._client)
def pagerduty(self) -> AsyncPagerdutyResource:
return AsyncPagerdutyResource(self._client)

@cached_property
def webhooks(self) -> AsyncWebhooks:
Expand All @@ -85,8 +85,8 @@ def eligible(self) -> EligibleWithRawResponse:
return EligibleWithRawResponse(self._destinations.eligible)

@cached_property
def pagerduty(self) -> PagerdutyWithRawResponse:
return PagerdutyWithRawResponse(self._destinations.pagerduty)
def pagerduty(self) -> PagerdutyResourceWithRawResponse:
return PagerdutyResourceWithRawResponse(self._destinations.pagerduty)

@cached_property
def webhooks(self) -> WebhooksWithRawResponse:
Expand All @@ -102,8 +102,8 @@ def eligible(self) -> AsyncEligibleWithRawResponse:
return AsyncEligibleWithRawResponse(self._destinations.eligible)

@cached_property
def pagerduty(self) -> AsyncPagerdutyWithRawResponse:
return AsyncPagerdutyWithRawResponse(self._destinations.pagerduty)
def pagerduty(self) -> AsyncPagerdutyResourceWithRawResponse:
return AsyncPagerdutyResourceWithRawResponse(self._destinations.pagerduty)

@cached_property
def webhooks(self) -> AsyncWebhooksWithRawResponse:
Expand All @@ -119,8 +119,8 @@ def eligible(self) -> EligibleWithStreamingResponse:
return EligibleWithStreamingResponse(self._destinations.eligible)

@cached_property
def pagerduty(self) -> PagerdutyWithStreamingResponse:
return PagerdutyWithStreamingResponse(self._destinations.pagerduty)
def pagerduty(self) -> PagerdutyResourceWithStreamingResponse:
return PagerdutyResourceWithStreamingResponse(self._destinations.pagerduty)

@cached_property
def webhooks(self) -> WebhooksWithStreamingResponse:
Expand All @@ -136,8 +136,8 @@ def eligible(self) -> AsyncEligibleWithStreamingResponse:
return AsyncEligibleWithStreamingResponse(self._destinations.eligible)

@cached_property
def pagerduty(self) -> AsyncPagerdutyWithStreamingResponse:
return AsyncPagerdutyWithStreamingResponse(self._destinations.pagerduty)
def pagerduty(self) -> AsyncPagerdutyResourceWithStreamingResponse:
return AsyncPagerdutyResourceWithStreamingResponse(self._destinations.pagerduty)

@cached_property
def webhooks(self) -> AsyncWebhooksWithStreamingResponse:
Expand Down
38 changes: 19 additions & 19 deletions src/cloudflare/resources/alerting/destinations/pagerduty.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@
from ....types.shared import UnnamedSchemaRef67bbb1ccdd42c3e2937b9fd19f791151
from ....types.alerting.destinations import PagerdutyGetResponse, PagerdutyLinkResponse, PagerdutyCreateResponse

__all__ = ["Pagerduty", "AsyncPagerduty"]
__all__ = ["PagerdutyResource", "AsyncPagerdutyResource"]


class Pagerduty(SyncAPIResource):
class PagerdutyResource(SyncAPIResource):
@cached_property
def with_raw_response(self) -> PagerdutyWithRawResponse:
return PagerdutyWithRawResponse(self)
def with_raw_response(self) -> PagerdutyResourceWithRawResponse:
return PagerdutyResourceWithRawResponse(self)

@cached_property
def with_streaming_response(self) -> PagerdutyWithStreamingResponse:
return PagerdutyWithStreamingResponse(self)
def with_streaming_response(self) -> PagerdutyResourceWithStreamingResponse:
return PagerdutyResourceWithStreamingResponse(self)

def create(
self,
Expand Down Expand Up @@ -201,14 +201,14 @@ def link(
)


class AsyncPagerduty(AsyncAPIResource):
class AsyncPagerdutyResource(AsyncAPIResource):
@cached_property
def with_raw_response(self) -> AsyncPagerdutyWithRawResponse:
return AsyncPagerdutyWithRawResponse(self)
def with_raw_response(self) -> AsyncPagerdutyResourceWithRawResponse:
return AsyncPagerdutyResourceWithRawResponse(self)

@cached_property
def with_streaming_response(self) -> AsyncPagerdutyWithStreamingResponse:
return AsyncPagerdutyWithStreamingResponse(self)
def with_streaming_response(self) -> AsyncPagerdutyResourceWithStreamingResponse:
return AsyncPagerdutyResourceWithStreamingResponse(self)

async def create(
self,
Expand Down Expand Up @@ -377,8 +377,8 @@ async def link(
)


class PagerdutyWithRawResponse:
def __init__(self, pagerduty: Pagerduty) -> None:
class PagerdutyResourceWithRawResponse:
def __init__(self, pagerduty: PagerdutyResource) -> None:
self._pagerduty = pagerduty

self.create = to_raw_response_wrapper(
Expand All @@ -395,8 +395,8 @@ def __init__(self, pagerduty: Pagerduty) -> None:
)


class AsyncPagerdutyWithRawResponse:
def __init__(self, pagerduty: AsyncPagerduty) -> None:
class AsyncPagerdutyResourceWithRawResponse:
def __init__(self, pagerduty: AsyncPagerdutyResource) -> None:
self._pagerduty = pagerduty

self.create = async_to_raw_response_wrapper(
Expand All @@ -413,8 +413,8 @@ def __init__(self, pagerduty: AsyncPagerduty) -> None:
)


class PagerdutyWithStreamingResponse:
def __init__(self, pagerduty: Pagerduty) -> None:
class PagerdutyResourceWithStreamingResponse:
def __init__(self, pagerduty: PagerdutyResource) -> None:
self._pagerduty = pagerduty

self.create = to_streamed_response_wrapper(
Expand All @@ -431,8 +431,8 @@ def __init__(self, pagerduty: Pagerduty) -> None:
)


class AsyncPagerdutyWithStreamingResponse:
def __init__(self, pagerduty: AsyncPagerduty) -> None:
class AsyncPagerdutyResourceWithStreamingResponse:
def __init__(self, pagerduty: AsyncPagerdutyResource) -> None:
self._pagerduty = pagerduty

self.create = async_to_streamed_response_wrapper(
Expand Down
Loading

0 comments on commit cc6ec6d

Please sign in to comment.