Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#274)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Apr 22, 2024
1 parent 72a3b86 commit 2a11bb1
Show file tree
Hide file tree
Showing 13 changed files with 749 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 1250
configured_endpoints: 1251
6 changes: 5 additions & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4174,9 +4174,13 @@ Methods:
Types:

```python
from cloudflare.types.request_tracers import Trace, TraceItem
from cloudflare.types.request_tracers import Trace, TraceItem, TraceCreateResponse
```

Methods:

- <code title="post /accounts/{account_identifier}/request-tracer/trace">client.request_tracers.traces.<a href="./src/cloudflare/resources/request_tracers/traces.py">create</a>(account_identifier, \*\*<a href="src/cloudflare/types/request_tracers/trace_create_params.py">params</a>) -> <a href="./src/cloudflare/types/request_tracers/trace_create_response.py">TraceCreateResponse</a></code>

# Rules

## Lists
Expand Down
8 changes: 8 additions & 0 deletions src/cloudflare/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class Cloudflare(SyncAPIClient):
pages: resources.Pages
pcaps: resources.PCAPs
registrar: resources.Registrar
request_tracers: resources.RequestTracers
rules: resources.Rules
storage: resources.Storage
stream: resources.Stream
Expand Down Expand Up @@ -257,6 +258,7 @@ def __init__(
self.pages = resources.Pages(self)
self.pcaps = resources.PCAPs(self)
self.registrar = resources.Registrar(self)
self.request_tracers = resources.RequestTracers(self)
self.rules = resources.Rules(self)
self.storage = resources.Storage(self)
self.stream = resources.Stream(self)
Expand Down Expand Up @@ -514,6 +516,7 @@ class AsyncCloudflare(AsyncAPIClient):
pages: resources.AsyncPages
pcaps: resources.AsyncPCAPs
registrar: resources.AsyncRegistrar
request_tracers: resources.AsyncRequestTracers
rules: resources.AsyncRules
storage: resources.AsyncStorage
stream: resources.AsyncStream
Expand Down Expand Up @@ -668,6 +671,7 @@ def __init__(
self.pages = resources.AsyncPages(self)
self.pcaps = resources.AsyncPCAPs(self)
self.registrar = resources.AsyncRegistrar(self)
self.request_tracers = resources.AsyncRequestTracers(self)
self.rules = resources.AsyncRules(self)
self.storage = resources.AsyncStorage(self)
self.stream = resources.AsyncStream(self)
Expand Down Expand Up @@ -926,6 +930,7 @@ def __init__(self, client: Cloudflare) -> None:
self.pages = resources.PagesWithRawResponse(client.pages)
self.pcaps = resources.PCAPsWithRawResponse(client.pcaps)
self.registrar = resources.RegistrarWithRawResponse(client.registrar)
self.request_tracers = resources.RequestTracersWithRawResponse(client.request_tracers)
self.rules = resources.RulesWithRawResponse(client.rules)
self.storage = resources.StorageWithRawResponse(client.storage)
self.stream = resources.StreamWithRawResponse(client.stream)
Expand Down Expand Up @@ -1015,6 +1020,7 @@ def __init__(self, client: AsyncCloudflare) -> None:
self.pages = resources.AsyncPagesWithRawResponse(client.pages)
self.pcaps = resources.AsyncPCAPsWithRawResponse(client.pcaps)
self.registrar = resources.AsyncRegistrarWithRawResponse(client.registrar)
self.request_tracers = resources.AsyncRequestTracersWithRawResponse(client.request_tracers)
self.rules = resources.AsyncRulesWithRawResponse(client.rules)
self.storage = resources.AsyncStorageWithRawResponse(client.storage)
self.stream = resources.AsyncStreamWithRawResponse(client.stream)
Expand Down Expand Up @@ -1104,6 +1110,7 @@ def __init__(self, client: Cloudflare) -> None:
self.pages = resources.PagesWithStreamingResponse(client.pages)
self.pcaps = resources.PCAPsWithStreamingResponse(client.pcaps)
self.registrar = resources.RegistrarWithStreamingResponse(client.registrar)
self.request_tracers = resources.RequestTracersWithStreamingResponse(client.request_tracers)
self.rules = resources.RulesWithStreamingResponse(client.rules)
self.storage = resources.StorageWithStreamingResponse(client.storage)
self.stream = resources.StreamWithStreamingResponse(client.stream)
Expand Down Expand Up @@ -1197,6 +1204,7 @@ def __init__(self, client: AsyncCloudflare) -> None:
self.pages = resources.AsyncPagesWithStreamingResponse(client.pages)
self.pcaps = resources.AsyncPCAPsWithStreamingResponse(client.pcaps)
self.registrar = resources.AsyncRegistrarWithStreamingResponse(client.registrar)
self.request_tracers = resources.AsyncRequestTracersWithStreamingResponse(client.request_tracers)
self.rules = resources.AsyncRulesWithStreamingResponse(client.rules)
self.storage = resources.AsyncStorageWithStreamingResponse(client.storage)
self.stream = resources.AsyncStreamWithStreamingResponse(client.stream)
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 @@ -520,6 +520,14 @@
ManagedHeadersWithStreamingResponse,
AsyncManagedHeadersWithStreamingResponse,
)
from .request_tracers import (
RequestTracers,
AsyncRequestTracers,
RequestTracersWithRawResponse,
AsyncRequestTracersWithRawResponse,
RequestTracersWithStreamingResponse,
AsyncRequestTracersWithStreamingResponse,
)
from .brand_protection import (
BrandProtection,
AsyncBrandProtection,
Expand Down Expand Up @@ -970,6 +978,12 @@
"AsyncRegistrarWithRawResponse",
"RegistrarWithStreamingResponse",
"AsyncRegistrarWithStreamingResponse",
"RequestTracers",
"AsyncRequestTracers",
"RequestTracersWithRawResponse",
"AsyncRequestTracersWithRawResponse",
"RequestTracersWithStreamingResponse",
"AsyncRequestTracersWithStreamingResponse",
"Rules",
"AsyncRules",
"RulesWithRawResponse",
Expand Down
33 changes: 33 additions & 0 deletions src/cloudflare/resources/request_tracers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from .traces import (
Traces,
AsyncTraces,
TracesWithRawResponse,
AsyncTracesWithRawResponse,
TracesWithStreamingResponse,
AsyncTracesWithStreamingResponse,
)
from .request_tracers import (
RequestTracers,
AsyncRequestTracers,
RequestTracersWithRawResponse,
AsyncRequestTracersWithRawResponse,
RequestTracersWithStreamingResponse,
AsyncRequestTracersWithStreamingResponse,
)

__all__ = [
"Traces",
"AsyncTraces",
"TracesWithRawResponse",
"AsyncTracesWithRawResponse",
"TracesWithStreamingResponse",
"AsyncTracesWithStreamingResponse",
"RequestTracers",
"AsyncRequestTracers",
"RequestTracersWithRawResponse",
"AsyncRequestTracersWithRawResponse",
"RequestTracersWithStreamingResponse",
"AsyncRequestTracersWithStreamingResponse",
]
80 changes: 80 additions & 0 deletions src/cloudflare/resources/request_tracers/request_tracers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from .traces import (
Traces,
AsyncTraces,
TracesWithRawResponse,
AsyncTracesWithRawResponse,
TracesWithStreamingResponse,
AsyncTracesWithStreamingResponse,
)
from ..._compat import cached_property
from ..._resource import SyncAPIResource, AsyncAPIResource

__all__ = ["RequestTracers", "AsyncRequestTracers"]


class RequestTracers(SyncAPIResource):
@cached_property
def traces(self) -> Traces:
return Traces(self._client)

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

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


class AsyncRequestTracers(AsyncAPIResource):
@cached_property
def traces(self) -> AsyncTraces:
return AsyncTraces(self._client)

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

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


class RequestTracersWithRawResponse:
def __init__(self, request_tracers: RequestTracers) -> None:
self._request_tracers = request_tracers

@cached_property
def traces(self) -> TracesWithRawResponse:
return TracesWithRawResponse(self._request_tracers.traces)


class AsyncRequestTracersWithRawResponse:
def __init__(self, request_tracers: AsyncRequestTracers) -> None:
self._request_tracers = request_tracers

@cached_property
def traces(self) -> AsyncTracesWithRawResponse:
return AsyncTracesWithRawResponse(self._request_tracers.traces)


class RequestTracersWithStreamingResponse:
def __init__(self, request_tracers: RequestTracers) -> None:
self._request_tracers = request_tracers

@cached_property
def traces(self) -> TracesWithStreamingResponse:
return TracesWithStreamingResponse(self._request_tracers.traces)


class AsyncRequestTracersWithStreamingResponse:
def __init__(self, request_tracers: AsyncRequestTracers) -> None:
self._request_tracers = request_tracers

@cached_property
def traces(self) -> AsyncTracesWithStreamingResponse:
return AsyncTracesWithStreamingResponse(self._request_tracers.traces)
Loading

0 comments on commit 2a11bb1

Please sign in to comment.