From 456532e952bfdf931241666a37bddb0546701d29 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 27 Mar 2026 17:39:13 +0000 Subject: [PATCH] Regenerate client from commit e98f66e of spec repo --- .generator/schemas/v2/openapi.yaml | 1287 +++++++++++++++++ .../GetApiMultistepSubtestParents.ts | 21 + .../v2/synthetics/GetApiMultistepSubtests.ts | 21 + .../v2/synthetics/GetSyntheticsTestVersion.ts | 22 + examples/v2/synthetics/GetTestParentSuites.ts | 21 + .../synthetics/ListSyntheticsTestVersions.ts | 21 + examples/v2/synthetics/PatchTestSuite.ts | 34 + examples/v2/widgets/CreateWidget.ts | 33 + examples/v2/widgets/DeleteWidget.ts | 22 + examples/v2/widgets/GetWidget.ts | 22 + examples/v2/widgets/SearchWidgets.ts | 21 + examples/v2/widgets/UpdateWidget.ts | 34 + features/support/scenarios_model_mapping.ts | 153 ++ features/v2/synthetics.feature | 81 ++ features/v2/undo.json | 77 + features/v2/widgets.feature | 115 ++ .../apis/SyntheticsApi.ts | 999 ++++++++++++- .../datadog-api-client-v2/apis/WidgetsApi.ts | 850 +++++++++++ packages/datadog-api-client-v2/index.ts | 61 + .../models/CreateOrUpdateWidgetRequest.ts | 54 + .../CreateOrUpdateWidgetRequestAttributes.ts | 62 + .../models/CreateOrUpdateWidgetRequestData.ts | 63 + .../models/ObjectSerializer.ts | 110 ++ .../models/SuiteJsonPatchRequest.ts | 54 + .../models/SuiteJsonPatchRequestData.ts | 62 + .../SuiteJsonPatchRequestDataAttributes.ts | 53 + .../models/SuiteJsonPatchType.ts | 14 + ...theticsApiMultistepParentTestAttributes.ts | 102 ++ .../SyntheticsApiMultistepParentTestData.ts | 70 + .../SyntheticsApiMultistepParentTestType.ts | 16 + ...ntheticsApiMultistepParentTestsResponse.ts | 53 + ...SyntheticsApiMultistepSubtestAttributes.ts | 60 + .../SyntheticsApiMultistepSubtestData.ts | 70 + .../SyntheticsApiMultistepSubtestType.ts | 14 + .../SyntheticsApiMultistepSubtestsResponse.ts | 53 + .../SyntheticsTestParentSuiteAttributes.ts | 102 ++ .../models/SyntheticsTestParentSuiteData.ts | 70 + .../models/SyntheticsTestParentSuiteType.ts | 16 + .../SyntheticsTestParentSuitesResponse.ts | 53 + .../SyntheticsTestVersionActionMetadata.ts | 77 + .../models/SyntheticsTestVersionAttributes.ts | 80 + .../models/SyntheticsTestVersionAuthor.ts | 76 + .../SyntheticsTestVersionChangeAttributes.ts | 79 + .../models/SyntheticsTestVersionChangeData.ts | 70 + ...SyntheticsTestVersionChangeMetadataItem.ts | 61 + .../models/SyntheticsTestVersionChangeType.ts | 16 + .../models/SyntheticsTestVersionData.ts | 70 + .../SyntheticsTestVersionDiffPatchDiff.ts | 60 + .../SyntheticsTestVersionDiffPatches.ts | 89 ++ .../SyntheticsTestVersionHistoryMeta.ts | 63 + .../SyntheticsTestVersionHistoryResponse.ts | 62 + .../models/SyntheticsTestVersionResponse.ts | 53 + .../models/SyntheticsTestVersionType.ts | 14 + .../models/WidgetAttributes.ts | 90 ++ .../models/WidgetData.ts | 81 ++ .../models/WidgetDefinition.ts | 64 + .../models/WidgetExperienceType.ts | 22 + .../models/WidgetIncludedUser.ts | 71 + .../models/WidgetIncludedUserAttributes.ts | 60 + .../models/WidgetListResponse.ts | 72 + .../models/WidgetRelationshipData.ts | 62 + .../models/WidgetRelationshipItem.ts | 53 + .../models/WidgetRelationships.ts | 61 + .../models/WidgetResponse.ts | 63 + .../models/WidgetSearchMeta.ts | 80 + .../models/WidgetType.ts | 45 + 66 files changed, 6672 insertions(+), 68 deletions(-) create mode 100644 examples/v2/synthetics/GetApiMultistepSubtestParents.ts create mode 100644 examples/v2/synthetics/GetApiMultistepSubtests.ts create mode 100644 examples/v2/synthetics/GetSyntheticsTestVersion.ts create mode 100644 examples/v2/synthetics/GetTestParentSuites.ts create mode 100644 examples/v2/synthetics/ListSyntheticsTestVersions.ts create mode 100644 examples/v2/synthetics/PatchTestSuite.ts create mode 100644 examples/v2/widgets/CreateWidget.ts create mode 100644 examples/v2/widgets/DeleteWidget.ts create mode 100644 examples/v2/widgets/GetWidget.ts create mode 100644 examples/v2/widgets/SearchWidgets.ts create mode 100644 examples/v2/widgets/UpdateWidget.ts create mode 100644 features/v2/widgets.feature create mode 100644 packages/datadog-api-client-v2/apis/WidgetsApi.ts create mode 100644 packages/datadog-api-client-v2/models/CreateOrUpdateWidgetRequest.ts create mode 100644 packages/datadog-api-client-v2/models/CreateOrUpdateWidgetRequestAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/CreateOrUpdateWidgetRequestData.ts create mode 100644 packages/datadog-api-client-v2/models/SuiteJsonPatchRequest.ts create mode 100644 packages/datadog-api-client-v2/models/SuiteJsonPatchRequestData.ts create mode 100644 packages/datadog-api-client-v2/models/SuiteJsonPatchRequestDataAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/SuiteJsonPatchType.ts create mode 100644 packages/datadog-api-client-v2/models/SyntheticsApiMultistepParentTestAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/SyntheticsApiMultistepParentTestData.ts create mode 100644 packages/datadog-api-client-v2/models/SyntheticsApiMultistepParentTestType.ts create mode 100644 packages/datadog-api-client-v2/models/SyntheticsApiMultistepParentTestsResponse.ts create mode 100644 packages/datadog-api-client-v2/models/SyntheticsApiMultistepSubtestAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/SyntheticsApiMultistepSubtestData.ts create mode 100644 packages/datadog-api-client-v2/models/SyntheticsApiMultistepSubtestType.ts create mode 100644 packages/datadog-api-client-v2/models/SyntheticsApiMultistepSubtestsResponse.ts create mode 100644 packages/datadog-api-client-v2/models/SyntheticsTestParentSuiteAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/SyntheticsTestParentSuiteData.ts create mode 100644 packages/datadog-api-client-v2/models/SyntheticsTestParentSuiteType.ts create mode 100644 packages/datadog-api-client-v2/models/SyntheticsTestParentSuitesResponse.ts create mode 100644 packages/datadog-api-client-v2/models/SyntheticsTestVersionActionMetadata.ts create mode 100644 packages/datadog-api-client-v2/models/SyntheticsTestVersionAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/SyntheticsTestVersionAuthor.ts create mode 100644 packages/datadog-api-client-v2/models/SyntheticsTestVersionChangeAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/SyntheticsTestVersionChangeData.ts create mode 100644 packages/datadog-api-client-v2/models/SyntheticsTestVersionChangeMetadataItem.ts create mode 100644 packages/datadog-api-client-v2/models/SyntheticsTestVersionChangeType.ts create mode 100644 packages/datadog-api-client-v2/models/SyntheticsTestVersionData.ts create mode 100644 packages/datadog-api-client-v2/models/SyntheticsTestVersionDiffPatchDiff.ts create mode 100644 packages/datadog-api-client-v2/models/SyntheticsTestVersionDiffPatches.ts create mode 100644 packages/datadog-api-client-v2/models/SyntheticsTestVersionHistoryMeta.ts create mode 100644 packages/datadog-api-client-v2/models/SyntheticsTestVersionHistoryResponse.ts create mode 100644 packages/datadog-api-client-v2/models/SyntheticsTestVersionResponse.ts create mode 100644 packages/datadog-api-client-v2/models/SyntheticsTestVersionType.ts create mode 100644 packages/datadog-api-client-v2/models/WidgetAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/WidgetData.ts create mode 100644 packages/datadog-api-client-v2/models/WidgetDefinition.ts create mode 100644 packages/datadog-api-client-v2/models/WidgetExperienceType.ts create mode 100644 packages/datadog-api-client-v2/models/WidgetIncludedUser.ts create mode 100644 packages/datadog-api-client-v2/models/WidgetIncludedUserAttributes.ts create mode 100644 packages/datadog-api-client-v2/models/WidgetListResponse.ts create mode 100644 packages/datadog-api-client-v2/models/WidgetRelationshipData.ts create mode 100644 packages/datadog-api-client-v2/models/WidgetRelationshipItem.ts create mode 100644 packages/datadog-api-client-v2/models/WidgetRelationships.ts create mode 100644 packages/datadog-api-client-v2/models/WidgetResponse.ts create mode 100644 packages/datadog-api-client-v2/models/WidgetSearchMeta.ts create mode 100644 packages/datadog-api-client-v2/models/WidgetType.ts diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index f45d9a1cc953..f1ef3930eef6 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -15324,6 +15324,41 @@ components: id: $ref: "#/components/schemas/ApiID" type: object + CreateOrUpdateWidgetRequest: + description: Request body for creating or updating a widget. + properties: + data: + $ref: "#/components/schemas/CreateOrUpdateWidgetRequestData" + required: + - data + type: object + CreateOrUpdateWidgetRequestAttributes: + description: Attributes for creating or updating a widget. + properties: + definition: + $ref: "#/components/schemas/WidgetDefinition" + tags: + description: User-defined tags for organizing the widget. + items: + type: string + nullable: true + type: array + required: + - definition + type: object + CreateOrUpdateWidgetRequestData: + description: Data for creating or updating a widget. + properties: + attributes: + $ref: "#/components/schemas/CreateOrUpdateWidgetRequestAttributes" + type: + description: Widgets resource type. + example: widgets + type: string + required: + - type + - attributes + type: object CreatePageRequest: description: Full request to trigger an On-Call Page. example: @@ -64427,6 +64462,40 @@ components: required: - data type: object + SuiteJsonPatchRequest: + description: JSON Patch request for a Synthetic test suite. + properties: + data: + $ref: "#/components/schemas/SuiteJsonPatchRequestData" + required: + - data + type: object + SuiteJsonPatchRequestData: + description: Data object for a JSON Patch request on a Synthetic test suite. + properties: + attributes: + $ref: "#/components/schemas/SuiteJsonPatchRequestDataAttributes" + type: + $ref: "#/components/schemas/SuiteJsonPatchType" + type: object + SuiteJsonPatchRequestDataAttributes: + description: Attributes for a JSON Patch request on a Synthetic test suite. + properties: + json_patch: + description: JSON Patch operations following RFC 6902. + items: + $ref: "#/components/schemas/JsonPatchOperation" + type: array + type: object + SuiteJsonPatchType: + default: suites_json_patch + description: Type for a JSON Patch request on a Synthetic test suite, `suites_json_patch`. + enum: + - suites_json_patch + example: suites_json_patch + type: string + x-enum-varnames: + - SUITES_JSON_PATCH SuiteSearchResponseType: default: suites_search description: Type for the Synthetics suites search response, `suites_search`. @@ -64486,6 +64555,114 @@ components: description: The direction and type of synchronization for this property. type: string type: object + SyntheticsApiMultistepParentTestAttributes: + description: Attributes of a parent API multistep test. + properties: + child_name: + description: The name of the child subtest. + example: My API Subtest + type: string + child_public_id: + description: The public ID of the child subtest. + example: xyz-uvw-789 + type: string + monitor_id: + description: The associated monitor ID. + example: 12345678 + format: int64 + type: integer + name: + description: Name of the parent test. + example: My Multistep Test + type: string + overall_state: + description: The overall state of the parent test. + example: 0 + format: int64 + type: integer + overall_state_modified: + description: Timestamp of when the overall state was last modified. + example: "2024-01-01T00:00:00+00:00" + type: string + public_id: + description: The public ID of the parent test. + example: abc-def-123 + type: string + type: object + SyntheticsApiMultistepParentTestData: + description: Data object for a parent API multistep test. + properties: + attributes: + $ref: "#/components/schemas/SyntheticsApiMultistepParentTestAttributes" + id: + description: The public ID of the parent test. + example: abc-def-123 + type: string + type: + $ref: "#/components/schemas/SyntheticsApiMultistepParentTestType" + type: object + SyntheticsApiMultistepParentTestType: + default: parent_test + description: Type of the parent test resource. + enum: + - parent_test + example: parent_test + type: string + x-enum-varnames: + - PARENT_TEST + SyntheticsApiMultistepParentTestsResponse: + description: |- + Response containing the list of parent tests for an API multistep subtest. + properties: + data: + description: List of parent tests that include this subtest. + items: + $ref: "#/components/schemas/SyntheticsApiMultistepParentTestData" + type: array + type: object + SyntheticsApiMultistepSubtestAttributes: + description: Attributes of a Synthetic API multistep subtest. + properties: + name: + description: Name of the subtest. + example: My API Test + type: string + public_id: + description: The public ID of the subtest. + example: abc-def-123 + type: string + type: object + SyntheticsApiMultistepSubtestData: + description: Data object for a Synthetic API multistep subtest. + properties: + attributes: + $ref: "#/components/schemas/SyntheticsApiMultistepSubtestAttributes" + id: + description: The public ID of the subtest. + example: abc-def-123 + type: string + type: + $ref: "#/components/schemas/SyntheticsApiMultistepSubtestType" + type: object + SyntheticsApiMultistepSubtestType: + default: subtest + description: Type of the subtest resource. + enum: + - subtest + example: subtest + type: string + x-enum-varnames: + - SUBTEST + SyntheticsApiMultistepSubtestsResponse: + description: |- + Response containing the list of available subtests for an API multistep test. + properties: + data: + description: List of API tests that can be added as subtests. + items: + $ref: "#/components/schemas/SyntheticsApiMultistepSubtestData" + type: array + type: object SyntheticsFastTestAssertionResult: additionalProperties: {} description: Result of a single assertion evaluated during a fast test run. @@ -65466,6 +65643,70 @@ components: - from - to type: object + SyntheticsTestParentSuiteAttributes: + description: Object containing details about a parent suite of a Synthetic test. + properties: + child_name: + description: The name of the child test within the suite. + example: My API Test + type: string + child_public_id: + description: The public ID of the child test within the suite. + example: xyz-uvw-789 + type: string + monitor_id: + description: The associated monitor ID. + example: 12345678 + format: int64 + type: integer + name: + description: Name of the parent suite. + example: My Suite + type: string + overall_state: + description: The overall state of the parent suite. + example: 0 + format: int64 + type: integer + overall_state_modified: + description: Timestamp of when the overall state was last modified. + example: "2024-01-01T00:00:00+00:00" + type: string + public_id: + description: The public ID of the parent suite. + example: abc-def-123 + type: string + type: object + SyntheticsTestParentSuiteData: + description: Data object for a parent suite. + properties: + attributes: + $ref: "#/components/schemas/SyntheticsTestParentSuiteAttributes" + id: + description: The public ID of the parent suite. + example: abc-def-123 + type: string + type: + $ref: "#/components/schemas/SyntheticsTestParentSuiteType" + type: object + SyntheticsTestParentSuiteType: + default: parent_suite + description: Type of the parent suite resource. + enum: + - parent_suite + example: parent_suite + type: string + x-enum-varnames: + - PARENT_SUITE + SyntheticsTestParentSuitesResponse: + description: Response containing the list of parent suites for a Synthetic test. + properties: + data: + description: List of parent suites for the given test. + items: + $ref: "#/components/schemas/SyntheticsTestParentSuiteData" + type: array + type: object SyntheticsTestPauseStatus: description: |- Define whether you want to start (`live`) or pause (`paused`) a @@ -65478,6 +65719,208 @@ components: x-enum-varnames: - LIVE - PAUSED + SyntheticsTestVersionActionMetadata: + description: Object containing metadata about a change action. + properties: + after_value: + description: The value of the property after the change. + before_value: + description: The value of the property before the change. + diff_patches: + description: List of diff patches for text changes. + items: + $ref: "#/components/schemas/SyntheticsTestVersionDiffPatches" + nullable: true + type: array + property_path: + description: The dot-separated path of the property that was changed. + type: string + type: object + SyntheticsTestVersionAttributes: + description: Attributes of a specific Synthetic test version. + properties: + author: + $ref: "#/components/schemas/SyntheticsTestVersionAuthor" + change_metadata: + description: |- + List of metadata describing individual changes in this version. + Only returned when the `include_change_metadata` query parameter is `true`. + items: + $ref: "#/components/schemas/SyntheticsTestVersionChangeMetadataItem" + type: array + payload: + additionalProperties: {} + description: The full test configuration at this version. + type: object + version_payload_created_at: + description: Timestamp of when this version was created. + example: "2024-01-01T00:00:00+00:00" + format: date-time + type: string + type: object + SyntheticsTestVersionAuthor: + description: Object describing the author of a test version. + properties: + email: + description: Email address of the author. + example: john.doe@example.com + type: string + handle: + description: The author's Datadog handle (login username). + example: john.doe + type: string + id: + description: UUID of the author. + example: "00000000-0000-0000-0000-000000000000" + type: string + name: + description: Display name of the author. + example: John Doe + type: string + type: object + SyntheticsTestVersionChangeAttributes: + description: Attributes of a version change record. + properties: + author_uuid: + description: UUID of the user who created this version. + example: "00000000-0000-0000-0000-000000000000" + type: string + change_metadata: + description: List of metadata describing individual changes in this version. + items: + $ref: "#/components/schemas/SyntheticsTestVersionChangeMetadataItem" + type: array + version_number: + description: The sequential version number. + example: 5 + format: int64 + type: integer + version_payload_created_at: + description: Timestamp of when this version was created. + example: "2024-01-01T00:00:00+00:00" + format: date-time + type: string + type: object + SyntheticsTestVersionChangeData: + description: Data object for a version change record. + properties: + attributes: + $ref: "#/components/schemas/SyntheticsTestVersionChangeAttributes" + id: + description: UUID of the version change record. + example: "00000000-0000-0000-0000-000000000000" + type: string + type: + $ref: "#/components/schemas/SyntheticsTestVersionChangeType" + type: object + SyntheticsTestVersionChangeMetadataItem: + description: Object describing a single change within a version. + properties: + action: + description: The action that was performed (for example, `updated` or `created`). + type: string + action_metadata: + $ref: "#/components/schemas/SyntheticsTestVersionActionMetadata" + type: object + SyntheticsTestVersionChangeType: + default: version_metadata + description: Type of the version metadata resource. + enum: + - version_metadata + example: version_metadata + type: string + x-enum-varnames: + - VERSION_METADATA + SyntheticsTestVersionData: + description: Data object for a specific Synthetic test version. + properties: + attributes: + $ref: "#/components/schemas/SyntheticsTestVersionAttributes" + id: + description: UUID of the version record. + example: "00000000-0000-0000-0000-000000000000" + type: string + type: + $ref: "#/components/schemas/SyntheticsTestVersionType" + type: object + SyntheticsTestVersionDiffPatchDiff: + description: Object describing a single text diff operation. + properties: + change_text: + description: The text that was changed. + type: string + operation: + description: The diff operation applied. + type: string + type: object + SyntheticsTestVersionDiffPatches: + description: Object describing a patch in the diff. + properties: + diffs: + description: List of individual diff operations. + items: + $ref: "#/components/schemas/SyntheticsTestVersionDiffPatchDiff" + type: array + length1: + description: Length of the original text segment. + format: int64 + type: integer + length2: + description: Length of the modified text segment. + format: int64 + type: integer + start1: + description: Start position in the original text. + format: int64 + type: integer + start2: + description: Start position in the modified text. + format: int64 + type: integer + type: object + SyntheticsTestVersionHistoryMeta: + description: Pagination metadata for a version history response. + properties: + next_last_version_number: + description: |- + The version number to use as the `last_version_number` query parameter + to fetch the next page. `null` indicates there are no more pages. + example: 3 + format: int64 + nullable: true + type: integer + retention_period_in_days: + description: The number of days that version history is retained. + example: 30 + format: int64 + type: integer + type: object + SyntheticsTestVersionHistoryResponse: + description: Response containing the paginated version history for a Synthetic test. + properties: + data: + description: List of version change records. + items: + $ref: "#/components/schemas/SyntheticsTestVersionChangeData" + type: array + meta: + $ref: "#/components/schemas/SyntheticsTestVersionHistoryMeta" + type: object + SyntheticsTestVersionResponse: + description: Response containing a specific version of a Synthetic test. + properties: + data: + $ref: "#/components/schemas/SyntheticsTestVersionData" + type: object + SyntheticsTestVersionType: + default: version + description: Type of the version resource. + enum: + - version + example: version + type: string + x-enum-varnames: + - VERSION SyntheticsVariableParser: description: Details of the parser to use for the global variable. example: @@ -71675,6 +72118,136 @@ components: - FRIDAY - SATURDAY - SUNDAY + WidgetAttributes: + description: Attributes of a widget resource. + properties: + created_at: + description: ISO 8601 timestamp of when the widget was created. + example: "2024-01-15T00:00:00.000Z" + type: string + definition: + $ref: "#/components/schemas/WidgetDefinition" + is_favorited: + description: "Will be implemented soon. Currently always returns false." + example: false + type: boolean + modified_at: + description: ISO 8601 timestamp of when the widget was last modified. + example: "2024-01-15T00:00:00.000Z" + type: string + tags: + description: User-defined tags for organizing widgets. + example: + - "team:my-team" + items: + type: string + nullable: true + type: array + required: + - definition + - tags + - is_favorited + - created_at + - modified_at + type: object + WidgetData: + description: A widget resource object. + properties: + attributes: + $ref: "#/components/schemas/WidgetAttributes" + id: + description: The unique identifier of the widget. + example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + type: string + relationships: + $ref: "#/components/schemas/WidgetRelationships" + type: + description: Widgets resource type. + example: widgets + type: string + required: + - id + - type + - attributes + type: object + WidgetDefinition: + additionalProperties: {} + description: The definition of a widget, including its type and configuration. + properties: + title: + description: The display title of the widget. + example: My Widget + maxLength: 100 + minLength: 1 + type: string + type: + $ref: "#/components/schemas/WidgetType" + required: + - type + - title + type: object + WidgetExperienceType: + description: Widget experience types that differentiate between the products using the specific widget. + enum: + - ccm_reports + - logs_reports + - csv_reports + - product_analytics + example: ccm_reports + type: string + x-enum-varnames: + - CCM_REPORTS + - LOGS_REPORTS + - CSV_REPORTS + - PRODUCT_ANALYTICS + WidgetIncludedUser: + description: A user resource included in the response. + properties: + attributes: + $ref: "#/components/schemas/WidgetIncludedUserAttributes" + id: + description: The unique identifier of the user. + example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + type: string + type: + description: Users resource type. + example: users + type: string + required: + - id + - type + type: object + WidgetIncludedUserAttributes: + description: Attributes of an included user resource. + properties: + handle: + description: The email handle of the user. + example: "john.doe@example.com" + type: string + name: + description: The display name of the user. + example: "John Doe" + nullable: true + type: string + type: object + WidgetListResponse: + description: Response containing a list of widgets. + properties: + data: + description: List of widget resources. + items: + $ref: "#/components/schemas/WidgetData" + type: array + included: + description: Array of user resources related to the widgets. + items: + $ref: "#/components/schemas/WidgetIncludedUser" + type: array + meta: + $ref: "#/components/schemas/WidgetSearchMeta" + required: + - data + type: object WidgetLiveSpan: description: The available timeframes depend on the widget you are using. enum: @@ -71711,6 +72284,108 @@ components: - PAST_SIX_MONTHS - PAST_ONE_YEAR - ALERT + WidgetRelationshipData: + description: Relationship data referencing a user resource. + properties: + id: + description: The unique identifier of the user. + example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + type: string + type: + description: Users resource type. + example: users + type: string + required: + - id + - type + type: object + WidgetRelationshipItem: + description: A JSON:API relationship to a user. + properties: + data: + $ref: "#/components/schemas/WidgetRelationshipData" + type: object + WidgetRelationships: + description: Relationships of the widget resource. + properties: + created_by: + $ref: "#/components/schemas/WidgetRelationshipItem" + description: The user who created the widget. + modified_by: + $ref: "#/components/schemas/WidgetRelationshipItem" + description: The user who last modified the widget. + type: object + WidgetResponse: + description: Response containing a single widget. + properties: + data: + $ref: "#/components/schemas/WidgetData" + included: + description: Array of user resources related to the widget. + items: + $ref: "#/components/schemas/WidgetIncludedUser" + type: array + required: + - data + type: object + WidgetSearchMeta: + description: Metadata about the search results. + properties: + created_by_anyone_total: + description: Total number of widgets created by anyone. + format: int64 + type: integer + created_by_you_total: + description: Total number of widgets created by the current user. + format: int64 + type: integer + favorited_by_you_total: + description: Total number of widgets favorited by the current user. + format: int64 + type: integer + filtered_total: + description: Total number of widgets matching the current filter criteria. + format: int64 + type: integer + type: object + WidgetType: + description: |- + Widget types that are allowed to be stored as individual records. + This is not a complete list of dashboard and notebook widget types. + enum: + - bar_chart + - change + - cloud_cost_summary + - cohort + - funnel + - geomap + - list_stream + - query_table + - query_value + - retention_curve + - sankey + - sunburst + - timeseries + - toplist + - treemap + example: bar_chart + type: string + x-enum-varnames: + - BAR_CHART + - CHANGE + - CLOUD_COST_SUMMARY + - COHORT + - FUNNEL + - GEOMAP + - LIST_STREAM + - QUERY_TABLE + - QUERY_VALUE + - RETENTION_CURVE + - SANKEY + - SUNBURST + - TIMESERIES + - TOPLIST + - TREEMAP WorkflowData: description: Data related to the workflow. properties: @@ -106105,6 +106780,80 @@ paths: operator: AND permissions: - status_pages_incident_write + /api/v2/synthetics/api-multistep/subtests/{public_id}: + get: + description: |- + Get the list of API tests that can be added as subtests to a given API multistep test. + The current test is excluded from the list since a test cannot be a subtest of itself. + operationId: GetApiMultistepSubtests + parameters: + - description: The public ID of the API multistep test. + in: path + name: public_id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/SyntheticsApiMultistepSubtestsResponse" + description: OK + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_read + summary: Get available subtests for a multistep test + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_read + /api/v2/synthetics/api-multistep/subtests/{public_id}/parents: + get: + description: |- + Get the list of API multistep tests that include a given subtest, + along with their monitor status. + operationId: GetApiMultistepSubtestParents + parameters: + - description: The public ID of the subtest. + in: path + name: public_id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/SyntheticsApiMultistepParentTestsResponse" + description: OK + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_read + summary: Get parent tests for a subtest + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_read /api/v2/synthetics/settings/on_demand_concurrency_cap: get: description: Get the on-demand concurrency cap. @@ -106373,6 +107122,61 @@ paths: operator: OR permissions: - synthetics_write + /api/v2/synthetics/suites/{public_id}/jsonpatch: + patch: + description: |- + Patch a Synthetic test suite using JSON Patch (RFC 6902). + Use partial updates to modify only specific fields of a test suite. + + Common operations include: + - Replace field values: `{"op": "replace", "path": "/name", "value": "new_name"}` + - Add/update tags: `{"op": "add", "path": "/tags/-", "value": "new_tag"}` + - Remove fields: `{"op": "remove", "path": "/message"}` + operationId: PatchTestSuite + parameters: + - description: The public ID of the Synthetic test suite to patch. + in: path + name: public_id + required: true + schema: + example: 123-abc-456 + type: string + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/SuiteJsonPatchRequest" + description: JSON Patch document with operations to apply. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/SyntheticsSuiteResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_write + summary: Patch a test suite + tags: + - Synthetics + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - synthetics_write + - synthetics_create_edit_trigger /api/v2/synthetics/tests/bulk-delete: post: operationId: DeleteSyntheticsTests @@ -106589,6 +107393,162 @@ paths: 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. + operationId: GetTestParentSuites + parameters: + - description: The public ID of the Synthetic test. + in: path + name: public_id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/SyntheticsTestParentSuitesResponse" + description: OK + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_read + summary: Get parent suites for a test + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_read + /api/v2/synthetics/tests/{public_id}/version_history: + get: + description: Get the paginated version history for a Synthetic test. + operationId: ListSyntheticsTestVersions + parameters: + - description: The public ID of the Synthetic test. + in: path + name: public_id + required: true + schema: + type: string + - description: The version number of the last item from the previous page. Omit to get the first page. + in: query + name: last_version_number + required: false + schema: + format: int64 + type: integer + - description: Maximum number of version records to return per page. + in: query + name: limit + required: false + schema: + format: int64 + maximum: 50 + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/SyntheticsTestVersionHistoryResponse" + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "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 version history of a test + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_read + /api/v2/synthetics/tests/{public_id}/version_history/{version_number}: + get: + description: Get a specific version of a Synthetic test by its version number. + operationId: GetSyntheticsTestVersion + parameters: + - description: The public ID of the Synthetic test. + in: path + name: public_id + required: true + schema: + type: string + - description: The version number to retrieve. + in: path + name: version_number + required: true + schema: + format: int64 + type: integer + - description: If `true`, include change metadata in the response. + in: query + name: include_change_metadata + required: false + schema: + type: boolean + - description: |- + If `true`, only check whether the version exists without returning its full payload. + Returns an empty object if the version exists, or 404 if not. + in: query + name: only_check_existence + required: false + schema: + type: boolean + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/SyntheticsTestVersionResponse" + description: OK + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_read + summary: Get a specific version of a test + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_read /api/v2/synthetics/variables/{variable_id}/jsonpatch: patch: description: |- @@ -109866,6 +110826,328 @@ paths: operator: OR permissions: - teams_read + /api/v2/widgets/{experience_type}: + get: + description: Search and list widgets for a given experience type. Supports filtering by widget type, creator, title, and tags, as well as sorting and pagination. + operationId: SearchWidgets + parameters: + - description: The experience type for the widget. + in: path + name: experience_type + required: true + schema: + $ref: "#/components/schemas/WidgetExperienceType" + - description: Filter widgets by widget type. + in: query + name: filter[widgetType] + schema: + $ref: "#/components/schemas/WidgetType" + - description: Filter widgets by the email handle of the creator. + in: query + name: filter[creatorHandle] + schema: + example: "john.doe@example.com" + type: string + - description: Filter to only widgets favorited by the current user. + in: query + name: filter[isFavorited] + schema: + type: boolean + - description: Filter widgets by title (substring match). + in: query + name: filter[title] + schema: + type: string + - description: Filter widgets by tags. Format as bracket-delimited CSV, e.g. `[tag1,tag2]`. + in: query + name: filter[tags] + schema: + type: string + - description: |- + Sort field for the results. Prefix with `-` for descending order. + Allowed values: `title`, `created_at`, `modified_at`. + in: query + name: sort + schema: + default: "-modified_at" + example: "-modified_at" + type: string + - description: Page number for pagination (0-indexed). + in: query + name: page[number] + schema: + default: 0 + minimum: 0 + type: integer + - description: Number of widgets per page. + in: query + name: page[size] + schema: + default: 50 + maximum: 100 + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/WidgetListResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Search widgets + tags: + - Widgets + x-permission: + operator: OR + permissions: + - cloud_cost_management_read + - generate_log_reports + - manage_log_reports + - product_analytics_saved_widgets_read + post: + description: Create a new widget for a given experience type. + operationId: CreateWidget + parameters: + - description: The experience type for the widget. + in: path + name: experience_type + required: true + schema: + $ref: "#/components/schemas/WidgetExperienceType" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/CreateOrUpdateWidgetRequest" + description: Widget request body. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/WidgetResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create a widget + tags: + - Widgets + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - cloud_cost_management_write + - generate_log_reports + - manage_log_reports + - product_analytics_saved_widgets_write + /api/v2/widgets/{experience_type}/{uuid}: + delete: + description: Soft-delete a widget by its UUID for a given experience type. + operationId: DeleteWidget + parameters: + - description: The experience type for the widget. + in: path + name: experience_type + required: true + schema: + $ref: "#/components/schemas/WidgetExperienceType" + - description: The UUID of the widget. + in: path + name: uuid + required: true + schema: + format: uuid + type: string + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Delete a widget + tags: + - Widgets + x-permission: + operator: OR + permissions: + - cloud_cost_management_write + - generate_log_reports + - manage_log_reports + - product_analytics_saved_widgets_write + get: + description: Retrieve a widget by its UUID for a given experience type. + operationId: GetWidget + parameters: + - description: The experience type for the widget. + in: path + name: experience_type + required: true + schema: + $ref: "#/components/schemas/WidgetExperienceType" + - description: The UUID of the widget. + in: path + name: uuid + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/WidgetResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get a widget + tags: + - Widgets + x-permission: + operator: OR + permissions: + - cloud_cost_management_read + - generate_log_reports + - manage_log_reports + - product_analytics_saved_widgets_read + put: + description: Update a widget by its UUID for a given experience type. This performs a full replacement of the widget definition. + operationId: UpdateWidget + parameters: + - description: The experience type for the widget. + in: path + name: experience_type + required: true + schema: + $ref: "#/components/schemas/WidgetExperienceType" + - description: The UUID of the widget. + in: path + name: uuid + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/CreateOrUpdateWidgetRequest" + description: Widget request body. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/WidgetResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Update a widget + tags: + - Widgets + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - cloud_cost_management_write + - generate_log_reports + - manage_log_reports + - product_analytics_saved_widgets_write /api/v2/workflows: post: description: Create a new workflow, returning the workflow ID. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). Alternatively, you can configure these permissions [in the UI](https://docs.datadoghq.com/account_management/api-app-keys/#actions-api-access). @@ -110716,6 +111998,11 @@ tags: externalDocs: url: https://docs.datadoghq.com/account_management/users name: Users + - description: |- + Create, read, update, and delete saved widgets. Widgets are reusable + visualization components stored independently from any dashboard or notebook, + partitioned by experience type and identified by a UUID. + name: Widgets - description: |- Datadog Workflow Automation allows you to automate your end-to-end processes by connecting Datadog with the rest of your tech stack. Build workflows to auto-remediate your alerts, streamline your incident and security processes, and reduce manual toil. Workflow Automation supports over 1,000+ OOTB actions, including AWS, JIRA, ServiceNow, GitHub, and OpenAI. Learn more in our Workflow Automation docs [here](https://docs.datadoghq.com/service_management/workflows/). externalDocs: diff --git a/examples/v2/synthetics/GetApiMultistepSubtestParents.ts b/examples/v2/synthetics/GetApiMultistepSubtestParents.ts new file mode 100644 index 000000000000..4317b82f6472 --- /dev/null +++ b/examples/v2/synthetics/GetApiMultistepSubtestParents.ts @@ -0,0 +1,21 @@ +/** + * Get parent tests for a subtest returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.SyntheticsApi(configuration); + +const params: v2.SyntheticsApiGetApiMultistepSubtestParentsRequest = { + publicId: "public_id", +}; + +apiInstance + .getApiMultistepSubtestParents(params) + .then((data: v2.SyntheticsApiMultistepParentTestsResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/synthetics/GetApiMultistepSubtests.ts b/examples/v2/synthetics/GetApiMultistepSubtests.ts new file mode 100644 index 000000000000..eacae40ab7e8 --- /dev/null +++ b/examples/v2/synthetics/GetApiMultistepSubtests.ts @@ -0,0 +1,21 @@ +/** + * Get available subtests for a multistep test returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.SyntheticsApi(configuration); + +const params: v2.SyntheticsApiGetApiMultistepSubtestsRequest = { + publicId: "public_id", +}; + +apiInstance + .getApiMultistepSubtests(params) + .then((data: v2.SyntheticsApiMultistepSubtestsResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/synthetics/GetSyntheticsTestVersion.ts b/examples/v2/synthetics/GetSyntheticsTestVersion.ts new file mode 100644 index 000000000000..4d6d75f9b665 --- /dev/null +++ b/examples/v2/synthetics/GetSyntheticsTestVersion.ts @@ -0,0 +1,22 @@ +/** + * Get a specific version of a test returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.SyntheticsApi(configuration); + +const params: v2.SyntheticsApiGetSyntheticsTestVersionRequest = { + publicId: "public_id", + versionNumber: 9223372036854775807, +}; + +apiInstance + .getSyntheticsTestVersion(params) + .then((data: v2.SyntheticsTestVersionResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/synthetics/GetTestParentSuites.ts b/examples/v2/synthetics/GetTestParentSuites.ts new file mode 100644 index 000000000000..7d17c878c495 --- /dev/null +++ b/examples/v2/synthetics/GetTestParentSuites.ts @@ -0,0 +1,21 @@ +/** + * Get parent suites for a test returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.SyntheticsApi(configuration); + +const params: v2.SyntheticsApiGetTestParentSuitesRequest = { + publicId: "public_id", +}; + +apiInstance + .getTestParentSuites(params) + .then((data: v2.SyntheticsTestParentSuitesResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/synthetics/ListSyntheticsTestVersions.ts b/examples/v2/synthetics/ListSyntheticsTestVersions.ts new file mode 100644 index 000000000000..a390e7312a09 --- /dev/null +++ b/examples/v2/synthetics/ListSyntheticsTestVersions.ts @@ -0,0 +1,21 @@ +/** + * Get version history of a test returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.SyntheticsApi(configuration); + +const params: v2.SyntheticsApiListSyntheticsTestVersionsRequest = { + publicId: "public_id", +}; + +apiInstance + .listSyntheticsTestVersions(params) + .then((data: v2.SyntheticsTestVersionHistoryResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/synthetics/PatchTestSuite.ts b/examples/v2/synthetics/PatchTestSuite.ts new file mode 100644 index 000000000000..1c42386e9ac4 --- /dev/null +++ b/examples/v2/synthetics/PatchTestSuite.ts @@ -0,0 +1,34 @@ +/** + * Patch a test suite returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.SyntheticsApi(configuration); + +const params: v2.SyntheticsApiPatchTestSuiteRequest = { + body: { + data: { + attributes: { + jsonPatch: [ + { + op: "add", + path: "/name", + }, + ], + }, + type: "suites_json_patch", + }, + }, + publicId: "123-abc-456", +}; + +apiInstance + .patchTestSuite(params) + .then((data: v2.SyntheticsSuiteResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/widgets/CreateWidget.ts b/examples/v2/widgets/CreateWidget.ts new file mode 100644 index 000000000000..fca2cd11e170 --- /dev/null +++ b/examples/v2/widgets/CreateWidget.ts @@ -0,0 +1,33 @@ +/** + * Create a widget returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.WidgetsApi(configuration); + +const params: v2.WidgetsApiCreateWidgetRequest = { + body: { + data: { + attributes: { + definition: { + title: "My Widget", + type: "bar_chart", + }, + tags: [], + }, + type: "widgets", + }, + }, + experienceType: "ccm_reports", +}; + +apiInstance + .createWidget(params) + .then((data: v2.WidgetResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/widgets/DeleteWidget.ts b/examples/v2/widgets/DeleteWidget.ts new file mode 100644 index 000000000000..876e8072c8c6 --- /dev/null +++ b/examples/v2/widgets/DeleteWidget.ts @@ -0,0 +1,22 @@ +/** + * Delete a widget returns "No Content" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.WidgetsApi(configuration); + +const params: v2.WidgetsApiDeleteWidgetRequest = { + experienceType: "ccm_reports", + uuid: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", +}; + +apiInstance + .deleteWidget(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/widgets/GetWidget.ts b/examples/v2/widgets/GetWidget.ts new file mode 100644 index 000000000000..67ba6df36f7f --- /dev/null +++ b/examples/v2/widgets/GetWidget.ts @@ -0,0 +1,22 @@ +/** + * Get a widget returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.WidgetsApi(configuration); + +const params: v2.WidgetsApiGetWidgetRequest = { + experienceType: "ccm_reports", + uuid: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", +}; + +apiInstance + .getWidget(params) + .then((data: v2.WidgetResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/widgets/SearchWidgets.ts b/examples/v2/widgets/SearchWidgets.ts new file mode 100644 index 000000000000..3ef86a402a23 --- /dev/null +++ b/examples/v2/widgets/SearchWidgets.ts @@ -0,0 +1,21 @@ +/** + * Search widgets returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.WidgetsApi(configuration); + +const params: v2.WidgetsApiSearchWidgetsRequest = { + experienceType: "ccm_reports", +}; + +apiInstance + .searchWidgets(params) + .then((data: v2.WidgetListResponse) => { + console.log( + "API called successfully. Returned data: " + JSON.stringify(data) + ); + }) + .catch((error: any) => console.error(error)); diff --git a/examples/v2/widgets/UpdateWidget.ts b/examples/v2/widgets/UpdateWidget.ts new file mode 100644 index 000000000000..ce47306b0bee --- /dev/null +++ b/examples/v2/widgets/UpdateWidget.ts @@ -0,0 +1,34 @@ +/** + * Update a widget returns "OK" response + */ + +import { client, v2 } from "@datadog/datadog-api-client"; + +const configuration = client.createConfiguration(); +const apiInstance = new v2.WidgetsApi(configuration); + +const params: v2.WidgetsApiUpdateWidgetRequest = { + body: { + data: { + attributes: { + definition: { + title: "My Widget", + type: "bar_chart", + }, + tags: [], + }, + type: "widgets", + }, + }, + experienceType: "ccm_reports", + uuid: "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", +}; + +apiInstance + .updateWidget(params) + .then((data: v2.WidgetResponse) => { + 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 777bb863a27b..e2e6960458b1 100644 --- a/features/support/scenarios_model_mapping.ts +++ b/features/support/scenarios_model_mapping.ts @@ -11096,6 +11096,20 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "Maintenance", }, + "v2.GetApiMultistepSubtests": { + "publicId": { + "type": "string", + "format": "", + }, + "operationResponseType": "SyntheticsApiMultistepSubtestsResponse", + }, + "v2.GetApiMultistepSubtestParents": { + "publicId": { + "type": "string", + "format": "", + }, + "operationResponseType": "SyntheticsApiMultistepParentTestsResponse", + }, "v2.GetOnDemandConcurrencyCap": { "operationResponseType": "OnDemandConcurrencyCapResponse", }, @@ -11161,6 +11175,17 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "SyntheticsSuiteResponse", }, + "v2.PatchTestSuite": { + "publicId": { + "type": "string", + "format": "", + }, + "body": { + "type": "SuiteJsonPatchRequest", + "format": "", + }, + "operationResponseType": "SyntheticsSuiteResponse", + }, "v2.DeleteSyntheticsTests": { "body": { "type": "DeletedTestsRequestDeleteRequest", @@ -11200,6 +11225,47 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "SyntheticsNetworkTestResponse", }, + "v2.GetTestParentSuites": { + "publicId": { + "type": "string", + "format": "", + }, + "operationResponseType": "SyntheticsTestParentSuitesResponse", + }, + "v2.ListSyntheticsTestVersions": { + "publicId": { + "type": "string", + "format": "", + }, + "lastVersionNumber": { + "type": "number", + "format": "int64", + }, + "limit": { + "type": "number", + "format": "int64", + }, + "operationResponseType": "SyntheticsTestVersionHistoryResponse", + }, + "v2.GetSyntheticsTestVersion": { + "publicId": { + "type": "string", + "format": "", + }, + "versionNumber": { + "type": "number", + "format": "int64", + }, + "includeChangeMetadata": { + "type": "boolean", + "format": "", + }, + "onlyCheckExistence": { + "type": "boolean", + "format": "", + }, + "operationResponseType": "SyntheticsTestVersionResponse", + }, "v2.PatchGlobalVariable": { "variableId": { "type": "string", @@ -11751,6 +11817,93 @@ export const ScenariosModelMappings: {[key: string]: {[key: string]: any}} = { }, "operationResponseType": "PermissionsResponse", }, + "v2.SearchWidgets": { + "experienceType": { + "type": "WidgetExperienceType", + "format": "", + }, + "filterWidgetType": { + "type": "WidgetType", + "format": "", + }, + "filterCreatorHandle": { + "type": "string", + "format": "", + }, + "filterIsFavorited": { + "type": "boolean", + "format": "", + }, + "filterTitle": { + "type": "string", + "format": "", + }, + "filterTags": { + "type": "string", + "format": "", + }, + "sort": { + "type": "string", + "format": "", + }, + "pageNumber": { + "type": "number", + "format": "", + }, + "pageSize": { + "type": "number", + "format": "", + }, + "operationResponseType": "WidgetListResponse", + }, + "v2.CreateWidget": { + "experienceType": { + "type": "WidgetExperienceType", + "format": "", + }, + "body": { + "type": "CreateOrUpdateWidgetRequest", + "format": "", + }, + "operationResponseType": "WidgetResponse", + }, + "v2.GetWidget": { + "experienceType": { + "type": "WidgetExperienceType", + "format": "", + }, + "uuid": { + "type": "string", + "format": "uuid", + }, + "operationResponseType": "WidgetResponse", + }, + "v2.UpdateWidget": { + "experienceType": { + "type": "WidgetExperienceType", + "format": "", + }, + "uuid": { + "type": "string", + "format": "uuid", + }, + "body": { + "type": "CreateOrUpdateWidgetRequest", + "format": "", + }, + "operationResponseType": "WidgetResponse", + }, + "v2.DeleteWidget": { + "experienceType": { + "type": "WidgetExperienceType", + "format": "", + }, + "uuid": { + "type": "string", + "format": "uuid", + }, + "operationResponseType": "{}", + }, "v2.CreateWorkflow": { "body": { "type": "CreateWorkflowRequest", diff --git a/features/v2/synthetics.feature b/features/v2/synthetics.feature index 418dbf5fb3ad..8ed9b98adf40 100644 --- a/features/v2/synthetics.feature +++ b/features/v2/synthetics.feature @@ -133,6 +133,22 @@ Feature: Synthetics 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 + And request contains "public_id" parameter from "REPLACE.ME" + And request contains "version_number" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Get a specific version of a test returns "OK" response + Given new "GetSyntheticsTestVersion" request + And request contains "public_id" parameter from "REPLACE.ME" + And request contains "version_number" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing Scenario: Get a suite returns "API error response." response Given new "GetSyntheticsSuite" request @@ -147,12 +163,61 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing + Scenario: Get available subtests for a multistep test returns "OK" response + Given new "GetApiMultistepSubtests" request + And request contains "public_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Get parent suites for a test returns "API error response." response + Given new "GetTestParentSuites" request + And request contains "public_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Get parent suites for a test returns "OK" response + Given new "GetTestParentSuites" request + And request contains "public_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Get parent tests for a subtest returns "API error response." response + Given new "GetApiMultistepSubtestParents" request + And request contains "public_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Get parent tests for a subtest returns "OK" response + Given new "GetApiMultistepSubtestParents" request + And request contains "public_id" parameter from "REPLACE.ME" + 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 When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing + Scenario: Get version history of a test returns "API error response." response + Given new "ListSyntheticsTestVersions" request + And request contains "public_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Get version history of a test returns "OK" response + Given new "ListSyntheticsTestVersions" request + And request contains "public_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing Scenario: Patch a global variable returns "Bad Request" response Given new "PatchGlobalVariable" request @@ -177,6 +242,22 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing + Scenario: Patch a test suite returns "API error response." response + Given new "PatchTestSuite" request + And request contains "public_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"json_patch": [{"op": "add", "path": "/name"}]}, "type": "suites_json_patch"}} + When the request is sent + Then the response status is 400 API error response. + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Patch a test suite returns "OK" response + Given new "PatchTestSuite" request + And request contains "public_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"json_patch": [{"op": "add", "path": "/name"}]}, "type": "suites_json_patch"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/synthetics-managing Scenario: Save new value for on-demand concurrency cap returns "OK" response Given new "SetOnDemandConcurrencyCap" request diff --git a/features/v2/undo.json b/features/v2/undo.json index 67596e3589cb..dcdc0219f9ca 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -5809,6 +5809,18 @@ "type": "idempotent" } }, + "GetApiMultistepSubtests": { + "tag": "Synthetics", + "undo": { + "type": "safe" + } + }, + "GetApiMultistepSubtestParents": { + "tag": "Synthetics", + "undo": { + "type": "safe" + } + }, "GetOnDemandConcurrencyCap": { "tag": "Synthetics", "undo": { @@ -5858,6 +5870,12 @@ "type": "idempotent" } }, + "PatchTestSuite": { + "tag": "Synthetics", + "undo": { + "type": "idempotent" + } + }, "DeleteSyntheticsTests": { "tag": "Synthetics", "undo": { @@ -5895,6 +5913,24 @@ "type": "idempotent" } }, + "GetTestParentSuites": { + "tag": "Synthetics", + "undo": { + "type": "safe" + } + }, + "ListSyntheticsTestVersions": { + "tag": "Synthetics", + "undo": { + "type": "safe" + } + }, + "GetSyntheticsTestVersion": { + "tag": "Synthetics", + "undo": { + "type": "safe" + } + }, "PatchGlobalVariable": { "tag": "Synthetics", "undo": { @@ -6356,6 +6392,47 @@ "type": "safe" } }, + "SearchWidgets": { + "tag": "Widgets", + "undo": { + "type": "safe" + } + }, + "CreateWidget": { + "tag": "Widgets", + "undo": { + "operationId": "DeleteWidget", + "parameters": [ + { + "name": "experience_type", + "source": "experience_type" + }, + { + "name": "uuid", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteWidget": { + "tag": "Widgets", + "undo": { + "type": "idempotent" + } + }, + "GetWidget": { + "tag": "Widgets", + "undo": { + "type": "safe" + } + }, + "UpdateWidget": { + "tag": "Widgets", + "undo": { + "type": "safe" + } + }, "CreateWorkflow": { "tag": "Workflow Automation", "undo": { diff --git a/features/v2/widgets.feature b/features/v2/widgets.feature new file mode 100644 index 000000000000..54b015711565 --- /dev/null +++ b/features/v2/widgets.feature @@ -0,0 +1,115 @@ +@endpoint(widgets) @endpoint(widgets-v2) +Feature: Widgets + Create, read, update, and delete saved widgets. Widgets are reusable + visualization components stored independently from any dashboard or + notebook, partitioned by experience type and identified by a UUID. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "Widgets" API + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Create a widget returns "Bad Request" response + Given new "CreateWidget" request + And request contains "experience_type" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"definition": {"title": "My Widget", "type": "bar_chart"}, "tags": []}, "type": "widgets"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Create a widget returns "OK" response + Given new "CreateWidget" request + And request contains "experience_type" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"definition": {"title": "My Widget", "type": "bar_chart"}, "tags": []}, "type": "widgets"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Delete a widget returns "Bad Request" response + Given new "DeleteWidget" request + And request contains "experience_type" parameter from "REPLACE.ME" + And request contains "uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Delete a widget returns "No Content" response + Given new "DeleteWidget" request + And request contains "experience_type" parameter from "REPLACE.ME" + And request contains "uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Delete a widget returns "Not Found" response + Given new "DeleteWidget" request + And request contains "experience_type" parameter from "REPLACE.ME" + And request contains "uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Get a widget returns "Bad Request" response + Given new "GetWidget" request + And request contains "experience_type" parameter from "REPLACE.ME" + And request contains "uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Get a widget returns "Not Found" response + Given new "GetWidget" request + And request contains "experience_type" parameter from "REPLACE.ME" + And request contains "uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Get a widget returns "OK" response + Given new "GetWidget" request + And request contains "experience_type" parameter from "REPLACE.ME" + And request contains "uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Search widgets returns "Bad Request" response + Given new "SearchWidgets" request + And request contains "experience_type" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Search widgets returns "OK" response + Given new "SearchWidgets" request + And request contains "experience_type" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Update a widget returns "Bad Request" response + Given new "UpdateWidget" request + And request contains "experience_type" parameter from "REPLACE.ME" + And request contains "uuid" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"definition": {"title": "My Widget", "type": "bar_chart"}, "tags": []}, "type": "widgets"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Update a widget returns "Not Found" response + Given new "UpdateWidget" request + And request contains "experience_type" parameter from "REPLACE.ME" + And request contains "uuid" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"definition": {"title": "My Widget", "type": "bar_chart"}, "tags": []}, "type": "widgets"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Update a widget returns "OK" response + Given new "UpdateWidget" request + And request contains "experience_type" parameter from "REPLACE.ME" + And request contains "uuid" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"definition": {"title": "My Widget", "type": "bar_chart"}, "tags": []}, "type": "widgets"}} + When the request is sent + Then the response status is 200 OK diff --git a/packages/datadog-api-client-v2/apis/SyntheticsApi.ts b/packages/datadog-api-client-v2/apis/SyntheticsApi.ts index a80eddf684af..e390773ba036 100644 --- a/packages/datadog-api-client-v2/apis/SyntheticsApi.ts +++ b/packages/datadog-api-client-v2/apis/SyntheticsApi.ts @@ -26,11 +26,17 @@ import { GlobalVariableResponse } from "../models/GlobalVariableResponse"; import { OnDemandConcurrencyCapAttributes } from "../models/OnDemandConcurrencyCapAttributes"; import { OnDemandConcurrencyCapResponse } from "../models/OnDemandConcurrencyCapResponse"; import { SuiteCreateEditRequest } from "../models/SuiteCreateEditRequest"; +import { SuiteJsonPatchRequest } from "../models/SuiteJsonPatchRequest"; +import { SyntheticsApiMultistepParentTestsResponse } from "../models/SyntheticsApiMultistepParentTestsResponse"; +import { SyntheticsApiMultistepSubtestsResponse } from "../models/SyntheticsApiMultistepSubtestsResponse"; import { SyntheticsFastTestResult } from "../models/SyntheticsFastTestResult"; import { SyntheticsNetworkTestEditRequest } from "../models/SyntheticsNetworkTestEditRequest"; import { SyntheticsNetworkTestResponse } from "../models/SyntheticsNetworkTestResponse"; import { SyntheticsSuiteResponse } from "../models/SyntheticsSuiteResponse"; import { SyntheticsSuiteSearchResponse } from "../models/SyntheticsSuiteSearchResponse"; +import { SyntheticsTestParentSuitesResponse } from "../models/SyntheticsTestParentSuitesResponse"; +import { SyntheticsTestVersionHistoryResponse } from "../models/SyntheticsTestVersionHistoryResponse"; +import { SyntheticsTestVersionResponse } from "../models/SyntheticsTestVersionResponse"; export class SyntheticsApiRequestFactory extends BaseAPIRequestFactory { public async createSyntheticsNetworkTest( @@ -252,6 +258,76 @@ export class SyntheticsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async getApiMultistepSubtestParents( + publicId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'publicId' is not null or undefined + if (publicId === null || publicId === undefined) { + throw new RequiredError("publicId", "getApiMultistepSubtestParents"); + } + + // Path Params + const localVarPath = + "/api/v2/synthetics/api-multistep/subtests/{public_id}/parents".replace( + "{public_id}", + encodeURIComponent(String(publicId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.SyntheticsApi.getApiMultistepSubtestParents") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + + public async getApiMultistepSubtests( + publicId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'publicId' is not null or undefined + if (publicId === null || publicId === undefined) { + throw new RequiredError("publicId", "getApiMultistepSubtests"); + } + + // Path Params + const localVarPath = + "/api/v2/synthetics/api-multistep/subtests/{public_id}".replace( + "{public_id}", + encodeURIComponent(String(publicId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.SyntheticsApi.getApiMultistepSubtests") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + public async getOnDemandConcurrencyCap( _options?: Configuration ): Promise { @@ -379,6 +455,152 @@ export class SyntheticsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async getSyntheticsTestVersion( + publicId: string, + versionNumber: number, + includeChangeMetadata?: boolean, + onlyCheckExistence?: boolean, + _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", "getSyntheticsTestVersion"); + } + + // verify required parameter 'versionNumber' is not null or undefined + if (versionNumber === null || versionNumber === undefined) { + throw new RequiredError("versionNumber", "getSyntheticsTestVersion"); + } + + // Path Params + const localVarPath = + "/api/v2/synthetics/tests/{public_id}/version_history/{version_number}" + .replace("{public_id}", encodeURIComponent(String(publicId))) + .replace("{version_number}", encodeURIComponent(String(versionNumber))); + + // Make Request Context + const requestContext = _config + .getServer("v2.SyntheticsApi.getSyntheticsTestVersion") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Query Params + if (includeChangeMetadata !== undefined) { + requestContext.setQueryParam( + "include_change_metadata", + ObjectSerializer.serialize(includeChangeMetadata, "boolean", ""), + "" + ); + } + if (onlyCheckExistence !== undefined) { + requestContext.setQueryParam( + "only_check_existence", + ObjectSerializer.serialize(onlyCheckExistence, "boolean", ""), + "" + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + + public async getTestParentSuites( + publicId: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'publicId' is not null or undefined + if (publicId === null || publicId === undefined) { + throw new RequiredError("publicId", "getTestParentSuites"); + } + + // Path Params + const localVarPath = + "/api/v2/synthetics/tests/{public_id}/parent-suites".replace( + "{public_id}", + encodeURIComponent(String(publicId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.SyntheticsApi.getTestParentSuites") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + + public async listSyntheticsTestVersions( + publicId: string, + lastVersionNumber?: number, + limit?: number, + _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", "listSyntheticsTestVersions"); + } + + // Path Params + const localVarPath = + "/api/v2/synthetics/tests/{public_id}/version_history".replace( + "{public_id}", + encodeURIComponent(String(publicId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.SyntheticsApi.listSyntheticsTestVersions") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Query Params + if (lastVersionNumber !== undefined) { + requestContext.setQueryParam( + "last_version_number", + ObjectSerializer.serialize(lastVersionNumber, "number", "int64"), + "" + ); + } + if (limit !== undefined) { + requestContext.setQueryParam( + "limit", + ObjectSerializer.serialize(limit, "number", "int64"), + "" + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + public async patchGlobalVariable( variableId: string, body: GlobalVariableJsonPatchRequest, @@ -430,6 +652,58 @@ export class SyntheticsApiRequestFactory extends BaseAPIRequestFactory { return requestContext; } + public async patchTestSuite( + publicId: string, + body: SuiteJsonPatchRequest, + _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", "patchTestSuite"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "patchTestSuite"); + } + + // Path Params + const localVarPath = + "/api/v2/synthetics/suites/{public_id}/jsonpatch".replace( + "{public_id}", + encodeURIComponent(String(publicId)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.SyntheticsApi.patchTestSuite") + .makeRequestContext(localVarPath, HttpMethod.PATCH); + 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, "SuiteJsonPatchRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + "AuthZ", + ]); + + return requestContext; + } + public async searchSuites( query?: string, sort?: string, @@ -817,7 +1091,367 @@ export class SyntheticsApiResponseProcessor { ObjectSerializer.parse(await response.body.text(), contentType), "DeletedTestsResponse", "" - ) as DeletedTestsResponse; + ) as DeletedTestsResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to editSyntheticsSuite + * @throws ApiException if the response code was not in [200, 299] + */ + public async editSyntheticsSuite( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: SyntheticsSuiteResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SyntheticsSuiteResponse" + ) as SyntheticsSuiteResponse; + return body; + } + if (response.httpStatusCode === 400 || response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: SyntheticsSuiteResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SyntheticsSuiteResponse", + "" + ) as SyntheticsSuiteResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getApiMultistepSubtestParents + * @throws ApiException if the response code was not in [200, 299] + */ + public async getApiMultistepSubtestParents( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: SyntheticsApiMultistepParentTestsResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SyntheticsApiMultistepParentTestsResponse" + ) as SyntheticsApiMultistepParentTestsResponse; + return body; + } + if (response.httpStatusCode === 404 || response.httpStatusCode === 429) { + const bodyText = ObjectSerializer.parse( + await response.body.text(), + contentType + ); + let body: APIErrorResponse; + try { + body = ObjectSerializer.deserialize( + bodyText, + "APIErrorResponse" + ) as APIErrorResponse; + } catch (error) { + logger.debug(`Got error deserializing error: ${error}`); + throw new ApiException( + response.httpStatusCode, + bodyText + ); + } + throw new ApiException(response.httpStatusCode, body); + } + + // Work around for missing responses in specification, e.g. for petstore.yaml + if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { + const body: SyntheticsApiMultistepParentTestsResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SyntheticsApiMultistepParentTestsResponse", + "" + ) as SyntheticsApiMultistepParentTestsResponse; + 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 getApiMultistepSubtests + * @throws ApiException if the response code was not in [200, 299] + */ + public async getApiMultistepSubtests( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: SyntheticsApiMultistepSubtestsResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SyntheticsApiMultistepSubtestsResponse" + ) as SyntheticsApiMultistepSubtestsResponse; + return body; + } + if (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: SyntheticsApiMultistepSubtestsResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SyntheticsApiMultistepSubtestsResponse", + "" + ) as SyntheticsApiMultistepSubtestsResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getOnDemandConcurrencyCap + * @throws ApiException if the response code was not in [200, 299] + */ + public async getOnDemandConcurrencyCap( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: OnDemandConcurrencyCapResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "OnDemandConcurrencyCapResponse" + ) as OnDemandConcurrencyCapResponse; + return body; + } + if (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: OnDemandConcurrencyCapResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "OnDemandConcurrencyCapResponse", + "" + ) as OnDemandConcurrencyCapResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } + + /** + * Unwraps the actual response sent by the server from the response context and deserializes the response content + * to the expected objects + * + * @params response Response returned by the server for a request to getSyntheticsFastTestResult + * @throws ApiException if the response code was not in [200, 299] + */ + public async getSyntheticsFastTestResult( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: SyntheticsFastTestResult = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SyntheticsFastTestResult" + ) as SyntheticsFastTestResult; + return body; + } + if ( + response.httpStatusCode === 400 || + 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: SyntheticsFastTestResult = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SyntheticsFastTestResult", + "" + ) as SyntheticsFastTestResult; + 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 getSyntheticsNetworkTest + * @throws ApiException if the response code was not in [200, 299] + */ + public async getSyntheticsNetworkTest( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: SyntheticsNetworkTestResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SyntheticsNetworkTestResponse" + ) as SyntheticsNetworkTestResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + 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: SyntheticsNetworkTestResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SyntheticsNetworkTestResponse", + "" + ) as SyntheticsNetworkTestResponse; return body; } @@ -832,10 +1466,10 @@ 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 editSyntheticsSuite + * @params response Response returned by the server for a request to getSyntheticsSuite * @throws ApiException if the response code was not in [200, 299] */ - public async editSyntheticsSuite( + public async getSyntheticsSuite( response: ResponseContext ): Promise { const contentType = ObjectSerializer.normalizeMediaType( @@ -848,7 +1482,7 @@ export class SyntheticsApiResponseProcessor { ) as SyntheticsSuiteResponse; return body; } - if (response.httpStatusCode === 400 || response.httpStatusCode === 429) { + if (response.httpStatusCode === 404 || response.httpStatusCode === 429) { const bodyText = ObjectSerializer.parse( await response.body.text(), contentType @@ -890,23 +1524,23 @@ export class SyntheticsApiResponseProcessor { * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to getOnDemandConcurrencyCap + * @params response Response returned by the server for a request to getSyntheticsTestVersion * @throws ApiException if the response code was not in [200, 299] */ - public async getOnDemandConcurrencyCap( + public async getSyntheticsTestVersion( response: ResponseContext - ): Promise { + ): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); if (response.httpStatusCode === 200) { - const body: OnDemandConcurrencyCapResponse = ObjectSerializer.deserialize( + const body: SyntheticsTestVersionResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "OnDemandConcurrencyCapResponse" - ) as OnDemandConcurrencyCapResponse; + "SyntheticsTestVersionResponse" + ) as SyntheticsTestVersionResponse; return body; } - if (response.httpStatusCode === 429) { + if (response.httpStatusCode === 404 || response.httpStatusCode === 429) { const bodyText = ObjectSerializer.parse( await response.body.text(), contentType @@ -929,11 +1563,11 @@ export class SyntheticsApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: OnDemandConcurrencyCapResponse = ObjectSerializer.deserialize( + const body: SyntheticsTestVersionResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "OnDemandConcurrencyCapResponse", + "SyntheticsTestVersionResponse", "" - ) as OnDemandConcurrencyCapResponse; + ) as SyntheticsTestVersionResponse; return body; } @@ -948,27 +1582,24 @@ 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 getSyntheticsFastTestResult + * @params response Response returned by the server for a request to getTestParentSuites * @throws ApiException if the response code was not in [200, 299] */ - public async getSyntheticsFastTestResult( + public async getTestParentSuites( response: ResponseContext - ): Promise { + ): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); if (response.httpStatusCode === 200) { - const body: SyntheticsFastTestResult = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "SyntheticsFastTestResult" - ) as SyntheticsFastTestResult; + const body: SyntheticsTestParentSuitesResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SyntheticsTestParentSuitesResponse" + ) as SyntheticsTestParentSuitesResponse; return body; } - if ( - response.httpStatusCode === 400 || - response.httpStatusCode === 404 || - response.httpStatusCode === 429 - ) { + if (response.httpStatusCode === 404 || response.httpStatusCode === 429) { const bodyText = ObjectSerializer.parse( await response.body.text(), contentType @@ -991,11 +1622,12 @@ export class SyntheticsApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: SyntheticsFastTestResult = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "SyntheticsFastTestResult", - "" - ) as SyntheticsFastTestResult; + const body: SyntheticsTestParentSuitesResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SyntheticsTestParentSuitesResponse", + "" + ) as SyntheticsTestParentSuitesResponse; return body; } @@ -1010,24 +1642,25 @@ 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 getSyntheticsNetworkTest + * @params response Response returned by the server for a request to listSyntheticsTestVersions * @throws ApiException if the response code was not in [200, 299] */ - public async getSyntheticsNetworkTest( + public async listSyntheticsTestVersions( response: ResponseContext - ): Promise { + ): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); if (response.httpStatusCode === 200) { - const body: SyntheticsNetworkTestResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "SyntheticsNetworkTestResponse" - ) as SyntheticsNetworkTestResponse; + const body: SyntheticsTestVersionHistoryResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SyntheticsTestVersionHistoryResponse" + ) as SyntheticsTestVersionHistoryResponse; return body; } if ( - response.httpStatusCode === 400 || + response.httpStatusCode === 403 || response.httpStatusCode === 404 || response.httpStatusCode === 429 ) { @@ -1053,11 +1686,12 @@ export class SyntheticsApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: SyntheticsNetworkTestResponse = ObjectSerializer.deserialize( - ObjectSerializer.parse(await response.body.text(), contentType), - "SyntheticsNetworkTestResponse", - "" - ) as SyntheticsNetworkTestResponse; + const body: SyntheticsTestVersionHistoryResponse = + ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "SyntheticsTestVersionHistoryResponse", + "" + ) as SyntheticsTestVersionHistoryResponse; return body; } @@ -1072,23 +1706,27 @@ export class SyntheticsApiResponseProcessor { * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to getSyntheticsSuite + * @params response Response returned by the server for a request to patchGlobalVariable * @throws ApiException if the response code was not in [200, 299] */ - public async getSyntheticsSuite( + public async patchGlobalVariable( response: ResponseContext - ): Promise { + ): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); if (response.httpStatusCode === 200) { - const body: SyntheticsSuiteResponse = ObjectSerializer.deserialize( + const body: GlobalVariableResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SyntheticsSuiteResponse" - ) as SyntheticsSuiteResponse; + "GlobalVariableResponse" + ) as GlobalVariableResponse; return body; } - if (response.httpStatusCode === 404 || response.httpStatusCode === 429) { + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 404 || + response.httpStatusCode === 429 + ) { const bodyText = ObjectSerializer.parse( await response.body.text(), contentType @@ -1111,11 +1749,11 @@ export class SyntheticsApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: SyntheticsSuiteResponse = ObjectSerializer.deserialize( + const body: GlobalVariableResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "SyntheticsSuiteResponse", + "GlobalVariableResponse", "" - ) as SyntheticsSuiteResponse; + ) as GlobalVariableResponse; return body; } @@ -1130,27 +1768,23 @@ export class SyntheticsApiResponseProcessor { * Unwraps the actual response sent by the server from the response context and deserializes the response content * to the expected objects * - * @params response Response returned by the server for a request to patchGlobalVariable + * @params response Response returned by the server for a request to patchTestSuite * @throws ApiException if the response code was not in [200, 299] */ - public async patchGlobalVariable( + public async patchTestSuite( response: ResponseContext - ): Promise { + ): Promise { const contentType = ObjectSerializer.normalizeMediaType( response.headers["content-type"] ); if (response.httpStatusCode === 200) { - const body: GlobalVariableResponse = ObjectSerializer.deserialize( + const body: SyntheticsSuiteResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "GlobalVariableResponse" - ) as GlobalVariableResponse; + "SyntheticsSuiteResponse" + ) as SyntheticsSuiteResponse; return body; } - if ( - response.httpStatusCode === 400 || - response.httpStatusCode === 404 || - response.httpStatusCode === 429 - ) { + if (response.httpStatusCode === 400 || response.httpStatusCode === 429) { const bodyText = ObjectSerializer.parse( await response.body.text(), contentType @@ -1173,11 +1807,11 @@ export class SyntheticsApiResponseProcessor { // Work around for missing responses in specification, e.g. for petstore.yaml if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) { - const body: GlobalVariableResponse = ObjectSerializer.deserialize( + const body: SyntheticsSuiteResponse = ObjectSerializer.deserialize( ObjectSerializer.parse(await response.body.text(), contentType), - "GlobalVariableResponse", + "SyntheticsSuiteResponse", "" - ) as GlobalVariableResponse; + ) as SyntheticsSuiteResponse; return body; } @@ -1408,6 +2042,22 @@ export interface SyntheticsApiEditSyntheticsSuiteRequest { body: SuiteCreateEditRequest; } +export interface SyntheticsApiGetApiMultistepSubtestParentsRequest { + /** + * The public ID of the subtest. + * @type string + */ + publicId: string; +} + +export interface SyntheticsApiGetApiMultistepSubtestsRequest { + /** + * The public ID of the API multistep test. + * @type string + */ + publicId: string; +} + export interface SyntheticsApiGetSyntheticsFastTestResultRequest { /** * The UUID of the fast test to retrieve the result for. @@ -1432,6 +2082,56 @@ export interface SyntheticsApiGetSyntheticsSuiteRequest { publicId: string; } +export interface SyntheticsApiGetSyntheticsTestVersionRequest { + /** + * The public ID of the Synthetic test. + * @type string + */ + publicId: string; + /** + * The version number to retrieve. + * @type number + */ + versionNumber: number; + /** + * If `true`, include change metadata in the response. + * @type boolean + */ + includeChangeMetadata?: boolean; + /** + * If `true`, only check whether the version exists without returning its full payload. + * Returns an empty object if the version exists, or 404 if not. + * @type boolean + */ + onlyCheckExistence?: boolean; +} + +export interface SyntheticsApiGetTestParentSuitesRequest { + /** + * The public ID of the Synthetic test. + * @type string + */ + publicId: string; +} + +export interface SyntheticsApiListSyntheticsTestVersionsRequest { + /** + * The public ID of the Synthetic test. + * @type string + */ + publicId: string; + /** + * The version number of the last item from the previous page. Omit to get the first page. + * @type number + */ + lastVersionNumber?: number; + /** + * Maximum number of version records to return per page. + * @type number + */ + limit?: number; +} + export interface SyntheticsApiPatchGlobalVariableRequest { /** * The ID of the global variable. @@ -1445,6 +2145,19 @@ export interface SyntheticsApiPatchGlobalVariableRequest { body: GlobalVariableJsonPatchRequest; } +export interface SyntheticsApiPatchTestSuiteRequest { + /** + * The public ID of the Synthetic test suite to patch. + * @type string + */ + publicId: string; + /** + * JSON Patch document with operations to apply. + * @type SuiteJsonPatchRequest + */ + body: SuiteJsonPatchRequest; +} + export interface SyntheticsApiSearchSuitesRequest { /** * The search query. @@ -1612,6 +2325,55 @@ export class SyntheticsApi { }); } + /** + * Get the list of API multistep tests that include a given subtest, + * along with their monitor status. + * @param param The request object + */ + public getApiMultistepSubtestParents( + param: SyntheticsApiGetApiMultistepSubtestParentsRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.getApiMultistepSubtestParents( + param.publicId, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getApiMultistepSubtestParents( + responseContext + ); + }); + }); + } + + /** + * Get the list of API tests that can be added as subtests to a given API multistep test. + * The current test is excluded from the list since a test cannot be a subtest of itself. + * @param param The request object + */ + public getApiMultistepSubtests( + param: SyntheticsApiGetApiMultistepSubtestsRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.getApiMultistepSubtests( + param.publicId, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getApiMultistepSubtests( + responseContext + ); + }); + }); + } + /** * Get the on-demand concurrency cap. * @param param The request object @@ -1694,6 +2456,79 @@ export class SyntheticsApi { }); } + /** + * Get a specific version of a Synthetic test by its version number. + * @param param The request object + */ + public getSyntheticsTestVersion( + param: SyntheticsApiGetSyntheticsTestVersionRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.getSyntheticsTestVersion( + param.publicId, + param.versionNumber, + param.includeChangeMetadata, + param.onlyCheckExistence, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getSyntheticsTestVersion( + responseContext + ); + }); + }); + } + + /** + * Get the list of parent suites and their status for a given Synthetic test. + * @param param The request object + */ + public getTestParentSuites( + param: SyntheticsApiGetTestParentSuitesRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.getTestParentSuites( + param.publicId, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getTestParentSuites(responseContext); + }); + }); + } + + /** + * Get the paginated version history for a Synthetic test. + * @param param The request object + */ + public listSyntheticsTestVersions( + param: SyntheticsApiListSyntheticsTestVersionsRequest, + options?: Configuration + ): Promise { + const requestContextPromise = + this.requestFactory.listSyntheticsTestVersions( + param.publicId, + param.lastVersionNumber, + param.limit, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.listSyntheticsTestVersions( + responseContext + ); + }); + }); + } + /** * Patch a global variable using JSON Patch (RFC 6902). * This endpoint allows partial updates to a global variable by specifying only the fields to modify. @@ -1723,6 +2558,34 @@ export class SyntheticsApi { }); } + /** + * Patch a Synthetic test suite using JSON Patch (RFC 6902). + * Use partial updates to modify only specific fields of a test suite. + * + * Common operations include: + * - Replace field values: `{"op": "replace", "path": "/name", "value": "new_name"}` + * - Add/update tags: `{"op": "add", "path": "/tags/-", "value": "new_tag"}` + * - Remove fields: `{"op": "remove", "path": "/message"}` + * @param param The request object + */ + public patchTestSuite( + param: SyntheticsApiPatchTestSuiteRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.patchTestSuite( + param.publicId, + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.patchTestSuite(responseContext); + }); + }); + } + /** * Search for test suites. * @param param The request object diff --git a/packages/datadog-api-client-v2/apis/WidgetsApi.ts b/packages/datadog-api-client-v2/apis/WidgetsApi.ts new file mode 100644 index 000000000000..4693abbd9a60 --- /dev/null +++ b/packages/datadog-api-client-v2/apis/WidgetsApi.ts @@ -0,0 +1,850 @@ +import { + BaseAPIRequestFactory, + RequiredError, +} from "../../datadog-api-client-common/baseapi"; +import { + Configuration, + applySecurityAuthentication, +} from "../../datadog-api-client-common/configuration"; +import { + RequestContext, + HttpMethod, + ResponseContext, +} from "../../datadog-api-client-common/http/http"; + +import { logger } from "../../../logger"; +import { ObjectSerializer } from "../models/ObjectSerializer"; +import { ApiException } from "../../datadog-api-client-common/exception"; + +import { APIErrorResponse } from "../models/APIErrorResponse"; +import { CreateOrUpdateWidgetRequest } from "../models/CreateOrUpdateWidgetRequest"; +import { WidgetExperienceType } from "../models/WidgetExperienceType"; +import { WidgetListResponse } from "../models/WidgetListResponse"; +import { WidgetResponse } from "../models/WidgetResponse"; +import { WidgetType } from "../models/WidgetType"; + +export class WidgetsApiRequestFactory extends BaseAPIRequestFactory { + public async createWidget( + experienceType: WidgetExperienceType, + body: CreateOrUpdateWidgetRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'experienceType' is not null or undefined + if (experienceType === null || experienceType === undefined) { + throw new RequiredError("experienceType", "createWidget"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "createWidget"); + } + + // Path Params + const localVarPath = "/api/v2/widgets/{experience_type}".replace( + "{experience_type}", + encodeURIComponent(String(experienceType)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.WidgetsApi.createWidget") + .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, "CreateOrUpdateWidgetRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async deleteWidget( + experienceType: WidgetExperienceType, + uuid: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'experienceType' is not null or undefined + if (experienceType === null || experienceType === undefined) { + throw new RequiredError("experienceType", "deleteWidget"); + } + + // verify required parameter 'uuid' is not null or undefined + if (uuid === null || uuid === undefined) { + throw new RequiredError("uuid", "deleteWidget"); + } + + // Path Params + const localVarPath = "/api/v2/widgets/{experience_type}/{uuid}" + .replace("{experience_type}", encodeURIComponent(String(experienceType))) + .replace("{uuid}", encodeURIComponent(String(uuid))); + + // Make Request Context + const requestContext = _config + .getServer("v2.WidgetsApi.deleteWidget") + .makeRequestContext(localVarPath, HttpMethod.DELETE); + requestContext.setHeaderParam("Accept", "*/*"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async getWidget( + experienceType: WidgetExperienceType, + uuid: string, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'experienceType' is not null or undefined + if (experienceType === null || experienceType === undefined) { + throw new RequiredError("experienceType", "getWidget"); + } + + // verify required parameter 'uuid' is not null or undefined + if (uuid === null || uuid === undefined) { + throw new RequiredError("uuid", "getWidget"); + } + + // Path Params + const localVarPath = "/api/v2/widgets/{experience_type}/{uuid}" + .replace("{experience_type}", encodeURIComponent(String(experienceType))) + .replace("{uuid}", encodeURIComponent(String(uuid))); + + // Make Request Context + const requestContext = _config + .getServer("v2.WidgetsApi.getWidget") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async searchWidgets( + experienceType: WidgetExperienceType, + filterWidgetType?: WidgetType, + filterCreatorHandle?: string, + filterIsFavorited?: boolean, + filterTitle?: string, + filterTags?: string, + sort?: string, + pageNumber?: number, + pageSize?: number, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'experienceType' is not null or undefined + if (experienceType === null || experienceType === undefined) { + throw new RequiredError("experienceType", "searchWidgets"); + } + + // Path Params + const localVarPath = "/api/v2/widgets/{experience_type}".replace( + "{experience_type}", + encodeURIComponent(String(experienceType)) + ); + + // Make Request Context + const requestContext = _config + .getServer("v2.WidgetsApi.searchWidgets") + .makeRequestContext(localVarPath, HttpMethod.GET); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Query Params + if (filterWidgetType !== undefined) { + requestContext.setQueryParam( + "filter[widgetType]", + ObjectSerializer.serialize(filterWidgetType, "WidgetType", ""), + "" + ); + } + if (filterCreatorHandle !== undefined) { + requestContext.setQueryParam( + "filter[creatorHandle]", + ObjectSerializer.serialize(filterCreatorHandle, "string", ""), + "" + ); + } + if (filterIsFavorited !== undefined) { + requestContext.setQueryParam( + "filter[isFavorited]", + ObjectSerializer.serialize(filterIsFavorited, "boolean", ""), + "" + ); + } + if (filterTitle !== undefined) { + requestContext.setQueryParam( + "filter[title]", + ObjectSerializer.serialize(filterTitle, "string", ""), + "" + ); + } + if (filterTags !== undefined) { + requestContext.setQueryParam( + "filter[tags]", + ObjectSerializer.serialize(filterTags, "string", ""), + "" + ); + } + if (sort !== undefined) { + requestContext.setQueryParam( + "sort", + ObjectSerializer.serialize(sort, "string", ""), + "" + ); + } + if (pageNumber !== undefined) { + requestContext.setQueryParam( + "page[number]", + ObjectSerializer.serialize(pageNumber, "number", ""), + "" + ); + } + if (pageSize !== undefined) { + requestContext.setQueryParam( + "page[size]", + ObjectSerializer.serialize(pageSize, "number", ""), + "" + ); + } + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } + + public async updateWidget( + experienceType: WidgetExperienceType, + uuid: string, + body: CreateOrUpdateWidgetRequest, + _options?: Configuration + ): Promise { + const _config = _options || this.configuration; + + // verify required parameter 'experienceType' is not null or undefined + if (experienceType === null || experienceType === undefined) { + throw new RequiredError("experienceType", "updateWidget"); + } + + // verify required parameter 'uuid' is not null or undefined + if (uuid === null || uuid === undefined) { + throw new RequiredError("uuid", "updateWidget"); + } + + // verify required parameter 'body' is not null or undefined + if (body === null || body === undefined) { + throw new RequiredError("body", "updateWidget"); + } + + // Path Params + const localVarPath = "/api/v2/widgets/{experience_type}/{uuid}" + .replace("{experience_type}", encodeURIComponent(String(experienceType))) + .replace("{uuid}", encodeURIComponent(String(uuid))); + + // Make Request Context + const requestContext = _config + .getServer("v2.WidgetsApi.updateWidget") + .makeRequestContext(localVarPath, HttpMethod.PUT); + requestContext.setHeaderParam("Accept", "application/json"); + requestContext.setHttpConfig(_config.httpConfig); + + // Body Params + const contentType = ObjectSerializer.getPreferredMediaType([ + "application/json", + ]); + requestContext.setHeaderParam("Content-Type", contentType); + const serializedBody = ObjectSerializer.stringify( + ObjectSerializer.serialize(body, "CreateOrUpdateWidgetRequest", ""), + contentType + ); + requestContext.setBody(serializedBody); + + // Apply auth methods + applySecurityAuthentication(_config, requestContext, [ + "apiKeyAuth", + "appKeyAuth", + ]); + + return requestContext; + } +} + +export class WidgetsApiResponseProcessor { + /** + * 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 createWidget + * @throws ApiException if the response code was not in [200, 299] + */ + public async createWidget( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: WidgetResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "WidgetResponse" + ) as WidgetResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + 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: WidgetResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "WidgetResponse", + "" + ) as WidgetResponse; + 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 deleteWidget + * @throws ApiException if the response code was not in [200, 299] + */ + public async deleteWidget(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 getWidget + * @throws ApiException if the response code was not in [200, 299] + */ + public async getWidget(response: ResponseContext): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: WidgetResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "WidgetResponse" + ) as WidgetResponse; + 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: WidgetResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "WidgetResponse", + "" + ) as WidgetResponse; + 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 searchWidgets + * @throws ApiException if the response code was not in [200, 299] + */ + public async searchWidgets( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: WidgetListResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "WidgetListResponse" + ) as WidgetListResponse; + return body; + } + if ( + response.httpStatusCode === 400 || + response.httpStatusCode === 403 || + 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: WidgetListResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "WidgetListResponse", + "" + ) as WidgetListResponse; + 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 updateWidget + * @throws ApiException if the response code was not in [200, 299] + */ + public async updateWidget( + response: ResponseContext + ): Promise { + const contentType = ObjectSerializer.normalizeMediaType( + response.headers["content-type"] + ); + if (response.httpStatusCode === 200) { + const body: WidgetResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "WidgetResponse" + ) as WidgetResponse; + 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: WidgetResponse = ObjectSerializer.deserialize( + ObjectSerializer.parse(await response.body.text(), contentType), + "WidgetResponse", + "" + ) as WidgetResponse; + return body; + } + + const body = (await response.body.text()) || ""; + throw new ApiException( + response.httpStatusCode, + 'Unknown API Status Code!\nBody: "' + body + '"' + ); + } +} + +export interface WidgetsApiCreateWidgetRequest { + /** + * The experience type for the widget. + * @type WidgetExperienceType + */ + experienceType: WidgetExperienceType; + /** + * Widget request body. + * @type CreateOrUpdateWidgetRequest + */ + body: CreateOrUpdateWidgetRequest; +} + +export interface WidgetsApiDeleteWidgetRequest { + /** + * The experience type for the widget. + * @type WidgetExperienceType + */ + experienceType: WidgetExperienceType; + /** + * The UUID of the widget. + * @type string + */ + uuid: string; +} + +export interface WidgetsApiGetWidgetRequest { + /** + * The experience type for the widget. + * @type WidgetExperienceType + */ + experienceType: WidgetExperienceType; + /** + * The UUID of the widget. + * @type string + */ + uuid: string; +} + +export interface WidgetsApiSearchWidgetsRequest { + /** + * The experience type for the widget. + * @type WidgetExperienceType + */ + experienceType: WidgetExperienceType; + /** + * Filter widgets by widget type. + * @type WidgetType + */ + filterWidgetType?: WidgetType; + /** + * Filter widgets by the email handle of the creator. + * @type string + */ + filterCreatorHandle?: string; + /** + * Filter to only widgets favorited by the current user. + * @type boolean + */ + filterIsFavorited?: boolean; + /** + * Filter widgets by title (substring match). + * @type string + */ + filterTitle?: string; + /** + * Filter widgets by tags. Format as bracket-delimited CSV, e.g. `[tag1,tag2]`. + * @type string + */ + filterTags?: string; + /** + * Sort field for the results. Prefix with `-` for descending order. + * Allowed values: `title`, `created_at`, `modified_at`. + * @type string + */ + sort?: string; + /** + * Page number for pagination (0-indexed). + * @type number + */ + pageNumber?: number; + /** + * Number of widgets per page. + * @type number + */ + pageSize?: number; +} + +export interface WidgetsApiUpdateWidgetRequest { + /** + * The experience type for the widget. + * @type WidgetExperienceType + */ + experienceType: WidgetExperienceType; + /** + * The UUID of the widget. + * @type string + */ + uuid: string; + /** + * Widget request body. + * @type CreateOrUpdateWidgetRequest + */ + body: CreateOrUpdateWidgetRequest; +} + +export class WidgetsApi { + private requestFactory: WidgetsApiRequestFactory; + private responseProcessor: WidgetsApiResponseProcessor; + private configuration: Configuration; + + public constructor( + configuration: Configuration, + requestFactory?: WidgetsApiRequestFactory, + responseProcessor?: WidgetsApiResponseProcessor + ) { + this.configuration = configuration; + this.requestFactory = + requestFactory || new WidgetsApiRequestFactory(configuration); + this.responseProcessor = + responseProcessor || new WidgetsApiResponseProcessor(); + } + + /** + * Create a new widget for a given experience type. + * @param param The request object + */ + public createWidget( + param: WidgetsApiCreateWidgetRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.createWidget( + param.experienceType, + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.createWidget(responseContext); + }); + }); + } + + /** + * Soft-delete a widget by its UUID for a given experience type. + * @param param The request object + */ + public deleteWidget( + param: WidgetsApiDeleteWidgetRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.deleteWidget( + param.experienceType, + param.uuid, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.deleteWidget(responseContext); + }); + }); + } + + /** + * Retrieve a widget by its UUID for a given experience type. + * @param param The request object + */ + public getWidget( + param: WidgetsApiGetWidgetRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.getWidget( + param.experienceType, + param.uuid, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.getWidget(responseContext); + }); + }); + } + + /** + * Search and list widgets for a given experience type. Supports filtering by widget type, creator, title, and tags, as well as sorting and pagination. + * @param param The request object + */ + public searchWidgets( + param: WidgetsApiSearchWidgetsRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.searchWidgets( + param.experienceType, + param.filterWidgetType, + param.filterCreatorHandle, + param.filterIsFavorited, + param.filterTitle, + param.filterTags, + param.sort, + param.pageNumber, + param.pageSize, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.searchWidgets(responseContext); + }); + }); + } + + /** + * Update a widget by its UUID for a given experience type. This performs a full replacement of the widget definition. + * @param param The request object + */ + public updateWidget( + param: WidgetsApiUpdateWidgetRequest, + options?: Configuration + ): Promise { + const requestContextPromise = this.requestFactory.updateWidget( + param.experienceType, + param.uuid, + param.body, + options + ); + return requestContextPromise.then((requestContext) => { + return this.configuration.httpApi + .send(requestContext) + .then((responseContext) => { + return this.responseProcessor.updateWidget(responseContext); + }); + }); + } +} diff --git a/packages/datadog-api-client-v2/index.ts b/packages/datadog-api-client-v2/index.ts index 5f7dc60a3853..1c719be16580 100644 --- a/packages/datadog-api-client-v2/index.ts +++ b/packages/datadog-api-client-v2/index.ts @@ -1143,10 +1143,16 @@ export { SyntheticsApiDeleteSyntheticsSuitesRequest, SyntheticsApiDeleteSyntheticsTestsRequest, SyntheticsApiEditSyntheticsSuiteRequest, + SyntheticsApiGetApiMultistepSubtestParentsRequest, + SyntheticsApiGetApiMultistepSubtestsRequest, SyntheticsApiGetSyntheticsFastTestResultRequest, SyntheticsApiGetSyntheticsNetworkTestRequest, SyntheticsApiGetSyntheticsSuiteRequest, + SyntheticsApiGetSyntheticsTestVersionRequest, + SyntheticsApiGetTestParentSuitesRequest, + SyntheticsApiListSyntheticsTestVersionsRequest, SyntheticsApiPatchGlobalVariableRequest, + SyntheticsApiPatchTestSuiteRequest, SyntheticsApiSearchSuitesRequest, SyntheticsApiSetOnDemandConcurrencyCapRequest, SyntheticsApiUpdateSyntheticsNetworkTestRequest, @@ -1227,6 +1233,15 @@ export { UsersApi, } from "./apis/UsersApi"; +export { + WidgetsApiCreateWidgetRequest, + WidgetsApiDeleteWidgetRequest, + WidgetsApiGetWidgetRequest, + WidgetsApiSearchWidgetsRequest, + WidgetsApiUpdateWidgetRequest, + WidgetsApi, +} from "./apis/WidgetsApi"; + export { WorkflowAutomationApiCancelWorkflowInstanceRequest, WorkflowAutomationApiCreateWorkflowRequest, @@ -2152,6 +2167,9 @@ export { CreateOnCallNotificationRuleRequestData } from "./models/CreateOnCallNo export { CreateOpenAPIResponse } from "./models/CreateOpenAPIResponse"; export { CreateOpenAPIResponseAttributes } from "./models/CreateOpenAPIResponseAttributes"; export { CreateOpenAPIResponseData } from "./models/CreateOpenAPIResponseData"; +export { CreateOrUpdateWidgetRequest } from "./models/CreateOrUpdateWidgetRequest"; +export { CreateOrUpdateWidgetRequestAttributes } from "./models/CreateOrUpdateWidgetRequestAttributes"; +export { CreateOrUpdateWidgetRequestData } from "./models/CreateOrUpdateWidgetRequestData"; export { CreatePageRequest } from "./models/CreatePageRequest"; export { CreatePageRequestData } from "./models/CreatePageRequestData"; export { CreatePageRequestDataAttributes } from "./models/CreatePageRequestDataAttributes"; @@ -5399,11 +5417,23 @@ export { StepDisplay } from "./models/StepDisplay"; export { StepDisplayBounds } from "./models/StepDisplayBounds"; export { SuiteCreateEdit } from "./models/SuiteCreateEdit"; export { SuiteCreateEditRequest } from "./models/SuiteCreateEditRequest"; +export { SuiteJsonPatchRequest } from "./models/SuiteJsonPatchRequest"; +export { SuiteJsonPatchRequestData } from "./models/SuiteJsonPatchRequestData"; +export { SuiteJsonPatchRequestDataAttributes } from "./models/SuiteJsonPatchRequestDataAttributes"; +export { SuiteJsonPatchType } from "./models/SuiteJsonPatchType"; export { SuiteSearchResponseType } from "./models/SuiteSearchResponseType"; export { SuppressionVersionHistory } from "./models/SuppressionVersionHistory"; export { SuppressionVersions } from "./models/SuppressionVersions"; export { SyncProperty } from "./models/SyncProperty"; export { SyncPropertyWithMapping } from "./models/SyncPropertyWithMapping"; +export { SyntheticsApiMultistepParentTestAttributes } from "./models/SyntheticsApiMultistepParentTestAttributes"; +export { SyntheticsApiMultistepParentTestData } from "./models/SyntheticsApiMultistepParentTestData"; +export { SyntheticsApiMultistepParentTestsResponse } from "./models/SyntheticsApiMultistepParentTestsResponse"; +export { SyntheticsApiMultistepParentTestType } from "./models/SyntheticsApiMultistepParentTestType"; +export { SyntheticsApiMultistepSubtestAttributes } from "./models/SyntheticsApiMultistepSubtestAttributes"; +export { SyntheticsApiMultistepSubtestData } from "./models/SyntheticsApiMultistepSubtestData"; +export { SyntheticsApiMultistepSubtestsResponse } from "./models/SyntheticsApiMultistepSubtestsResponse"; +export { SyntheticsApiMultistepSubtestType } from "./models/SyntheticsApiMultistepSubtestType"; export { SyntheticsFastTestResult } from "./models/SyntheticsFastTestResult"; export { SyntheticsFastTestResultAttributes } from "./models/SyntheticsFastTestResultAttributes"; export { SyntheticsFastTestResultData } from "./models/SyntheticsFastTestResultData"; @@ -5460,7 +5490,25 @@ export { SyntheticsTestOptionsMonitorOptionsNotificationPresetName } from "./mod export { SyntheticsTestOptionsRetry } from "./models/SyntheticsTestOptionsRetry"; export { SyntheticsTestOptionsScheduling } from "./models/SyntheticsTestOptionsScheduling"; export { SyntheticsTestOptionsSchedulingTimeframe } from "./models/SyntheticsTestOptionsSchedulingTimeframe"; +export { SyntheticsTestParentSuiteAttributes } from "./models/SyntheticsTestParentSuiteAttributes"; +export { SyntheticsTestParentSuiteData } from "./models/SyntheticsTestParentSuiteData"; +export { SyntheticsTestParentSuitesResponse } from "./models/SyntheticsTestParentSuitesResponse"; +export { SyntheticsTestParentSuiteType } from "./models/SyntheticsTestParentSuiteType"; export { SyntheticsTestPauseStatus } from "./models/SyntheticsTestPauseStatus"; +export { SyntheticsTestVersionActionMetadata } from "./models/SyntheticsTestVersionActionMetadata"; +export { SyntheticsTestVersionAttributes } from "./models/SyntheticsTestVersionAttributes"; +export { SyntheticsTestVersionAuthor } from "./models/SyntheticsTestVersionAuthor"; +export { SyntheticsTestVersionChangeAttributes } from "./models/SyntheticsTestVersionChangeAttributes"; +export { SyntheticsTestVersionChangeData } from "./models/SyntheticsTestVersionChangeData"; +export { SyntheticsTestVersionChangeMetadataItem } from "./models/SyntheticsTestVersionChangeMetadataItem"; +export { SyntheticsTestVersionChangeType } from "./models/SyntheticsTestVersionChangeType"; +export { SyntheticsTestVersionData } from "./models/SyntheticsTestVersionData"; +export { SyntheticsTestVersionDiffPatchDiff } from "./models/SyntheticsTestVersionDiffPatchDiff"; +export { SyntheticsTestVersionDiffPatches } from "./models/SyntheticsTestVersionDiffPatches"; +export { SyntheticsTestVersionHistoryMeta } from "./models/SyntheticsTestVersionHistoryMeta"; +export { SyntheticsTestVersionHistoryResponse } from "./models/SyntheticsTestVersionHistoryResponse"; +export { SyntheticsTestVersionResponse } from "./models/SyntheticsTestVersionResponse"; +export { SyntheticsTestVersionType } from "./models/SyntheticsTestVersionType"; export { SyntheticsVariableParser } from "./models/SyntheticsVariableParser"; export { TableResultV2 } from "./models/TableResultV2"; export { TableResultV2Array } from "./models/TableResultV2Array"; @@ -5869,7 +5917,20 @@ export { WatcherData } from "./models/WatcherData"; export { WatcherDataAttributes } from "./models/WatcherDataAttributes"; export { WatcherDataType } from "./models/WatcherDataType"; export { Weekday } from "./models/Weekday"; +export { WidgetAttributes } from "./models/WidgetAttributes"; +export { WidgetData } from "./models/WidgetData"; +export { WidgetDefinition } from "./models/WidgetDefinition"; +export { WidgetExperienceType } from "./models/WidgetExperienceType"; +export { WidgetIncludedUser } from "./models/WidgetIncludedUser"; +export { WidgetIncludedUserAttributes } from "./models/WidgetIncludedUserAttributes"; +export { WidgetListResponse } from "./models/WidgetListResponse"; export { WidgetLiveSpan } from "./models/WidgetLiveSpan"; +export { WidgetRelationshipData } from "./models/WidgetRelationshipData"; +export { WidgetRelationshipItem } from "./models/WidgetRelationshipItem"; +export { WidgetRelationships } from "./models/WidgetRelationships"; +export { WidgetResponse } from "./models/WidgetResponse"; +export { WidgetSearchMeta } from "./models/WidgetSearchMeta"; +export { WidgetType } from "./models/WidgetType"; export { WorkflowData } from "./models/WorkflowData"; export { WorkflowDataAttributes } from "./models/WorkflowDataAttributes"; export { WorkflowDataRelationships } from "./models/WorkflowDataRelationships"; diff --git a/packages/datadog-api-client-v2/models/CreateOrUpdateWidgetRequest.ts b/packages/datadog-api-client-v2/models/CreateOrUpdateWidgetRequest.ts new file mode 100644 index 000000000000..10d20619deeb --- /dev/null +++ b/packages/datadog-api-client-v2/models/CreateOrUpdateWidgetRequest.ts @@ -0,0 +1,54 @@ +/** + * 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 { CreateOrUpdateWidgetRequestData } from "./CreateOrUpdateWidgetRequestData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Request body for creating or updating a widget. + */ +export class CreateOrUpdateWidgetRequest { + /** + * Data for creating or updating a widget. + */ + "data": CreateOrUpdateWidgetRequestData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "CreateOrUpdateWidgetRequestData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return CreateOrUpdateWidgetRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/CreateOrUpdateWidgetRequestAttributes.ts b/packages/datadog-api-client-v2/models/CreateOrUpdateWidgetRequestAttributes.ts new file mode 100644 index 000000000000..706ce73aeb32 --- /dev/null +++ b/packages/datadog-api-client-v2/models/CreateOrUpdateWidgetRequestAttributes.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 { WidgetDefinition } from "./WidgetDefinition"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes for creating or updating a widget. + */ +export class CreateOrUpdateWidgetRequestAttributes { + /** + * The definition of a widget, including its type and configuration. + */ + "definition": WidgetDefinition; + /** + * User-defined tags for organizing the widget. + */ + "tags"?: 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 = { + definition: { + baseName: "definition", + type: "WidgetDefinition", + required: true, + }, + tags: { + baseName: "tags", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return CreateOrUpdateWidgetRequestAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/CreateOrUpdateWidgetRequestData.ts b/packages/datadog-api-client-v2/models/CreateOrUpdateWidgetRequestData.ts new file mode 100644 index 000000000000..285f08562178 --- /dev/null +++ b/packages/datadog-api-client-v2/models/CreateOrUpdateWidgetRequestData.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 { CreateOrUpdateWidgetRequestAttributes } from "./CreateOrUpdateWidgetRequestAttributes"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data for creating or updating a widget. + */ +export class CreateOrUpdateWidgetRequestData { + /** + * Attributes for creating or updating a widget. + */ + "attributes": CreateOrUpdateWidgetRequestAttributes; + /** + * Widgets resource type. + */ + "type": 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 = { + attributes: { + baseName: "attributes", + type: "CreateOrUpdateWidgetRequestAttributes", + required: true, + }, + type: { + baseName: "type", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return CreateOrUpdateWidgetRequestData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/ObjectSerializer.ts b/packages/datadog-api-client-v2/models/ObjectSerializer.ts index c092ffd784f2..d1a3d2d2681a 100644 --- a/packages/datadog-api-client-v2/models/ObjectSerializer.ts +++ b/packages/datadog-api-client-v2/models/ObjectSerializer.ts @@ -700,6 +700,9 @@ import { CreateOnCallNotificationRuleRequestData } from "./CreateOnCallNotificat import { CreateOpenAPIResponse } from "./CreateOpenAPIResponse"; import { CreateOpenAPIResponseAttributes } from "./CreateOpenAPIResponseAttributes"; import { CreateOpenAPIResponseData } from "./CreateOpenAPIResponseData"; +import { CreateOrUpdateWidgetRequest } from "./CreateOrUpdateWidgetRequest"; +import { CreateOrUpdateWidgetRequestAttributes } from "./CreateOrUpdateWidgetRequestAttributes"; +import { CreateOrUpdateWidgetRequestData } from "./CreateOrUpdateWidgetRequestData"; import { CreatePageRequest } from "./CreatePageRequest"; import { CreatePageRequestData } from "./CreatePageRequestData"; import { CreatePageRequestDataAttributes } from "./CreatePageRequestDataAttributes"; @@ -3157,10 +3160,19 @@ import { StepDisplay } from "./StepDisplay"; import { StepDisplayBounds } from "./StepDisplayBounds"; import { SuiteCreateEdit } from "./SuiteCreateEdit"; import { SuiteCreateEditRequest } from "./SuiteCreateEditRequest"; +import { SuiteJsonPatchRequest } from "./SuiteJsonPatchRequest"; +import { SuiteJsonPatchRequestData } from "./SuiteJsonPatchRequestData"; +import { SuiteJsonPatchRequestDataAttributes } from "./SuiteJsonPatchRequestDataAttributes"; import { SuppressionVersionHistory } from "./SuppressionVersionHistory"; import { SuppressionVersions } from "./SuppressionVersions"; import { SyncProperty } from "./SyncProperty"; import { SyncPropertyWithMapping } from "./SyncPropertyWithMapping"; +import { SyntheticsApiMultistepParentTestAttributes } from "./SyntheticsApiMultistepParentTestAttributes"; +import { SyntheticsApiMultistepParentTestData } from "./SyntheticsApiMultistepParentTestData"; +import { SyntheticsApiMultistepParentTestsResponse } from "./SyntheticsApiMultistepParentTestsResponse"; +import { SyntheticsApiMultistepSubtestAttributes } from "./SyntheticsApiMultistepSubtestAttributes"; +import { SyntheticsApiMultistepSubtestData } from "./SyntheticsApiMultistepSubtestData"; +import { SyntheticsApiMultistepSubtestsResponse } from "./SyntheticsApiMultistepSubtestsResponse"; import { SyntheticsFastTestResult } from "./SyntheticsFastTestResult"; import { SyntheticsFastTestResultAttributes } from "./SyntheticsFastTestResultAttributes"; import { SyntheticsFastTestResultData } from "./SyntheticsFastTestResultData"; @@ -3198,6 +3210,21 @@ import { SyntheticsTestOptionsMonitorOptions } from "./SyntheticsTestOptionsMoni import { SyntheticsTestOptionsRetry } from "./SyntheticsTestOptionsRetry"; import { SyntheticsTestOptionsScheduling } from "./SyntheticsTestOptionsScheduling"; import { SyntheticsTestOptionsSchedulingTimeframe } from "./SyntheticsTestOptionsSchedulingTimeframe"; +import { SyntheticsTestParentSuiteAttributes } from "./SyntheticsTestParentSuiteAttributes"; +import { SyntheticsTestParentSuiteData } from "./SyntheticsTestParentSuiteData"; +import { SyntheticsTestParentSuitesResponse } from "./SyntheticsTestParentSuitesResponse"; +import { SyntheticsTestVersionActionMetadata } from "./SyntheticsTestVersionActionMetadata"; +import { SyntheticsTestVersionAttributes } from "./SyntheticsTestVersionAttributes"; +import { SyntheticsTestVersionAuthor } from "./SyntheticsTestVersionAuthor"; +import { SyntheticsTestVersionChangeAttributes } from "./SyntheticsTestVersionChangeAttributes"; +import { SyntheticsTestVersionChangeData } from "./SyntheticsTestVersionChangeData"; +import { SyntheticsTestVersionChangeMetadataItem } from "./SyntheticsTestVersionChangeMetadataItem"; +import { SyntheticsTestVersionData } from "./SyntheticsTestVersionData"; +import { SyntheticsTestVersionDiffPatchDiff } from "./SyntheticsTestVersionDiffPatchDiff"; +import { SyntheticsTestVersionDiffPatches } from "./SyntheticsTestVersionDiffPatches"; +import { SyntheticsTestVersionHistoryMeta } from "./SyntheticsTestVersionHistoryMeta"; +import { SyntheticsTestVersionHistoryResponse } from "./SyntheticsTestVersionHistoryResponse"; +import { SyntheticsTestVersionResponse } from "./SyntheticsTestVersionResponse"; import { SyntheticsVariableParser } from "./SyntheticsVariableParser"; import { TableResultV2 } from "./TableResultV2"; import { TableResultV2Array } from "./TableResultV2Array"; @@ -3512,6 +3539,17 @@ import { WatchDataAttributes } from "./WatchDataAttributes"; import { WatcherArray } from "./WatcherArray"; import { WatcherData } from "./WatcherData"; import { WatcherDataAttributes } from "./WatcherDataAttributes"; +import { WidgetAttributes } from "./WidgetAttributes"; +import { WidgetData } from "./WidgetData"; +import { WidgetDefinition } from "./WidgetDefinition"; +import { WidgetIncludedUser } from "./WidgetIncludedUser"; +import { WidgetIncludedUserAttributes } from "./WidgetIncludedUserAttributes"; +import { WidgetListResponse } from "./WidgetListResponse"; +import { WidgetRelationshipData } from "./WidgetRelationshipData"; +import { WidgetRelationshipItem } from "./WidgetRelationshipItem"; +import { WidgetRelationships } from "./WidgetRelationships"; +import { WidgetResponse } from "./WidgetResponse"; +import { WidgetSearchMeta } from "./WidgetSearchMeta"; import { WorkflowData } from "./WorkflowData"; import { WorkflowDataAttributes } from "./WorkflowDataAttributes"; import { WorkflowDataRelationships } from "./WorkflowDataRelationships"; @@ -5331,7 +5369,10 @@ const enumsMap: { [key: string]: any[] } = { StatusPagesComponentGroupAttributesComponentsItemsType: ["component"], StatusPagesComponentGroupType: ["components"], StatusPagesUserType: ["users"], + SuiteJsonPatchType: ["suites_json_patch"], SuiteSearchResponseType: ["suites_search"], + SyntheticsApiMultistepParentTestType: ["parent_test"], + SyntheticsApiMultistepSubtestType: ["subtest"], SyntheticsFastTestResultType: ["result"], SyntheticsFastTestSubType: [ "dns", @@ -5381,7 +5422,10 @@ const enumsMap: { [key: string]: any[] } = { "show_only_snapshot", "hide_handles_and_footer", ], + SyntheticsTestParentSuiteType: ["parent_suite"], SyntheticsTestPauseStatus: ["live", "paused"], + SyntheticsTestVersionChangeType: ["version_metadata"], + SyntheticsTestVersionType: ["version"], TableResultV2DataAttributesFileMetadataCloudStorageErrorType: [ "TABLE_SCHEMA_ERROR", "FILE_FORMAT_ERROR", @@ -5587,6 +5631,12 @@ const enumsMap: { [key: string]: any[] } = { "saturday", "sunday", ], + WidgetExperienceType: [ + "ccm_reports", + "logs_reports", + "csv_reports", + "product_analytics", + ], WidgetLiveSpan: [ "1m", "5m", @@ -5604,6 +5654,23 @@ const enumsMap: { [key: string]: any[] } = { "1y", "alert", ], + WidgetType: [ + "bar_chart", + "change", + "cloud_cost_summary", + "cohort", + "funnel", + "geomap", + "list_stream", + "query_table", + "query_value", + "retention_curve", + "sankey", + "sunburst", + "timeseries", + "toplist", + "treemap", + ], WorkflowDataType: ["workflows"], WorkflowUserRelationshipType: ["users"], }; @@ -6442,6 +6509,9 @@ const typeMap: { [index: string]: any } = { CreateOpenAPIResponse: CreateOpenAPIResponse, CreateOpenAPIResponseAttributes: CreateOpenAPIResponseAttributes, CreateOpenAPIResponseData: CreateOpenAPIResponseData, + CreateOrUpdateWidgetRequest: CreateOrUpdateWidgetRequest, + CreateOrUpdateWidgetRequestAttributes: CreateOrUpdateWidgetRequestAttributes, + CreateOrUpdateWidgetRequestData: CreateOrUpdateWidgetRequestData, CreatePageRequest: CreatePageRequest, CreatePageRequestData: CreatePageRequestData, CreatePageRequestDataAttributes: CreatePageRequestDataAttributes, @@ -9416,10 +9486,23 @@ const typeMap: { [index: string]: any } = { StepDisplayBounds: StepDisplayBounds, SuiteCreateEdit: SuiteCreateEdit, SuiteCreateEditRequest: SuiteCreateEditRequest, + SuiteJsonPatchRequest: SuiteJsonPatchRequest, + SuiteJsonPatchRequestData: SuiteJsonPatchRequestData, + SuiteJsonPatchRequestDataAttributes: SuiteJsonPatchRequestDataAttributes, SuppressionVersionHistory: SuppressionVersionHistory, SuppressionVersions: SuppressionVersions, SyncProperty: SyncProperty, SyncPropertyWithMapping: SyncPropertyWithMapping, + SyntheticsApiMultistepParentTestAttributes: + SyntheticsApiMultistepParentTestAttributes, + SyntheticsApiMultistepParentTestData: SyntheticsApiMultistepParentTestData, + SyntheticsApiMultistepParentTestsResponse: + SyntheticsApiMultistepParentTestsResponse, + SyntheticsApiMultistepSubtestAttributes: + SyntheticsApiMultistepSubtestAttributes, + SyntheticsApiMultistepSubtestData: SyntheticsApiMultistepSubtestData, + SyntheticsApiMultistepSubtestsResponse: + SyntheticsApiMultistepSubtestsResponse, SyntheticsFastTestResult: SyntheticsFastTestResult, SyntheticsFastTestResultAttributes: SyntheticsFastTestResultAttributes, SyntheticsFastTestResultData: SyntheticsFastTestResultData, @@ -9463,6 +9546,22 @@ const typeMap: { [index: string]: any } = { SyntheticsTestOptionsScheduling: SyntheticsTestOptionsScheduling, SyntheticsTestOptionsSchedulingTimeframe: SyntheticsTestOptionsSchedulingTimeframe, + SyntheticsTestParentSuiteAttributes: SyntheticsTestParentSuiteAttributes, + SyntheticsTestParentSuiteData: SyntheticsTestParentSuiteData, + SyntheticsTestParentSuitesResponse: SyntheticsTestParentSuitesResponse, + SyntheticsTestVersionActionMetadata: SyntheticsTestVersionActionMetadata, + SyntheticsTestVersionAttributes: SyntheticsTestVersionAttributes, + SyntheticsTestVersionAuthor: SyntheticsTestVersionAuthor, + SyntheticsTestVersionChangeAttributes: SyntheticsTestVersionChangeAttributes, + SyntheticsTestVersionChangeData: SyntheticsTestVersionChangeData, + SyntheticsTestVersionChangeMetadataItem: + SyntheticsTestVersionChangeMetadataItem, + SyntheticsTestVersionData: SyntheticsTestVersionData, + SyntheticsTestVersionDiffPatchDiff: SyntheticsTestVersionDiffPatchDiff, + SyntheticsTestVersionDiffPatches: SyntheticsTestVersionDiffPatches, + SyntheticsTestVersionHistoryMeta: SyntheticsTestVersionHistoryMeta, + SyntheticsTestVersionHistoryResponse: SyntheticsTestVersionHistoryResponse, + SyntheticsTestVersionResponse: SyntheticsTestVersionResponse, SyntheticsVariableParser: SyntheticsVariableParser, TableResultV2: TableResultV2, TableResultV2Array: TableResultV2Array, @@ -9830,6 +9929,17 @@ const typeMap: { [index: string]: any } = { WatcherArray: WatcherArray, WatcherData: WatcherData, WatcherDataAttributes: WatcherDataAttributes, + WidgetAttributes: WidgetAttributes, + WidgetData: WidgetData, + WidgetDefinition: WidgetDefinition, + WidgetIncludedUser: WidgetIncludedUser, + WidgetIncludedUserAttributes: WidgetIncludedUserAttributes, + WidgetListResponse: WidgetListResponse, + WidgetRelationshipData: WidgetRelationshipData, + WidgetRelationshipItem: WidgetRelationshipItem, + WidgetRelationships: WidgetRelationships, + WidgetResponse: WidgetResponse, + WidgetSearchMeta: WidgetSearchMeta, WorkflowData: WorkflowData, WorkflowDataAttributes: WorkflowDataAttributes, WorkflowDataRelationships: WorkflowDataRelationships, diff --git a/packages/datadog-api-client-v2/models/SuiteJsonPatchRequest.ts b/packages/datadog-api-client-v2/models/SuiteJsonPatchRequest.ts new file mode 100644 index 000000000000..8aca7fc21ef5 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SuiteJsonPatchRequest.ts @@ -0,0 +1,54 @@ +/** + * 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 { SuiteJsonPatchRequestData } from "./SuiteJsonPatchRequestData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * JSON Patch request for a Synthetic test suite. + */ +export class SuiteJsonPatchRequest { + /** + * Data object for a JSON Patch request on a Synthetic test suite. + */ + "data": SuiteJsonPatchRequestData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "SuiteJsonPatchRequestData", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SuiteJsonPatchRequest.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SuiteJsonPatchRequestData.ts b/packages/datadog-api-client-v2/models/SuiteJsonPatchRequestData.ts new file mode 100644 index 000000000000..30cde0881aac --- /dev/null +++ b/packages/datadog-api-client-v2/models/SuiteJsonPatchRequestData.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 { SuiteJsonPatchRequestDataAttributes } from "./SuiteJsonPatchRequestDataAttributes"; +import { SuiteJsonPatchType } from "./SuiteJsonPatchType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data object for a JSON Patch request on a Synthetic test suite. + */ +export class SuiteJsonPatchRequestData { + /** + * Attributes for a JSON Patch request on a Synthetic test suite. + */ + "attributes"?: SuiteJsonPatchRequestDataAttributes; + /** + * Type for a JSON Patch request on a Synthetic test suite, `suites_json_patch`. + */ + "type"?: SuiteJsonPatchType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "SuiteJsonPatchRequestDataAttributes", + }, + type: { + baseName: "type", + type: "SuiteJsonPatchType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SuiteJsonPatchRequestData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SuiteJsonPatchRequestDataAttributes.ts b/packages/datadog-api-client-v2/models/SuiteJsonPatchRequestDataAttributes.ts new file mode 100644 index 000000000000..eef483cc10c8 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SuiteJsonPatchRequestDataAttributes.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 { JsonPatchOperation } from "./JsonPatchOperation"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes for a JSON Patch request on a Synthetic test suite. + */ +export class SuiteJsonPatchRequestDataAttributes { + /** + * JSON Patch operations following RFC 6902. + */ + "jsonPatch"?: Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + jsonPatch: { + baseName: "json_patch", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SuiteJsonPatchRequestDataAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SuiteJsonPatchType.ts b/packages/datadog-api-client-v2/models/SuiteJsonPatchType.ts new file mode 100644 index 000000000000..7553ae6f8dcc --- /dev/null +++ b/packages/datadog-api-client-v2/models/SuiteJsonPatchType.ts @@ -0,0 +1,14 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Type for a JSON Patch request on a Synthetic test suite, `suites_json_patch`. + */ + +export type SuiteJsonPatchType = typeof SUITES_JSON_PATCH | UnparsedObject; +export const SUITES_JSON_PATCH = "suites_json_patch"; diff --git a/packages/datadog-api-client-v2/models/SyntheticsApiMultistepParentTestAttributes.ts b/packages/datadog-api-client-v2/models/SyntheticsApiMultistepParentTestAttributes.ts new file mode 100644 index 000000000000..b970ed0cb17b --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsApiMultistepParentTestAttributes.ts @@ -0,0 +1,102 @@ +/** + * 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"; + +/** + * Attributes of a parent API multistep test. + */ +export class SyntheticsApiMultistepParentTestAttributes { + /** + * The name of the child subtest. + */ + "childName"?: string; + /** + * The public ID of the child subtest. + */ + "childPublicId"?: string; + /** + * The associated monitor ID. + */ + "monitorId"?: number; + /** + * Name of the parent test. + */ + "name"?: string; + /** + * The overall state of the parent test. + */ + "overallState"?: number; + /** + * Timestamp of when the overall state was last modified. + */ + "overallStateModified"?: string; + /** + * The public ID of the parent test. + */ + "publicId"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + childName: { + baseName: "child_name", + type: "string", + }, + childPublicId: { + baseName: "child_public_id", + type: "string", + }, + monitorId: { + baseName: "monitor_id", + type: "number", + format: "int64", + }, + name: { + baseName: "name", + type: "string", + }, + overallState: { + baseName: "overall_state", + type: "number", + format: "int64", + }, + overallStateModified: { + baseName: "overall_state_modified", + type: "string", + }, + publicId: { + baseName: "public_id", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsApiMultistepParentTestAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SyntheticsApiMultistepParentTestData.ts b/packages/datadog-api-client-v2/models/SyntheticsApiMultistepParentTestData.ts new file mode 100644 index 000000000000..3c304ddd1bb9 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsApiMultistepParentTestData.ts @@ -0,0 +1,70 @@ +/** + * 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 { SyntheticsApiMultistepParentTestAttributes } from "./SyntheticsApiMultistepParentTestAttributes"; +import { SyntheticsApiMultistepParentTestType } from "./SyntheticsApiMultistepParentTestType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data object for a parent API multistep test. + */ +export class SyntheticsApiMultistepParentTestData { + /** + * Attributes of a parent API multistep test. + */ + "attributes"?: SyntheticsApiMultistepParentTestAttributes; + /** + * The public ID of the parent test. + */ + "id"?: string; + /** + * Type of the parent test resource. + */ + "type"?: SyntheticsApiMultistepParentTestType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "SyntheticsApiMultistepParentTestAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "SyntheticsApiMultistepParentTestType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsApiMultistepParentTestData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SyntheticsApiMultistepParentTestType.ts b/packages/datadog-api-client-v2/models/SyntheticsApiMultistepParentTestType.ts new file mode 100644 index 000000000000..93a04b1e6595 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsApiMultistepParentTestType.ts @@ -0,0 +1,16 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Type of the parent test resource. + */ + +export type SyntheticsApiMultistepParentTestType = + | typeof PARENT_TEST + | UnparsedObject; +export const PARENT_TEST = "parent_test"; diff --git a/packages/datadog-api-client-v2/models/SyntheticsApiMultistepParentTestsResponse.ts b/packages/datadog-api-client-v2/models/SyntheticsApiMultistepParentTestsResponse.ts new file mode 100644 index 000000000000..3184f4c51ea5 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsApiMultistepParentTestsResponse.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 { SyntheticsApiMultistepParentTestData } from "./SyntheticsApiMultistepParentTestData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response containing the list of parent tests for an API multistep subtest. + */ +export class SyntheticsApiMultistepParentTestsResponse { + /** + * List of parent tests that include this subtest. + */ + "data"?: Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsApiMultistepParentTestsResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SyntheticsApiMultistepSubtestAttributes.ts b/packages/datadog-api-client-v2/models/SyntheticsApiMultistepSubtestAttributes.ts new file mode 100644 index 000000000000..9eb80739f405 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsApiMultistepSubtestAttributes.ts @@ -0,0 +1,60 @@ +/** + * 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"; + +/** + * Attributes of a Synthetic API multistep subtest. + */ +export class SyntheticsApiMultistepSubtestAttributes { + /** + * Name of the subtest. + */ + "name"?: string; + /** + * The public ID of the subtest. + */ + "publicId"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + name: { + baseName: "name", + type: "string", + }, + publicId: { + baseName: "public_id", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsApiMultistepSubtestAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SyntheticsApiMultistepSubtestData.ts b/packages/datadog-api-client-v2/models/SyntheticsApiMultistepSubtestData.ts new file mode 100644 index 000000000000..d352599d2cf3 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsApiMultistepSubtestData.ts @@ -0,0 +1,70 @@ +/** + * 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 { SyntheticsApiMultistepSubtestAttributes } from "./SyntheticsApiMultistepSubtestAttributes"; +import { SyntheticsApiMultistepSubtestType } from "./SyntheticsApiMultistepSubtestType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data object for a Synthetic API multistep subtest. + */ +export class SyntheticsApiMultistepSubtestData { + /** + * Attributes of a Synthetic API multistep subtest. + */ + "attributes"?: SyntheticsApiMultistepSubtestAttributes; + /** + * The public ID of the subtest. + */ + "id"?: string; + /** + * Type of the subtest resource. + */ + "type"?: SyntheticsApiMultistepSubtestType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "SyntheticsApiMultistepSubtestAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "SyntheticsApiMultistepSubtestType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsApiMultistepSubtestData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SyntheticsApiMultistepSubtestType.ts b/packages/datadog-api-client-v2/models/SyntheticsApiMultistepSubtestType.ts new file mode 100644 index 000000000000..e955d308590e --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsApiMultistepSubtestType.ts @@ -0,0 +1,14 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Type of the subtest resource. + */ + +export type SyntheticsApiMultistepSubtestType = typeof SUBTEST | UnparsedObject; +export const SUBTEST = "subtest"; diff --git a/packages/datadog-api-client-v2/models/SyntheticsApiMultistepSubtestsResponse.ts b/packages/datadog-api-client-v2/models/SyntheticsApiMultistepSubtestsResponse.ts new file mode 100644 index 000000000000..4e61926f7e4a --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsApiMultistepSubtestsResponse.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 { SyntheticsApiMultistepSubtestData } from "./SyntheticsApiMultistepSubtestData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response containing the list of available subtests for an API multistep test. + */ +export class SyntheticsApiMultistepSubtestsResponse { + /** + * List of API tests that can be added as subtests. + */ + "data"?: Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsApiMultistepSubtestsResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SyntheticsTestParentSuiteAttributes.ts b/packages/datadog-api-client-v2/models/SyntheticsTestParentSuiteAttributes.ts new file mode 100644 index 000000000000..2b5a6244beaf --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsTestParentSuiteAttributes.ts @@ -0,0 +1,102 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Object containing details about a parent suite of a Synthetic test. + */ +export class SyntheticsTestParentSuiteAttributes { + /** + * The name of the child test within the suite. + */ + "childName"?: string; + /** + * The public ID of the child test within the suite. + */ + "childPublicId"?: string; + /** + * The associated monitor ID. + */ + "monitorId"?: number; + /** + * Name of the parent suite. + */ + "name"?: string; + /** + * The overall state of the parent suite. + */ + "overallState"?: number; + /** + * Timestamp of when the overall state was last modified. + */ + "overallStateModified"?: string; + /** + * The public ID of the parent suite. + */ + "publicId"?: string; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + childName: { + baseName: "child_name", + type: "string", + }, + childPublicId: { + baseName: "child_public_id", + type: "string", + }, + monitorId: { + baseName: "monitor_id", + type: "number", + format: "int64", + }, + name: { + baseName: "name", + type: "string", + }, + overallState: { + baseName: "overall_state", + type: "number", + format: "int64", + }, + overallStateModified: { + baseName: "overall_state_modified", + type: "string", + }, + publicId: { + baseName: "public_id", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsTestParentSuiteAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SyntheticsTestParentSuiteData.ts b/packages/datadog-api-client-v2/models/SyntheticsTestParentSuiteData.ts new file mode 100644 index 000000000000..9ec6d75ab2eb --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsTestParentSuiteData.ts @@ -0,0 +1,70 @@ +/** + * 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 { SyntheticsTestParentSuiteAttributes } from "./SyntheticsTestParentSuiteAttributes"; +import { SyntheticsTestParentSuiteType } from "./SyntheticsTestParentSuiteType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data object for a parent suite. + */ +export class SyntheticsTestParentSuiteData { + /** + * Object containing details about a parent suite of a Synthetic test. + */ + "attributes"?: SyntheticsTestParentSuiteAttributes; + /** + * The public ID of the parent suite. + */ + "id"?: string; + /** + * Type of the parent suite resource. + */ + "type"?: SyntheticsTestParentSuiteType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "SyntheticsTestParentSuiteAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "SyntheticsTestParentSuiteType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsTestParentSuiteData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SyntheticsTestParentSuiteType.ts b/packages/datadog-api-client-v2/models/SyntheticsTestParentSuiteType.ts new file mode 100644 index 000000000000..e8bcfc440059 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsTestParentSuiteType.ts @@ -0,0 +1,16 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Type of the parent suite resource. + */ + +export type SyntheticsTestParentSuiteType = + | typeof PARENT_SUITE + | UnparsedObject; +export const PARENT_SUITE = "parent_suite"; diff --git a/packages/datadog-api-client-v2/models/SyntheticsTestParentSuitesResponse.ts b/packages/datadog-api-client-v2/models/SyntheticsTestParentSuitesResponse.ts new file mode 100644 index 000000000000..feeb26408a53 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsTestParentSuitesResponse.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 { SyntheticsTestParentSuiteData } from "./SyntheticsTestParentSuiteData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response containing the list of parent suites for a Synthetic test. + */ +export class SyntheticsTestParentSuitesResponse { + /** + * List of parent suites for the given test. + */ + "data"?: Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsTestParentSuitesResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SyntheticsTestVersionActionMetadata.ts b/packages/datadog-api-client-v2/models/SyntheticsTestVersionActionMetadata.ts new file mode 100644 index 000000000000..db0f118cd6a5 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsTestVersionActionMetadata.ts @@ -0,0 +1,77 @@ +/** + * 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 { SyntheticsTestVersionDiffPatches } from "./SyntheticsTestVersionDiffPatches"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Object containing metadata about a change action. + */ +export class SyntheticsTestVersionActionMetadata { + /** + * The value of the property after the change. + */ + "afterValue"?: any; + /** + * The value of the property before the change. + */ + "beforeValue"?: any; + /** + * List of diff patches for text changes. + */ + "diffPatches"?: Array; + /** + * The dot-separated path of the property that was changed. + */ + "propertyPath"?: 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 = { + afterValue: { + baseName: "after_value", + type: "any", + }, + beforeValue: { + baseName: "before_value", + type: "any", + }, + diffPatches: { + baseName: "diff_patches", + type: "Array", + }, + propertyPath: { + baseName: "property_path", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsTestVersionActionMetadata.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SyntheticsTestVersionAttributes.ts b/packages/datadog-api-client-v2/models/SyntheticsTestVersionAttributes.ts new file mode 100644 index 000000000000..c485b07ab64d --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsTestVersionAttributes.ts @@ -0,0 +1,80 @@ +/** + * 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 { SyntheticsTestVersionAuthor } from "./SyntheticsTestVersionAuthor"; +import { SyntheticsTestVersionChangeMetadataItem } from "./SyntheticsTestVersionChangeMetadataItem"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes of a specific Synthetic test version. + */ +export class SyntheticsTestVersionAttributes { + /** + * Object describing the author of a test version. + */ + "author"?: SyntheticsTestVersionAuthor; + /** + * List of metadata describing individual changes in this version. + * Only returned when the `include_change_metadata` query parameter is `true`. + */ + "changeMetadata"?: Array; + /** + * The full test configuration at this version. + */ + "payload"?: { [key: string]: any }; + /** + * Timestamp of when this version was created. + */ + "versionPayloadCreatedAt"?: Date; + + /** + * 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 = { + author: { + baseName: "author", + type: "SyntheticsTestVersionAuthor", + }, + changeMetadata: { + baseName: "change_metadata", + type: "Array", + }, + payload: { + baseName: "payload", + type: "{ [key: string]: any; }", + }, + versionPayloadCreatedAt: { + baseName: "version_payload_created_at", + type: "Date", + format: "date-time", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsTestVersionAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SyntheticsTestVersionAuthor.ts b/packages/datadog-api-client-v2/models/SyntheticsTestVersionAuthor.ts new file mode 100644 index 000000000000..ea90f2a0deb8 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsTestVersionAuthor.ts @@ -0,0 +1,76 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Object describing the author of a test version. + */ +export class SyntheticsTestVersionAuthor { + /** + * Email address of the author. + */ + "email"?: string; + /** + * The author's Datadog handle (login username). + */ + "handle"?: string; + /** + * UUID of the author. + */ + "id"?: string; + /** + * Display name of the author. + */ + "name"?: 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 = { + email: { + baseName: "email", + type: "string", + }, + handle: { + baseName: "handle", + type: "string", + }, + id: { + baseName: "id", + type: "string", + }, + name: { + baseName: "name", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsTestVersionAuthor.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SyntheticsTestVersionChangeAttributes.ts b/packages/datadog-api-client-v2/models/SyntheticsTestVersionChangeAttributes.ts new file mode 100644 index 000000000000..18b76380eb05 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsTestVersionChangeAttributes.ts @@ -0,0 +1,79 @@ +/** + * 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 { SyntheticsTestVersionChangeMetadataItem } from "./SyntheticsTestVersionChangeMetadataItem"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes of a version change record. + */ +export class SyntheticsTestVersionChangeAttributes { + /** + * UUID of the user who created this version. + */ + "authorUuid"?: string; + /** + * List of metadata describing individual changes in this version. + */ + "changeMetadata"?: Array; + /** + * The sequential version number. + */ + "versionNumber"?: number; + /** + * Timestamp of when this version was created. + */ + "versionPayloadCreatedAt"?: Date; + + /** + * 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 = { + authorUuid: { + baseName: "author_uuid", + type: "string", + }, + changeMetadata: { + baseName: "change_metadata", + type: "Array", + }, + versionNumber: { + baseName: "version_number", + type: "number", + format: "int64", + }, + versionPayloadCreatedAt: { + baseName: "version_payload_created_at", + type: "Date", + format: "date-time", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsTestVersionChangeAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SyntheticsTestVersionChangeData.ts b/packages/datadog-api-client-v2/models/SyntheticsTestVersionChangeData.ts new file mode 100644 index 000000000000..a846a75444e1 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsTestVersionChangeData.ts @@ -0,0 +1,70 @@ +/** + * 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 { SyntheticsTestVersionChangeAttributes } from "./SyntheticsTestVersionChangeAttributes"; +import { SyntheticsTestVersionChangeType } from "./SyntheticsTestVersionChangeType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data object for a version change record. + */ +export class SyntheticsTestVersionChangeData { + /** + * Attributes of a version change record. + */ + "attributes"?: SyntheticsTestVersionChangeAttributes; + /** + * UUID of the version change record. + */ + "id"?: string; + /** + * Type of the version metadata resource. + */ + "type"?: SyntheticsTestVersionChangeType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "SyntheticsTestVersionChangeAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "SyntheticsTestVersionChangeType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsTestVersionChangeData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SyntheticsTestVersionChangeMetadataItem.ts b/packages/datadog-api-client-v2/models/SyntheticsTestVersionChangeMetadataItem.ts new file mode 100644 index 000000000000..50f5584b93f7 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsTestVersionChangeMetadataItem.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 { SyntheticsTestVersionActionMetadata } from "./SyntheticsTestVersionActionMetadata"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Object describing a single change within a version. + */ +export class SyntheticsTestVersionChangeMetadataItem { + /** + * The action that was performed (for example, `updated` or `created`). + */ + "action"?: string; + /** + * Object containing metadata about a change action. + */ + "actionMetadata"?: SyntheticsTestVersionActionMetadata; + + /** + * 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 = { + action: { + baseName: "action", + type: "string", + }, + actionMetadata: { + baseName: "action_metadata", + type: "SyntheticsTestVersionActionMetadata", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsTestVersionChangeMetadataItem.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SyntheticsTestVersionChangeType.ts b/packages/datadog-api-client-v2/models/SyntheticsTestVersionChangeType.ts new file mode 100644 index 000000000000..c5df0de5cccb --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsTestVersionChangeType.ts @@ -0,0 +1,16 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Type of the version metadata resource. + */ + +export type SyntheticsTestVersionChangeType = + | typeof VERSION_METADATA + | UnparsedObject; +export const VERSION_METADATA = "version_metadata"; diff --git a/packages/datadog-api-client-v2/models/SyntheticsTestVersionData.ts b/packages/datadog-api-client-v2/models/SyntheticsTestVersionData.ts new file mode 100644 index 000000000000..b5ae19328558 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsTestVersionData.ts @@ -0,0 +1,70 @@ +/** + * 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 { SyntheticsTestVersionAttributes } from "./SyntheticsTestVersionAttributes"; +import { SyntheticsTestVersionType } from "./SyntheticsTestVersionType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Data object for a specific Synthetic test version. + */ +export class SyntheticsTestVersionData { + /** + * Attributes of a specific Synthetic test version. + */ + "attributes"?: SyntheticsTestVersionAttributes; + /** + * UUID of the version record. + */ + "id"?: string; + /** + * Type of the version resource. + */ + "type"?: SyntheticsTestVersionType; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + attributes: { + baseName: "attributes", + type: "SyntheticsTestVersionAttributes", + }, + id: { + baseName: "id", + type: "string", + }, + type: { + baseName: "type", + type: "SyntheticsTestVersionType", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsTestVersionData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SyntheticsTestVersionDiffPatchDiff.ts b/packages/datadog-api-client-v2/models/SyntheticsTestVersionDiffPatchDiff.ts new file mode 100644 index 000000000000..6b5f3976264a --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsTestVersionDiffPatchDiff.ts @@ -0,0 +1,60 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Object describing a single text diff operation. + */ +export class SyntheticsTestVersionDiffPatchDiff { + /** + * The text that was changed. + */ + "changeText"?: string; + /** + * The diff operation applied. + */ + "operation"?: 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 = { + changeText: { + baseName: "change_text", + type: "string", + }, + operation: { + baseName: "operation", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsTestVersionDiffPatchDiff.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SyntheticsTestVersionDiffPatches.ts b/packages/datadog-api-client-v2/models/SyntheticsTestVersionDiffPatches.ts new file mode 100644 index 000000000000..e69503147879 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsTestVersionDiffPatches.ts @@ -0,0 +1,89 @@ +/** + * 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 { SyntheticsTestVersionDiffPatchDiff } from "./SyntheticsTestVersionDiffPatchDiff"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Object describing a patch in the diff. + */ +export class SyntheticsTestVersionDiffPatches { + /** + * List of individual diff operations. + */ + "diffs"?: Array; + /** + * Length of the original text segment. + */ + "length1"?: number; + /** + * Length of the modified text segment. + */ + "length2"?: number; + /** + * Start position in the original text. + */ + "start1"?: number; + /** + * Start position in the modified text. + */ + "start2"?: 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 = { + diffs: { + baseName: "diffs", + type: "Array", + }, + length1: { + baseName: "length1", + type: "number", + format: "int64", + }, + length2: { + baseName: "length2", + type: "number", + format: "int64", + }, + start1: { + baseName: "start1", + type: "number", + format: "int64", + }, + start2: { + baseName: "start2", + type: "number", + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsTestVersionDiffPatches.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SyntheticsTestVersionHistoryMeta.ts b/packages/datadog-api-client-v2/models/SyntheticsTestVersionHistoryMeta.ts new file mode 100644 index 000000000000..d03a446aebb8 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsTestVersionHistoryMeta.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"; + +/** + * Pagination metadata for a version history response. + */ +export class SyntheticsTestVersionHistoryMeta { + /** + * The version number to use as the `last_version_number` query parameter + * to fetch the next page. `null` indicates there are no more pages. + */ + "nextLastVersionNumber"?: number; + /** + * The number of days that version history is retained. + */ + "retentionPeriodInDays"?: 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 = { + nextLastVersionNumber: { + baseName: "next_last_version_number", + type: "number", + format: "int64", + }, + retentionPeriodInDays: { + baseName: "retention_period_in_days", + type: "number", + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsTestVersionHistoryMeta.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SyntheticsTestVersionHistoryResponse.ts b/packages/datadog-api-client-v2/models/SyntheticsTestVersionHistoryResponse.ts new file mode 100644 index 000000000000..6cda882d9377 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsTestVersionHistoryResponse.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 { SyntheticsTestVersionChangeData } from "./SyntheticsTestVersionChangeData"; +import { SyntheticsTestVersionHistoryMeta } from "./SyntheticsTestVersionHistoryMeta"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response containing the paginated version history for a Synthetic test. + */ +export class SyntheticsTestVersionHistoryResponse { + /** + * List of version change records. + */ + "data"?: Array; + /** + * Pagination metadata for a version history response. + */ + "meta"?: SyntheticsTestVersionHistoryMeta; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + }, + meta: { + baseName: "meta", + type: "SyntheticsTestVersionHistoryMeta", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsTestVersionHistoryResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SyntheticsTestVersionResponse.ts b/packages/datadog-api-client-v2/models/SyntheticsTestVersionResponse.ts new file mode 100644 index 000000000000..0f920598d9e6 --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsTestVersionResponse.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 { SyntheticsTestVersionData } from "./SyntheticsTestVersionData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response containing a specific version of a Synthetic test. + */ +export class SyntheticsTestVersionResponse { + /** + * Data object for a specific Synthetic test version. + */ + "data"?: SyntheticsTestVersionData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "SyntheticsTestVersionData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return SyntheticsTestVersionResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/SyntheticsTestVersionType.ts b/packages/datadog-api-client-v2/models/SyntheticsTestVersionType.ts new file mode 100644 index 000000000000..d3fed8c027bb --- /dev/null +++ b/packages/datadog-api-client-v2/models/SyntheticsTestVersionType.ts @@ -0,0 +1,14 @@ +/** + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2020-Present Datadog, Inc. + */ + +import { UnparsedObject } from "../../datadog-api-client-common/util"; + +/** + * Type of the version resource. + */ + +export type SyntheticsTestVersionType = typeof VERSION | UnparsedObject; +export const VERSION = "version"; diff --git a/packages/datadog-api-client-v2/models/WidgetAttributes.ts b/packages/datadog-api-client-v2/models/WidgetAttributes.ts new file mode 100644 index 000000000000..08c7a665c241 --- /dev/null +++ b/packages/datadog-api-client-v2/models/WidgetAttributes.ts @@ -0,0 +1,90 @@ +/** + * 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 { WidgetDefinition } from "./WidgetDefinition"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Attributes of a widget resource. + */ +export class WidgetAttributes { + /** + * ISO 8601 timestamp of when the widget was created. + */ + "createdAt": string; + /** + * The definition of a widget, including its type and configuration. + */ + "definition": WidgetDefinition; + /** + * Will be implemented soon. Currently always returns false. + */ + "isFavorited": boolean; + /** + * ISO 8601 timestamp of when the widget was last modified. + */ + "modifiedAt": string; + /** + * User-defined tags for organizing widgets. + */ + "tags": Array | null; + + /** + * 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 = { + createdAt: { + baseName: "created_at", + type: "string", + required: true, + }, + definition: { + baseName: "definition", + type: "WidgetDefinition", + required: true, + }, + isFavorited: { + baseName: "is_favorited", + type: "boolean", + required: true, + }, + modifiedAt: { + baseName: "modified_at", + type: "string", + required: true, + }, + tags: { + baseName: "tags", + type: "Array", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return WidgetAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/WidgetData.ts b/packages/datadog-api-client-v2/models/WidgetData.ts new file mode 100644 index 000000000000..1383f5d356b1 --- /dev/null +++ b/packages/datadog-api-client-v2/models/WidgetData.ts @@ -0,0 +1,81 @@ +/** + * 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 { WidgetAttributes } from "./WidgetAttributes"; +import { WidgetRelationships } from "./WidgetRelationships"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A widget resource object. + */ +export class WidgetData { + /** + * Attributes of a widget resource. + */ + "attributes": WidgetAttributes; + /** + * The unique identifier of the widget. + */ + "id": string; + /** + * Relationships of the widget resource. + */ + "relationships"?: WidgetRelationships; + /** + * Widgets resource type. + */ + "type": 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 = { + attributes: { + baseName: "attributes", + type: "WidgetAttributes", + required: true, + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + relationships: { + baseName: "relationships", + type: "WidgetRelationships", + }, + type: { + baseName: "type", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return WidgetData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/WidgetDefinition.ts b/packages/datadog-api-client-v2/models/WidgetDefinition.ts new file mode 100644 index 000000000000..f10dd2de3bf4 --- /dev/null +++ b/packages/datadog-api-client-v2/models/WidgetDefinition.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 { WidgetType } from "./WidgetType"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * The definition of a widget, including its type and configuration. + */ +export class WidgetDefinition { + /** + * The display title of the widget. + */ + "title": string; + /** + * Widget types that are allowed to be stored as individual records. + * This is not a complete list of dashboard and notebook widget types. + */ + "type": WidgetType; + + /** + * 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 = { + title: { + baseName: "title", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "WidgetType", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return WidgetDefinition.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/WidgetExperienceType.ts b/packages/datadog-api-client-v2/models/WidgetExperienceType.ts new file mode 100644 index 000000000000..17088146941d --- /dev/null +++ b/packages/datadog-api-client-v2/models/WidgetExperienceType.ts @@ -0,0 +1,22 @@ +/** + * 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"; + +/** + * Widget experience types that differentiate between the products using the specific widget. + */ + +export type WidgetExperienceType = + | typeof CCM_REPORTS + | typeof LOGS_REPORTS + | typeof CSV_REPORTS + | typeof PRODUCT_ANALYTICS + | UnparsedObject; +export const CCM_REPORTS = "ccm_reports"; +export const LOGS_REPORTS = "logs_reports"; +export const CSV_REPORTS = "csv_reports"; +export const PRODUCT_ANALYTICS = "product_analytics"; diff --git a/packages/datadog-api-client-v2/models/WidgetIncludedUser.ts b/packages/datadog-api-client-v2/models/WidgetIncludedUser.ts new file mode 100644 index 000000000000..5f656542b387 --- /dev/null +++ b/packages/datadog-api-client-v2/models/WidgetIncludedUser.ts @@ -0,0 +1,71 @@ +/** + * 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 { WidgetIncludedUserAttributes } from "./WidgetIncludedUserAttributes"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A user resource included in the response. + */ +export class WidgetIncludedUser { + /** + * Attributes of an included user resource. + */ + "attributes"?: WidgetIncludedUserAttributes; + /** + * The unique identifier of the user. + */ + "id": string; + /** + * Users resource type. + */ + "type": 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 = { + attributes: { + baseName: "attributes", + type: "WidgetIncludedUserAttributes", + }, + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return WidgetIncludedUser.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/WidgetIncludedUserAttributes.ts b/packages/datadog-api-client-v2/models/WidgetIncludedUserAttributes.ts new file mode 100644 index 000000000000..49d4a59a5e9a --- /dev/null +++ b/packages/datadog-api-client-v2/models/WidgetIncludedUserAttributes.ts @@ -0,0 +1,60 @@ +/** + * 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"; + +/** + * Attributes of an included user resource. + */ +export class WidgetIncludedUserAttributes { + /** + * The email handle of the user. + */ + "handle"?: string; + /** + * The display name of the user. + */ + "name"?: 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 = { + handle: { + baseName: "handle", + type: "string", + }, + name: { + baseName: "name", + type: "string", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return WidgetIncludedUserAttributes.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/WidgetListResponse.ts b/packages/datadog-api-client-v2/models/WidgetListResponse.ts new file mode 100644 index 000000000000..c89ae4abc862 --- /dev/null +++ b/packages/datadog-api-client-v2/models/WidgetListResponse.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 { WidgetData } from "./WidgetData"; +import { WidgetIncludedUser } from "./WidgetIncludedUser"; +import { WidgetSearchMeta } from "./WidgetSearchMeta"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response containing a list of widgets. + */ +export class WidgetListResponse { + /** + * List of widget resources. + */ + "data": Array; + /** + * Array of user resources related to the widgets. + */ + "included"?: Array; + /** + * Metadata about the search results. + */ + "meta"?: WidgetSearchMeta; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "Array", + required: true, + }, + included: { + baseName: "included", + type: "Array", + }, + meta: { + baseName: "meta", + type: "WidgetSearchMeta", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return WidgetListResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/WidgetRelationshipData.ts b/packages/datadog-api-client-v2/models/WidgetRelationshipData.ts new file mode 100644 index 000000000000..ad69f3704eb8 --- /dev/null +++ b/packages/datadog-api-client-v2/models/WidgetRelationshipData.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"; + +/** + * Relationship data referencing a user resource. + */ +export class WidgetRelationshipData { + /** + * The unique identifier of the user. + */ + "id": string; + /** + * Users resource type. + */ + "type": 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 = { + id: { + baseName: "id", + type: "string", + required: true, + }, + type: { + baseName: "type", + type: "string", + required: true, + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return WidgetRelationshipData.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/WidgetRelationshipItem.ts b/packages/datadog-api-client-v2/models/WidgetRelationshipItem.ts new file mode 100644 index 000000000000..7f20e80c3786 --- /dev/null +++ b/packages/datadog-api-client-v2/models/WidgetRelationshipItem.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 { WidgetRelationshipData } from "./WidgetRelationshipData"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * A JSON:API relationship to a user. + */ +export class WidgetRelationshipItem { + /** + * Relationship data referencing a user resource. + */ + "data"?: WidgetRelationshipData; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "WidgetRelationshipData", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return WidgetRelationshipItem.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/WidgetRelationships.ts b/packages/datadog-api-client-v2/models/WidgetRelationships.ts new file mode 100644 index 000000000000..a8f4b23072f1 --- /dev/null +++ b/packages/datadog-api-client-v2/models/WidgetRelationships.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 { WidgetRelationshipItem } from "./WidgetRelationshipItem"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Relationships of the widget resource. + */ +export class WidgetRelationships { + /** + * A JSON:API relationship to a user. + */ + "createdBy"?: WidgetRelationshipItem; + /** + * A JSON:API relationship to a user. + */ + "modifiedBy"?: WidgetRelationshipItem; + + /** + * 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 = { + createdBy: { + baseName: "created_by", + type: "WidgetRelationshipItem", + }, + modifiedBy: { + baseName: "modified_by", + type: "WidgetRelationshipItem", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return WidgetRelationships.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/WidgetResponse.ts b/packages/datadog-api-client-v2/models/WidgetResponse.ts new file mode 100644 index 000000000000..b8feacaad577 --- /dev/null +++ b/packages/datadog-api-client-v2/models/WidgetResponse.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 { WidgetData } from "./WidgetData"; +import { WidgetIncludedUser } from "./WidgetIncludedUser"; + +import { AttributeTypeMap } from "../../datadog-api-client-common/util"; + +/** + * Response containing a single widget. + */ +export class WidgetResponse { + /** + * A widget resource object. + */ + "data": WidgetData; + /** + * Array of user resources related to the widget. + */ + "included"?: Array; + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + "additionalProperties"?: { [key: string]: any }; + + /** + * @ignore + */ + "_unparsed"?: boolean; + + /** + * @ignore + */ + static readonly attributeTypeMap: AttributeTypeMap = { + data: { + baseName: "data", + type: "WidgetData", + required: true, + }, + included: { + baseName: "included", + type: "Array", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return WidgetResponse.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/WidgetSearchMeta.ts b/packages/datadog-api-client-v2/models/WidgetSearchMeta.ts new file mode 100644 index 000000000000..92b1d4f18cf2 --- /dev/null +++ b/packages/datadog-api-client-v2/models/WidgetSearchMeta.ts @@ -0,0 +1,80 @@ +/** + * 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"; + +/** + * Metadata about the search results. + */ +export class WidgetSearchMeta { + /** + * Total number of widgets created by anyone. + */ + "createdByAnyoneTotal"?: number; + /** + * Total number of widgets created by the current user. + */ + "createdByYouTotal"?: number; + /** + * Total number of widgets favorited by the current user. + */ + "favoritedByYouTotal"?: number; + /** + * Total number of widgets matching the current filter criteria. + */ + "filteredTotal"?: 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 = { + createdByAnyoneTotal: { + baseName: "created_by_anyone_total", + type: "number", + format: "int64", + }, + createdByYouTotal: { + baseName: "created_by_you_total", + type: "number", + format: "int64", + }, + favoritedByYouTotal: { + baseName: "favorited_by_you_total", + type: "number", + format: "int64", + }, + filteredTotal: { + baseName: "filtered_total", + type: "number", + format: "int64", + }, + additionalProperties: { + baseName: "additionalProperties", + type: "{ [key: string]: any; }", + }, + }; + + /** + * @ignore + */ + static getAttributeTypeMap(): AttributeTypeMap { + return WidgetSearchMeta.attributeTypeMap; + } + + public constructor() {} +} diff --git a/packages/datadog-api-client-v2/models/WidgetType.ts b/packages/datadog-api-client-v2/models/WidgetType.ts new file mode 100644 index 000000000000..68e9064755c1 --- /dev/null +++ b/packages/datadog-api-client-v2/models/WidgetType.ts @@ -0,0 +1,45 @@ +/** + * 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"; + +/** + * Widget types that are allowed to be stored as individual records. + * This is not a complete list of dashboard and notebook widget types. + */ + +export type WidgetType = + | typeof BAR_CHART + | typeof CHANGE + | typeof CLOUD_COST_SUMMARY + | typeof COHORT + | typeof FUNNEL + | typeof GEOMAP + | typeof LIST_STREAM + | typeof QUERY_TABLE + | typeof QUERY_VALUE + | typeof RETENTION_CURVE + | typeof SANKEY + | typeof SUNBURST + | typeof TIMESERIES + | typeof TOPLIST + | typeof TREEMAP + | UnparsedObject; +export const BAR_CHART = "bar_chart"; +export const CHANGE = "change"; +export const CLOUD_COST_SUMMARY = "cloud_cost_summary"; +export const COHORT = "cohort"; +export const FUNNEL = "funnel"; +export const GEOMAP = "geomap"; +export const LIST_STREAM = "list_stream"; +export const QUERY_TABLE = "query_table"; +export const QUERY_VALUE = "query_value"; +export const RETENTION_CURVE = "retention_curve"; +export const SANKEY = "sankey"; +export const SUNBURST = "sunburst"; +export const TIMESERIES = "timeseries"; +export const TOPLIST = "toplist"; +export const TREEMAP = "treemap";