From 2ab74c22f19062fc2c7bbad3c9de2311b1295668 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 28 Feb 2024 10:34:57 +0000 Subject: [PATCH] feat: OpenAPI spec update via Stainless API --- api.md | 1 - requesttracertrace.go | 98 ++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 93 insertions(+), 6 deletions(-) diff --git a/api.md b/api.md index 92e1b2808e8..b67b6286e54 100644 --- a/api.md +++ b/api.md @@ -4082,7 +4082,6 @@ Methods: Response Types: -- cloudflare.HhgJaXcvTrace - cloudflare.RequestTracerTraceNewResponse Methods: diff --git a/requesttracertrace.go b/requesttracertrace.go index 7779b5dc4c6..5165f46f7a0 100644 --- a/requesttracertrace.go +++ b/requesttracertrace.go @@ -44,14 +44,12 @@ func (r *RequestTracerTraceService) New(ctx context.Context, accountIdentifier s return } -type HhgJaXcvTrace []HhgJaXcvTrace - // Trace result with an origin status code type RequestTracerTraceNewResponse struct { // HTTP Status code of zone response - StatusCode int64 `json:"status_code"` - Trace HhgJaXcvTrace `json:"trace"` - JSON requestTracerTraceNewResponseJSON `json:"-"` + StatusCode int64 `json:"status_code"` + Trace []RequestTracerTraceNewResponseTrace `json:"trace"` + JSON requestTracerTraceNewResponseJSON `json:"-"` } // requestTracerTraceNewResponseJSON contains the JSON metadata for the struct @@ -67,6 +65,96 @@ func (r *RequestTracerTraceNewResponse) UnmarshalJSON(data []byte) (err error) { return apijson.UnmarshalRoot(data, r) } +// List of steps acting on request/response +type RequestTracerTraceNewResponseTrace struct { + // If step type is rule, then action performed by this rule + Action string `json:"action"` + // If step type is rule, then action parameters of this rule as JSON + ActionParameters interface{} `json:"action_parameters"` + // If step type is rule or ruleset, the description of this entity + Description string `json:"description"` + // If step type is rule, then expression used to match for this rule + Expression string `json:"expression"` + // If step type is ruleset, then kind of this ruleset + Kind string `json:"kind"` + // Whether tracing step affected tracing request/response + Matched bool `json:"matched"` + // If step type is ruleset, then name of this ruleset + Name string `json:"name"` + // Tracing step identifying name + StepName string `json:"step_name"` + Trace []RequestTracerTraceNewResponseTraceTrace `json:"trace"` + // Tracing step type + Type string `json:"type"` + JSON requestTracerTraceNewResponseTraceJSON `json:"-"` +} + +// requestTracerTraceNewResponseTraceJSON contains the JSON metadata for the struct +// [RequestTracerTraceNewResponseTrace] +type requestTracerTraceNewResponseTraceJSON struct { + Action apijson.Field + ActionParameters apijson.Field + Description apijson.Field + Expression apijson.Field + Kind apijson.Field + Matched apijson.Field + Name apijson.Field + StepName apijson.Field + Trace apijson.Field + Type apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RequestTracerTraceNewResponseTrace) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + +// List of steps acting on request/response +type RequestTracerTraceNewResponseTraceTrace struct { + // If step type is rule, then action performed by this rule + Action string `json:"action"` + // If step type is rule, then action parameters of this rule as JSON + ActionParameters interface{} `json:"action_parameters"` + // If step type is rule or ruleset, the description of this entity + Description string `json:"description"` + // If step type is rule, then expression used to match for this rule + Expression string `json:"expression"` + // If step type is ruleset, then kind of this ruleset + Kind string `json:"kind"` + // Whether tracing step affected tracing request/response + Matched bool `json:"matched"` + // If step type is ruleset, then name of this ruleset + Name string `json:"name"` + // Tracing step identifying name + StepName string `json:"step_name"` + Trace interface{} `json:"trace"` + // Tracing step type + Type string `json:"type"` + JSON requestTracerTraceNewResponseTraceTraceJSON `json:"-"` +} + +// requestTracerTraceNewResponseTraceTraceJSON contains the JSON metadata for the +// struct [RequestTracerTraceNewResponseTraceTrace] +type requestTracerTraceNewResponseTraceTraceJSON struct { + Action apijson.Field + ActionParameters apijson.Field + Description apijson.Field + Expression apijson.Field + Kind apijson.Field + Matched apijson.Field + Name apijson.Field + StepName apijson.Field + Trace apijson.Field + Type apijson.Field + raw string + ExtraFields map[string]apijson.Field +} + +func (r *RequestTracerTraceNewResponseTraceTrace) UnmarshalJSON(data []byte) (err error) { + return apijson.UnmarshalRoot(data, r) +} + type RequestTracerTraceNewParams struct { // HTTP Method of tracing request Method param.Field[string] `json:"method,required"`