Skip to content

Commit

Permalink
feat(api): update via SDK Studio (#995)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Jun 17, 2024
1 parent 349941a commit 3de5454
Show file tree
Hide file tree
Showing 30 changed files with 3,263 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1343
configured_endpoints: 1352
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e3875d4464358c7aee5cbb9a4e0e39f0e400536dfadb684e8f217a2800897d0e.yml
51 changes: 51 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3131,6 +3131,7 @@ Types:

```python
from cloudflare.types.page_shield import (
Policy,
PolicyCreateResponse,
PolicyUpdateResponse,
PolicyListResponse,
Expand Down Expand Up @@ -3172,6 +3173,19 @@ Methods:
- <code title="get /zones/{zone_id}/page_shield/scripts">client.page_shield.scripts.<a href="./src/cloudflare/resources/page_shield/scripts.py">list</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/page_shield/script_list_params.py">params</a>) -> <a href="./src/cloudflare/types/page_shield/script.py">SyncSinglePage[Script]</a></code>
- <code title="get /zones/{zone_id}/page_shield/scripts/{script_id}">client.page_shield.scripts.<a href="./src/cloudflare/resources/page_shield/scripts.py">get</a>(script_id, \*, zone_id) -> <a href="./src/cloudflare/types/page_shield/script_get_response.py">Optional</a></code>

## Cookies

Types:

```python
from cloudflare.types.page_shield import CookieListResponse, CookieGetResponse
```

Methods:

- <code title="get /zones/{zone_id}/page_shield/cookies">client.page_shield.cookies.<a href="./src/cloudflare/resources/page_shield/cookies.py">list</a>(\*, zone_id, \*\*<a href="src/cloudflare/types/page_shield/cookie_list_params.py">params</a>) -> <a href="./src/cloudflare/types/page_shield/cookie_list_response.py">SyncSinglePage[CookieListResponse]</a></code>
- <code title="get /zones/{zone_id}/page_shield/cookies/{cookie_id}">client.page_shield.cookies.<a href="./src/cloudflare/resources/page_shield/cookies.py">get</a>(cookie_id, \*, zone_id) -> <a href="./src/cloudflare/types/page_shield/cookie_get_response.py">Optional</a></code>

# Rulesets

Types:
Expand Down Expand Up @@ -7882,3 +7896,40 @@ from cloudflare.types.ai_gateway import LogGetResponse
Methods:

- <code title="get /accounts/{account_id}/ai-gateway/gateways/{id}/logs">client.ai_gateway.logs.<a href="./src/cloudflare/resources/ai_gateway/logs.py">get</a>(id, \*, account_id, \*\*<a href="src/cloudflare/types/ai_gateway/log_get_params.py">params</a>) -> <a href="./src/cloudflare/types/ai_gateway/log_get_response.py">LogGetResponse</a></code>

# Iam

## PermissionGroups

Types:

```python
from cloudflare.types.iam import PermissionGroupListResponse, PermissionGroupGetResponse
```

Methods:

- <code title="get /accounts/{account_id}/iam/permission_groups">client.iam.permission_groups.<a href="./src/cloudflare/resources/iam/permission_groups.py">list</a>(\*, account_id, \*\*<a href="src/cloudflare/types/iam/permission_group_list_params.py">params</a>) -> <a href="./src/cloudflare/types/iam/permission_group_list_response.py">SyncV4PagePaginationArray[object]</a></code>
- <code title="get /accounts/{account_id}/iam/permission_groups/{permission_group_id}">client.iam.permission_groups.<a href="./src/cloudflare/resources/iam/permission_groups.py">get</a>(permission_group_id, \*, account_id) -> <a href="./src/cloudflare/types/iam/permission_group_get_response.py">PermissionGroupGetResponse</a></code>

## ResourceGroups

Types:

```python
from cloudflare.types.iam import (
ResourceGroupCreateResponse,
ResourceGroupUpdateResponse,
ResourceGroupListResponse,
ResourceGroupDeleteResponse,
ResourceGroupGetResponse,
)
```

Methods:

- <code title="post /accounts/{account_id}/iam/resource_groups">client.iam.resource_groups.<a href="./src/cloudflare/resources/iam/resource_groups.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/iam/resource_group_create_params.py">params</a>) -> <a href="./src/cloudflare/types/iam/resource_group_create_response.py">ResourceGroupCreateResponse</a></code>
- <code title="put /accounts/{account_id}/iam/resource_groups/{resource_group_id}">client.iam.resource_groups.<a href="./src/cloudflare/resources/iam/resource_groups.py">update</a>(resource_group_id, \*, account_id, \*\*<a href="src/cloudflare/types/iam/resource_group_update_params.py">params</a>) -> <a href="./src/cloudflare/types/iam/resource_group_update_response.py">ResourceGroupUpdateResponse</a></code>
- <code title="get /accounts/{account_id}/iam/resource_groups">client.iam.resource_groups.<a href="./src/cloudflare/resources/iam/resource_groups.py">list</a>(\*, account_id, \*\*<a href="src/cloudflare/types/iam/resource_group_list_params.py">params</a>) -> <a href="./src/cloudflare/types/iam/resource_group_list_response.py">SyncV4PagePaginationArray[object]</a></code>
- <code title="delete /accounts/{account_id}/iam/resource_groups/{resource_group_id}">client.iam.resource_groups.<a href="./src/cloudflare/resources/iam/resource_groups.py">delete</a>(resource_group_id, \*, account_id) -> <a href="./src/cloudflare/types/iam/resource_group_delete_response.py">Optional</a></code>
- <code title="get /accounts/{account_id}/iam/resource_groups/{resource_group_id}">client.iam.resource_groups.<a href="./src/cloudflare/resources/iam/resource_groups.py">get</a>(resource_group_id, \*, account_id) -> <a href="./src/cloudflare/types/iam/resource_group_get_response.py">ResourceGroupGetResponse</a></code>
8 changes: 8 additions & 0 deletions src/cloudflare/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ class Cloudflare(SyncAPIClient):
cloudforce_one: resources.CloudforceOneResource
event_notifications: resources.EventNotificationsResource
ai_gateway: resources.AIGatewayResource
iam: resources.IamResource
with_raw_response: CloudflareWithRawResponse
with_streaming_response: CloudflareWithStreamedResponse

Expand Down Expand Up @@ -288,6 +289,7 @@ def __init__(
self.cloudforce_one = resources.CloudforceOneResource(self)
self.event_notifications = resources.EventNotificationsResource(self)
self.ai_gateway = resources.AIGatewayResource(self)
self.iam = resources.IamResource(self)
self.with_raw_response = CloudflareWithRawResponse(self)
self.with_streaming_response = CloudflareWithStreamedResponse(self)

Expand Down Expand Up @@ -549,6 +551,7 @@ class AsyncCloudflare(AsyncAPIClient):
cloudforce_one: resources.AsyncCloudforceOneResource
event_notifications: resources.AsyncEventNotificationsResource
ai_gateway: resources.AsyncAIGatewayResource
iam: resources.AsyncIamResource
with_raw_response: AsyncCloudflareWithRawResponse
with_streaming_response: AsyncCloudflareWithStreamedResponse

Expand Down Expand Up @@ -707,6 +710,7 @@ def __init__(
self.cloudforce_one = resources.AsyncCloudforceOneResource(self)
self.event_notifications = resources.AsyncEventNotificationsResource(self)
self.ai_gateway = resources.AsyncAIGatewayResource(self)
self.iam = resources.AsyncIamResource(self)
self.with_raw_response = AsyncCloudflareWithRawResponse(self)
self.with_streaming_response = AsyncCloudflareWithStreamedResponse(self)

Expand Down Expand Up @@ -979,6 +983,7 @@ def __init__(self, client: Cloudflare) -> None:
self.cloudforce_one = resources.CloudforceOneResourceWithRawResponse(client.cloudforce_one)
self.event_notifications = resources.EventNotificationsResourceWithRawResponse(client.event_notifications)
self.ai_gateway = resources.AIGatewayResourceWithRawResponse(client.ai_gateway)
self.iam = resources.IamResourceWithRawResponse(client.iam)


class AsyncCloudflareWithRawResponse:
Expand Down Expand Up @@ -1080,6 +1085,7 @@ def __init__(self, client: AsyncCloudflare) -> None:
self.cloudforce_one = resources.AsyncCloudforceOneResourceWithRawResponse(client.cloudforce_one)
self.event_notifications = resources.AsyncEventNotificationsResourceWithRawResponse(client.event_notifications)
self.ai_gateway = resources.AsyncAIGatewayResourceWithRawResponse(client.ai_gateway)
self.iam = resources.AsyncIamResourceWithRawResponse(client.iam)


class CloudflareWithStreamedResponse:
Expand Down Expand Up @@ -1181,6 +1187,7 @@ def __init__(self, client: Cloudflare) -> None:
self.cloudforce_one = resources.CloudforceOneResourceWithStreamingResponse(client.cloudforce_one)
self.event_notifications = resources.EventNotificationsResourceWithStreamingResponse(client.event_notifications)
self.ai_gateway = resources.AIGatewayResourceWithStreamingResponse(client.ai_gateway)
self.iam = resources.IamResourceWithStreamingResponse(client.iam)


class AsyncCloudflareWithStreamedResponse:
Expand Down Expand Up @@ -1290,6 +1297,7 @@ def __init__(self, client: AsyncCloudflare) -> None:
client.event_notifications
)
self.ai_gateway = resources.AsyncAIGatewayResourceWithStreamingResponse(client.ai_gateway)
self.iam = resources.AsyncIamResourceWithStreamingResponse(client.iam)


Client = Cloudflare
Expand Down
14 changes: 14 additions & 0 deletions src/cloudflare/resources/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@
DNSResourceWithStreamingResponse,
AsyncDNSResourceWithStreamingResponse,
)
from .iam import (
IamResource,
AsyncIamResource,
IamResourceWithRawResponse,
AsyncIamResourceWithRawResponse,
IamResourceWithStreamingResponse,
AsyncIamResourceWithStreamingResponse,
)
from .ips import (
IPsResource,
AsyncIPsResource,
Expand Down Expand Up @@ -1164,4 +1172,10 @@
"AsyncAIGatewayResourceWithRawResponse",
"AIGatewayResourceWithStreamingResponse",
"AsyncAIGatewayResourceWithStreamingResponse",
"IamResource",
"AsyncIamResource",
"IamResourceWithRawResponse",
"AsyncIamResourceWithRawResponse",
"IamResourceWithStreamingResponse",
"AsyncIamResourceWithStreamingResponse",
]
47 changes: 47 additions & 0 deletions src/cloudflare/resources/iam/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from .iam import (
IamResource,
AsyncIamResource,
IamResourceWithRawResponse,
AsyncIamResourceWithRawResponse,
IamResourceWithStreamingResponse,
AsyncIamResourceWithStreamingResponse,
)
from .resource_groups import (
ResourceGroupsResource,
AsyncResourceGroupsResource,
ResourceGroupsResourceWithRawResponse,
AsyncResourceGroupsResourceWithRawResponse,
ResourceGroupsResourceWithStreamingResponse,
AsyncResourceGroupsResourceWithStreamingResponse,
)
from .permission_groups import (
PermissionGroupsResource,
AsyncPermissionGroupsResource,
PermissionGroupsResourceWithRawResponse,
AsyncPermissionGroupsResourceWithRawResponse,
PermissionGroupsResourceWithStreamingResponse,
AsyncPermissionGroupsResourceWithStreamingResponse,
)

__all__ = [
"PermissionGroupsResource",
"AsyncPermissionGroupsResource",
"PermissionGroupsResourceWithRawResponse",
"AsyncPermissionGroupsResourceWithRawResponse",
"PermissionGroupsResourceWithStreamingResponse",
"AsyncPermissionGroupsResourceWithStreamingResponse",
"ResourceGroupsResource",
"AsyncResourceGroupsResource",
"ResourceGroupsResourceWithRawResponse",
"AsyncResourceGroupsResourceWithRawResponse",
"ResourceGroupsResourceWithStreamingResponse",
"AsyncResourceGroupsResourceWithStreamingResponse",
"IamResource",
"AsyncIamResource",
"IamResourceWithRawResponse",
"AsyncIamResourceWithRawResponse",
"IamResourceWithStreamingResponse",
"AsyncIamResourceWithStreamingResponse",
]
112 changes: 112 additions & 0 deletions src/cloudflare/resources/iam/iam.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource
from .resource_groups import (
ResourceGroupsResource,
AsyncResourceGroupsResource,
ResourceGroupsResourceWithRawResponse,
AsyncResourceGroupsResourceWithRawResponse,
ResourceGroupsResourceWithStreamingResponse,
AsyncResourceGroupsResourceWithStreamingResponse,
)
from .permission_groups import (
PermissionGroupsResource,
AsyncPermissionGroupsResource,
PermissionGroupsResourceWithRawResponse,
AsyncPermissionGroupsResourceWithRawResponse,
PermissionGroupsResourceWithStreamingResponse,
AsyncPermissionGroupsResourceWithStreamingResponse,
)

__all__ = ["IamResource", "AsyncIamResource"]


class IamResource(SyncAPIResource):
@cached_property
def permission_groups(self) -> PermissionGroupsResource:
return PermissionGroupsResource(self._client)

@cached_property
def resource_groups(self) -> ResourceGroupsResource:
return ResourceGroupsResource(self._client)

@cached_property
def with_raw_response(self) -> IamResourceWithRawResponse:
return IamResourceWithRawResponse(self)

@cached_property
def with_streaming_response(self) -> IamResourceWithStreamingResponse:
return IamResourceWithStreamingResponse(self)


class AsyncIamResource(AsyncAPIResource):
@cached_property
def permission_groups(self) -> AsyncPermissionGroupsResource:
return AsyncPermissionGroupsResource(self._client)

@cached_property
def resource_groups(self) -> AsyncResourceGroupsResource:
return AsyncResourceGroupsResource(self._client)

@cached_property
def with_raw_response(self) -> AsyncIamResourceWithRawResponse:
return AsyncIamResourceWithRawResponse(self)

@cached_property
def with_streaming_response(self) -> AsyncIamResourceWithStreamingResponse:
return AsyncIamResourceWithStreamingResponse(self)


class IamResourceWithRawResponse:
def __init__(self, iam: IamResource) -> None:
self._iam = iam

@cached_property
def permission_groups(self) -> PermissionGroupsResourceWithRawResponse:
return PermissionGroupsResourceWithRawResponse(self._iam.permission_groups)

@cached_property
def resource_groups(self) -> ResourceGroupsResourceWithRawResponse:
return ResourceGroupsResourceWithRawResponse(self._iam.resource_groups)


class AsyncIamResourceWithRawResponse:
def __init__(self, iam: AsyncIamResource) -> None:
self._iam = iam

@cached_property
def permission_groups(self) -> AsyncPermissionGroupsResourceWithRawResponse:
return AsyncPermissionGroupsResourceWithRawResponse(self._iam.permission_groups)

@cached_property
def resource_groups(self) -> AsyncResourceGroupsResourceWithRawResponse:
return AsyncResourceGroupsResourceWithRawResponse(self._iam.resource_groups)


class IamResourceWithStreamingResponse:
def __init__(self, iam: IamResource) -> None:
self._iam = iam

@cached_property
def permission_groups(self) -> PermissionGroupsResourceWithStreamingResponse:
return PermissionGroupsResourceWithStreamingResponse(self._iam.permission_groups)

@cached_property
def resource_groups(self) -> ResourceGroupsResourceWithStreamingResponse:
return ResourceGroupsResourceWithStreamingResponse(self._iam.resource_groups)


class AsyncIamResourceWithStreamingResponse:
def __init__(self, iam: AsyncIamResource) -> None:
self._iam = iam

@cached_property
def permission_groups(self) -> AsyncPermissionGroupsResourceWithStreamingResponse:
return AsyncPermissionGroupsResourceWithStreamingResponse(self._iam.permission_groups)

@cached_property
def resource_groups(self) -> AsyncResourceGroupsResourceWithStreamingResponse:
return AsyncResourceGroupsResourceWithStreamingResponse(self._iam.resource_groups)
Loading

0 comments on commit 3de5454

Please sign in to comment.