From 388665d8da392629a767541d1cba9771b9a2d3a3 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 1 Aug 2024 13:01:07 +0000 Subject: [PATCH] Regenerate client from commit 5bb7cdec of spec repo --- .apigentools-info | 8 +-- .generator/schemas/v1/openapi.yaml | 30 ++++++-- ...tics_global_variable_parse_test_options.go | 2 +- ...global_variable_parse_test_options_type.go | 10 +-- ...ics_local_variable_parsing_options_type.go | 72 +++++++++++++++++++ .../model_synthetics_parsing_options.go | 26 +++---- .../CreateSyntheticsAPITest_1279271422.go | 2 +- 7 files changed, 121 insertions(+), 29 deletions(-) create mode 100644 api/datadogV1/model_synthetics_local_variable_parsing_options_type.go diff --git a/.apigentools-info b/.apigentools-info index 04ebba55af8..a10321f1873 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-07-30 19:24:56.339975", - "spec_repo_commit": "edbd396a" + "regenerated": "2024-08-01 12:59:21.719243", + "spec_repo_commit": "5bb7cdec" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-07-30 19:24:56.358983", - "spec_repo_commit": "edbd396a" + "regenerated": "2024-08-01 12:59:21.737592", + "spec_repo_commit": "5bb7cdec" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 1694c6267d2..6e6762e3c71 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -15207,17 +15207,18 @@ components: - type type: object SyntheticsGlobalVariableParseTestOptionsType: - description: Property of the Synthetic Test Response to use for a Synthetic - global variable. + description: Type of value to extract from a test for a Synthetic global variable. enum: - http_body - http_header + - http_status_code - local_variable example: http_body type: string x-enum-varnames: - HTTP_BODY - HTTP_HEADER + - HTTP_STATUS_CODE - LOCAL_VARIABLE SyntheticsGlobalVariableParserType: description: Type of parser for a Synthetic global variable from a synthetics @@ -15289,6 +15290,23 @@ components: $ref: '#/components/schemas/SyntheticsTestDetails' type: array type: object + SyntheticsLocalVariableParsingOptionsType: + description: Property of the Synthetic Test Response to extract into a local + variable. + enum: + - grpc_message + - grpc_metadata + - http_body + - http_header + - http_status_code + example: http_body + type: string + x-enum-varnames: + - GRPC_MESSAGE + - GRPC_METADATA + - HTTP_BODY + - HTTP_HEADER + - HTTP_STATUS_CODE SyntheticsLocation: description: 'Synthetic location that can be used when creating or editing a @@ -15315,8 +15333,8 @@ components: example: {} properties: field: - description: When type is `http_header`, name of the header to use to extract - the value. + description: When type is `http_header` or `grpc_metadata`, name of the + header or metadatum to extract. example: content-type type: string name: @@ -15328,7 +15346,7 @@ components: description: Determines whether or not the extracted value will be obfuscated. type: boolean type: - $ref: '#/components/schemas/SyntheticsGlobalVariableParseTestOptionsType' + $ref: '#/components/schemas/SyntheticsLocalVariableParsingOptionsType' type: object SyntheticsPatchTestBody: description: Wrapper around an array of [JSON Patch](https://jsonpatch.com) @@ -15903,7 +15921,7 @@ components: type: object SyntheticsTestMetadata: additionalProperties: - description: A single Metadatum. + description: A single metadatum. type: string description: Metadata to include when performing the gRPC test. type: object diff --git a/api/datadogV1/model_synthetics_global_variable_parse_test_options.go b/api/datadogV1/model_synthetics_global_variable_parse_test_options.go index 17374b1d393..22f2937321b 100644 --- a/api/datadogV1/model_synthetics_global_variable_parse_test_options.go +++ b/api/datadogV1/model_synthetics_global_variable_parse_test_options.go @@ -18,7 +18,7 @@ type SyntheticsGlobalVariableParseTestOptions struct { LocalVariableName *string `json:"localVariableName,omitempty"` // Details of the parser to use for the global variable. Parser *SyntheticsVariableParser `json:"parser,omitempty"` - // Property of the Synthetic Test Response to use for a Synthetic global variable. + // Type of value to extract from a test for a Synthetic global variable. Type SyntheticsGlobalVariableParseTestOptionsType `json:"type"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` diff --git a/api/datadogV1/model_synthetics_global_variable_parse_test_options_type.go b/api/datadogV1/model_synthetics_global_variable_parse_test_options_type.go index 4f114c18fb6..3478564377c 100644 --- a/api/datadogV1/model_synthetics_global_variable_parse_test_options_type.go +++ b/api/datadogV1/model_synthetics_global_variable_parse_test_options_type.go @@ -10,19 +10,21 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// SyntheticsGlobalVariableParseTestOptionsType Property of the Synthetic Test Response to use for a Synthetic global variable. +// SyntheticsGlobalVariableParseTestOptionsType Type of value to extract from a test for a Synthetic global variable. type SyntheticsGlobalVariableParseTestOptionsType string // List of SyntheticsGlobalVariableParseTestOptionsType. const ( - SYNTHETICSGLOBALVARIABLEPARSETESTOPTIONSTYPE_HTTP_BODY SyntheticsGlobalVariableParseTestOptionsType = "http_body" - SYNTHETICSGLOBALVARIABLEPARSETESTOPTIONSTYPE_HTTP_HEADER SyntheticsGlobalVariableParseTestOptionsType = "http_header" - SYNTHETICSGLOBALVARIABLEPARSETESTOPTIONSTYPE_LOCAL_VARIABLE SyntheticsGlobalVariableParseTestOptionsType = "local_variable" + SYNTHETICSGLOBALVARIABLEPARSETESTOPTIONSTYPE_HTTP_BODY SyntheticsGlobalVariableParseTestOptionsType = "http_body" + SYNTHETICSGLOBALVARIABLEPARSETESTOPTIONSTYPE_HTTP_HEADER SyntheticsGlobalVariableParseTestOptionsType = "http_header" + SYNTHETICSGLOBALVARIABLEPARSETESTOPTIONSTYPE_HTTP_STATUS_CODE SyntheticsGlobalVariableParseTestOptionsType = "http_status_code" + SYNTHETICSGLOBALVARIABLEPARSETESTOPTIONSTYPE_LOCAL_VARIABLE SyntheticsGlobalVariableParseTestOptionsType = "local_variable" ) var allowedSyntheticsGlobalVariableParseTestOptionsTypeEnumValues = []SyntheticsGlobalVariableParseTestOptionsType{ SYNTHETICSGLOBALVARIABLEPARSETESTOPTIONSTYPE_HTTP_BODY, SYNTHETICSGLOBALVARIABLEPARSETESTOPTIONSTYPE_HTTP_HEADER, + SYNTHETICSGLOBALVARIABLEPARSETESTOPTIONSTYPE_HTTP_STATUS_CODE, SYNTHETICSGLOBALVARIABLEPARSETESTOPTIONSTYPE_LOCAL_VARIABLE, } diff --git a/api/datadogV1/model_synthetics_local_variable_parsing_options_type.go b/api/datadogV1/model_synthetics_local_variable_parsing_options_type.go new file mode 100644 index 00000000000..0ce8a2bbc27 --- /dev/null +++ b/api/datadogV1/model_synthetics_local_variable_parsing_options_type.go @@ -0,0 +1,72 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +package datadogV1 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// SyntheticsLocalVariableParsingOptionsType Property of the Synthetic Test Response to extract into a local variable. +type SyntheticsLocalVariableParsingOptionsType string + +// List of SyntheticsLocalVariableParsingOptionsType. +const ( + SYNTHETICSLOCALVARIABLEPARSINGOPTIONSTYPE_GRPC_MESSAGE SyntheticsLocalVariableParsingOptionsType = "grpc_message" + SYNTHETICSLOCALVARIABLEPARSINGOPTIONSTYPE_GRPC_METADATA SyntheticsLocalVariableParsingOptionsType = "grpc_metadata" + SYNTHETICSLOCALVARIABLEPARSINGOPTIONSTYPE_HTTP_BODY SyntheticsLocalVariableParsingOptionsType = "http_body" + SYNTHETICSLOCALVARIABLEPARSINGOPTIONSTYPE_HTTP_HEADER SyntheticsLocalVariableParsingOptionsType = "http_header" + SYNTHETICSLOCALVARIABLEPARSINGOPTIONSTYPE_HTTP_STATUS_CODE SyntheticsLocalVariableParsingOptionsType = "http_status_code" +) + +var allowedSyntheticsLocalVariableParsingOptionsTypeEnumValues = []SyntheticsLocalVariableParsingOptionsType{ + SYNTHETICSLOCALVARIABLEPARSINGOPTIONSTYPE_GRPC_MESSAGE, + SYNTHETICSLOCALVARIABLEPARSINGOPTIONSTYPE_GRPC_METADATA, + SYNTHETICSLOCALVARIABLEPARSINGOPTIONSTYPE_HTTP_BODY, + SYNTHETICSLOCALVARIABLEPARSINGOPTIONSTYPE_HTTP_HEADER, + SYNTHETICSLOCALVARIABLEPARSINGOPTIONSTYPE_HTTP_STATUS_CODE, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *SyntheticsLocalVariableParsingOptionsType) GetAllowedValues() []SyntheticsLocalVariableParsingOptionsType { + return allowedSyntheticsLocalVariableParsingOptionsTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *SyntheticsLocalVariableParsingOptionsType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = SyntheticsLocalVariableParsingOptionsType(value) + return nil +} + +// NewSyntheticsLocalVariableParsingOptionsTypeFromValue returns a pointer to a valid SyntheticsLocalVariableParsingOptionsType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewSyntheticsLocalVariableParsingOptionsTypeFromValue(v string) (*SyntheticsLocalVariableParsingOptionsType, error) { + ev := SyntheticsLocalVariableParsingOptionsType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for SyntheticsLocalVariableParsingOptionsType: valid values are %v", v, allowedSyntheticsLocalVariableParsingOptionsTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v SyntheticsLocalVariableParsingOptionsType) IsValid() bool { + for _, existing := range allowedSyntheticsLocalVariableParsingOptionsTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to SyntheticsLocalVariableParsingOptionsType value. +func (v SyntheticsLocalVariableParsingOptionsType) Ptr() *SyntheticsLocalVariableParsingOptionsType { + return &v +} diff --git a/api/datadogV1/model_synthetics_parsing_options.go b/api/datadogV1/model_synthetics_parsing_options.go index ca906a49b09..8653916fb86 100644 --- a/api/datadogV1/model_synthetics_parsing_options.go +++ b/api/datadogV1/model_synthetics_parsing_options.go @@ -10,7 +10,7 @@ import ( // SyntheticsParsingOptions Parsing options for variables to extract. type SyntheticsParsingOptions struct { - // When type is `http_header`, name of the header to use to extract the value. + // When type is `http_header` or `grpc_metadata`, name of the header or metadatum to extract. Field *string `json:"field,omitempty"` // Name of the variable to extract. Name *string `json:"name,omitempty"` @@ -18,8 +18,8 @@ type SyntheticsParsingOptions struct { Parser *SyntheticsVariableParser `json:"parser,omitempty"` // Determines whether or not the extracted value will be obfuscated. Secure *bool `json:"secure,omitempty"` - // Property of the Synthetic Test Response to use for a Synthetic global variable. - Type *SyntheticsGlobalVariableParseTestOptionsType `json:"type,omitempty"` + // Property of the Synthetic Test Response to extract into a local variable. + Type *SyntheticsLocalVariableParsingOptionsType `json:"type,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} @@ -155,9 +155,9 @@ func (o *SyntheticsParsingOptions) SetSecure(v bool) { } // GetType returns the Type field value if set, zero value otherwise. -func (o *SyntheticsParsingOptions) GetType() SyntheticsGlobalVariableParseTestOptionsType { +func (o *SyntheticsParsingOptions) GetType() SyntheticsLocalVariableParsingOptionsType { if o == nil || o.Type == nil { - var ret SyntheticsGlobalVariableParseTestOptionsType + var ret SyntheticsLocalVariableParsingOptionsType return ret } return *o.Type @@ -165,7 +165,7 @@ func (o *SyntheticsParsingOptions) GetType() SyntheticsGlobalVariableParseTestOp // GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. -func (o *SyntheticsParsingOptions) GetTypeOk() (*SyntheticsGlobalVariableParseTestOptionsType, bool) { +func (o *SyntheticsParsingOptions) GetTypeOk() (*SyntheticsLocalVariableParsingOptionsType, bool) { if o == nil || o.Type == nil { return nil, false } @@ -177,8 +177,8 @@ func (o *SyntheticsParsingOptions) HasType() bool { return o != nil && o.Type != nil } -// SetType gets a reference to the given SyntheticsGlobalVariableParseTestOptionsType and assigns it to the Type field. -func (o *SyntheticsParsingOptions) SetType(v SyntheticsGlobalVariableParseTestOptionsType) { +// SetType gets a reference to the given SyntheticsLocalVariableParsingOptionsType and assigns it to the Type field. +func (o *SyntheticsParsingOptions) SetType(v SyntheticsLocalVariableParsingOptionsType) { o.Type = &v } @@ -213,11 +213,11 @@ func (o SyntheticsParsingOptions) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *SyntheticsParsingOptions) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Field *string `json:"field,omitempty"` - Name *string `json:"name,omitempty"` - Parser *SyntheticsVariableParser `json:"parser,omitempty"` - Secure *bool `json:"secure,omitempty"` - Type *SyntheticsGlobalVariableParseTestOptionsType `json:"type,omitempty"` + Field *string `json:"field,omitempty"` + Name *string `json:"name,omitempty"` + Parser *SyntheticsVariableParser `json:"parser,omitempty"` + Secure *bool `json:"secure,omitempty"` + Type *SyntheticsLocalVariableParsingOptionsType `json:"type,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) diff --git a/examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.go b/examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.go index 80c6e525466..060e169c44d 100644 --- a/examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.go +++ b/examples/v1/synthetics/CreateSyntheticsAPITest_1279271422.go @@ -42,7 +42,7 @@ func main() { Parser: &datadogV1.SyntheticsVariableParser{ Type: datadogV1.SYNTHETICSGLOBALVARIABLEPARSERTYPE_RAW, }, - Type: datadogV1.SYNTHETICSGLOBALVARIABLEPARSETESTOPTIONSTYPE_HTTP_HEADER.Ptr(), + Type: datadogV1.SYNTHETICSLOCALVARIABLEPARSINGOPTIONSTYPE_HTTP_HEADER.Ptr(), Secure: datadog.PtrBool(true), }, },