From ce0309542feefb963f180f84280bc9464b133d13 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 19 Dec 2025 09:37:18 +0000 Subject: [PATCH] Regenerate client from commit 19ebc26 of spec repo --- .generator/schemas/v2/openapi.yaml | 441 ++++++++++ features/v2/synthetics.feature | 70 ++ features/v2/undo.json | 37 + .../src/support/scenarios_model_mapping.ts | 55 ++ services/synthetics/src/v2/SyntheticsApi.ts | 819 +++++++++++++++++- services/synthetics/src/v2/index.ts | 26 + .../src/v2/models/DeletedSuiteResponseData.ts | 54 ++ .../DeletedSuiteResponseDataAttributes.ts | 49 ++ .../v2/models/DeletedSuitesRequestDelete.ts | 52 ++ .../DeletedSuitesRequestDeleteAttributes.ts | 44 + .../DeletedSuitesRequestDeleteRequest.ts | 41 + .../src/v2/models/DeletedSuitesRequestType.ts | 5 + .../src/v2/models/DeletedSuitesResponse.ts | 40 + .../src/v2/models/SuiteCreateEdit.ts | 54 ++ .../src/v2/models/SuiteCreateEditRequest.ts | 41 + .../src/v2/models/SuiteSearchResponseType.ts | 3 + .../src/v2/models/SyntheticsSuite.ts | 98 +++ .../src/v2/models/SyntheticsSuiteOptions.ts | 45 + .../src/v2/models/SyntheticsSuiteResponse.ts | 46 + .../v2/models/SyntheticsSuiteResponseData.ts | 46 + .../models/SyntheticsSuiteSearchResponse.ts | 46 + .../SyntheticsSuiteSearchResponseData.ts | 58 ++ ...heticsSuiteSearchResponseDataAttributes.ts | 49 ++ .../src/v2/models/SyntheticsSuiteTest.ts | 52 ++ .../SyntheticsSuiteTestAlertingCriticality.ts | 11 + .../src/v2/models/SyntheticsSuiteType.ts | 7 + .../src/v2/models/SyntheticsSuiteTypes.ts | 7 + .../synthetics/src/v2/models/TypingInfo.ts | 38 + 28 files changed, 2294 insertions(+), 40 deletions(-) create mode 100644 services/synthetics/src/v2/models/DeletedSuiteResponseData.ts create mode 100644 services/synthetics/src/v2/models/DeletedSuiteResponseDataAttributes.ts create mode 100644 services/synthetics/src/v2/models/DeletedSuitesRequestDelete.ts create mode 100644 services/synthetics/src/v2/models/DeletedSuitesRequestDeleteAttributes.ts create mode 100644 services/synthetics/src/v2/models/DeletedSuitesRequestDeleteRequest.ts create mode 100644 services/synthetics/src/v2/models/DeletedSuitesRequestType.ts create mode 100644 services/synthetics/src/v2/models/DeletedSuitesResponse.ts create mode 100644 services/synthetics/src/v2/models/SuiteCreateEdit.ts create mode 100644 services/synthetics/src/v2/models/SuiteCreateEditRequest.ts create mode 100644 services/synthetics/src/v2/models/SuiteSearchResponseType.ts create mode 100644 services/synthetics/src/v2/models/SyntheticsSuite.ts create mode 100644 services/synthetics/src/v2/models/SyntheticsSuiteOptions.ts create mode 100644 services/synthetics/src/v2/models/SyntheticsSuiteResponse.ts create mode 100644 services/synthetics/src/v2/models/SyntheticsSuiteResponseData.ts create mode 100644 services/synthetics/src/v2/models/SyntheticsSuiteSearchResponse.ts create mode 100644 services/synthetics/src/v2/models/SyntheticsSuiteSearchResponseData.ts create mode 100644 services/synthetics/src/v2/models/SyntheticsSuiteSearchResponseDataAttributes.ts create mode 100644 services/synthetics/src/v2/models/SyntheticsSuiteTest.ts create mode 100644 services/synthetics/src/v2/models/SyntheticsSuiteTestAlertingCriticality.ts create mode 100644 services/synthetics/src/v2/models/SyntheticsSuiteType.ts create mode 100644 services/synthetics/src/v2/models/SyntheticsSuiteTypes.ts diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 196165112daa..ac0ddb8e192a 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -17098,6 +17098,70 @@ components: required: - data type: object + DeletedSuiteResponseData: + properties: + attributes: + $ref: '#/components/schemas/DeletedSuiteResponseDataAttributes' + id: + type: string + type: + $ref: '#/components/schemas/SyntheticsSuiteTypes' + type: object + DeletedSuiteResponseDataAttributes: + properties: + deleted_at: + description: Deletion timestamp of the Synthetic suite ID. + type: string + public_id: + description: The Synthetic suite ID deleted. + type: string + type: object + DeletedSuitesRequestDelete: + properties: + attributes: + $ref: '#/components/schemas/DeletedSuitesRequestDeleteAttributes' + id: + type: string + type: + $ref: '#/components/schemas/DeletedSuitesRequestType' + required: + - attributes + type: object + DeletedSuitesRequestDeleteAttributes: + properties: + force_delete_dependencies: + type: boolean + public_ids: + example: + - '' + items: + type: string + type: array + required: + - public_ids + type: object + DeletedSuitesRequestDeleteRequest: + properties: + data: + $ref: '#/components/schemas/DeletedSuitesRequestDelete' + required: + - data + type: object + DeletedSuitesRequestType: + default: delete_suites_request + enum: + - delete_suites_request + example: delete_suites_request + type: string + x-enum-varnames: + - DELETE_SUITES_REQUEST + DeletedSuitesResponse: + properties: + data: + items: + $ref: '#/components/schemas/DeletedSuiteResponseData' + type: array + type: object DependencyLocation: description: Static library vulnerability location. properties: @@ -53228,6 +53292,31 @@ components: format: double type: number type: object + SuiteCreateEdit: + properties: + attributes: + $ref: '#/components/schemas/SyntheticsSuite' + type: + $ref: '#/components/schemas/SyntheticsSuiteTypes' + required: + - attributes + - type + type: object + SuiteCreateEditRequest: + properties: + data: + $ref: '#/components/schemas/SuiteCreateEdit' + required: + - data + type: object + SuiteSearchResponseType: + default: suites_search + enum: + - suites_search + example: suites_search + type: string + x-enum-varnames: + - SUITES_SEARCH SuppressionVersionHistory: description: Response object containing the version history of a suppression. properties: @@ -53254,6 +53343,137 @@ components: suppression: $ref: '#/components/schemas/SecurityMonitoringSuppressionAttributes' type: object + SyntheticsSuite: + description: Object containing details about a Synthetic suite. + properties: + message: + description: Notification message associated with the suite. + example: Notification message + type: string + name: + description: Name of the suite. + example: Example suite name + type: string + options: + $ref: '#/components/schemas/SyntheticsSuiteOptions' + public_id: + description: The public ID for the test. + example: 123-abc-456 + readOnly: true + type: string + tags: + description: Array of tags attached to the suite. + example: + - env:production + items: + description: A tag attached to the suite. + type: string + type: array + tests: + items: + $ref: '#/components/schemas/SyntheticsSuiteTest' + type: array + type: + $ref: '#/components/schemas/SyntheticsSuiteType' + required: + - name + - message + - type + - tests + - options + type: object + SyntheticsSuiteOptions: + description: Object describing the extra options for a Synthetic suite. + properties: + alerting_threshold: + description: Percentage of critical tests failure needed for a suite to + fail. + format: double + maximum: 1 + minimum: 0 + type: number + type: object + SyntheticsSuiteResponse: + description: Synthetics suite response + properties: + data: + $ref: '#/components/schemas/SyntheticsSuiteResponseData' + type: object + SyntheticsSuiteResponseData: + description: Synthetics suite response data + properties: + attributes: + $ref: '#/components/schemas/SyntheticsSuite' + type: object + SyntheticsSuiteSearchResponse: + description: Synthetics suite search response + properties: + data: + $ref: '#/components/schemas/SyntheticsSuiteSearchResponseData' + type: object + SyntheticsSuiteSearchResponseData: + description: Synthetics suite search response data + properties: + attributes: + $ref: '#/components/schemas/SyntheticsSuiteSearchResponseDataAttributes' + id: + format: uuid + type: string + type: + $ref: '#/components/schemas/SuiteSearchResponseType' + type: object + SyntheticsSuiteSearchResponseDataAttributes: + description: Synthetics suite search response data attributes + properties: + suites: + items: + $ref: '#/components/schemas/SyntheticsSuite' + type: array + total: + format: int32 + maximum: 2147483647 + type: integer + type: object + SyntheticsSuiteTest: + description: Object containing details about a Synthetic test included in a + Synthetic suite. + properties: + alerting_criticality: + $ref: '#/components/schemas/SyntheticsSuiteTestAlertingCriticality' + public_id: + example: '' + type: string + required: + - public_id + type: object + SyntheticsSuiteTestAlertingCriticality: + description: Alerting criticality for each the test. + enum: + - ignore + - critical + example: critical + type: string + x-enum-varnames: + - IGNORE + - CRITICAL + SyntheticsSuiteType: + default: suite + description: Type of the Synthetic suite, `suite`. + enum: + - suite + example: suite + type: string + x-enum-varnames: + - SUITE + SyntheticsSuiteTypes: + default: suites + description: Type for the Synthetics suites responses, `suites`. + enum: + - suites + example: suites + type: string + x-enum-varnames: + - SUITES TableResultV2: description: A reference table resource containing its full configuration and state. @@ -85358,6 +85578,227 @@ paths: operator: OR permissions: - billing_edit + /api/v2/synthetics/suites: + post: + operationId: CreateSyntheticsSuite + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SuiteCreateEditRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticsSuiteResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_write + summary: 'Synthetics: Create a test suite' + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_write + - synthetics_create_edit_trigger + /api/v2/synthetics/suites/bulk-delete: + post: + operationId: DeleteSyntheticsSuites + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeletedSuitesRequestDeleteRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeletedSuitesResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_write + summary: 'Synthetics: Bulk delete suites' + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_write + /api/v2/synthetics/suites/search: + get: + description: Search for Synthetics suites. + operationId: SearchSuites + parameters: + - description: The search query. + in: query + name: query + required: false + schema: + type: string + - description: The sort order for the results (e.g., `name,asc` or `name,desc`). + in: query + name: sort + required: false + schema: + default: name,asc + type: string + - description: If true, return only facets instead of full test details. + in: query + name: facets_only + required: false + schema: + default: false + type: boolean + - description: The offset from which to start returning results. + in: query + name: start + required: false + schema: + default: 0 + format: int64 + type: integer + - description: The maximum number of results to return. + in: query + name: count + required: false + schema: + default: 50 + format: int64 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticsSuiteSearchResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_read + summary: Search Synthetics suites + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_read + /api/v2/synthetics/suites/{public_id}: + get: + operationId: GetSyntheticsSuite + parameters: + - description: The public ID of the suite to get details from. + in: path + name: public_id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticsSuiteResponse' + description: OK + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_read + summary: 'Synthetics: Get a suite' + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_read + put: + operationId: EditSyntheticsSuite + parameters: + - description: The public ID of the suite to edit. + in: path + name: public_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SuiteCreateEditRequest' + description: New suite details to be saved. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticsSuiteResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_write + summary: 'Synthetics: edit a test suite' + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_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..9f30830eb2e8 100644 --- a/features/v2/synthetics.feature +++ b/features/v2/synthetics.feature @@ -27,3 +27,73 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK And the response "data.attributes.on_demand_concurrency_cap" is equal to 20 + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Search Synthetics suites returns "API error response." response + Given new "SearchSuites" request + When the request is sent + Then the response status is 400 API error response. + + @team:DataDog/synthetics-managing + Scenario: Search Synthetics suites returns "OK" response + Given new "SearchSuites" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Synthetics: Bulk delete suites returns "API error response." response + Given new "DeleteSyntheticsSuites" request + And body with value {"data": {"attributes": {"public_ids": [""]}, "type": "delete_suites_request"}} + When the request is sent + Then the response status is 400 API error response. + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Synthetics: Bulk delete suites returns "OK" response + Given new "DeleteSyntheticsSuites" request + And body with value {"data": {"attributes": {"public_ids": [""]}, "type": "delete_suites_request"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Synthetics: Create a test suite returns "API error response." response + Given new "CreateSyntheticsSuite" request + And body with value {"data": {"attributes": {"message": "Notification message", "name": "Example suite name", "options": {}, "tags": ["env:production"], "tests": [{"alerting_criticality": "critical", "public_id": ""}], "type": "suite"}, "type": "suites"}} + When the request is sent + Then the response status is 400 API error response. + + @team:DataDog/synthetics-managing + Scenario: Synthetics: Create a test suite returns "OK" response + Given new "CreateSyntheticsSuite" request + And body with value {"data": {"attributes": {"message": "Notification message", "name": "Example suite name", "options": {}, "tags": ["env:production"], "tests": [], "type": "suite"}, "type": "suites"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Synthetics: Get a suite returns "API error response." response + Given new "GetSyntheticsSuite" request + And request contains "public_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Synthetics: Get a suite returns "OK" response + Given new "GetSyntheticsSuite" request + And request contains "public_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Synthetics: edit a test suite returns "API error response." response + Given new "EditSyntheticsSuite" request + And request contains "public_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"message": "Notification message", "name": "Example suite name", "options": {}, "tags": ["env:production"], "tests": [{"alerting_criticality": "critical", "public_id": ""}], "type": "suite"}, "type": "suites"}} + When the request is sent + Then the response status is 400 API error response. + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Synthetics: edit a test suite returns "OK" response + Given new "EditSyntheticsSuite" request + And request contains "public_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"message": "Notification message", "name": "Example suite name", "options": {}, "tags": ["env:production"], "tests": [{"alerting_criticality": "critical", "public_id": ""}], "type": "suite"}, "type": "suites"}} + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/undo.json b/features/v2/undo.json index e0f0b98d0c96..35d427654cec 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -4469,6 +4469,43 @@ "type": "safe" } }, + "CreateSyntheticsSuite": { + "tag": "Synthetics", + "undo": { + "operationId": "DeleteSyntheticsSuites", + "parameters": [ + { + "name": "body", + "template": "{\"data\": {\"type\": \"delete_suites_request\", \"attributes\": {\"public_ids\": [\"{{ data.attributes.public_id }}\"]}}" + } + ], + "type": "unsafe" + } + }, + "DeleteSyntheticsSuites": { + "tag": "Synthetics", + "undo": { + "type": "idempotent" + } + }, + "SearchSuites": { + "tag": "Synthetics", + "undo": { + "type": "safe" + } + }, + "GetSyntheticsSuite": { + "tag": "Synthetics", + "undo": { + "type": "safe" + } + }, + "EditSyntheticsSuite": { + "tag": "Synthetics", + "undo": { + "type": "idempotent" + } + }, "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 b16e19bf9cca..355ce51c39e2 100644 --- a/private/bdd_runner/src/support/scenarios_model_mapping.ts +++ b/private/bdd_runner/src/support/scenarios_model_mapping.ts @@ -9016,6 +9016,61 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = { }, operationResponseType: "OnDemandConcurrencyCapResponse", }, + "SyntheticsApi.V2.CreateSyntheticsSuite": { + body: { + type: "SuiteCreateEditRequest", + format: "", + }, + operationResponseType: "SyntheticsSuiteResponse", + }, + "SyntheticsApi.V2.DeleteSyntheticsSuites": { + body: { + type: "DeletedSuitesRequestDeleteRequest", + format: "", + }, + operationResponseType: "DeletedSuitesResponse", + }, + "SyntheticsApi.V2.SearchSuites": { + query: { + type: "string", + format: "", + }, + sort: { + type: "string", + format: "", + }, + facetsOnly: { + type: "boolean", + format: "", + }, + start: { + type: "number", + format: "int64", + }, + count: { + type: "number", + format: "int64", + }, + operationResponseType: "SyntheticsSuiteSearchResponse", + }, + "SyntheticsApi.V2.GetSyntheticsSuite": { + publicId: { + type: "string", + format: "", + }, + operationResponseType: "SyntheticsSuiteResponse", + }, + "SyntheticsApi.V2.EditSyntheticsSuite": { + publicId: { + type: "string", + format: "", + }, + body: { + type: "SuiteCreateEditRequest", + format: "", + }, + operationResponseType: "SyntheticsSuiteResponse", + }, "TeamsApi.V2.ListTeams": { pageNumber: { type: "number", diff --git a/services/synthetics/src/v2/SyntheticsApi.ts b/services/synthetics/src/v2/SyntheticsApi.ts index ab96e3f46e3d..1c7717a0931a 100644 --- a/services/synthetics/src/v2/SyntheticsApi.ts +++ b/services/synthetics/src/v2/SyntheticsApi.ts @@ -23,8 +23,13 @@ import { import { TypingInfo } from "./models/TypingInfo"; import { APIErrorResponse } from "./models/APIErrorResponse"; +import { DeletedSuitesRequestDeleteRequest } from "./models/DeletedSuitesRequestDeleteRequest"; +import { DeletedSuitesResponse } from "./models/DeletedSuitesResponse"; import { OnDemandConcurrencyCapAttributes } from "./models/OnDemandConcurrencyCapAttributes"; import { OnDemandConcurrencyCapResponse } from "./models/OnDemandConcurrencyCapResponse"; +import { SuiteCreateEditRequest } from "./models/SuiteCreateEditRequest"; +import { SyntheticsSuiteResponse } from "./models/SyntheticsSuiteResponse"; +import { SyntheticsSuiteSearchResponse } from "./models/SyntheticsSuiteSearchResponse"; import { version } from "../version"; export class SyntheticsApiRequestFactory extends BaseAPIRequestFactory { @@ -36,6 +41,168 @@ export class SyntheticsApiRequestFactory extends BaseAPIRequestFactory { this.userAgent = buildUserAgent("synthetics", version); } } + public async createSyntheticsSuite( + body: SuiteCreateEditRequest, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "createSyntheticsSuite"); + } + + // Path Params + const localVarPath = "/api/v2/synthetics/suites"; + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "SyntheticsApi.v2.createSyntheticsSuite", + SyntheticsApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.POST, + 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, "SuiteCreateEditRequest", ""), + contentType, + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + + public async deleteSyntheticsSuites( + body: DeletedSuitesRequestDeleteRequest, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "deleteSyntheticsSuites"); + } + + // Path Params + const localVarPath = "/api/v2/synthetics/suites/bulk-delete"; + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "SyntheticsApi.v2.deleteSyntheticsSuites", + SyntheticsApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.POST, + 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, "DeletedSuitesRequestDeleteRequest", ""), + contentType, + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + + public async editSyntheticsSuite( + publicId: string, + body: SuiteCreateEditRequest, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'publicId' is not null or undefined + if (publicId === null || publicId === undefined) { + throw new RequiredError("publicId", "editSyntheticsSuite"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "editSyntheticsSuite"); + } + + // Path Params + const localVarPath = "/api/v2/synthetics/suites/{public_id}".replace( + "{public_id}", + encodeURIComponent(String(publicId)), + ); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "SyntheticsApi.v2.editSyntheticsSuite", + SyntheticsApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.PUT, + 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, "SuiteCreateEditRequest", ""), + contentType, + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + public async getOnDemandConcurrencyCap( _options?: Configuration, ): Promise { @@ -72,6 +239,129 @@ export class SyntheticsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async getSyntheticsSuite( + publicId: string, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'publicId' is not null or undefined + if (publicId === null || publicId === undefined) { + throw new RequiredError("publicId", "getSyntheticsSuite"); + } + + // Path Params + const localVarPath = "/api/v2/synthetics/suites/{public_id}".replace( + "{public_id}", + encodeURIComponent(String(publicId)), + ); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "SyntheticsApi.v2.getSyntheticsSuite", + SyntheticsApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.GET, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + + public async searchSuites( + query?: string, + sort?: string, + facetsOnly?: boolean, + start?: number, + count?: number, + _options?: Configuration, + ): Promise { + const _config = _options || this.configuration; + + // Path Params + const localVarPath = "/api/v2/synthetics/suites/search"; + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "SyntheticsApi.v2.searchSuites", + SyntheticsApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.GET, + overrides, + ); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Set User-Agent + if (this.userAgent) { + requestContext.setHeaderParam("User-Agent", this.userAgent); + } + + // Query Params + if (query !== undefined) { + requestContext.setQueryParam( + "query", + serialize(query, TypingInfo, "string", ""), + "", + ); + } + if (sort !== undefined) { + requestContext.setQueryParam( + "sort", + serialize(sort, TypingInfo, "string", ""), + "", + ); + } + if (facetsOnly !== undefined) { + requestContext.setQueryParam( + "facets_only", + serialize(facetsOnly, TypingInfo, "boolean", ""), + "", + ); + } + if (start !== undefined) { + requestContext.setQueryParam( + "start", + serialize(start, TypingInfo, "number", "int64"), + "", + ); + } + if (count !== undefined) { + requestContext.setQueryParam( + "count", + serialize(count, TypingInfo, "number", "int64"), + "", + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + public async setOnDemandConcurrencyCap( body: OnDemandConcurrencyCapAttributes, _options?: Configuration, @@ -129,22 +419,22 @@ 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 getOnDemandConcurrencyCap + * @params response Response returned by the server for a request to createSyntheticsSuite * @throws ApiException if the response code was not in [200, 299] */ - public async getOnDemandConcurrencyCap( + public async createSyntheticsSuite( response: ResponseContext, - ): Promise { + ): Promise { const contentType = normalizeMediaType(response.headers["content-type"]); if (response.httpStatusCode === 200) { - const body: OnDemandConcurrencyCapResponse = deserialize( + const body: SyntheticsSuiteResponse = deserialize( parse(await response.body.text(), contentType), TypingInfo, - "OnDemandConcurrencyCapResponse", - ) as OnDemandConcurrencyCapResponse; + "SyntheticsSuiteResponse", + ) as SyntheticsSuiteResponse; return body; } - if (response.httpStatusCode === 429) { + if (response.httpStatusCode === 400 || response.httpStatusCode === 429) { const bodyText = parse(await response.body.text(), contentType); let body: APIErrorResponse; try { @@ -165,12 +455,12 @@ export class SyntheticsApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: OnDemandConcurrencyCapResponse = deserialize( + const body: SyntheticsSuiteResponse = deserialize( parse(await response.body.text(), contentType), TypingInfo, - "OnDemandConcurrencyCapResponse", + "SyntheticsSuiteResponse", "", - ) as OnDemandConcurrencyCapResponse; + ) as SyntheticsSuiteResponse; return body; } @@ -185,22 +475,22 @@ 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 setOnDemandConcurrencyCap + * @params response Response returned by the server for a request to deleteSyntheticsSuites * @throws ApiException if the response code was not in [200, 299] */ - public async setOnDemandConcurrencyCap( + public async deleteSyntheticsSuites( response: ResponseContext, - ): Promise { + ): Promise { const contentType = normalizeMediaType(response.headers["content-type"]); if (response.httpStatusCode === 200) { - const body: OnDemandConcurrencyCapResponse = deserialize( + const body: DeletedSuitesResponse = deserialize( parse(await response.body.text(), contentType), TypingInfo, - "OnDemandConcurrencyCapResponse", - ) as OnDemandConcurrencyCapResponse; + "DeletedSuitesResponse", + ) as DeletedSuitesResponse; return body; } - if (response.httpStatusCode === 429) { + if (response.httpStatusCode === 400 || response.httpStatusCode === 429) { const bodyText = parse(await response.body.text(), contentType); let body: APIErrorResponse; try { @@ -221,12 +511,12 @@ export class SyntheticsApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: OnDemandConcurrencyCapResponse = deserialize( + const body: DeletedSuitesResponse = deserialize( parse(await response.body.text(), contentType), TypingInfo, - "OnDemandConcurrencyCapResponse", + "DeletedSuitesResponse", "", - ) as OnDemandConcurrencyCapResponse; + ) as DeletedSuitesResponse; return body; } @@ -236,35 +526,439 @@ export class SyntheticsApiResponseProcessor { 'Unknown API Status Code!\nBody: "' + body + '"', ); } -} -export interface SyntheticsApiSetOnDemandConcurrencyCapRequest { /** - * . - * @type OnDemandConcurrencyCapAttributes + * 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 editSyntheticsSuite + * @throws ApiException if the response code was not in [200, 299] */ - body: OnDemandConcurrencyCapAttributes; -} - -export class SyntheticsApi { - private requestFactory: SyntheticsApiRequestFactory; - private responseProcessor: SyntheticsApiResponseProcessor; - private configuration: Configuration; - - static operationServers: { [key: string]: BaseServerConfiguration[] } = {}; - - public constructor( - configuration?: Configuration, - requestFactory?: SyntheticsApiRequestFactory, - responseProcessor?: SyntheticsApiResponseProcessor, - ) { - this.configuration = configuration || createConfiguration(); + public async editSyntheticsSuite( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: SyntheticsSuiteResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "SyntheticsSuiteResponse", + ) as SyntheticsSuiteResponse; + return body; + } + if (response.httpStatusCode === 400 || 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: SyntheticsSuiteResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "SyntheticsSuiteResponse", + "", + ) as SyntheticsSuiteResponse; + 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 + * + * @params response Response returned by the server for a request to getOnDemandConcurrencyCap + * @throws ApiException if the response code was not in [200, 299] + */ + public async getOnDemandConcurrencyCap( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: OnDemandConcurrencyCapResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "OnDemandConcurrencyCapResponse", + ) as OnDemandConcurrencyCapResponse; + return body; + } + if (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: OnDemandConcurrencyCapResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "OnDemandConcurrencyCapResponse", + "", + ) as OnDemandConcurrencyCapResponse; + 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 + * + * @params response Response returned by the server for a request to getSyntheticsSuite + * @throws ApiException if the response code was not in [200, 299] + */ + public async getSyntheticsSuite( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: SyntheticsSuiteResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "SyntheticsSuiteResponse", + ) as SyntheticsSuiteResponse; + return body; + } + if (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: SyntheticsSuiteResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "SyntheticsSuiteResponse", + "", + ) as SyntheticsSuiteResponse; + 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 + * + * @params response Response returned by the server for a request to searchSuites + * @throws ApiException if the response code was not in [200, 299] + */ + public async searchSuites( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: SyntheticsSuiteSearchResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "SyntheticsSuiteSearchResponse", + ) as SyntheticsSuiteSearchResponse; + return body; + } + if (response.httpStatusCode === 400 || 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: SyntheticsSuiteSearchResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "SyntheticsSuiteSearchResponse", + "", + ) as SyntheticsSuiteSearchResponse; + 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 + * + * @params response Response returned by the server for a request to setOnDemandConcurrencyCap + * @throws ApiException if the response code was not in [200, 299] + */ + public async setOnDemandConcurrencyCap( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: OnDemandConcurrencyCapResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "OnDemandConcurrencyCapResponse", + ) as OnDemandConcurrencyCapResponse; + return body; + } + if (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: OnDemandConcurrencyCapResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "OnDemandConcurrencyCapResponse", + "", + ) as OnDemandConcurrencyCapResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', + ); + } +} + +export interface SyntheticsApiCreateSyntheticsSuiteRequest { + /** + * @type SuiteCreateEditRequest + */ + body: SuiteCreateEditRequest; +} + +export interface SyntheticsApiDeleteSyntheticsSuitesRequest { + /** + * @type DeletedSuitesRequestDeleteRequest + */ + body: DeletedSuitesRequestDeleteRequest; +} + +export interface SyntheticsApiEditSyntheticsSuiteRequest { + /** + * The public ID of the suite to edit. + * @type string + */ + publicId: string; + /** + * New suite details to be saved. + * @type SuiteCreateEditRequest + */ + body: SuiteCreateEditRequest; +} + +export interface SyntheticsApiGetSyntheticsSuiteRequest { + /** + * The public ID of the suite to get details from. + * @type string + */ + publicId: string; +} + +export interface SyntheticsApiSearchSuitesRequest { + /** + * The search query. + * @type string + */ + query?: string; + /** + * The sort order for the results (e.g., `name,asc` or `name,desc`). + * @type string + */ + sort?: string; + /** + * If true, return only facets instead of full test details. + * @type boolean + */ + facetsOnly?: boolean; + /** + * The offset from which to start returning results. + * @type number + */ + start?: number; + /** + * The maximum number of results to return. + * @type number + */ + count?: number; +} + +export interface SyntheticsApiSetOnDemandConcurrencyCapRequest { + /** + * . + * @type OnDemandConcurrencyCapAttributes + */ + body: OnDemandConcurrencyCapAttributes; +} + +export class SyntheticsApi { + private requestFactory: SyntheticsApiRequestFactory; + private responseProcessor: SyntheticsApiResponseProcessor; + private configuration: Configuration; + + static operationServers: { [key: string]: BaseServerConfiguration[] } = {}; + + public constructor( + configuration?: Configuration, + requestFactory?: SyntheticsApiRequestFactory, + responseProcessor?: SyntheticsApiResponseProcessor, + ) { + this.configuration = configuration || createConfiguration(); this.requestFactory = requestFactory || new SyntheticsApiRequestFactory(this.configuration); this.responseProcessor = responseProcessor || new SyntheticsApiResponseProcessor(); } + /** + * @param param The request object + */ + public createSyntheticsSuite( + param: SyntheticsApiCreateSyntheticsSuiteRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.createSyntheticsSuite( + param.body, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.createSyntheticsSuite(responseContext); + }); + }); + } + + /** + * @param param The request object + */ + public deleteSyntheticsSuites( + param: SyntheticsApiDeleteSyntheticsSuitesRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.deleteSyntheticsSuites( + param.body, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.deleteSyntheticsSuites(responseContext); + }); + }); + } + + /** + * @param param The request object + */ + public editSyntheticsSuite( + param: SyntheticsApiEditSyntheticsSuiteRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.editSyntheticsSuite( + param.publicId, + param.body, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.editSyntheticsSuite(responseContext); + }); + }); + } + /** * Get the on-demand concurrency cap. * @param param The request object @@ -285,6 +979,51 @@ export class SyntheticsApi { }); } + /** + * @param param The request object + */ + public getSyntheticsSuite( + param: SyntheticsApiGetSyntheticsSuiteRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.getSyntheticsSuite( + param.publicId, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getSyntheticsSuite(responseContext); + }); + }); + } + + /** + * Search for Synthetics suites. + * @param param The request object + */ + public searchSuites( + param: SyntheticsApiSearchSuitesRequest = {}, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.searchSuites( + param.query, + param.sort, + param.facetsOnly, + param.start, + param.count, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.searchSuites(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..79ca3397af70 100644 --- a/services/synthetics/src/v2/index.ts +++ b/services/synthetics/src/v2/index.ts @@ -1,10 +1,36 @@ export { + SyntheticsApiCreateSyntheticsSuiteRequest, + SyntheticsApiDeleteSyntheticsSuitesRequest, + SyntheticsApiEditSyntheticsSuiteRequest, + SyntheticsApiGetSyntheticsSuiteRequest, + SyntheticsApiSearchSuitesRequest, SyntheticsApiSetOnDemandConcurrencyCapRequest, SyntheticsApi, } from "./SyntheticsApi"; export { APIErrorResponse } from "./models/APIErrorResponse"; +export { DeletedSuiteResponseData } from "./models/DeletedSuiteResponseData"; +export { DeletedSuiteResponseDataAttributes } from "./models/DeletedSuiteResponseDataAttributes"; +export { DeletedSuitesRequestDelete } from "./models/DeletedSuitesRequestDelete"; +export { DeletedSuitesRequestDeleteAttributes } from "./models/DeletedSuitesRequestDeleteAttributes"; +export { DeletedSuitesRequestDeleteRequest } from "./models/DeletedSuitesRequestDeleteRequest"; +export { DeletedSuitesRequestType } from "./models/DeletedSuitesRequestType"; +export { DeletedSuitesResponse } from "./models/DeletedSuitesResponse"; export { OnDemandConcurrencyCap } from "./models/OnDemandConcurrencyCap"; export { OnDemandConcurrencyCapAttributes } from "./models/OnDemandConcurrencyCapAttributes"; export { OnDemandConcurrencyCapResponse } from "./models/OnDemandConcurrencyCapResponse"; export { OnDemandConcurrencyCapType } from "./models/OnDemandConcurrencyCapType"; +export { SuiteCreateEdit } from "./models/SuiteCreateEdit"; +export { SuiteCreateEditRequest } from "./models/SuiteCreateEditRequest"; +export { SuiteSearchResponseType } from "./models/SuiteSearchResponseType"; +export { SyntheticsSuite } from "./models/SyntheticsSuite"; +export { SyntheticsSuiteOptions } from "./models/SyntheticsSuiteOptions"; +export { SyntheticsSuiteResponse } from "./models/SyntheticsSuiteResponse"; +export { SyntheticsSuiteResponseData } from "./models/SyntheticsSuiteResponseData"; +export { SyntheticsSuiteSearchResponse } from "./models/SyntheticsSuiteSearchResponse"; +export { SyntheticsSuiteSearchResponseData } from "./models/SyntheticsSuiteSearchResponseData"; +export { SyntheticsSuiteSearchResponseDataAttributes } from "./models/SyntheticsSuiteSearchResponseDataAttributes"; +export { SyntheticsSuiteTest } from "./models/SyntheticsSuiteTest"; +export { SyntheticsSuiteTestAlertingCriticality } from "./models/SyntheticsSuiteTestAlertingCriticality"; +export { SyntheticsSuiteType } from "./models/SyntheticsSuiteType"; +export { SyntheticsSuiteTypes } from "./models/SyntheticsSuiteTypes"; diff --git a/services/synthetics/src/v2/models/DeletedSuiteResponseData.ts b/services/synthetics/src/v2/models/DeletedSuiteResponseData.ts new file mode 100644 index 000000000000..84d76c9ccf08 --- /dev/null +++ b/services/synthetics/src/v2/models/DeletedSuiteResponseData.ts @@ -0,0 +1,54 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { DeletedSuiteResponseDataAttributes } from "./DeletedSuiteResponseDataAttributes"; +import { SyntheticsSuiteTypes } from "./SyntheticsSuiteTypes"; + +export class DeletedSuiteResponseData { + "attributes"?: DeletedSuiteResponseDataAttributes; + "id"?: string; + /** + * Type for the Synthetics suites responses, `suites`. + */ + "type"?: SyntheticsSuiteTypes; + /** + * 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: "DeletedSuiteResponseDataAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "SyntheticsSuiteTypes", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return DeletedSuiteResponseData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/DeletedSuiteResponseDataAttributes.ts b/services/synthetics/src/v2/models/DeletedSuiteResponseDataAttributes.ts new file mode 100644 index 000000000000..2729792f75fa --- /dev/null +++ b/services/synthetics/src/v2/models/DeletedSuiteResponseDataAttributes.ts @@ -0,0 +1,49 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class DeletedSuiteResponseDataAttributes { + /** + * Deletion timestamp of the Synthetic suite ID. + */ + "deletedAt"?: string; + /** + * The Synthetic suite ID deleted. + */ + "publicId"?: 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 = { + deletedAt: { + baseName: "deleted_at", + type: "string", + }, + publicId: { + baseName: "public_id", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return DeletedSuiteResponseDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/DeletedSuitesRequestDelete.ts b/services/synthetics/src/v2/models/DeletedSuitesRequestDelete.ts new file mode 100644 index 000000000000..96e62d3f6d02 --- /dev/null +++ b/services/synthetics/src/v2/models/DeletedSuitesRequestDelete.ts @@ -0,0 +1,52 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { DeletedSuitesRequestDeleteAttributes } from "./DeletedSuitesRequestDeleteAttributes"; +import { DeletedSuitesRequestType } from "./DeletedSuitesRequestType"; + +export class DeletedSuitesRequestDelete { + "attributes": DeletedSuitesRequestDeleteAttributes; + "id"?: string; + "type"?: DeletedSuitesRequestType; + /** + * 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: "DeletedSuitesRequestDeleteAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "DeletedSuitesRequestType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return DeletedSuitesRequestDelete.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/DeletedSuitesRequestDeleteAttributes.ts b/services/synthetics/src/v2/models/DeletedSuitesRequestDeleteAttributes.ts new file mode 100644 index 000000000000..d62e7151a9ef --- /dev/null +++ b/services/synthetics/src/v2/models/DeletedSuitesRequestDeleteAttributes.ts @@ -0,0 +1,44 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +export class DeletedSuitesRequestDeleteAttributes { + "forceDeleteDependencies"?: boolean; + "publicIds": 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 = { + forceDeleteDependencies: { + baseName: "force_delete_dependencies", + type: "boolean", + }, + publicIds: { + baseName: "public_ids", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return DeletedSuitesRequestDeleteAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/DeletedSuitesRequestDeleteRequest.ts b/services/synthetics/src/v2/models/DeletedSuitesRequestDeleteRequest.ts new file mode 100644 index 000000000000..039eb736cc0d --- /dev/null +++ b/services/synthetics/src/v2/models/DeletedSuitesRequestDeleteRequest.ts @@ -0,0 +1,41 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { DeletedSuitesRequestDelete } from "./DeletedSuitesRequestDelete"; + +export class DeletedSuitesRequestDeleteRequest { + "data": DeletedSuitesRequestDelete; + /** + * 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: "DeletedSuitesRequestDelete", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return DeletedSuitesRequestDeleteRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/DeletedSuitesRequestType.ts b/services/synthetics/src/v2/models/DeletedSuitesRequestType.ts new file mode 100644 index 000000000000..e939e8e89ce3 --- /dev/null +++ b/services/synthetics/src/v2/models/DeletedSuitesRequestType.ts @@ -0,0 +1,5 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; +export type DeletedSuitesRequestType = + | typeof DELETE_SUITES_REQUEST + | UnparsedObject; +export const DELETE_SUITES_REQUEST = "delete_suites_request"; diff --git a/services/synthetics/src/v2/models/DeletedSuitesResponse.ts b/services/synthetics/src/v2/models/DeletedSuitesResponse.ts new file mode 100644 index 000000000000..59aa69e5f57d --- /dev/null +++ b/services/synthetics/src/v2/models/DeletedSuitesResponse.ts @@ -0,0 +1,40 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { DeletedSuiteResponseData } from "./DeletedSuiteResponseData"; + +export class DeletedSuitesResponse { + "data"?: 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 = { + data: { + baseName: "data", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return DeletedSuitesResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/SuiteCreateEdit.ts b/services/synthetics/src/v2/models/SuiteCreateEdit.ts new file mode 100644 index 000000000000..682cbafcb527 --- /dev/null +++ b/services/synthetics/src/v2/models/SuiteCreateEdit.ts @@ -0,0 +1,54 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SyntheticsSuite } from "./SyntheticsSuite"; +import { SyntheticsSuiteTypes } from "./SyntheticsSuiteTypes"; + +export class SuiteCreateEdit { + /** + * Object containing details about a Synthetic suite. + */ + "attributes": SyntheticsSuite; + /** + * Type for the Synthetics suites responses, `suites`. + */ + "type": SyntheticsSuiteTypes; + /** + * 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: "SyntheticsSuite", + required: true, + }, + type: { + baseName: "type", + type: "SyntheticsSuiteTypes", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SuiteCreateEdit.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/SuiteCreateEditRequest.ts b/services/synthetics/src/v2/models/SuiteCreateEditRequest.ts new file mode 100644 index 000000000000..fc08c7e0734f --- /dev/null +++ b/services/synthetics/src/v2/models/SuiteCreateEditRequest.ts @@ -0,0 +1,41 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SuiteCreateEdit } from "./SuiteCreateEdit"; + +export class SuiteCreateEditRequest { + "data": SuiteCreateEdit; + /** + * 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: "SuiteCreateEdit", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SuiteCreateEditRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/SuiteSearchResponseType.ts b/services/synthetics/src/v2/models/SuiteSearchResponseType.ts new file mode 100644 index 000000000000..629a0c7250c9 --- /dev/null +++ b/services/synthetics/src/v2/models/SuiteSearchResponseType.ts @@ -0,0 +1,3 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; +export type SuiteSearchResponseType = typeof SUITES_SEARCH | UnparsedObject; +export const SUITES_SEARCH = "suites_search"; diff --git a/services/synthetics/src/v2/models/SyntheticsSuite.ts b/services/synthetics/src/v2/models/SyntheticsSuite.ts new file mode 100644 index 000000000000..14bb0de3e536 --- /dev/null +++ b/services/synthetics/src/v2/models/SyntheticsSuite.ts @@ -0,0 +1,98 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SyntheticsSuiteOptions } from "./SyntheticsSuiteOptions"; +import { SyntheticsSuiteTest } from "./SyntheticsSuiteTest"; +import { SyntheticsSuiteType } from "./SyntheticsSuiteType"; + +/** + * Object containing details about a Synthetic suite. + */ +export class SyntheticsSuite { + /** + * Notification message associated with the suite. + */ + "message": string; + /** + * Name of the suite. + */ + "name": string; + /** + * Object describing the extra options for a Synthetic suite. + */ + "options": SyntheticsSuiteOptions; + /** + * The public ID for the test. + */ + "publicId"?: string; + /** + * Array of tags attached to the suite. + */ + "tags"?: Array; + "tests": Array; + /** + * Type of the Synthetic suite, `suite`. + */ + "type": SyntheticsSuiteType; + /** + * 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 = { + message: { + baseName: "message", + type: "string", + required: true, + }, + name: { + baseName: "name", + type: "string", + required: true, + }, + options: { + baseName: "options", + type: "SyntheticsSuiteOptions", + required: true, + }, + publicId: { + baseName: "public_id", + type: "string", + }, + tags: { + baseName: "tags", + type: "Array", + }, + tests: { + baseName: "tests", + type: "Array", + required: true, + }, + type: { + baseName: "type", + type: "SyntheticsSuiteType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsSuite.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/SyntheticsSuiteOptions.ts b/services/synthetics/src/v2/models/SyntheticsSuiteOptions.ts new file mode 100644 index 000000000000..6c022631e655 --- /dev/null +++ b/services/synthetics/src/v2/models/SyntheticsSuiteOptions.ts @@ -0,0 +1,45 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Object describing the extra options for a Synthetic suite. + */ +export class SyntheticsSuiteOptions { + /** + * Percentage of critical tests failure needed for a suite to fail. + */ + "alertingThreshold"?: 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 = { + alertingThreshold: { + baseName: "alerting_threshold", + type: "number", + format: "double", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsSuiteOptions.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/SyntheticsSuiteResponse.ts b/services/synthetics/src/v2/models/SyntheticsSuiteResponse.ts new file mode 100644 index 000000000000..aa831b42538c --- /dev/null +++ b/services/synthetics/src/v2/models/SyntheticsSuiteResponse.ts @@ -0,0 +1,46 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SyntheticsSuiteResponseData } from "./SyntheticsSuiteResponseData"; + +/** + * Synthetics suite response + */ +export class SyntheticsSuiteResponse { + /** + * Synthetics suite response data + */ + "data"?: SyntheticsSuiteResponseData; + /** + * 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: "SyntheticsSuiteResponseData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsSuiteResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/SyntheticsSuiteResponseData.ts b/services/synthetics/src/v2/models/SyntheticsSuiteResponseData.ts new file mode 100644 index 000000000000..bebfcc3da5a8 --- /dev/null +++ b/services/synthetics/src/v2/models/SyntheticsSuiteResponseData.ts @@ -0,0 +1,46 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SyntheticsSuite } from "./SyntheticsSuite"; + +/** + * Synthetics suite response data + */ +export class SyntheticsSuiteResponseData { + /** + * Object containing details about a Synthetic suite. + */ + "attributes"?: SyntheticsSuite; + /** + * 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: "SyntheticsSuite", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsSuiteResponseData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/SyntheticsSuiteSearchResponse.ts b/services/synthetics/src/v2/models/SyntheticsSuiteSearchResponse.ts new file mode 100644 index 000000000000..0987d49cf912 --- /dev/null +++ b/services/synthetics/src/v2/models/SyntheticsSuiteSearchResponse.ts @@ -0,0 +1,46 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SyntheticsSuiteSearchResponseData } from "./SyntheticsSuiteSearchResponseData"; + +/** + * Synthetics suite search response + */ +export class SyntheticsSuiteSearchResponse { + /** + * Synthetics suite search response data + */ + "data"?: SyntheticsSuiteSearchResponseData; + /** + * 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: "SyntheticsSuiteSearchResponseData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsSuiteSearchResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/SyntheticsSuiteSearchResponseData.ts b/services/synthetics/src/v2/models/SyntheticsSuiteSearchResponseData.ts new file mode 100644 index 000000000000..48ca17d9fe4c --- /dev/null +++ b/services/synthetics/src/v2/models/SyntheticsSuiteSearchResponseData.ts @@ -0,0 +1,58 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SuiteSearchResponseType } from "./SuiteSearchResponseType"; +import { SyntheticsSuiteSearchResponseDataAttributes } from "./SyntheticsSuiteSearchResponseDataAttributes"; + +/** + * Synthetics suite search response data + */ +export class SyntheticsSuiteSearchResponseData { + /** + * Synthetics suite search response data attributes + */ + "attributes"?: SyntheticsSuiteSearchResponseDataAttributes; + "id"?: string; + "type"?: SuiteSearchResponseType; + /** + * 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: "SyntheticsSuiteSearchResponseDataAttributes", + }, + id: { + baseName: "id", + type: "string", + format: "uuid", + }, + type: { + baseName: "type", + type: "SuiteSearchResponseType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsSuiteSearchResponseData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/SyntheticsSuiteSearchResponseDataAttributes.ts b/services/synthetics/src/v2/models/SyntheticsSuiteSearchResponseDataAttributes.ts new file mode 100644 index 000000000000..816fd588d8fb --- /dev/null +++ b/services/synthetics/src/v2/models/SyntheticsSuiteSearchResponseDataAttributes.ts @@ -0,0 +1,49 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SyntheticsSuite } from "./SyntheticsSuite"; + +/** + * Synthetics suite search response data attributes + */ +export class SyntheticsSuiteSearchResponseDataAttributes { + "suites"?: Array; + "total"?: 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 = { + suites: { + baseName: "suites", + type: "Array", + }, + total: { + baseName: "total", + type: "number", + format: "int32", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsSuiteSearchResponseDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/SyntheticsSuiteTest.ts b/services/synthetics/src/v2/models/SyntheticsSuiteTest.ts new file mode 100644 index 000000000000..426037414a2e --- /dev/null +++ b/services/synthetics/src/v2/models/SyntheticsSuiteTest.ts @@ -0,0 +1,52 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SyntheticsSuiteTestAlertingCriticality } from "./SyntheticsSuiteTestAlertingCriticality"; + +/** + * Object containing details about a Synthetic test included in a Synthetic suite. + */ +export class SyntheticsSuiteTest { + /** + * Alerting criticality for each the test. + */ + "alertingCriticality"?: SyntheticsSuiteTestAlertingCriticality; + "publicId": 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 = { + alertingCriticality: { + baseName: "alerting_criticality", + type: "SyntheticsSuiteTestAlertingCriticality", + }, + publicId: { + baseName: "public_id", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsSuiteTest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/SyntheticsSuiteTestAlertingCriticality.ts b/services/synthetics/src/v2/models/SyntheticsSuiteTestAlertingCriticality.ts new file mode 100644 index 000000000000..2d1e11432646 --- /dev/null +++ b/services/synthetics/src/v2/models/SyntheticsSuiteTestAlertingCriticality.ts @@ -0,0 +1,11 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * Alerting criticality for each the test. + */ +export type SyntheticsSuiteTestAlertingCriticality = + | typeof IGNORE + | typeof CRITICAL + | UnparsedObject; +export const IGNORE = "ignore"; +export const CRITICAL = "critical"; diff --git a/services/synthetics/src/v2/models/SyntheticsSuiteType.ts b/services/synthetics/src/v2/models/SyntheticsSuiteType.ts new file mode 100644 index 000000000000..2d53589a7d7f --- /dev/null +++ b/services/synthetics/src/v2/models/SyntheticsSuiteType.ts @@ -0,0 +1,7 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * Type of the Synthetic suite, `suite`. + */ +export type SyntheticsSuiteType = typeof SUITE | UnparsedObject; +export const SUITE = "suite"; diff --git a/services/synthetics/src/v2/models/SyntheticsSuiteTypes.ts b/services/synthetics/src/v2/models/SyntheticsSuiteTypes.ts new file mode 100644 index 000000000000..50fe74b7d2b5 --- /dev/null +++ b/services/synthetics/src/v2/models/SyntheticsSuiteTypes.ts @@ -0,0 +1,7 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * Type for the Synthetics suites responses, `suites`. + */ +export type SyntheticsSuiteTypes = typeof SUITES | UnparsedObject; +export const SUITES = "suites"; diff --git a/services/synthetics/src/v2/models/TypingInfo.ts b/services/synthetics/src/v2/models/TypingInfo.ts index efc37672a99f..8ff6654e1cd7 100644 --- a/services/synthetics/src/v2/models/TypingInfo.ts +++ b/services/synthetics/src/v2/models/TypingInfo.ts @@ -1,19 +1,57 @@ import { ModelTypingInfo } from "@datadog/datadog-api-client"; import { APIErrorResponse } from "./APIErrorResponse"; +import { DeletedSuiteResponseData } from "./DeletedSuiteResponseData"; +import { DeletedSuiteResponseDataAttributes } from "./DeletedSuiteResponseDataAttributes"; +import { DeletedSuitesRequestDelete } from "./DeletedSuitesRequestDelete"; +import { DeletedSuitesRequestDeleteAttributes } from "./DeletedSuitesRequestDeleteAttributes"; +import { DeletedSuitesRequestDeleteRequest } from "./DeletedSuitesRequestDeleteRequest"; +import { DeletedSuitesResponse } from "./DeletedSuitesResponse"; import { OnDemandConcurrencyCap } from "./OnDemandConcurrencyCap"; import { OnDemandConcurrencyCapAttributes } from "./OnDemandConcurrencyCapAttributes"; import { OnDemandConcurrencyCapResponse } from "./OnDemandConcurrencyCapResponse"; +import { SuiteCreateEdit } from "./SuiteCreateEdit"; +import { SuiteCreateEditRequest } from "./SuiteCreateEditRequest"; +import { SyntheticsSuite } from "./SyntheticsSuite"; +import { SyntheticsSuiteOptions } from "./SyntheticsSuiteOptions"; +import { SyntheticsSuiteResponse } from "./SyntheticsSuiteResponse"; +import { SyntheticsSuiteResponseData } from "./SyntheticsSuiteResponseData"; +import { SyntheticsSuiteSearchResponse } from "./SyntheticsSuiteSearchResponse"; +import { SyntheticsSuiteSearchResponseData } from "./SyntheticsSuiteSearchResponseData"; +import { SyntheticsSuiteSearchResponseDataAttributes } from "./SyntheticsSuiteSearchResponseDataAttributes"; +import { SyntheticsSuiteTest } from "./SyntheticsSuiteTest"; export const TypingInfo: ModelTypingInfo = { enumsMap: { + DeletedSuitesRequestType: ["delete_suites_request"], OnDemandConcurrencyCapType: ["on_demand_concurrency_cap"], + SuiteSearchResponseType: ["suites_search"], + SyntheticsSuiteTestAlertingCriticality: ["ignore", "critical"], + SyntheticsSuiteType: ["suite"], + SyntheticsSuiteTypes: ["suites"], }, oneOfMap: {}, typeMap: { APIErrorResponse: APIErrorResponse, + DeletedSuiteResponseData: DeletedSuiteResponseData, + DeletedSuiteResponseDataAttributes: DeletedSuiteResponseDataAttributes, + DeletedSuitesRequestDelete: DeletedSuitesRequestDelete, + DeletedSuitesRequestDeleteAttributes: DeletedSuitesRequestDeleteAttributes, + DeletedSuitesRequestDeleteRequest: DeletedSuitesRequestDeleteRequest, + DeletedSuitesResponse: DeletedSuitesResponse, OnDemandConcurrencyCap: OnDemandConcurrencyCap, OnDemandConcurrencyCapAttributes: OnDemandConcurrencyCapAttributes, OnDemandConcurrencyCapResponse: OnDemandConcurrencyCapResponse, + SuiteCreateEdit: SuiteCreateEdit, + SuiteCreateEditRequest: SuiteCreateEditRequest, + SyntheticsSuite: SyntheticsSuite, + SyntheticsSuiteOptions: SyntheticsSuiteOptions, + SyntheticsSuiteResponse: SyntheticsSuiteResponse, + SyntheticsSuiteResponseData: SyntheticsSuiteResponseData, + SyntheticsSuiteSearchResponse: SyntheticsSuiteSearchResponse, + SyntheticsSuiteSearchResponseData: SyntheticsSuiteSearchResponseData, + SyntheticsSuiteSearchResponseDataAttributes: + SyntheticsSuiteSearchResponseDataAttributes, + SyntheticsSuiteTest: SyntheticsSuiteTest, }, };