Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#305)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Apr 24, 2024
1 parent 3d43c94 commit 83339e4
Show file tree
Hide file tree
Showing 24 changed files with 87 additions and 76 deletions.
16 changes: 10 additions & 6 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ from cloudflare.types import (
Identifier,
LoadBalancerPreview,
PaginationInfo,
Permission,
PermissionGrant,
ResponseInfo,
Result,
Role,
User,
)
```

Expand Down Expand Up @@ -38,22 +42,22 @@ from cloudflare.types.accounts import UserWithInviteCode, MemberListResponse, Me
Methods:

- <code title="post /accounts/{account_id}/members">client.accounts.members.<a href="./src/cloudflare/resources/accounts/members.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/accounts/member_create_params.py">params</a>) -> <a href="./src/cloudflare/types/accounts/user_with_invite_code.py">UserWithInviteCode</a></code>
- <code title="put /accounts/{account_id}/members/{member_id}">client.accounts.members.<a href="./src/cloudflare/resources/accounts/members.py">update</a>(member_id, \*, account_id, \*\*<a href="src/cloudflare/types/accounts/member_update_params.py">params</a>) -> <a href="./src/cloudflare/types/user.py">User</a></code>
- <code title="put /accounts/{account_id}/members/{member_id}">client.accounts.members.<a href="./src/cloudflare/resources/accounts/members.py">update</a>(member_id, \*, account_id, \*\*<a href="src/cloudflare/types/accounts/member_update_params.py">params</a>) -> <a href="./src/cloudflare/types/shared/user.py">User</a></code>
- <code title="get /accounts/{account_id}/members">client.accounts.members.<a href="./src/cloudflare/resources/accounts/members.py">list</a>(\*, account_id, \*\*<a href="src/cloudflare/types/accounts/member_list_params.py">params</a>) -> <a href="./src/cloudflare/types/accounts/member_list_response.py">SyncV4PagePaginationArray[MemberListResponse]</a></code>
- <code title="delete /accounts/{account_id}/members/{member_id}">client.accounts.members.<a href="./src/cloudflare/resources/accounts/members.py">delete</a>(member_id, \*, account_id, \*\*<a href="src/cloudflare/types/accounts/member_delete_params.py">params</a>) -> <a href="./src/cloudflare/types/accounts/member_delete_response.py">Optional</a></code>
- <code title="get /accounts/{account_id}/members/{member_id}">client.accounts.members.<a href="./src/cloudflare/resources/accounts/members.py">get</a>(member_id, \*, account_id) -> <a href="./src/cloudflare/types/user.py">User</a></code>
- <code title="get /accounts/{account_id}/members/{member_id}">client.accounts.members.<a href="./src/cloudflare/resources/accounts/members.py">get</a>(member_id, \*, account_id) -> <a href="./src/cloudflare/types/shared/user.py">User</a></code>

## Roles

Types:

```python
from cloudflare.types.accounts import PermissionGrant, RoleGetResponse
from cloudflare.types.accounts import RoleGetResponse
```

Methods:

- <code title="get /accounts/{account_id}/roles">client.accounts.roles.<a href="./src/cloudflare/resources/accounts/roles.py">list</a>(\*, account_id) -> <a href="./src/cloudflare/types/role.py">SyncSinglePage[Role]</a></code>
- <code title="get /accounts/{account_id}/roles">client.accounts.roles.<a href="./src/cloudflare/resources/accounts/roles.py">list</a>(\*, account_id) -> <a href="./src/cloudflare/types/shared/role.py">SyncSinglePage[Role]</a></code>
- <code title="get /accounts/{account_id}/roles/{role_id}">client.accounts.roles.<a href="./src/cloudflare/resources/accounts/roles.py">get</a>(role_id, \*, account_id) -> <a href="./src/cloudflare/types/accounts/role_get_response.py">RoleGetResponse</a></code>

# OriginCACertificates
Expand Down Expand Up @@ -108,12 +112,12 @@ Methods:
- <code title="delete /memberships/{membership_id}">client.memberships.<a href="./src/cloudflare/resources/memberships.py">delete</a>(membership_id, \*\*<a href="src/cloudflare/types/membership_delete_params.py">params</a>) -> <a href="./src/cloudflare/types/membership_delete_response.py">MembershipDeleteResponse</a></code>
- <code title="get /memberships/{membership_id}">client.memberships.<a href="./src/cloudflare/resources/memberships.py">get</a>(membership_id) -> <a href="./src/cloudflare/types/membership_get_response.py">MembershipGetResponse</a></code>

# UserResource
# User

Types:

```python
from cloudflare.types import Permission, Role, User, UserEditResponse, UserGetResponse
from cloudflare.types import UserEditResponse, UserGetResponse
```

Methods:
Expand Down
16 changes: 8 additions & 8 deletions src/cloudflare/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Cloudflare(SyncAPIClient):
origin_ca_certificates: resources.OriginCACertificates
ips: resources.IPs
memberships: resources.Memberships
user: resources.UserResource
user: resources.User
zones: resources.Zones
load_balancers: resources.LoadBalancers
cache: resources.Cache
Expand Down Expand Up @@ -206,7 +206,7 @@ def __init__(
self.origin_ca_certificates = resources.OriginCACertificates(self)
self.ips = resources.IPs(self)
self.memberships = resources.Memberships(self)
self.user = resources.UserResource(self)
self.user = resources.User(self)
self.zones = resources.Zones(self)
self.load_balancers = resources.LoadBalancers(self)
self.cache = resources.Cache(self)
Expand Down Expand Up @@ -464,7 +464,7 @@ class AsyncCloudflare(AsyncAPIClient):
origin_ca_certificates: resources.AsyncOriginCACertificates
ips: resources.AsyncIPs
memberships: resources.AsyncMemberships
user: resources.AsyncUserResource
user: resources.AsyncUser
zones: resources.AsyncZones
load_balancers: resources.AsyncLoadBalancers
cache: resources.AsyncCache
Expand Down Expand Up @@ -619,7 +619,7 @@ def __init__(
self.origin_ca_certificates = resources.AsyncOriginCACertificates(self)
self.ips = resources.AsyncIPs(self)
self.memberships = resources.AsyncMemberships(self)
self.user = resources.AsyncUserResource(self)
self.user = resources.AsyncUser(self)
self.zones = resources.AsyncZones(self)
self.load_balancers = resources.AsyncLoadBalancers(self)
self.cache = resources.AsyncCache(self)
Expand Down Expand Up @@ -878,7 +878,7 @@ def __init__(self, client: Cloudflare) -> None:
self.origin_ca_certificates = resources.OriginCACertificatesWithRawResponse(client.origin_ca_certificates)
self.ips = resources.IPsWithRawResponse(client.ips)
self.memberships = resources.MembershipsWithRawResponse(client.memberships)
self.user = resources.UserResourceWithRawResponse(client.user)
self.user = resources.UserWithRawResponse(client.user)
self.zones = resources.ZonesWithRawResponse(client.zones)
self.load_balancers = resources.LoadBalancersWithRawResponse(client.load_balancers)
self.cache = resources.CacheWithRawResponse(client.cache)
Expand Down Expand Up @@ -964,7 +964,7 @@ def __init__(self, client: AsyncCloudflare) -> None:
self.origin_ca_certificates = resources.AsyncOriginCACertificatesWithRawResponse(client.origin_ca_certificates)
self.ips = resources.AsyncIPsWithRawResponse(client.ips)
self.memberships = resources.AsyncMembershipsWithRawResponse(client.memberships)
self.user = resources.AsyncUserResourceWithRawResponse(client.user)
self.user = resources.AsyncUserWithRawResponse(client.user)
self.zones = resources.AsyncZonesWithRawResponse(client.zones)
self.load_balancers = resources.AsyncLoadBalancersWithRawResponse(client.load_balancers)
self.cache = resources.AsyncCacheWithRawResponse(client.cache)
Expand Down Expand Up @@ -1054,7 +1054,7 @@ def __init__(self, client: Cloudflare) -> None:
self.origin_ca_certificates = resources.OriginCACertificatesWithStreamingResponse(client.origin_ca_certificates)
self.ips = resources.IPsWithStreamingResponse(client.ips)
self.memberships = resources.MembershipsWithStreamingResponse(client.memberships)
self.user = resources.UserResourceWithStreamingResponse(client.user)
self.user = resources.UserWithStreamingResponse(client.user)
self.zones = resources.ZonesWithStreamingResponse(client.zones)
self.load_balancers = resources.LoadBalancersWithStreamingResponse(client.load_balancers)
self.cache = resources.CacheWithStreamingResponse(client.cache)
Expand Down Expand Up @@ -1146,7 +1146,7 @@ def __init__(self, client: AsyncCloudflare) -> None:
)
self.ips = resources.AsyncIPsWithStreamingResponse(client.ips)
self.memberships = resources.AsyncMembershipsWithStreamingResponse(client.memberships)
self.user = resources.AsyncUserResourceWithStreamingResponse(client.user)
self.user = resources.AsyncUserWithStreamingResponse(client.user)
self.zones = resources.AsyncZonesWithStreamingResponse(client.zones)
self.load_balancers = resources.AsyncLoadBalancersWithStreamingResponse(client.load_balancers)
self.cache = resources.AsyncCacheWithStreamingResponse(client.cache)
Expand Down
24 changes: 12 additions & 12 deletions src/cloudflare/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@
AsyncLogsWithStreamingResponse,
)
from .user import (
UserResource,
AsyncUserResource,
UserResourceWithRawResponse,
AsyncUserResourceWithRawResponse,
UserResourceWithStreamingResponse,
AsyncUserResourceWithStreamingResponse,
User,
AsyncUser,
UserWithRawResponse,
AsyncUserWithRawResponse,
UserWithStreamingResponse,
AsyncUserWithStreamingResponse,
)
from .web3 import (
Web3,
Expand Down Expand Up @@ -666,12 +666,12 @@
"AsyncMembershipsWithRawResponse",
"MembershipsWithStreamingResponse",
"AsyncMembershipsWithStreamingResponse",
"UserResource",
"AsyncUserResource",
"UserResourceWithRawResponse",
"AsyncUserResourceWithRawResponse",
"UserResourceWithStreamingResponse",
"AsyncUserResourceWithStreamingResponse",
"User",
"AsyncUser",
"UserWithRawResponse",
"AsyncUserWithRawResponse",
"UserWithStreamingResponse",
"AsyncUserWithStreamingResponse",
"Zones",
"AsyncZones",
"ZonesWithRawResponse",
Expand Down
2 changes: 1 addition & 1 deletion src/cloudflare/resources/accounts/members.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import httpx

from ...types import User
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._utils import (
maybe_transform,
Expand All @@ -27,6 +26,7 @@
AsyncPaginator,
make_request_options,
)
from ...types.shared import User
from ...types.accounts import (
MemberListResponse,
UserWithInviteCode,
Expand Down
2 changes: 1 addition & 1 deletion src/cloudflare/resources/accounts/roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import httpx

from ...types import Role
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
Expand All @@ -22,6 +21,7 @@
AsyncPaginator,
make_request_options,
)
from ...types.shared import Role
from ...types.accounts import RoleGetResponse

__all__ = ["Roles", "AsyncRoles"]
Expand Down
24 changes: 12 additions & 12 deletions src/cloudflare/resources/user/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from .user import (
UserResource,
AsyncUserResource,
UserResourceWithRawResponse,
AsyncUserResourceWithRawResponse,
UserResourceWithStreamingResponse,
AsyncUserResourceWithStreamingResponse,
User,
AsyncUser,
UserWithRawResponse,
AsyncUserWithRawResponse,
UserWithStreamingResponse,
AsyncUserWithStreamingResponse,
)
from .tokens import (
Tokens,
Expand Down Expand Up @@ -94,10 +94,10 @@
"AsyncTokensWithRawResponse",
"TokensWithStreamingResponse",
"AsyncTokensWithStreamingResponse",
"UserResource",
"AsyncUserResource",
"UserResourceWithRawResponse",
"AsyncUserResourceWithRawResponse",
"UserResourceWithStreamingResponse",
"AsyncUserResourceWithStreamingResponse",
"User",
"AsyncUser",
"UserWithRawResponse",
"AsyncUserWithRawResponse",
"UserWithStreamingResponse",
"AsyncUserWithStreamingResponse",
]
38 changes: 19 additions & 19 deletions src/cloudflare/resources/user/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@
)
from .billing.billing import Billing, AsyncBilling

__all__ = ["UserResource", "AsyncUserResource"]
__all__ = ["User", "AsyncUser"]


class UserResource(SyncAPIResource):
class User(SyncAPIResource):
@cached_property
def audit_logs(self) -> AuditLogs:
return AuditLogs(self._client)
Expand All @@ -104,12 +104,12 @@ def tokens(self) -> Tokens:
return Tokens(self._client)

@cached_property
def with_raw_response(self) -> UserResourceWithRawResponse:
return UserResourceWithRawResponse(self)
def with_raw_response(self) -> UserWithRawResponse:
return UserWithRawResponse(self)

@cached_property
def with_streaming_response(self) -> UserResourceWithStreamingResponse:
return UserResourceWithStreamingResponse(self)
def with_streaming_response(self) -> UserWithStreamingResponse:
return UserWithStreamingResponse(self)

def edit(
self,
Expand Down Expand Up @@ -204,7 +204,7 @@ def get(
)


class AsyncUserResource(AsyncAPIResource):
class AsyncUser(AsyncAPIResource):
@cached_property
def audit_logs(self) -> AsyncAuditLogs:
return AsyncAuditLogs(self._client)
Expand All @@ -230,12 +230,12 @@ def tokens(self) -> AsyncTokens:
return AsyncTokens(self._client)

@cached_property
def with_raw_response(self) -> AsyncUserResourceWithRawResponse:
return AsyncUserResourceWithRawResponse(self)
def with_raw_response(self) -> AsyncUserWithRawResponse:
return AsyncUserWithRawResponse(self)

@cached_property
def with_streaming_response(self) -> AsyncUserResourceWithStreamingResponse:
return AsyncUserResourceWithStreamingResponse(self)
def with_streaming_response(self) -> AsyncUserWithStreamingResponse:
return AsyncUserWithStreamingResponse(self)

async def edit(
self,
Expand Down Expand Up @@ -330,8 +330,8 @@ async def get(
)


class UserResourceWithRawResponse:
def __init__(self, user: UserResource) -> None:
class UserWithRawResponse:
def __init__(self, user: User) -> None:
self._user = user

self.edit = to_raw_response_wrapper(
Expand Down Expand Up @@ -366,8 +366,8 @@ def tokens(self) -> TokensWithRawResponse:
return TokensWithRawResponse(self._user.tokens)


class AsyncUserResourceWithRawResponse:
def __init__(self, user: AsyncUserResource) -> None:
class AsyncUserWithRawResponse:
def __init__(self, user: AsyncUser) -> None:
self._user = user

self.edit = async_to_raw_response_wrapper(
Expand Down Expand Up @@ -402,8 +402,8 @@ def tokens(self) -> AsyncTokensWithRawResponse:
return AsyncTokensWithRawResponse(self._user.tokens)


class UserResourceWithStreamingResponse:
def __init__(self, user: UserResource) -> None:
class UserWithStreamingResponse:
def __init__(self, user: User) -> None:
self._user = user

self.edit = to_streamed_response_wrapper(
Expand Down Expand Up @@ -438,8 +438,8 @@ def tokens(self) -> TokensWithStreamingResponse:
return TokensWithStreamingResponse(self._user.tokens)


class AsyncUserResourceWithStreamingResponse:
def __init__(self, user: AsyncUserResource) -> None:
class AsyncUserWithStreamingResponse:
def __init__(self, user: AsyncUser) -> None:
self._user = user

self.edit = async_to_streamed_response_wrapper(
Expand Down
7 changes: 4 additions & 3 deletions src/cloudflare/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
from .host import Host as Host
from .info import Info as Info
from .pcap import PCAP as PCAP
from .role import Role as Role
from .user import User as User
from .zone import Zone as Zone
from .queue import Queue as Queue
from .route import Route as Route
Expand All @@ -21,12 +19,16 @@
from .header import Header as Header
from .origin import Origin as Origin
from .shared import (
Role as Role,
User as User,
Result as Result,
AuditLog as AuditLog,
ErrorData as ErrorData,
Identifier as Identifier,
Permission as Permission,
ResponseInfo as ResponseInfo,
PaginationInfo as PaginationInfo,
PermissionGrant as PermissionGrant,
CloudflareTunnel as CloudflareTunnel,
LoadBalancerPreview as LoadBalancerPreview,
)
Expand All @@ -50,7 +52,6 @@
from .hyperdrive import Hyperdrive as Hyperdrive
from .membership import Membership as Membership
from .origin_dns import OriginDNS as OriginDNS
from .permission import Permission as Permission
from .r2_binding import R2Binding as R2Binding
from .rate_limit import RateLimit as RateLimit
from .rule_match import RuleMatch as RuleMatch
Expand Down
2 changes: 0 additions & 2 deletions src/cloudflare/types/accounts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from __future__ import annotations

from .permission_grant import PermissionGrant as PermissionGrant
from .role_get_response import RoleGetResponse as RoleGetResponse
from .member_list_params import MemberListParams as MemberListParams
from .member_create_params import MemberCreateParams as MemberCreateParams
Expand All @@ -11,4 +10,3 @@
from .member_update_params import MemberUpdateParams as MemberUpdateParams
from .user_with_invite_code import UserWithInviteCode as UserWithInviteCode
from .member_delete_response import MemberDeleteResponse as MemberDeleteResponse
from .permission_grant_param import PermissionGrantParam as PermissionGrantParam
2 changes: 1 addition & 1 deletion src/cloudflare/types/accounts/member_list_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import List, Optional
from typing_extensions import Literal

from ..role import Role
from ..shared import Role
from ..._models import BaseModel

__all__ = ["MemberListResponse"]
Expand Down
2 changes: 1 addition & 1 deletion src/cloudflare/types/accounts/user_with_invite_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from typing import List, Optional

from ..shared import PermissionGrant
from ..._models import BaseModel
from .permission_grant import PermissionGrant

__all__ = ["UserWithInviteCode", "Role", "RolePermissions", "User"]

Expand Down
Loading

0 comments on commit 83339e4

Please sign in to comment.