Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored Apr 12, 2024
1 parent 0c03064 commit fbf88e1
Show file tree
Hide file tree
Showing 12 changed files with 61 additions and 67 deletions.
15 changes: 4 additions & 11 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,7 @@ from cloudflare.types import (
Types:

```python
from cloudflare.types import (
Account,
Role,
User,
AccountUpdateResponse,
AccountListResponse,
AccountGetResponse,
)
from cloudflare.types import Account, AccountUpdateResponse, AccountListResponse, AccountGetResponse
```

Methods:
Expand Down Expand Up @@ -115,12 +108,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>

# User
# UserResource

Types:

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

Methods:
Expand Down Expand Up @@ -244,7 +237,7 @@ Methods:
Types:

```python
from cloudflare.types.user.tokens import Permission, PermissionGroupListResponse
from cloudflare.types.user.tokens import PermissionGroupListResponse
```

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.User
user: resources.UserResource
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.User(self)
self.user = resources.UserResource(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.AsyncUser
user: resources.AsyncUserResource
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.AsyncUser(self)
self.user = resources.AsyncUserResource(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.UserWithRawResponse(client.user)
self.user = resources.UserResourceWithRawResponse(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.AsyncUserWithRawResponse(client.user)
self.user = resources.AsyncUserResourceWithRawResponse(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.UserWithStreamingResponse(client.user)
self.user = resources.UserResourceWithStreamingResponse(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.AsyncUserWithStreamingResponse(client.user)
self.user = resources.AsyncUserResourceWithStreamingResponse(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 (
User,
AsyncUser,
UserWithRawResponse,
AsyncUserWithRawResponse,
UserWithStreamingResponse,
AsyncUserWithStreamingResponse,
UserResource,
AsyncUserResource,
UserResourceWithRawResponse,
AsyncUserResourceWithRawResponse,
UserResourceWithStreamingResponse,
AsyncUserResourceWithStreamingResponse,
)
from .web3 import (
Web3,
Expand Down Expand Up @@ -666,12 +666,12 @@
"AsyncMembershipsWithRawResponse",
"MembershipsWithStreamingResponse",
"AsyncMembershipsWithStreamingResponse",
"User",
"AsyncUser",
"UserWithRawResponse",
"AsyncUserWithRawResponse",
"UserWithStreamingResponse",
"AsyncUserWithStreamingResponse",
"UserResource",
"AsyncUserResource",
"UserResourceWithRawResponse",
"AsyncUserResourceWithRawResponse",
"UserResourceWithStreamingResponse",
"AsyncUserResourceWithStreamingResponse",
"Zones",
"AsyncZones",
"ZonesWithRawResponse",
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 (
User,
AsyncUser,
UserWithRawResponse,
AsyncUserWithRawResponse,
UserWithStreamingResponse,
AsyncUserWithStreamingResponse,
UserResource,
AsyncUserResource,
UserResourceWithRawResponse,
AsyncUserResourceWithRawResponse,
UserResourceWithStreamingResponse,
AsyncUserResourceWithStreamingResponse,
)
from .tokens import (
Tokens,
Expand Down Expand Up @@ -94,10 +94,10 @@
"AsyncTokensWithRawResponse",
"TokensWithStreamingResponse",
"AsyncTokensWithStreamingResponse",
"User",
"AsyncUser",
"UserWithRawResponse",
"AsyncUserWithRawResponse",
"UserWithStreamingResponse",
"AsyncUserWithStreamingResponse",
"UserResource",
"AsyncUserResource",
"UserResourceWithRawResponse",
"AsyncUserResourceWithRawResponse",
"UserResourceWithStreamingResponse",
"AsyncUserResourceWithStreamingResponse",
]
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__ = ["User", "AsyncUser"]
__all__ = ["UserResource", "AsyncUserResource"]


class User(SyncAPIResource):
class UserResource(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) -> UserWithRawResponse:
return UserWithRawResponse(self)
def with_raw_response(self) -> UserResourceWithRawResponse:
return UserResourceWithRawResponse(self)

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

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


class AsyncUser(AsyncAPIResource):
class AsyncUserResource(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) -> AsyncUserWithRawResponse:
return AsyncUserWithRawResponse(self)
def with_raw_response(self) -> AsyncUserResourceWithRawResponse:
return AsyncUserResourceWithRawResponse(self)

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

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


class UserWithRawResponse:
def __init__(self, user: User) -> None:
class UserResourceWithRawResponse:
def __init__(self, user: UserResource) -> 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 AsyncUserWithRawResponse:
def __init__(self, user: AsyncUser) -> None:
class AsyncUserResourceWithRawResponse:
def __init__(self, user: AsyncUserResource) -> 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 UserWithStreamingResponse:
def __init__(self, user: User) -> None:
class UserResourceWithStreamingResponse:
def __init__(self, user: UserResource) -> 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 AsyncUserWithStreamingResponse:
def __init__(self, user: AsyncUser) -> None:
class AsyncUserResourceWithStreamingResponse:
def __init__(self, user: AsyncUserResource) -> None:
self._user = user

self.edit = async_to_streamed_response_wrapper(
Expand Down
1 change: 1 addition & 0 deletions src/cloudflare/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
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
File renamed without changes.
2 changes: 1 addition & 1 deletion src/cloudflare/types/role.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import List

from .._models import BaseModel
from .user.tokens import Permission
from .permission import Permission

__all__ = ["Role"]

Expand Down
1 change: 1 addition & 0 deletions src/cloudflare/types/user/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from __future__ import annotations

from .user import User as User
from .invite import Invite as Invite
from .policy import Policy as Policy
from .cidr_list import CIDRList as CIDRList
Expand Down
2 changes: 1 addition & 1 deletion src/cloudflare/types/user/organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from typing import List, Optional
from typing_extensions import Literal

from .tokens import Permission
from ..._models import BaseModel
from ..permission import Permission

__all__ = ["Organization"]

Expand Down
1 change: 0 additions & 1 deletion src/cloudflare/types/user/tokens/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@
from __future__ import annotations

from .value import Value as Value
from .permission import Permission as Permission
from .value_update_params import ValueUpdateParams as ValueUpdateParams
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from typing import List, Optional

from .._models import BaseModel
from .accounts import PermissionGrant
from ..._models import BaseModel
from ..accounts import PermissionGrant

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

Expand Down

0 comments on commit fbf88e1

Please sign in to comment.