From e0d8f5d58be55a13cf287680e3e7f7fe45e7b7b0 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 21 Nov 2025 12:57:12 +0000 Subject: [PATCH] Regenerate client from commit 73f2ad5 of spec repo --- .generator/schemas/v2/openapi.yaml | 315 ++++++++++++++++++ features/v2/synthetics.feature | 24 ++ features/v2/undo.json | 6 + .../src/support/scenarios_model_mapping.ts | 11 + services/synthetics/src/v2/SyntheticsApi.ts | 164 +++++++++ services/synthetics/src/v2/index.ts | 19 ++ .../src/v2/models/GlobalVariableData.ts | 63 ++++ .../models/GlobalVariableJsonPatchRequest.ts | 44 +++ .../GlobalVariableJsonPatchRequestData.ts | 49 +++ ...lVariableJsonPatchRequestDataAttributes.ts | 43 +++ .../v2/models/GlobalVariableJsonPatchType.ts | 9 + .../src/v2/models/GlobalVariableResponse.ts | 46 +++ .../src/v2/models/GlobalVariableType.ts | 7 + .../src/v2/models/JsonPatchOperation.ts | 64 ++++ .../src/v2/models/JsonPatchOperationOp.ts | 19 ++ .../src/v2/models/SyntheticsGlobalVariable.ts | 124 +++++++ .../SyntheticsGlobalVariableAttributes.ts | 44 +++ .../models/SyntheticsGlobalVariableOptions.ts | 46 +++ ...yntheticsGlobalVariableParseTestOptions.ts | 72 ++++ ...eticsGlobalVariableParseTestOptionsType.ts | 15 + .../SyntheticsGlobalVariableParserType.ts | 15 + .../SyntheticsGlobalVariableTOTPParameters.ts | 54 +++ .../models/SyntheticsGlobalVariableValue.ts | 63 ++++ .../src/v2/models/SyntheticsVariableParser.ts | 55 +++ .../synthetics/src/v2/models/TypingInfo.ts | 39 +++ 25 files changed, 1410 insertions(+) create mode 100644 services/synthetics/src/v2/models/GlobalVariableData.ts create mode 100644 services/synthetics/src/v2/models/GlobalVariableJsonPatchRequest.ts create mode 100644 services/synthetics/src/v2/models/GlobalVariableJsonPatchRequestData.ts create mode 100644 services/synthetics/src/v2/models/GlobalVariableJsonPatchRequestDataAttributes.ts create mode 100644 services/synthetics/src/v2/models/GlobalVariableJsonPatchType.ts create mode 100644 services/synthetics/src/v2/models/GlobalVariableResponse.ts create mode 100644 services/synthetics/src/v2/models/GlobalVariableType.ts create mode 100644 services/synthetics/src/v2/models/JsonPatchOperation.ts create mode 100644 services/synthetics/src/v2/models/JsonPatchOperationOp.ts create mode 100644 services/synthetics/src/v2/models/SyntheticsGlobalVariable.ts create mode 100644 services/synthetics/src/v2/models/SyntheticsGlobalVariableAttributes.ts create mode 100644 services/synthetics/src/v2/models/SyntheticsGlobalVariableOptions.ts create mode 100644 services/synthetics/src/v2/models/SyntheticsGlobalVariableParseTestOptions.ts create mode 100644 services/synthetics/src/v2/models/SyntheticsGlobalVariableParseTestOptionsType.ts create mode 100644 services/synthetics/src/v2/models/SyntheticsGlobalVariableParserType.ts create mode 100644 services/synthetics/src/v2/models/SyntheticsGlobalVariableTOTPParameters.ts create mode 100644 services/synthetics/src/v2/models/SyntheticsGlobalVariableValue.ts create mode 100644 services/synthetics/src/v2/models/SyntheticsVariableParser.ts diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 9bceb715496a..1fe0e1f167d1 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -23651,6 +23651,61 @@ components: required: - type type: object + GlobalVariableData: + description: Synthetics global variable data. Wrapper around the global variable + object. + properties: + attributes: + $ref: '#/components/schemas/SyntheticsGlobalVariable' + id: + description: Global variable identifier. + type: string + type: + $ref: '#/components/schemas/GlobalVariableType' + type: object + GlobalVariableJsonPatchRequest: + description: JSON Patch request for global variable. + properties: + data: + $ref: '#/components/schemas/GlobalVariableJsonPatchRequestData' + required: + - data + type: object + GlobalVariableJsonPatchRequestData: + properties: + attributes: + $ref: '#/components/schemas/GlobalVariableJsonPatchRequestDataAttributes' + type: + $ref: '#/components/schemas/GlobalVariableJsonPatchType' + type: object + GlobalVariableJsonPatchRequestDataAttributes: + properties: + json_patch: + description: JSON Patch operations following RFC 6902. + items: + $ref: '#/components/schemas/JsonPatchOperation' + type: array + type: object + GlobalVariableJsonPatchType: + description: Global variable JSON Patch type. + enum: + - global_variables_json_patch + type: string + x-enum-varnames: + - GLOBAL_VARIABLES_JSON_PATCH + GlobalVariableResponse: + description: Global variable response. + properties: + data: + $ref: '#/components/schemas/GlobalVariableData' + type: object + GlobalVariableType: + description: Global variable type. + enum: + - global_variables + type: string + x-enum-varnames: + - GLOBAL_VARIABLES GoogleMeetConfigurationReference: description: A reference to a Google Meet Configuration resource. nullable: true @@ -28404,6 +28459,40 @@ components: - to - index type: object + JsonPatchOperation: + description: A JSON Patch operation as per RFC 6902. + properties: + op: + $ref: '#/components/schemas/JsonPatchOperationOp' + path: + description: A JSON Pointer path (e.g., "/name", "/value/secure"). + example: /name + type: string + value: + description: The value to use for the operation (not applicable for "remove" + and "test" operations). + required: + - op + - path + type: object + JsonPatchOperationOp: + description: The operation to perform. + enum: + - add + - remove + - replace + - move + - copy + - test + example: add + type: string + x-enum-varnames: + - ADD + - REMOVE + - REPLACE + - MOVE + - COPY + - TEST KindAttributes: description: Kind attributes. properties: @@ -51322,6 +51411,178 @@ components: format: double type: number type: object + SyntheticsGlobalVariable: + description: Synthetic global variable. + properties: + attributes: + $ref: '#/components/schemas/SyntheticsGlobalVariableAttributes' + description: + description: Description of the global variable. + example: Example description + type: string + id: + description: Unique identifier of the global variable. + readOnly: true + type: string + is_fido: + description: Determines if the global variable is a FIDO variable. + type: boolean + is_totp: + description: Determines if the global variable is a TOTP/MFA variable. + type: boolean + name: + description: Name of the global variable. Unique across Synthetic global + variables. + example: MY_VARIABLE + type: string + parse_test_options: + $ref: '#/components/schemas/SyntheticsGlobalVariableParseTestOptions' + parse_test_public_id: + description: A Synthetic test ID to use as a test to generate the variable + value. + example: abc-def-123 + type: string + tags: + description: Tags of the global variable. + example: + - team:front + - test:workflow-1 + items: + description: Tag name. + type: string + type: array + value: + $ref: '#/components/schemas/SyntheticsGlobalVariableValue' + required: + - description + - name + - tags + - value + type: object + SyntheticsGlobalVariableAttributes: + description: Attributes of the global variable. + properties: + restricted_roles: + $ref: '#/components/schemas/SyntheticsRestrictedRoles' + type: object + SyntheticsGlobalVariableOptions: + description: Options for the Global Variable for MFA. + properties: + totp_parameters: + $ref: '#/components/schemas/SyntheticsGlobalVariableTOTPParameters' + type: object + SyntheticsGlobalVariableParseTestOptions: + description: Parser options to use for retrieving a Synthetic global variable + from a Synthetic test. Used in conjunction with `parse_test_public_id`. + properties: + field: + description: When type is `http_header`, name of the header to use to extract + the value. + example: content-type + type: string + localVariableName: + description: When type is `local_variable`, name of the local variable to + use to extract the value. + example: LOCAL_VARIABLE + type: string + parser: + $ref: '#/components/schemas/SyntheticsVariableParser' + type: + $ref: '#/components/schemas/SyntheticsGlobalVariableParseTestOptionsType' + required: + - type + type: object + SyntheticsGlobalVariableParseTestOptionsType: + 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 + test. + enum: + - raw + - json_path + - regex + - x_path + example: raw + type: string + x-enum-varnames: + - RAW + - JSON_PATH + - REGEX + - X_PATH + SyntheticsGlobalVariableTOTPParameters: + description: Parameters for the TOTP/MFA variable + properties: + digits: + description: Number of digits for the OTP code. + example: 6 + format: int32 + maximum: 10 + minimum: 4 + type: integer + refresh_interval: + description: Interval for which to refresh the token (in seconds). + example: 30 + format: int32 + maximum: 999 + minimum: 0 + type: integer + type: object + SyntheticsGlobalVariableValue: + description: Value of the global variable. + example: + secure: true + value: value + properties: + options: + $ref: '#/components/schemas/SyntheticsGlobalVariableOptions' + secure: + description: Determines if the value of the variable is hidden. + type: boolean + value: + description: 'Value of the global variable. When reading a global variable, + + the value will not be present if the variable is hidden with the `secure` + property.' + example: example-value + type: string + type: object + SyntheticsRestrictedRoles: + description: A list of role identifiers that can be pulled from the Roles API, + for restricting read and write access. + example: + - xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + items: + description: UUID for a role. + example: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + type: string + type: array + SyntheticsVariableParser: + description: Details of the parser to use for the global variable. + example: + type: regex + value: .* + properties: + type: + $ref: '#/components/schemas/SyntheticsGlobalVariableParserType' + value: + description: Regex or JSON path used for the parser. Not used with type + `raw`. + type: string + required: + - type + type: object TableResultV2: description: A reference table resource containing its full configuration and state. @@ -81694,6 +81955,60 @@ paths: operator: OR permissions: - billing_edit + /api/v2/synthetics/variables/{variable_id}/jsonpatch: + patch: + description: 'Patch a global variable using JSON Patch (RFC 6902). + + This endpoint allows partial updates to a global variable by specifying only + the fields to modify. + + + Common operations include: + + - Replace field values: `{"op": "replace", "path": "/name", "value": "new_name"}` + + - Update nested values: `{"op": "replace", "path": "/value/value", "value": + "new_value"}` + + - Add/update tags: `{"op": "add", "path": "/tags/-", "value": "new_tag"}` + + - Remove fields: `{"op": "remove", "path": "/description"}`' + operationId: PatchGlobalVariable + parameters: + - description: The ID of the global variable. + in: path + name: variable_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GlobalVariableJsonPatchRequest' + description: JSON Patch document with operations to apply. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GlobalVariableResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Patch a global variable + tags: + - Synthetics + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - synthetics_global_variable_write /api/v2/tags/enrichment: get: description: List all tag pipeline rulesets - Retrieve a list of all tag pipeline diff --git a/features/v2/synthetics.feature b/features/v2/synthetics.feature index 73efa73ec291..133993b11b7b 100644 --- a/features/v2/synthetics.feature +++ b/features/v2/synthetics.feature @@ -20,6 +20,30 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing + Scenario: Patch a global variable returns "Bad Request" response + Given new "PatchGlobalVariable" request + And request contains "variable_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"json_patch": [{"op": "add", "path": "/name"}]}, "type": "global_variables_json_patch"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Patch a global variable returns "Not Found" response + Given new "PatchGlobalVariable" request + And request contains "variable_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"json_patch": [{"op": "add", "path": "/name"}]}, "type": "global_variables_json_patch"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Patch a global variable returns "OK" response + Given new "PatchGlobalVariable" request + And request contains "variable_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"json_patch": [{"op": "add", "path": "/name"}]}, "type": "global_variables_json_patch"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/synthetics-managing Scenario: Save new value for on-demand concurrency cap returns "OK" response Given new "SetOnDemandConcurrencyCap" request diff --git a/features/v2/undo.json b/features/v2/undo.json index 3799e64e630d..f4cbbb2baae9 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -4284,6 +4284,12 @@ "type": "safe" } }, + "PatchGlobalVariable": { + "tag": "Synthetics", + "undo": { + "type": "safe" + } + }, "ListTagPipelinesRulesets": { "tag": "Cloud Cost Management", "undo": { diff --git a/private/bdd_runner/src/support/scenarios_model_mapping.ts b/private/bdd_runner/src/support/scenarios_model_mapping.ts index a918b3e7a5c9..704f447a4786 100644 --- a/private/bdd_runner/src/support/scenarios_model_mapping.ts +++ b/private/bdd_runner/src/support/scenarios_model_mapping.ts @@ -8735,6 +8735,17 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = { }, operationResponseType: "OnDemandConcurrencyCapResponse", }, + "SyntheticsApi.V2.PatchGlobalVariable": { + variableId: { + type: "string", + format: "", + }, + body: { + type: "GlobalVariableJsonPatchRequest", + format: "", + }, + operationResponseType: "GlobalVariableResponse", + }, "TeamsApi.V2.ListTeams": { pageNumber: { type: "number", diff --git a/services/synthetics/src/v2/SyntheticsApi.ts b/services/synthetics/src/v2/SyntheticsApi.ts index ab96e3f46e3d..2b0fa8505bee 100644 --- a/services/synthetics/src/v2/SyntheticsApi.ts +++ b/services/synthetics/src/v2/SyntheticsApi.ts @@ -23,6 +23,8 @@ import { import { TypingInfo } from "./models/TypingInfo"; import { APIErrorResponse } from "./models/APIErrorResponse"; +import { GlobalVariableJsonPatchRequest } from "./models/GlobalVariableJsonPatchRequest"; +import { GlobalVariableResponse } from "./models/GlobalVariableResponse"; import { OnDemandConcurrencyCapAttributes } from "./models/OnDemandConcurrencyCapAttributes"; import { OnDemandConcurrencyCapResponse } from "./models/OnDemandConcurrencyCapResponse"; import { version } from "../version"; @@ -72,6 +74,66 @@ export class SyntheticsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async patchGlobalVariable( + variableId: string, + body: GlobalVariableJsonPatchRequest, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'variableId' is not null or undefined + if (variableId === null || variableId === undefined) { + throw new RequiredError("variableId", "patchGlobalVariable"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "patchGlobalVariable"); + } + + // Path Params + const localVarPath = + "/api/v2/synthetics/variables/{variable_id}/jsonpatch".replace( + "{variable_id}", + encodeURIComponent(String(variableId)), + ); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "SyntheticsApi.v2.patchGlobalVariable", + SyntheticsApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.PATCH, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Body Params + const contentType = getPreferredMediaType(["application/json"]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = stringify( + serialize(body, TypingInfo, "GlobalVariableJsonPatchRequest", ""), + contentType, + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + public async setOnDemandConcurrencyCap( body: OnDemandConcurrencyCapAttributes, _options?: Configuration, @@ -181,6 +243,66 @@ export class SyntheticsApiResponseProcessor { ); } + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to patchGlobalVariable + * @throws ApiException if the response code was not in [200, 299] + */ + public async patchGlobalVariable( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: GlobalVariableResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "GlobalVariableResponse", + ) as GlobalVariableResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { + const bodyText = parse(await response.body.text(), contentType); + let body: APIErrorResponse; + try { + body = deserialize( + bodyText, + TypingInfo, + "APIErrorResponse", + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText, + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: GlobalVariableResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "GlobalVariableResponse", + "", + ) as GlobalVariableResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } + /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -238,6 +360,19 @@ export class SyntheticsApiResponseProcessor { } } +export interface SyntheticsApiPatchGlobalVariableRequest { + /** + * The ID of the global variable. + * @type string + */ + variableId: string; + /** + * JSON Patch document with operations to apply. + * @type GlobalVariableJsonPatchRequest + */ + body: GlobalVariableJsonPatchRequest; +} + export interface SyntheticsApiSetOnDemandConcurrencyCapRequest { /** * . @@ -285,6 +420,35 @@ export class SyntheticsApi { }); } + /** + * Patch a global variable using JSON Patch (RFC 6902). + * This endpoint allows partial updates to a global variable by specifying only the fields to modify. + * + * Common operations include: + * - Replace field values: `{"op": "replace", "path": "/name", "value": "new_name"}` + * - Update nested values: `{"op": "replace", "path": "/value/value", "value": "new_value"}` + * - Add/update tags: `{"op": "add", "path": "/tags/-", "value": "new_tag"}` + * - Remove fields: `{"op": "remove", "path": "/description"}` + * @param param The request object + */ + public patchGlobalVariable( + param: SyntheticsApiPatchGlobalVariableRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.patchGlobalVariable( + param.variableId, + param.body, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.patchGlobalVariable(responseContext); + }); + }); + } + /** * Save new value for on-demand concurrency cap. * @param param The request object diff --git a/services/synthetics/src/v2/index.ts b/services/synthetics/src/v2/index.ts index 0824785dff8a..47b32d65dea8 100644 --- a/services/synthetics/src/v2/index.ts +++ b/services/synthetics/src/v2/index.ts @@ -1,10 +1,29 @@ export { + SyntheticsApiPatchGlobalVariableRequest, SyntheticsApiSetOnDemandConcurrencyCapRequest, SyntheticsApi, } from "./SyntheticsApi"; export { APIErrorResponse } from "./models/APIErrorResponse"; +export { GlobalVariableData } from "./models/GlobalVariableData"; +export { GlobalVariableJsonPatchRequest } from "./models/GlobalVariableJsonPatchRequest"; +export { GlobalVariableJsonPatchRequestData } from "./models/GlobalVariableJsonPatchRequestData"; +export { GlobalVariableJsonPatchRequestDataAttributes } from "./models/GlobalVariableJsonPatchRequestDataAttributes"; +export { GlobalVariableJsonPatchType } from "./models/GlobalVariableJsonPatchType"; +export { GlobalVariableResponse } from "./models/GlobalVariableResponse"; +export { GlobalVariableType } from "./models/GlobalVariableType"; +export { JsonPatchOperation } from "./models/JsonPatchOperation"; +export { JsonPatchOperationOp } from "./models/JsonPatchOperationOp"; export { OnDemandConcurrencyCap } from "./models/OnDemandConcurrencyCap"; export { OnDemandConcurrencyCapAttributes } from "./models/OnDemandConcurrencyCapAttributes"; export { OnDemandConcurrencyCapResponse } from "./models/OnDemandConcurrencyCapResponse"; export { OnDemandConcurrencyCapType } from "./models/OnDemandConcurrencyCapType"; +export { SyntheticsGlobalVariable } from "./models/SyntheticsGlobalVariable"; +export { SyntheticsGlobalVariableAttributes } from "./models/SyntheticsGlobalVariableAttributes"; +export { SyntheticsGlobalVariableOptions } from "./models/SyntheticsGlobalVariableOptions"; +export { SyntheticsGlobalVariableParserType } from "./models/SyntheticsGlobalVariableParserType"; +export { SyntheticsGlobalVariableParseTestOptions } from "./models/SyntheticsGlobalVariableParseTestOptions"; +export { SyntheticsGlobalVariableParseTestOptionsType } from "./models/SyntheticsGlobalVariableParseTestOptionsType"; +export { SyntheticsGlobalVariableTOTPParameters } from "./models/SyntheticsGlobalVariableTOTPParameters"; +export { SyntheticsGlobalVariableValue } from "./models/SyntheticsGlobalVariableValue"; +export { SyntheticsVariableParser } from "./models/SyntheticsVariableParser"; diff --git a/services/synthetics/src/v2/models/GlobalVariableData.ts b/services/synthetics/src/v2/models/GlobalVariableData.ts new file mode 100644 index 000000000000..8705b0d67d4f --- /dev/null +++ b/services/synthetics/src/v2/models/GlobalVariableData.ts @@ -0,0 +1,63 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GlobalVariableType } from "./GlobalVariableType"; +import { SyntheticsGlobalVariable } from "./SyntheticsGlobalVariable"; + +/** + * Synthetics global variable data. Wrapper around the global variable object. + */ +export class GlobalVariableData { + /** + * Synthetic global variable. + */ + "attributes"?: SyntheticsGlobalVariable; + /** + * Global variable identifier. + */ + "id"?: string; + /** + * Global variable type. + */ + "type"?: GlobalVariableType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "SyntheticsGlobalVariable", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "GlobalVariableType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GlobalVariableData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/GlobalVariableJsonPatchRequest.ts b/services/synthetics/src/v2/models/GlobalVariableJsonPatchRequest.ts new file mode 100644 index 000000000000..1bdef8e5b4b6 --- /dev/null +++ b/services/synthetics/src/v2/models/GlobalVariableJsonPatchRequest.ts @@ -0,0 +1,44 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GlobalVariableJsonPatchRequestData } from "./GlobalVariableJsonPatchRequestData"; + +/** + * JSON Patch request for global variable. + */ +export class GlobalVariableJsonPatchRequest { + "data": GlobalVariableJsonPatchRequestData; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "GlobalVariableJsonPatchRequestData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GlobalVariableJsonPatchRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/GlobalVariableJsonPatchRequestData.ts b/services/synthetics/src/v2/models/GlobalVariableJsonPatchRequestData.ts new file mode 100644 index 000000000000..6db9850c6f91 --- /dev/null +++ b/services/synthetics/src/v2/models/GlobalVariableJsonPatchRequestData.ts @@ -0,0 +1,49 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GlobalVariableJsonPatchRequestDataAttributes } from "./GlobalVariableJsonPatchRequestDataAttributes"; +import { GlobalVariableJsonPatchType } from "./GlobalVariableJsonPatchType"; + +export class GlobalVariableJsonPatchRequestData { + "attributes"?: GlobalVariableJsonPatchRequestDataAttributes; + /** + * Global variable JSON Patch type. + */ + "type"?: GlobalVariableJsonPatchType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "GlobalVariableJsonPatchRequestDataAttributes", + }, + type: { + baseName: "type", + type: "GlobalVariableJsonPatchType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GlobalVariableJsonPatchRequestData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/GlobalVariableJsonPatchRequestDataAttributes.ts b/services/synthetics/src/v2/models/GlobalVariableJsonPatchRequestDataAttributes.ts new file mode 100644 index 000000000000..e7bd8478bd4e --- /dev/null +++ b/services/synthetics/src/v2/models/GlobalVariableJsonPatchRequestDataAttributes.ts @@ -0,0 +1,43 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { JsonPatchOperation } from "./JsonPatchOperation"; + +export class GlobalVariableJsonPatchRequestDataAttributes { + /** + * JSON Patch operations following RFC 6902. + */ + "jsonPatch"?: Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + jsonPatch: { + baseName: "json_patch", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GlobalVariableJsonPatchRequestDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/GlobalVariableJsonPatchType.ts b/services/synthetics/src/v2/models/GlobalVariableJsonPatchType.ts new file mode 100644 index 000000000000..47d7ec6ffad1 --- /dev/null +++ b/services/synthetics/src/v2/models/GlobalVariableJsonPatchType.ts @@ -0,0 +1,9 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * Global variable JSON Patch type. + */ +export type GlobalVariableJsonPatchType = + | typeof GLOBAL_VARIABLES_JSON_PATCH + | UnparsedObject; +export const GLOBAL_VARIABLES_JSON_PATCH = "global_variables_json_patch"; diff --git a/services/synthetics/src/v2/models/GlobalVariableResponse.ts b/services/synthetics/src/v2/models/GlobalVariableResponse.ts new file mode 100644 index 000000000000..40c12258dc01 --- /dev/null +++ b/services/synthetics/src/v2/models/GlobalVariableResponse.ts @@ -0,0 +1,46 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { GlobalVariableData } from "./GlobalVariableData"; + +/** + * Global variable response. + */ +export class GlobalVariableResponse { + /** + * Synthetics global variable data. Wrapper around the global variable object. + */ + "data"?: GlobalVariableData; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "GlobalVariableData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return GlobalVariableResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/GlobalVariableType.ts b/services/synthetics/src/v2/models/GlobalVariableType.ts new file mode 100644 index 000000000000..00605c425a21 --- /dev/null +++ b/services/synthetics/src/v2/models/GlobalVariableType.ts @@ -0,0 +1,7 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * Global variable type. + */ +export type GlobalVariableType = typeof GLOBAL_VARIABLES | UnparsedObject; +export const GLOBAL_VARIABLES = "global_variables"; diff --git a/services/synthetics/src/v2/models/JsonPatchOperation.ts b/services/synthetics/src/v2/models/JsonPatchOperation.ts new file mode 100644 index 000000000000..676d9b5fb068 --- /dev/null +++ b/services/synthetics/src/v2/models/JsonPatchOperation.ts @@ -0,0 +1,64 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { JsonPatchOperationOp } from "./JsonPatchOperationOp"; + +/** + * A JSON Patch operation as per RFC 6902. + */ +export class JsonPatchOperation { + /** + * The operation to perform. + */ + "op": JsonPatchOperationOp; + /** + * A JSON Pointer path (e.g., "/name", "/value/secure"). + */ + "path": string; + /** + * The value to use for the operation (not applicable for "remove" and "test" operations). + */ + "value"?: any; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + op: { + baseName: "op", + type: "JsonPatchOperationOp", + required: true, + }, + path: { + baseName: "path", + type: "string", + required: true, + }, + value: { + baseName: "value", + type: "any", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return JsonPatchOperation.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/JsonPatchOperationOp.ts b/services/synthetics/src/v2/models/JsonPatchOperationOp.ts new file mode 100644 index 000000000000..4280e1098e80 --- /dev/null +++ b/services/synthetics/src/v2/models/JsonPatchOperationOp.ts @@ -0,0 +1,19 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * The operation to perform. + */ +export type JsonPatchOperationOp = + | typeof ADD + | typeof REMOVE + | typeof REPLACE + | typeof MOVE + | typeof COPY + | typeof TEST + | UnparsedObject; +export const ADD = "add"; +export const REMOVE = "remove"; +export const REPLACE = "replace"; +export const MOVE = "move"; +export const COPY = "copy"; +export const TEST = "test"; diff --git a/services/synthetics/src/v2/models/SyntheticsGlobalVariable.ts b/services/synthetics/src/v2/models/SyntheticsGlobalVariable.ts new file mode 100644 index 000000000000..5d2cce246b66 --- /dev/null +++ b/services/synthetics/src/v2/models/SyntheticsGlobalVariable.ts @@ -0,0 +1,124 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SyntheticsGlobalVariableAttributes } from "./SyntheticsGlobalVariableAttributes"; +import { SyntheticsGlobalVariableParseTestOptions } from "./SyntheticsGlobalVariableParseTestOptions"; +import { SyntheticsGlobalVariableValue } from "./SyntheticsGlobalVariableValue"; + +/** + * Synthetic global variable. + */ +export class SyntheticsGlobalVariable { + /** + * Attributes of the global variable. + */ + "attributes"?: SyntheticsGlobalVariableAttributes; + /** + * Description of the global variable. + */ + "description": string; + /** + * Unique identifier of the global variable. + */ + "id"?: string; + /** + * Determines if the global variable is a FIDO variable. + */ + "isFido"?: boolean; + /** + * Determines if the global variable is a TOTP/MFA variable. + */ + "isTotp"?: boolean; + /** + * Name of the global variable. Unique across Synthetic global variables. + */ + "name": string; + /** + * Parser options to use for retrieving a Synthetic global variable from a Synthetic test. Used in conjunction with `parse_test_public_id`. + */ + "parseTestOptions"?: SyntheticsGlobalVariableParseTestOptions; + /** + * A Synthetic test ID to use as a test to generate the variable value. + */ + "parseTestPublicId"?: string; + /** + * Tags of the global variable. + */ + "tags": Array; + /** + * Value of the global variable. + */ + "value": SyntheticsGlobalVariableValue; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "SyntheticsGlobalVariableAttributes", + }, + description: { + baseName: "description", + type: "string", + required: true, + }, + id: { + baseName: "id", + type: "string", + }, + isFido: { + baseName: "is_fido", + type: "boolean", + }, + isTotp: { + baseName: "is_totp", + type: "boolean", + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + parseTestOptions: { + baseName: "parse_test_options", + type: "SyntheticsGlobalVariableParseTestOptions", + }, + parseTestPublicId: { + baseName: "parse_test_public_id", + type: "string", + }, + tags: { + baseName: "tags", + type: "Array", + required: true, + }, + value: { + baseName: "value", + type: "SyntheticsGlobalVariableValue", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsGlobalVariable.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/SyntheticsGlobalVariableAttributes.ts b/services/synthetics/src/v2/models/SyntheticsGlobalVariableAttributes.ts new file mode 100644 index 000000000000..00e3916e096a --- /dev/null +++ b/services/synthetics/src/v2/models/SyntheticsGlobalVariableAttributes.ts @@ -0,0 +1,44 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Attributes of the global variable. + */ +export class SyntheticsGlobalVariableAttributes { + /** + * A list of role identifiers that can be pulled from the Roles API, for restricting read and write access. + */ + "restrictedRoles"?: Array; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + restrictedRoles: { + baseName: "restricted_roles", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsGlobalVariableAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/SyntheticsGlobalVariableOptions.ts b/services/synthetics/src/v2/models/SyntheticsGlobalVariableOptions.ts new file mode 100644 index 000000000000..2ef27d7e3846 --- /dev/null +++ b/services/synthetics/src/v2/models/SyntheticsGlobalVariableOptions.ts @@ -0,0 +1,46 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SyntheticsGlobalVariableTOTPParameters } from "./SyntheticsGlobalVariableTOTPParameters"; + +/** + * Options for the Global Variable for MFA. + */ +export class SyntheticsGlobalVariableOptions { + /** + * Parameters for the TOTP/MFA variable + */ + "totpParameters"?: SyntheticsGlobalVariableTOTPParameters; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + totpParameters: { + baseName: "totp_parameters", + type: "SyntheticsGlobalVariableTOTPParameters", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsGlobalVariableOptions.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/SyntheticsGlobalVariableParseTestOptions.ts b/services/synthetics/src/v2/models/SyntheticsGlobalVariableParseTestOptions.ts new file mode 100644 index 000000000000..2bbbebb2641d --- /dev/null +++ b/services/synthetics/src/v2/models/SyntheticsGlobalVariableParseTestOptions.ts @@ -0,0 +1,72 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SyntheticsGlobalVariableParseTestOptionsType } from "./SyntheticsGlobalVariableParseTestOptionsType"; +import { SyntheticsVariableParser } from "./SyntheticsVariableParser"; + +/** + * Parser options to use for retrieving a Synthetic global variable from a Synthetic test. Used in conjunction with `parse_test_public_id`. + */ +export class SyntheticsGlobalVariableParseTestOptions { + /** + * When type is `http_header`, name of the header to use to extract the value. + */ + "field"?: string; + /** + * When type is `local_variable`, name of the local variable to use to extract the value. + */ + "localVariableName"?: string; + /** + * Details of the parser to use for the global variable. + */ + "parser"?: SyntheticsVariableParser; + /** + * Type of value to extract from a test for a Synthetic global variable. + */ + "type": SyntheticsGlobalVariableParseTestOptionsType; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + field: { + baseName: "field", + type: "string", + }, + localVariableName: { + baseName: "localVariableName", + type: "string", + }, + parser: { + baseName: "parser", + type: "SyntheticsVariableParser", + }, + type: { + baseName: "type", + type: "SyntheticsGlobalVariableParseTestOptionsType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsGlobalVariableParseTestOptions.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/SyntheticsGlobalVariableParseTestOptionsType.ts b/services/synthetics/src/v2/models/SyntheticsGlobalVariableParseTestOptionsType.ts new file mode 100644 index 000000000000..a6c5ad6072c1 --- /dev/null +++ b/services/synthetics/src/v2/models/SyntheticsGlobalVariableParseTestOptionsType.ts @@ -0,0 +1,15 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * 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"; diff --git a/services/synthetics/src/v2/models/SyntheticsGlobalVariableParserType.ts b/services/synthetics/src/v2/models/SyntheticsGlobalVariableParserType.ts new file mode 100644 index 000000000000..f9edc9f951d1 --- /dev/null +++ b/services/synthetics/src/v2/models/SyntheticsGlobalVariableParserType.ts @@ -0,0 +1,15 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * Type of parser for a Synthetic global variable from a synthetics test. + */ +export type SyntheticsGlobalVariableParserType = + | typeof RAW + | typeof JSON_PATH + | typeof REGEX + | typeof X_PATH + | UnparsedObject; +export const RAW = "raw"; +export const JSON_PATH = "json_path"; +export const REGEX = "regex"; +export const X_PATH = "x_path"; diff --git a/services/synthetics/src/v2/models/SyntheticsGlobalVariableTOTPParameters.ts b/services/synthetics/src/v2/models/SyntheticsGlobalVariableTOTPParameters.ts new file mode 100644 index 000000000000..a809930d0f6b --- /dev/null +++ b/services/synthetics/src/v2/models/SyntheticsGlobalVariableTOTPParameters.ts @@ -0,0 +1,54 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Parameters for the TOTP/MFA variable + */ +export class SyntheticsGlobalVariableTOTPParameters { + /** + * Number of digits for the OTP code. + */ + "digits"?: number; + /** + * Interval for which to refresh the token (in seconds). + */ + "refreshInterval"?: number; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + digits: { + baseName: "digits", + type: "number", + format: "int32", + }, + refreshInterval: { + baseName: "refresh_interval", + type: "number", + format: "int32", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsGlobalVariableTOTPParameters.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/SyntheticsGlobalVariableValue.ts b/services/synthetics/src/v2/models/SyntheticsGlobalVariableValue.ts new file mode 100644 index 000000000000..a17fb61ddb28 --- /dev/null +++ b/services/synthetics/src/v2/models/SyntheticsGlobalVariableValue.ts @@ -0,0 +1,63 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SyntheticsGlobalVariableOptions } from "./SyntheticsGlobalVariableOptions"; + +/** + * Value of the global variable. + */ +export class SyntheticsGlobalVariableValue { + /** + * Options for the Global Variable for MFA. + */ + "options"?: SyntheticsGlobalVariableOptions; + /** + * Determines if the value of the variable is hidden. + */ + "secure"?: boolean; + /** + * Value of the global variable. When reading a global variable, + * the value will not be present if the variable is hidden with the `secure` property. + */ + "value"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + options: { + baseName: "options", + type: "SyntheticsGlobalVariableOptions", + }, + secure: { + baseName: "secure", + type: "boolean", + }, + value: { + baseName: "value", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsGlobalVariableValue.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/SyntheticsVariableParser.ts b/services/synthetics/src/v2/models/SyntheticsVariableParser.ts new file mode 100644 index 000000000000..35b91eba16a0 --- /dev/null +++ b/services/synthetics/src/v2/models/SyntheticsVariableParser.ts @@ -0,0 +1,55 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SyntheticsGlobalVariableParserType } from "./SyntheticsGlobalVariableParserType"; + +/** + * Details of the parser to use for the global variable. + */ +export class SyntheticsVariableParser { + /** + * Type of parser for a Synthetic global variable from a synthetics test. + */ + "type": SyntheticsGlobalVariableParserType; + /** + * Regex or JSON path used for the parser. Not used with type `raw`. + */ + "value"?: string; + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + type: { + baseName: "type", + type: "SyntheticsGlobalVariableParserType", + required: true, + }, + value: { + baseName: "value", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsVariableParser.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/TypingInfo.ts b/services/synthetics/src/v2/models/TypingInfo.ts index efc37672a99f..28922c882f2c 100644 --- a/services/synthetics/src/v2/models/TypingInfo.ts +++ b/services/synthetics/src/v2/models/TypingInfo.ts @@ -1,19 +1,58 @@ import { ModelTypingInfo } from "@datadog/datadog-api-client"; import { APIErrorResponse } from "./APIErrorResponse"; +import { GlobalVariableData } from "./GlobalVariableData"; +import { GlobalVariableJsonPatchRequest } from "./GlobalVariableJsonPatchRequest"; +import { GlobalVariableJsonPatchRequestData } from "./GlobalVariableJsonPatchRequestData"; +import { GlobalVariableJsonPatchRequestDataAttributes } from "./GlobalVariableJsonPatchRequestDataAttributes"; +import { GlobalVariableResponse } from "./GlobalVariableResponse"; +import { JsonPatchOperation } from "./JsonPatchOperation"; import { OnDemandConcurrencyCap } from "./OnDemandConcurrencyCap"; import { OnDemandConcurrencyCapAttributes } from "./OnDemandConcurrencyCapAttributes"; import { OnDemandConcurrencyCapResponse } from "./OnDemandConcurrencyCapResponse"; +import { SyntheticsGlobalVariable } from "./SyntheticsGlobalVariable"; +import { SyntheticsGlobalVariableAttributes } from "./SyntheticsGlobalVariableAttributes"; +import { SyntheticsGlobalVariableOptions } from "./SyntheticsGlobalVariableOptions"; +import { SyntheticsGlobalVariableParseTestOptions } from "./SyntheticsGlobalVariableParseTestOptions"; +import { SyntheticsGlobalVariableTOTPParameters } from "./SyntheticsGlobalVariableTOTPParameters"; +import { SyntheticsGlobalVariableValue } from "./SyntheticsGlobalVariableValue"; +import { SyntheticsVariableParser } from "./SyntheticsVariableParser"; export const TypingInfo: ModelTypingInfo = { enumsMap: { + GlobalVariableJsonPatchType: ["global_variables_json_patch"], + GlobalVariableType: ["global_variables"], + JsonPatchOperationOp: ["add", "remove", "replace", "move", "copy", "test"], OnDemandConcurrencyCapType: ["on_demand_concurrency_cap"], + SyntheticsGlobalVariableParseTestOptionsType: [ + "http_body", + "http_header", + "http_status_code", + "local_variable", + ], + SyntheticsGlobalVariableParserType: ["raw", "json_path", "regex", "x_path"], }, oneOfMap: {}, typeMap: { APIErrorResponse: APIErrorResponse, + GlobalVariableData: GlobalVariableData, + GlobalVariableJsonPatchRequest: GlobalVariableJsonPatchRequest, + GlobalVariableJsonPatchRequestData: GlobalVariableJsonPatchRequestData, + GlobalVariableJsonPatchRequestDataAttributes: + GlobalVariableJsonPatchRequestDataAttributes, + GlobalVariableResponse: GlobalVariableResponse, + JsonPatchOperation: JsonPatchOperation, OnDemandConcurrencyCap: OnDemandConcurrencyCap, OnDemandConcurrencyCapAttributes: OnDemandConcurrencyCapAttributes, OnDemandConcurrencyCapResponse: OnDemandConcurrencyCapResponse, + SyntheticsGlobalVariable: SyntheticsGlobalVariable, + SyntheticsGlobalVariableAttributes: SyntheticsGlobalVariableAttributes, + SyntheticsGlobalVariableOptions: SyntheticsGlobalVariableOptions, + SyntheticsGlobalVariableParseTestOptions: + SyntheticsGlobalVariableParseTestOptions, + SyntheticsGlobalVariableTOTPParameters: + SyntheticsGlobalVariableTOTPParameters, + SyntheticsGlobalVariableValue: SyntheticsGlobalVariableValue, + SyntheticsVariableParser: SyntheticsVariableParser, }, };