Skip to content

Commit

Permalink
Fix VFTs and extracted local variables enum types (#1731)
Browse files Browse the repository at this point in the history
Co-authored-by: ci.datadog-api-spec <[email protected]>
Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Sep 3, 2024
1 parent 6eb1337 commit 1d757d8
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 17 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-08-29 20:02:13.031504",
"spec_repo_commit": "518ca9df"
"regenerated": "2024-09-03 13:58:47.551352",
"spec_repo_commit": "ff772101"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-08-29 20:02:13.055105",
"spec_repo_commit": "518ca9df"
"regenerated": "2024-09-03 13:58:47.571233",
"spec_repo_commit": "ff772101"
}
}
}
30 changes: 24 additions & 6 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15267,17 +15267,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
Expand Down Expand Up @@ -15396,6 +15397,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

Expand All @@ -15422,8 +15440,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:
Expand All @@ -15435,7 +15453,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)
Expand Down Expand Up @@ -16010,7 +16028,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
Expand Down
1 change: 1 addition & 0 deletions packages/datadog-api-client-v1/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,7 @@ export { SyntheticsGlobalVariableTOTPParameters } from "./models/SyntheticsGloba
export { SyntheticsGlobalVariableValue } from "./models/SyntheticsGlobalVariableValue";
export { SyntheticsListGlobalVariablesResponse } from "./models/SyntheticsListGlobalVariablesResponse";
export { SyntheticsListTestsResponse } from "./models/SyntheticsListTestsResponse";
export { SyntheticsLocalVariableParsingOptionsType } from "./models/SyntheticsLocalVariableParsingOptionsType";
export { SyntheticsLocation } from "./models/SyntheticsLocation";
export { SyntheticsLocations } from "./models/SyntheticsLocations";
export { SyntheticsParsingOptions } from "./models/SyntheticsParsingOptions";
Expand Down
8 changes: 8 additions & 0 deletions packages/datadog-api-client-v1/models/ObjectSerializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1333,9 +1333,17 @@ const enumsMap: { [key: string]: any[] } = {
SyntheticsGlobalVariableParseTestOptionsType: [
"http_body",
"http_header",
"http_status_code",
"local_variable",
],
SyntheticsGlobalVariableParserType: ["raw", "json_path", "regex", "x_path"],
SyntheticsLocalVariableParsingOptionsType: [
"grpc_message",
"grpc_metadata",
"http_body",
"http_header",
"http_status_code",
],
SyntheticsPatchTestOperationName: [
"add",
"remove",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class SyntheticsGlobalVariableParseTestOptions {
*/
"parser"?: SyntheticsVariableParser;
/**
* 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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@
import { UnparsedObject } from "../../datadog-api-client-common/util";

/**
* 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.
*/

export type SyntheticsGlobalVariableParseTestOptionsType =
| typeof HTTP_BODY
| typeof HTTP_HEADER
| typeof HTTP_STATUS_CODE
| typeof LOCAL_VARIABLE
| UnparsedObject;
export const HTTP_BODY = "http_body";
export const HTTP_HEADER = "http_header";
export const HTTP_STATUS_CODE = "http_status_code";
export const LOCAL_VARIABLE = "local_variable";
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* 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 2020-Present Datadog, Inc.
*/

import { UnparsedObject } from "../../datadog-api-client-common/util";

/**
* Property of the Synthetic Test Response to extract into a local variable.
*/

export type SyntheticsLocalVariableParsingOptionsType =
| typeof GRPC_MESSAGE
| typeof GRPC_METADATA
| typeof HTTP_BODY
| typeof HTTP_HEADER
| typeof HTTP_STATUS_CODE
| UnparsedObject;
export const GRPC_MESSAGE = "grpc_message";
export const GRPC_METADATA = "grpc_metadata";
export const HTTP_BODY = "http_body";
export const HTTP_HEADER = "http_header";
export const HTTP_STATUS_CODE = "http_status_code";
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2020-Present Datadog, Inc.
*/
import { SyntheticsGlobalVariableParseTestOptionsType } from "./SyntheticsGlobalVariableParseTestOptionsType";
import { SyntheticsLocalVariableParsingOptionsType } from "./SyntheticsLocalVariableParsingOptionsType";
import { SyntheticsVariableParser } from "./SyntheticsVariableParser";

import { AttributeTypeMap } from "../../datadog-api-client-common/util";
Expand All @@ -13,7 +13,7 @@ import { AttributeTypeMap } from "../../datadog-api-client-common/util";
*/
export class SyntheticsParsingOptions {
/**
* 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;
/**
Expand All @@ -29,9 +29,9 @@ export class SyntheticsParsingOptions {
*/
"secure"?: boolean;
/**
* Property of the Synthetic Test Response to use for a Synthetic global variable.
* Property of the Synthetic Test Response to extract into a local variable.
*/
"type"?: SyntheticsGlobalVariableParseTestOptionsType;
"type"?: SyntheticsLocalVariableParsingOptionsType;

/**
* A container for additional, undeclared properties.
Expand Down Expand Up @@ -67,7 +67,7 @@ export class SyntheticsParsingOptions {
},
type: {
baseName: "type",
type: "SyntheticsGlobalVariableParseTestOptionsType",
type: "SyntheticsLocalVariableParsingOptionsType",
},
additionalProperties: {
baseName: "additionalProperties",
Expand Down

0 comments on commit 1d757d8

Please sign in to comment.