diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index f45d9a1cc95..f1ef3930eef 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.java b/examples/v2/synthetics/GetApiMultistepSubtestParents.java new file mode 100644 index 00000000000..dbbc60385e4 --- /dev/null +++ b/examples/v2/synthetics/GetApiMultistepSubtestParents.java @@ -0,0 +1,25 @@ +// Get parent tests for a subtest returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SyntheticsApi; +import com.datadog.api.client.v2.model.SyntheticsApiMultistepParentTestsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SyntheticsApi apiInstance = new SyntheticsApi(defaultClient); + + try { + SyntheticsApiMultistepParentTestsResponse result = + apiInstance.getApiMultistepSubtestParents("public_id"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SyntheticsApi#getApiMultistepSubtestParents"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/synthetics/GetApiMultistepSubtests.java b/examples/v2/synthetics/GetApiMultistepSubtests.java new file mode 100644 index 00000000000..0578ef1b5d1 --- /dev/null +++ b/examples/v2/synthetics/GetApiMultistepSubtests.java @@ -0,0 +1,25 @@ +// Get available subtests for a multistep test returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SyntheticsApi; +import com.datadog.api.client.v2.model.SyntheticsApiMultistepSubtestsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SyntheticsApi apiInstance = new SyntheticsApi(defaultClient); + + try { + SyntheticsApiMultistepSubtestsResponse result = + apiInstance.getApiMultistepSubtests("public_id"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SyntheticsApi#getApiMultistepSubtests"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/synthetics/GetSyntheticsTestVersion.java b/examples/v2/synthetics/GetSyntheticsTestVersion.java new file mode 100644 index 00000000000..343da4b34f7 --- /dev/null +++ b/examples/v2/synthetics/GetSyntheticsTestVersion.java @@ -0,0 +1,25 @@ +// Get a specific version of a test returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SyntheticsApi; +import com.datadog.api.client.v2.model.SyntheticsTestVersionResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SyntheticsApi apiInstance = new SyntheticsApi(defaultClient); + + try { + SyntheticsTestVersionResponse result = + apiInstance.getSyntheticsTestVersion("public_id", 9223372036854775807L); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SyntheticsApi#getSyntheticsTestVersion"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/synthetics/GetTestParentSuites.java b/examples/v2/synthetics/GetTestParentSuites.java new file mode 100644 index 00000000000..984f171ad03 --- /dev/null +++ b/examples/v2/synthetics/GetTestParentSuites.java @@ -0,0 +1,24 @@ +// Get parent suites for a test returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SyntheticsApi; +import com.datadog.api.client.v2.model.SyntheticsTestParentSuitesResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SyntheticsApi apiInstance = new SyntheticsApi(defaultClient); + + try { + SyntheticsTestParentSuitesResponse result = apiInstance.getTestParentSuites("public_id"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SyntheticsApi#getTestParentSuites"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/synthetics/ListSyntheticsTestVersions.java b/examples/v2/synthetics/ListSyntheticsTestVersions.java new file mode 100644 index 00000000000..bc942c83759 --- /dev/null +++ b/examples/v2/synthetics/ListSyntheticsTestVersions.java @@ -0,0 +1,25 @@ +// Get version history of a test returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SyntheticsApi; +import com.datadog.api.client.v2.model.SyntheticsTestVersionHistoryResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SyntheticsApi apiInstance = new SyntheticsApi(defaultClient); + + try { + SyntheticsTestVersionHistoryResponse result = + apiInstance.listSyntheticsTestVersions("public_id"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SyntheticsApi#listSyntheticsTestVersions"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/synthetics/PatchTestSuite.java b/examples/v2/synthetics/PatchTestSuite.java new file mode 100644 index 00000000000..7bbe2b6d3bd --- /dev/null +++ b/examples/v2/synthetics/PatchTestSuite.java @@ -0,0 +1,44 @@ +// Patch a test suite returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SyntheticsApi; +import com.datadog.api.client.v2.model.JsonPatchOperation; +import com.datadog.api.client.v2.model.JsonPatchOperationOp; +import com.datadog.api.client.v2.model.SuiteJsonPatchRequest; +import com.datadog.api.client.v2.model.SuiteJsonPatchRequestData; +import com.datadog.api.client.v2.model.SuiteJsonPatchRequestDataAttributes; +import com.datadog.api.client.v2.model.SuiteJsonPatchType; +import com.datadog.api.client.v2.model.SyntheticsSuiteResponse; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SyntheticsApi apiInstance = new SyntheticsApi(defaultClient); + + SuiteJsonPatchRequest body = + new SuiteJsonPatchRequest() + .data( + new SuiteJsonPatchRequestData() + .attributes( + new SuiteJsonPatchRequestDataAttributes() + .jsonPatch( + Collections.singletonList( + new JsonPatchOperation() + .op(JsonPatchOperationOp.ADD) + .path("/name")))) + .type(SuiteJsonPatchType.SUITES_JSON_PATCH)); + + try { + SyntheticsSuiteResponse result = apiInstance.patchTestSuite("123-abc-456", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SyntheticsApi#patchTestSuite"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/widgets/CreateWidget.java b/examples/v2/widgets/CreateWidget.java new file mode 100644 index 00000000000..fcda8927285 --- /dev/null +++ b/examples/v2/widgets/CreateWidget.java @@ -0,0 +1,42 @@ +// Create a widget returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.WidgetsApi; +import com.datadog.api.client.v2.model.CreateOrUpdateWidgetRequest; +import com.datadog.api.client.v2.model.CreateOrUpdateWidgetRequestAttributes; +import com.datadog.api.client.v2.model.CreateOrUpdateWidgetRequestData; +import com.datadog.api.client.v2.model.WidgetDefinition; +import com.datadog.api.client.v2.model.WidgetExperienceType; +import com.datadog.api.client.v2.model.WidgetResponse; +import com.datadog.api.client.v2.model.WidgetType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + WidgetsApi apiInstance = new WidgetsApi(defaultClient); + + CreateOrUpdateWidgetRequest body = + new CreateOrUpdateWidgetRequest() + .data( + new CreateOrUpdateWidgetRequestData() + .attributes( + new CreateOrUpdateWidgetRequestAttributes() + .definition( + new WidgetDefinition() + .title("My Widget") + .type(WidgetType.BAR_CHART))) + .type("widgets")); + + try { + WidgetResponse result = apiInstance.createWidget(WidgetExperienceType.CCM_REPORTS, body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling WidgetsApi#createWidget"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/widgets/DeleteWidget.java b/examples/v2/widgets/DeleteWidget.java new file mode 100644 index 00000000000..cf76c095eec --- /dev/null +++ b/examples/v2/widgets/DeleteWidget.java @@ -0,0 +1,26 @@ +// Delete a widget returns "No Content" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.WidgetsApi; +import com.datadog.api.client.v2.model.WidgetExperienceType; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + WidgetsApi apiInstance = new WidgetsApi(defaultClient); + + try { + apiInstance.deleteWidget( + WidgetExperienceType.CCM_REPORTS, + UUID.fromString("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d")); + } catch (ApiException e) { + System.err.println("Exception when calling WidgetsApi#deleteWidget"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/widgets/GetWidget.java b/examples/v2/widgets/GetWidget.java new file mode 100644 index 00000000000..ded31dfd389 --- /dev/null +++ b/examples/v2/widgets/GetWidget.java @@ -0,0 +1,29 @@ +// Get a widget returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.WidgetsApi; +import com.datadog.api.client.v2.model.WidgetExperienceType; +import com.datadog.api.client.v2.model.WidgetResponse; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + WidgetsApi apiInstance = new WidgetsApi(defaultClient); + + try { + WidgetResponse result = + apiInstance.getWidget( + WidgetExperienceType.CCM_REPORTS, + UUID.fromString("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d")); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling WidgetsApi#getWidget"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/widgets/SearchWidgets.java b/examples/v2/widgets/SearchWidgets.java new file mode 100644 index 00000000000..9d0020e199d --- /dev/null +++ b/examples/v2/widgets/SearchWidgets.java @@ -0,0 +1,25 @@ +// Search widgets returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.WidgetsApi; +import com.datadog.api.client.v2.model.WidgetExperienceType; +import com.datadog.api.client.v2.model.WidgetListResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + WidgetsApi apiInstance = new WidgetsApi(defaultClient); + + try { + WidgetListResponse result = apiInstance.searchWidgets(WidgetExperienceType.CCM_REPORTS); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling WidgetsApi#searchWidgets"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/widgets/UpdateWidget.java b/examples/v2/widgets/UpdateWidget.java new file mode 100644 index 00000000000..d9c7a92ecc9 --- /dev/null +++ b/examples/v2/widgets/UpdateWidget.java @@ -0,0 +1,47 @@ +// Update a widget returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.WidgetsApi; +import com.datadog.api.client.v2.model.CreateOrUpdateWidgetRequest; +import com.datadog.api.client.v2.model.CreateOrUpdateWidgetRequestAttributes; +import com.datadog.api.client.v2.model.CreateOrUpdateWidgetRequestData; +import com.datadog.api.client.v2.model.WidgetDefinition; +import com.datadog.api.client.v2.model.WidgetExperienceType; +import com.datadog.api.client.v2.model.WidgetResponse; +import com.datadog.api.client.v2.model.WidgetType; +import java.util.UUID; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + WidgetsApi apiInstance = new WidgetsApi(defaultClient); + + CreateOrUpdateWidgetRequest body = + new CreateOrUpdateWidgetRequest() + .data( + new CreateOrUpdateWidgetRequestData() + .attributes( + new CreateOrUpdateWidgetRequestAttributes() + .definition( + new WidgetDefinition() + .title("My Widget") + .type(WidgetType.BAR_CHART))) + .type("widgets")); + + try { + WidgetResponse result = + apiInstance.updateWidget( + WidgetExperienceType.CCM_REPORTS, + UUID.fromString("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"), + body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling WidgetsApi#updateWidget"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/SyntheticsApi.java b/src/main/java/com/datadog/api/client/v2/api/SyntheticsApi.java index 64543fb0087..d1d8a6ab7fc 100644 --- a/src/main/java/com/datadog/api/client/v2/api/SyntheticsApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/SyntheticsApi.java @@ -13,11 +13,17 @@ import com.datadog.api.client.v2.model.OnDemandConcurrencyCapAttributes; import com.datadog.api.client.v2.model.OnDemandConcurrencyCapResponse; import com.datadog.api.client.v2.model.SuiteCreateEditRequest; +import com.datadog.api.client.v2.model.SuiteJsonPatchRequest; +import com.datadog.api.client.v2.model.SyntheticsApiMultistepParentTestsResponse; +import com.datadog.api.client.v2.model.SyntheticsApiMultistepSubtestsResponse; import com.datadog.api.client.v2.model.SyntheticsFastTestResult; import com.datadog.api.client.v2.model.SyntheticsNetworkTestEditRequest; import com.datadog.api.client.v2.model.SyntheticsNetworkTestResponse; import com.datadog.api.client.v2.model.SyntheticsSuiteResponse; import com.datadog.api.client.v2.model.SyntheticsSuiteSearchResponse; +import com.datadog.api.client.v2.model.SyntheticsTestParentSuitesResponse; +import com.datadog.api.client.v2.model.SyntheticsTestVersionHistoryResponse; +import com.datadog.api.client.v2.model.SyntheticsTestVersionResponse; import jakarta.ws.rs.client.Invocation; import jakarta.ws.rs.core.GenericType; import java.util.ArrayList; @@ -734,6 +740,287 @@ public ApiResponse editSyntheticsSuiteWithHttpInfo( new GenericType() {}); } + /** + * Get parent tests for a subtest. + * + *

See {@link #getApiMultistepSubtestParentsWithHttpInfo}. + * + * @param publicId The public ID of the subtest. (required) + * @return SyntheticsApiMultistepParentTestsResponse + * @throws ApiException if fails to make API call + */ + public SyntheticsApiMultistepParentTestsResponse getApiMultistepSubtestParents(String publicId) + throws ApiException { + return getApiMultistepSubtestParentsWithHttpInfo(publicId).getData(); + } + + /** + * Get parent tests for a subtest. + * + *

See {@link #getApiMultistepSubtestParentsWithHttpInfoAsync}. + * + * @param publicId The public ID of the subtest. (required) + * @return CompletableFuture<SyntheticsApiMultistepParentTestsResponse> + */ + public CompletableFuture + getApiMultistepSubtestParentsAsync(String publicId) { + return getApiMultistepSubtestParentsWithHttpInfoAsync(publicId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the list of API multistep tests that include a given subtest, along with their monitor + * status. + * + * @param publicId The public ID of the subtest. (required) + * @return ApiResponse<SyntheticsApiMultistepParentTestsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
404 API error response. -
429 Too many requests -
+ */ + public ApiResponse + getApiMultistepSubtestParentsWithHttpInfo(String publicId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'publicId' is set + if (publicId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'publicId' when calling getApiMultistepSubtestParents"); + } + // create path and map variables + String localVarPath = + "/api/v2/synthetics/api-multistep/subtests/{public_id}/parents" + .replaceAll("\\{" + "public_id" + "\\}", apiClient.escapeString(publicId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SyntheticsApi.getApiMultistepSubtestParents", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get parent tests for a subtest. + * + *

See {@link #getApiMultistepSubtestParentsWithHttpInfo}. + * + * @param publicId The public ID of the subtest. (required) + * @return CompletableFuture<ApiResponse<SyntheticsApiMultistepParentTestsResponse>> + */ + public CompletableFuture> + getApiMultistepSubtestParentsWithHttpInfoAsync(String publicId) { + Object localVarPostBody = null; + + // verify the required parameter 'publicId' is set + if (publicId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'publicId' when calling" + + " getApiMultistepSubtestParents")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/synthetics/api-multistep/subtests/{public_id}/parents" + .replaceAll("\\{" + "public_id" + "\\}", apiClient.escapeString(publicId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SyntheticsApi.getApiMultistepSubtestParents", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get available subtests for a multistep test. + * + *

See {@link #getApiMultistepSubtestsWithHttpInfo}. + * + * @param publicId The public ID of the API multistep test. (required) + * @return SyntheticsApiMultistepSubtestsResponse + * @throws ApiException if fails to make API call + */ + public SyntheticsApiMultistepSubtestsResponse getApiMultistepSubtests(String publicId) + throws ApiException { + return getApiMultistepSubtestsWithHttpInfo(publicId).getData(); + } + + /** + * Get available subtests for a multistep test. + * + *

See {@link #getApiMultistepSubtestsWithHttpInfoAsync}. + * + * @param publicId The public ID of the API multistep test. (required) + * @return CompletableFuture<SyntheticsApiMultistepSubtestsResponse> + */ + public CompletableFuture getApiMultistepSubtestsAsync( + String publicId) { + return getApiMultistepSubtestsWithHttpInfoAsync(publicId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * 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 publicId The public ID of the API multistep test. (required) + * @return ApiResponse<SyntheticsApiMultistepSubtestsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
429 Too many requests -
+ */ + public ApiResponse getApiMultistepSubtestsWithHttpInfo( + String publicId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'publicId' is set + if (publicId == null) { + throw new ApiException( + 400, "Missing the required parameter 'publicId' when calling getApiMultistepSubtests"); + } + // create path and map variables + String localVarPath = + "/api/v2/synthetics/api-multistep/subtests/{public_id}" + .replaceAll("\\{" + "public_id" + "\\}", apiClient.escapeString(publicId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SyntheticsApi.getApiMultistepSubtests", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get available subtests for a multistep test. + * + *

See {@link #getApiMultistepSubtestsWithHttpInfo}. + * + * @param publicId The public ID of the API multistep test. (required) + * @return CompletableFuture<ApiResponse<SyntheticsApiMultistepSubtestsResponse>> + */ + public CompletableFuture> + getApiMultistepSubtestsWithHttpInfoAsync(String publicId) { + Object localVarPostBody = null; + + // verify the required parameter 'publicId' is set + if (publicId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'publicId' when calling getApiMultistepSubtests")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/synthetics/api-multistep/subtests/{public_id}" + .replaceAll("\\{" + "public_id" + "\\}", apiClient.escapeString(publicId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SyntheticsApi.getApiMultistepSubtests", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Get the on-demand concurrency cap. * @@ -1248,33 +1535,69 @@ public ApiResponse getSyntheticsSuiteWithHttpInfo(Strin new GenericType() {}); } + /** Manage optional parameters to getSyntheticsTestVersion. */ + public static class GetSyntheticsTestVersionOptionalParameters { + private Boolean includeChangeMetadata; + private Boolean onlyCheckExistence; + + /** + * Set includeChangeMetadata. + * + * @param includeChangeMetadata If true, include change metadata in the response. + * (optional) + * @return GetSyntheticsTestVersionOptionalParameters + */ + public GetSyntheticsTestVersionOptionalParameters includeChangeMetadata( + Boolean includeChangeMetadata) { + this.includeChangeMetadata = includeChangeMetadata; + return this; + } + + /** + * Set onlyCheckExistence. + * + * @param onlyCheckExistence 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. + * (optional) + * @return GetSyntheticsTestVersionOptionalParameters + */ + public GetSyntheticsTestVersionOptionalParameters onlyCheckExistence( + Boolean onlyCheckExistence) { + this.onlyCheckExistence = onlyCheckExistence; + return this; + } + } + /** - * Patch a global variable. + * Get a specific version of a test. * - *

See {@link #patchGlobalVariableWithHttpInfo}. + *

See {@link #getSyntheticsTestVersionWithHttpInfo}. * - * @param variableId The ID of the global variable. (required) - * @param body JSON Patch document with operations to apply. (required) - * @return GlobalVariableResponse + * @param publicId The public ID of the Synthetic test. (required) + * @param versionNumber The version number to retrieve. (required) + * @return SyntheticsTestVersionResponse * @throws ApiException if fails to make API call */ - public GlobalVariableResponse patchGlobalVariable( - String variableId, GlobalVariableJsonPatchRequest body) throws ApiException { - return patchGlobalVariableWithHttpInfo(variableId, body).getData(); + public SyntheticsTestVersionResponse getSyntheticsTestVersion(String publicId, Long versionNumber) + throws ApiException { + return getSyntheticsTestVersionWithHttpInfo( + publicId, versionNumber, new GetSyntheticsTestVersionOptionalParameters()) + .getData(); } /** - * Patch a global variable. + * Get a specific version of a test. * - *

See {@link #patchGlobalVariableWithHttpInfoAsync}. + *

See {@link #getSyntheticsTestVersionWithHttpInfoAsync}. * - * @param variableId The ID of the global variable. (required) - * @param body JSON Patch document with operations to apply. (required) - * @return CompletableFuture<GlobalVariableResponse> + * @param publicId The public ID of the Synthetic test. (required) + * @param versionNumber The version number to retrieve. (required) + * @return CompletableFuture<SyntheticsTestVersionResponse> */ - public CompletableFuture patchGlobalVariableAsync( - String variableId, GlobalVariableJsonPatchRequest body) { - return patchGlobalVariableWithHttpInfoAsync(variableId, body) + public CompletableFuture getSyntheticsTestVersionAsync( + String publicId, Long versionNumber) { + return getSyntheticsTestVersionWithHttpInfoAsync( + publicId, versionNumber, new GetSyntheticsTestVersionOptionalParameters()) .thenApply( response -> { return response.getData(); @@ -1282,20 +1605,606 @@ public CompletableFuture patchGlobalVariableAsync( } /** - * 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. + * Get a specific version of a test. * - *

Common operations include: - Replace field values: - * {"op": "replace", "path": "/name", "value": "new_name"} - Update nested values: - * {"op": "replace", "path": "/value/value", "value": "new_value"} - Add/update tags: - * {"op": "add", "path": "/tags/-", "value": "new_tag"} - Remove fields: - * {"op": "remove", "path": "/description"} + *

See {@link #getSyntheticsTestVersionWithHttpInfo}. * - * @param variableId The ID of the global variable. (required) - * @param body JSON Patch document with operations to apply. (required) - * @return ApiResponse<GlobalVariableResponse> + * @param publicId The public ID of the Synthetic test. (required) + * @param versionNumber The version number to retrieve. (required) + * @param parameters Optional parameters for the request. + * @return SyntheticsTestVersionResponse * @throws ApiException if fails to make API call - * @http.response.details + */ + public SyntheticsTestVersionResponse getSyntheticsTestVersion( + String publicId, Long versionNumber, GetSyntheticsTestVersionOptionalParameters parameters) + throws ApiException { + return getSyntheticsTestVersionWithHttpInfo(publicId, versionNumber, parameters).getData(); + } + + /** + * Get a specific version of a test. + * + *

See {@link #getSyntheticsTestVersionWithHttpInfoAsync}. + * + * @param publicId The public ID of the Synthetic test. (required) + * @param versionNumber The version number to retrieve. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<SyntheticsTestVersionResponse> + */ + public CompletableFuture getSyntheticsTestVersionAsync( + String publicId, Long versionNumber, GetSyntheticsTestVersionOptionalParameters parameters) { + return getSyntheticsTestVersionWithHttpInfoAsync(publicId, versionNumber, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a specific version of a Synthetic test by its version number. + * + * @param publicId The public ID of the Synthetic test. (required) + * @param versionNumber The version number to retrieve. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<SyntheticsTestVersionResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
404 API error response. -
429 Too many requests -
+ */ + public ApiResponse getSyntheticsTestVersionWithHttpInfo( + String publicId, Long versionNumber, GetSyntheticsTestVersionOptionalParameters parameters) + throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'publicId' is set + if (publicId == null) { + throw new ApiException( + 400, "Missing the required parameter 'publicId' when calling getSyntheticsTestVersion"); + } + + // verify the required parameter 'versionNumber' is set + if (versionNumber == null) { + throw new ApiException( + 400, + "Missing the required parameter 'versionNumber' when calling getSyntheticsTestVersion"); + } + Boolean includeChangeMetadata = parameters.includeChangeMetadata; + Boolean onlyCheckExistence = parameters.onlyCheckExistence; + // create path and map variables + String localVarPath = + "/api/v2/synthetics/tests/{public_id}/version_history/{version_number}" + .replaceAll("\\{" + "public_id" + "\\}", apiClient.escapeString(publicId.toString())) + .replaceAll( + "\\{" + "version_number" + "\\}", apiClient.escapeString(versionNumber.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "include_change_metadata", includeChangeMetadata)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "only_check_existence", onlyCheckExistence)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SyntheticsApi.getSyntheticsTestVersion", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a specific version of a test. + * + *

See {@link #getSyntheticsTestVersionWithHttpInfo}. + * + * @param publicId The public ID of the Synthetic test. (required) + * @param versionNumber The version number to retrieve. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<SyntheticsTestVersionResponse>> + */ + public CompletableFuture> + getSyntheticsTestVersionWithHttpInfoAsync( + String publicId, + Long versionNumber, + GetSyntheticsTestVersionOptionalParameters parameters) { + Object localVarPostBody = null; + + // verify the required parameter 'publicId' is set + if (publicId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'publicId' when calling getSyntheticsTestVersion")); + return result; + } + + // verify the required parameter 'versionNumber' is set + if (versionNumber == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'versionNumber' when calling" + + " getSyntheticsTestVersion")); + return result; + } + Boolean includeChangeMetadata = parameters.includeChangeMetadata; + Boolean onlyCheckExistence = parameters.onlyCheckExistence; + // create path and map variables + String localVarPath = + "/api/v2/synthetics/tests/{public_id}/version_history/{version_number}" + .replaceAll("\\{" + "public_id" + "\\}", apiClient.escapeString(publicId.toString())) + .replaceAll( + "\\{" + "version_number" + "\\}", apiClient.escapeString(versionNumber.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "include_change_metadata", includeChangeMetadata)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "only_check_existence", onlyCheckExistence)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SyntheticsApi.getSyntheticsTestVersion", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get parent suites for a test. + * + *

See {@link #getTestParentSuitesWithHttpInfo}. + * + * @param publicId The public ID of the Synthetic test. (required) + * @return SyntheticsTestParentSuitesResponse + * @throws ApiException if fails to make API call + */ + public SyntheticsTestParentSuitesResponse getTestParentSuites(String publicId) + throws ApiException { + return getTestParentSuitesWithHttpInfo(publicId).getData(); + } + + /** + * Get parent suites for a test. + * + *

See {@link #getTestParentSuitesWithHttpInfoAsync}. + * + * @param publicId The public ID of the Synthetic test. (required) + * @return CompletableFuture<SyntheticsTestParentSuitesResponse> + */ + public CompletableFuture getTestParentSuitesAsync( + String publicId) { + return getTestParentSuitesWithHttpInfoAsync(publicId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the list of parent suites and their status for a given Synthetic test. + * + * @param publicId The public ID of the Synthetic test. (required) + * @return ApiResponse<SyntheticsTestParentSuitesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
404 API error response. -
429 Too many requests -
+ */ + public ApiResponse getTestParentSuitesWithHttpInfo( + String publicId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'publicId' is set + if (publicId == null) { + throw new ApiException( + 400, "Missing the required parameter 'publicId' when calling getTestParentSuites"); + } + // create path and map variables + String localVarPath = + "/api/v2/synthetics/tests/{public_id}/parent-suites" + .replaceAll("\\{" + "public_id" + "\\}", apiClient.escapeString(publicId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SyntheticsApi.getTestParentSuites", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get parent suites for a test. + * + *

See {@link #getTestParentSuitesWithHttpInfo}. + * + * @param publicId The public ID of the Synthetic test. (required) + * @return CompletableFuture<ApiResponse<SyntheticsTestParentSuitesResponse>> + */ + public CompletableFuture> + getTestParentSuitesWithHttpInfoAsync(String publicId) { + Object localVarPostBody = null; + + // verify the required parameter 'publicId' is set + if (publicId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'publicId' when calling getTestParentSuites")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/synthetics/tests/{public_id}/parent-suites" + .replaceAll("\\{" + "public_id" + "\\}", apiClient.escapeString(publicId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SyntheticsApi.getTestParentSuites", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to listSyntheticsTestVersions. */ + public static class ListSyntheticsTestVersionsOptionalParameters { + private Long lastVersionNumber; + private Long limit; + + /** + * Set lastVersionNumber. + * + * @param lastVersionNumber The version number of the last item from the previous page. Omit to + * get the first page. (optional) + * @return ListSyntheticsTestVersionsOptionalParameters + */ + public ListSyntheticsTestVersionsOptionalParameters lastVersionNumber(Long lastVersionNumber) { + this.lastVersionNumber = lastVersionNumber; + return this; + } + + /** + * Set limit. + * + * @param limit Maximum number of version records to return per page. (optional) + * @return ListSyntheticsTestVersionsOptionalParameters + */ + public ListSyntheticsTestVersionsOptionalParameters limit(Long limit) { + this.limit = limit; + return this; + } + } + + /** + * Get version history of a test. + * + *

See {@link #listSyntheticsTestVersionsWithHttpInfo}. + * + * @param publicId The public ID of the Synthetic test. (required) + * @return SyntheticsTestVersionHistoryResponse + * @throws ApiException if fails to make API call + */ + public SyntheticsTestVersionHistoryResponse listSyntheticsTestVersions(String publicId) + throws ApiException { + return listSyntheticsTestVersionsWithHttpInfo( + publicId, new ListSyntheticsTestVersionsOptionalParameters()) + .getData(); + } + + /** + * Get version history of a test. + * + *

See {@link #listSyntheticsTestVersionsWithHttpInfoAsync}. + * + * @param publicId The public ID of the Synthetic test. (required) + * @return CompletableFuture<SyntheticsTestVersionHistoryResponse> + */ + public CompletableFuture listSyntheticsTestVersionsAsync( + String publicId) { + return listSyntheticsTestVersionsWithHttpInfoAsync( + publicId, new ListSyntheticsTestVersionsOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get version history of a test. + * + *

See {@link #listSyntheticsTestVersionsWithHttpInfo}. + * + * @param publicId The public ID of the Synthetic test. (required) + * @param parameters Optional parameters for the request. + * @return SyntheticsTestVersionHistoryResponse + * @throws ApiException if fails to make API call + */ + public SyntheticsTestVersionHistoryResponse listSyntheticsTestVersions( + String publicId, ListSyntheticsTestVersionsOptionalParameters parameters) + throws ApiException { + return listSyntheticsTestVersionsWithHttpInfo(publicId, parameters).getData(); + } + + /** + * Get version history of a test. + * + *

See {@link #listSyntheticsTestVersionsWithHttpInfoAsync}. + * + * @param publicId The public ID of the Synthetic test. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<SyntheticsTestVersionHistoryResponse> + */ + public CompletableFuture listSyntheticsTestVersionsAsync( + String publicId, ListSyntheticsTestVersionsOptionalParameters parameters) { + return listSyntheticsTestVersionsWithHttpInfoAsync(publicId, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the paginated version history for a Synthetic test. + * + * @param publicId The public ID of the Synthetic test. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<SyntheticsTestVersionHistoryResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 API error response. -
404 API error response. -
429 Too many requests -
+ */ + public ApiResponse listSyntheticsTestVersionsWithHttpInfo( + String publicId, ListSyntheticsTestVersionsOptionalParameters parameters) + throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'publicId' is set + if (publicId == null) { + throw new ApiException( + 400, "Missing the required parameter 'publicId' when calling listSyntheticsTestVersions"); + } + Long lastVersionNumber = parameters.lastVersionNumber; + Long limit = parameters.limit; + // create path and map variables + String localVarPath = + "/api/v2/synthetics/tests/{public_id}/version_history" + .replaceAll("\\{" + "public_id" + "\\}", apiClient.escapeString(publicId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "last_version_number", lastVersionNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SyntheticsApi.listSyntheticsTestVersions", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get version history of a test. + * + *

See {@link #listSyntheticsTestVersionsWithHttpInfo}. + * + * @param publicId The public ID of the Synthetic test. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<SyntheticsTestVersionHistoryResponse>> + */ + public CompletableFuture> + listSyntheticsTestVersionsWithHttpInfoAsync( + String publicId, ListSyntheticsTestVersionsOptionalParameters parameters) { + Object localVarPostBody = null; + + // verify the required parameter 'publicId' is set + if (publicId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'publicId' when calling listSyntheticsTestVersions")); + return result; + } + Long lastVersionNumber = parameters.lastVersionNumber; + Long limit = parameters.limit; + // create path and map variables + String localVarPath = + "/api/v2/synthetics/tests/{public_id}/version_history" + .replaceAll("\\{" + "public_id" + "\\}", apiClient.escapeString(publicId.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "last_version_number", lastVersionNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SyntheticsApi.listSyntheticsTestVersions", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Patch a global variable. + * + *

See {@link #patchGlobalVariableWithHttpInfo}. + * + * @param variableId The ID of the global variable. (required) + * @param body JSON Patch document with operations to apply. (required) + * @return GlobalVariableResponse + * @throws ApiException if fails to make API call + */ + public GlobalVariableResponse patchGlobalVariable( + String variableId, GlobalVariableJsonPatchRequest body) throws ApiException { + return patchGlobalVariableWithHttpInfo(variableId, body).getData(); + } + + /** + * Patch a global variable. + * + *

See {@link #patchGlobalVariableWithHttpInfoAsync}. + * + * @param variableId The ID of the global variable. (required) + * @param body JSON Patch document with operations to apply. (required) + * @return CompletableFuture<GlobalVariableResponse> + */ + public CompletableFuture patchGlobalVariableAsync( + String variableId, GlobalVariableJsonPatchRequest body) { + return patchGlobalVariableWithHttpInfoAsync(variableId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * 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. + * + *

Common operations include: - Replace field values: + * {"op": "replace", "path": "/name", "value": "new_name"} - Update nested values: + * {"op": "replace", "path": "/value/value", "value": "new_value"} - Add/update tags: + * {"op": "add", "path": "/tags/-", "value": "new_tag"} - Remove fields: + * {"op": "remove", "path": "/description"} + * + * @param variableId The ID of the global variable. (required) + * @param body JSON Patch document with operations to apply. (required) + * @return ApiResponse<GlobalVariableResponse> + * @throws ApiException if fails to make API call + * @http.response.details * * * @@ -1413,6 +2322,167 @@ public ApiResponse patchGlobalVariableWithHttpInfo( new GenericType() {}); } + /** + * Patch a test suite. + * + *

See {@link #patchTestSuiteWithHttpInfo}. + * + * @param publicId The public ID of the Synthetic test suite to patch. (required) + * @param body JSON Patch document with operations to apply. (required) + * @return SyntheticsSuiteResponse + * @throws ApiException if fails to make API call + */ + public SyntheticsSuiteResponse patchTestSuite(String publicId, SuiteJsonPatchRequest body) + throws ApiException { + return patchTestSuiteWithHttpInfo(publicId, body).getData(); + } + + /** + * Patch a test suite. + * + *

See {@link #patchTestSuiteWithHttpInfoAsync}. + * + * @param publicId The public ID of the Synthetic test suite to patch. (required) + * @param body JSON Patch document with operations to apply. (required) + * @return CompletableFuture<SyntheticsSuiteResponse> + */ + public CompletableFuture patchTestSuiteAsync( + String publicId, SuiteJsonPatchRequest body) { + return patchTestSuiteWithHttpInfoAsync(publicId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * 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 publicId The public ID of the Synthetic test suite to patch. (required) + * @param body JSON Patch document with operations to apply. (required) + * @return ApiResponse<SyntheticsSuiteResponse> + * @throws ApiException if fails to make API call + * @http.response.details + *

Response details
Status Code Description Response Headers
+ * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 API error response. -
429 Too many requests -
+ */ + public ApiResponse patchTestSuiteWithHttpInfo( + String publicId, SuiteJsonPatchRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'publicId' is set + if (publicId == null) { + throw new ApiException( + 400, "Missing the required parameter 'publicId' when calling patchTestSuite"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling patchTestSuite"); + } + // create path and map variables + String localVarPath = + "/api/v2/synthetics/suites/{public_id}/jsonpatch" + .replaceAll("\\{" + "public_id" + "\\}", apiClient.escapeString(publicId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SyntheticsApi.patchTestSuite", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Patch a test suite. + * + *

See {@link #patchTestSuiteWithHttpInfo}. + * + * @param publicId The public ID of the Synthetic test suite to patch. (required) + * @param body JSON Patch document with operations to apply. (required) + * @return CompletableFuture<ApiResponse<SyntheticsSuiteResponse>> + */ + public CompletableFuture> patchTestSuiteWithHttpInfoAsync( + String publicId, SuiteJsonPatchRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'publicId' is set + if (publicId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'publicId' when calling patchTestSuite")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling patchTestSuite")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/synthetics/suites/{public_id}/jsonpatch" + .replaceAll("\\{" + "public_id" + "\\}", apiClient.escapeString(publicId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SyntheticsApi.patchTestSuite", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** Manage optional parameters to searchSuites. */ public static class SearchSuitesOptionalParameters { private String query; diff --git a/src/main/java/com/datadog/api/client/v2/api/WidgetsApi.java b/src/main/java/com/datadog/api/client/v2/api/WidgetsApi.java new file mode 100644 index 00000000000..dc28ab77bf1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/api/WidgetsApi.java @@ -0,0 +1,1037 @@ +package com.datadog.api.client.v2.api; + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.ApiResponse; +import com.datadog.api.client.Pair; +import com.datadog.api.client.v2.model.CreateOrUpdateWidgetRequest; +import com.datadog.api.client.v2.model.WidgetExperienceType; +import com.datadog.api.client.v2.model.WidgetListResponse; +import com.datadog.api.client.v2.model.WidgetResponse; +import com.datadog.api.client.v2.model.WidgetType; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.GenericType; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.CompletableFuture; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class WidgetsApi { + private ApiClient apiClient; + + public WidgetsApi() { + this(ApiClient.getDefaultApiClient()); + } + + public WidgetsApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API client. + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API client. + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Create a widget. + * + *

See {@link #createWidgetWithHttpInfo}. + * + * @param experienceType The experience type for the widget. (required) + * @param body Widget request body. (required) + * @return WidgetResponse + * @throws ApiException if fails to make API call + */ + public WidgetResponse createWidget( + WidgetExperienceType experienceType, CreateOrUpdateWidgetRequest body) throws ApiException { + return createWidgetWithHttpInfo(experienceType, body).getData(); + } + + /** + * Create a widget. + * + *

See {@link #createWidgetWithHttpInfoAsync}. + * + * @param experienceType The experience type for the widget. (required) + * @param body Widget request body. (required) + * @return CompletableFuture<WidgetResponse> + */ + public CompletableFuture createWidgetAsync( + WidgetExperienceType experienceType, CreateOrUpdateWidgetRequest body) { + return createWidgetWithHttpInfoAsync(experienceType, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Create a new widget for a given experience type. + * + * @param experienceType The experience type for the widget. (required) + * @param body Widget request body. (required) + * @return ApiResponse<WidgetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse createWidgetWithHttpInfo( + WidgetExperienceType experienceType, CreateOrUpdateWidgetRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'experienceType' is set + if (experienceType == null) { + throw new ApiException( + 400, "Missing the required parameter 'experienceType' when calling createWidget"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createWidget"); + } + // create path and map variables + String localVarPath = + "/api/v2/widgets/{experience_type}" + .replaceAll( + "\\{" + "experience_type" + "\\}", + apiClient.escapeString(experienceType.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.WidgetsApi.createWidget", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Create a widget. + * + *

See {@link #createWidgetWithHttpInfo}. + * + * @param experienceType The experience type for the widget. (required) + * @param body Widget request body. (required) + * @return CompletableFuture<ApiResponse<WidgetResponse>> + */ + public CompletableFuture> createWidgetWithHttpInfoAsync( + WidgetExperienceType experienceType, CreateOrUpdateWidgetRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'experienceType' is set + if (experienceType == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'experienceType' when calling createWidget")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'body' when calling createWidget")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/widgets/{experience_type}" + .replaceAll( + "\\{" + "experience_type" + "\\}", + apiClient.escapeString(experienceType.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.WidgetsApi.createWidget", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Delete a widget. + * + *

See {@link #deleteWidgetWithHttpInfo}. + * + * @param experienceType The experience type for the widget. (required) + * @param uuid The UUID of the widget. (required) + * @throws ApiException if fails to make API call + */ + public void deleteWidget(WidgetExperienceType experienceType, UUID uuid) throws ApiException { + deleteWidgetWithHttpInfo(experienceType, uuid); + } + + /** + * Delete a widget. + * + *

See {@link #deleteWidgetWithHttpInfoAsync}. + * + * @param experienceType The experience type for the widget. (required) + * @param uuid The UUID of the widget. (required) + * @return CompletableFuture + */ + public CompletableFuture deleteWidgetAsync(WidgetExperienceType experienceType, UUID uuid) { + return deleteWidgetWithHttpInfoAsync(experienceType, uuid) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Soft-delete a widget by its UUID for a given experience type. + * + * @param experienceType The experience type for the widget. (required) + * @param uuid The UUID of the widget. (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
204 No Content -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse deleteWidgetWithHttpInfo(WidgetExperienceType experienceType, UUID uuid) + throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'experienceType' is set + if (experienceType == null) { + throw new ApiException( + 400, "Missing the required parameter 'experienceType' when calling deleteWidget"); + } + + // verify the required parameter 'uuid' is set + if (uuid == null) { + throw new ApiException( + 400, "Missing the required parameter 'uuid' when calling deleteWidget"); + } + // create path and map variables + String localVarPath = + "/api/v2/widgets/{experience_type}/{uuid}" + .replaceAll( + "\\{" + "experience_type" + "\\}", + apiClient.escapeString(experienceType.toString())) + .replaceAll("\\{" + "uuid" + "\\}", apiClient.escapeString(uuid.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.WidgetsApi.deleteWidget", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Delete a widget. + * + *

See {@link #deleteWidgetWithHttpInfo}. + * + * @param experienceType The experience type for the widget. (required) + * @param uuid The UUID of the widget. (required) + * @return CompletableFuture<ApiResponse<Void>> + */ + public CompletableFuture> deleteWidgetWithHttpInfoAsync( + WidgetExperienceType experienceType, UUID uuid) { + Object localVarPostBody = null; + + // verify the required parameter 'experienceType' is set + if (experienceType == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'experienceType' when calling deleteWidget")); + return result; + } + + // verify the required parameter 'uuid' is set + if (uuid == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'uuid' when calling deleteWidget")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/widgets/{experience_type}/{uuid}" + .replaceAll( + "\\{" + "experience_type" + "\\}", + apiClient.escapeString(experienceType.toString())) + .replaceAll("\\{" + "uuid" + "\\}", apiClient.escapeString(uuid.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.WidgetsApi.deleteWidget", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"*/*"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "DELETE", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + null); + } + + /** + * Get a widget. + * + *

See {@link #getWidgetWithHttpInfo}. + * + * @param experienceType The experience type for the widget. (required) + * @param uuid The UUID of the widget. (required) + * @return WidgetResponse + * @throws ApiException if fails to make API call + */ + public WidgetResponse getWidget(WidgetExperienceType experienceType, UUID uuid) + throws ApiException { + return getWidgetWithHttpInfo(experienceType, uuid).getData(); + } + + /** + * Get a widget. + * + *

See {@link #getWidgetWithHttpInfoAsync}. + * + * @param experienceType The experience type for the widget. (required) + * @param uuid The UUID of the widget. (required) + * @return CompletableFuture<WidgetResponse> + */ + public CompletableFuture getWidgetAsync( + WidgetExperienceType experienceType, UUID uuid) { + return getWidgetWithHttpInfoAsync(experienceType, uuid) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Retrieve a widget by its UUID for a given experience type. + * + * @param experienceType The experience type for the widget. (required) + * @param uuid The UUID of the widget. (required) + * @return ApiResponse<WidgetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getWidgetWithHttpInfo( + WidgetExperienceType experienceType, UUID uuid) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'experienceType' is set + if (experienceType == null) { + throw new ApiException( + 400, "Missing the required parameter 'experienceType' when calling getWidget"); + } + + // verify the required parameter 'uuid' is set + if (uuid == null) { + throw new ApiException(400, "Missing the required parameter 'uuid' when calling getWidget"); + } + // create path and map variables + String localVarPath = + "/api/v2/widgets/{experience_type}/{uuid}" + .replaceAll( + "\\{" + "experience_type" + "\\}", + apiClient.escapeString(experienceType.toString())) + .replaceAll("\\{" + "uuid" + "\\}", apiClient.escapeString(uuid.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.WidgetsApi.getWidget", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a widget. + * + *

See {@link #getWidgetWithHttpInfo}. + * + * @param experienceType The experience type for the widget. (required) + * @param uuid The UUID of the widget. (required) + * @return CompletableFuture<ApiResponse<WidgetResponse>> + */ + public CompletableFuture> getWidgetWithHttpInfoAsync( + WidgetExperienceType experienceType, UUID uuid) { + Object localVarPostBody = null; + + // verify the required parameter 'experienceType' is set + if (experienceType == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'experienceType' when calling getWidget")); + return result; + } + + // verify the required parameter 'uuid' is set + if (uuid == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'uuid' when calling getWidget")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/widgets/{experience_type}/{uuid}" + .replaceAll( + "\\{" + "experience_type" + "\\}", + apiClient.escapeString(experienceType.toString())) + .replaceAll("\\{" + "uuid" + "\\}", apiClient.escapeString(uuid.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.WidgetsApi.getWidget", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to searchWidgets. */ + public static class SearchWidgetsOptionalParameters { + private WidgetType filterWidgetType; + private String filterCreatorHandle; + private Boolean filterIsFavorited; + private String filterTitle; + private String filterTags; + private String sort; + private Integer pageNumber; + private Integer pageSize; + + /** + * Set filterWidgetType. + * + * @param filterWidgetType Filter widgets by widget type. (optional) + * @return SearchWidgetsOptionalParameters + */ + public SearchWidgetsOptionalParameters filterWidgetType(WidgetType filterWidgetType) { + this.filterWidgetType = filterWidgetType; + return this; + } + + /** + * Set filterCreatorHandle. + * + * @param filterCreatorHandle Filter widgets by the email handle of the creator. (optional) + * @return SearchWidgetsOptionalParameters + */ + public SearchWidgetsOptionalParameters filterCreatorHandle(String filterCreatorHandle) { + this.filterCreatorHandle = filterCreatorHandle; + return this; + } + + /** + * Set filterIsFavorited. + * + * @param filterIsFavorited Filter to only widgets favorited by the current user. (optional) + * @return SearchWidgetsOptionalParameters + */ + public SearchWidgetsOptionalParameters filterIsFavorited(Boolean filterIsFavorited) { + this.filterIsFavorited = filterIsFavorited; + return this; + } + + /** + * Set filterTitle. + * + * @param filterTitle Filter widgets by title (substring match). (optional) + * @return SearchWidgetsOptionalParameters + */ + public SearchWidgetsOptionalParameters filterTitle(String filterTitle) { + this.filterTitle = filterTitle; + return this; + } + + /** + * Set filterTags. + * + * @param filterTags Filter widgets by tags. Format as bracket-delimited CSV, e.g. + * [tag1,tag2]. (optional) + * @return SearchWidgetsOptionalParameters + */ + public SearchWidgetsOptionalParameters filterTags(String filterTags) { + this.filterTags = filterTags; + return this; + } + + /** + * Set sort. + * + * @param sort Sort field for the results. Prefix with - for descending order. + * Allowed values: title, created_at, modified_at. + * (optional, default to "-modified_at") + * @return SearchWidgetsOptionalParameters + */ + public SearchWidgetsOptionalParameters sort(String sort) { + this.sort = sort; + return this; + } + + /** + * Set pageNumber. + * + * @param pageNumber Page number for pagination (0-indexed). (optional, default to 0) + * @return SearchWidgetsOptionalParameters + */ + public SearchWidgetsOptionalParameters pageNumber(Integer pageNumber) { + this.pageNumber = pageNumber; + return this; + } + + /** + * Set pageSize. + * + * @param pageSize Number of widgets per page. (optional, default to 50) + * @return SearchWidgetsOptionalParameters + */ + public SearchWidgetsOptionalParameters pageSize(Integer pageSize) { + this.pageSize = pageSize; + return this; + } + } + + /** + * Search widgets. + * + *

See {@link #searchWidgetsWithHttpInfo}. + * + * @param experienceType The experience type for the widget. (required) + * @return WidgetListResponse + * @throws ApiException if fails to make API call + */ + public WidgetListResponse searchWidgets(WidgetExperienceType experienceType) throws ApiException { + return searchWidgetsWithHttpInfo(experienceType, new SearchWidgetsOptionalParameters()) + .getData(); + } + + /** + * Search widgets. + * + *

See {@link #searchWidgetsWithHttpInfoAsync}. + * + * @param experienceType The experience type for the widget. (required) + * @return CompletableFuture<WidgetListResponse> + */ + public CompletableFuture searchWidgetsAsync( + WidgetExperienceType experienceType) { + return searchWidgetsWithHttpInfoAsync(experienceType, new SearchWidgetsOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Search widgets. + * + *

See {@link #searchWidgetsWithHttpInfo}. + * + * @param experienceType The experience type for the widget. (required) + * @param parameters Optional parameters for the request. + * @return WidgetListResponse + * @throws ApiException if fails to make API call + */ + public WidgetListResponse searchWidgets( + WidgetExperienceType experienceType, SearchWidgetsOptionalParameters parameters) + throws ApiException { + return searchWidgetsWithHttpInfo(experienceType, parameters).getData(); + } + + /** + * Search widgets. + * + *

See {@link #searchWidgetsWithHttpInfoAsync}. + * + * @param experienceType The experience type for the widget. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<WidgetListResponse> + */ + public CompletableFuture searchWidgetsAsync( + WidgetExperienceType experienceType, SearchWidgetsOptionalParameters parameters) { + return searchWidgetsWithHttpInfoAsync(experienceType, parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * 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 experienceType The experience type for the widget. (required) + * @param parameters Optional parameters for the request. + * @return ApiResponse<WidgetListResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse searchWidgetsWithHttpInfo( + WidgetExperienceType experienceType, SearchWidgetsOptionalParameters parameters) + throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'experienceType' is set + if (experienceType == null) { + throw new ApiException( + 400, "Missing the required parameter 'experienceType' when calling searchWidgets"); + } + WidgetType filterWidgetType = parameters.filterWidgetType; + String filterCreatorHandle = parameters.filterCreatorHandle; + Boolean filterIsFavorited = parameters.filterIsFavorited; + String filterTitle = parameters.filterTitle; + String filterTags = parameters.filterTags; + String sort = parameters.sort; + Integer pageNumber = parameters.pageNumber; + Integer pageSize = parameters.pageSize; + // create path and map variables + String localVarPath = + "/api/v2/widgets/{experience_type}" + .replaceAll( + "\\{" + "experience_type" + "\\}", + apiClient.escapeString(experienceType.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[widgetType]", filterWidgetType)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[creatorHandle]", filterCreatorHandle)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[isFavorited]", filterIsFavorited)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[title]", filterTitle)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[tags]", filterTags)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.WidgetsApi.searchWidgets", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Search widgets. + * + *

See {@link #searchWidgetsWithHttpInfo}. + * + * @param experienceType The experience type for the widget. (required) + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<WidgetListResponse>> + */ + public CompletableFuture> searchWidgetsWithHttpInfoAsync( + WidgetExperienceType experienceType, SearchWidgetsOptionalParameters parameters) { + Object localVarPostBody = null; + + // verify the required parameter 'experienceType' is set + if (experienceType == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'experienceType' when calling searchWidgets")); + return result; + } + WidgetType filterWidgetType = parameters.filterWidgetType; + String filterCreatorHandle = parameters.filterCreatorHandle; + Boolean filterIsFavorited = parameters.filterIsFavorited; + String filterTitle = parameters.filterTitle; + String filterTags = parameters.filterTags; + String sort = parameters.sort; + Integer pageNumber = parameters.pageNumber; + Integer pageSize = parameters.pageSize; + // create path and map variables + String localVarPath = + "/api/v2/widgets/{experience_type}" + .replaceAll( + "\\{" + "experience_type" + "\\}", + apiClient.escapeString(experienceType.toString())); + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[widgetType]", filterWidgetType)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[creatorHandle]", filterCreatorHandle)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[isFavorited]", filterIsFavorited)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[title]", filterTitle)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[tags]", filterTags)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort", sort)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.WidgetsApi.searchWidgets", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update a widget. + * + *

See {@link #updateWidgetWithHttpInfo}. + * + * @param experienceType The experience type for the widget. (required) + * @param uuid The UUID of the widget. (required) + * @param body Widget request body. (required) + * @return WidgetResponse + * @throws ApiException if fails to make API call + */ + public WidgetResponse updateWidget( + WidgetExperienceType experienceType, UUID uuid, CreateOrUpdateWidgetRequest body) + throws ApiException { + return updateWidgetWithHttpInfo(experienceType, uuid, body).getData(); + } + + /** + * Update a widget. + * + *

See {@link #updateWidgetWithHttpInfoAsync}. + * + * @param experienceType The experience type for the widget. (required) + * @param uuid The UUID of the widget. (required) + * @param body Widget request body. (required) + * @return CompletableFuture<WidgetResponse> + */ + public CompletableFuture updateWidgetAsync( + WidgetExperienceType experienceType, UUID uuid, CreateOrUpdateWidgetRequest body) { + return updateWidgetWithHttpInfoAsync(experienceType, uuid, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Update a widget by its UUID for a given experience type. This performs a full replacement of + * the widget definition. + * + * @param experienceType The experience type for the widget. (required) + * @param uuid The UUID of the widget. (required) + * @param body Widget request body. (required) + * @return ApiResponse<WidgetResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse updateWidgetWithHttpInfo( + WidgetExperienceType experienceType, UUID uuid, CreateOrUpdateWidgetRequest body) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'experienceType' is set + if (experienceType == null) { + throw new ApiException( + 400, "Missing the required parameter 'experienceType' when calling updateWidget"); + } + + // verify the required parameter 'uuid' is set + if (uuid == null) { + throw new ApiException( + 400, "Missing the required parameter 'uuid' when calling updateWidget"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateWidget"); + } + // create path and map variables + String localVarPath = + "/api/v2/widgets/{experience_type}/{uuid}" + .replaceAll( + "\\{" + "experience_type" + "\\}", + apiClient.escapeString(experienceType.toString())) + .replaceAll("\\{" + "uuid" + "\\}", apiClient.escapeString(uuid.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.WidgetsApi.updateWidget", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update a widget. + * + *

See {@link #updateWidgetWithHttpInfo}. + * + * @param experienceType The experience type for the widget. (required) + * @param uuid The UUID of the widget. (required) + * @param body Widget request body. (required) + * @return CompletableFuture<ApiResponse<WidgetResponse>> + */ + public CompletableFuture> updateWidgetWithHttpInfoAsync( + WidgetExperienceType experienceType, UUID uuid, CreateOrUpdateWidgetRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'experienceType' is set + if (experienceType == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'experienceType' when calling updateWidget")); + return result; + } + + // verify the required parameter 'uuid' is set + if (uuid == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'uuid' when calling updateWidget")); + return result; + } + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(400, "Missing the required parameter 'body' when calling updateWidget")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/widgets/{experience_type}/{uuid}" + .replaceAll( + "\\{" + "experience_type" + "\\}", + apiClient.escapeString(experienceType.toString())) + .replaceAll("\\{" + "uuid" + "\\}", apiClient.escapeString(uuid.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.WidgetsApi.updateWidget", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateOrUpdateWidgetRequest.java b/src/main/java/com/datadog/api/client/v2/model/CreateOrUpdateWidgetRequest.java new file mode 100644 index 00000000000..1f1601d3a4b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateOrUpdateWidgetRequest.java @@ -0,0 +1,147 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Request body for creating or updating a widget. */ +@JsonPropertyOrder({CreateOrUpdateWidgetRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateOrUpdateWidgetRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private CreateOrUpdateWidgetRequestData data; + + public CreateOrUpdateWidgetRequest() {} + + @JsonCreator + public CreateOrUpdateWidgetRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + CreateOrUpdateWidgetRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public CreateOrUpdateWidgetRequest data(CreateOrUpdateWidgetRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for creating or updating a widget. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CreateOrUpdateWidgetRequestData getData() { + return data; + } + + public void setData(CreateOrUpdateWidgetRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateOrUpdateWidgetRequest + */ + @JsonAnySetter + public CreateOrUpdateWidgetRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateOrUpdateWidgetRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateOrUpdateWidgetRequest createOrUpdateWidgetRequest = (CreateOrUpdateWidgetRequest) o; + return Objects.equals(this.data, createOrUpdateWidgetRequest.data) + && Objects.equals( + this.additionalProperties, createOrUpdateWidgetRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateOrUpdateWidgetRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateOrUpdateWidgetRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CreateOrUpdateWidgetRequestAttributes.java new file mode 100644 index 00000000000..3b8616026be --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateOrUpdateWidgetRequestAttributes.java @@ -0,0 +1,202 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Attributes for creating or updating a widget. */ +@JsonPropertyOrder({ + CreateOrUpdateWidgetRequestAttributes.JSON_PROPERTY_DEFINITION, + CreateOrUpdateWidgetRequestAttributes.JSON_PROPERTY_TAGS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateOrUpdateWidgetRequestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DEFINITION = "definition"; + private WidgetDefinition definition; + + public static final String JSON_PROPERTY_TAGS = "tags"; + private JsonNullable> tags = JsonNullable.>undefined(); + + public CreateOrUpdateWidgetRequestAttributes() {} + + @JsonCreator + public CreateOrUpdateWidgetRequestAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_DEFINITION) + WidgetDefinition definition) { + this.definition = definition; + this.unparsed |= definition.unparsed; + } + + public CreateOrUpdateWidgetRequestAttributes definition(WidgetDefinition definition) { + this.definition = definition; + this.unparsed |= definition.unparsed; + return this; + } + + /** + * The definition of a widget, including its type and configuration. + * + * @return definition + */ + @JsonProperty(JSON_PROPERTY_DEFINITION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public WidgetDefinition getDefinition() { + return definition; + } + + public void setDefinition(WidgetDefinition definition) { + this.definition = definition; + } + + public CreateOrUpdateWidgetRequestAttributes tags(List tags) { + this.tags = JsonNullable.>of(tags); + return this; + } + + public CreateOrUpdateWidgetRequestAttributes addTagsItem(String tagsItem) { + if (this.tags == null || !this.tags.isPresent()) { + this.tags = JsonNullable.>of(new ArrayList<>()); + } + try { + this.tags.get().add(tagsItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * User-defined tags for organizing the widget. + * + * @return tags + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getTags() { + return tags.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getTags_JsonNullable() { + return tags; + } + + @JsonProperty(JSON_PROPERTY_TAGS) + public void setTags_JsonNullable(JsonNullable> tags) { + this.tags = tags; + } + + public void setTags(List tags) { + this.tags = JsonNullable.>of(tags); + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateOrUpdateWidgetRequestAttributes + */ + @JsonAnySetter + public CreateOrUpdateWidgetRequestAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateOrUpdateWidgetRequestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateOrUpdateWidgetRequestAttributes createOrUpdateWidgetRequestAttributes = + (CreateOrUpdateWidgetRequestAttributes) o; + return Objects.equals(this.definition, createOrUpdateWidgetRequestAttributes.definition) + && Objects.equals(this.tags, createOrUpdateWidgetRequestAttributes.tags) + && Objects.equals( + this.additionalProperties, createOrUpdateWidgetRequestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(definition, tags, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateOrUpdateWidgetRequestAttributes {\n"); + sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CreateOrUpdateWidgetRequestData.java b/src/main/java/com/datadog/api/client/v2/model/CreateOrUpdateWidgetRequestData.java new file mode 100644 index 00000000000..85604bace65 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CreateOrUpdateWidgetRequestData.java @@ -0,0 +1,179 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data for creating or updating a widget. */ +@JsonPropertyOrder({ + CreateOrUpdateWidgetRequestData.JSON_PROPERTY_ATTRIBUTES, + CreateOrUpdateWidgetRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CreateOrUpdateWidgetRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private CreateOrUpdateWidgetRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public CreateOrUpdateWidgetRequestData() {} + + @JsonCreator + public CreateOrUpdateWidgetRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + CreateOrUpdateWidgetRequestAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + } + + public CreateOrUpdateWidgetRequestData attributes( + CreateOrUpdateWidgetRequestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for creating or updating a widget. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CreateOrUpdateWidgetRequestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(CreateOrUpdateWidgetRequestAttributes attributes) { + this.attributes = attributes; + } + + public CreateOrUpdateWidgetRequestData type(String type) { + this.type = type; + return this; + } + + /** + * Widgets resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CreateOrUpdateWidgetRequestData + */ + @JsonAnySetter + public CreateOrUpdateWidgetRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CreateOrUpdateWidgetRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateOrUpdateWidgetRequestData createOrUpdateWidgetRequestData = + (CreateOrUpdateWidgetRequestData) o; + return Objects.equals(this.attributes, createOrUpdateWidgetRequestData.attributes) + && Objects.equals(this.type, createOrUpdateWidgetRequestData.type) + && Objects.equals( + this.additionalProperties, createOrUpdateWidgetRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateOrUpdateWidgetRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SuiteJsonPatchRequest.java b/src/main/java/com/datadog/api/client/v2/model/SuiteJsonPatchRequest.java new file mode 100644 index 00000000000..cf7f6f93b78 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SuiteJsonPatchRequest.java @@ -0,0 +1,145 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** JSON Patch request for a Synthetic test suite. */ +@JsonPropertyOrder({SuiteJsonPatchRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SuiteJsonPatchRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private SuiteJsonPatchRequestData data; + + public SuiteJsonPatchRequest() {} + + @JsonCreator + public SuiteJsonPatchRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) SuiteJsonPatchRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public SuiteJsonPatchRequest data(SuiteJsonPatchRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for a JSON Patch request on a Synthetic test suite. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SuiteJsonPatchRequestData getData() { + return data; + } + + public void setData(SuiteJsonPatchRequestData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SuiteJsonPatchRequest + */ + @JsonAnySetter + public SuiteJsonPatchRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SuiteJsonPatchRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SuiteJsonPatchRequest suiteJsonPatchRequest = (SuiteJsonPatchRequest) o; + return Objects.equals(this.data, suiteJsonPatchRequest.data) + && Objects.equals(this.additionalProperties, suiteJsonPatchRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SuiteJsonPatchRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SuiteJsonPatchRequestData.java b/src/main/java/com/datadog/api/client/v2/model/SuiteJsonPatchRequestData.java new file mode 100644 index 00000000000..8e70acff407 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SuiteJsonPatchRequestData.java @@ -0,0 +1,170 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for a JSON Patch request on a Synthetic test suite. */ +@JsonPropertyOrder({ + SuiteJsonPatchRequestData.JSON_PROPERTY_ATTRIBUTES, + SuiteJsonPatchRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SuiteJsonPatchRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private SuiteJsonPatchRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private SuiteJsonPatchType type = SuiteJsonPatchType.SUITES_JSON_PATCH; + + public SuiteJsonPatchRequestData attributes(SuiteJsonPatchRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for a JSON Patch request on a Synthetic test suite. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SuiteJsonPatchRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(SuiteJsonPatchRequestDataAttributes attributes) { + this.attributes = attributes; + } + + public SuiteJsonPatchRequestData type(SuiteJsonPatchType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type for a JSON Patch request on a Synthetic test suite, suites_json_patch. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SuiteJsonPatchType getType() { + return type; + } + + public void setType(SuiteJsonPatchType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SuiteJsonPatchRequestData + */ + @JsonAnySetter + public SuiteJsonPatchRequestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SuiteJsonPatchRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SuiteJsonPatchRequestData suiteJsonPatchRequestData = (SuiteJsonPatchRequestData) o; + return Objects.equals(this.attributes, suiteJsonPatchRequestData.attributes) + && Objects.equals(this.type, suiteJsonPatchRequestData.type) + && Objects.equals( + this.additionalProperties, suiteJsonPatchRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SuiteJsonPatchRequestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SuiteJsonPatchRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/SuiteJsonPatchRequestDataAttributes.java new file mode 100644 index 00000000000..1ac7b057f32 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SuiteJsonPatchRequestDataAttributes.java @@ -0,0 +1,151 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes for a JSON Patch request on a Synthetic test suite. */ +@JsonPropertyOrder({SuiteJsonPatchRequestDataAttributes.JSON_PROPERTY_JSON_PATCH}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SuiteJsonPatchRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_JSON_PATCH = "json_patch"; + private List jsonPatch = null; + + public SuiteJsonPatchRequestDataAttributes jsonPatch(List jsonPatch) { + this.jsonPatch = jsonPatch; + for (JsonPatchOperation item : jsonPatch) { + this.unparsed |= item.unparsed; + } + return this; + } + + public SuiteJsonPatchRequestDataAttributes addJsonPatchItem(JsonPatchOperation jsonPatchItem) { + if (this.jsonPatch == null) { + this.jsonPatch = new ArrayList<>(); + } + this.jsonPatch.add(jsonPatchItem); + this.unparsed |= jsonPatchItem.unparsed; + return this; + } + + /** + * JSON Patch operations following RFC 6902. + * + * @return jsonPatch + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_JSON_PATCH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getJsonPatch() { + return jsonPatch; + } + + public void setJsonPatch(List jsonPatch) { + this.jsonPatch = jsonPatch; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SuiteJsonPatchRequestDataAttributes + */ + @JsonAnySetter + public SuiteJsonPatchRequestDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SuiteJsonPatchRequestDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SuiteJsonPatchRequestDataAttributes suiteJsonPatchRequestDataAttributes = + (SuiteJsonPatchRequestDataAttributes) o; + return Objects.equals(this.jsonPatch, suiteJsonPatchRequestDataAttributes.jsonPatch) + && Objects.equals( + this.additionalProperties, suiteJsonPatchRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(jsonPatch, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SuiteJsonPatchRequestDataAttributes {\n"); + sb.append(" jsonPatch: ").append(toIndentedString(jsonPatch)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SuiteJsonPatchType.java b/src/main/java/com/datadog/api/client/v2/model/SuiteJsonPatchType.java new file mode 100644 index 00000000000..74ef6029dc0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SuiteJsonPatchType.java @@ -0,0 +1,55 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type for a JSON Patch request on a Synthetic test suite, suites_json_patch. */ +@JsonSerialize(using = SuiteJsonPatchType.SuiteJsonPatchTypeSerializer.class) +public class SuiteJsonPatchType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("suites_json_patch")); + + public static final SuiteJsonPatchType SUITES_JSON_PATCH = + new SuiteJsonPatchType("suites_json_patch"); + + SuiteJsonPatchType(String value) { + super(value, allowedValues); + } + + public static class SuiteJsonPatchTypeSerializer extends StdSerializer { + public SuiteJsonPatchTypeSerializer(Class t) { + super(t); + } + + public SuiteJsonPatchTypeSerializer() { + this(null); + } + + @Override + public void serialize(SuiteJsonPatchType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SuiteJsonPatchType fromValue(String value) { + return new SuiteJsonPatchType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsApiMultistepParentTestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsApiMultistepParentTestAttributes.java new file mode 100644 index 00000000000..34316a07d65 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsApiMultistepParentTestAttributes.java @@ -0,0 +1,318 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes of a parent API multistep test. */ +@JsonPropertyOrder({ + SyntheticsApiMultistepParentTestAttributes.JSON_PROPERTY_CHILD_NAME, + SyntheticsApiMultistepParentTestAttributes.JSON_PROPERTY_CHILD_PUBLIC_ID, + SyntheticsApiMultistepParentTestAttributes.JSON_PROPERTY_MONITOR_ID, + SyntheticsApiMultistepParentTestAttributes.JSON_PROPERTY_NAME, + SyntheticsApiMultistepParentTestAttributes.JSON_PROPERTY_OVERALL_STATE, + SyntheticsApiMultistepParentTestAttributes.JSON_PROPERTY_OVERALL_STATE_MODIFIED, + SyntheticsApiMultistepParentTestAttributes.JSON_PROPERTY_PUBLIC_ID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsApiMultistepParentTestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CHILD_NAME = "child_name"; + private String childName; + + public static final String JSON_PROPERTY_CHILD_PUBLIC_ID = "child_public_id"; + private String childPublicId; + + public static final String JSON_PROPERTY_MONITOR_ID = "monitor_id"; + private Long monitorId; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_OVERALL_STATE = "overall_state"; + private Long overallState; + + public static final String JSON_PROPERTY_OVERALL_STATE_MODIFIED = "overall_state_modified"; + private String overallStateModified; + + public static final String JSON_PROPERTY_PUBLIC_ID = "public_id"; + private String publicId; + + public SyntheticsApiMultistepParentTestAttributes childName(String childName) { + this.childName = childName; + return this; + } + + /** + * The name of the child subtest. + * + * @return childName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHILD_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChildName() { + return childName; + } + + public void setChildName(String childName) { + this.childName = childName; + } + + public SyntheticsApiMultistepParentTestAttributes childPublicId(String childPublicId) { + this.childPublicId = childPublicId; + return this; + } + + /** + * The public ID of the child subtest. + * + * @return childPublicId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHILD_PUBLIC_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChildPublicId() { + return childPublicId; + } + + public void setChildPublicId(String childPublicId) { + this.childPublicId = childPublicId; + } + + public SyntheticsApiMultistepParentTestAttributes monitorId(Long monitorId) { + this.monitorId = monitorId; + return this; + } + + /** + * The associated monitor ID. + * + * @return monitorId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MONITOR_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getMonitorId() { + return monitorId; + } + + public void setMonitorId(Long monitorId) { + this.monitorId = monitorId; + } + + public SyntheticsApiMultistepParentTestAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Name of the parent test. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public SyntheticsApiMultistepParentTestAttributes overallState(Long overallState) { + this.overallState = overallState; + return this; + } + + /** + * The overall state of the parent test. + * + * @return overallState + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OVERALL_STATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getOverallState() { + return overallState; + } + + public void setOverallState(Long overallState) { + this.overallState = overallState; + } + + public SyntheticsApiMultistepParentTestAttributes overallStateModified( + String overallStateModified) { + this.overallStateModified = overallStateModified; + return this; + } + + /** + * Timestamp of when the overall state was last modified. + * + * @return overallStateModified + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OVERALL_STATE_MODIFIED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOverallStateModified() { + return overallStateModified; + } + + public void setOverallStateModified(String overallStateModified) { + this.overallStateModified = overallStateModified; + } + + public SyntheticsApiMultistepParentTestAttributes publicId(String publicId) { + this.publicId = publicId; + return this; + } + + /** + * The public ID of the parent test. + * + * @return publicId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PUBLIC_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPublicId() { + return publicId; + } + + public void setPublicId(String publicId) { + this.publicId = publicId; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SyntheticsApiMultistepParentTestAttributes + */ + @JsonAnySetter + public SyntheticsApiMultistepParentTestAttributes putAdditionalProperty( + String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SyntheticsApiMultistepParentTestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsApiMultistepParentTestAttributes syntheticsApiMultistepParentTestAttributes = + (SyntheticsApiMultistepParentTestAttributes) o; + return Objects.equals(this.childName, syntheticsApiMultistepParentTestAttributes.childName) + && Objects.equals( + this.childPublicId, syntheticsApiMultistepParentTestAttributes.childPublicId) + && Objects.equals(this.monitorId, syntheticsApiMultistepParentTestAttributes.monitorId) + && Objects.equals(this.name, syntheticsApiMultistepParentTestAttributes.name) + && Objects.equals( + this.overallState, syntheticsApiMultistepParentTestAttributes.overallState) + && Objects.equals( + this.overallStateModified, + syntheticsApiMultistepParentTestAttributes.overallStateModified) + && Objects.equals(this.publicId, syntheticsApiMultistepParentTestAttributes.publicId) + && Objects.equals( + this.additionalProperties, + syntheticsApiMultistepParentTestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + childName, + childPublicId, + monitorId, + name, + overallState, + overallStateModified, + publicId, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsApiMultistepParentTestAttributes {\n"); + sb.append(" childName: ").append(toIndentedString(childName)).append("\n"); + sb.append(" childPublicId: ").append(toIndentedString(childPublicId)).append("\n"); + sb.append(" monitorId: ").append(toIndentedString(monitorId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" overallState: ").append(toIndentedString(overallState)).append("\n"); + sb.append(" overallStateModified: ") + .append(toIndentedString(overallStateModified)) + .append("\n"); + sb.append(" publicId: ").append(toIndentedString(publicId)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsApiMultistepParentTestData.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsApiMultistepParentTestData.java new file mode 100644 index 00000000000..d23847e2690 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsApiMultistepParentTestData.java @@ -0,0 +1,200 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for a parent API multistep test. */ +@JsonPropertyOrder({ + SyntheticsApiMultistepParentTestData.JSON_PROPERTY_ATTRIBUTES, + SyntheticsApiMultistepParentTestData.JSON_PROPERTY_ID, + SyntheticsApiMultistepParentTestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsApiMultistepParentTestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private SyntheticsApiMultistepParentTestAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private SyntheticsApiMultistepParentTestType type = + SyntheticsApiMultistepParentTestType.PARENT_TEST; + + public SyntheticsApiMultistepParentTestData attributes( + SyntheticsApiMultistepParentTestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a parent API multistep test. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsApiMultistepParentTestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(SyntheticsApiMultistepParentTestAttributes attributes) { + this.attributes = attributes; + } + + public SyntheticsApiMultistepParentTestData id(String id) { + this.id = id; + return this; + } + + /** + * The public ID of the parent test. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public SyntheticsApiMultistepParentTestData type(SyntheticsApiMultistepParentTestType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the parent test resource. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsApiMultistepParentTestType getType() { + return type; + } + + public void setType(SyntheticsApiMultistepParentTestType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SyntheticsApiMultistepParentTestData + */ + @JsonAnySetter + public SyntheticsApiMultistepParentTestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SyntheticsApiMultistepParentTestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsApiMultistepParentTestData syntheticsApiMultistepParentTestData = + (SyntheticsApiMultistepParentTestData) o; + return Objects.equals(this.attributes, syntheticsApiMultistepParentTestData.attributes) + && Objects.equals(this.id, syntheticsApiMultistepParentTestData.id) + && Objects.equals(this.type, syntheticsApiMultistepParentTestData.type) + && Objects.equals( + this.additionalProperties, syntheticsApiMultistepParentTestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsApiMultistepParentTestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsApiMultistepParentTestType.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsApiMultistepParentTestType.java new file mode 100644 index 00000000000..6bc2c7e61d8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsApiMultistepParentTestType.java @@ -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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type of the parent test resource. */ +@JsonSerialize( + using = + SyntheticsApiMultistepParentTestType.SyntheticsApiMultistepParentTestTypeSerializer.class) +public class SyntheticsApiMultistepParentTestType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("parent_test")); + + public static final SyntheticsApiMultistepParentTestType PARENT_TEST = + new SyntheticsApiMultistepParentTestType("parent_test"); + + SyntheticsApiMultistepParentTestType(String value) { + super(value, allowedValues); + } + + public static class SyntheticsApiMultistepParentTestTypeSerializer + extends StdSerializer { + public SyntheticsApiMultistepParentTestTypeSerializer( + Class t) { + super(t); + } + + public SyntheticsApiMultistepParentTestTypeSerializer() { + this(null); + } + + @Override + public void serialize( + SyntheticsApiMultistepParentTestType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SyntheticsApiMultistepParentTestType fromValue(String value) { + return new SyntheticsApiMultistepParentTestType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsApiMultistepParentTestsResponse.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsApiMultistepParentTestsResponse.java new file mode 100644 index 00000000000..36f46b5774f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsApiMultistepParentTestsResponse.java @@ -0,0 +1,154 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response containing the list of parent tests for an API multistep subtest. */ +@JsonPropertyOrder({SyntheticsApiMultistepParentTestsResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsApiMultistepParentTestsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public SyntheticsApiMultistepParentTestsResponse data( + List data) { + this.data = data; + for (SyntheticsApiMultistepParentTestData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public SyntheticsApiMultistepParentTestsResponse addDataItem( + SyntheticsApiMultistepParentTestData dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * List of parent tests that include this subtest. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SyntheticsApiMultistepParentTestsResponse + */ + @JsonAnySetter + public SyntheticsApiMultistepParentTestsResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SyntheticsApiMultistepParentTestsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsApiMultistepParentTestsResponse syntheticsApiMultistepParentTestsResponse = + (SyntheticsApiMultistepParentTestsResponse) o; + return Objects.equals(this.data, syntheticsApiMultistepParentTestsResponse.data) + && Objects.equals( + this.additionalProperties, + syntheticsApiMultistepParentTestsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsApiMultistepParentTestsResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsApiMultistepSubtestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsApiMultistepSubtestAttributes.java new file mode 100644 index 00000000000..005d732cac2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsApiMultistepSubtestAttributes.java @@ -0,0 +1,167 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes of a Synthetic API multistep subtest. */ +@JsonPropertyOrder({ + SyntheticsApiMultistepSubtestAttributes.JSON_PROPERTY_NAME, + SyntheticsApiMultistepSubtestAttributes.JSON_PROPERTY_PUBLIC_ID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsApiMultistepSubtestAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_PUBLIC_ID = "public_id"; + private String publicId; + + public SyntheticsApiMultistepSubtestAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Name of the subtest. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public SyntheticsApiMultistepSubtestAttributes publicId(String publicId) { + this.publicId = publicId; + return this; + } + + /** + * The public ID of the subtest. + * + * @return publicId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PUBLIC_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPublicId() { + return publicId; + } + + public void setPublicId(String publicId) { + this.publicId = publicId; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SyntheticsApiMultistepSubtestAttributes + */ + @JsonAnySetter + public SyntheticsApiMultistepSubtestAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SyntheticsApiMultistepSubtestAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsApiMultistepSubtestAttributes syntheticsApiMultistepSubtestAttributes = + (SyntheticsApiMultistepSubtestAttributes) o; + return Objects.equals(this.name, syntheticsApiMultistepSubtestAttributes.name) + && Objects.equals(this.publicId, syntheticsApiMultistepSubtestAttributes.publicId) + && Objects.equals( + this.additionalProperties, + syntheticsApiMultistepSubtestAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, publicId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsApiMultistepSubtestAttributes {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" publicId: ").append(toIndentedString(publicId)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsApiMultistepSubtestData.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsApiMultistepSubtestData.java new file mode 100644 index 00000000000..253e7e8fe67 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsApiMultistepSubtestData.java @@ -0,0 +1,199 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for a Synthetic API multistep subtest. */ +@JsonPropertyOrder({ + SyntheticsApiMultistepSubtestData.JSON_PROPERTY_ATTRIBUTES, + SyntheticsApiMultistepSubtestData.JSON_PROPERTY_ID, + SyntheticsApiMultistepSubtestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsApiMultistepSubtestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private SyntheticsApiMultistepSubtestAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private SyntheticsApiMultistepSubtestType type = SyntheticsApiMultistepSubtestType.SUBTEST; + + public SyntheticsApiMultistepSubtestData attributes( + SyntheticsApiMultistepSubtestAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a Synthetic API multistep subtest. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsApiMultistepSubtestAttributes getAttributes() { + return attributes; + } + + public void setAttributes(SyntheticsApiMultistepSubtestAttributes attributes) { + this.attributes = attributes; + } + + public SyntheticsApiMultistepSubtestData id(String id) { + this.id = id; + return this; + } + + /** + * The public ID of the subtest. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public SyntheticsApiMultistepSubtestData type(SyntheticsApiMultistepSubtestType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the subtest resource. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsApiMultistepSubtestType getType() { + return type; + } + + public void setType(SyntheticsApiMultistepSubtestType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SyntheticsApiMultistepSubtestData + */ + @JsonAnySetter + public SyntheticsApiMultistepSubtestData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SyntheticsApiMultistepSubtestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsApiMultistepSubtestData syntheticsApiMultistepSubtestData = + (SyntheticsApiMultistepSubtestData) o; + return Objects.equals(this.attributes, syntheticsApiMultistepSubtestData.attributes) + && Objects.equals(this.id, syntheticsApiMultistepSubtestData.id) + && Objects.equals(this.type, syntheticsApiMultistepSubtestData.type) + && Objects.equals( + this.additionalProperties, syntheticsApiMultistepSubtestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsApiMultistepSubtestData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsApiMultistepSubtestType.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsApiMultistepSubtestType.java new file mode 100644 index 00000000000..a9ca151f33e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsApiMultistepSubtestType.java @@ -0,0 +1,57 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type of the subtest resource. */ +@JsonSerialize( + using = SyntheticsApiMultistepSubtestType.SyntheticsApiMultistepSubtestTypeSerializer.class) +public class SyntheticsApiMultistepSubtestType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("subtest")); + + public static final SyntheticsApiMultistepSubtestType SUBTEST = + new SyntheticsApiMultistepSubtestType("subtest"); + + SyntheticsApiMultistepSubtestType(String value) { + super(value, allowedValues); + } + + public static class SyntheticsApiMultistepSubtestTypeSerializer + extends StdSerializer { + public SyntheticsApiMultistepSubtestTypeSerializer(Class t) { + super(t); + } + + public SyntheticsApiMultistepSubtestTypeSerializer() { + this(null); + } + + @Override + public void serialize( + SyntheticsApiMultistepSubtestType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SyntheticsApiMultistepSubtestType fromValue(String value) { + return new SyntheticsApiMultistepSubtestType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsApiMultistepSubtestsResponse.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsApiMultistepSubtestsResponse.java new file mode 100644 index 00000000000..d0811a11e1a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsApiMultistepSubtestsResponse.java @@ -0,0 +1,152 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response containing the list of available subtests for an API multistep test. */ +@JsonPropertyOrder({SyntheticsApiMultistepSubtestsResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsApiMultistepSubtestsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public SyntheticsApiMultistepSubtestsResponse data(List data) { + this.data = data; + for (SyntheticsApiMultistepSubtestData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public SyntheticsApiMultistepSubtestsResponse addDataItem( + SyntheticsApiMultistepSubtestData dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * List of API tests that can be added as subtests. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SyntheticsApiMultistepSubtestsResponse + */ + @JsonAnySetter + public SyntheticsApiMultistepSubtestsResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SyntheticsApiMultistepSubtestsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsApiMultistepSubtestsResponse syntheticsApiMultistepSubtestsResponse = + (SyntheticsApiMultistepSubtestsResponse) o; + return Objects.equals(this.data, syntheticsApiMultistepSubtestsResponse.data) + && Objects.equals( + this.additionalProperties, syntheticsApiMultistepSubtestsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsApiMultistepSubtestsResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestParentSuiteAttributes.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestParentSuiteAttributes.java new file mode 100644 index 00000000000..b1bd4aa99d0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestParentSuiteAttributes.java @@ -0,0 +1,312 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Object containing details about a parent suite of a Synthetic test. */ +@JsonPropertyOrder({ + SyntheticsTestParentSuiteAttributes.JSON_PROPERTY_CHILD_NAME, + SyntheticsTestParentSuiteAttributes.JSON_PROPERTY_CHILD_PUBLIC_ID, + SyntheticsTestParentSuiteAttributes.JSON_PROPERTY_MONITOR_ID, + SyntheticsTestParentSuiteAttributes.JSON_PROPERTY_NAME, + SyntheticsTestParentSuiteAttributes.JSON_PROPERTY_OVERALL_STATE, + SyntheticsTestParentSuiteAttributes.JSON_PROPERTY_OVERALL_STATE_MODIFIED, + SyntheticsTestParentSuiteAttributes.JSON_PROPERTY_PUBLIC_ID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsTestParentSuiteAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CHILD_NAME = "child_name"; + private String childName; + + public static final String JSON_PROPERTY_CHILD_PUBLIC_ID = "child_public_id"; + private String childPublicId; + + public static final String JSON_PROPERTY_MONITOR_ID = "monitor_id"; + private Long monitorId; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_OVERALL_STATE = "overall_state"; + private Long overallState; + + public static final String JSON_PROPERTY_OVERALL_STATE_MODIFIED = "overall_state_modified"; + private String overallStateModified; + + public static final String JSON_PROPERTY_PUBLIC_ID = "public_id"; + private String publicId; + + public SyntheticsTestParentSuiteAttributes childName(String childName) { + this.childName = childName; + return this; + } + + /** + * The name of the child test within the suite. + * + * @return childName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHILD_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChildName() { + return childName; + } + + public void setChildName(String childName) { + this.childName = childName; + } + + public SyntheticsTestParentSuiteAttributes childPublicId(String childPublicId) { + this.childPublicId = childPublicId; + return this; + } + + /** + * The public ID of the child test within the suite. + * + * @return childPublicId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHILD_PUBLIC_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChildPublicId() { + return childPublicId; + } + + public void setChildPublicId(String childPublicId) { + this.childPublicId = childPublicId; + } + + public SyntheticsTestParentSuiteAttributes monitorId(Long monitorId) { + this.monitorId = monitorId; + return this; + } + + /** + * The associated monitor ID. + * + * @return monitorId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MONITOR_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getMonitorId() { + return monitorId; + } + + public void setMonitorId(Long monitorId) { + this.monitorId = monitorId; + } + + public SyntheticsTestParentSuiteAttributes name(String name) { + this.name = name; + return this; + } + + /** + * Name of the parent suite. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public SyntheticsTestParentSuiteAttributes overallState(Long overallState) { + this.overallState = overallState; + return this; + } + + /** + * The overall state of the parent suite. + * + * @return overallState + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OVERALL_STATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getOverallState() { + return overallState; + } + + public void setOverallState(Long overallState) { + this.overallState = overallState; + } + + public SyntheticsTestParentSuiteAttributes overallStateModified(String overallStateModified) { + this.overallStateModified = overallStateModified; + return this; + } + + /** + * Timestamp of when the overall state was last modified. + * + * @return overallStateModified + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OVERALL_STATE_MODIFIED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOverallStateModified() { + return overallStateModified; + } + + public void setOverallStateModified(String overallStateModified) { + this.overallStateModified = overallStateModified; + } + + public SyntheticsTestParentSuiteAttributes publicId(String publicId) { + this.publicId = publicId; + return this; + } + + /** + * The public ID of the parent suite. + * + * @return publicId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PUBLIC_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPublicId() { + return publicId; + } + + public void setPublicId(String publicId) { + this.publicId = publicId; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SyntheticsTestParentSuiteAttributes + */ + @JsonAnySetter + public SyntheticsTestParentSuiteAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SyntheticsTestParentSuiteAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsTestParentSuiteAttributes syntheticsTestParentSuiteAttributes = + (SyntheticsTestParentSuiteAttributes) o; + return Objects.equals(this.childName, syntheticsTestParentSuiteAttributes.childName) + && Objects.equals(this.childPublicId, syntheticsTestParentSuiteAttributes.childPublicId) + && Objects.equals(this.monitorId, syntheticsTestParentSuiteAttributes.monitorId) + && Objects.equals(this.name, syntheticsTestParentSuiteAttributes.name) + && Objects.equals(this.overallState, syntheticsTestParentSuiteAttributes.overallState) + && Objects.equals( + this.overallStateModified, syntheticsTestParentSuiteAttributes.overallStateModified) + && Objects.equals(this.publicId, syntheticsTestParentSuiteAttributes.publicId) + && Objects.equals( + this.additionalProperties, syntheticsTestParentSuiteAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + childName, + childPublicId, + monitorId, + name, + overallState, + overallStateModified, + publicId, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsTestParentSuiteAttributes {\n"); + sb.append(" childName: ").append(toIndentedString(childName)).append("\n"); + sb.append(" childPublicId: ").append(toIndentedString(childPublicId)).append("\n"); + sb.append(" monitorId: ").append(toIndentedString(monitorId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" overallState: ").append(toIndentedString(overallState)).append("\n"); + sb.append(" overallStateModified: ") + .append(toIndentedString(overallStateModified)) + .append("\n"); + sb.append(" publicId: ").append(toIndentedString(publicId)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestParentSuiteData.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestParentSuiteData.java new file mode 100644 index 00000000000..16cdeaf6b41 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestParentSuiteData.java @@ -0,0 +1,197 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for a parent suite. */ +@JsonPropertyOrder({ + SyntheticsTestParentSuiteData.JSON_PROPERTY_ATTRIBUTES, + SyntheticsTestParentSuiteData.JSON_PROPERTY_ID, + SyntheticsTestParentSuiteData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsTestParentSuiteData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private SyntheticsTestParentSuiteAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private SyntheticsTestParentSuiteType type = SyntheticsTestParentSuiteType.PARENT_SUITE; + + public SyntheticsTestParentSuiteData attributes(SyntheticsTestParentSuiteAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Object containing details about a parent suite of a Synthetic test. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsTestParentSuiteAttributes getAttributes() { + return attributes; + } + + public void setAttributes(SyntheticsTestParentSuiteAttributes attributes) { + this.attributes = attributes; + } + + public SyntheticsTestParentSuiteData id(String id) { + this.id = id; + return this; + } + + /** + * The public ID of the parent suite. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public SyntheticsTestParentSuiteData type(SyntheticsTestParentSuiteType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the parent suite resource. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsTestParentSuiteType getType() { + return type; + } + + public void setType(SyntheticsTestParentSuiteType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SyntheticsTestParentSuiteData + */ + @JsonAnySetter + public SyntheticsTestParentSuiteData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SyntheticsTestParentSuiteData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsTestParentSuiteData syntheticsTestParentSuiteData = (SyntheticsTestParentSuiteData) o; + return Objects.equals(this.attributes, syntheticsTestParentSuiteData.attributes) + && Objects.equals(this.id, syntheticsTestParentSuiteData.id) + && Objects.equals(this.type, syntheticsTestParentSuiteData.type) + && Objects.equals( + this.additionalProperties, syntheticsTestParentSuiteData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsTestParentSuiteData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestParentSuiteType.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestParentSuiteType.java new file mode 100644 index 00000000000..8b46fe1c8b5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestParentSuiteType.java @@ -0,0 +1,57 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type of the parent suite resource. */ +@JsonSerialize(using = SyntheticsTestParentSuiteType.SyntheticsTestParentSuiteTypeSerializer.class) +public class SyntheticsTestParentSuiteType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("parent_suite")); + + public static final SyntheticsTestParentSuiteType PARENT_SUITE = + new SyntheticsTestParentSuiteType("parent_suite"); + + SyntheticsTestParentSuiteType(String value) { + super(value, allowedValues); + } + + public static class SyntheticsTestParentSuiteTypeSerializer + extends StdSerializer { + public SyntheticsTestParentSuiteTypeSerializer(Class t) { + super(t); + } + + public SyntheticsTestParentSuiteTypeSerializer() { + this(null); + } + + @Override + public void serialize( + SyntheticsTestParentSuiteType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SyntheticsTestParentSuiteType fromValue(String value) { + return new SyntheticsTestParentSuiteType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestParentSuitesResponse.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestParentSuitesResponse.java new file mode 100644 index 00000000000..2542fdbfe4e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestParentSuitesResponse.java @@ -0,0 +1,151 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response containing the list of parent suites for a Synthetic test. */ +@JsonPropertyOrder({SyntheticsTestParentSuitesResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsTestParentSuitesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public SyntheticsTestParentSuitesResponse data(List data) { + this.data = data; + for (SyntheticsTestParentSuiteData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public SyntheticsTestParentSuitesResponse addDataItem(SyntheticsTestParentSuiteData dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * List of parent suites for the given test. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SyntheticsTestParentSuitesResponse + */ + @JsonAnySetter + public SyntheticsTestParentSuitesResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SyntheticsTestParentSuitesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsTestParentSuitesResponse syntheticsTestParentSuitesResponse = + (SyntheticsTestParentSuitesResponse) o; + return Objects.equals(this.data, syntheticsTestParentSuitesResponse.data) + && Objects.equals( + this.additionalProperties, syntheticsTestParentSuitesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsTestParentSuitesResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionActionMetadata.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionActionMetadata.java new file mode 100644 index 00000000000..2fa1b02d079 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionActionMetadata.java @@ -0,0 +1,249 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Object containing metadata about a change action. */ +@JsonPropertyOrder({ + SyntheticsTestVersionActionMetadata.JSON_PROPERTY_AFTER_VALUE, + SyntheticsTestVersionActionMetadata.JSON_PROPERTY_BEFORE_VALUE, + SyntheticsTestVersionActionMetadata.JSON_PROPERTY_DIFF_PATCHES, + SyntheticsTestVersionActionMetadata.JSON_PROPERTY_PROPERTY_PATH +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsTestVersionActionMetadata { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AFTER_VALUE = "after_value"; + private Object afterValue = null; + + public static final String JSON_PROPERTY_BEFORE_VALUE = "before_value"; + private Object beforeValue = null; + + public static final String JSON_PROPERTY_DIFF_PATCHES = "diff_patches"; + private JsonNullable> diffPatches = + JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_PROPERTY_PATH = "property_path"; + private String propertyPath; + + public SyntheticsTestVersionActionMetadata afterValue(Object afterValue) { + this.afterValue = afterValue; + return this; + } + + /** + * The value of the property after the change. + * + * @return afterValue + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AFTER_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getAfterValue() { + return afterValue; + } + + public void setAfterValue(Object afterValue) { + this.afterValue = afterValue; + } + + public SyntheticsTestVersionActionMetadata beforeValue(Object beforeValue) { + this.beforeValue = beforeValue; + return this; + } + + /** + * The value of the property before the change. + * + * @return beforeValue + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BEFORE_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getBeforeValue() { + return beforeValue; + } + + public void setBeforeValue(Object beforeValue) { + this.beforeValue = beforeValue; + } + + public SyntheticsTestVersionActionMetadata diffPatches( + List diffPatches) { + this.diffPatches = JsonNullable.>of(diffPatches); + return this; + } + + public SyntheticsTestVersionActionMetadata addDiffPatchesItem( + SyntheticsTestVersionDiffPatches diffPatchesItem) { + if (this.diffPatches == null || !this.diffPatches.isPresent()) { + this.diffPatches = JsonNullable.>of(new ArrayList<>()); + } + try { + this.diffPatches.get().add(diffPatchesItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * List of diff patches for text changes. + * + * @return diffPatches + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getDiffPatches() { + return diffPatches.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_DIFF_PATCHES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getDiffPatches_JsonNullable() { + return diffPatches; + } + + @JsonProperty(JSON_PROPERTY_DIFF_PATCHES) + public void setDiffPatches_JsonNullable( + JsonNullable> diffPatches) { + this.diffPatches = diffPatches; + } + + public void setDiffPatches(List diffPatches) { + this.diffPatches = JsonNullable.>of(diffPatches); + } + + public SyntheticsTestVersionActionMetadata propertyPath(String propertyPath) { + this.propertyPath = propertyPath; + return this; + } + + /** + * The dot-separated path of the property that was changed. + * + * @return propertyPath + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyPath() { + return propertyPath; + } + + public void setPropertyPath(String propertyPath) { + this.propertyPath = propertyPath; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SyntheticsTestVersionActionMetadata + */ + @JsonAnySetter + public SyntheticsTestVersionActionMetadata putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SyntheticsTestVersionActionMetadata object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsTestVersionActionMetadata syntheticsTestVersionActionMetadata = + (SyntheticsTestVersionActionMetadata) o; + return Objects.equals(this.afterValue, syntheticsTestVersionActionMetadata.afterValue) + && Objects.equals(this.beforeValue, syntheticsTestVersionActionMetadata.beforeValue) + && Objects.equals(this.diffPatches, syntheticsTestVersionActionMetadata.diffPatches) + && Objects.equals(this.propertyPath, syntheticsTestVersionActionMetadata.propertyPath) + && Objects.equals( + this.additionalProperties, syntheticsTestVersionActionMetadata.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(afterValue, beforeValue, diffPatches, propertyPath, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsTestVersionActionMetadata {\n"); + sb.append(" afterValue: ").append(toIndentedString(afterValue)).append("\n"); + sb.append(" beforeValue: ").append(toIndentedString(beforeValue)).append("\n"); + sb.append(" diffPatches: ").append(toIndentedString(diffPatches)).append("\n"); + sb.append(" propertyPath: ").append(toIndentedString(propertyPath)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionAttributes.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionAttributes.java new file mode 100644 index 00000000000..cfe8883c4e7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionAttributes.java @@ -0,0 +1,253 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes of a specific Synthetic test version. */ +@JsonPropertyOrder({ + SyntheticsTestVersionAttributes.JSON_PROPERTY_AUTHOR, + SyntheticsTestVersionAttributes.JSON_PROPERTY_CHANGE_METADATA, + SyntheticsTestVersionAttributes.JSON_PROPERTY_PAYLOAD, + SyntheticsTestVersionAttributes.JSON_PROPERTY_VERSION_PAYLOAD_CREATED_AT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsTestVersionAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AUTHOR = "author"; + private SyntheticsTestVersionAuthor author; + + public static final String JSON_PROPERTY_CHANGE_METADATA = "change_metadata"; + private List changeMetadata = null; + + public static final String JSON_PROPERTY_PAYLOAD = "payload"; + private Map payload = null; + + public static final String JSON_PROPERTY_VERSION_PAYLOAD_CREATED_AT = + "version_payload_created_at"; + private OffsetDateTime versionPayloadCreatedAt; + + public SyntheticsTestVersionAttributes author(SyntheticsTestVersionAuthor author) { + this.author = author; + this.unparsed |= author.unparsed; + return this; + } + + /** + * Object describing the author of a test version. + * + * @return author + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTHOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsTestVersionAuthor getAuthor() { + return author; + } + + public void setAuthor(SyntheticsTestVersionAuthor author) { + this.author = author; + } + + public SyntheticsTestVersionAttributes changeMetadata( + List changeMetadata) { + this.changeMetadata = changeMetadata; + for (SyntheticsTestVersionChangeMetadataItem item : changeMetadata) { + this.unparsed |= item.unparsed; + } + return this; + } + + public SyntheticsTestVersionAttributes addChangeMetadataItem( + SyntheticsTestVersionChangeMetadataItem changeMetadataItem) { + if (this.changeMetadata == null) { + this.changeMetadata = new ArrayList<>(); + } + this.changeMetadata.add(changeMetadataItem); + this.unparsed |= changeMetadataItem.unparsed; + return this; + } + + /** + * List of metadata describing individual changes in this version. Only returned when the + * include_change_metadata query parameter is true. + * + * @return changeMetadata + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHANGE_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getChangeMetadata() { + return changeMetadata; + } + + public void setChangeMetadata(List changeMetadata) { + this.changeMetadata = changeMetadata; + } + + public SyntheticsTestVersionAttributes payload(Map payload) { + this.payload = payload; + return this; + } + + public SyntheticsTestVersionAttributes putPayloadItem(String key, Object payloadItem) { + if (this.payload == null) { + this.payload = new HashMap<>(); + } + this.payload.put(key, payloadItem); + return this; + } + + /** + * The full test configuration at this version. + * + * @return payload + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAYLOAD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getPayload() { + return payload; + } + + public void setPayload(Map payload) { + this.payload = payload; + } + + public SyntheticsTestVersionAttributes versionPayloadCreatedAt( + OffsetDateTime versionPayloadCreatedAt) { + this.versionPayloadCreatedAt = versionPayloadCreatedAt; + return this; + } + + /** + * Timestamp of when this version was created. + * + * @return versionPayloadCreatedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERSION_PAYLOAD_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getVersionPayloadCreatedAt() { + return versionPayloadCreatedAt; + } + + public void setVersionPayloadCreatedAt(OffsetDateTime versionPayloadCreatedAt) { + this.versionPayloadCreatedAt = versionPayloadCreatedAt; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SyntheticsTestVersionAttributes + */ + @JsonAnySetter + public SyntheticsTestVersionAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SyntheticsTestVersionAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsTestVersionAttributes syntheticsTestVersionAttributes = + (SyntheticsTestVersionAttributes) o; + return Objects.equals(this.author, syntheticsTestVersionAttributes.author) + && Objects.equals(this.changeMetadata, syntheticsTestVersionAttributes.changeMetadata) + && Objects.equals(this.payload, syntheticsTestVersionAttributes.payload) + && Objects.equals( + this.versionPayloadCreatedAt, syntheticsTestVersionAttributes.versionPayloadCreatedAt) + && Objects.equals( + this.additionalProperties, syntheticsTestVersionAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + author, changeMetadata, payload, versionPayloadCreatedAt, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsTestVersionAttributes {\n"); + sb.append(" author: ").append(toIndentedString(author)).append("\n"); + sb.append(" changeMetadata: ").append(toIndentedString(changeMetadata)).append("\n"); + sb.append(" payload: ").append(toIndentedString(payload)).append("\n"); + sb.append(" versionPayloadCreatedAt: ") + .append(toIndentedString(versionPayloadCreatedAt)) + .append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionAuthor.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionAuthor.java new file mode 100644 index 00000000000..bdb479e3250 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionAuthor.java @@ -0,0 +1,219 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Object describing the author of a test version. */ +@JsonPropertyOrder({ + SyntheticsTestVersionAuthor.JSON_PROPERTY_EMAIL, + SyntheticsTestVersionAuthor.JSON_PROPERTY_HANDLE, + SyntheticsTestVersionAuthor.JSON_PROPERTY_ID, + SyntheticsTestVersionAuthor.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsTestVersionAuthor { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_HANDLE = "handle"; + private String handle; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public SyntheticsTestVersionAuthor email(String email) { + this.email = email; + return this; + } + + /** + * Email address of the author. + * + * @return email + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public SyntheticsTestVersionAuthor handle(String handle) { + this.handle = handle; + return this; + } + + /** + * The author's Datadog handle (login username). + * + * @return handle + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HANDLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + public SyntheticsTestVersionAuthor id(String id) { + this.id = id; + return this; + } + + /** + * UUID of the author. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public SyntheticsTestVersionAuthor name(String name) { + this.name = name; + return this; + } + + /** + * Display name of the author. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SyntheticsTestVersionAuthor + */ + @JsonAnySetter + public SyntheticsTestVersionAuthor putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SyntheticsTestVersionAuthor object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsTestVersionAuthor syntheticsTestVersionAuthor = (SyntheticsTestVersionAuthor) o; + return Objects.equals(this.email, syntheticsTestVersionAuthor.email) + && Objects.equals(this.handle, syntheticsTestVersionAuthor.handle) + && Objects.equals(this.id, syntheticsTestVersionAuthor.id) + && Objects.equals(this.name, syntheticsTestVersionAuthor.name) + && Objects.equals( + this.additionalProperties, syntheticsTestVersionAuthor.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(email, handle, id, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsTestVersionAuthor {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" handle: ").append(toIndentedString(handle)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionChangeAttributes.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionChangeAttributes.java new file mode 100644 index 00000000000..ba990160708 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionChangeAttributes.java @@ -0,0 +1,244 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes of a version change record. */ +@JsonPropertyOrder({ + SyntheticsTestVersionChangeAttributes.JSON_PROPERTY_AUTHOR_UUID, + SyntheticsTestVersionChangeAttributes.JSON_PROPERTY_CHANGE_METADATA, + SyntheticsTestVersionChangeAttributes.JSON_PROPERTY_VERSION_NUMBER, + SyntheticsTestVersionChangeAttributes.JSON_PROPERTY_VERSION_PAYLOAD_CREATED_AT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsTestVersionChangeAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AUTHOR_UUID = "author_uuid"; + private String authorUuid; + + public static final String JSON_PROPERTY_CHANGE_METADATA = "change_metadata"; + private List changeMetadata = null; + + public static final String JSON_PROPERTY_VERSION_NUMBER = "version_number"; + private Long versionNumber; + + public static final String JSON_PROPERTY_VERSION_PAYLOAD_CREATED_AT = + "version_payload_created_at"; + private OffsetDateTime versionPayloadCreatedAt; + + public SyntheticsTestVersionChangeAttributes authorUuid(String authorUuid) { + this.authorUuid = authorUuid; + return this; + } + + /** + * UUID of the user who created this version. + * + * @return authorUuid + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AUTHOR_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAuthorUuid() { + return authorUuid; + } + + public void setAuthorUuid(String authorUuid) { + this.authorUuid = authorUuid; + } + + public SyntheticsTestVersionChangeAttributes changeMetadata( + List changeMetadata) { + this.changeMetadata = changeMetadata; + for (SyntheticsTestVersionChangeMetadataItem item : changeMetadata) { + this.unparsed |= item.unparsed; + } + return this; + } + + public SyntheticsTestVersionChangeAttributes addChangeMetadataItem( + SyntheticsTestVersionChangeMetadataItem changeMetadataItem) { + if (this.changeMetadata == null) { + this.changeMetadata = new ArrayList<>(); + } + this.changeMetadata.add(changeMetadataItem); + this.unparsed |= changeMetadataItem.unparsed; + return this; + } + + /** + * List of metadata describing individual changes in this version. + * + * @return changeMetadata + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHANGE_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getChangeMetadata() { + return changeMetadata; + } + + public void setChangeMetadata(List changeMetadata) { + this.changeMetadata = changeMetadata; + } + + public SyntheticsTestVersionChangeAttributes versionNumber(Long versionNumber) { + this.versionNumber = versionNumber; + return this; + } + + /** + * The sequential version number. + * + * @return versionNumber + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERSION_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getVersionNumber() { + return versionNumber; + } + + public void setVersionNumber(Long versionNumber) { + this.versionNumber = versionNumber; + } + + public SyntheticsTestVersionChangeAttributes versionPayloadCreatedAt( + OffsetDateTime versionPayloadCreatedAt) { + this.versionPayloadCreatedAt = versionPayloadCreatedAt; + return this; + } + + /** + * Timestamp of when this version was created. + * + * @return versionPayloadCreatedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_VERSION_PAYLOAD_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getVersionPayloadCreatedAt() { + return versionPayloadCreatedAt; + } + + public void setVersionPayloadCreatedAt(OffsetDateTime versionPayloadCreatedAt) { + this.versionPayloadCreatedAt = versionPayloadCreatedAt; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SyntheticsTestVersionChangeAttributes + */ + @JsonAnySetter + public SyntheticsTestVersionChangeAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SyntheticsTestVersionChangeAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsTestVersionChangeAttributes syntheticsTestVersionChangeAttributes = + (SyntheticsTestVersionChangeAttributes) o; + return Objects.equals(this.authorUuid, syntheticsTestVersionChangeAttributes.authorUuid) + && Objects.equals(this.changeMetadata, syntheticsTestVersionChangeAttributes.changeMetadata) + && Objects.equals(this.versionNumber, syntheticsTestVersionChangeAttributes.versionNumber) + && Objects.equals( + this.versionPayloadCreatedAt, + syntheticsTestVersionChangeAttributes.versionPayloadCreatedAt) + && Objects.equals( + this.additionalProperties, syntheticsTestVersionChangeAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + authorUuid, changeMetadata, versionNumber, versionPayloadCreatedAt, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsTestVersionChangeAttributes {\n"); + sb.append(" authorUuid: ").append(toIndentedString(authorUuid)).append("\n"); + sb.append(" changeMetadata: ").append(toIndentedString(changeMetadata)).append("\n"); + sb.append(" versionNumber: ").append(toIndentedString(versionNumber)).append("\n"); + sb.append(" versionPayloadCreatedAt: ") + .append(toIndentedString(versionPayloadCreatedAt)) + .append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionChangeData.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionChangeData.java new file mode 100644 index 00000000000..f771f2f66bc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionChangeData.java @@ -0,0 +1,199 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for a version change record. */ +@JsonPropertyOrder({ + SyntheticsTestVersionChangeData.JSON_PROPERTY_ATTRIBUTES, + SyntheticsTestVersionChangeData.JSON_PROPERTY_ID, + SyntheticsTestVersionChangeData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsTestVersionChangeData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private SyntheticsTestVersionChangeAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private SyntheticsTestVersionChangeType type = SyntheticsTestVersionChangeType.VERSION_METADATA; + + public SyntheticsTestVersionChangeData attributes( + SyntheticsTestVersionChangeAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a version change record. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsTestVersionChangeAttributes getAttributes() { + return attributes; + } + + public void setAttributes(SyntheticsTestVersionChangeAttributes attributes) { + this.attributes = attributes; + } + + public SyntheticsTestVersionChangeData id(String id) { + this.id = id; + return this; + } + + /** + * UUID of the version change record. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public SyntheticsTestVersionChangeData type(SyntheticsTestVersionChangeType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the version metadata resource. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsTestVersionChangeType getType() { + return type; + } + + public void setType(SyntheticsTestVersionChangeType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SyntheticsTestVersionChangeData + */ + @JsonAnySetter + public SyntheticsTestVersionChangeData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SyntheticsTestVersionChangeData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsTestVersionChangeData syntheticsTestVersionChangeData = + (SyntheticsTestVersionChangeData) o; + return Objects.equals(this.attributes, syntheticsTestVersionChangeData.attributes) + && Objects.equals(this.id, syntheticsTestVersionChangeData.id) + && Objects.equals(this.type, syntheticsTestVersionChangeData.type) + && Objects.equals( + this.additionalProperties, syntheticsTestVersionChangeData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsTestVersionChangeData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionChangeMetadataItem.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionChangeMetadataItem.java new file mode 100644 index 00000000000..f54b9cb1e5c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionChangeMetadataItem.java @@ -0,0 +1,170 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Object describing a single change within a version. */ +@JsonPropertyOrder({ + SyntheticsTestVersionChangeMetadataItem.JSON_PROPERTY_ACTION, + SyntheticsTestVersionChangeMetadataItem.JSON_PROPERTY_ACTION_METADATA +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsTestVersionChangeMetadataItem { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ACTION = "action"; + private String action; + + public static final String JSON_PROPERTY_ACTION_METADATA = "action_metadata"; + private SyntheticsTestVersionActionMetadata actionMetadata; + + public SyntheticsTestVersionChangeMetadataItem action(String action) { + this.action = action; + return this; + } + + /** + * The action that was performed (for example, updated or created). + * + * @return action + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + + public SyntheticsTestVersionChangeMetadataItem actionMetadata( + SyntheticsTestVersionActionMetadata actionMetadata) { + this.actionMetadata = actionMetadata; + this.unparsed |= actionMetadata.unparsed; + return this; + } + + /** + * Object containing metadata about a change action. + * + * @return actionMetadata + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ACTION_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsTestVersionActionMetadata getActionMetadata() { + return actionMetadata; + } + + public void setActionMetadata(SyntheticsTestVersionActionMetadata actionMetadata) { + this.actionMetadata = actionMetadata; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SyntheticsTestVersionChangeMetadataItem + */ + @JsonAnySetter + public SyntheticsTestVersionChangeMetadataItem putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SyntheticsTestVersionChangeMetadataItem object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsTestVersionChangeMetadataItem syntheticsTestVersionChangeMetadataItem = + (SyntheticsTestVersionChangeMetadataItem) o; + return Objects.equals(this.action, syntheticsTestVersionChangeMetadataItem.action) + && Objects.equals( + this.actionMetadata, syntheticsTestVersionChangeMetadataItem.actionMetadata) + && Objects.equals( + this.additionalProperties, + syntheticsTestVersionChangeMetadataItem.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(action, actionMetadata, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsTestVersionChangeMetadataItem {\n"); + sb.append(" action: ").append(toIndentedString(action)).append("\n"); + sb.append(" actionMetadata: ").append(toIndentedString(actionMetadata)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionChangeType.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionChangeType.java new file mode 100644 index 00000000000..374564a8ae1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionChangeType.java @@ -0,0 +1,58 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type of the version metadata resource. */ +@JsonSerialize( + using = SyntheticsTestVersionChangeType.SyntheticsTestVersionChangeTypeSerializer.class) +public class SyntheticsTestVersionChangeType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("version_metadata")); + + public static final SyntheticsTestVersionChangeType VERSION_METADATA = + new SyntheticsTestVersionChangeType("version_metadata"); + + SyntheticsTestVersionChangeType(String value) { + super(value, allowedValues); + } + + public static class SyntheticsTestVersionChangeTypeSerializer + extends StdSerializer { + public SyntheticsTestVersionChangeTypeSerializer(Class t) { + super(t); + } + + public SyntheticsTestVersionChangeTypeSerializer() { + this(null); + } + + @Override + public void serialize( + SyntheticsTestVersionChangeType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SyntheticsTestVersionChangeType fromValue(String value) { + return new SyntheticsTestVersionChangeType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionData.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionData.java new file mode 100644 index 00000000000..e7efb85b7f7 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionData.java @@ -0,0 +1,197 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data object for a specific Synthetic test version. */ +@JsonPropertyOrder({ + SyntheticsTestVersionData.JSON_PROPERTY_ATTRIBUTES, + SyntheticsTestVersionData.JSON_PROPERTY_ID, + SyntheticsTestVersionData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsTestVersionData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private SyntheticsTestVersionAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private SyntheticsTestVersionType type = SyntheticsTestVersionType.VERSION; + + public SyntheticsTestVersionData attributes(SyntheticsTestVersionAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a specific Synthetic test version. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsTestVersionAttributes getAttributes() { + return attributes; + } + + public void setAttributes(SyntheticsTestVersionAttributes attributes) { + this.attributes = attributes; + } + + public SyntheticsTestVersionData id(String id) { + this.id = id; + return this; + } + + /** + * UUID of the version record. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public SyntheticsTestVersionData type(SyntheticsTestVersionType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the version resource. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsTestVersionType getType() { + return type; + } + + public void setType(SyntheticsTestVersionType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SyntheticsTestVersionData + */ + @JsonAnySetter + public SyntheticsTestVersionData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SyntheticsTestVersionData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsTestVersionData syntheticsTestVersionData = (SyntheticsTestVersionData) o; + return Objects.equals(this.attributes, syntheticsTestVersionData.attributes) + && Objects.equals(this.id, syntheticsTestVersionData.id) + && Objects.equals(this.type, syntheticsTestVersionData.type) + && Objects.equals( + this.additionalProperties, syntheticsTestVersionData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsTestVersionData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionDiffPatchDiff.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionDiffPatchDiff.java new file mode 100644 index 00000000000..28370a837ed --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionDiffPatchDiff.java @@ -0,0 +1,166 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Object describing a single text diff operation. */ +@JsonPropertyOrder({ + SyntheticsTestVersionDiffPatchDiff.JSON_PROPERTY_CHANGE_TEXT, + SyntheticsTestVersionDiffPatchDiff.JSON_PROPERTY_OPERATION +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsTestVersionDiffPatchDiff { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CHANGE_TEXT = "change_text"; + private String changeText; + + public static final String JSON_PROPERTY_OPERATION = "operation"; + private String operation; + + public SyntheticsTestVersionDiffPatchDiff changeText(String changeText) { + this.changeText = changeText; + return this; + } + + /** + * The text that was changed. + * + * @return changeText + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHANGE_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getChangeText() { + return changeText; + } + + public void setChangeText(String changeText) { + this.changeText = changeText; + } + + public SyntheticsTestVersionDiffPatchDiff operation(String operation) { + this.operation = operation; + return this; + } + + /** + * The diff operation applied. + * + * @return operation + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OPERATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOperation() { + return operation; + } + + public void setOperation(String operation) { + this.operation = operation; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SyntheticsTestVersionDiffPatchDiff + */ + @JsonAnySetter + public SyntheticsTestVersionDiffPatchDiff putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SyntheticsTestVersionDiffPatchDiff object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsTestVersionDiffPatchDiff syntheticsTestVersionDiffPatchDiff = + (SyntheticsTestVersionDiffPatchDiff) o; + return Objects.equals(this.changeText, syntheticsTestVersionDiffPatchDiff.changeText) + && Objects.equals(this.operation, syntheticsTestVersionDiffPatchDiff.operation) + && Objects.equals( + this.additionalProperties, syntheticsTestVersionDiffPatchDiff.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(changeText, operation, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsTestVersionDiffPatchDiff {\n"); + sb.append(" changeText: ").append(toIndentedString(changeText)).append("\n"); + sb.append(" operation: ").append(toIndentedString(operation)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionDiffPatches.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionDiffPatches.java new file mode 100644 index 00000000000..2db28c44ea1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionDiffPatches.java @@ -0,0 +1,262 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Object describing a patch in the diff. */ +@JsonPropertyOrder({ + SyntheticsTestVersionDiffPatches.JSON_PROPERTY_DIFFS, + SyntheticsTestVersionDiffPatches.JSON_PROPERTY_LENGTH1, + SyntheticsTestVersionDiffPatches.JSON_PROPERTY_LENGTH2, + SyntheticsTestVersionDiffPatches.JSON_PROPERTY_START1, + SyntheticsTestVersionDiffPatches.JSON_PROPERTY_START2 +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsTestVersionDiffPatches { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DIFFS = "diffs"; + private List diffs = null; + + public static final String JSON_PROPERTY_LENGTH1 = "length1"; + private Long length1; + + public static final String JSON_PROPERTY_LENGTH2 = "length2"; + private Long length2; + + public static final String JSON_PROPERTY_START1 = "start1"; + private Long start1; + + public static final String JSON_PROPERTY_START2 = "start2"; + private Long start2; + + public SyntheticsTestVersionDiffPatches diffs(List diffs) { + this.diffs = diffs; + for (SyntheticsTestVersionDiffPatchDiff item : diffs) { + this.unparsed |= item.unparsed; + } + return this; + } + + public SyntheticsTestVersionDiffPatches addDiffsItem( + SyntheticsTestVersionDiffPatchDiff diffsItem) { + if (this.diffs == null) { + this.diffs = new ArrayList<>(); + } + this.diffs.add(diffsItem); + this.unparsed |= diffsItem.unparsed; + return this; + } + + /** + * List of individual diff operations. + * + * @return diffs + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DIFFS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getDiffs() { + return diffs; + } + + public void setDiffs(List diffs) { + this.diffs = diffs; + } + + public SyntheticsTestVersionDiffPatches length1(Long length1) { + this.length1 = length1; + return this; + } + + /** + * Length of the original text segment. + * + * @return length1 + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LENGTH1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getLength1() { + return length1; + } + + public void setLength1(Long length1) { + this.length1 = length1; + } + + public SyntheticsTestVersionDiffPatches length2(Long length2) { + this.length2 = length2; + return this; + } + + /** + * Length of the modified text segment. + * + * @return length2 + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LENGTH2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getLength2() { + return length2; + } + + public void setLength2(Long length2) { + this.length2 = length2; + } + + public SyntheticsTestVersionDiffPatches start1(Long start1) { + this.start1 = start1; + return this; + } + + /** + * Start position in the original text. + * + * @return start1 + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getStart1() { + return start1; + } + + public void setStart1(Long start1) { + this.start1 = start1; + } + + public SyntheticsTestVersionDiffPatches start2(Long start2) { + this.start2 = start2; + return this; + } + + /** + * Start position in the modified text. + * + * @return start2 + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_START2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getStart2() { + return start2; + } + + public void setStart2(Long start2) { + this.start2 = start2; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SyntheticsTestVersionDiffPatches + */ + @JsonAnySetter + public SyntheticsTestVersionDiffPatches putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SyntheticsTestVersionDiffPatches object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsTestVersionDiffPatches syntheticsTestVersionDiffPatches = + (SyntheticsTestVersionDiffPatches) o; + return Objects.equals(this.diffs, syntheticsTestVersionDiffPatches.diffs) + && Objects.equals(this.length1, syntheticsTestVersionDiffPatches.length1) + && Objects.equals(this.length2, syntheticsTestVersionDiffPatches.length2) + && Objects.equals(this.start1, syntheticsTestVersionDiffPatches.start1) + && Objects.equals(this.start2, syntheticsTestVersionDiffPatches.start2) + && Objects.equals( + this.additionalProperties, syntheticsTestVersionDiffPatches.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(diffs, length1, length2, start1, start2, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsTestVersionDiffPatches {\n"); + sb.append(" diffs: ").append(toIndentedString(diffs)).append("\n"); + sb.append(" length1: ").append(toIndentedString(length1)).append("\n"); + sb.append(" length2: ").append(toIndentedString(length2)).append("\n"); + sb.append(" start1: ").append(toIndentedString(start1)).append("\n"); + sb.append(" start2: ").append(toIndentedString(start2)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionHistoryMeta.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionHistoryMeta.java new file mode 100644 index 00000000000..cd68c5b37df --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionHistoryMeta.java @@ -0,0 +1,184 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Pagination metadata for a version history response. */ +@JsonPropertyOrder({ + SyntheticsTestVersionHistoryMeta.JSON_PROPERTY_NEXT_LAST_VERSION_NUMBER, + SyntheticsTestVersionHistoryMeta.JSON_PROPERTY_RETENTION_PERIOD_IN_DAYS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsTestVersionHistoryMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NEXT_LAST_VERSION_NUMBER = "next_last_version_number"; + private JsonNullable nextLastVersionNumber = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_RETENTION_PERIOD_IN_DAYS = "retention_period_in_days"; + private Long retentionPeriodInDays; + + public SyntheticsTestVersionHistoryMeta nextLastVersionNumber(Long nextLastVersionNumber) { + this.nextLastVersionNumber = JsonNullable.of(nextLastVersionNumber); + return this; + } + + /** + * The version number to use as the last_version_number query parameter to fetch the + * next page. null indicates there are no more pages. + * + * @return nextLastVersionNumber + */ + @jakarta.annotation.Nullable + @JsonIgnore + public Long getNextLastVersionNumber() { + return nextLastVersionNumber.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_NEXT_LAST_VERSION_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getNextLastVersionNumber_JsonNullable() { + return nextLastVersionNumber; + } + + @JsonProperty(JSON_PROPERTY_NEXT_LAST_VERSION_NUMBER) + public void setNextLastVersionNumber_JsonNullable(JsonNullable nextLastVersionNumber) { + this.nextLastVersionNumber = nextLastVersionNumber; + } + + public void setNextLastVersionNumber(Long nextLastVersionNumber) { + this.nextLastVersionNumber = JsonNullable.of(nextLastVersionNumber); + } + + public SyntheticsTestVersionHistoryMeta retentionPeriodInDays(Long retentionPeriodInDays) { + this.retentionPeriodInDays = retentionPeriodInDays; + return this; + } + + /** + * The number of days that version history is retained. + * + * @return retentionPeriodInDays + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RETENTION_PERIOD_IN_DAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getRetentionPeriodInDays() { + return retentionPeriodInDays; + } + + public void setRetentionPeriodInDays(Long retentionPeriodInDays) { + this.retentionPeriodInDays = retentionPeriodInDays; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SyntheticsTestVersionHistoryMeta + */ + @JsonAnySetter + public SyntheticsTestVersionHistoryMeta putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SyntheticsTestVersionHistoryMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsTestVersionHistoryMeta syntheticsTestVersionHistoryMeta = + (SyntheticsTestVersionHistoryMeta) o; + return Objects.equals( + this.nextLastVersionNumber, syntheticsTestVersionHistoryMeta.nextLastVersionNumber) + && Objects.equals( + this.retentionPeriodInDays, syntheticsTestVersionHistoryMeta.retentionPeriodInDays) + && Objects.equals( + this.additionalProperties, syntheticsTestVersionHistoryMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(nextLastVersionNumber, retentionPeriodInDays, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsTestVersionHistoryMeta {\n"); + sb.append(" nextLastVersionNumber: ") + .append(toIndentedString(nextLastVersionNumber)) + .append("\n"); + sb.append(" retentionPeriodInDays: ") + .append(toIndentedString(retentionPeriodInDays)) + .append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionHistoryResponse.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionHistoryResponse.java new file mode 100644 index 00000000000..40b10e698e5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionHistoryResponse.java @@ -0,0 +1,182 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response containing the paginated version history for a Synthetic test. */ +@JsonPropertyOrder({ + SyntheticsTestVersionHistoryResponse.JSON_PROPERTY_DATA, + SyntheticsTestVersionHistoryResponse.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsTestVersionHistoryResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public static final String JSON_PROPERTY_META = "meta"; + private SyntheticsTestVersionHistoryMeta meta; + + public SyntheticsTestVersionHistoryResponse data(List data) { + this.data = data; + for (SyntheticsTestVersionChangeData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public SyntheticsTestVersionHistoryResponse addDataItem( + SyntheticsTestVersionChangeData dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * List of version change records. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public SyntheticsTestVersionHistoryResponse meta(SyntheticsTestVersionHistoryMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Pagination metadata for a version history response. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsTestVersionHistoryMeta getMeta() { + return meta; + } + + public void setMeta(SyntheticsTestVersionHistoryMeta meta) { + this.meta = meta; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SyntheticsTestVersionHistoryResponse + */ + @JsonAnySetter + public SyntheticsTestVersionHistoryResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SyntheticsTestVersionHistoryResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsTestVersionHistoryResponse syntheticsTestVersionHistoryResponse = + (SyntheticsTestVersionHistoryResponse) o; + return Objects.equals(this.data, syntheticsTestVersionHistoryResponse.data) + && Objects.equals(this.meta, syntheticsTestVersionHistoryResponse.meta) + && Objects.equals( + this.additionalProperties, syntheticsTestVersionHistoryResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsTestVersionHistoryResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionResponse.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionResponse.java new file mode 100644 index 00000000000..96148d95877 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionResponse.java @@ -0,0 +1,137 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Response containing a specific version of a Synthetic test. */ +@JsonPropertyOrder({SyntheticsTestVersionResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsTestVersionResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private SyntheticsTestVersionData data; + + public SyntheticsTestVersionResponse data(SyntheticsTestVersionData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data object for a specific Synthetic test version. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsTestVersionData getData() { + return data; + } + + public void setData(SyntheticsTestVersionData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SyntheticsTestVersionResponse + */ + @JsonAnySetter + public SyntheticsTestVersionResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this SyntheticsTestVersionResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsTestVersionResponse syntheticsTestVersionResponse = (SyntheticsTestVersionResponse) o; + return Objects.equals(this.data, syntheticsTestVersionResponse.data) + && Objects.equals( + this.additionalProperties, syntheticsTestVersionResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsTestVersionResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionType.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionType.java new file mode 100644 index 00000000000..4eaab50f5bf --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestVersionType.java @@ -0,0 +1,55 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type of the version resource. */ +@JsonSerialize(using = SyntheticsTestVersionType.SyntheticsTestVersionTypeSerializer.class) +public class SyntheticsTestVersionType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("version")); + + public static final SyntheticsTestVersionType VERSION = new SyntheticsTestVersionType("version"); + + SyntheticsTestVersionType(String value) { + super(value, allowedValues); + } + + public static class SyntheticsTestVersionTypeSerializer + extends StdSerializer { + public SyntheticsTestVersionTypeSerializer(Class t) { + super(t); + } + + public SyntheticsTestVersionTypeSerializer() { + this(null); + } + + @Override + public void serialize( + SyntheticsTestVersionType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SyntheticsTestVersionType fromValue(String value) { + return new SyntheticsTestVersionType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/WidgetAttributes.java b/src/main/java/com/datadog/api/client/v2/model/WidgetAttributes.java new file mode 100644 index 00000000000..b7f0c9cbf2e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/WidgetAttributes.java @@ -0,0 +1,268 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes of a widget resource. */ +@JsonPropertyOrder({ + WidgetAttributes.JSON_PROPERTY_CREATED_AT, + WidgetAttributes.JSON_PROPERTY_DEFINITION, + WidgetAttributes.JSON_PROPERTY_IS_FAVORITED, + WidgetAttributes.JSON_PROPERTY_MODIFIED_AT, + WidgetAttributes.JSON_PROPERTY_TAGS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class WidgetAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private String createdAt; + + public static final String JSON_PROPERTY_DEFINITION = "definition"; + private WidgetDefinition definition; + + public static final String JSON_PROPERTY_IS_FAVORITED = "is_favorited"; + private Boolean isFavorited; + + public static final String JSON_PROPERTY_MODIFIED_AT = "modified_at"; + private String modifiedAt; + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = new ArrayList<>(); + + public WidgetAttributes() {} + + @JsonCreator + public WidgetAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) String createdAt, + @JsonProperty(required = true, value = JSON_PROPERTY_DEFINITION) WidgetDefinition definition, + @JsonProperty(required = true, value = JSON_PROPERTY_IS_FAVORITED) Boolean isFavorited, + @JsonProperty(required = true, value = JSON_PROPERTY_MODIFIED_AT) String modifiedAt, + @JsonProperty(required = true, value = JSON_PROPERTY_TAGS) List tags) { + this.createdAt = createdAt; + this.definition = definition; + this.unparsed |= definition.unparsed; + this.isFavorited = isFavorited; + this.modifiedAt = modifiedAt; + this.tags = tags; + if (tags != null) {} + } + + public WidgetAttributes createdAt(String createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * ISO 8601 timestamp of when the widget was created. + * + * @return createdAt + */ + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(String createdAt) { + this.createdAt = createdAt; + } + + public WidgetAttributes definition(WidgetDefinition definition) { + this.definition = definition; + this.unparsed |= definition.unparsed; + return this; + } + + /** + * The definition of a widget, including its type and configuration. + * + * @return definition + */ + @JsonProperty(JSON_PROPERTY_DEFINITION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public WidgetDefinition getDefinition() { + return definition; + } + + public void setDefinition(WidgetDefinition definition) { + this.definition = definition; + } + + public WidgetAttributes isFavorited(Boolean isFavorited) { + this.isFavorited = isFavorited; + return this; + } + + /** + * Will be implemented soon. Currently always returns false. + * + * @return isFavorited + */ + @JsonProperty(JSON_PROPERTY_IS_FAVORITED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getIsFavorited() { + return isFavorited; + } + + public void setIsFavorited(Boolean isFavorited) { + this.isFavorited = isFavorited; + } + + public WidgetAttributes modifiedAt(String modifiedAt) { + this.modifiedAt = modifiedAt; + return this; + } + + /** + * ISO 8601 timestamp of when the widget was last modified. + * + * @return modifiedAt + */ + @JsonProperty(JSON_PROPERTY_MODIFIED_AT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getModifiedAt() { + return modifiedAt; + } + + public void setModifiedAt(String modifiedAt) { + this.modifiedAt = modifiedAt; + } + + public WidgetAttributes tags(List tags) { + this.tags = tags; + return this; + } + + public WidgetAttributes addTagsItem(String tagsItem) { + this.tags.add(tagsItem); + return this; + } + + /** + * User-defined tags for organizing widgets. + * + * @return tags + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return WidgetAttributes + */ + @JsonAnySetter + public WidgetAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this WidgetAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WidgetAttributes widgetAttributes = (WidgetAttributes) o; + return Objects.equals(this.createdAt, widgetAttributes.createdAt) + && Objects.equals(this.definition, widgetAttributes.definition) + && Objects.equals(this.isFavorited, widgetAttributes.isFavorited) + && Objects.equals(this.modifiedAt, widgetAttributes.modifiedAt) + && Objects.equals(this.tags, widgetAttributes.tags) + && Objects.equals(this.additionalProperties, widgetAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(createdAt, definition, isFavorited, modifiedAt, tags, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WidgetAttributes {\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" definition: ").append(toIndentedString(definition)).append("\n"); + sb.append(" isFavorited: ").append(toIndentedString(isFavorited)).append("\n"); + sb.append(" modifiedAt: ").append(toIndentedString(modifiedAt)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/WidgetData.java b/src/main/java/com/datadog/api/client/v2/model/WidgetData.java new file mode 100644 index 00000000000..35056cec50e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/WidgetData.java @@ -0,0 +1,231 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A widget resource object. */ +@JsonPropertyOrder({ + WidgetData.JSON_PROPERTY_ATTRIBUTES, + WidgetData.JSON_PROPERTY_ID, + WidgetData.JSON_PROPERTY_RELATIONSHIPS, + WidgetData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class WidgetData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private WidgetAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_RELATIONSHIPS = "relationships"; + private WidgetRelationships relationships; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public WidgetData() {} + + @JsonCreator + public WidgetData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) WidgetAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + } + + public WidgetData attributes(WidgetAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of a widget resource. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public WidgetAttributes getAttributes() { + return attributes; + } + + public void setAttributes(WidgetAttributes attributes) { + this.attributes = attributes; + } + + public WidgetData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the widget. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public WidgetData relationships(WidgetRelationships relationships) { + this.relationships = relationships; + this.unparsed |= relationships.unparsed; + return this; + } + + /** + * Relationships of the widget resource. + * + * @return relationships + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RELATIONSHIPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public WidgetRelationships getRelationships() { + return relationships; + } + + public void setRelationships(WidgetRelationships relationships) { + this.relationships = relationships; + } + + public WidgetData type(String type) { + this.type = type; + return this; + } + + /** + * Widgets resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return WidgetData + */ + @JsonAnySetter + public WidgetData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this WidgetData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WidgetData widgetData = (WidgetData) o; + return Objects.equals(this.attributes, widgetData.attributes) + && Objects.equals(this.id, widgetData.id) + && Objects.equals(this.relationships, widgetData.relationships) + && Objects.equals(this.type, widgetData.type) + && Objects.equals(this.additionalProperties, widgetData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, relationships, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WidgetData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationships: ").append(toIndentedString(relationships)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/WidgetDefinition.java b/src/main/java/com/datadog/api/client/v2/model/WidgetDefinition.java new file mode 100644 index 00000000000..0fb3d1812c2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/WidgetDefinition.java @@ -0,0 +1,176 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The definition of a widget, including its type and configuration. */ +@JsonPropertyOrder({WidgetDefinition.JSON_PROPERTY_TITLE, WidgetDefinition.JSON_PROPERTY_TYPE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class WidgetDefinition { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public static final String JSON_PROPERTY_TYPE = "type"; + private WidgetType type; + + public WidgetDefinition() {} + + @JsonCreator + public WidgetDefinition( + @JsonProperty(required = true, value = JSON_PROPERTY_TITLE) String title, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) WidgetType type) { + this.title = title; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public WidgetDefinition title(String title) { + this.title = title; + return this; + } + + /** + * The display title of the widget. + * + * @return title + */ + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public WidgetDefinition type(WidgetType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Widget types that are allowed to be stored as individual records. This is not a complete list + * of dashboard and notebook widget types. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public WidgetType getType() { + return type; + } + + public void setType(WidgetType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return WidgetDefinition + */ + @JsonAnySetter + public WidgetDefinition putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this WidgetDefinition object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WidgetDefinition widgetDefinition = (WidgetDefinition) o; + return Objects.equals(this.title, widgetDefinition.title) + && Objects.equals(this.type, widgetDefinition.type) + && Objects.equals(this.additionalProperties, widgetDefinition.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(title, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WidgetDefinition {\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/WidgetExperienceType.java b/src/main/java/com/datadog/api/client/v2/model/WidgetExperienceType.java new file mode 100644 index 00000000000..5b1bd842156 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/WidgetExperienceType.java @@ -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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Widget experience types that differentiate between the products using the specific widget. */ +@JsonSerialize(using = WidgetExperienceType.WidgetExperienceTypeSerializer.class) +public class WidgetExperienceType extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList("ccm_reports", "logs_reports", "csv_reports", "product_analytics")); + + public static final WidgetExperienceType CCM_REPORTS = new WidgetExperienceType("ccm_reports"); + public static final WidgetExperienceType LOGS_REPORTS = new WidgetExperienceType("logs_reports"); + public static final WidgetExperienceType CSV_REPORTS = new WidgetExperienceType("csv_reports"); + public static final WidgetExperienceType PRODUCT_ANALYTICS = + new WidgetExperienceType("product_analytics"); + + WidgetExperienceType(String value) { + super(value, allowedValues); + } + + public static class WidgetExperienceTypeSerializer extends StdSerializer { + public WidgetExperienceTypeSerializer(Class t) { + super(t); + } + + public WidgetExperienceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + WidgetExperienceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static WidgetExperienceType fromValue(String value) { + return new WidgetExperienceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/WidgetIncludedUser.java b/src/main/java/com/datadog/api/client/v2/model/WidgetIncludedUser.java new file mode 100644 index 00000000000..6b2b2c57245 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/WidgetIncludedUser.java @@ -0,0 +1,201 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A user resource included in the response. */ +@JsonPropertyOrder({ + WidgetIncludedUser.JSON_PROPERTY_ATTRIBUTES, + WidgetIncludedUser.JSON_PROPERTY_ID, + WidgetIncludedUser.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class WidgetIncludedUser { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private WidgetIncludedUserAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public WidgetIncludedUser() {} + + @JsonCreator + public WidgetIncludedUser( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type) { + this.id = id; + this.type = type; + } + + public WidgetIncludedUser attributes(WidgetIncludedUserAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of an included user resource. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public WidgetIncludedUserAttributes getAttributes() { + return attributes; + } + + public void setAttributes(WidgetIncludedUserAttributes attributes) { + this.attributes = attributes; + } + + public WidgetIncludedUser id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the user. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public WidgetIncludedUser type(String type) { + this.type = type; + return this; + } + + /** + * Users resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return WidgetIncludedUser + */ + @JsonAnySetter + public WidgetIncludedUser putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this WidgetIncludedUser object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WidgetIncludedUser widgetIncludedUser = (WidgetIncludedUser) o; + return Objects.equals(this.attributes, widgetIncludedUser.attributes) + && Objects.equals(this.id, widgetIncludedUser.id) + && Objects.equals(this.type, widgetIncludedUser.type) + && Objects.equals(this.additionalProperties, widgetIncludedUser.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WidgetIncludedUser {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/WidgetIncludedUserAttributes.java b/src/main/java/com/datadog/api/client/v2/model/WidgetIncludedUserAttributes.java new file mode 100644 index 00000000000..93e2e67aa27 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/WidgetIncludedUserAttributes.java @@ -0,0 +1,176 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Attributes of an included user resource. */ +@JsonPropertyOrder({ + WidgetIncludedUserAttributes.JSON_PROPERTY_HANDLE, + WidgetIncludedUserAttributes.JSON_PROPERTY_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class WidgetIncludedUserAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_HANDLE = "handle"; + private String handle; + + public static final String JSON_PROPERTY_NAME = "name"; + private JsonNullable name = JsonNullable.undefined(); + + public WidgetIncludedUserAttributes handle(String handle) { + this.handle = handle; + return this; + } + + /** + * The email handle of the user. + * + * @return handle + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HANDLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getHandle() { + return handle; + } + + public void setHandle(String handle) { + this.handle = handle; + } + + public WidgetIncludedUserAttributes name(String name) { + this.name = JsonNullable.of(name); + return this; + } + + /** + * The display name of the user. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getName() { + return name.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getName_JsonNullable() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + public void setName_JsonNullable(JsonNullable name) { + this.name = name; + } + + public void setName(String name) { + this.name = JsonNullable.of(name); + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return WidgetIncludedUserAttributes + */ + @JsonAnySetter + public WidgetIncludedUserAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this WidgetIncludedUserAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WidgetIncludedUserAttributes widgetIncludedUserAttributes = (WidgetIncludedUserAttributes) o; + return Objects.equals(this.handle, widgetIncludedUserAttributes.handle) + && Objects.equals(this.name, widgetIncludedUserAttributes.name) + && Objects.equals( + this.additionalProperties, widgetIncludedUserAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(handle, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WidgetIncludedUserAttributes {\n"); + sb.append(" handle: ").append(toIndentedString(handle)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/WidgetListResponse.java b/src/main/java/com/datadog/api/client/v2/model/WidgetListResponse.java new file mode 100644 index 00000000000..158ec1988ad --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/WidgetListResponse.java @@ -0,0 +1,223 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response containing a list of widgets. */ +@JsonPropertyOrder({ + WidgetListResponse.JSON_PROPERTY_DATA, + WidgetListResponse.JSON_PROPERTY_INCLUDED, + WidgetListResponse.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class WidgetListResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public static final String JSON_PROPERTY_INCLUDED = "included"; + private List included = null; + + public static final String JSON_PROPERTY_META = "meta"; + private WidgetSearchMeta meta; + + public WidgetListResponse() {} + + @JsonCreator + public WidgetListResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data) { + this.data = data; + } + + public WidgetListResponse data(List data) { + this.data = data; + for (WidgetData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public WidgetListResponse addDataItem(WidgetData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * List of widget resources. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public WidgetListResponse included(List included) { + this.included = included; + for (WidgetIncludedUser item : included) { + this.unparsed |= item.unparsed; + } + return this; + } + + public WidgetListResponse addIncludedItem(WidgetIncludedUser includedItem) { + if (this.included == null) { + this.included = new ArrayList<>(); + } + this.included.add(includedItem); + this.unparsed |= includedItem.unparsed; + return this; + } + + /** + * Array of user resources related to the widgets. + * + * @return included + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCLUDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIncluded() { + return included; + } + + public void setIncluded(List included) { + this.included = included; + } + + public WidgetListResponse meta(WidgetSearchMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Metadata about the search results. + * + * @return meta + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public WidgetSearchMeta getMeta() { + return meta; + } + + public void setMeta(WidgetSearchMeta meta) { + this.meta = meta; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return WidgetListResponse + */ + @JsonAnySetter + public WidgetListResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this WidgetListResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WidgetListResponse widgetListResponse = (WidgetListResponse) o; + return Objects.equals(this.data, widgetListResponse.data) + && Objects.equals(this.included, widgetListResponse.included) + && Objects.equals(this.meta, widgetListResponse.meta) + && Objects.equals(this.additionalProperties, widgetListResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, included, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WidgetListResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" included: ").append(toIndentedString(included)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/WidgetRelationshipData.java b/src/main/java/com/datadog/api/client/v2/model/WidgetRelationshipData.java new file mode 100644 index 00000000000..3da15f37197 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/WidgetRelationshipData.java @@ -0,0 +1,173 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationship data referencing a user resource. */ +@JsonPropertyOrder({ + WidgetRelationshipData.JSON_PROPERTY_ID, + WidgetRelationshipData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class WidgetRelationshipData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public WidgetRelationshipData() {} + + @JsonCreator + public WidgetRelationshipData( + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) String type) { + this.id = id; + this.type = type; + } + + public WidgetRelationshipData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the user. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public WidgetRelationshipData type(String type) { + this.type = type; + return this; + } + + /** + * Users resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return WidgetRelationshipData + */ + @JsonAnySetter + public WidgetRelationshipData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this WidgetRelationshipData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WidgetRelationshipData widgetRelationshipData = (WidgetRelationshipData) o; + return Objects.equals(this.id, widgetRelationshipData.id) + && Objects.equals(this.type, widgetRelationshipData.type) + && Objects.equals(this.additionalProperties, widgetRelationshipData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WidgetRelationshipData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/WidgetRelationshipItem.java b/src/main/java/com/datadog/api/client/v2/model/WidgetRelationshipItem.java new file mode 100644 index 00000000000..0c4a91bdf84 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/WidgetRelationshipItem.java @@ -0,0 +1,136 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A JSON:API relationship to a user. */ +@JsonPropertyOrder({WidgetRelationshipItem.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class WidgetRelationshipItem { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private WidgetRelationshipData data; + + public WidgetRelationshipItem data(WidgetRelationshipData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Relationship data referencing a user resource. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public WidgetRelationshipData getData() { + return data; + } + + public void setData(WidgetRelationshipData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return WidgetRelationshipItem + */ + @JsonAnySetter + public WidgetRelationshipItem putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this WidgetRelationshipItem object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WidgetRelationshipItem widgetRelationshipItem = (WidgetRelationshipItem) o; + return Objects.equals(this.data, widgetRelationshipItem.data) + && Objects.equals(this.additionalProperties, widgetRelationshipItem.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WidgetRelationshipItem {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/WidgetRelationships.java b/src/main/java/com/datadog/api/client/v2/model/WidgetRelationships.java new file mode 100644 index 00000000000..3e5c28faa0a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/WidgetRelationships.java @@ -0,0 +1,166 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Relationships of the widget resource. */ +@JsonPropertyOrder({ + WidgetRelationships.JSON_PROPERTY_CREATED_BY, + WidgetRelationships.JSON_PROPERTY_MODIFIED_BY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class WidgetRelationships { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_BY = "created_by"; + private WidgetRelationshipItem createdBy; + + public static final String JSON_PROPERTY_MODIFIED_BY = "modified_by"; + private WidgetRelationshipItem modifiedBy; + + public WidgetRelationships createdBy(WidgetRelationshipItem createdBy) { + this.createdBy = createdBy; + this.unparsed |= createdBy.unparsed; + return this; + } + + /** + * A JSON:API relationship to a user. + * + * @return createdBy + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public WidgetRelationshipItem getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(WidgetRelationshipItem createdBy) { + this.createdBy = createdBy; + } + + public WidgetRelationships modifiedBy(WidgetRelationshipItem modifiedBy) { + this.modifiedBy = modifiedBy; + this.unparsed |= modifiedBy.unparsed; + return this; + } + + /** + * A JSON:API relationship to a user. + * + * @return modifiedBy + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MODIFIED_BY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public WidgetRelationshipItem getModifiedBy() { + return modifiedBy; + } + + public void setModifiedBy(WidgetRelationshipItem modifiedBy) { + this.modifiedBy = modifiedBy; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return WidgetRelationships + */ + @JsonAnySetter + public WidgetRelationships putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this WidgetRelationships object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WidgetRelationships widgetRelationships = (WidgetRelationships) o; + return Objects.equals(this.createdBy, widgetRelationships.createdBy) + && Objects.equals(this.modifiedBy, widgetRelationships.modifiedBy) + && Objects.equals(this.additionalProperties, widgetRelationships.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(createdBy, modifiedBy, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WidgetRelationships {\n"); + sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n"); + sb.append(" modifiedBy: ").append(toIndentedString(modifiedBy)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/WidgetResponse.java b/src/main/java/com/datadog/api/client/v2/model/WidgetResponse.java new file mode 100644 index 00000000000..aeb16df9254 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/WidgetResponse.java @@ -0,0 +1,185 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response containing a single widget. */ +@JsonPropertyOrder({WidgetResponse.JSON_PROPERTY_DATA, WidgetResponse.JSON_PROPERTY_INCLUDED}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class WidgetResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private WidgetData data; + + public static final String JSON_PROPERTY_INCLUDED = "included"; + private List included = null; + + public WidgetResponse() {} + + @JsonCreator + public WidgetResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) WidgetData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public WidgetResponse data(WidgetData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * A widget resource object. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public WidgetData getData() { + return data; + } + + public void setData(WidgetData data) { + this.data = data; + } + + public WidgetResponse included(List included) { + this.included = included; + for (WidgetIncludedUser item : included) { + this.unparsed |= item.unparsed; + } + return this; + } + + public WidgetResponse addIncludedItem(WidgetIncludedUser includedItem) { + if (this.included == null) { + this.included = new ArrayList<>(); + } + this.included.add(includedItem); + this.unparsed |= includedItem.unparsed; + return this; + } + + /** + * Array of user resources related to the widget. + * + * @return included + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INCLUDED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getIncluded() { + return included; + } + + public void setIncluded(List included) { + this.included = included; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return WidgetResponse + */ + @JsonAnySetter + public WidgetResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this WidgetResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WidgetResponse widgetResponse = (WidgetResponse) o; + return Objects.equals(this.data, widgetResponse.data) + && Objects.equals(this.included, widgetResponse.included) + && Objects.equals(this.additionalProperties, widgetResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, included, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WidgetResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" included: ").append(toIndentedString(included)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/WidgetSearchMeta.java b/src/main/java/com/datadog/api/client/v2/model/WidgetSearchMeta.java new file mode 100644 index 00000000000..50ea3f1850c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/WidgetSearchMeta.java @@ -0,0 +1,227 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Metadata about the search results. */ +@JsonPropertyOrder({ + WidgetSearchMeta.JSON_PROPERTY_CREATED_BY_ANYONE_TOTAL, + WidgetSearchMeta.JSON_PROPERTY_CREATED_BY_YOU_TOTAL, + WidgetSearchMeta.JSON_PROPERTY_FAVORITED_BY_YOU_TOTAL, + WidgetSearchMeta.JSON_PROPERTY_FILTERED_TOTAL +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class WidgetSearchMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CREATED_BY_ANYONE_TOTAL = "created_by_anyone_total"; + private Long createdByAnyoneTotal; + + public static final String JSON_PROPERTY_CREATED_BY_YOU_TOTAL = "created_by_you_total"; + private Long createdByYouTotal; + + public static final String JSON_PROPERTY_FAVORITED_BY_YOU_TOTAL = "favorited_by_you_total"; + private Long favoritedByYouTotal; + + public static final String JSON_PROPERTY_FILTERED_TOTAL = "filtered_total"; + private Long filteredTotal; + + public WidgetSearchMeta createdByAnyoneTotal(Long createdByAnyoneTotal) { + this.createdByAnyoneTotal = createdByAnyoneTotal; + return this; + } + + /** + * Total number of widgets created by anyone. + * + * @return createdByAnyoneTotal + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_BY_ANYONE_TOTAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getCreatedByAnyoneTotal() { + return createdByAnyoneTotal; + } + + public void setCreatedByAnyoneTotal(Long createdByAnyoneTotal) { + this.createdByAnyoneTotal = createdByAnyoneTotal; + } + + public WidgetSearchMeta createdByYouTotal(Long createdByYouTotal) { + this.createdByYouTotal = createdByYouTotal; + return this; + } + + /** + * Total number of widgets created by the current user. + * + * @return createdByYouTotal + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_BY_YOU_TOTAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getCreatedByYouTotal() { + return createdByYouTotal; + } + + public void setCreatedByYouTotal(Long createdByYouTotal) { + this.createdByYouTotal = createdByYouTotal; + } + + public WidgetSearchMeta favoritedByYouTotal(Long favoritedByYouTotal) { + this.favoritedByYouTotal = favoritedByYouTotal; + return this; + } + + /** + * Total number of widgets favorited by the current user. + * + * @return favoritedByYouTotal + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FAVORITED_BY_YOU_TOTAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getFavoritedByYouTotal() { + return favoritedByYouTotal; + } + + public void setFavoritedByYouTotal(Long favoritedByYouTotal) { + this.favoritedByYouTotal = favoritedByYouTotal; + } + + public WidgetSearchMeta filteredTotal(Long filteredTotal) { + this.filteredTotal = filteredTotal; + return this; + } + + /** + * Total number of widgets matching the current filter criteria. + * + * @return filteredTotal + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILTERED_TOTAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getFilteredTotal() { + return filteredTotal; + } + + public void setFilteredTotal(Long filteredTotal) { + this.filteredTotal = filteredTotal; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return WidgetSearchMeta + */ + @JsonAnySetter + public WidgetSearchMeta putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this WidgetSearchMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WidgetSearchMeta widgetSearchMeta = (WidgetSearchMeta) o; + return Objects.equals(this.createdByAnyoneTotal, widgetSearchMeta.createdByAnyoneTotal) + && Objects.equals(this.createdByYouTotal, widgetSearchMeta.createdByYouTotal) + && Objects.equals(this.favoritedByYouTotal, widgetSearchMeta.favoritedByYouTotal) + && Objects.equals(this.filteredTotal, widgetSearchMeta.filteredTotal) + && Objects.equals(this.additionalProperties, widgetSearchMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + createdByAnyoneTotal, + createdByYouTotal, + favoritedByYouTotal, + filteredTotal, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WidgetSearchMeta {\n"); + sb.append(" createdByAnyoneTotal: ") + .append(toIndentedString(createdByAnyoneTotal)) + .append("\n"); + sb.append(" createdByYouTotal: ").append(toIndentedString(createdByYouTotal)).append("\n"); + sb.append(" favoritedByYouTotal: ") + .append(toIndentedString(favoritedByYouTotal)) + .append("\n"); + sb.append(" filteredTotal: ").append(toIndentedString(filteredTotal)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/WidgetType.java b/src/main/java/com/datadog/api/client/v2/model/WidgetType.java new file mode 100644 index 00000000000..28ca7342765 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/WidgetType.java @@ -0,0 +1,87 @@ +/* + * 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 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** + * Widget types that are allowed to be stored as individual records. This is not a complete list of + * dashboard and notebook widget types. + */ +@JsonSerialize(using = WidgetType.WidgetTypeSerializer.class) +public class WidgetType extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList( + "bar_chart", + "change", + "cloud_cost_summary", + "cohort", + "funnel", + "geomap", + "list_stream", + "query_table", + "query_value", + "retention_curve", + "sankey", + "sunburst", + "timeseries", + "toplist", + "treemap")); + + public static final WidgetType BAR_CHART = new WidgetType("bar_chart"); + public static final WidgetType CHANGE = new WidgetType("change"); + public static final WidgetType CLOUD_COST_SUMMARY = new WidgetType("cloud_cost_summary"); + public static final WidgetType COHORT = new WidgetType("cohort"); + public static final WidgetType FUNNEL = new WidgetType("funnel"); + public static final WidgetType GEOMAP = new WidgetType("geomap"); + public static final WidgetType LIST_STREAM = new WidgetType("list_stream"); + public static final WidgetType QUERY_TABLE = new WidgetType("query_table"); + public static final WidgetType QUERY_VALUE = new WidgetType("query_value"); + public static final WidgetType RETENTION_CURVE = new WidgetType("retention_curve"); + public static final WidgetType SANKEY = new WidgetType("sankey"); + public static final WidgetType SUNBURST = new WidgetType("sunburst"); + public static final WidgetType TIMESERIES = new WidgetType("timeseries"); + public static final WidgetType TOPLIST = new WidgetType("toplist"); + public static final WidgetType TREEMAP = new WidgetType("treemap"); + + WidgetType(String value) { + super(value, allowedValues); + } + + public static class WidgetTypeSerializer extends StdSerializer { + public WidgetTypeSerializer(Class t) { + super(t); + } + + public WidgetTypeSerializer() { + this(null); + } + + @Override + public void serialize(WidgetType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static WidgetType fromValue(String value) { + return new WidgetType(value); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/synthetics.feature b/src/test/resources/com/datadog/api/client/v2/api/synthetics.feature index 418dbf5fb3a..8ed9b98adf4 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/synthetics.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/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/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 67596e3589c..dcdc0219f9c 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/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/src/test/resources/com/datadog/api/client/v2/api/widgets.feature b/src/test/resources/com/datadog/api/client/v2/api/widgets.feature new file mode 100644 index 00000000000..54b01571156 --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/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