diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index f45d9a1cc953..f1ef3930eef6 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -15324,6 +15324,41 @@ components: id: $ref: "#/components/schemas/ApiID" type: object + CreateOrUpdateWidgetRequest: + description: Request body for creating or updating a widget. + properties: + data: + $ref: "#/components/schemas/CreateOrUpdateWidgetRequestData" + required: + - data + type: object + CreateOrUpdateWidgetRequestAttributes: + description: Attributes for creating or updating a widget. + properties: + definition: + $ref: "#/components/schemas/WidgetDefinition" + tags: + description: User-defined tags for organizing the widget. + items: + type: string + nullable: true + type: array + required: + - definition + type: object + CreateOrUpdateWidgetRequestData: + description: Data for creating or updating a widget. + properties: + attributes: + $ref: "#/components/schemas/CreateOrUpdateWidgetRequestAttributes" + type: + description: Widgets resource type. + example: widgets + type: string + required: + - type + - attributes + type: object CreatePageRequest: description: Full request to trigger an On-Call Page. example: @@ -64427,6 +64462,40 @@ components: required: - data type: object + SuiteJsonPatchRequest: + description: JSON Patch request for a Synthetic test suite. + properties: + data: + $ref: "#/components/schemas/SuiteJsonPatchRequestData" + required: + - data + type: object + SuiteJsonPatchRequestData: + description: Data object for a JSON Patch request on a Synthetic test suite. + properties: + attributes: + $ref: "#/components/schemas/SuiteJsonPatchRequestDataAttributes" + type: + $ref: "#/components/schemas/SuiteJsonPatchType" + type: object + SuiteJsonPatchRequestDataAttributes: + description: Attributes for a JSON Patch request on a Synthetic test suite. + properties: + json_patch: + description: JSON Patch operations following RFC 6902. + items: + $ref: "#/components/schemas/JsonPatchOperation" + type: array + type: object + SuiteJsonPatchType: + default: suites_json_patch + description: Type for a JSON Patch request on a Synthetic test suite, `suites_json_patch`. + enum: + - suites_json_patch + example: suites_json_patch + type: string + x-enum-varnames: + - SUITES_JSON_PATCH SuiteSearchResponseType: default: suites_search description: Type for the Synthetics suites search response, `suites_search`. @@ -64486,6 +64555,114 @@ components: description: The direction and type of synchronization for this property. type: string type: object + SyntheticsApiMultistepParentTestAttributes: + description: Attributes of a parent API multistep test. + properties: + child_name: + description: The name of the child subtest. + example: My API Subtest + type: string + child_public_id: + description: The public ID of the child subtest. + example: xyz-uvw-789 + type: string + monitor_id: + description: The associated monitor ID. + example: 12345678 + format: int64 + type: integer + name: + description: Name of the parent test. + example: My Multistep Test + type: string + overall_state: + description: The overall state of the parent test. + example: 0 + format: int64 + type: integer + overall_state_modified: + description: Timestamp of when the overall state was last modified. + example: "2024-01-01T00:00:00+00:00" + type: string + public_id: + description: The public ID of the parent test. + example: abc-def-123 + type: string + type: object + SyntheticsApiMultistepParentTestData: + description: Data object for a parent API multistep test. + properties: + attributes: + $ref: "#/components/schemas/SyntheticsApiMultistepParentTestAttributes" + id: + description: The public ID of the parent test. + example: abc-def-123 + type: string + type: + $ref: "#/components/schemas/SyntheticsApiMultistepParentTestType" + type: object + SyntheticsApiMultistepParentTestType: + default: parent_test + description: Type of the parent test resource. + enum: + - parent_test + example: parent_test + type: string + x-enum-varnames: + - PARENT_TEST + SyntheticsApiMultistepParentTestsResponse: + description: |- + Response containing the list of parent tests for an API multistep subtest. + properties: + data: + description: List of parent tests that include this subtest. + items: + $ref: "#/components/schemas/SyntheticsApiMultistepParentTestData" + type: array + type: object + SyntheticsApiMultistepSubtestAttributes: + description: Attributes of a Synthetic API multistep subtest. + properties: + name: + description: Name of the subtest. + example: My API Test + type: string + public_id: + description: The public ID of the subtest. + example: abc-def-123 + type: string + type: object + SyntheticsApiMultistepSubtestData: + description: Data object for a Synthetic API multistep subtest. + properties: + attributes: + $ref: "#/components/schemas/SyntheticsApiMultistepSubtestAttributes" + id: + description: The public ID of the subtest. + example: abc-def-123 + type: string + type: + $ref: "#/components/schemas/SyntheticsApiMultistepSubtestType" + type: object + SyntheticsApiMultistepSubtestType: + default: subtest + description: Type of the subtest resource. + enum: + - subtest + example: subtest + type: string + x-enum-varnames: + - SUBTEST + SyntheticsApiMultistepSubtestsResponse: + description: |- + Response containing the list of available subtests for an API multistep test. + properties: + data: + description: List of API tests that can be added as subtests. + items: + $ref: "#/components/schemas/SyntheticsApiMultistepSubtestData" + type: array + type: object SyntheticsFastTestAssertionResult: additionalProperties: {} description: Result of a single assertion evaluated during a fast test run. @@ -65466,6 +65643,70 @@ components: - from - to type: object + SyntheticsTestParentSuiteAttributes: + description: Object containing details about a parent suite of a Synthetic test. + properties: + child_name: + description: The name of the child test within the suite. + example: My API Test + type: string + child_public_id: + description: The public ID of the child test within the suite. + example: xyz-uvw-789 + type: string + monitor_id: + description: The associated monitor ID. + example: 12345678 + format: int64 + type: integer + name: + description: Name of the parent suite. + example: My Suite + type: string + overall_state: + description: The overall state of the parent suite. + example: 0 + format: int64 + type: integer + overall_state_modified: + description: Timestamp of when the overall state was last modified. + example: "2024-01-01T00:00:00+00:00" + type: string + public_id: + description: The public ID of the parent suite. + example: abc-def-123 + type: string + type: object + SyntheticsTestParentSuiteData: + description: Data object for a parent suite. + properties: + attributes: + $ref: "#/components/schemas/SyntheticsTestParentSuiteAttributes" + id: + description: The public ID of the parent suite. + example: abc-def-123 + type: string + type: + $ref: "#/components/schemas/SyntheticsTestParentSuiteType" + type: object + SyntheticsTestParentSuiteType: + default: parent_suite + description: Type of the parent suite resource. + enum: + - parent_suite + example: parent_suite + type: string + x-enum-varnames: + - PARENT_SUITE + SyntheticsTestParentSuitesResponse: + description: Response containing the list of parent suites for a Synthetic test. + properties: + data: + description: List of parent suites for the given test. + items: + $ref: "#/components/schemas/SyntheticsTestParentSuiteData" + type: array + type: object SyntheticsTestPauseStatus: description: |- Define whether you want to start (`live`) or pause (`paused`) a @@ -65478,6 +65719,208 @@ components: x-enum-varnames: - LIVE - PAUSED + SyntheticsTestVersionActionMetadata: + description: Object containing metadata about a change action. + properties: + after_value: + description: The value of the property after the change. + before_value: + description: The value of the property before the change. + diff_patches: + description: List of diff patches for text changes. + items: + $ref: "#/components/schemas/SyntheticsTestVersionDiffPatches" + nullable: true + type: array + property_path: + description: The dot-separated path of the property that was changed. + type: string + type: object + SyntheticsTestVersionAttributes: + description: Attributes of a specific Synthetic test version. + properties: + author: + $ref: "#/components/schemas/SyntheticsTestVersionAuthor" + change_metadata: + description: |- + List of metadata describing individual changes in this version. + Only returned when the `include_change_metadata` query parameter is `true`. + items: + $ref: "#/components/schemas/SyntheticsTestVersionChangeMetadataItem" + type: array + payload: + additionalProperties: {} + description: The full test configuration at this version. + type: object + version_payload_created_at: + description: Timestamp of when this version was created. + example: "2024-01-01T00:00:00+00:00" + format: date-time + type: string + type: object + SyntheticsTestVersionAuthor: + description: Object describing the author of a test version. + properties: + email: + description: Email address of the author. + example: john.doe@example.com + type: string + handle: + description: The author's Datadog handle (login username). + example: john.doe + type: string + id: + description: UUID of the author. + example: "00000000-0000-0000-0000-000000000000" + type: string + name: + description: Display name of the author. + example: John Doe + type: string + type: object + SyntheticsTestVersionChangeAttributes: + description: Attributes of a version change record. + properties: + author_uuid: + description: UUID of the user who created this version. + example: "00000000-0000-0000-0000-000000000000" + type: string + change_metadata: + description: List of metadata describing individual changes in this version. + items: + $ref: "#/components/schemas/SyntheticsTestVersionChangeMetadataItem" + type: array + version_number: + description: The sequential version number. + example: 5 + format: int64 + type: integer + version_payload_created_at: + description: Timestamp of when this version was created. + example: "2024-01-01T00:00:00+00:00" + format: date-time + type: string + type: object + SyntheticsTestVersionChangeData: + description: Data object for a version change record. + properties: + attributes: + $ref: "#/components/schemas/SyntheticsTestVersionChangeAttributes" + id: + description: UUID of the version change record. + example: "00000000-0000-0000-0000-000000000000" + type: string + type: + $ref: "#/components/schemas/SyntheticsTestVersionChangeType" + type: object + SyntheticsTestVersionChangeMetadataItem: + description: Object describing a single change within a version. + properties: + action: + description: The action that was performed (for example, `updated` or `created`). + type: string + action_metadata: + $ref: "#/components/schemas/SyntheticsTestVersionActionMetadata" + type: object + SyntheticsTestVersionChangeType: + default: version_metadata + description: Type of the version metadata resource. + enum: + - version_metadata + example: version_metadata + type: string + x-enum-varnames: + - VERSION_METADATA + SyntheticsTestVersionData: + description: Data object for a specific Synthetic test version. + properties: + attributes: + $ref: "#/components/schemas/SyntheticsTestVersionAttributes" + id: + description: UUID of the version record. + example: "00000000-0000-0000-0000-000000000000" + type: string + type: + $ref: "#/components/schemas/SyntheticsTestVersionType" + type: object + SyntheticsTestVersionDiffPatchDiff: + description: Object describing a single text diff operation. + properties: + change_text: + description: The text that was changed. + type: string + operation: + description: The diff operation applied. + type: string + type: object + SyntheticsTestVersionDiffPatches: + description: Object describing a patch in the diff. + properties: + diffs: + description: List of individual diff operations. + items: + $ref: "#/components/schemas/SyntheticsTestVersionDiffPatchDiff" + type: array + length1: + description: Length of the original text segment. + format: int64 + type: integer + length2: + description: Length of the modified text segment. + format: int64 + type: integer + start1: + description: Start position in the original text. + format: int64 + type: integer + start2: + description: Start position in the modified text. + format: int64 + type: integer + type: object + SyntheticsTestVersionHistoryMeta: + description: Pagination metadata for a version history response. + properties: + next_last_version_number: + description: |- + The version number to use as the `last_version_number` query parameter + to fetch the next page. `null` indicates there are no more pages. + example: 3 + format: int64 + nullable: true + type: integer + retention_period_in_days: + description: The number of days that version history is retained. + example: 30 + format: int64 + type: integer + type: object + SyntheticsTestVersionHistoryResponse: + description: Response containing the paginated version history for a Synthetic test. + properties: + data: + description: List of version change records. + items: + $ref: "#/components/schemas/SyntheticsTestVersionChangeData" + type: array + meta: + $ref: "#/components/schemas/SyntheticsTestVersionHistoryMeta" + type: object + SyntheticsTestVersionResponse: + description: Response containing a specific version of a Synthetic test. + properties: + data: + $ref: "#/components/schemas/SyntheticsTestVersionData" + type: object + SyntheticsTestVersionType: + default: version + description: Type of the version resource. + enum: + - version + example: version + type: string + x-enum-varnames: + - VERSION SyntheticsVariableParser: description: Details of the parser to use for the global variable. example: @@ -71675,6 +72118,136 @@ components: - FRIDAY - SATURDAY - SUNDAY + WidgetAttributes: + description: Attributes of a widget resource. + properties: + created_at: + description: ISO 8601 timestamp of when the widget was created. + example: "2024-01-15T00:00:00.000Z" + type: string + definition: + $ref: "#/components/schemas/WidgetDefinition" + is_favorited: + description: "Will be implemented soon. Currently always returns false." + example: false + type: boolean + modified_at: + description: ISO 8601 timestamp of when the widget was last modified. + example: "2024-01-15T00:00:00.000Z" + type: string + tags: + description: User-defined tags for organizing widgets. + example: + - "team:my-team" + items: + type: string + nullable: true + type: array + required: + - definition + - tags + - is_favorited + - created_at + - modified_at + type: object + WidgetData: + description: A widget resource object. + properties: + attributes: + $ref: "#/components/schemas/WidgetAttributes" + id: + description: The unique identifier of the widget. + example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + type: string + relationships: + $ref: "#/components/schemas/WidgetRelationships" + type: + description: Widgets resource type. + example: widgets + type: string + required: + - id + - type + - attributes + type: object + WidgetDefinition: + additionalProperties: {} + description: The definition of a widget, including its type and configuration. + properties: + title: + description: The display title of the widget. + example: My Widget + maxLength: 100 + minLength: 1 + type: string + type: + $ref: "#/components/schemas/WidgetType" + required: + - type + - title + type: object + WidgetExperienceType: + description: Widget experience types that differentiate between the products using the specific widget. + enum: + - ccm_reports + - logs_reports + - csv_reports + - product_analytics + example: ccm_reports + type: string + x-enum-varnames: + - CCM_REPORTS + - LOGS_REPORTS + - CSV_REPORTS + - PRODUCT_ANALYTICS + WidgetIncludedUser: + description: A user resource included in the response. + properties: + attributes: + $ref: "#/components/schemas/WidgetIncludedUserAttributes" + id: + description: The unique identifier of the user. + example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + type: string + type: + description: Users resource type. + example: users + type: string + required: + - id + - type + type: object + WidgetIncludedUserAttributes: + description: Attributes of an included user resource. + properties: + handle: + description: The email handle of the user. + example: "john.doe@example.com" + type: string + name: + description: The display name of the user. + example: "John Doe" + nullable: true + type: string + type: object + WidgetListResponse: + description: Response containing a list of widgets. + properties: + data: + description: List of widget resources. + items: + $ref: "#/components/schemas/WidgetData" + type: array + included: + description: Array of user resources related to the widgets. + items: + $ref: "#/components/schemas/WidgetIncludedUser" + type: array + meta: + $ref: "#/components/schemas/WidgetSearchMeta" + required: + - data + type: object WidgetLiveSpan: description: The available timeframes depend on the widget you are using. enum: @@ -71711,6 +72284,108 @@ components: - PAST_SIX_MONTHS - PAST_ONE_YEAR - ALERT + WidgetRelationshipData: + description: Relationship data referencing a user resource. + properties: + id: + description: The unique identifier of the user. + example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890" + type: string + type: + description: Users resource type. + example: users + type: string + required: + - id + - type + type: object + WidgetRelationshipItem: + description: A JSON:API relationship to a user. + properties: + data: + $ref: "#/components/schemas/WidgetRelationshipData" + type: object + WidgetRelationships: + description: Relationships of the widget resource. + properties: + created_by: + $ref: "#/components/schemas/WidgetRelationshipItem" + description: The user who created the widget. + modified_by: + $ref: "#/components/schemas/WidgetRelationshipItem" + description: The user who last modified the widget. + type: object + WidgetResponse: + description: Response containing a single widget. + properties: + data: + $ref: "#/components/schemas/WidgetData" + included: + description: Array of user resources related to the widget. + items: + $ref: "#/components/schemas/WidgetIncludedUser" + type: array + required: + - data + type: object + WidgetSearchMeta: + description: Metadata about the search results. + properties: + created_by_anyone_total: + description: Total number of widgets created by anyone. + format: int64 + type: integer + created_by_you_total: + description: Total number of widgets created by the current user. + format: int64 + type: integer + favorited_by_you_total: + description: Total number of widgets favorited by the current user. + format: int64 + type: integer + filtered_total: + description: Total number of widgets matching the current filter criteria. + format: int64 + type: integer + type: object + WidgetType: + description: |- + Widget types that are allowed to be stored as individual records. + This is not a complete list of dashboard and notebook widget types. + enum: + - bar_chart + - change + - cloud_cost_summary + - cohort + - funnel + - geomap + - list_stream + - query_table + - query_value + - retention_curve + - sankey + - sunburst + - timeseries + - toplist + - treemap + example: bar_chart + type: string + x-enum-varnames: + - BAR_CHART + - CHANGE + - CLOUD_COST_SUMMARY + - COHORT + - FUNNEL + - GEOMAP + - LIST_STREAM + - QUERY_TABLE + - QUERY_VALUE + - RETENTION_CURVE + - SANKEY + - SUNBURST + - TIMESERIES + - TOPLIST + - TREEMAP WorkflowData: description: Data related to the workflow. properties: @@ -106105,6 +106780,80 @@ paths: operator: AND permissions: - status_pages_incident_write + /api/v2/synthetics/api-multistep/subtests/{public_id}: + get: + description: |- + Get the list of API tests that can be added as subtests to a given API multistep test. + The current test is excluded from the list since a test cannot be a subtest of itself. + operationId: GetApiMultistepSubtests + parameters: + - description: The public ID of the API multistep test. + in: path + name: public_id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/SyntheticsApiMultistepSubtestsResponse" + description: OK + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_read + summary: Get available subtests for a multistep test + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_read + /api/v2/synthetics/api-multistep/subtests/{public_id}/parents: + get: + description: |- + Get the list of API multistep tests that include a given subtest, + along with their monitor status. + operationId: GetApiMultistepSubtestParents + parameters: + - description: The public ID of the subtest. + in: path + name: public_id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/SyntheticsApiMultistepParentTestsResponse" + description: OK + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_read + summary: Get parent tests for a subtest + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_read /api/v2/synthetics/settings/on_demand_concurrency_cap: get: description: Get the on-demand concurrency cap. @@ -106373,6 +107122,61 @@ paths: operator: OR permissions: - synthetics_write + /api/v2/synthetics/suites/{public_id}/jsonpatch: + patch: + description: |- + Patch a Synthetic test suite using JSON Patch (RFC 6902). + Use partial updates to modify only specific fields of a test suite. + + Common operations include: + - Replace field values: `{"op": "replace", "path": "/name", "value": "new_name"}` + - Add/update tags: `{"op": "add", "path": "/tags/-", "value": "new_tag"}` + - Remove fields: `{"op": "remove", "path": "/message"}` + operationId: PatchTestSuite + parameters: + - description: The public ID of the Synthetic test suite to patch. + in: path + name: public_id + required: true + schema: + example: 123-abc-456 + type: string + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/SuiteJsonPatchRequest" + description: JSON Patch document with operations to apply. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/SyntheticsSuiteResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_write + summary: Patch a test suite + tags: + - Synthetics + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - synthetics_write + - synthetics_create_edit_trigger /api/v2/synthetics/tests/bulk-delete: post: operationId: DeleteSyntheticsTests @@ -106589,6 +107393,162 @@ paths: permissions: - synthetics_write - synthetics_create_edit_trigger + /api/v2/synthetics/tests/{public_id}/parent-suites: + get: + description: Get the list of parent suites and their status for a given Synthetic test. + operationId: GetTestParentSuites + parameters: + - description: The public ID of the Synthetic test. + in: path + name: public_id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/SyntheticsTestParentSuitesResponse" + description: OK + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_read + summary: Get parent suites for a test + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_read + /api/v2/synthetics/tests/{public_id}/version_history: + get: + description: Get the paginated version history for a Synthetic test. + operationId: ListSyntheticsTestVersions + parameters: + - description: The public ID of the Synthetic test. + in: path + name: public_id + required: true + schema: + type: string + - description: The version number of the last item from the previous page. Omit to get the first page. + in: query + name: last_version_number + required: false + schema: + format: int64 + type: integer + - description: Maximum number of version records to return per page. + in: query + name: limit + required: false + schema: + format: int64 + maximum: 50 + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/SyntheticsTestVersionHistoryResponse" + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_read + summary: Get version history of a test + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_read + /api/v2/synthetics/tests/{public_id}/version_history/{version_number}: + get: + description: Get a specific version of a Synthetic test by its version number. + operationId: GetSyntheticsTestVersion + parameters: + - description: The public ID of the Synthetic test. + in: path + name: public_id + required: true + schema: + type: string + - description: The version number to retrieve. + in: path + name: version_number + required: true + schema: + format: int64 + type: integer + - description: If `true`, include change metadata in the response. + in: query + name: include_change_metadata + required: false + schema: + type: boolean + - description: |- + If `true`, only check whether the version exists without returning its full payload. + Returns an empty object if the version exists, or 404 if not. + in: query + name: only_check_existence + required: false + schema: + type: boolean + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/SyntheticsTestVersionResponse" + description: OK + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: API error response. + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_read + summary: Get a specific version of a test + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_read /api/v2/synthetics/variables/{variable_id}/jsonpatch: patch: description: |- @@ -109866,6 +110826,328 @@ paths: operator: OR permissions: - teams_read + /api/v2/widgets/{experience_type}: + get: + description: Search and list widgets for a given experience type. Supports filtering by widget type, creator, title, and tags, as well as sorting and pagination. + operationId: SearchWidgets + parameters: + - description: The experience type for the widget. + in: path + name: experience_type + required: true + schema: + $ref: "#/components/schemas/WidgetExperienceType" + - description: Filter widgets by widget type. + in: query + name: filter[widgetType] + schema: + $ref: "#/components/schemas/WidgetType" + - description: Filter widgets by the email handle of the creator. + in: query + name: filter[creatorHandle] + schema: + example: "john.doe@example.com" + type: string + - description: Filter to only widgets favorited by the current user. + in: query + name: filter[isFavorited] + schema: + type: boolean + - description: Filter widgets by title (substring match). + in: query + name: filter[title] + schema: + type: string + - description: Filter widgets by tags. Format as bracket-delimited CSV, e.g. `[tag1,tag2]`. + in: query + name: filter[tags] + schema: + type: string + - description: |- + Sort field for the results. Prefix with `-` for descending order. + Allowed values: `title`, `created_at`, `modified_at`. + in: query + name: sort + schema: + default: "-modified_at" + example: "-modified_at" + type: string + - description: Page number for pagination (0-indexed). + in: query + name: page[number] + schema: + default: 0 + minimum: 0 + type: integer + - description: Number of widgets per page. + in: query + name: page[size] + schema: + default: 50 + maximum: 100 + type: integer + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/WidgetListResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Search widgets + tags: + - Widgets + x-permission: + operator: OR + permissions: + - cloud_cost_management_read + - generate_log_reports + - manage_log_reports + - product_analytics_saved_widgets_read + post: + description: Create a new widget for a given experience type. + operationId: CreateWidget + parameters: + - description: The experience type for the widget. + in: path + name: experience_type + required: true + schema: + $ref: "#/components/schemas/WidgetExperienceType" + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/CreateOrUpdateWidgetRequest" + description: Widget request body. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/WidgetResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create a widget + tags: + - Widgets + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - cloud_cost_management_write + - generate_log_reports + - manage_log_reports + - product_analytics_saved_widgets_write + /api/v2/widgets/{experience_type}/{uuid}: + delete: + description: Soft-delete a widget by its UUID for a given experience type. + operationId: DeleteWidget + parameters: + - description: The experience type for the widget. + in: path + name: experience_type + required: true + schema: + $ref: "#/components/schemas/WidgetExperienceType" + - description: The UUID of the widget. + in: path + name: uuid + required: true + schema: + format: uuid + type: string + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Delete a widget + tags: + - Widgets + x-permission: + operator: OR + permissions: + - cloud_cost_management_write + - generate_log_reports + - manage_log_reports + - product_analytics_saved_widgets_write + get: + description: Retrieve a widget by its UUID for a given experience type. + operationId: GetWidget + parameters: + - description: The experience type for the widget. + in: path + name: experience_type + required: true + schema: + $ref: "#/components/schemas/WidgetExperienceType" + - description: The UUID of the widget. + in: path + name: uuid + required: true + schema: + format: uuid + type: string + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/WidgetResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get a widget + tags: + - Widgets + x-permission: + operator: OR + permissions: + - cloud_cost_management_read + - generate_log_reports + - manage_log_reports + - product_analytics_saved_widgets_read + put: + description: Update a widget by its UUID for a given experience type. This performs a full replacement of the widget definition. + operationId: UpdateWidget + parameters: + - description: The experience type for the widget. + in: path + name: experience_type + required: true + schema: + $ref: "#/components/schemas/WidgetExperienceType" + - description: The UUID of the widget. + in: path + name: uuid + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: "#/components/schemas/CreateOrUpdateWidgetRequest" + description: Widget request body. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: "#/components/schemas/WidgetResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Update a widget + tags: + - Widgets + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - cloud_cost_management_write + - generate_log_reports + - manage_log_reports + - product_analytics_saved_widgets_write /api/v2/workflows: post: description: Create a new workflow, returning the workflow ID. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). Alternatively, you can configure these permissions [in the UI](https://docs.datadoghq.com/account_management/api-app-keys/#actions-api-access). @@ -110716,6 +111998,11 @@ tags: externalDocs: url: https://docs.datadoghq.com/account_management/users name: Users + - description: |- + Create, read, update, and delete saved widgets. Widgets are reusable + visualization components stored independently from any dashboard or notebook, + partitioned by experience type and identified by a UUID. + name: Widgets - description: |- Datadog Workflow Automation allows you to automate your end-to-end processes by connecting Datadog with the rest of your tech stack. Build workflows to auto-remediate your alerts, streamline your incident and security processes, and reduce manual toil. Workflow Automation supports over 1,000+ OOTB actions, including AWS, JIRA, ServiceNow, GitHub, and OpenAI. Learn more in our Workflow Automation docs [here](https://docs.datadoghq.com/service_management/workflows/). externalDocs: diff --git a/examples/v2/synthetics/GetApiMultistepSubtestParents.rb b/examples/v2/synthetics/GetApiMultistepSubtestParents.rb new file mode 100644 index 000000000000..9c41e9e98c9c --- /dev/null +++ b/examples/v2/synthetics/GetApiMultistepSubtestParents.rb @@ -0,0 +1,5 @@ +# Get parent tests for a subtest returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SyntheticsAPI.new +p api_instance.get_api_multistep_subtest_parents("public_id") diff --git a/examples/v2/synthetics/GetApiMultistepSubtests.rb b/examples/v2/synthetics/GetApiMultistepSubtests.rb new file mode 100644 index 000000000000..015dbc6a0d78 --- /dev/null +++ b/examples/v2/synthetics/GetApiMultistepSubtests.rb @@ -0,0 +1,5 @@ +# Get available subtests for a multistep test returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SyntheticsAPI.new +p api_instance.get_api_multistep_subtests("public_id") diff --git a/examples/v2/synthetics/GetSyntheticsTestVersion.rb b/examples/v2/synthetics/GetSyntheticsTestVersion.rb new file mode 100644 index 000000000000..88684d696640 --- /dev/null +++ b/examples/v2/synthetics/GetSyntheticsTestVersion.rb @@ -0,0 +1,5 @@ +# Get a specific version of a test returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SyntheticsAPI.new +p api_instance.get_synthetics_test_version("public_id", 9223372036854775807) diff --git a/examples/v2/synthetics/GetTestParentSuites.rb b/examples/v2/synthetics/GetTestParentSuites.rb new file mode 100644 index 000000000000..9ec97fe221d0 --- /dev/null +++ b/examples/v2/synthetics/GetTestParentSuites.rb @@ -0,0 +1,5 @@ +# Get parent suites for a test returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SyntheticsAPI.new +p api_instance.get_test_parent_suites("public_id") diff --git a/examples/v2/synthetics/ListSyntheticsTestVersions.rb b/examples/v2/synthetics/ListSyntheticsTestVersions.rb new file mode 100644 index 000000000000..bd11096c97d2 --- /dev/null +++ b/examples/v2/synthetics/ListSyntheticsTestVersions.rb @@ -0,0 +1,5 @@ +# Get version history of a test returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SyntheticsAPI.new +p api_instance.list_synthetics_test_versions("public_id") diff --git a/examples/v2/synthetics/PatchTestSuite.rb b/examples/v2/synthetics/PatchTestSuite.rb new file mode 100644 index 000000000000..789ec05319ea --- /dev/null +++ b/examples/v2/synthetics/PatchTestSuite.rb @@ -0,0 +1,19 @@ +# Patch a test suite returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SyntheticsAPI.new + +body = DatadogAPIClient::V2::SuiteJsonPatchRequest.new({ + data: DatadogAPIClient::V2::SuiteJsonPatchRequestData.new({ + attributes: DatadogAPIClient::V2::SuiteJsonPatchRequestDataAttributes.new({ + json_patch: [ + DatadogAPIClient::V2::JsonPatchOperation.new({ + op: DatadogAPIClient::V2::JsonPatchOperationOp::ADD, + path: "/name", + }), + ], + }), + type: DatadogAPIClient::V2::SuiteJsonPatchType::SUITES_JSON_PATCH, + }), +}) +p api_instance.patch_test_suite("123-abc-456", body) diff --git a/examples/v2/widgets/CreateWidget.rb b/examples/v2/widgets/CreateWidget.rb new file mode 100644 index 000000000000..5ba0ba9beadd --- /dev/null +++ b/examples/v2/widgets/CreateWidget.rb @@ -0,0 +1,18 @@ +# Create a widget returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::WidgetsAPI.new + +body = DatadogAPIClient::V2::CreateOrUpdateWidgetRequest.new({ + data: DatadogAPIClient::V2::CreateOrUpdateWidgetRequestData.new({ + attributes: DatadogAPIClient::V2::CreateOrUpdateWidgetRequestAttributes.new({ + definition: DatadogAPIClient::V2::WidgetDefinition.new({ + title: "My Widget", + type: DatadogAPIClient::V2::WidgetType::BAR_CHART, + }), + tags: [], + }), + type: "widgets", + }), +}) +p api_instance.create_widget(WidgetExperienceType::CCM_REPORTS, body) diff --git a/examples/v2/widgets/DeleteWidget.rb b/examples/v2/widgets/DeleteWidget.rb new file mode 100644 index 000000000000..705052ca3082 --- /dev/null +++ b/examples/v2/widgets/DeleteWidget.rb @@ -0,0 +1,5 @@ +# Delete a widget returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::WidgetsAPI.new +api_instance.delete_widget(WidgetExperienceType::CCM_REPORTS, "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d") diff --git a/examples/v2/widgets/GetWidget.rb b/examples/v2/widgets/GetWidget.rb new file mode 100644 index 000000000000..325cd38a6590 --- /dev/null +++ b/examples/v2/widgets/GetWidget.rb @@ -0,0 +1,5 @@ +# Get a widget returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::WidgetsAPI.new +p api_instance.get_widget(WidgetExperienceType::CCM_REPORTS, "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d") diff --git a/examples/v2/widgets/SearchWidgets.rb b/examples/v2/widgets/SearchWidgets.rb new file mode 100644 index 000000000000..64fd833bd1c9 --- /dev/null +++ b/examples/v2/widgets/SearchWidgets.rb @@ -0,0 +1,5 @@ +# Search widgets returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::WidgetsAPI.new +p api_instance.search_widgets(WidgetExperienceType::CCM_REPORTS) diff --git a/examples/v2/widgets/UpdateWidget.rb b/examples/v2/widgets/UpdateWidget.rb new file mode 100644 index 000000000000..d4216c0990fb --- /dev/null +++ b/examples/v2/widgets/UpdateWidget.rb @@ -0,0 +1,18 @@ +# Update a widget returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::WidgetsAPI.new + +body = DatadogAPIClient::V2::CreateOrUpdateWidgetRequest.new({ + data: DatadogAPIClient::V2::CreateOrUpdateWidgetRequestData.new({ + attributes: DatadogAPIClient::V2::CreateOrUpdateWidgetRequestAttributes.new({ + definition: DatadogAPIClient::V2::WidgetDefinition.new({ + title: "My Widget", + type: DatadogAPIClient::V2::WidgetType::BAR_CHART, + }), + tags: [], + }), + type: "widgets", + }), +}) +p api_instance.update_widget(WidgetExperienceType::CCM_REPORTS, "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index d0609933ade5..96676513db7b 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -3926,6 +3926,12 @@ "include" => "String", "body" => "PatchMaintenanceRequest", }, + "v2.GetApiMultistepSubtests" => { + "public_id" => "String", + }, + "v2.GetApiMultistepSubtestParents" => { + "public_id" => "String", + }, "v2.SetOnDemandConcurrencyCap" => { "body" => "OnDemandConcurrencyCapAttributes", }, @@ -3949,6 +3955,10 @@ "public_id" => "String", "body" => "SuiteCreateEditRequest", }, + "v2.PatchTestSuite" => { + "public_id" => "String", + "body" => "SuiteJsonPatchRequest", + }, "v2.DeleteSyntheticsTests" => { "body" => "DeletedTestsRequestDeleteRequest", }, @@ -3965,6 +3975,20 @@ "public_id" => "String", "body" => "SyntheticsNetworkTestEditRequest", }, + "v2.GetTestParentSuites" => { + "public_id" => "String", + }, + "v2.ListSyntheticsTestVersions" => { + "public_id" => "String", + "last_version_number" => "Integer", + "limit" => "Integer", + }, + "v2.GetSyntheticsTestVersion" => { + "public_id" => "String", + "version_number" => "Integer", + "include_change_metadata" => "Boolean", + "only_check_existence" => "Boolean", + }, "v2.PatchGlobalVariable" => { "variable_id" => "String", "body" => "GlobalVariableJsonPatchRequest", @@ -4164,6 +4188,34 @@ "v2.ListUserPermissions" => { "user_id" => "String", }, + "v2.SearchWidgets" => { + "experience_type" => "WidgetExperienceType", + "filter_widget_type" => "WidgetType", + "filter_creator_handle" => "String", + "filter_is_favorited" => "Boolean", + "filter_title" => "String", + "filter_tags" => "String", + "sort" => "String", + "page_number" => "Integer", + "page_size" => "Integer", + }, + "v2.CreateWidget" => { + "experience_type" => "WidgetExperienceType", + "body" => "CreateOrUpdateWidgetRequest", + }, + "v2.DeleteWidget" => { + "experience_type" => "WidgetExperienceType", + "uuid" => "UUID", + }, + "v2.GetWidget" => { + "experience_type" => "WidgetExperienceType", + "uuid" => "UUID", + }, + "v2.UpdateWidget" => { + "experience_type" => "WidgetExperienceType", + "uuid" => "UUID", + "body" => "CreateOrUpdateWidgetRequest", + }, "v2.CreateWorkflow" => { "body" => "CreateWorkflowRequest", }, diff --git a/features/v2/synthetics.feature b/features/v2/synthetics.feature index 418dbf5fb3ad..8ed9b98adf40 100644 --- a/features/v2/synthetics.feature +++ b/features/v2/synthetics.feature @@ -133,6 +133,22 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing + Scenario: Get a specific version of a test returns "API error response." response + Given new "GetSyntheticsTestVersion" request + And request contains "public_id" parameter from "REPLACE.ME" + And request contains "version_number" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Get a specific version of a test returns "OK" response + Given new "GetSyntheticsTestVersion" request + And request contains "public_id" parameter from "REPLACE.ME" + And request contains "version_number" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing Scenario: Get a suite returns "API error response." response Given new "GetSyntheticsSuite" request @@ -147,12 +163,61 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing + Scenario: Get available subtests for a multistep test returns "OK" response + Given new "GetApiMultistepSubtests" request + And request contains "public_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Get parent suites for a test returns "API error response." response + Given new "GetTestParentSuites" request + And request contains "public_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Get parent suites for a test returns "OK" response + Given new "GetTestParentSuites" request + And request contains "public_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Get parent tests for a subtest returns "API error response." response + Given new "GetApiMultistepSubtestParents" request + And request contains "public_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Get parent tests for a subtest returns "OK" response + Given new "GetApiMultistepSubtestParents" request + And request contains "public_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @team:DataDog/synthetics-managing Scenario: Get the on-demand concurrency cap returns "OK" response Given new "GetOnDemandConcurrencyCap" request When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing + Scenario: Get version history of a test returns "API error response." response + Given new "ListSyntheticsTestVersions" request + And request contains "public_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Get version history of a test returns "OK" response + Given new "ListSyntheticsTestVersions" request + And request contains "public_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing Scenario: Patch a global variable returns "Bad Request" response Given new "PatchGlobalVariable" request @@ -177,6 +242,22 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing + Scenario: Patch a test suite returns "API error response." response + Given new "PatchTestSuite" request + And request contains "public_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"json_patch": [{"op": "add", "path": "/name"}]}, "type": "suites_json_patch"}} + When the request is sent + Then the response status is 400 API error response. + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Patch a test suite returns "OK" response + Given new "PatchTestSuite" request + And request contains "public_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"json_patch": [{"op": "add", "path": "/name"}]}, "type": "suites_json_patch"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/synthetics-managing Scenario: Save new value for on-demand concurrency cap returns "OK" response Given new "SetOnDemandConcurrencyCap" request diff --git a/features/v2/undo.json b/features/v2/undo.json index 67596e3589cb..dcdc0219f9ca 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -5809,6 +5809,18 @@ "type": "idempotent" } }, + "GetApiMultistepSubtests": { + "tag": "Synthetics", + "undo": { + "type": "safe" + } + }, + "GetApiMultistepSubtestParents": { + "tag": "Synthetics", + "undo": { + "type": "safe" + } + }, "GetOnDemandConcurrencyCap": { "tag": "Synthetics", "undo": { @@ -5858,6 +5870,12 @@ "type": "idempotent" } }, + "PatchTestSuite": { + "tag": "Synthetics", + "undo": { + "type": "idempotent" + } + }, "DeleteSyntheticsTests": { "tag": "Synthetics", "undo": { @@ -5895,6 +5913,24 @@ "type": "idempotent" } }, + "GetTestParentSuites": { + "tag": "Synthetics", + "undo": { + "type": "safe" + } + }, + "ListSyntheticsTestVersions": { + "tag": "Synthetics", + "undo": { + "type": "safe" + } + }, + "GetSyntheticsTestVersion": { + "tag": "Synthetics", + "undo": { + "type": "safe" + } + }, "PatchGlobalVariable": { "tag": "Synthetics", "undo": { @@ -6356,6 +6392,47 @@ "type": "safe" } }, + "SearchWidgets": { + "tag": "Widgets", + "undo": { + "type": "safe" + } + }, + "CreateWidget": { + "tag": "Widgets", + "undo": { + "operationId": "DeleteWidget", + "parameters": [ + { + "name": "experience_type", + "source": "experience_type" + }, + { + "name": "uuid", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteWidget": { + "tag": "Widgets", + "undo": { + "type": "idempotent" + } + }, + "GetWidget": { + "tag": "Widgets", + "undo": { + "type": "safe" + } + }, + "UpdateWidget": { + "tag": "Widgets", + "undo": { + "type": "safe" + } + }, "CreateWorkflow": { "tag": "Workflow Automation", "undo": { diff --git a/features/v2/widgets.feature b/features/v2/widgets.feature new file mode 100644 index 000000000000..54b015711565 --- /dev/null +++ b/features/v2/widgets.feature @@ -0,0 +1,115 @@ +@endpoint(widgets) @endpoint(widgets-v2) +Feature: Widgets + Create, read, update, and delete saved widgets. Widgets are reusable + visualization components stored independently from any dashboard or + notebook, partitioned by experience type and identified by a UUID. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "Widgets" API + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Create a widget returns "Bad Request" response + Given new "CreateWidget" request + And request contains "experience_type" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"definition": {"title": "My Widget", "type": "bar_chart"}, "tags": []}, "type": "widgets"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Create a widget returns "OK" response + Given new "CreateWidget" request + And request contains "experience_type" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"definition": {"title": "My Widget", "type": "bar_chart"}, "tags": []}, "type": "widgets"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Delete a widget returns "Bad Request" response + Given new "DeleteWidget" request + And request contains "experience_type" parameter from "REPLACE.ME" + And request contains "uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Delete a widget returns "No Content" response + Given new "DeleteWidget" request + And request contains "experience_type" parameter from "REPLACE.ME" + And request contains "uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Delete a widget returns "Not Found" response + Given new "DeleteWidget" request + And request contains "experience_type" parameter from "REPLACE.ME" + And request contains "uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Get a widget returns "Bad Request" response + Given new "GetWidget" request + And request contains "experience_type" parameter from "REPLACE.ME" + And request contains "uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Get a widget returns "Not Found" response + Given new "GetWidget" request + And request contains "experience_type" parameter from "REPLACE.ME" + And request contains "uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Get a widget returns "OK" response + Given new "GetWidget" request + And request contains "experience_type" parameter from "REPLACE.ME" + And request contains "uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Search widgets returns "Bad Request" response + Given new "SearchWidgets" request + And request contains "experience_type" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Search widgets returns "OK" response + Given new "SearchWidgets" request + And request contains "experience_type" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Update a widget returns "Bad Request" response + Given new "UpdateWidget" request + And request contains "experience_type" parameter from "REPLACE.ME" + And request contains "uuid" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"definition": {"title": "My Widget", "type": "bar_chart"}, "tags": []}, "type": "widgets"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Update a widget returns "Not Found" response + Given new "UpdateWidget" request + And request contains "experience_type" parameter from "REPLACE.ME" + And request contains "uuid" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"definition": {"title": "My Widget", "type": "bar_chart"}, "tags": []}, "type": "widgets"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/reporting-and-sharing + Scenario: Update a widget returns "OK" response + Given new "UpdateWidget" request + And request contains "experience_type" parameter from "REPLACE.ME" + And request contains "uuid" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"definition": {"title": "My Widget", "type": "bar_chart"}, "tags": []}, "type": "widgets"}} + When the request is sent + Then the response status is 200 OK diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index ab346bc663c0..6afa8980a892 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1948,6 +1948,9 @@ def overrides "v2.create_open_api_response" => "CreateOpenAPIResponse", "v2.create_open_api_response_attributes" => "CreateOpenAPIResponseAttributes", "v2.create_open_api_response_data" => "CreateOpenAPIResponseData", + "v2.create_or_update_widget_request" => "CreateOrUpdateWidgetRequest", + "v2.create_or_update_widget_request_attributes" => "CreateOrUpdateWidgetRequestAttributes", + "v2.create_or_update_widget_request_data" => "CreateOrUpdateWidgetRequestData", "v2.create_page_request" => "CreatePageRequest", "v2.create_page_request_data" => "CreatePageRequestData", "v2.create_page_request_data_attributes" => "CreatePageRequestDataAttributes", @@ -5195,11 +5198,23 @@ def overrides "v2.step_display_bounds" => "StepDisplayBounds", "v2.suite_create_edit" => "SuiteCreateEdit", "v2.suite_create_edit_request" => "SuiteCreateEditRequest", + "v2.suite_json_patch_request" => "SuiteJsonPatchRequest", + "v2.suite_json_patch_request_data" => "SuiteJsonPatchRequestData", + "v2.suite_json_patch_request_data_attributes" => "SuiteJsonPatchRequestDataAttributes", + "v2.suite_json_patch_type" => "SuiteJsonPatchType", "v2.suite_search_response_type" => "SuiteSearchResponseType", "v2.suppression_version_history" => "SuppressionVersionHistory", "v2.suppression_versions" => "SuppressionVersions", "v2.sync_property" => "SyncProperty", "v2.sync_property_with_mapping" => "SyncPropertyWithMapping", + "v2.synthetics_api_multistep_parent_test_attributes" => "SyntheticsApiMultistepParentTestAttributes", + "v2.synthetics_api_multistep_parent_test_data" => "SyntheticsApiMultistepParentTestData", + "v2.synthetics_api_multistep_parent_tests_response" => "SyntheticsApiMultistepParentTestsResponse", + "v2.synthetics_api_multistep_parent_test_type" => "SyntheticsApiMultistepParentTestType", + "v2.synthetics_api_multistep_subtest_attributes" => "SyntheticsApiMultistepSubtestAttributes", + "v2.synthetics_api_multistep_subtest_data" => "SyntheticsApiMultistepSubtestData", + "v2.synthetics_api_multistep_subtests_response" => "SyntheticsApiMultistepSubtestsResponse", + "v2.synthetics_api_multistep_subtest_type" => "SyntheticsApiMultistepSubtestType", "v2.synthetics_fast_test_result" => "SyntheticsFastTestResult", "v2.synthetics_fast_test_result_attributes" => "SyntheticsFastTestResultAttributes", "v2.synthetics_fast_test_result_data" => "SyntheticsFastTestResultData", @@ -5256,7 +5271,25 @@ def overrides "v2.synthetics_test_options_retry" => "SyntheticsTestOptionsRetry", "v2.synthetics_test_options_scheduling" => "SyntheticsTestOptionsScheduling", "v2.synthetics_test_options_scheduling_timeframe" => "SyntheticsTestOptionsSchedulingTimeframe", + "v2.synthetics_test_parent_suite_attributes" => "SyntheticsTestParentSuiteAttributes", + "v2.synthetics_test_parent_suite_data" => "SyntheticsTestParentSuiteData", + "v2.synthetics_test_parent_suites_response" => "SyntheticsTestParentSuitesResponse", + "v2.synthetics_test_parent_suite_type" => "SyntheticsTestParentSuiteType", "v2.synthetics_test_pause_status" => "SyntheticsTestPauseStatus", + "v2.synthetics_test_version_action_metadata" => "SyntheticsTestVersionActionMetadata", + "v2.synthetics_test_version_attributes" => "SyntheticsTestVersionAttributes", + "v2.synthetics_test_version_author" => "SyntheticsTestVersionAuthor", + "v2.synthetics_test_version_change_attributes" => "SyntheticsTestVersionChangeAttributes", + "v2.synthetics_test_version_change_data" => "SyntheticsTestVersionChangeData", + "v2.synthetics_test_version_change_metadata_item" => "SyntheticsTestVersionChangeMetadataItem", + "v2.synthetics_test_version_change_type" => "SyntheticsTestVersionChangeType", + "v2.synthetics_test_version_data" => "SyntheticsTestVersionData", + "v2.synthetics_test_version_diff_patch_diff" => "SyntheticsTestVersionDiffPatchDiff", + "v2.synthetics_test_version_diff_patches" => "SyntheticsTestVersionDiffPatches", + "v2.synthetics_test_version_history_meta" => "SyntheticsTestVersionHistoryMeta", + "v2.synthetics_test_version_history_response" => "SyntheticsTestVersionHistoryResponse", + "v2.synthetics_test_version_response" => "SyntheticsTestVersionResponse", + "v2.synthetics_test_version_type" => "SyntheticsTestVersionType", "v2.synthetics_variable_parser" => "SyntheticsVariableParser", "v2.table_result_v2" => "TableResultV2", "v2.table_result_v2_array" => "TableResultV2Array", @@ -5665,7 +5698,20 @@ def overrides "v2.watcher_data_attributes" => "WatcherDataAttributes", "v2.watcher_data_type" => "WatcherDataType", "v2.weekday" => "Weekday", + "v2.widget_attributes" => "WidgetAttributes", + "v2.widget_data" => "WidgetData", + "v2.widget_definition" => "WidgetDefinition", + "v2.widget_experience_type" => "WidgetExperienceType", + "v2.widget_included_user" => "WidgetIncludedUser", + "v2.widget_included_user_attributes" => "WidgetIncludedUserAttributes", + "v2.widget_list_response" => "WidgetListResponse", "v2.widget_live_span" => "WidgetLiveSpan", + "v2.widget_relationship_data" => "WidgetRelationshipData", + "v2.widget_relationship_item" => "WidgetRelationshipItem", + "v2.widget_relationships" => "WidgetRelationships", + "v2.widget_response" => "WidgetResponse", + "v2.widget_search_meta" => "WidgetSearchMeta", + "v2.widget_type" => "WidgetType", "v2.workflow_data" => "WorkflowData", "v2.workflow_data_attributes" => "WorkflowDataAttributes", "v2.workflow_data_relationships" => "WorkflowDataRelationships", @@ -5829,6 +5875,7 @@ def overrides "v2.test_optimization_api" => "TestOptimizationAPI", "v2.usage_metering_api" => "UsageMeteringAPI", "v2.users_api" => "UsersAPI", + "v2.widgets_api" => "WidgetsAPI", "v2.workflow_automation_api" => "WorkflowAutomationAPI" } end diff --git a/lib/datadog_api_client/v2/api/synthetics_api.rb b/lib/datadog_api_client/v2/api/synthetics_api.rb index 522309bf2f2f..bd3b98b6790f 100644 --- a/lib/datadog_api_client/v2/api/synthetics_api.rb +++ b/lib/datadog_api_client/v2/api/synthetics_api.rb @@ -348,6 +348,138 @@ def edit_synthetics_suite_with_http_info(public_id, body, opts = {}) return data, status_code, headers end + # Get parent tests for a subtest. + # + # @see #get_api_multistep_subtest_parents_with_http_info + def get_api_multistep_subtest_parents(public_id, opts = {}) + data, _status_code, _headers = get_api_multistep_subtest_parents_with_http_info(public_id, opts) + data + end + + # Get parent tests for a subtest. + # + # Get the list of API multistep tests that include a given subtest, + # along with their monitor status. + # + # @param public_id [String] The public ID of the subtest. + # @param opts [Hash] the optional parameters + # @return [Array<(SyntheticsApiMultistepParentTestsResponse, Integer, Hash)>] SyntheticsApiMultistepParentTestsResponse data, response status code and response headers + def get_api_multistep_subtest_parents_with_http_info(public_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SyntheticsAPI.get_api_multistep_subtest_parents ...' + end + # verify the required parameter 'public_id' is set + if @api_client.config.client_side_validation && public_id.nil? + fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsAPI.get_api_multistep_subtest_parents" + end + # resource path + local_var_path = '/api/v2/synthetics/api-multistep/subtests/{public_id}/parents'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'SyntheticsApiMultistepParentTestsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_api_multistep_subtest_parents, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SyntheticsAPI#get_api_multistep_subtest_parents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get available subtests for a multistep test. + # + # @see #get_api_multistep_subtests_with_http_info + def get_api_multistep_subtests(public_id, opts = {}) + data, _status_code, _headers = get_api_multistep_subtests_with_http_info(public_id, opts) + data + end + + # Get available subtests for a multistep test. + # + # 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 public_id [String] The public ID of the API multistep test. + # @param opts [Hash] the optional parameters + # @return [Array<(SyntheticsApiMultistepSubtestsResponse, Integer, Hash)>] SyntheticsApiMultistepSubtestsResponse data, response status code and response headers + def get_api_multistep_subtests_with_http_info(public_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SyntheticsAPI.get_api_multistep_subtests ...' + end + # verify the required parameter 'public_id' is set + if @api_client.config.client_side_validation && public_id.nil? + fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsAPI.get_api_multistep_subtests" + end + # resource path + local_var_path = '/api/v2/synthetics/api-multistep/subtests/{public_id}'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'SyntheticsApiMultistepSubtestsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_api_multistep_subtests, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SyntheticsAPI#get_api_multistep_subtests\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get the on-demand concurrency cap. # # @see #get_on_demand_concurrency_cap_with_http_info @@ -594,6 +726,217 @@ def get_synthetics_suite_with_http_info(public_id, opts = {}) return data, status_code, headers end + # Get a specific version of a test. + # + # @see #get_synthetics_test_version_with_http_info + def get_synthetics_test_version(public_id, version_number, opts = {}) + data, _status_code, _headers = get_synthetics_test_version_with_http_info(public_id, version_number, opts) + data + end + + # Get a specific version of a test. + # + # Get a specific version of a Synthetic test by its version number. + # + # @param public_id [String] The public ID of the Synthetic test. + # @param version_number [Integer] The version number to retrieve. + # @param opts [Hash] the optional parameters + # @option opts [Boolean] :include_change_metadata If `true`, include change metadata in the response. + # @option opts [Boolean] :only_check_existence 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. + # @return [Array<(SyntheticsTestVersionResponse, Integer, Hash)>] SyntheticsTestVersionResponse data, response status code and response headers + def get_synthetics_test_version_with_http_info(public_id, version_number, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SyntheticsAPI.get_synthetics_test_version ...' + end + # verify the required parameter 'public_id' is set + if @api_client.config.client_side_validation && public_id.nil? + fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsAPI.get_synthetics_test_version" + end + # verify the required parameter 'version_number' is set + if @api_client.config.client_side_validation && version_number.nil? + fail ArgumentError, "Missing the required parameter 'version_number' when calling SyntheticsAPI.get_synthetics_test_version" + end + # resource path + local_var_path = '/api/v2/synthetics/tests/{public_id}/version_history/{version_number}'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/')).sub('{version_number}', CGI.escape(version_number.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'include_change_metadata'] = opts[:'include_change_metadata'] if !opts[:'include_change_metadata'].nil? + query_params[:'only_check_existence'] = opts[:'only_check_existence'] if !opts[:'only_check_existence'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'SyntheticsTestVersionResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_synthetics_test_version, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SyntheticsAPI#get_synthetics_test_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get parent suites for a test. + # + # @see #get_test_parent_suites_with_http_info + def get_test_parent_suites(public_id, opts = {}) + data, _status_code, _headers = get_test_parent_suites_with_http_info(public_id, opts) + data + end + + # Get parent suites for a test. + # + # Get the list of parent suites and their status for a given Synthetic test. + # + # @param public_id [String] The public ID of the Synthetic test. + # @param opts [Hash] the optional parameters + # @return [Array<(SyntheticsTestParentSuitesResponse, Integer, Hash)>] SyntheticsTestParentSuitesResponse data, response status code and response headers + def get_test_parent_suites_with_http_info(public_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SyntheticsAPI.get_test_parent_suites ...' + end + # verify the required parameter 'public_id' is set + if @api_client.config.client_side_validation && public_id.nil? + fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsAPI.get_test_parent_suites" + end + # resource path + local_var_path = '/api/v2/synthetics/tests/{public_id}/parent-suites'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'SyntheticsTestParentSuitesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_test_parent_suites, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SyntheticsAPI#get_test_parent_suites\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get version history of a test. + # + # @see #list_synthetics_test_versions_with_http_info + def list_synthetics_test_versions(public_id, opts = {}) + data, _status_code, _headers = list_synthetics_test_versions_with_http_info(public_id, opts) + data + end + + # Get version history of a test. + # + # Get the paginated version history for a Synthetic test. + # + # @param public_id [String] The public ID of the Synthetic test. + # @param opts [Hash] the optional parameters + # @option opts [Integer] :last_version_number The version number of the last item from the previous page. Omit to get the first page. + # @option opts [Integer] :limit Maximum number of version records to return per page. + # @return [Array<(SyntheticsTestVersionHistoryResponse, Integer, Hash)>] SyntheticsTestVersionHistoryResponse data, response status code and response headers + def list_synthetics_test_versions_with_http_info(public_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SyntheticsAPI.list_synthetics_test_versions ...' + end + # verify the required parameter 'public_id' is set + if @api_client.config.client_side_validation && public_id.nil? + fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsAPI.list_synthetics_test_versions" + end + if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 50 + fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling SyntheticsAPI.list_synthetics_test_versions, must be smaller than or equal to 50.' + end + # resource path + local_var_path = '/api/v2/synthetics/tests/{public_id}/version_history'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'last_version_number'] = opts[:'last_version_number'] if !opts[:'last_version_number'].nil? + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'SyntheticsTestVersionHistoryResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_synthetics_test_versions, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SyntheticsAPI#list_synthetics_test_versions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Patch a global variable. # # @see #patch_global_variable_with_http_info @@ -673,6 +1016,84 @@ def patch_global_variable_with_http_info(variable_id, body, opts = {}) return data, status_code, headers end + # Patch a test suite. + # + # @see #patch_test_suite_with_http_info + def patch_test_suite(public_id, body, opts = {}) + data, _status_code, _headers = patch_test_suite_with_http_info(public_id, body, opts) + data + end + + # Patch a test suite. + # + # 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 public_id [String] The public ID of the Synthetic test suite to patch. + # @param body [SuiteJsonPatchRequest] JSON Patch document with operations to apply. + # @param opts [Hash] the optional parameters + # @return [Array<(SyntheticsSuiteResponse, Integer, Hash)>] SyntheticsSuiteResponse data, response status code and response headers + def patch_test_suite_with_http_info(public_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SyntheticsAPI.patch_test_suite ...' + end + # verify the required parameter 'public_id' is set + if @api_client.config.client_side_validation && public_id.nil? + fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsAPI.patch_test_suite" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.patch_test_suite" + end + # resource path + local_var_path = '/api/v2/synthetics/suites/{public_id}/jsonpatch'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'SyntheticsSuiteResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :patch_test_suite, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SyntheticsAPI#patch_test_suite\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Search test suites. # # @see #search_suites_with_http_info diff --git a/lib/datadog_api_client/v2/api/widgets_api.rb b/lib/datadog_api_client/v2/api/widgets_api.rb new file mode 100644 index 000000000000..14c104504fa5 --- /dev/null +++ b/lib/datadog_api_client/v2/api/widgets_api.rb @@ -0,0 +1,431 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'cgi' + +module DatadogAPIClient::V2 + class WidgetsAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Create a widget. + # + # @see #create_widget_with_http_info + def create_widget(experience_type, body, opts = {}) + data, _status_code, _headers = create_widget_with_http_info(experience_type, body, opts) + data + end + + # Create a widget. + # + # Create a new widget for a given experience type. + # + # @param experience_type [WidgetExperienceType] The experience type for the widget. + # @param body [CreateOrUpdateWidgetRequest] Widget request body. + # @param opts [Hash] the optional parameters + # @return [Array<(WidgetResponse, Integer, Hash)>] WidgetResponse data, response status code and response headers + def create_widget_with_http_info(experience_type, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WidgetsAPI.create_widget ...' + end + # verify the required parameter 'experience_type' is set + if @api_client.config.client_side_validation && experience_type.nil? + fail ArgumentError, "Missing the required parameter 'experience_type' when calling WidgetsAPI.create_widget" + end + # verify enum value + allowable_values = ['ccm_reports', 'logs_reports', 'csv_reports', 'product_analytics'] + if @api_client.config.client_side_validation && !allowable_values.include?(experience_type) + fail ArgumentError, "invalid value for \"experience_type\", must be one of #{allowable_values}" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling WidgetsAPI.create_widget" + end + # resource path + local_var_path = '/api/v2/widgets/{experience_type}'.sub('{experience_type}', CGI.escape(experience_type.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'WidgetResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_widget, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: WidgetsAPI#create_widget\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete a widget. + # + # @see #delete_widget_with_http_info + def delete_widget(experience_type, uuid, opts = {}) + delete_widget_with_http_info(experience_type, uuid, opts) + nil + end + + # Delete a widget. + # + # Soft-delete a widget by its UUID for a given experience type. + # + # @param experience_type [WidgetExperienceType] The experience type for the widget. + # @param uuid [UUID] The UUID of the widget. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_widget_with_http_info(experience_type, uuid, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WidgetsAPI.delete_widget ...' + end + # verify the required parameter 'experience_type' is set + if @api_client.config.client_side_validation && experience_type.nil? + fail ArgumentError, "Missing the required parameter 'experience_type' when calling WidgetsAPI.delete_widget" + end + # verify enum value + allowable_values = ['ccm_reports', 'logs_reports', 'csv_reports', 'product_analytics'] + if @api_client.config.client_side_validation && !allowable_values.include?(experience_type) + fail ArgumentError, "invalid value for \"experience_type\", must be one of #{allowable_values}" + end + # verify the required parameter 'uuid' is set + if @api_client.config.client_side_validation && uuid.nil? + fail ArgumentError, "Missing the required parameter 'uuid' when calling WidgetsAPI.delete_widget" + end + # resource path + local_var_path = '/api/v2/widgets/{experience_type}/{uuid}'.sub('{experience_type}', CGI.escape(experience_type.to_s).gsub('%2F', '/')).sub('{uuid}', CGI.escape(uuid.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :delete_widget, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: WidgetsAPI#delete_widget\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get a widget. + # + # @see #get_widget_with_http_info + def get_widget(experience_type, uuid, opts = {}) + data, _status_code, _headers = get_widget_with_http_info(experience_type, uuid, opts) + data + end + + # Get a widget. + # + # Retrieve a widget by its UUID for a given experience type. + # + # @param experience_type [WidgetExperienceType] The experience type for the widget. + # @param uuid [UUID] The UUID of the widget. + # @param opts [Hash] the optional parameters + # @return [Array<(WidgetResponse, Integer, Hash)>] WidgetResponse data, response status code and response headers + def get_widget_with_http_info(experience_type, uuid, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WidgetsAPI.get_widget ...' + end + # verify the required parameter 'experience_type' is set + if @api_client.config.client_side_validation && experience_type.nil? + fail ArgumentError, "Missing the required parameter 'experience_type' when calling WidgetsAPI.get_widget" + end + # verify enum value + allowable_values = ['ccm_reports', 'logs_reports', 'csv_reports', 'product_analytics'] + if @api_client.config.client_side_validation && !allowable_values.include?(experience_type) + fail ArgumentError, "invalid value for \"experience_type\", must be one of #{allowable_values}" + end + # verify the required parameter 'uuid' is set + if @api_client.config.client_side_validation && uuid.nil? + fail ArgumentError, "Missing the required parameter 'uuid' when calling WidgetsAPI.get_widget" + end + # resource path + local_var_path = '/api/v2/widgets/{experience_type}/{uuid}'.sub('{experience_type}', CGI.escape(experience_type.to_s).gsub('%2F', '/')).sub('{uuid}', CGI.escape(uuid.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'WidgetResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_widget, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: WidgetsAPI#get_widget\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Search widgets. + # + # @see #search_widgets_with_http_info + def search_widgets(experience_type, opts = {}) + data, _status_code, _headers = search_widgets_with_http_info(experience_type, opts) + data + end + + # Search widgets. + # + # 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 experience_type [WidgetExperienceType] The experience type for the widget. + # @param opts [Hash] the optional parameters + # @option opts [WidgetType] :filter_widget_type Filter widgets by widget type. + # @option opts [String] :filter_creator_handle Filter widgets by the email handle of the creator. + # @option opts [Boolean] :filter_is_favorited Filter to only widgets favorited by the current user. + # @option opts [String] :filter_title Filter widgets by title (substring match). + # @option opts [String] :filter_tags Filter widgets by tags. Format as bracket-delimited CSV, e.g. `[tag1,tag2]`. + # @option opts [String] :sort Sort field for the results. Prefix with `-` for descending order. Allowed values: `title`, `created_at`, `modified_at`. + # @option opts [Integer] :page_number Page number for pagination (0-indexed). + # @option opts [Integer] :page_size Number of widgets per page. + # @return [Array<(WidgetListResponse, Integer, Hash)>] WidgetListResponse data, response status code and response headers + def search_widgets_with_http_info(experience_type, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WidgetsAPI.search_widgets ...' + end + # verify the required parameter 'experience_type' is set + if @api_client.config.client_side_validation && experience_type.nil? + fail ArgumentError, "Missing the required parameter 'experience_type' when calling WidgetsAPI.search_widgets" + end + # verify enum value + allowable_values = ['ccm_reports', 'logs_reports', 'csv_reports', 'product_analytics'] + if @api_client.config.client_side_validation && !allowable_values.include?(experience_type) + fail ArgumentError, "invalid value for \"experience_type\", must be one of #{allowable_values}" + end + allowable_values = ['bar_chart', 'change', 'cloud_cost_summary', 'cohort', 'funnel', 'geomap', 'list_stream', 'query_table', 'query_value', 'retention_curve', 'sankey', 'sunburst', 'timeseries', 'toplist', 'treemap'] + if @api_client.config.client_side_validation && opts[:'filter_widget_type'] && !allowable_values.include?(opts[:'filter_widget_type']) + fail ArgumentError, "invalid value for \"filter_widget_type\", must be one of #{allowable_values}" + end + if @api_client.config.client_side_validation && !opts[:'page_number'].nil? && opts[:'page_number'] < 0 + fail ArgumentError, 'invalid value for "opts[:"page_number"]" when calling WidgetsAPI.search_widgets, must be greater than or equal to 0.' + end + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling WidgetsAPI.search_widgets, must be smaller than or equal to 100.' + end + # resource path + local_var_path = '/api/v2/widgets/{experience_type}'.sub('{experience_type}', CGI.escape(experience_type.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'filter[widgetType]'] = opts[:'filter_widget_type'] if !opts[:'filter_widget_type'].nil? + query_params[:'filter[creatorHandle]'] = opts[:'filter_creator_handle'] if !opts[:'filter_creator_handle'].nil? + query_params[:'filter[isFavorited]'] = opts[:'filter_is_favorited'] if !opts[:'filter_is_favorited'].nil? + query_params[:'filter[title]'] = opts[:'filter_title'] if !opts[:'filter_title'].nil? + query_params[:'filter[tags]'] = opts[:'filter_tags'] if !opts[:'filter_tags'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'WidgetListResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :search_widgets, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: WidgetsAPI#search_widgets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update a widget. + # + # @see #update_widget_with_http_info + def update_widget(experience_type, uuid, body, opts = {}) + data, _status_code, _headers = update_widget_with_http_info(experience_type, uuid, body, opts) + data + end + + # Update a widget. + # + # Update a widget by its UUID for a given experience type. This performs a full replacement of the widget definition. + # + # @param experience_type [WidgetExperienceType] The experience type for the widget. + # @param uuid [UUID] The UUID of the widget. + # @param body [CreateOrUpdateWidgetRequest] Widget request body. + # @param opts [Hash] the optional parameters + # @return [Array<(WidgetResponse, Integer, Hash)>] WidgetResponse data, response status code and response headers + def update_widget_with_http_info(experience_type, uuid, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: WidgetsAPI.update_widget ...' + end + # verify the required parameter 'experience_type' is set + if @api_client.config.client_side_validation && experience_type.nil? + fail ArgumentError, "Missing the required parameter 'experience_type' when calling WidgetsAPI.update_widget" + end + # verify enum value + allowable_values = ['ccm_reports', 'logs_reports', 'csv_reports', 'product_analytics'] + if @api_client.config.client_side_validation && !allowable_values.include?(experience_type) + fail ArgumentError, "invalid value for \"experience_type\", must be one of #{allowable_values}" + end + # verify the required parameter 'uuid' is set + if @api_client.config.client_side_validation && uuid.nil? + fail ArgumentError, "Missing the required parameter 'uuid' when calling WidgetsAPI.update_widget" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling WidgetsAPI.update_widget" + end + # resource path + local_var_path = '/api/v2/widgets/{experience_type}/{uuid}'.sub('{experience_type}', CGI.escape(experience_type.to_s).gsub('%2F', '/')).sub('{uuid}', CGI.escape(uuid.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'WidgetResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_widget, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: WidgetsAPI#update_widget\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_or_update_widget_request.rb b/lib/datadog_api_client/v2/models/create_or_update_widget_request.rb new file mode 100644 index 000000000000..e390a9414085 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_or_update_widget_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request body for creating or updating a widget. + class CreateOrUpdateWidgetRequest + include BaseGenericModel + + # Data for creating or updating a widget. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'CreateOrUpdateWidgetRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateOrUpdateWidgetRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_or_update_widget_request_attributes.rb b/lib/datadog_api_client/v2/models/create_or_update_widget_request_attributes.rb new file mode 100644 index 000000000000..610a72966563 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_or_update_widget_request_attributes.rb @@ -0,0 +1,143 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for creating or updating a widget. + class CreateOrUpdateWidgetRequestAttributes + include BaseGenericModel + + # The definition of a widget, including its type and configuration. + attr_reader :definition + + # User-defined tags for organizing the widget. + attr_accessor :tags + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'definition' => :'definition', + :'tags' => :'tags' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'definition' => :'WidgetDefinition', + :'tags' => :'Array' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'tags', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateOrUpdateWidgetRequestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'definition') + self.definition = attributes[:'definition'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @definition.nil? + true + end + + # Custom attribute writer method with validation + # @param definition [Object] Object to be assigned + # @!visibility private + def definition=(definition) + if definition.nil? + fail ArgumentError, 'invalid value for "definition", definition cannot be nil.' + end + @definition = definition + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + definition == o.definition && + tags == o.tags && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [definition, tags, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_or_update_widget_request_data.rb b/lib/datadog_api_client/v2/models/create_or_update_widget_request_data.rb new file mode 100644 index 000000000000..99303dfd64e9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_or_update_widget_request_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for creating or updating a widget. + class CreateOrUpdateWidgetRequestData + include BaseGenericModel + + # Attributes for creating or updating a widget. + attr_reader :attributes + + # Widgets resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'CreateOrUpdateWidgetRequestAttributes', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CreateOrUpdateWidgetRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/suite_json_patch_request.rb b/lib/datadog_api_client/v2/models/suite_json_patch_request.rb new file mode 100644 index 000000000000..360598d48ce9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/suite_json_patch_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # JSON Patch request for a Synthetic test suite. + class SuiteJsonPatchRequest + include BaseGenericModel + + # Data object for a JSON Patch request on a Synthetic test suite. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'SuiteJsonPatchRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SuiteJsonPatchRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/suite_json_patch_request_data.rb b/lib/datadog_api_client/v2/models/suite_json_patch_request_data.rb new file mode 100644 index 000000000000..ea77a8f6f91c --- /dev/null +++ b/lib/datadog_api_client/v2/models/suite_json_patch_request_data.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for a JSON Patch request on a Synthetic test suite. + class SuiteJsonPatchRequestData + include BaseGenericModel + + # Attributes for a JSON Patch request on a Synthetic test suite. + attr_accessor :attributes + + # Type for a JSON Patch request on a Synthetic test suite, `suites_json_patch`. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SuiteJsonPatchRequestDataAttributes', + :'type' => :'SuiteJsonPatchType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SuiteJsonPatchRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/suite_json_patch_request_data_attributes.rb b/lib/datadog_api_client/v2/models/suite_json_patch_request_data_attributes.rb new file mode 100644 index 000000000000..6aab1c360306 --- /dev/null +++ b/lib/datadog_api_client/v2/models/suite_json_patch_request_data_attributes.rb @@ -0,0 +1,107 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for a JSON Patch request on a Synthetic test suite. + class SuiteJsonPatchRequestDataAttributes + include BaseGenericModel + + # JSON Patch operations following RFC 6902. + attr_accessor :json_patch + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'json_patch' => :'json_patch' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'json_patch' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SuiteJsonPatchRequestDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'json_patch') + if (value = attributes[:'json_patch']).is_a?(Array) + self.json_patch = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + json_patch == o.json_patch && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [json_patch, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/suite_json_patch_type.rb b/lib/datadog_api_client/v2/models/suite_json_patch_type.rb new file mode 100644 index 000000000000..201df51ba2bc --- /dev/null +++ b/lib/datadog_api_client/v2/models/suite_json_patch_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type for a JSON Patch request on a Synthetic test suite, `suites_json_patch`. + class SuiteJsonPatchType + include BaseEnumModel + + SUITES_JSON_PATCH = "suites_json_patch".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_api_multistep_parent_test_attributes.rb b/lib/datadog_api_client/v2/models/synthetics_api_multistep_parent_test_attributes.rb new file mode 100644 index 000000000000..ea39d0888f2e --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_api_multistep_parent_test_attributes.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a parent API multistep test. + class SyntheticsApiMultistepParentTestAttributes + include BaseGenericModel + + # The name of the child subtest. + attr_accessor :child_name + + # The public ID of the child subtest. + attr_accessor :child_public_id + + # The associated monitor ID. + attr_accessor :monitor_id + + # Name of the parent test. + attr_accessor :name + + # The overall state of the parent test. + attr_accessor :overall_state + + # Timestamp of when the overall state was last modified. + attr_accessor :overall_state_modified + + # The public ID of the parent test. + attr_accessor :public_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'child_name' => :'child_name', + :'child_public_id' => :'child_public_id', + :'monitor_id' => :'monitor_id', + :'name' => :'name', + :'overall_state' => :'overall_state', + :'overall_state_modified' => :'overall_state_modified', + :'public_id' => :'public_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'child_name' => :'String', + :'child_public_id' => :'String', + :'monitor_id' => :'Integer', + :'name' => :'String', + :'overall_state' => :'Integer', + :'overall_state_modified' => :'String', + :'public_id' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsApiMultistepParentTestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'child_name') + self.child_name = attributes[:'child_name'] + end + + if attributes.key?(:'child_public_id') + self.child_public_id = attributes[:'child_public_id'] + end + + if attributes.key?(:'monitor_id') + self.monitor_id = attributes[:'monitor_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'overall_state') + self.overall_state = attributes[:'overall_state'] + end + + if attributes.key?(:'overall_state_modified') + self.overall_state_modified = attributes[:'overall_state_modified'] + end + + if attributes.key?(:'public_id') + self.public_id = attributes[:'public_id'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + child_name == o.child_name && + child_public_id == o.child_public_id && + monitor_id == o.monitor_id && + name == o.name && + overall_state == o.overall_state && + overall_state_modified == o.overall_state_modified && + public_id == o.public_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [child_name, child_public_id, monitor_id, name, overall_state, overall_state_modified, public_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_api_multistep_parent_test_data.rb b/lib/datadog_api_client/v2/models/synthetics_api_multistep_parent_test_data.rb new file mode 100644 index 000000000000..514f5473b7db --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_api_multistep_parent_test_data.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for a parent API multistep test. + class SyntheticsApiMultistepParentTestData + include BaseGenericModel + + # Attributes of a parent API multistep test. + attr_accessor :attributes + + # The public ID of the parent test. + attr_accessor :id + + # Type of the parent test resource. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SyntheticsApiMultistepParentTestAttributes', + :'id' => :'String', + :'type' => :'SyntheticsApiMultistepParentTestType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsApiMultistepParentTestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_api_multistep_parent_test_type.rb b/lib/datadog_api_client/v2/models/synthetics_api_multistep_parent_test_type.rb new file mode 100644 index 000000000000..9c5f3559adf1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_api_multistep_parent_test_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type of the parent test resource. + class SyntheticsApiMultistepParentTestType + include BaseEnumModel + + PARENT_TEST = "parent_test".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_api_multistep_parent_tests_response.rb b/lib/datadog_api_client/v2/models/synthetics_api_multistep_parent_tests_response.rb new file mode 100644 index 000000000000..b5bb03ca05a6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_api_multistep_parent_tests_response.rb @@ -0,0 +1,107 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing the list of parent tests for an API multistep subtest. + class SyntheticsApiMultistepParentTestsResponse + include BaseGenericModel + + # List of parent tests that include this subtest. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsApiMultistepParentTestsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_api_multistep_subtest_attributes.rb b/lib/datadog_api_client/v2/models/synthetics_api_multistep_subtest_attributes.rb new file mode 100644 index 000000000000..8d2c348eaa35 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_api_multistep_subtest_attributes.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a Synthetic API multistep subtest. + class SyntheticsApiMultistepSubtestAttributes + include BaseGenericModel + + # Name of the subtest. + attr_accessor :name + + # The public ID of the subtest. + attr_accessor :public_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name', + :'public_id' => :'public_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String', + :'public_id' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsApiMultistepSubtestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'public_id') + self.public_id = attributes[:'public_id'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + public_id == o.public_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, public_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_api_multistep_subtest_data.rb b/lib/datadog_api_client/v2/models/synthetics_api_multistep_subtest_data.rb new file mode 100644 index 000000000000..31c3edf6b7b4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_api_multistep_subtest_data.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for a Synthetic API multistep subtest. + class SyntheticsApiMultistepSubtestData + include BaseGenericModel + + # Attributes of a Synthetic API multistep subtest. + attr_accessor :attributes + + # The public ID of the subtest. + attr_accessor :id + + # Type of the subtest resource. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SyntheticsApiMultistepSubtestAttributes', + :'id' => :'String', + :'type' => :'SyntheticsApiMultistepSubtestType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsApiMultistepSubtestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_api_multistep_subtest_type.rb b/lib/datadog_api_client/v2/models/synthetics_api_multistep_subtest_type.rb new file mode 100644 index 000000000000..ff33cf2a3a98 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_api_multistep_subtest_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type of the subtest resource. + class SyntheticsApiMultistepSubtestType + include BaseEnumModel + + SUBTEST = "subtest".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_api_multistep_subtests_response.rb b/lib/datadog_api_client/v2/models/synthetics_api_multistep_subtests_response.rb new file mode 100644 index 000000000000..d289d6ffb643 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_api_multistep_subtests_response.rb @@ -0,0 +1,107 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing the list of available subtests for an API multistep test. + class SyntheticsApiMultistepSubtestsResponse + include BaseGenericModel + + # List of API tests that can be added as subtests. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsApiMultistepSubtestsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_test_parent_suite_attributes.rb b/lib/datadog_api_client/v2/models/synthetics_test_parent_suite_attributes.rb new file mode 100644 index 000000000000..36f7e4412a69 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_test_parent_suite_attributes.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Object containing details about a parent suite of a Synthetic test. + class SyntheticsTestParentSuiteAttributes + include BaseGenericModel + + # The name of the child test within the suite. + attr_accessor :child_name + + # The public ID of the child test within the suite. + attr_accessor :child_public_id + + # The associated monitor ID. + attr_accessor :monitor_id + + # Name of the parent suite. + attr_accessor :name + + # The overall state of the parent suite. + attr_accessor :overall_state + + # Timestamp of when the overall state was last modified. + attr_accessor :overall_state_modified + + # The public ID of the parent suite. + attr_accessor :public_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'child_name' => :'child_name', + :'child_public_id' => :'child_public_id', + :'monitor_id' => :'monitor_id', + :'name' => :'name', + :'overall_state' => :'overall_state', + :'overall_state_modified' => :'overall_state_modified', + :'public_id' => :'public_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'child_name' => :'String', + :'child_public_id' => :'String', + :'monitor_id' => :'Integer', + :'name' => :'String', + :'overall_state' => :'Integer', + :'overall_state_modified' => :'String', + :'public_id' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsTestParentSuiteAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'child_name') + self.child_name = attributes[:'child_name'] + end + + if attributes.key?(:'child_public_id') + self.child_public_id = attributes[:'child_public_id'] + end + + if attributes.key?(:'monitor_id') + self.monitor_id = attributes[:'monitor_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'overall_state') + self.overall_state = attributes[:'overall_state'] + end + + if attributes.key?(:'overall_state_modified') + self.overall_state_modified = attributes[:'overall_state_modified'] + end + + if attributes.key?(:'public_id') + self.public_id = attributes[:'public_id'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + child_name == o.child_name && + child_public_id == o.child_public_id && + monitor_id == o.monitor_id && + name == o.name && + overall_state == o.overall_state && + overall_state_modified == o.overall_state_modified && + public_id == o.public_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [child_name, child_public_id, monitor_id, name, overall_state, overall_state_modified, public_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_test_parent_suite_data.rb b/lib/datadog_api_client/v2/models/synthetics_test_parent_suite_data.rb new file mode 100644 index 000000000000..f75a18c23f03 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_test_parent_suite_data.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for a parent suite. + class SyntheticsTestParentSuiteData + include BaseGenericModel + + # Object containing details about a parent suite of a Synthetic test. + attr_accessor :attributes + + # The public ID of the parent suite. + attr_accessor :id + + # Type of the parent suite resource. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SyntheticsTestParentSuiteAttributes', + :'id' => :'String', + :'type' => :'SyntheticsTestParentSuiteType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsTestParentSuiteData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_test_parent_suite_type.rb b/lib/datadog_api_client/v2/models/synthetics_test_parent_suite_type.rb new file mode 100644 index 000000000000..7d0c24e5c523 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_test_parent_suite_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type of the parent suite resource. + class SyntheticsTestParentSuiteType + include BaseEnumModel + + PARENT_SUITE = "parent_suite".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_test_parent_suites_response.rb b/lib/datadog_api_client/v2/models/synthetics_test_parent_suites_response.rb new file mode 100644 index 000000000000..0b49f05f0564 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_test_parent_suites_response.rb @@ -0,0 +1,107 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing the list of parent suites for a Synthetic test. + class SyntheticsTestParentSuitesResponse + include BaseGenericModel + + # List of parent suites for the given test. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsTestParentSuitesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_test_version_action_metadata.rb b/lib/datadog_api_client/v2/models/synthetics_test_version_action_metadata.rb new file mode 100644 index 000000000000..4205d5991707 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_test_version_action_metadata.rb @@ -0,0 +1,145 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Object containing metadata about a change action. + class SyntheticsTestVersionActionMetadata + include BaseGenericModel + + # The value of the property after the change. + attr_accessor :after_value + + # The value of the property before the change. + attr_accessor :before_value + + # List of diff patches for text changes. + attr_accessor :diff_patches + + # The dot-separated path of the property that was changed. + attr_accessor :property_path + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'after_value' => :'after_value', + :'before_value' => :'before_value', + :'diff_patches' => :'diff_patches', + :'property_path' => :'property_path' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'after_value' => :'Object', + :'before_value' => :'Object', + :'diff_patches' => :'Array', + :'property_path' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'diff_patches', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsTestVersionActionMetadata` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'after_value') + self.after_value = attributes[:'after_value'] + end + + if attributes.key?(:'before_value') + self.before_value = attributes[:'before_value'] + end + + if attributes.key?(:'diff_patches') + if (value = attributes[:'diff_patches']).is_a?(Array) + self.diff_patches = value + end + end + + if attributes.key?(:'property_path') + self.property_path = attributes[:'property_path'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + after_value == o.after_value && + before_value == o.before_value && + diff_patches == o.diff_patches && + property_path == o.property_path && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [after_value, before_value, diff_patches, property_path, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_test_version_attributes.rb b/lib/datadog_api_client/v2/models/synthetics_test_version_attributes.rb new file mode 100644 index 000000000000..e48126f588ce --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_test_version_attributes.rb @@ -0,0 +1,138 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a specific Synthetic test version. + class SyntheticsTestVersionAttributes + include BaseGenericModel + + # Object describing the author of a test version. + attr_accessor :author + + # List of metadata describing individual changes in this version. + # Only returned when the `include_change_metadata` query parameter is `true`. + attr_accessor :change_metadata + + # The full test configuration at this version. + attr_accessor :payload + + # Timestamp of when this version was created. + attr_accessor :version_payload_created_at + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'author' => :'author', + :'change_metadata' => :'change_metadata', + :'payload' => :'payload', + :'version_payload_created_at' => :'version_payload_created_at' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'author' => :'SyntheticsTestVersionAuthor', + :'change_metadata' => :'Array', + :'payload' => :'Hash', + :'version_payload_created_at' => :'Time' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsTestVersionAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'author') + self.author = attributes[:'author'] + end + + if attributes.key?(:'change_metadata') + if (value = attributes[:'change_metadata']).is_a?(Array) + self.change_metadata = value + end + end + + if attributes.key?(:'payload') + self.payload = attributes[:'payload'] + end + + if attributes.key?(:'version_payload_created_at') + self.version_payload_created_at = attributes[:'version_payload_created_at'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + author == o.author && + change_metadata == o.change_metadata && + payload == o.payload && + version_payload_created_at == o.version_payload_created_at && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [author, change_metadata, payload, version_payload_created_at, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_test_version_author.rb b/lib/datadog_api_client/v2/models/synthetics_test_version_author.rb new file mode 100644 index 000000000000..7d324bc96d5e --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_test_version_author.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Object describing the author of a test version. + class SyntheticsTestVersionAuthor + include BaseGenericModel + + # Email address of the author. + attr_accessor :email + + # The author's Datadog handle (login username). + attr_accessor :handle + + # UUID of the author. + attr_accessor :id + + # Display name of the author. + attr_accessor :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'email' => :'email', + :'handle' => :'handle', + :'id' => :'id', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'email' => :'String', + :'handle' => :'String', + :'id' => :'String', + :'name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsTestVersionAuthor` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'handle') + self.handle = attributes[:'handle'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + email == o.email && + handle == o.handle && + id == o.id && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [email, handle, id, name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_test_version_change_attributes.rb b/lib/datadog_api_client/v2/models/synthetics_test_version_change_attributes.rb new file mode 100644 index 000000000000..d1fbea6f686a --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_test_version_change_attributes.rb @@ -0,0 +1,137 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a version change record. + class SyntheticsTestVersionChangeAttributes + include BaseGenericModel + + # UUID of the user who created this version. + attr_accessor :author_uuid + + # List of metadata describing individual changes in this version. + attr_accessor :change_metadata + + # The sequential version number. + attr_accessor :version_number + + # Timestamp of when this version was created. + attr_accessor :version_payload_created_at + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'author_uuid' => :'author_uuid', + :'change_metadata' => :'change_metadata', + :'version_number' => :'version_number', + :'version_payload_created_at' => :'version_payload_created_at' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'author_uuid' => :'String', + :'change_metadata' => :'Array', + :'version_number' => :'Integer', + :'version_payload_created_at' => :'Time' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsTestVersionChangeAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'author_uuid') + self.author_uuid = attributes[:'author_uuid'] + end + + if attributes.key?(:'change_metadata') + if (value = attributes[:'change_metadata']).is_a?(Array) + self.change_metadata = value + end + end + + if attributes.key?(:'version_number') + self.version_number = attributes[:'version_number'] + end + + if attributes.key?(:'version_payload_created_at') + self.version_payload_created_at = attributes[:'version_payload_created_at'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + author_uuid == o.author_uuid && + change_metadata == o.change_metadata && + version_number == o.version_number && + version_payload_created_at == o.version_payload_created_at && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [author_uuid, change_metadata, version_number, version_payload_created_at, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_test_version_change_data.rb b/lib/datadog_api_client/v2/models/synthetics_test_version_change_data.rb new file mode 100644 index 000000000000..94ae7411c029 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_test_version_change_data.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for a version change record. + class SyntheticsTestVersionChangeData + include BaseGenericModel + + # Attributes of a version change record. + attr_accessor :attributes + + # UUID of the version change record. + attr_accessor :id + + # Type of the version metadata resource. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SyntheticsTestVersionChangeAttributes', + :'id' => :'String', + :'type' => :'SyntheticsTestVersionChangeType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsTestVersionChangeData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_test_version_change_metadata_item.rb b/lib/datadog_api_client/v2/models/synthetics_test_version_change_metadata_item.rb new file mode 100644 index 000000000000..5f69e8729741 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_test_version_change_metadata_item.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Object describing a single change within a version. + class SyntheticsTestVersionChangeMetadataItem + include BaseGenericModel + + # The action that was performed (for example, `updated` or `created`). + attr_accessor :action + + # Object containing metadata about a change action. + attr_accessor :action_metadata + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'action' => :'action', + :'action_metadata' => :'action_metadata' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'action' => :'String', + :'action_metadata' => :'SyntheticsTestVersionActionMetadata' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsTestVersionChangeMetadataItem` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'action') + self.action = attributes[:'action'] + end + + if attributes.key?(:'action_metadata') + self.action_metadata = attributes[:'action_metadata'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + action == o.action && + action_metadata == o.action_metadata && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [action, action_metadata, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_test_version_change_type.rb b/lib/datadog_api_client/v2/models/synthetics_test_version_change_type.rb new file mode 100644 index 000000000000..6c6486332af0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_test_version_change_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type of the version metadata resource. + class SyntheticsTestVersionChangeType + include BaseEnumModel + + VERSION_METADATA = "version_metadata".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_test_version_data.rb b/lib/datadog_api_client/v2/models/synthetics_test_version_data.rb new file mode 100644 index 000000000000..b98e3e4215b5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_test_version_data.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for a specific Synthetic test version. + class SyntheticsTestVersionData + include BaseGenericModel + + # Attributes of a specific Synthetic test version. + attr_accessor :attributes + + # UUID of the version record. + attr_accessor :id + + # Type of the version resource. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SyntheticsTestVersionAttributes', + :'id' => :'String', + :'type' => :'SyntheticsTestVersionType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsTestVersionData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_test_version_diff_patch_diff.rb b/lib/datadog_api_client/v2/models/synthetics_test_version_diff_patch_diff.rb new file mode 100644 index 000000000000..d78455463aea --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_test_version_diff_patch_diff.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Object describing a single text diff operation. + class SyntheticsTestVersionDiffPatchDiff + include BaseGenericModel + + # The text that was changed. + attr_accessor :change_text + + # The diff operation applied. + attr_accessor :operation + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'change_text' => :'change_text', + :'operation' => :'operation' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'change_text' => :'String', + :'operation' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsTestVersionDiffPatchDiff` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'change_text') + self.change_text = attributes[:'change_text'] + end + + if attributes.key?(:'operation') + self.operation = attributes[:'operation'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + change_text == o.change_text && + operation == o.operation && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [change_text, operation, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_test_version_diff_patches.rb b/lib/datadog_api_client/v2/models/synthetics_test_version_diff_patches.rb new file mode 100644 index 000000000000..4f3af256bd4f --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_test_version_diff_patches.rb @@ -0,0 +1,147 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Object describing a patch in the diff. + class SyntheticsTestVersionDiffPatches + include BaseGenericModel + + # List of individual diff operations. + attr_accessor :diffs + + # Length of the original text segment. + attr_accessor :length1 + + # Length of the modified text segment. + attr_accessor :length2 + + # Start position in the original text. + attr_accessor :start1 + + # Start position in the modified text. + attr_accessor :start2 + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'diffs' => :'diffs', + :'length1' => :'length1', + :'length2' => :'length2', + :'start1' => :'start1', + :'start2' => :'start2' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'diffs' => :'Array', + :'length1' => :'Integer', + :'length2' => :'Integer', + :'start1' => :'Integer', + :'start2' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsTestVersionDiffPatches` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'diffs') + if (value = attributes[:'diffs']).is_a?(Array) + self.diffs = value + end + end + + if attributes.key?(:'length1') + self.length1 = attributes[:'length1'] + end + + if attributes.key?(:'length2') + self.length2 = attributes[:'length2'] + end + + if attributes.key?(:'start1') + self.start1 = attributes[:'start1'] + end + + if attributes.key?(:'start2') + self.start2 = attributes[:'start2'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + diffs == o.diffs && + length1 == o.length1 && + length2 == o.length2 && + start1 == o.start1 && + start2 == o.start2 && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [diffs, length1, length2, start1, start2, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_test_version_history_meta.rb b/lib/datadog_api_client/v2/models/synthetics_test_version_history_meta.rb new file mode 100644 index 000000000000..2c7ed7ed8584 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_test_version_history_meta.rb @@ -0,0 +1,124 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Pagination metadata for a version history response. + class SyntheticsTestVersionHistoryMeta + include BaseGenericModel + + # The version number to use as the `last_version_number` query parameter + # to fetch the next page. `null` indicates there are no more pages. + attr_accessor :next_last_version_number + + # The number of days that version history is retained. + attr_accessor :retention_period_in_days + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'next_last_version_number' => :'next_last_version_number', + :'retention_period_in_days' => :'retention_period_in_days' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'next_last_version_number' => :'Integer', + :'retention_period_in_days' => :'Integer' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'next_last_version_number', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsTestVersionHistoryMeta` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'next_last_version_number') + self.next_last_version_number = attributes[:'next_last_version_number'] + end + + if attributes.key?(:'retention_period_in_days') + self.retention_period_in_days = attributes[:'retention_period_in_days'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + next_last_version_number == o.next_last_version_number && + retention_period_in_days == o.retention_period_in_days && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [next_last_version_number, retention_period_in_days, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_test_version_history_response.rb b/lib/datadog_api_client/v2/models/synthetics_test_version_history_response.rb new file mode 100644 index 000000000000..912fbb184db7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_test_version_history_response.rb @@ -0,0 +1,117 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing the paginated version history for a Synthetic test. + class SyntheticsTestVersionHistoryResponse + include BaseGenericModel + + # List of version change records. + attr_accessor :data + + # Pagination metadata for a version history response. + attr_accessor :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'meta' => :'SyntheticsTestVersionHistoryMeta' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsTestVersionHistoryResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_test_version_response.rb b/lib/datadog_api_client/v2/models/synthetics_test_version_response.rb new file mode 100644 index 000000000000..599707b12043 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_test_version_response.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a specific version of a Synthetic test. + class SyntheticsTestVersionResponse + include BaseGenericModel + + # Data object for a specific Synthetic test version. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'SyntheticsTestVersionData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsTestVersionResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_test_version_type.rb b/lib/datadog_api_client/v2/models/synthetics_test_version_type.rb new file mode 100644 index 000000000000..744350947146 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_test_version_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type of the version resource. + class SyntheticsTestVersionType + include BaseEnumModel + + VERSION = "version".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/widget_attributes.rb b/lib/datadog_api_client/v2/models/widget_attributes.rb new file mode 100644 index 000000000000..af559edf326d --- /dev/null +++ b/lib/datadog_api_client/v2/models/widget_attributes.rb @@ -0,0 +1,206 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a widget resource. + class WidgetAttributes + include BaseGenericModel + + # ISO 8601 timestamp of when the widget was created. + attr_reader :created_at + + # The definition of a widget, including its type and configuration. + attr_reader :definition + + # Will be implemented soon. Currently always returns false. + attr_reader :is_favorited + + # ISO 8601 timestamp of when the widget was last modified. + attr_reader :modified_at + + # User-defined tags for organizing widgets. + attr_accessor :tags + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_at' => :'created_at', + :'definition' => :'definition', + :'is_favorited' => :'is_favorited', + :'modified_at' => :'modified_at', + :'tags' => :'tags' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'String', + :'definition' => :'WidgetDefinition', + :'is_favorited' => :'Boolean', + :'modified_at' => :'String', + :'tags' => :'Array' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'tags', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::WidgetAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'definition') + self.definition = attributes[:'definition'] + end + + if attributes.key?(:'is_favorited') + self.is_favorited = attributes[:'is_favorited'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @created_at.nil? + return false if @definition.nil? + return false if @is_favorited.nil? + return false if @modified_at.nil? + true + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param definition [Object] Object to be assigned + # @!visibility private + def definition=(definition) + if definition.nil? + fail ArgumentError, 'invalid value for "definition", definition cannot be nil.' + end + @definition = definition + end + + # Custom attribute writer method with validation + # @param is_favorited [Object] Object to be assigned + # @!visibility private + def is_favorited=(is_favorited) + if is_favorited.nil? + fail ArgumentError, 'invalid value for "is_favorited", is_favorited cannot be nil.' + end + @is_favorited = is_favorited + end + + # Custom attribute writer method with validation + # @param modified_at [Object] Object to be assigned + # @!visibility private + def modified_at=(modified_at) + if modified_at.nil? + fail ArgumentError, 'invalid value for "modified_at", modified_at cannot be nil.' + end + @modified_at = modified_at + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_at == o.created_at && + definition == o.definition && + is_favorited == o.is_favorited && + modified_at == o.modified_at && + tags == o.tags && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, definition, is_favorited, modified_at, tags, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/widget_data.rb b/lib/datadog_api_client/v2/models/widget_data.rb new file mode 100644 index 000000000000..a8f8444d27df --- /dev/null +++ b/lib/datadog_api_client/v2/models/widget_data.rb @@ -0,0 +1,175 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A widget resource object. + class WidgetData + include BaseGenericModel + + # Attributes of a widget resource. + attr_reader :attributes + + # The unique identifier of the widget. + attr_reader :id + + # Relationships of the widget resource. + attr_accessor :relationships + + # Widgets resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'WidgetAttributes', + :'id' => :'String', + :'relationships' => :'WidgetRelationships', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::WidgetData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/widget_definition.rb b/lib/datadog_api_client/v2/models/widget_definition.rb new file mode 100644 index 000000000000..052cd1967e93 --- /dev/null +++ b/lib/datadog_api_client/v2/models/widget_definition.rb @@ -0,0 +1,153 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The definition of a widget, including its type and configuration. + class WidgetDefinition + include BaseGenericModel + + # The display title of the widget. + attr_reader :title + + # Widget types that are allowed to be stored as individual records. + # This is not a complete list of dashboard and notebook widget types. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'title' => :'title', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'title' => :'String', + :'type' => :'WidgetType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::WidgetDefinition` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @title.nil? + return false if @title.to_s.length > 100 + return false if @title.to_s.length < 1 + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param title [Object] Object to be assigned + # @!visibility private + def title=(title) + if title.nil? + fail ArgumentError, 'invalid value for "title", title cannot be nil.' + end + if title.to_s.length > 100 + fail ArgumentError, 'invalid value for "title", the character length must be smaller than or equal to 100.' + end + if title.to_s.length < 1 + fail ArgumentError, 'invalid value for "title", the character length must be great than or equal to 1.' + end + @title = title + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + title == o.title && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [title, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/widget_experience_type.rb b/lib/datadog_api_client/v2/models/widget_experience_type.rb new file mode 100644 index 000000000000..486817d6d94f --- /dev/null +++ b/lib/datadog_api_client/v2/models/widget_experience_type.rb @@ -0,0 +1,29 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Widget experience types that differentiate between the products using the specific widget. + class WidgetExperienceType + include BaseEnumModel + + CCM_REPORTS = "ccm_reports".freeze + LOGS_REPORTS = "logs_reports".freeze + CSV_REPORTS = "csv_reports".freeze + PRODUCT_ANALYTICS = "product_analytics".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/widget_included_user.rb b/lib/datadog_api_client/v2/models/widget_included_user.rb new file mode 100644 index 000000000000..8bebb2f96f21 --- /dev/null +++ b/lib/datadog_api_client/v2/models/widget_included_user.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A user resource included in the response. + class WidgetIncludedUser + include BaseGenericModel + + # Attributes of an included user resource. + attr_accessor :attributes + + # The unique identifier of the user. + attr_reader :id + + # Users resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'WidgetIncludedUserAttributes', + :'id' => :'String', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::WidgetIncludedUser` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/widget_included_user_attributes.rb b/lib/datadog_api_client/v2/models/widget_included_user_attributes.rb new file mode 100644 index 000000000000..ef59859ff741 --- /dev/null +++ b/lib/datadog_api_client/v2/models/widget_included_user_attributes.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of an included user resource. + class WidgetIncludedUserAttributes + include BaseGenericModel + + # The email handle of the user. + attr_accessor :handle + + # The display name of the user. + attr_accessor :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'handle' => :'handle', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'handle' => :'String', + :'name' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'name', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::WidgetIncludedUserAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'handle') + self.handle = attributes[:'handle'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + handle == o.handle && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [handle, name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/widget_list_response.rb b/lib/datadog_api_client/v2/models/widget_list_response.rb new file mode 100644 index 000000000000..f3e74f8790d4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/widget_list_response.rb @@ -0,0 +1,147 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a list of widgets. + class WidgetListResponse + include BaseGenericModel + + # List of widget resources. + attr_reader :data + + # Array of user resources related to the widgets. + attr_accessor :included + + # Metadata about the search results. + attr_accessor :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'included' => :'Array', + :'meta' => :'WidgetSearchMeta' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::WidgetListResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'included') + if (value = attributes[:'included']).is_a?(Array) + self.included = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + included == o.included && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/widget_relationship_data.rb b/lib/datadog_api_client/v2/models/widget_relationship_data.rb new file mode 100644 index 000000000000..040e428d16ce --- /dev/null +++ b/lib/datadog_api_client/v2/models/widget_relationship_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationship data referencing a user resource. + class WidgetRelationshipData + include BaseGenericModel + + # The unique identifier of the user. + attr_reader :id + + # Users resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::WidgetRelationshipData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/widget_relationship_item.rb b/lib/datadog_api_client/v2/models/widget_relationship_item.rb new file mode 100644 index 000000000000..e5a0b260d15a --- /dev/null +++ b/lib/datadog_api_client/v2/models/widget_relationship_item.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A JSON:API relationship to a user. + class WidgetRelationshipItem + include BaseGenericModel + + # Relationship data referencing a user resource. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'WidgetRelationshipData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::WidgetRelationshipItem` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/widget_relationships.rb b/lib/datadog_api_client/v2/models/widget_relationships.rb new file mode 100644 index 000000000000..8322ed087639 --- /dev/null +++ b/lib/datadog_api_client/v2/models/widget_relationships.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationships of the widget resource. + class WidgetRelationships + include BaseGenericModel + + # A JSON:API relationship to a user. + attr_accessor :created_by + + # A JSON:API relationship to a user. + attr_accessor :modified_by + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_by' => :'created_by', + :'modified_by' => :'modified_by' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_by' => :'WidgetRelationshipItem', + :'modified_by' => :'WidgetRelationshipItem' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::WidgetRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_by') + self.created_by = attributes[:'created_by'] + end + + if attributes.key?(:'modified_by') + self.modified_by = attributes[:'modified_by'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_by == o.created_by && + modified_by == o.modified_by && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_by, modified_by, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/widget_response.rb b/lib/datadog_api_client/v2/models/widget_response.rb new file mode 100644 index 000000000000..498546b4623b --- /dev/null +++ b/lib/datadog_api_client/v2/models/widget_response.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a single widget. + class WidgetResponse + include BaseGenericModel + + # A widget resource object. + attr_reader :data + + # Array of user resources related to the widget. + attr_accessor :included + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'WidgetData', + :'included' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::WidgetResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + + if attributes.key?(:'included') + if (value = attributes[:'included']).is_a?(Array) + self.included = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + included == o.included && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/widget_search_meta.rb b/lib/datadog_api_client/v2/models/widget_search_meta.rb new file mode 100644 index 000000000000..111877dca9c6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/widget_search_meta.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Metadata about the search results. + class WidgetSearchMeta + include BaseGenericModel + + # Total number of widgets created by anyone. + attr_accessor :created_by_anyone_total + + # Total number of widgets created by the current user. + attr_accessor :created_by_you_total + + # Total number of widgets favorited by the current user. + attr_accessor :favorited_by_you_total + + # Total number of widgets matching the current filter criteria. + attr_accessor :filtered_total + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_by_anyone_total' => :'created_by_anyone_total', + :'created_by_you_total' => :'created_by_you_total', + :'favorited_by_you_total' => :'favorited_by_you_total', + :'filtered_total' => :'filtered_total' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_by_anyone_total' => :'Integer', + :'created_by_you_total' => :'Integer', + :'favorited_by_you_total' => :'Integer', + :'filtered_total' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::WidgetSearchMeta` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_by_anyone_total') + self.created_by_anyone_total = attributes[:'created_by_anyone_total'] + end + + if attributes.key?(:'created_by_you_total') + self.created_by_you_total = attributes[:'created_by_you_total'] + end + + if attributes.key?(:'favorited_by_you_total') + self.favorited_by_you_total = attributes[:'favorited_by_you_total'] + end + + if attributes.key?(:'filtered_total') + self.filtered_total = attributes[:'filtered_total'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_by_anyone_total == o.created_by_anyone_total && + created_by_you_total == o.created_by_you_total && + favorited_by_you_total == o.favorited_by_you_total && + filtered_total == o.filtered_total && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_by_anyone_total, created_by_you_total, favorited_by_you_total, filtered_total, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/widget_type.rb b/lib/datadog_api_client/v2/models/widget_type.rb new file mode 100644 index 000000000000..30c827eac988 --- /dev/null +++ b/lib/datadog_api_client/v2/models/widget_type.rb @@ -0,0 +1,41 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Widget types that are allowed to be stored as individual records. + # This is not a complete list of dashboard and notebook widget types. + class WidgetType + include BaseEnumModel + + BAR_CHART = "bar_chart".freeze + CHANGE = "change".freeze + CLOUD_COST_SUMMARY = "cloud_cost_summary".freeze + COHORT = "cohort".freeze + FUNNEL = "funnel".freeze + GEOMAP = "geomap".freeze + LIST_STREAM = "list_stream".freeze + QUERY_TABLE = "query_table".freeze + QUERY_VALUE = "query_value".freeze + RETENTION_CURVE = "retention_curve".freeze + SANKEY = "sankey".freeze + SUNBURST = "sunburst".freeze + TIMESERIES = "timeseries".freeze + TOPLIST = "toplist".freeze + TREEMAP = "treemap".freeze + end +end