From 670c3f1717cd3c4ec249248b524721ed8b627d31 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 30 Mar 2026 08:30:58 +0000 Subject: [PATCH] Regenerate client from commit 962dc50 of spec repo --- .generator/schemas/v2/openapi.yaml | 374 +++++++++ features/v2/synthetics.feature | 64 ++ features/v2/undo.json | 24 + .../src/support/scenarios_model_mapping.ts | 44 ++ services/synthetics/src/v2/SyntheticsApi.ts | 718 +++++++++++++++++- services/synthetics/src/v2/index.ts | 14 + ...ticsTestFileAbortMultipartUploadRequest.ts | 54 ++ ...ticsTestFileCompleteMultipartUploadPart.ts | 55 ++ ...sTestFileCompleteMultipartUploadRequest.ts | 65 ++ .../SyntheticsTestFileDownloadRequest.ts | 45 ++ .../SyntheticsTestFileDownloadResponse.ts | 44 ++ ...icsTestFileMultipartPresignedUrlsParams.ts | 60 ++ ...eticsTestFileMultipartPresignedUrlsPart.ts | 55 ++ ...csTestFileMultipartPresignedUrlsRequest.ts | 57 ++ ...partPresignedUrlsRequestBucketKeyPrefix.ts | 11 + ...sTestFileMultipartPresignedUrlsResponse.ts | 54 ++ .../synthetics/src/v2/models/TypingInfo.ts | 29 + 17 files changed, 1727 insertions(+), 40 deletions(-) create mode 100644 services/synthetics/src/v2/models/SyntheticsTestFileAbortMultipartUploadRequest.ts create mode 100644 services/synthetics/src/v2/models/SyntheticsTestFileCompleteMultipartUploadPart.ts create mode 100644 services/synthetics/src/v2/models/SyntheticsTestFileCompleteMultipartUploadRequest.ts create mode 100644 services/synthetics/src/v2/models/SyntheticsTestFileDownloadRequest.ts create mode 100644 services/synthetics/src/v2/models/SyntheticsTestFileDownloadResponse.ts create mode 100644 services/synthetics/src/v2/models/SyntheticsTestFileMultipartPresignedUrlsParams.ts create mode 100644 services/synthetics/src/v2/models/SyntheticsTestFileMultipartPresignedUrlsPart.ts create mode 100644 services/synthetics/src/v2/models/SyntheticsTestFileMultipartPresignedUrlsRequest.ts create mode 100644 services/synthetics/src/v2/models/SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix.ts create mode 100644 services/synthetics/src/v2/models/SyntheticsTestFileMultipartPresignedUrlsResponse.ts diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index ea8f0cd3e16b..eac2fa3c1792 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -65509,6 +65509,149 @@ components: type: string x-enum-varnames: - SUITES + SyntheticsTestFileAbortMultipartUploadRequest: + description: Request body for aborting a multipart file upload. + properties: + key: + description: The full storage path of the file whose upload should be aborted. + example: "org-123/api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json" + type: string + uploadId: + description: The upload ID of the multipart upload to abort. + example: "upload-id-abc123" + type: string + required: + - uploadId + - key + type: object + SyntheticsTestFileCompleteMultipartUploadPart: + description: A completed part of a multipart upload. + properties: + ETag: + description: The ETag returned by the storage provider after uploading the part. + example: '"d41d8cd98f00b204e9800998ecf8427e"' + type: string + PartNumber: + description: The 1-indexed part number for the multipart upload. + example: 1 + format: int64 + type: integer + required: + - ETag + - PartNumber + type: object + SyntheticsTestFileCompleteMultipartUploadRequest: + description: Request body for completing a multipart file upload. + properties: + key: + description: The full storage path for the uploaded file. + example: "org-123/api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json" + type: string + parts: + description: Array of completed parts with their ETags. + items: + $ref: "#/components/schemas/SyntheticsTestFileCompleteMultipartUploadPart" + type: array + uploadId: + description: The upload ID returned when the multipart upload was initiated. + example: "upload-id-abc123" + type: string + required: + - uploadId + - key + - parts + type: object + SyntheticsTestFileDownloadRequest: + description: Request body for getting a presigned download URL for a test file. + properties: + bucketKey: + description: The bucket key referencing the file to download. + example: "api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json" + minLength: 1 + type: string + required: + - bucketKey + type: object + SyntheticsTestFileDownloadResponse: + description: Response containing a presigned URL for downloading a test file. + properties: + url: + description: A presigned URL to download the file. The URL expires after a short period. + example: "https://storage.example.com/presigned-download-url" + type: string + type: object + SyntheticsTestFileMultipartPresignedUrlsParams: + description: Presigned URL parameters returned for a multipart upload. + properties: + key: + description: The full storage path for the file being uploaded. + example: "org-123/api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json" + type: string + upload_id: + description: The upload ID assigned by the storage provider for this multipart upload. + example: "upload-id-abc123" + type: string + urls: + additionalProperties: + type: string + description: A map of part numbers to presigned upload URLs. + example: + "1": "https://storage.example.com/presigned-upload-url-part-1" + "2": "https://storage.example.com/presigned-upload-url-part-2" + type: object + type: object + SyntheticsTestFileMultipartPresignedUrlsPart: + description: A part descriptor for initiating a multipart upload. + properties: + md5: + description: Base64-encoded MD5 digest of the part content. + example: "1B2M2Y8AsgTpgAmY7PhCfg==" + maxLength: 24 + minLength: 22 + type: string + partNumber: + description: The 1-indexed part number for the multipart upload. + example: 1 + format: int64 + type: integer + required: + - md5 + - partNumber + type: object + SyntheticsTestFileMultipartPresignedUrlsRequest: + description: Request body for getting presigned URLs for a multipart file upload. + properties: + bucketKeyPrefix: + $ref: "#/components/schemas/SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix" + parts: + description: Array of part descriptors for the multipart upload. + items: + $ref: "#/components/schemas/SyntheticsTestFileMultipartPresignedUrlsPart" + type: array + required: + - bucketKeyPrefix + - parts + type: object + SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix: + description: The bucket key prefix indicating the type of file upload. + enum: + - api-upload-file + - browser-upload-file-step + example: "api-upload-file" + type: string + x-enum-varnames: + - API_UPLOAD_FILE + - BROWSER_UPLOAD_FILE_STEP + SyntheticsTestFileMultipartPresignedUrlsResponse: + description: Response containing presigned URLs for multipart file upload and the bucket key. + properties: + bucketKey: + description: The bucket key that references the uploaded file after completion. + example: "api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json" + type: string + multipart_presigned_urls_params: + $ref: "#/components/schemas/SyntheticsTestFileMultipartPresignedUrlsParams" + type: object SyntheticsTestOptions: description: Object describing the extra options for a Synthetic test. properties: @@ -107394,6 +107537,237 @@ paths: permissions: - synthetics_write - synthetics_create_edit_trigger + /api/v2/synthetics/tests/{public_id}/files/download: + post: + description: |- + Get a presigned URL to download a file attached to a Synthetic test. + The returned URL is temporary and expires after a short period. + operationId: GetTestFileDownloadUrl + parameters: + - description: The public ID of the Synthetic test. + in: path + name: public_id + required: true + schema: + example: abc-def-123 + type: string + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/SyntheticsTestFileDownloadRequest" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/SyntheticsTestFileDownloadResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden. + "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: Get a presigned URL for downloading a test file + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_read + /api/v2/synthetics/tests/{public_id}/files/multipart-presigned-urls: + post: + description: |- + Get presigned URLs for uploading a file to a Synthetic test using multipart upload. + Returns the presigned URLs for each part along with the bucket key that references the file. + operationId: GetTestFileMultipartPresignedUrls + parameters: + - description: The public ID of the Synthetic test. + in: path + name: public_id + required: true + schema: + example: abc-def-123 + type: string + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/SyntheticsTestFileMultipartPresignedUrlsRequest" + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/SyntheticsTestFileMultipartPresignedUrlsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden. + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_write + summary: Get presigned URLs for uploading a test file + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_write + - synthetics_create_edit_trigger + /api/v2/synthetics/tests/{public_id}/files/multipart-upload-abort: + post: + description: |- + Abort an in-progress multipart file upload for a Synthetic test. This cancels the upload + and releases any storage used by already-uploaded parts. + operationId: AbortTestFileMultipartUpload + parameters: + - description: The public ID of the Synthetic test. + in: path + name: public_id + required: true + schema: + example: abc-def-123 + type: string + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/SyntheticsTestFileAbortMultipartUploadRequest" + required: true + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden. + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_write + summary: Abort a multipart upload of a test file + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_write + - synthetics_create_edit_trigger + /api/v2/synthetics/tests/{public_id}/files/multipart-upload-complete: + post: + description: |- + Complete a multipart file upload for a Synthetic test. Call this endpoint after all parts + have been uploaded using the presigned URLs obtained from the multipart presigned URLs endpoint. + operationId: CompleteTestFileMultipartUpload + parameters: + - description: The public ID of the Synthetic test. + in: path + name: public_id + required: true + schema: + example: abc-def-123 + type: string + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/SyntheticsTestFileCompleteMultipartUploadRequest" + required: true + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden. + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_write + summary: Complete a multipart upload of a test file + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_write + - synthetics_create_edit_trigger /api/v2/synthetics/tests/{public_id}/parent-suites: get: description: Get the list of parent suites and their status for a given Synthetic test. diff --git a/features/v2/synthetics.feature b/features/v2/synthetics.feature index 8ed9b98adf40..2cdf9231fbc6 100644 --- a/features/v2/synthetics.feature +++ b/features/v2/synthetics.feature @@ -17,6 +17,22 @@ Feature: Synthetics And a valid "appKeyAuth" key in the system And an instance of "Synthetics" API + @generated @skip @team:DataDog/synthetics-managing + Scenario: Abort a multipart upload of a test file returns "API error response." response + Given new "AbortTestFileMultipartUpload" request + And request contains "public_id" parameter from "REPLACE.ME" + And body with value {"key": "org-123/api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json", "uploadId": "upload-id-abc123"} + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Abort a multipart upload of a test file returns "No Content" response + Given new "AbortTestFileMultipartUpload" request + And request contains "public_id" parameter from "REPLACE.ME" + And body with value {"key": "org-123/api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json", "uploadId": "upload-id-abc123"} + When the request is sent + Then the response status is 204 No Content + @generated @skip @team:DataDog/synthetics-managing Scenario: Bulk delete suites returns "API error response." response Given new "DeleteSyntheticsSuites" request @@ -45,6 +61,22 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing + Scenario: Complete a multipart upload of a test file returns "API error response." response + Given new "CompleteTestFileMultipartUpload" request + And request contains "public_id" parameter from "REPLACE.ME" + And body with value {"key": "org-123/api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json", "parts": [{"ETag": "\"d41d8cd98f00b204e9800998ecf8427e\"", "PartNumber": 1}], "uploadId": "upload-id-abc123"} + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Complete a multipart upload of a test file returns "No Content" response + Given new "CompleteTestFileMultipartUpload" request + And request contains "public_id" parameter from "REPLACE.ME" + And body with value {"key": "org-123/api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json", "parts": [{"ETag": "\"d41d8cd98f00b204e9800998ecf8427e\"", "PartNumber": 1}], "uploadId": "upload-id-abc123"} + When the request is sent + Then the response status is 204 No Content + @generated @skip @team:DataDog/synthetics-managing Scenario: Create a Network Path test returns "API error response." response Given new "CreateSyntheticsNetworkTest" request @@ -133,6 +165,22 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing + Scenario: Get a presigned URL for downloading a test file returns "API error response." response + Given new "GetTestFileDownloadUrl" request + And request contains "public_id" parameter from "REPLACE.ME" + And body with value {"bucketKey": "api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json"} + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Get a presigned URL for downloading a test file returns "OK" response + Given new "GetTestFileDownloadUrl" request + And request contains "public_id" parameter from "REPLACE.ME" + And body with value {"bucketKey": "api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json"} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing Scenario: Get a specific version of a test returns "API error response." response Given new "GetSyntheticsTestVersion" request @@ -198,6 +246,22 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing + Scenario: Get presigned URLs for uploading a test file returns "API error response." response + Given new "GetTestFileMultipartPresignedUrls" request + And request contains "public_id" parameter from "REPLACE.ME" + And body with value {"bucketKeyPrefix": "api-upload-file", "parts": [{"md5": "1B2M2Y8AsgTpgAmY7PhCfg==", "partNumber": 1}]} + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Get presigned URLs for uploading a test file returns "OK" response + Given new "GetTestFileMultipartPresignedUrls" request + And request contains "public_id" parameter from "REPLACE.ME" + And body with value {"bucketKeyPrefix": "api-upload-file", "parts": [{"md5": "1B2M2Y8AsgTpgAmY7PhCfg==", "partNumber": 1}]} + When the request is sent + Then the response status is 200 OK + @team:DataDog/synthetics-managing Scenario: Get the on-demand concurrency cap returns "OK" response Given new "GetOnDemandConcurrencyCap" request diff --git a/features/v2/undo.json b/features/v2/undo.json index dcdc0219f9ca..29b9dc1ab270 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -5913,6 +5913,30 @@ "type": "idempotent" } }, + "GetTestFileDownloadUrl": { + "tag": "Synthetics", + "undo": { + "type": "safe" + } + }, + "GetTestFileMultipartPresignedUrls": { + "tag": "Synthetics", + "undo": { + "type": "safe" + } + }, + "AbortTestFileMultipartUpload": { + "tag": "Synthetics", + "undo": { + "type": "safe" + } + }, + "CompleteTestFileMultipartUpload": { + "tag": "Synthetics", + "undo": { + "type": "safe" + } + }, "GetTestParentSuites": { "tag": "Synthetics", "undo": { diff --git a/private/bdd_runner/src/support/scenarios_model_mapping.ts b/private/bdd_runner/src/support/scenarios_model_mapping.ts index 5d2887effac2..8ac733fe0dac 100644 --- a/private/bdd_runner/src/support/scenarios_model_mapping.ts +++ b/private/bdd_runner/src/support/scenarios_model_mapping.ts @@ -11235,6 +11235,50 @@ export const ScenariosModelMappings: { [key: string]: OperationMapping } = { }, operationResponseType: "SyntheticsNetworkTestResponse", }, + "SyntheticsApi.V2.GetTestFileDownloadUrl": { + publicId: { + type: "string", + format: "", + }, + body: { + type: "SyntheticsTestFileDownloadRequest", + format: "", + }, + operationResponseType: "SyntheticsTestFileDownloadResponse", + }, + "SyntheticsApi.V2.GetTestFileMultipartPresignedUrls": { + publicId: { + type: "string", + format: "", + }, + body: { + type: "SyntheticsTestFileMultipartPresignedUrlsRequest", + format: "", + }, + operationResponseType: "SyntheticsTestFileMultipartPresignedUrlsResponse", + }, + "SyntheticsApi.V2.AbortTestFileMultipartUpload": { + publicId: { + type: "string", + format: "", + }, + body: { + type: "SyntheticsTestFileAbortMultipartUploadRequest", + format: "", + }, + operationResponseType: "{}", + }, + "SyntheticsApi.V2.CompleteTestFileMultipartUpload": { + publicId: { + type: "string", + format: "", + }, + body: { + type: "SyntheticsTestFileCompleteMultipartUploadRequest", + format: "", + }, + operationResponseType: "{}", + }, "SyntheticsApi.V2.GetTestParentSuites": { publicId: { type: "string", diff --git a/services/synthetics/src/v2/SyntheticsApi.ts b/services/synthetics/src/v2/SyntheticsApi.ts index 52b9f7a42265..f33f0f6941da 100644 --- a/services/synthetics/src/v2/SyntheticsApi.ts +++ b/services/synthetics/src/v2/SyntheticsApi.ts @@ -40,6 +40,12 @@ import { SyntheticsNetworkTestEditRequest } from "./models/SyntheticsNetworkTest import { SyntheticsNetworkTestResponse } from "./models/SyntheticsNetworkTestResponse"; import { SyntheticsSuiteResponse } from "./models/SyntheticsSuiteResponse"; import { SyntheticsSuiteSearchResponse } from "./models/SyntheticsSuiteSearchResponse"; +import { SyntheticsTestFileAbortMultipartUploadRequest } from "./models/SyntheticsTestFileAbortMultipartUploadRequest"; +import { SyntheticsTestFileCompleteMultipartUploadRequest } from "./models/SyntheticsTestFileCompleteMultipartUploadRequest"; +import { SyntheticsTestFileDownloadRequest } from "./models/SyntheticsTestFileDownloadRequest"; +import { SyntheticsTestFileDownloadResponse } from "./models/SyntheticsTestFileDownloadResponse"; +import { SyntheticsTestFileMultipartPresignedUrlsRequest } from "./models/SyntheticsTestFileMultipartPresignedUrlsRequest"; +import { SyntheticsTestFileMultipartPresignedUrlsResponse } from "./models/SyntheticsTestFileMultipartPresignedUrlsResponse"; import { SyntheticsTestParentSuitesResponse } from "./models/SyntheticsTestParentSuitesResponse"; import { SyntheticsTestVersionHistoryResponse } from "./models/SyntheticsTestVersionHistoryResponse"; import { SyntheticsTestVersionResponse } from "./models/SyntheticsTestVersionResponse"; @@ -54,6 +60,138 @@ export class SyntheticsApiRequestFactory extends BaseAPIRequestFactory { this.userAgent = buildUserAgent("synthetics", version); } } + public async abortTestFileMultipartUpload( + publicId: string, + body: SyntheticsTestFileAbortMultipartUploadRequest, + _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", "abortTestFileMultipartUpload"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "abortTestFileMultipartUpload"); + } + + // Path Params + const localVarPath = + "/api/v2/synthetics/tests/{public_id}/files/multipart-upload-abort".replace( + "{public_id}", + encodeURIComponent(String(publicId)), + ); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "SyntheticsApi.v2.abortTestFileMultipartUpload", + SyntheticsApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.POST, + overrides, + ); + requestContext.setHeaderParam("Accept", "*/*"); + 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, + "SyntheticsTestFileAbortMultipartUploadRequest", + "", + ), + contentType, + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + + public async completeTestFileMultipartUpload( + publicId: string, + body: SyntheticsTestFileCompleteMultipartUploadRequest, + _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", "completeTestFileMultipartUpload"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "completeTestFileMultipartUpload"); + } + + // Path Params + const localVarPath = + "/api/v2/synthetics/tests/{public_id}/files/multipart-upload-complete".replace( + "{public_id}", + encodeURIComponent(String(publicId)), + ); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "SyntheticsApi.v2.completeTestFileMultipartUpload", + SyntheticsApi.operationServers, + ); + const requestContext = server.makeRequestContext( + localVarPath, + HttpMethod.POST, + overrides, + ); + requestContext.setHeaderParam("Accept", "*/*"); + 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, + "SyntheticsTestFileCompleteMultipartUploadRequest", + "", + ), + contentType, + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + public async createSyntheticsNetworkTest( body: SyntheticsNetworkTestEditRequest, _options?: Configuration, @@ -650,6 +788,133 @@ export class SyntheticsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async getTestFileDownloadUrl( + publicId: string, + body: SyntheticsTestFileDownloadRequest, + _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", "getTestFileDownloadUrl"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "getTestFileDownloadUrl"); + } + + // Path Params + const localVarPath = + "/api/v2/synthetics/tests/{public_id}/files/download".replace( + "{public_id}", + encodeURIComponent(String(publicId)), + ); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "SyntheticsApi.v2.getTestFileDownloadUrl", + 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, "SyntheticsTestFileDownloadRequest", ""), + contentType, + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + + public async getTestFileMultipartPresignedUrls( + publicId: string, + body: SyntheticsTestFileMultipartPresignedUrlsRequest, + _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", "getTestFileMultipartPresignedUrls"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "getTestFileMultipartPresignedUrls"); + } + + // Path Params + const localVarPath = + "/api/v2/synthetics/tests/{public_id}/files/multipart-presigned-urls".replace( + "{public_id}", + encodeURIComponent(String(publicId)), + ); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "SyntheticsApi.v2.getTestFileMultipartPresignedUrls", + 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, + "SyntheticsTestFileMultipartPresignedUrlsRequest", + "", + ), + contentType, + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + public async getTestParentSuites( publicId: string, _options?: Configuration, @@ -1027,51 +1292,151 @@ export class SyntheticsApiRequestFactory extends BaseAPIRequestFactory { throw new RequiredError("body", "updateSyntheticsNetworkTest"); } - // Path Params - const localVarPath = "/api/v2/synthetics/tests/network/{public_id}".replace( - "{public_id}", - encodeURIComponent(String(publicId)), - ); - - // Make Request Context - const { server, overrides } = _config.getServerAndOverrides( - "SyntheticsApi.v2.updateSyntheticsNetworkTest", - 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); + // Path Params + const localVarPath = "/api/v2/synthetics/tests/network/{public_id}".replace( + "{public_id}", + encodeURIComponent(String(publicId)), + ); + + // Make Request Context + const { server, overrides } = _config.getServerAndOverrides( + "SyntheticsApi.v2.updateSyntheticsNetworkTest", + 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, "SyntheticsNetworkTestEditRequest", ""), + contentType, + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } +} + +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 abortTestFileMultipartUpload + * @throws ApiException if the response code was not in [200, 299] + */ + public async abortTestFileMultipartUpload( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 204) { + return; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + 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) { + return; + } + + 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 completeTestFileMultipartUpload + * @throws ApiException if the response code was not in [200, 299] + */ + public async completeTestFileMultipartUpload( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 204) { + return; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + 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) { + return; } - // Body Params - const contentType = getPreferredMediaType(["application/json"]); - requestContext.setHeaderParam("Content-Type", contentType); - const serializedBody = stringify( - serialize(body, TypingInfo, "SyntheticsNetworkTestEditRequest", ""), - contentType, + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"', ); - requestContext.setBody(serializedBody); - - // Apply auth methods - applySecurityAuthentication(_config, requestContext, [ - "apiKeyAuth", - "appKeyAuth", - "AuthZ", - ]); - - return requestContext; } -} -export class SyntheticsApiResponseProcessor { /** * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects @@ -1756,6 +2121,130 @@ 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 getTestFileDownloadUrl + * @throws ApiException if the response code was not in [200, 299] + */ + public async getTestFileDownloadUrl( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: SyntheticsTestFileDownloadResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "SyntheticsTestFileDownloadResponse", + ) as SyntheticsTestFileDownloadResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + 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: SyntheticsTestFileDownloadResponse = deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "SyntheticsTestFileDownloadResponse", + "", + ) as SyntheticsTestFileDownloadResponse; + 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 getTestFileMultipartPresignedUrls + * @throws ApiException if the response code was not in [200, 299] + */ + public async getTestFileMultipartPresignedUrls( + response: ResponseContext, + ): Promise { + const contentType = normalizeMediaType(response.headers["content-type"]); + if (response.httpStatusCode === 200) { + const body: SyntheticsTestFileMultipartPresignedUrlsResponse = + deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "SyntheticsTestFileMultipartPresignedUrlsResponse", + ) as SyntheticsTestFileMultipartPresignedUrlsResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + 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: SyntheticsTestFileMultipartPresignedUrlsResponse = + deserialize( + parse(await response.body.text(), contentType), + TypingInfo, + "SyntheticsTestFileMultipartPresignedUrlsResponse", + "", + ) as SyntheticsTestFileMultipartPresignedUrlsResponse; + 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 @@ -2161,6 +2650,30 @@ export class SyntheticsApiResponseProcessor { } } +export interface SyntheticsApiAbortTestFileMultipartUploadRequest { + /** + * The public ID of the Synthetic test. + * @type string + */ + publicId: string; + /** + * @type SyntheticsTestFileAbortMultipartUploadRequest + */ + body: SyntheticsTestFileAbortMultipartUploadRequest; +} + +export interface SyntheticsApiCompleteTestFileMultipartUploadRequest { + /** + * The public ID of the Synthetic test. + * @type string + */ + publicId: string; + /** + * @type SyntheticsTestFileCompleteMultipartUploadRequest + */ + body: SyntheticsTestFileCompleteMultipartUploadRequest; +} + export interface SyntheticsApiCreateSyntheticsNetworkTestRequest { /** * @type SyntheticsNetworkTestEditRequest @@ -2266,6 +2779,30 @@ export interface SyntheticsApiGetSyntheticsTestVersionRequest { onlyCheckExistence?: boolean; } +export interface SyntheticsApiGetTestFileDownloadUrlRequest { + /** + * The public ID of the Synthetic test. + * @type string + */ + publicId: string; + /** + * @type SyntheticsTestFileDownloadRequest + */ + body: SyntheticsTestFileDownloadRequest; +} + +export interface SyntheticsApiGetTestFileMultipartPresignedUrlsRequest { + /** + * The public ID of the Synthetic test. + * @type string + */ + publicId: string; + /** + * @type SyntheticsTestFileMultipartPresignedUrlsRequest + */ + body: SyntheticsTestFileMultipartPresignedUrlsRequest; +} + export interface SyntheticsApiGetTestParentSuitesRequest { /** * The public ID of the Synthetic test. @@ -2386,6 +2923,58 @@ export class SyntheticsApi { responseProcessor || new SyntheticsApiResponseProcessor(); } + /** + * Abort an in-progress multipart file upload for a Synthetic test. This cancels the upload + * and releases any storage used by already-uploaded parts. + * @param param The request object + */ + public abortTestFileMultipartUpload( + param: SyntheticsApiAbortTestFileMultipartUploadRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = + this.requestFactory.abortTestFileMultipartUpload( + param.publicId, + param.body, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.abortTestFileMultipartUpload( + responseContext, + ); + }); + }); + } + + /** + * Complete a multipart file upload for a Synthetic test. Call this endpoint after all parts + * have been uploaded using the presigned URLs obtained from the multipart presigned URLs endpoint. + * @param param The request object + */ + public completeTestFileMultipartUpload( + param: SyntheticsApiCompleteTestFileMultipartUploadRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = + this.requestFactory.completeTestFileMultipartUpload( + param.publicId, + param.body, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.completeTestFileMultipartUpload( + responseContext, + ); + }); + }); + } + /** * @param param The request object */ @@ -2644,6 +3233,55 @@ export class SyntheticsApi { }); } + /** + * Get a presigned URL to download a file attached to a Synthetic test. + * The returned URL is temporary and expires after a short period. + * @param param The request object + */ + public getTestFileDownloadUrl( + param: SyntheticsApiGetTestFileDownloadUrlRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = this.requestFactory.getTestFileDownloadUrl( + param.publicId, + param.body, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getTestFileDownloadUrl(responseContext); + }); + }); + } + + /** + * Get presigned URLs for uploading a file to a Synthetic test using multipart upload. + * Returns the presigned URLs for each part along with the bucket key that references the file. + * @param param The request object + */ + public getTestFileMultipartPresignedUrls( + param: SyntheticsApiGetTestFileMultipartPresignedUrlsRequest, + options?: Configuration, + ): Promise { + const requestContextPromise = + this.requestFactory.getTestFileMultipartPresignedUrls( + param.publicId, + param.body, + options, + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getTestFileMultipartPresignedUrls( + responseContext, + ); + }); + }); + } + /** * Get the list of parent suites and their status for a given Synthetic test. * @param param The request object diff --git a/services/synthetics/src/v2/index.ts b/services/synthetics/src/v2/index.ts index 0ccf0ae7f8a6..1ff89ce863a5 100644 --- a/services/synthetics/src/v2/index.ts +++ b/services/synthetics/src/v2/index.ts @@ -1,4 +1,6 @@ export { + SyntheticsApiAbortTestFileMultipartUploadRequest, + SyntheticsApiCompleteTestFileMultipartUploadRequest, SyntheticsApiCreateSyntheticsNetworkTestRequest, SyntheticsApiCreateSyntheticsSuiteRequest, SyntheticsApiDeleteSyntheticsSuitesRequest, @@ -10,6 +12,8 @@ export { SyntheticsApiGetSyntheticsNetworkTestRequest, SyntheticsApiGetSyntheticsSuiteRequest, SyntheticsApiGetSyntheticsTestVersionRequest, + SyntheticsApiGetTestFileDownloadUrlRequest, + SyntheticsApiGetTestFileMultipartPresignedUrlsRequest, SyntheticsApiGetTestParentSuitesRequest, SyntheticsApiListSyntheticsTestVersionsRequest, SyntheticsApiPatchGlobalVariableRequest, @@ -114,6 +118,16 @@ export { SyntheticsSuiteTest } from "./models/SyntheticsSuiteTest"; export { SyntheticsSuiteTestAlertingCriticality } from "./models/SyntheticsSuiteTestAlertingCriticality"; export { SyntheticsSuiteType } from "./models/SyntheticsSuiteType"; export { SyntheticsSuiteTypes } from "./models/SyntheticsSuiteTypes"; +export { SyntheticsTestFileAbortMultipartUploadRequest } from "./models/SyntheticsTestFileAbortMultipartUploadRequest"; +export { SyntheticsTestFileCompleteMultipartUploadPart } from "./models/SyntheticsTestFileCompleteMultipartUploadPart"; +export { SyntheticsTestFileCompleteMultipartUploadRequest } from "./models/SyntheticsTestFileCompleteMultipartUploadRequest"; +export { SyntheticsTestFileDownloadRequest } from "./models/SyntheticsTestFileDownloadRequest"; +export { SyntheticsTestFileDownloadResponse } from "./models/SyntheticsTestFileDownloadResponse"; +export { SyntheticsTestFileMultipartPresignedUrlsParams } from "./models/SyntheticsTestFileMultipartPresignedUrlsParams"; +export { SyntheticsTestFileMultipartPresignedUrlsPart } from "./models/SyntheticsTestFileMultipartPresignedUrlsPart"; +export { SyntheticsTestFileMultipartPresignedUrlsRequest } from "./models/SyntheticsTestFileMultipartPresignedUrlsRequest"; +export { SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix } from "./models/SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix"; +export { SyntheticsTestFileMultipartPresignedUrlsResponse } from "./models/SyntheticsTestFileMultipartPresignedUrlsResponse"; export { SyntheticsTestOptions } from "./models/SyntheticsTestOptions"; export { SyntheticsTestOptionsMonitorOptions } from "./models/SyntheticsTestOptionsMonitorOptions"; export { SyntheticsTestOptionsMonitorOptionsNotificationPresetName } from "./models/SyntheticsTestOptionsMonitorOptionsNotificationPresetName"; diff --git a/services/synthetics/src/v2/models/SyntheticsTestFileAbortMultipartUploadRequest.ts b/services/synthetics/src/v2/models/SyntheticsTestFileAbortMultipartUploadRequest.ts new file mode 100644 index 000000000000..8cc35f3d4241 --- /dev/null +++ b/services/synthetics/src/v2/models/SyntheticsTestFileAbortMultipartUploadRequest.ts @@ -0,0 +1,54 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Request body for aborting a multipart file upload. + */ +export class SyntheticsTestFileAbortMultipartUploadRequest { + /** + * The full storage path of the file whose upload should be aborted. + */ + "key": string; + /** + * The upload ID of the multipart upload to abort. + */ + "uploadId": 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 = { + key: { + baseName: "key", + type: "string", + required: true, + }, + uploadId: { + baseName: "uploadId", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsTestFileAbortMultipartUploadRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/SyntheticsTestFileCompleteMultipartUploadPart.ts b/services/synthetics/src/v2/models/SyntheticsTestFileCompleteMultipartUploadPart.ts new file mode 100644 index 000000000000..bd07629353e2 --- /dev/null +++ b/services/synthetics/src/v2/models/SyntheticsTestFileCompleteMultipartUploadPart.ts @@ -0,0 +1,55 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * A completed part of a multipart upload. + */ +export class SyntheticsTestFileCompleteMultipartUploadPart { + /** + * The ETag returned by the storage provider after uploading the part. + */ + "eTag": string; + /** + * The 1-indexed part number for the multipart upload. + */ + "partNumber": 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 = { + eTag: { + baseName: "ETag", + type: "string", + required: true, + }, + partNumber: { + baseName: "PartNumber", + type: "number", + required: true, + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsTestFileCompleteMultipartUploadPart.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/SyntheticsTestFileCompleteMultipartUploadRequest.ts b/services/synthetics/src/v2/models/SyntheticsTestFileCompleteMultipartUploadRequest.ts new file mode 100644 index 000000000000..00515109c48f --- /dev/null +++ b/services/synthetics/src/v2/models/SyntheticsTestFileCompleteMultipartUploadRequest.ts @@ -0,0 +1,65 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SyntheticsTestFileCompleteMultipartUploadPart } from "./SyntheticsTestFileCompleteMultipartUploadPart"; + +/** + * Request body for completing a multipart file upload. + */ +export class SyntheticsTestFileCompleteMultipartUploadRequest { + /** + * The full storage path for the uploaded file. + */ + "key": string; + /** + * Array of completed parts with their ETags. + */ + "parts": Array; + /** + * The upload ID returned when the multipart upload was initiated. + */ + "uploadId": 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 = { + key: { + baseName: "key", + type: "string", + required: true, + }, + parts: { + baseName: "parts", + type: "Array", + required: true, + }, + uploadId: { + baseName: "uploadId", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsTestFileCompleteMultipartUploadRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/SyntheticsTestFileDownloadRequest.ts b/services/synthetics/src/v2/models/SyntheticsTestFileDownloadRequest.ts new file mode 100644 index 000000000000..960e9591e23b --- /dev/null +++ b/services/synthetics/src/v2/models/SyntheticsTestFileDownloadRequest.ts @@ -0,0 +1,45 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Request body for getting a presigned download URL for a test file. + */ +export class SyntheticsTestFileDownloadRequest { + /** + * The bucket key referencing the file to download. + */ + "bucketKey": 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 = { + bucketKey: { + baseName: "bucketKey", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsTestFileDownloadRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/SyntheticsTestFileDownloadResponse.ts b/services/synthetics/src/v2/models/SyntheticsTestFileDownloadResponse.ts new file mode 100644 index 000000000000..fa9d62a88c5f --- /dev/null +++ b/services/synthetics/src/v2/models/SyntheticsTestFileDownloadResponse.ts @@ -0,0 +1,44 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Response containing a presigned URL for downloading a test file. + */ +export class SyntheticsTestFileDownloadResponse { + /** + * A presigned URL to download the file. The URL expires after a short period. + */ + "url"?: 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 = { + url: { + baseName: "url", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsTestFileDownloadResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/SyntheticsTestFileMultipartPresignedUrlsParams.ts b/services/synthetics/src/v2/models/SyntheticsTestFileMultipartPresignedUrlsParams.ts new file mode 100644 index 000000000000..c5a7cc849812 --- /dev/null +++ b/services/synthetics/src/v2/models/SyntheticsTestFileMultipartPresignedUrlsParams.ts @@ -0,0 +1,60 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * Presigned URL parameters returned for a multipart upload. + */ +export class SyntheticsTestFileMultipartPresignedUrlsParams { + /** + * The full storage path for the file being uploaded. + */ + "key"?: string; + /** + * The upload ID assigned by the storage provider for this multipart upload. + */ + "uploadId"?: string; + /** + * A map of part numbers to presigned upload URLs. + */ + "urls"?: { [key: string]: 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 = { + key: { + baseName: "key", + type: "string", + }, + uploadId: { + baseName: "upload_id", + type: "string", + }, + urls: { + baseName: "urls", + type: "{ [key: string]: string; }", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsTestFileMultipartPresignedUrlsParams.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/SyntheticsTestFileMultipartPresignedUrlsPart.ts b/services/synthetics/src/v2/models/SyntheticsTestFileMultipartPresignedUrlsPart.ts new file mode 100644 index 000000000000..7f2875fe3670 --- /dev/null +++ b/services/synthetics/src/v2/models/SyntheticsTestFileMultipartPresignedUrlsPart.ts @@ -0,0 +1,55 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +/** + * A part descriptor for initiating a multipart upload. + */ +export class SyntheticsTestFileMultipartPresignedUrlsPart { + /** + * Base64-encoded MD5 digest of the part content. + */ + "md5": string; + /** + * The 1-indexed part number for the multipart upload. + */ + "partNumber": 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 = { + md5: { + baseName: "md5", + type: "string", + required: true, + }, + partNumber: { + baseName: "partNumber", + type: "number", + required: true, + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsTestFileMultipartPresignedUrlsPart.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/SyntheticsTestFileMultipartPresignedUrlsRequest.ts b/services/synthetics/src/v2/models/SyntheticsTestFileMultipartPresignedUrlsRequest.ts new file mode 100644 index 000000000000..97da402a968e --- /dev/null +++ b/services/synthetics/src/v2/models/SyntheticsTestFileMultipartPresignedUrlsRequest.ts @@ -0,0 +1,57 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SyntheticsTestFileMultipartPresignedUrlsPart } from "./SyntheticsTestFileMultipartPresignedUrlsPart"; +import { SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix } from "./SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix"; + +/** + * Request body for getting presigned URLs for a multipart file upload. + */ +export class SyntheticsTestFileMultipartPresignedUrlsRequest { + /** + * The bucket key prefix indicating the type of file upload. + */ + "bucketKeyPrefix": SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix; + /** + * Array of part descriptors for the multipart upload. + */ + "parts": 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 = { + bucketKeyPrefix: { + baseName: "bucketKeyPrefix", + type: "SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix", + required: true, + }, + parts: { + baseName: "parts", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsTestFileMultipartPresignedUrlsRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix.ts b/services/synthetics/src/v2/models/SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix.ts new file mode 100644 index 000000000000..5c9296d256fc --- /dev/null +++ b/services/synthetics/src/v2/models/SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix.ts @@ -0,0 +1,11 @@ +import { UnparsedObject } from "@datadog/datadog-api-client"; + +/** + * The bucket key prefix indicating the type of file upload. + */ +export type SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix = + | typeof API_UPLOAD_FILE + | typeof BROWSER_UPLOAD_FILE_STEP + | UnparsedObject; +export const API_UPLOAD_FILE = "api-upload-file"; +export const BROWSER_UPLOAD_FILE_STEP = "browser-upload-file-step"; diff --git a/services/synthetics/src/v2/models/SyntheticsTestFileMultipartPresignedUrlsResponse.ts b/services/synthetics/src/v2/models/SyntheticsTestFileMultipartPresignedUrlsResponse.ts new file mode 100644 index 000000000000..c2d52443d65b --- /dev/null +++ b/services/synthetics/src/v2/models/SyntheticsTestFileMultipartPresignedUrlsResponse.ts @@ -0,0 +1,54 @@ +import { AttributeTypeMap } from "@datadog/datadog-api-client"; + +import { SyntheticsTestFileMultipartPresignedUrlsParams } from "./SyntheticsTestFileMultipartPresignedUrlsParams"; + +/** + * Response containing presigned URLs for multipart file upload and the bucket key. + */ +export class SyntheticsTestFileMultipartPresignedUrlsResponse { + /** + * The bucket key that references the uploaded file after completion. + */ + "bucketKey"?: string; + /** + * Presigned URL parameters returned for a multipart upload. + */ + "multipartPresignedUrlsParams"?: SyntheticsTestFileMultipartPresignedUrlsParams; + /** + * 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 = { + bucketKey: { + baseName: "bucketKey", + type: "string", + }, + multipartPresignedUrlsParams: { + baseName: "multipart_presigned_urls_params", + type: "SyntheticsTestFileMultipartPresignedUrlsParams", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsTestFileMultipartPresignedUrlsResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/services/synthetics/src/v2/models/TypingInfo.ts b/services/synthetics/src/v2/models/TypingInfo.ts index c61c37e5afc8..3494d75299e1 100644 --- a/services/synthetics/src/v2/models/TypingInfo.ts +++ b/services/synthetics/src/v2/models/TypingInfo.ts @@ -65,6 +65,15 @@ import { SyntheticsSuiteSearchResponse } from "./SyntheticsSuiteSearchResponse"; import { SyntheticsSuiteSearchResponseData } from "./SyntheticsSuiteSearchResponseData"; import { SyntheticsSuiteSearchResponseDataAttributes } from "./SyntheticsSuiteSearchResponseDataAttributes"; import { SyntheticsSuiteTest } from "./SyntheticsSuiteTest"; +import { SyntheticsTestFileAbortMultipartUploadRequest } from "./SyntheticsTestFileAbortMultipartUploadRequest"; +import { SyntheticsTestFileCompleteMultipartUploadPart } from "./SyntheticsTestFileCompleteMultipartUploadPart"; +import { SyntheticsTestFileCompleteMultipartUploadRequest } from "./SyntheticsTestFileCompleteMultipartUploadRequest"; +import { SyntheticsTestFileDownloadRequest } from "./SyntheticsTestFileDownloadRequest"; +import { SyntheticsTestFileDownloadResponse } from "./SyntheticsTestFileDownloadResponse"; +import { SyntheticsTestFileMultipartPresignedUrlsParams } from "./SyntheticsTestFileMultipartPresignedUrlsParams"; +import { SyntheticsTestFileMultipartPresignedUrlsPart } from "./SyntheticsTestFileMultipartPresignedUrlsPart"; +import { SyntheticsTestFileMultipartPresignedUrlsRequest } from "./SyntheticsTestFileMultipartPresignedUrlsRequest"; +import { SyntheticsTestFileMultipartPresignedUrlsResponse } from "./SyntheticsTestFileMultipartPresignedUrlsResponse"; import { SyntheticsTestOptions } from "./SyntheticsTestOptions"; import { SyntheticsTestOptionsMonitorOptions } from "./SyntheticsTestOptionsMonitorOptions"; import { SyntheticsTestOptionsRetry } from "./SyntheticsTestOptionsRetry"; @@ -142,6 +151,10 @@ export const TypingInfo: ModelTypingInfo = { SyntheticsSuiteTestAlertingCriticality: ["ignore", "critical"], SyntheticsSuiteType: ["suite"], SyntheticsSuiteTypes: ["suites"], + SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix: [ + "api-upload-file", + "browser-upload-file-step", + ], SyntheticsTestOptionsMonitorOptionsNotificationPresetName: [ "show_all", "hide_all", @@ -240,6 +253,22 @@ export const TypingInfo: ModelTypingInfo = { SyntheticsSuiteSearchResponseDataAttributes: SyntheticsSuiteSearchResponseDataAttributes, SyntheticsSuiteTest: SyntheticsSuiteTest, + SyntheticsTestFileAbortMultipartUploadRequest: + SyntheticsTestFileAbortMultipartUploadRequest, + SyntheticsTestFileCompleteMultipartUploadPart: + SyntheticsTestFileCompleteMultipartUploadPart, + SyntheticsTestFileCompleteMultipartUploadRequest: + SyntheticsTestFileCompleteMultipartUploadRequest, + SyntheticsTestFileDownloadRequest: SyntheticsTestFileDownloadRequest, + SyntheticsTestFileDownloadResponse: SyntheticsTestFileDownloadResponse, + SyntheticsTestFileMultipartPresignedUrlsParams: + SyntheticsTestFileMultipartPresignedUrlsParams, + SyntheticsTestFileMultipartPresignedUrlsPart: + SyntheticsTestFileMultipartPresignedUrlsPart, + SyntheticsTestFileMultipartPresignedUrlsRequest: + SyntheticsTestFileMultipartPresignedUrlsRequest, + SyntheticsTestFileMultipartPresignedUrlsResponse: + SyntheticsTestFileMultipartPresignedUrlsResponse, SyntheticsTestOptions: SyntheticsTestOptions, SyntheticsTestOptionsMonitorOptions: SyntheticsTestOptionsMonitorOptions, SyntheticsTestOptionsRetry: SyntheticsTestOptionsRetry,