diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index eea8d903b4de..d20d3c8f43c0 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -17028,6 +17028,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: @@ -52844,6 +52908,162 @@ 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 + 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. @@ -84630,6 +84850,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/examples/v2/synthetics/CreateSyntheticsSuite.ts b/examples/v2/synthetics/CreateSyntheticsSuite.ts new file mode 100644 index 000000000000..998a08e0ef1d --- /dev/null +++ b/examples/v2/synthetics/CreateSyntheticsSuite.ts @@ -0,0 +1,33 @@ +/** + * Synthetics: Create a test suite returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.SyntheticsApi(configuration); + +const params: v2.SyntheticsApiCreateSyntheticsSuiteRequest = { + body: { + data: { + attributes: { + message: "Notification message", + name: "Example suite name", + options: {}, + tags: ["env:production"], + tests: [], + type: "suite", + }, + type: "suites", + }, + }, +}; + +apiInstance + .createSyntheticsSuite(params) + .then((data: v2.SyntheticsSuiteResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/synthetics/DeleteSyntheticsSuites.ts b/examples/v2/synthetics/DeleteSyntheticsSuites.ts new file mode 100644 index 000000000000..e5b2d12ecb24 --- /dev/null +++ b/examples/v2/synthetics/DeleteSyntheticsSuites.ts @@ -0,0 +1,28 @@ +/** + * Synthetics: Bulk delete suites returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.SyntheticsApi(configuration); + +const params: v2.SyntheticsApiDeleteSyntheticsSuitesRequest = { + body: { + data: { + attributes: { + publicIds: [""], + }, + type: "delete_suites_request", + }, + }, +}; + +apiInstance + .deleteSyntheticsSuites(params) + .then((data: v2.DeletedSuitesResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/synthetics/EditSyntheticsSuite.ts b/examples/v2/synthetics/EditSyntheticsSuite.ts new file mode 100644 index 000000000000..ffc6ec409197 --- /dev/null +++ b/examples/v2/synthetics/EditSyntheticsSuite.ts @@ -0,0 +1,39 @@ +/** + * Synthetics: edit a test suite returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.SyntheticsApi(configuration); + +const params: v2.SyntheticsApiEditSyntheticsSuiteRequest = { + body: { + data: { + attributes: { + message: "Notification message", + name: "Example suite name", + options: {}, + tags: ["env:production"], + tests: [ + { + alertingCriticality: "critical", + publicId: "", + }, + ], + type: "suite", + }, + type: "suites", + }, + }, + publicId: "public_id", +}; + +apiInstance + .editSyntheticsSuite(params) + .then((data: v2.SyntheticsSuiteResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/synthetics/GetSyntheticsSuite.ts b/examples/v2/synthetics/GetSyntheticsSuite.ts new file mode 100644 index 000000000000..dc0f6f81ae12 --- /dev/null +++ b/examples/v2/synthetics/GetSyntheticsSuite.ts @@ -0,0 +1,21 @@ +/** + * Synthetics: Get a suite returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.SyntheticsApi(configuration); + +const params: v2.SyntheticsApiGetSyntheticsSuiteRequest = { + publicId: "public_id", +}; + +apiInstance + .getSyntheticsSuite(params) + .then((data: v2.SyntheticsSuiteResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/synthetics/SearchSuites.ts b/examples/v2/synthetics/SearchSuites.ts new file mode 100644 index 000000000000..b1ba6d6f13cc --- /dev/null +++ b/examples/v2/synthetics/SearchSuites.ts @@ -0,0 +1,17 @@ +/** + * Search Synthetics suites returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.SyntheticsApi(configuration); + +apiInstance + .searchSuites() + .then((data: v2.SyntheticsSuiteSearchResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/features/support/scenarios_model_mapping.ts b/features/support/scenarios_model_mapping.ts index 1a3964394794..e75aeda0673e 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -8936,6 +8936,61 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "OnDemandConcurrencyCapResponse", }, + "v2.CreateSyntheticsSuite": { + "body": { + "type": "SuiteCreateEditRequest", + "format": "", + }, + "operationResponseType": "SyntheticsSuiteResponse", + }, + "v2.DeleteSyntheticsSuites": { + "body": { + "type": "DeletedSuitesRequestDeleteRequest", + "format": "", + }, + "operationResponseType": "DeletedSuitesResponse", + }, + "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", + }, + "v2.GetSyntheticsSuite": { + "publicId": { + "type": "string", + "format": "", + }, + "operationResponseType": "SyntheticsSuiteResponse", + }, + "v2.EditSyntheticsSuite": { + "publicId": { + "type": "string", + "format": "", + }, + "body": { + "type": "SuiteCreateEditRequest", + "format": "", + }, + "operationResponseType": "SyntheticsSuiteResponse", + }, "v2.ListTeams": { "pageNumber": { "type": "number", 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 396d52383628..c15ada6dccb7 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -4433,6 +4433,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/packages/datadog-api-client-v2/apis/SyntheticsApi.ts b/packages/datadog-api-client-v2/apis/SyntheticsApi.ts index 3dc8b39d8eb3..db440896674e 100644 --- a/packages/datadog-api-client-v2/apis/SyntheticsApi.ts +++ b/packages/datadog-api-client-v2/apis/SyntheticsApi.ts @@ -17,10 +17,150 @@ import { ObjectSerializer } from "../models/ObjectSerializer"; import { ApiException } from "../../datadog-api-client-common/exception"; 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"; export class SyntheticsApiRequestFactory extends BaseAPIRequestFactory { + 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 requestContext = _config + .getServer("v2.SyntheticsApi.createSyntheticsSuite") + .makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "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 requestContext = _config + .getServer("v2.SyntheticsApi.deleteSyntheticsSuites") + .makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "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 requestContext = _config + .getServer("v2.SyntheticsApi.editSyntheticsSuite") + .makeRequestContext(localVarPath, HttpMethod.PUT); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "SuiteCreateEditRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + public async getOnDemandConcurrencyCap( _options?: Configuration ): Promise { @@ -46,6 +186,107 @@ 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 requestContext = _config + .getServer("v2.SyntheticsApi.getSyntheticsSuite") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // 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 requestContext = _config + .getServer("v2.SyntheticsApi.searchSuites") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Query Params + if (query !== undefined) { + requestContext.setQueryParam( + "query", + ObjectSerializer.serialize(query, "string", ""), + "" + ); + } + if (sort !== undefined) { + requestContext.setQueryParam( + "sort", + ObjectSerializer.serialize(sort, "string", ""), + "" + ); + } + if (facetsOnly !== undefined) { + requestContext.setQueryParam( + "facets_only", + ObjectSerializer.serialize(facetsOnly, "boolean", ""), + "" + ); + } + if (start !== undefined) { + requestContext.setQueryParam( + "start", + ObjectSerializer.serialize(start, "number", "int64"), + "" + ); + } + if (count !== undefined) { + requestContext.setQueryParam( + "count", + ObjectSerializer.serialize(count, "number", "int64"), + "" + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + public async setOnDemandConcurrencyCap( body: OnDemandConcurrencyCapAttributes, _options?: Configuration @@ -90,6 +331,180 @@ export class SyntheticsApiRequestFactory extends BaseAPIRequestFactory { } 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 createSyntheticsSuite + * @throws ApiException if the response code was not in [200, 299] + */ + public async createSyntheticsSuite( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: SyntheticsSuiteResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SyntheticsSuiteResponse" + ) as SyntheticsSuiteResponse; + return body; + } + if (response.httpStatusCode === 400 || response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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 = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "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 deleteSyntheticsSuites + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteSyntheticsSuites( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: DeletedSuitesResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "DeletedSuitesResponse" + ) as DeletedSuitesResponse; + return body; + } + if (response.httpStatusCode === 400 || response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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: DeletedSuitesResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "DeletedSuitesResponse", + "" + ) as DeletedSuitesResponse; + 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 editSyntheticsSuite + * @throws ApiException if the response code was not in [200, 299] + */ + public async editSyntheticsSuite( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: SyntheticsSuiteResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SyntheticsSuiteResponse" + ) as SyntheticsSuiteResponse; + return body; + } + if (response.httpStatusCode === 400 || response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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 = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "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 @@ -148,6 +563,122 @@ 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 getSyntheticsSuite + * @throws ApiException if the response code was not in [200, 299] + */ + public async getSyntheticsSuite( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: SyntheticsSuiteResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SyntheticsSuiteResponse" + ) as SyntheticsSuiteResponse; + return body; + } + if (response.httpStatusCode === 404 || response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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 = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "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 = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: SyntheticsSuiteSearchResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SyntheticsSuiteSearchResponse" + ) as SyntheticsSuiteSearchResponse; + return body; + } + if (response.httpStatusCode === 400 || response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "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 = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "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 @@ -207,6 +738,69 @@ export class SyntheticsApiResponseProcessor { } } +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 { /** * . @@ -232,6 +826,67 @@ export class SyntheticsApi { 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 @@ -252,6 +907,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/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index be08d75ee1a4..682cfae69afd 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -882,6 +882,11 @@ export { } from "./apis/StaticAnalysisApi"; export { + SyntheticsApiCreateSyntheticsSuiteRequest, + SyntheticsApiDeleteSyntheticsSuitesRequest, + SyntheticsApiEditSyntheticsSuiteRequest, + SyntheticsApiGetSyntheticsSuiteRequest, + SyntheticsApiSearchSuitesRequest, SyntheticsApiSetOnDemandConcurrencyCapRequest, SyntheticsApi, } from "./apis/SyntheticsApi"; @@ -1928,6 +1933,13 @@ export { DeleteAppsRequestDataItems } from "./models/DeleteAppsRequestDataItems" export { DeleteAppsResponse } from "./models/DeleteAppsResponse"; export { DeleteAppsResponseDataItems } from "./models/DeleteAppsResponseDataItems"; export { DeleteCustomFrameworkResponse } from "./models/DeleteCustomFrameworkResponse"; +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 { DependencyLocation } from "./models/DependencyLocation"; export { Deployment } from "./models/Deployment"; export { DeploymentAttributes } from "./models/DeploymentAttributes"; @@ -4278,6 +4290,20 @@ export { StatsigIntegrationUpdate } from "./models/StatsigIntegrationUpdate"; export { Step } from "./models/Step"; export { StepDisplay } from "./models/StepDisplay"; export { StepDisplayBounds } from "./models/StepDisplayBounds"; +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"; export { TableResultV2 } from "./models/TableResultV2"; export { TableResultV2Array } from "./models/TableResultV2Array"; export { TableResultV2Data } from "./models/TableResultV2Data"; diff --git a/packages/datadog-api-client-v2/models/DeletedSuiteResponseData.ts b/packages/datadog-api-client-v2/models/DeletedSuiteResponseData.ts new file mode 100644 index 000000000000..ed4fad70eccd --- /dev/null +++ b/packages/datadog-api-client-v2/models/DeletedSuiteResponseData.ts @@ -0,0 +1,61 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { DeletedSuiteResponseDataAttributes } from "./DeletedSuiteResponseDataAttributes"; +import { SyntheticsSuiteTypes } from "./SyntheticsSuiteTypes"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +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/packages/datadog-api-client-v2/models/DeletedSuiteResponseDataAttributes.ts b/packages/datadog-api-client-v2/models/DeletedSuiteResponseDataAttributes.ts new file mode 100644 index 000000000000..5966a241f76f --- /dev/null +++ b/packages/datadog-api-client-v2/models/DeletedSuiteResponseDataAttributes.ts @@ -0,0 +1,57 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +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/packages/datadog-api-client-v2/models/DeletedSuitesRequestDelete.ts b/packages/datadog-api-client-v2/models/DeletedSuitesRequestDelete.ts new file mode 100644 index 000000000000..fa1e0922b077 --- /dev/null +++ b/packages/datadog-api-client-v2/models/DeletedSuitesRequestDelete.ts @@ -0,0 +1,59 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { DeletedSuitesRequestDeleteAttributes } from "./DeletedSuitesRequestDeleteAttributes"; +import { DeletedSuitesRequestType } from "./DeletedSuitesRequestType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +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/packages/datadog-api-client-v2/models/DeletedSuitesRequestDeleteAttributes.ts b/packages/datadog-api-client-v2/models/DeletedSuitesRequestDeleteAttributes.ts new file mode 100644 index 000000000000..60623bfe3514 --- /dev/null +++ b/packages/datadog-api-client-v2/models/DeletedSuitesRequestDeleteAttributes.ts @@ -0,0 +1,52 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +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/packages/datadog-api-client-v2/models/DeletedSuitesRequestDeleteRequest.ts b/packages/datadog-api-client-v2/models/DeletedSuitesRequestDeleteRequest.ts new file mode 100644 index 000000000000..eb3374e6a71f --- /dev/null +++ b/packages/datadog-api-client-v2/models/DeletedSuitesRequestDeleteRequest.ts @@ -0,0 +1,48 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { DeletedSuitesRequestDelete } from "./DeletedSuitesRequestDelete"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +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/packages/datadog-api-client-v2/models/DeletedSuitesRequestType.ts b/packages/datadog-api-client-v2/models/DeletedSuitesRequestType.ts new file mode 100644 index 000000000000..b4693ed2cd8b --- /dev/null +++ b/packages/datadog-api-client-v2/models/DeletedSuitesRequestType.ts @@ -0,0 +1,12 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +export type DeletedSuitesRequestType = + | typeof DELETE_SUITES_REQUEST + | UnparsedObject; +export const DELETE_SUITES_REQUEST = "delete_suites_request"; diff --git a/packages/datadog-api-client-v2/models/DeletedSuitesResponse.ts b/packages/datadog-api-client-v2/models/DeletedSuitesResponse.ts new file mode 100644 index 000000000000..45b315e5e615 --- /dev/null +++ b/packages/datadog-api-client-v2/models/DeletedSuitesResponse.ts @@ -0,0 +1,47 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { DeletedSuiteResponseData } from "./DeletedSuiteResponseData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +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/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index 6a4de45be2d7..cc661499eab3 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -755,6 +755,12 @@ import { DeleteAppsRequestDataItems } from "./DeleteAppsRequestDataItems"; import { DeleteAppsResponse } from "./DeleteAppsResponse"; import { DeleteAppsResponseDataItems } from "./DeleteAppsResponseDataItems"; import { DeleteCustomFrameworkResponse } from "./DeleteCustomFrameworkResponse"; +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 { DependencyLocation } from "./DependencyLocation"; import { Deployment } from "./Deployment"; import { DeploymentAttributes } from "./DeploymentAttributes"; @@ -2480,6 +2486,16 @@ import { StatsigIntegrationUpdate } from "./StatsigIntegrationUpdate"; import { Step } from "./Step"; import { StepDisplay } from "./StepDisplay"; import { StepDisplayBounds } from "./StepDisplayBounds"; +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"; import { TableResultV2 } from "./TableResultV2"; import { TableResultV2Array } from "./TableResultV2Array"; import { TableResultV2Data } from "./TableResultV2Data"; @@ -3145,6 +3161,7 @@ const enumsMap: { [key: string]: any[] } = { DatastoreItemConflictMode: ["fail_on_conflict", "overwrite_on_conflict"], DatastoreItemsDataType: ["items"], DatastorePrimaryKeyGenerationStrategy: ["none", "uuid"], + DeletedSuitesRequestType: ["delete_suites_request"], DeploymentGateDataType: ["deployment_gate"], DeploymentRuleDataType: ["deployment_rule"], DeploymentRuleResponseDataAttributesType: [ @@ -4211,6 +4228,10 @@ const enumsMap: { [key: string]: any[] } = { StateVariableType: ["stateVariable"], StatsigAPIKeyType: ["StatsigAPIKey"], StatsigIntegrationType: ["Statsig"], + SuiteSearchResponseType: ["suites_search"], + SyntheticsSuiteTestAlertingCriticality: ["ignore", "critical"], + SyntheticsSuiteType: ["suite"], + SyntheticsSuiteTypes: ["suites"], TableResultV2DataAttributesFileMetadataCloudStorageErrorType: [ "TABLE_SCHEMA_ERROR", "FILE_FORMAT_ERROR", @@ -5307,6 +5328,12 @@ const typeMap: { [index: string]: any } = { DeleteAppsResponse: DeleteAppsResponse, DeleteAppsResponseDataItems: DeleteAppsResponseDataItems, DeleteCustomFrameworkResponse: DeleteCustomFrameworkResponse, + DeletedSuiteResponseData: DeletedSuiteResponseData, + DeletedSuiteResponseDataAttributes: DeletedSuiteResponseDataAttributes, + DeletedSuitesRequestDelete: DeletedSuitesRequestDelete, + DeletedSuitesRequestDeleteAttributes: DeletedSuitesRequestDeleteAttributes, + DeletedSuitesRequestDeleteRequest: DeletedSuitesRequestDeleteRequest, + DeletedSuitesResponse: DeletedSuitesResponse, DependencyLocation: DependencyLocation, Deployment: Deployment, DeploymentAttributes: DeploymentAttributes, @@ -7349,6 +7376,17 @@ const typeMap: { [index: string]: any } = { Step: Step, StepDisplay: StepDisplay, StepDisplayBounds: StepDisplayBounds, + SuiteCreateEdit: SuiteCreateEdit, + SuiteCreateEditRequest: SuiteCreateEditRequest, + SyntheticsSuite: SyntheticsSuite, + SyntheticsSuiteOptions: SyntheticsSuiteOptions, + SyntheticsSuiteResponse: SyntheticsSuiteResponse, + SyntheticsSuiteResponseData: SyntheticsSuiteResponseData, + SyntheticsSuiteSearchResponse: SyntheticsSuiteSearchResponse, + SyntheticsSuiteSearchResponseData: SyntheticsSuiteSearchResponseData, + SyntheticsSuiteSearchResponseDataAttributes: + SyntheticsSuiteSearchResponseDataAttributes, + SyntheticsSuiteTest: SyntheticsSuiteTest, TableResultV2: TableResultV2, TableResultV2Array: TableResultV2Array, TableResultV2Data: TableResultV2Data, diff --git a/packages/datadog-api-client-v2/models/SuiteCreateEdit.ts b/packages/datadog-api-client-v2/models/SuiteCreateEdit.ts new file mode 100644 index 000000000000..cb9a63ac5414 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SuiteCreateEdit.ts @@ -0,0 +1,61 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SyntheticsSuite } from "./SyntheticsSuite"; +import { SyntheticsSuiteTypes } from "./SyntheticsSuiteTypes"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +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/packages/datadog-api-client-v2/models/SuiteCreateEditRequest.ts b/packages/datadog-api-client-v2/models/SuiteCreateEditRequest.ts new file mode 100644 index 000000000000..ba3506f2f633 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SuiteCreateEditRequest.ts @@ -0,0 +1,48 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SuiteCreateEdit } from "./SuiteCreateEdit"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +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/packages/datadog-api-client-v2/models/SuiteSearchResponseType.ts b/packages/datadog-api-client-v2/models/SuiteSearchResponseType.ts new file mode 100644 index 000000000000..60075144a3c1 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SuiteSearchResponseType.ts @@ -0,0 +1,10 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +export type SuiteSearchResponseType = typeof SUITES_SEARCH | UnparsedObject; +export const SUITES_SEARCH = "suites_search"; diff --git a/packages/datadog-api-client-v2/models/SyntheticsSuite.ts b/packages/datadog-api-client-v2/models/SyntheticsSuite.ts new file mode 100644 index 000000000000..e54c2e95e4ee --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsSuite.ts @@ -0,0 +1,105 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SyntheticsSuiteOptions } from "./SyntheticsSuiteOptions"; +import { SyntheticsSuiteTest } from "./SyntheticsSuiteTest"; +import { SyntheticsSuiteType } from "./SyntheticsSuiteType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/SyntheticsSuiteOptions.ts b/packages/datadog-api-client-v2/models/SyntheticsSuiteOptions.ts new file mode 100644 index 000000000000..11f5a130a5d5 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsSuiteOptions.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/SyntheticsSuiteResponse.ts b/packages/datadog-api-client-v2/models/SyntheticsSuiteResponse.ts new file mode 100644 index 000000000000..b797656b80d7 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsSuiteResponse.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SyntheticsSuiteResponseData } from "./SyntheticsSuiteResponseData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/SyntheticsSuiteResponseData.ts b/packages/datadog-api-client-v2/models/SyntheticsSuiteResponseData.ts new file mode 100644 index 000000000000..8f4ea5de5741 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsSuiteResponseData.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SyntheticsSuite } from "./SyntheticsSuite"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/SyntheticsSuiteSearchResponse.ts b/packages/datadog-api-client-v2/models/SyntheticsSuiteSearchResponse.ts new file mode 100644 index 000000000000..7e24b18e78f6 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsSuiteSearchResponse.ts @@ -0,0 +1,53 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SyntheticsSuiteSearchResponseData } from "./SyntheticsSuiteSearchResponseData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/SyntheticsSuiteSearchResponseData.ts b/packages/datadog-api-client-v2/models/SyntheticsSuiteSearchResponseData.ts new file mode 100644 index 000000000000..9a860d95cbd0 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsSuiteSearchResponseData.ts @@ -0,0 +1,65 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SuiteSearchResponseType } from "./SuiteSearchResponseType"; +import { SyntheticsSuiteSearchResponseDataAttributes } from "./SyntheticsSuiteSearchResponseDataAttributes"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/SyntheticsSuiteSearchResponseDataAttributes.ts b/packages/datadog-api-client-v2/models/SyntheticsSuiteSearchResponseDataAttributes.ts new file mode 100644 index 000000000000..dadff6d0eb0f --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsSuiteSearchResponseDataAttributes.ts @@ -0,0 +1,56 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SyntheticsSuite } from "./SyntheticsSuite"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/SyntheticsSuiteTest.ts b/packages/datadog-api-client-v2/models/SyntheticsSuiteTest.ts new file mode 100644 index 000000000000..584f2c6f8f3a --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsSuiteTest.ts @@ -0,0 +1,59 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ +import { SyntheticsSuiteTestAlertingCriticality } from "./SyntheticsSuiteTestAlertingCriticality"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/SyntheticsSuiteTestAlertingCriticality.ts b/packages/datadog-api-client-v2/models/SyntheticsSuiteTestAlertingCriticality.ts new file mode 100644 index 000000000000..68300afe7e71 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsSuiteTestAlertingCriticality.ts @@ -0,0 +1,18 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/SyntheticsSuiteType.ts b/packages/datadog-api-client-v2/models/SyntheticsSuiteType.ts new file mode 100644 index 000000000000..bd15b9d21205 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsSuiteType.ts @@ -0,0 +1,14 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Type of the Synthetic suite, `suite`. + */ + +export type SyntheticsSuiteType = typeof SUITE | UnparsedObject; +export const SUITE = "suite"; diff --git a/packages/datadog-api-client-v2/models/SyntheticsSuiteTypes.ts b/packages/datadog-api-client-v2/models/SyntheticsSuiteTypes.ts new file mode 100644 index 000000000000..937f41c5f504 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsSuiteTypes.ts @@ -0,0 +1,14 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Type for the Synthetics suites responses, `suites`. + */ + +export type SyntheticsSuiteTypes = typeof SUITES | UnparsedObject; +export const SUITES = "suites";