From 31c592f48a8c7eb01fcd38ad1ea0eeb3ee2a2b08 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 9 Apr 2024 23:43:21 +0000 Subject: [PATCH] feat(api): update via SDK Studio (#253) --- api.md | 2 +- .../types/request_tracers/__init__.py | 1 + src/cloudflare/types/request_tracers/trace.py | 35 ++----------- .../request_tracers/trace_create_response.py | 16 ++++-- .../types/request_tracers/trace_item.py | 49 +++++++++++++++++++ 5 files changed, 68 insertions(+), 35 deletions(-) create mode 100644 src/cloudflare/types/request_tracers/trace_item.py diff --git a/api.md b/api.md index 40717fff0e44..5e5bebd996b7 100644 --- a/api.md +++ b/api.md @@ -4086,7 +4086,7 @@ Methods: Types: ```python -from cloudflare.types.request_tracers import Trace, TraceCreateResponse +from cloudflare.types.request_tracers import Trace, TraceItem, TraceCreateResponse ``` Methods: diff --git a/src/cloudflare/types/request_tracers/__init__.py b/src/cloudflare/types/request_tracers/__init__.py index a1d489d78faf..40a594702593 100644 --- a/src/cloudflare/types/request_tracers/__init__.py +++ b/src/cloudflare/types/request_tracers/__init__.py @@ -3,5 +3,6 @@ from __future__ import annotations from .trace import Trace as Trace +from .trace_item import TraceItem as TraceItem from .trace_create_params import TraceCreateParams as TraceCreateParams from .trace_create_response import TraceCreateResponse as TraceCreateResponse diff --git a/src/cloudflare/types/request_tracers/trace.py b/src/cloudflare/types/request_tracers/trace.py index 0049e7cb69c8..4687762c7f89 100644 --- a/src/cloudflare/types/request_tracers/trace.py +++ b/src/cloudflare/types/request_tracers/trace.py @@ -1,38 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from __future__ import annotations -from ..._models import BaseModel +from typing import List __all__ = ["Trace"] +Trace = List["TraceItem"] -class Trace(BaseModel): - action: Optional[str] = None - """If step type is rule, then action performed by this rule""" - - action_parameters: Optional[object] = None - """If step type is rule, then action parameters of this rule as JSON""" - - description: Optional[str] = None - """If step type is rule or ruleset, the description of this entity""" - - expression: Optional[str] = None - """If step type is rule, then expression used to match for this rule""" - - kind: Optional[str] = None - """If step type is ruleset, then kind of this ruleset""" - - matched: Optional[bool] = None - """Whether tracing step affected tracing request/response""" - - name: Optional[str] = None - """If step type is ruleset, then name of this ruleset""" - - step_name: Optional[str] = None - """Tracing step identifying name""" - - trace: Optional[List[Trace]] = None - - type: Optional[str] = None - """Tracing step type""" +from .trace_item import TraceItem diff --git a/src/cloudflare/types/request_tracers/trace_create_response.py b/src/cloudflare/types/request_tracers/trace_create_response.py index 10bb88349e51..3e72c080e9a8 100644 --- a/src/cloudflare/types/request_tracers/trace_create_response.py +++ b/src/cloudflare/types/request_tracers/trace_create_response.py @@ -1,8 +1,10 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from __future__ import annotations -from .trace import Trace +from typing import Optional + +from ..._compat import PYDANTIC_V2 from ..._models import BaseModel __all__ = ["TraceCreateResponse"] @@ -12,4 +14,12 @@ class TraceCreateResponse(BaseModel): status_code: Optional[int] = None """HTTP Status code of zone response""" - trace: Optional[List[Trace]] = None + trace: Optional["Trace"] = None + + +from .trace import Trace + +if PYDANTIC_V2: + TraceCreateResponse.model_rebuild() +else: + TraceCreateResponse.update_forward_refs() # type: ignore diff --git a/src/cloudflare/types/request_tracers/trace_item.py b/src/cloudflare/types/request_tracers/trace_item.py new file mode 100644 index 000000000000..2830764115ef --- /dev/null +++ b/src/cloudflare/types/request_tracers/trace_item.py @@ -0,0 +1,49 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional + +from ..._compat import PYDANTIC_V2 +from ..._models import BaseModel + +__all__ = ["TraceItem"] + + +class TraceItem(BaseModel): + action: Optional[str] = None + """If step type is rule, then action performed by this rule""" + + action_parameters: Optional[object] = None + """If step type is rule, then action parameters of this rule as JSON""" + + description: Optional[str] = None + """If step type is rule or ruleset, the description of this entity""" + + expression: Optional[str] = None + """If step type is rule, then expression used to match for this rule""" + + kind: Optional[str] = None + """If step type is ruleset, then kind of this ruleset""" + + matched: Optional[bool] = None + """Whether tracing step affected tracing request/response""" + + name: Optional[str] = None + """If step type is ruleset, then name of this ruleset""" + + step_name: Optional[str] = None + """Tracing step identifying name""" + + trace: Optional["Trace"] = None + + type: Optional[str] = None + """Tracing step type""" + + +from .trace import Trace + +if PYDANTIC_V2: + TraceItem.model_rebuild() +else: + TraceItem.update_forward_refs() # type: ignore