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/examples/v2/synthetics/AbortTestFileMultipartUpload.ts b/examples/v2/synthetics/AbortTestFileMultipartUpload.ts new file mode 100644 index 000000000000..d21a4e706ba0 --- /dev/null +++ b/examples/v2/synthetics/AbortTestFileMultipartUpload.ts @@ -0,0 +1,25 @@ +/** + * Abort a multipart upload of a test file returns "No Content" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.SyntheticsApi(configuration); + +const params: v2.SyntheticsApiAbortTestFileMultipartUploadRequest = { + body: { + key: "org-123/api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json", + uploadId: "upload-id-abc123", + }, + publicId: "abc-def-123", +}; + +apiInstance + .abortTestFileMultipartUpload(params) + .then((data: any) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/synthetics/CompleteTestFileMultipartUpload.ts b/examples/v2/synthetics/CompleteTestFileMultipartUpload.ts new file mode 100644 index 000000000000..8208eeade83e --- /dev/null +++ b/examples/v2/synthetics/CompleteTestFileMultipartUpload.ts @@ -0,0 +1,31 @@ +/** + * Complete a multipart upload of a test file returns "No Content" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.SyntheticsApi(configuration); + +const params: v2.SyntheticsApiCompleteTestFileMultipartUploadRequest = { + body: { + 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", + }, + publicId: "abc-def-123", +}; + +apiInstance + .completeTestFileMultipartUpload(params) + .then((data: any) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/synthetics/GetTestFileDownloadUrl.ts b/examples/v2/synthetics/GetTestFileDownloadUrl.ts new file mode 100644 index 000000000000..54f2a3cf6ca9 --- /dev/null +++ b/examples/v2/synthetics/GetTestFileDownloadUrl.ts @@ -0,0 +1,24 @@ +/** + * Get a presigned URL for downloading a test file returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.SyntheticsApi(configuration); + +const params: v2.SyntheticsApiGetTestFileDownloadUrlRequest = { + body: { + bucketKey: "api-upload-file/abc-def-123/2024-01-01T00:00:00_uuid.json", + }, + publicId: "abc-def-123", +}; + +apiInstance + .getTestFileDownloadUrl(params) + .then((data: v2.SyntheticsTestFileDownloadResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/synthetics/GetTestFileMultipartPresignedUrls.ts b/examples/v2/synthetics/GetTestFileMultipartPresignedUrls.ts new file mode 100644 index 000000000000..c34e8a19184f --- /dev/null +++ b/examples/v2/synthetics/GetTestFileMultipartPresignedUrls.ts @@ -0,0 +1,30 @@ +/** + * Get presigned URLs for uploading a test file returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.SyntheticsApi(configuration); + +const params: v2.SyntheticsApiGetTestFileMultipartPresignedUrlsRequest = { + body: { + bucketKeyPrefix: "api-upload-file", + parts: [ + { + md5: "1B2M2Y8AsgTpgAmY7PhCfg==", + partNumber: 1, + }, + ], + }, + publicId: "abc-def-123", +}; + +apiInstance + .getTestFileMultipartPresignedUrls(params) + .then((data: v2.SyntheticsTestFileMultipartPresignedUrlsResponse) => { + 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 e2e6960458b1..1fdcaf1446a0 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -11225,6 +11225,50 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "SyntheticsNetworkTestResponse", }, + "v2.GetTestFileDownloadUrl": { + "publicId": { + "type": "string", + "format": "", + }, + "body": { + "type": "SyntheticsTestFileDownloadRequest", + "format": "", + }, + "operationResponseType": "SyntheticsTestFileDownloadResponse", + }, + "v2.GetTestFileMultipartPresignedUrls": { + "publicId": { + "type": "string", + "format": "", + }, + "body": { + "type": "SyntheticsTestFileMultipartPresignedUrlsRequest", + "format": "", + }, + "operationResponseType": "SyntheticsTestFileMultipartPresignedUrlsResponse", + }, + "v2.AbortTestFileMultipartUpload": { + "publicId": { + "type": "string", + "format": "", + }, + "body": { + "type": "SyntheticsTestFileAbortMultipartUploadRequest", + "format": "", + }, + "operationResponseType": "{}", + }, + "v2.CompleteTestFileMultipartUpload": { + "publicId": { + "type": "string", + "format": "", + }, + "body": { + "type": "SyntheticsTestFileCompleteMultipartUploadRequest", + "format": "", + }, + "operationResponseType": "{}", + }, "v2.GetTestParentSuites": { "publicId": { "type": "string", 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/packages/datadog-api-client-v2/apis/SyntheticsApi.ts b/packages/datadog-api-client-v2/apis/SyntheticsApi.ts index e390773ba036..19638a7c5693 100644 --- a/packages/datadog-api-client-v2/apis/SyntheticsApi.ts +++ b/packages/datadog-api-client-v2/apis/SyntheticsApi.ts @@ -34,11 +34,129 @@ import { SyntheticsNetworkTestEditRequest } from "../models/SyntheticsNetworkTes 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"; export class SyntheticsApiRequestFactory extends BaseAPIRequestFactory { + 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 requestContext = _config + .getServer("v2.SyntheticsApi.abortTestFileMultipartUpload") + .makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize( + body, + "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 requestContext = _config + .getServer("v2.SyntheticsApi.completeTestFileMultipartUpload") + .makeRequestContext(localVarPath, HttpMethod.POST); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize( + body, + "SyntheticsTestFileCompleteMultipartUploadRequest", + "" + ), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + public async createSyntheticsNetworkTest( body: SyntheticsNetworkTestEditRequest, _options?: Configuration @@ -513,6 +631,114 @@ 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 requestContext = _config + .getServer("v2.SyntheticsApi.getTestFileDownloadUrl") + .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, "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 requestContext = _config + .getServer("v2.SyntheticsApi.getTestFileMultipartPresignedUrls") + .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, + "SyntheticsTestFileMultipartPresignedUrlsRequest", + "" + ), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + public async getTestParentSuites( publicId: string, _options?: Configuration @@ -866,6 +1092,114 @@ 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 abortTestFileMultipartUpload + * @throws ApiException if the response code was not in [200, 299] + */ + public async abortTestFileMultipartUpload( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.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 = 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) { + 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 = ObjectSerializer.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 = 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) { + 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 @@ -1578,6 +1912,136 @@ 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 = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: SyntheticsTestFileDownloadResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SyntheticsTestFileDownloadResponse" + ) as SyntheticsTestFileDownloadResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + 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: SyntheticsTestFileDownloadResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "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 = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: SyntheticsTestFileMultipartPresignedUrlsResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SyntheticsTestFileMultipartPresignedUrlsResponse" + ) as SyntheticsTestFileMultipartPresignedUrlsResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + 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: SyntheticsTestFileMultipartPresignedUrlsResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "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 @@ -2001,6 +2465,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 @@ -2106,6 +2594,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. @@ -2224,6 +2736,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 */ @@ -2482,6 +3046,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/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index 1c719be16580..4fbb0f4bbf71 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -1138,6 +1138,8 @@ export { } from "./apis/StatusPagesApi"; export { + SyntheticsApiAbortTestFileMultipartUploadRequest, + SyntheticsApiCompleteTestFileMultipartUploadRequest, SyntheticsApiCreateSyntheticsNetworkTestRequest, SyntheticsApiCreateSyntheticsSuiteRequest, SyntheticsApiDeleteSyntheticsSuitesRequest, @@ -1149,6 +1151,8 @@ export { SyntheticsApiGetSyntheticsNetworkTestRequest, SyntheticsApiGetSyntheticsSuiteRequest, SyntheticsApiGetSyntheticsTestVersionRequest, + SyntheticsApiGetTestFileDownloadUrlRequest, + SyntheticsApiGetTestFileMultipartPresignedUrlsRequest, SyntheticsApiGetTestParentSuitesRequest, SyntheticsApiListSyntheticsTestVersionsRequest, SyntheticsApiPatchGlobalVariableRequest, @@ -5484,6 +5488,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/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index d1a3d2d2681a..a55dfd16ffbf 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -3205,6 +3205,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"; @@ -5413,6 +5422,10 @@ const enumsMap: { [key: string]: any[] } = { SyntheticsSuiteTestAlertingCriticality: ["ignore", "critical"], SyntheticsSuiteType: ["suite"], SyntheticsSuiteTypes: ["suites"], + SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix: [ + "api-upload-file", + "browser-upload-file-step", + ], SyntheticsTestOptionsMonitorOptionsNotificationPresetName: [ "show_all", "hide_all", @@ -9540,6 +9553,22 @@ const typeMap: { [index: string]: any } = { 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, diff --git a/packages/datadog-api-client-v2/models/SyntheticsTestFileAbortMultipartUploadRequest.ts b/packages/datadog-api-client-v2/models/SyntheticsTestFileAbortMultipartUploadRequest.ts new file mode 100644 index 000000000000..95d6efe9a769 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsTestFileAbortMultipartUploadRequest.ts @@ -0,0 +1,62 @@ +/** + * 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"; + +/** + * 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/packages/datadog-api-client-v2/models/SyntheticsTestFileCompleteMultipartUploadPart.ts b/packages/datadog-api-client-v2/models/SyntheticsTestFileCompleteMultipartUploadPart.ts new file mode 100644 index 000000000000..cb5a9e2a3af4 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsTestFileCompleteMultipartUploadPart.ts @@ -0,0 +1,63 @@ +/** + * 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"; + +/** + * 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/packages/datadog-api-client-v2/models/SyntheticsTestFileCompleteMultipartUploadRequest.ts b/packages/datadog-api-client-v2/models/SyntheticsTestFileCompleteMultipartUploadRequest.ts new file mode 100644 index 000000000000..b6e737d41d03 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsTestFileCompleteMultipartUploadRequest.ts @@ -0,0 +1,72 @@ +/** + * 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 { SyntheticsTestFileCompleteMultipartUploadPart } from "./SyntheticsTestFileCompleteMultipartUploadPart"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/SyntheticsTestFileDownloadRequest.ts b/packages/datadog-api-client-v2/models/SyntheticsTestFileDownloadRequest.ts new file mode 100644 index 000000000000..a743913da099 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsTestFileDownloadRequest.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"; + +/** + * 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/packages/datadog-api-client-v2/models/SyntheticsTestFileDownloadResponse.ts b/packages/datadog-api-client-v2/models/SyntheticsTestFileDownloadResponse.ts new file mode 100644 index 000000000000..776e860f526f --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsTestFileDownloadResponse.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"; + +/** + * 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/packages/datadog-api-client-v2/models/SyntheticsTestFileMultipartPresignedUrlsParams.ts b/packages/datadog-api-client-v2/models/SyntheticsTestFileMultipartPresignedUrlsParams.ts new file mode 100644 index 000000000000..2f111e0717cc --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsTestFileMultipartPresignedUrlsParams.ts @@ -0,0 +1,68 @@ +/** + * 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"; + +/** + * 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/packages/datadog-api-client-v2/models/SyntheticsTestFileMultipartPresignedUrlsPart.ts b/packages/datadog-api-client-v2/models/SyntheticsTestFileMultipartPresignedUrlsPart.ts new file mode 100644 index 000000000000..ee328e26c2b6 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsTestFileMultipartPresignedUrlsPart.ts @@ -0,0 +1,63 @@ +/** + * 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"; + +/** + * 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/packages/datadog-api-client-v2/models/SyntheticsTestFileMultipartPresignedUrlsRequest.ts b/packages/datadog-api-client-v2/models/SyntheticsTestFileMultipartPresignedUrlsRequest.ts new file mode 100644 index 000000000000..f80d7ffa5548 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsTestFileMultipartPresignedUrlsRequest.ts @@ -0,0 +1,64 @@ +/** + * 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 { SyntheticsTestFileMultipartPresignedUrlsPart } from "./SyntheticsTestFileMultipartPresignedUrlsPart"; +import { SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix } from "./SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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/packages/datadog-api-client-v2/models/SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix.ts b/packages/datadog-api-client-v2/models/SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix.ts new file mode 100644 index 000000000000..910ebf7349e8 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsTestFileMultipartPresignedUrlsRequestBucketKeyPrefix.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"; + +/** + * 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/packages/datadog-api-client-v2/models/SyntheticsTestFileMultipartPresignedUrlsResponse.ts b/packages/datadog-api-client-v2/models/SyntheticsTestFileMultipartPresignedUrlsResponse.ts new file mode 100644 index 000000000000..b631160f44b5 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsTestFileMultipartPresignedUrlsResponse.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 { SyntheticsTestFileMultipartPresignedUrlsParams } from "./SyntheticsTestFileMultipartPresignedUrlsParams"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * 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() {} +}