diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 34f94ce65a0c..e889415714c2 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -15324,41 +15324,6 @@ 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: @@ -71710,136 +71675,6 @@ 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: @@ -71876,108 +71711,6 @@ 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: @@ -110133,328 +109866,6 @@ 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). @@ -111305,11 +110716,6 @@ 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/cassettes/features/v2/teams/Create-team-connections-returns-Bad-Request-response.frozen b/cassettes/features/v2/teams/Create-team-connections-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..21ac9fa02682 --- /dev/null +++ b/cassettes/features/v2/teams/Create-team-connections-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2026-03-27T09:09:04.870Z \ No newline at end of file diff --git a/cassettes/features/v2/teams/Create-team-connections-returns-Bad-Request-response.yml b/cassettes/features/v2/teams/Create-team-connections-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..b734fc94d612 --- /dev/null +++ b/cassettes/features/v2/teams/Create-team-connections-returns-Bad-Request-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Fri, 27 Mar 2026 09:09:04 GMT + request: + body: + encoding: UTF-8 + string: '{"data":[]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team/connections + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"attribute + \"data\" at least one team connection must be provided"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/teams/Create-team-connections-returns-Conflict-response.frozen b/cassettes/features/v2/teams/Create-team-connections-returns-Conflict-response.frozen new file mode 100644 index 000000000000..e7452b6e7bbf --- /dev/null +++ b/cassettes/features/v2/teams/Create-team-connections-returns-Conflict-response.frozen @@ -0,0 +1 @@ +2026-03-27T09:28:24.368Z \ No newline at end of file diff --git a/cassettes/features/v2/teams/Create-team-connections-returns-Conflict-response.yml b/cassettes/features/v2/teams/Create-team-connections-returns-Conflict-response.yml new file mode 100644 index 000000000000..21359d096a27 --- /dev/null +++ b/cassettes/features/v2/teams/Create-team-connections-returns-Conflict-response.yml @@ -0,0 +1,85 @@ +http_interactions: +- recorded_at: Fri, 27 Mar 2026 09:28:24 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"handle":"test-handle-84ab6777f7201a32","name":"test-name-84ab6777f7201a32"},"type":"team"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"be93b665-0a69-4573-8ef4-56f6a741c1a1","type":"team","attributes":{"avatar":null,"banner":10,"created_at":"2026-03-27T09:28:24.862516+00:00","description":null,"handle":"test-handle-84ab6777f7201a32","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2026-03-27T09:28:24.862516+00:00","name":"test-name-84ab6777f7201a32","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/be93b665-0a69-4573-8ef4-56f6a741c1a1/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/be93b665-0a69-4573-8ef4-56f6a741c1a1/permission-settings"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Fri, 27 Mar 2026 09:28:24 GMT + request: + body: + encoding: UTF-8 + string: '{"data":[{"attributes":{"managed_by":"datadog","source":"github"},"relationships":{"connected_team":{"data":{"id":"@MyGitHubAccount/my-team-name","type":"github_team"}},"team":{"data":{"id":"be93b665-0a69-4573-8ef4-56f6a741c1a1","type":"team"}}},"type":"team_connection"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team/connections + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"4e4b0094-29bf-11f1-aeac-da7ad0900002","type":"team_connection","attributes":{"managed_by":"datadog","source":"github"},"relationships":{"connected_team":{"data":{"id":"@MyGitHubAccount/my-team-name","type":"github_team"}},"team":{"data":{"id":"be93b665-0a69-4573-8ef4-56f6a741c1a1","type":"team"}}}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Fri, 27 Mar 2026 09:28:24 GMT + request: + body: + encoding: UTF-8 + string: '{"data":[{"attributes":{"managed_by":"datadog","source":"github"},"relationships":{"connected_team":{"data":{"id":"@MyGitHubAccount/my-team-name","type":"github_team"}},"team":{"data":{"id":"be93b665-0a69-4573-8ef4-56f6a741c1a1","type":"team"}}},"type":"team_connection"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team/connections + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"409","title":"Conflict","detail":"failed to add + team connections: one or more team attributes already exist"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 409 + message: Conflict +- recorded_at: Fri, 27 Mar 2026 09:28:24 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/be93b665-0a69-4573-8ef4-56f6a741c1a1 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/teams/Create-team-connections-returns-Created-response.frozen b/cassettes/features/v2/teams/Create-team-connections-returns-Created-response.frozen new file mode 100644 index 000000000000..9449f0e0c9e8 --- /dev/null +++ b/cassettes/features/v2/teams/Create-team-connections-returns-Created-response.frozen @@ -0,0 +1 @@ +2026-03-27T09:09:22.678Z \ No newline at end of file diff --git a/cassettes/features/v2/teams/Create-team-connections-returns-Created-response.yml b/cassettes/features/v2/teams/Create-team-connections-returns-Created-response.yml new file mode 100644 index 000000000000..d590ae2d9c5e --- /dev/null +++ b/cassettes/features/v2/teams/Create-team-connections-returns-Created-response.yml @@ -0,0 +1,62 @@ +http_interactions: +- recorded_at: Fri, 27 Mar 2026 09:09:22 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"handle":"test-handle-8d5b9953d168d107","name":"test-name-8d5b9953d168d107"},"type":"team"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"726053a9-9b81-4381-bf91-b96b746f28d9","type":"team","attributes":{"avatar":null,"banner":11,"created_at":"2026-03-27T09:09:23.174349+00:00","description":null,"handle":"test-handle-8d5b9953d168d107","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2026-03-27T09:09:23.174349+00:00","name":"test-name-8d5b9953d168d107","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/726053a9-9b81-4381-bf91-b96b746f28d9/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/726053a9-9b81-4381-bf91-b96b746f28d9/permission-settings"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Fri, 27 Mar 2026 09:09:22 GMT + request: + body: + encoding: UTF-8 + string: '{"data":[{"attributes":{"managed_by":"datadog","source":"github"},"relationships":{"connected_team":{"data":{"id":"@MyGitHubAccount/my-team-name","type":"github_team"}},"team":{"data":{"id":"726053a9-9b81-4381-bf91-b96b746f28d9","type":"team"}}},"type":"team_connection"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team/connections + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"a5c93d48-29bc-11f1-82fc-da7ad0900002","type":"team_connection","attributes":{"managed_by":"datadog","source":"github"},"relationships":{"connected_team":{"data":{"id":"@MyGitHubAccount/my-team-name","type":"github_team"}},"team":{"data":{"id":"726053a9-9b81-4381-bf91-b96b746f28d9","type":"team"}}}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Fri, 27 Mar 2026 09:09:22 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/726053a9-9b81-4381-bf91-b96b746f28d9 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/teams/Delete-team-connections-returns-Bad-Request-response.frozen b/cassettes/features/v2/teams/Delete-team-connections-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..28842d3616d6 --- /dev/null +++ b/cassettes/features/v2/teams/Delete-team-connections-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2026-03-27T09:21:11.529Z \ No newline at end of file diff --git a/cassettes/features/v2/teams/Delete-team-connections-returns-Bad-Request-response.yml b/cassettes/features/v2/teams/Delete-team-connections-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..3f39bdbdc8d7 --- /dev/null +++ b/cassettes/features/v2/teams/Delete-team-connections-returns-Bad-Request-response.yml @@ -0,0 +1,25 @@ +http_interactions: +- recorded_at: Fri, 27 Mar 2026 09:21:11 GMT + request: + body: + encoding: UTF-8 + string: '{"data":[{"id":"","type":"team_connection"}]}' + headers: + Accept: + - '*/*' + Content-Type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/connections + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"attribute + \"id\" one or more team connection ids are not present"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/teams/Delete-team-connections-returns-No-Content-response.frozen b/cassettes/features/v2/teams/Delete-team-connections-returns-No-Content-response.frozen new file mode 100644 index 000000000000..4293cb5276e0 --- /dev/null +++ b/cassettes/features/v2/teams/Delete-team-connections-returns-No-Content-response.frozen @@ -0,0 +1 @@ +2026-03-27T09:21:19.736Z \ No newline at end of file diff --git a/cassettes/features/v2/teams/Delete-team-connections-returns-No-Content-response.yml b/cassettes/features/v2/teams/Delete-team-connections-returns-No-Content-response.yml new file mode 100644 index 000000000000..275fd34e6b15 --- /dev/null +++ b/cassettes/features/v2/teams/Delete-team-connections-returns-No-Content-response.yml @@ -0,0 +1,82 @@ +http_interactions: +- recorded_at: Fri, 27 Mar 2026 09:21:19 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"handle":"test-handle-5e060b20bd1650cf","name":"test-name-5e060b20bd1650cf"},"type":"team"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"250b46bc-90c5-4464-8a8f-bf261f788495","type":"team","attributes":{"avatar":null,"banner":1,"created_at":"2026-03-27T09:21:20.252382+00:00","description":null,"handle":"test-handle-5e060b20bd1650cf","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2026-03-27T09:21:20.252382+00:00","name":"test-name-5e060b20bd1650cf","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/250b46bc-90c5-4464-8a8f-bf261f788495/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/250b46bc-90c5-4464-8a8f-bf261f788495/permission-settings"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Fri, 27 Mar 2026 09:21:19 GMT + request: + body: + encoding: UTF-8 + string: '{"data":[{"attributes":{"managed_by":"datadog","source":"github"},"relationships":{"connected_team":{"data":{"id":"@MyGitHubAccount/my-team-name","type":"github_team"}},"team":{"data":{"id":"250b46bc-90c5-4464-8a8f-bf261f788495","type":"team"}}},"type":"team_connection"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team/connections + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"51323b02-29be-11f1-ad4d-da7ad0900002","type":"team_connection","attributes":{"managed_by":"datadog","source":"github"},"relationships":{"connected_team":{"data":{"id":"@MyGitHubAccount/my-team-name","type":"github_team"}},"team":{"data":{"id":"250b46bc-90c5-4464-8a8f-bf261f788495","type":"team"}}}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Fri, 27 Mar 2026 09:21:19 GMT + request: + body: + encoding: UTF-8 + string: '{"data":[{"id":"51323b02-29be-11f1-ad4d-da7ad0900002","type":"team_connection"}]}' + headers: + Accept: + - '*/*' + Content-Type: + - application/json + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/connections + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Fri, 27 Mar 2026 09:21:19 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/250b46bc-90c5-4464-8a8f-bf261f788495 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/teams/List-team-connections-returns-OK-response.frozen b/cassettes/features/v2/teams/List-team-connections-returns-OK-response.frozen new file mode 100644 index 000000000000..fab573b8b2b8 --- /dev/null +++ b/cassettes/features/v2/teams/List-team-connections-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-03-27T09:09:49.513Z \ No newline at end of file diff --git a/cassettes/features/v2/teams/List-team-connections-returns-OK-response.yml b/cassettes/features/v2/teams/List-team-connections-returns-OK-response.yml new file mode 100644 index 000000000000..b43ac956c2d9 --- /dev/null +++ b/cassettes/features/v2/teams/List-team-connections-returns-OK-response.yml @@ -0,0 +1,80 @@ +http_interactions: +- recorded_at: Fri, 27 Mar 2026 09:09:49 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"handle":"test-handle-48ce99925c887f33","name":"test-name-48ce99925c887f33"},"type":"team"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"f520e86b-5137-461d-b054-5b454d7135c4","type":"team","attributes":{"avatar":null,"banner":4,"created_at":"2026-03-27T09:09:50.012362+00:00","description":null,"handle":"test-handle-48ce99925c887f33","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2026-03-27T09:09:50.012363+00:00","name":"test-name-48ce99925c887f33","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/f520e86b-5137-461d-b054-5b454d7135c4/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/f520e86b-5137-461d-b054-5b454d7135c4/permission-settings"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Fri, 27 Mar 2026 09:09:49 GMT + request: + body: + encoding: UTF-8 + string: '{"data":[{"attributes":{"managed_by":"datadog","source":"github"},"relationships":{"connected_team":{"data":{"id":"@MyGitHubAccount/my-team-name","type":"github_team"}},"team":{"data":{"id":"f520e86b-5137-461d-b054-5b454d7135c4","type":"team"}}},"type":"team_connection"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team/connections + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"b5c56780-29bc-11f1-b3d1-da7ad0900002","type":"team_connection","attributes":{"managed_by":"datadog","source":"github"},"relationships":{"connected_team":{"data":{"id":"@MyGitHubAccount/my-team-name","type":"github_team"}},"team":{"data":{"id":"f520e86b-5137-461d-b054-5b454d7135c4","type":"team"}}}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Fri, 27 Mar 2026 09:09:49 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/team/connections?page%5Bsize%5D=10 + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"52a55816-291e-11f1-be93-da7ad0900002","type":"team_connection","attributes":{"managed_by":"datadog","source":"github"},"relationships":{"connected_team":{"data":{"id":"@MyGitHubAccount/my-team-name","type":"github_team"}},"team":{"data":{"id":"0a81a948-5ee2-4790-b855-8817a21ccf1e","type":"team"}}}},{"id":"52df3810-291e-11f1-b8ea-da7ad0900002","type":"team_connection","attributes":{"managed_by":"datadog","source":"github"},"relationships":{"connected_team":{"data":{"id":"@MyGitHubAccount/my-team-name","type":"github_team"}},"team":{"data":{"id":"a9d786f4-447a-4a3b-9505-882df3f1d7e4","type":"team"}}}},{"id":"53407c2e-291e-11f1-af9c-da7ad0900002","type":"team_connection","attributes":{"managed_by":"datadog","source":"github"},"relationships":{"connected_team":{"data":{"id":"@MyGitHubAccount/my-team-name","type":"github_team"}},"team":{"data":{"id":"48f1089c-a1ee-4039-8b9d-59a512010d89","type":"team"}}}},{"id":"53722ae4-291e-11f1-be97-da7ad0900002","type":"team_connection","attributes":{"managed_by":"datadog","source":"github"},"relationships":{"connected_team":{"data":{"id":"@MyGitHubAccount/my-team-name","type":"github_team"}},"team":{"data":{"id":"27c3acd0-4eeb-459c-9dbf-2f61263c8387","type":"team"}}}},{"id":"4f642338-28f8-11f1-8cc3-da7ad0900002","type":"team_connection","attributes":{"managed_by":"datadog","source":"github"},"relationships":{"connected_team":{"data":{"id":"@MyGitHubAccount/my-team-name","type":"github_team"}},"team":{"data":{"id":"52b98022-50b0-42b5-8d59-f8f8a809027e","type":"team"}}}},{"id":"b5c56780-29bc-11f1-b3d1-da7ad0900002","type":"team_connection","attributes":{"managed_by":"datadog","source":"github"},"relationships":{"connected_team":{"data":{"id":"@MyGitHubAccount/my-team-name","type":"github_team"}},"team":{"data":{"id":"f520e86b-5137-461d-b054-5b454d7135c4","type":"team"}}}}],"meta":{"page":{"type":"number_size","number":0,"size":10,"total":6,"first_number":0,"prev_number":null,"next_number":null,"last_number":0}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Fri, 27 Mar 2026 09:09:49 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/f520e86b-5137-461d-b054-5b454d7135c4 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/teams/List-team-connections-with-filters-returns-OK-response.frozen b/cassettes/features/v2/teams/List-team-connections-with-filters-returns-OK-response.frozen new file mode 100644 index 000000000000..e6d33b39e880 --- /dev/null +++ b/cassettes/features/v2/teams/List-team-connections-with-filters-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-03-27T09:09:58.847Z \ No newline at end of file diff --git a/cassettes/features/v2/teams/List-team-connections-with-filters-returns-OK-response.yml b/cassettes/features/v2/teams/List-team-connections-with-filters-returns-OK-response.yml new file mode 100644 index 000000000000..17baea7d865d --- /dev/null +++ b/cassettes/features/v2/teams/List-team-connections-with-filters-returns-OK-response.yml @@ -0,0 +1,80 @@ +http_interactions: +- recorded_at: Fri, 27 Mar 2026 09:09:58 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"handle":"test-handle-fa25cb1eef560458","name":"test-name-fa25cb1eef560458"},"type":"team"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"d7ee1319-6ac0-45c6-8700-079e58eac9f9","type":"team","attributes":{"avatar":null,"banner":1,"created_at":"2026-03-27T09:09:59.338935+00:00","description":null,"handle":"test-handle-fa25cb1eef560458","hidden_modules":null,"is_managed":false,"link_count":0,"modified_at":"2026-03-27T09:09:59.338935+00:00","name":"test-name-fa25cb1eef560458","summary":null,"user_count":0,"visible_modules":null},"relationships":{"team_links":{"data":[],"links":{"related":"/api/v2/team/d7ee1319-6ac0-45c6-8700-079e58eac9f9/links"}},"user_team_permissions":{"data":null,"links":{"related":"/api/v2/team/d7ee1319-6ac0-45c6-8700-079e58eac9f9/permission-settings"}}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Fri, 27 Mar 2026 09:09:58 GMT + request: + body: + encoding: UTF-8 + string: '{"data":[{"attributes":{"managed_by":"datadog","source":"github"},"relationships":{"connected_team":{"data":{"id":"@MyGitHubAccount/my-team-name","type":"github_team"}},"team":{"data":{"id":"d7ee1319-6ac0-45c6-8700-079e58eac9f9","type":"team"}}},"type":"team_connection"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/team/connections + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"bb57db2e-29bc-11f1-bcee-da7ad0900002","type":"team_connection","attributes":{"managed_by":"datadog","source":"github"},"relationships":{"connected_team":{"data":{"id":"@MyGitHubAccount/my-team-name","type":"github_team"}},"team":{"data":{"id":"d7ee1319-6ac0-45c6-8700-079e58eac9f9","type":"team"}}}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Fri, 27 Mar 2026 09:09:58 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/team/connections?filter%5Bsources%5D=github&page%5Bsize%5D=10 + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"52a55816-291e-11f1-be93-da7ad0900002","type":"team_connection","attributes":{"managed_by":"datadog","source":"github"},"relationships":{"connected_team":{"data":{"id":"@MyGitHubAccount/my-team-name","type":"github_team"}},"team":{"data":{"id":"0a81a948-5ee2-4790-b855-8817a21ccf1e","type":"team"}}}},{"id":"52df3810-291e-11f1-b8ea-da7ad0900002","type":"team_connection","attributes":{"managed_by":"datadog","source":"github"},"relationships":{"connected_team":{"data":{"id":"@MyGitHubAccount/my-team-name","type":"github_team"}},"team":{"data":{"id":"a9d786f4-447a-4a3b-9505-882df3f1d7e4","type":"team"}}}},{"id":"53407c2e-291e-11f1-af9c-da7ad0900002","type":"team_connection","attributes":{"managed_by":"datadog","source":"github"},"relationships":{"connected_team":{"data":{"id":"@MyGitHubAccount/my-team-name","type":"github_team"}},"team":{"data":{"id":"48f1089c-a1ee-4039-8b9d-59a512010d89","type":"team"}}}},{"id":"53722ae4-291e-11f1-be97-da7ad0900002","type":"team_connection","attributes":{"managed_by":"datadog","source":"github"},"relationships":{"connected_team":{"data":{"id":"@MyGitHubAccount/my-team-name","type":"github_team"}},"team":{"data":{"id":"27c3acd0-4eeb-459c-9dbf-2f61263c8387","type":"team"}}}},{"id":"4f642338-28f8-11f1-8cc3-da7ad0900002","type":"team_connection","attributes":{"managed_by":"datadog","source":"github"},"relationships":{"connected_team":{"data":{"id":"@MyGitHubAccount/my-team-name","type":"github_team"}},"team":{"data":{"id":"52b98022-50b0-42b5-8d59-f8f8a809027e","type":"team"}}}},{"id":"bb57db2e-29bc-11f1-bcee-da7ad0900002","type":"team_connection","attributes":{"managed_by":"datadog","source":"github"},"relationships":{"connected_team":{"data":{"id":"@MyGitHubAccount/my-team-name","type":"github_team"}},"team":{"data":{"id":"d7ee1319-6ac0-45c6-8700-079e58eac9f9","type":"team"}}}}],"meta":{"page":{"type":"number_size","number":0,"size":10,"total":6,"first_number":0,"prev_number":null,"next_number":null,"last_number":0}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Fri, 27 Mar 2026 09:09:58 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/team/d7ee1319-6ac0-45c6-8700-079e58eac9f9 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/examples/v2/teams/CreateTeamConnections.rb b/examples/v2/teams/CreateTeamConnections.rb index 1a498252fd7c..761ccfb2ff74 100644 --- a/examples/v2/teams/CreateTeamConnections.rb +++ b/examples/v2/teams/CreateTeamConnections.rb @@ -1,9 +1,6 @@ # Create team connections returns "Created" response require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.create_team_connections".to_sym] = true -end api_instance = DatadogAPIClient::V2::TeamsAPI.new # there is a valid "dd_team" in the system diff --git a/examples/v2/teams/DeleteTeamConnections.rb b/examples/v2/teams/DeleteTeamConnections.rb index ed3b589bd296..dd62de92f20d 100644 --- a/examples/v2/teams/DeleteTeamConnections.rb +++ b/examples/v2/teams/DeleteTeamConnections.rb @@ -3,10 +3,13 @@ require "datadog_api_client" api_instance = DatadogAPIClient::V2::TeamsAPI.new +# there is a valid "team_connection" in the system +TEAM_CONNECTION_ID = ENV["TEAM_CONNECTION_ID"] + body = DatadogAPIClient::V2::TeamConnectionDeleteRequest.new({ data: [ DatadogAPIClient::V2::TeamConnectionDeleteRequestDataItem.new({ - id: "12345678-1234-5678-9abc-123456789012", + id: TEAM_CONNECTION_ID, type: DatadogAPIClient::V2::TeamConnectionType::TEAM_CONNECTION, }), ], diff --git a/examples/v2/teams/ListTeamConnections.rb b/examples/v2/teams/ListTeamConnections.rb index d984ab32b850..098a1d6aa4fa 100644 --- a/examples/v2/teams/ListTeamConnections.rb +++ b/examples/v2/teams/ListTeamConnections.rb @@ -2,4 +2,7 @@ require "datadog_api_client" api_instance = DatadogAPIClient::V2::TeamsAPI.new -p api_instance.list_team_connections() +opts = { + page_size: 10, +} +p api_instance.list_team_connections(opts) diff --git a/examples/v2/teams/ListTeamConnections_1473516764.rb b/examples/v2/teams/ListTeamConnections_1473516764.rb index 94ca072c4bbf..5cc1bba228fd 100644 --- a/examples/v2/teams/ListTeamConnections_1473516764.rb +++ b/examples/v2/teams/ListTeamConnections_1473516764.rb @@ -1,9 +1,6 @@ # List team connections with filters returns "OK" response require "datadog_api_client" -DatadogAPIClient.configure do |config| - config.unstable_operations["v2.list_team_connections".to_sym] = true -end api_instance = DatadogAPIClient::V2::TeamsAPI.new opts = { filter_sources: [ diff --git a/examples/v2/widgets/CreateWidget.rb b/examples/v2/widgets/CreateWidget.rb deleted file mode 100644 index 5ba0ba9beadd..000000000000 --- a/examples/v2/widgets/CreateWidget.rb +++ /dev/null @@ -1,18 +0,0 @@ -# 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 deleted file mode 100644 index 705052ca3082..000000000000 --- a/examples/v2/widgets/DeleteWidget.rb +++ /dev/null @@ -1,5 +0,0 @@ -# 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 deleted file mode 100644 index 325cd38a6590..000000000000 --- a/examples/v2/widgets/GetWidget.rb +++ /dev/null @@ -1,5 +0,0 @@ -# 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 deleted file mode 100644 index 64fd833bd1c9..000000000000 --- a/examples/v2/widgets/SearchWidgets.rb +++ /dev/null @@ -1,5 +0,0 @@ -# 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 deleted file mode 100644 index d4216c0990fb..000000000000 --- a/examples/v2/widgets/UpdateWidget.rb +++ /dev/null @@ -1,18 +0,0 @@ -# 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 813fdd824fe4..d0609933ade5 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -4164,34 +4164,6 @@ "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/given.json b/features/v2/given.json index 2fee80e2ff9e..6c42beffa17f 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -1388,7 +1388,13 @@ "operationId": "AddTeamHierarchyLink" }, { - "source": "data.data[0]", + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": [{\n \"type\": \"team_connection\",\n \"attributes\": {\n \"source\": \"github\",\n \"managed_by\": \"datadog\"\n },\n \"relationships\": {\n \"team\": {\n \"data\": {\n \"id\": \"{{ dd_team.data.id }}\",\n \"type\": \"team\"\n }\n },\n \"connected_team\": {\n \"data\": {\n \"id\": \"@MyGitHubAccount/my-team-name\",\n \"type\": \"github_team\"\n }\n }\n }\n }]\n}" + } + ], + "source": "data[0]", "step": "there is a valid \"team_connection\" in the system", "key": "team_connection", "tag": "Teams", diff --git a/features/v2/teams.feature b/features/v2/teams.feature index 50f7f314684d..c24ced9ffbf1 100644 --- a/features/v2/teams.feature +++ b/features/v2/teams.feature @@ -118,34 +118,34 @@ Feature: Teams And the response "data.attributes.hidden_modules" has length 1 And the response "data.attributes.hidden_modules" array contains value "m3" - @skip @team:DataDog/aaa-omg + @team:DataDog/aaa-omg Scenario: Create team connections returns "Bad Request" response - Given operation "CreateTeamConnections" enabled - And new "CreateTeamConnections" request - And body with value {"data": [{"attributes": {"source": "github"}, "relationships": {"connected_team": {"data": {"id": "@MyGitHubAccount/my-team-name", "type": "github_team"}}, "team": {"data": {"type": "team"}}}, "type": "team_connection"}]} + Given new "CreateTeamConnections" request + And body with value {"data": []} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/aaa-omg + @team:DataDog/aaa-omg Scenario: Create team connections returns "Conflict" response Given new "CreateTeamConnections" request - And body with value {"data": [{"attributes": {"managed_by": "github_sync", "source": "github"}, "relationships": {"connected_team": {"data": {"id": "@GitHubOrg/team-handle", "type": "github_team"}}, "team": {"data": {"id": "87654321-4321-8765-dcba-210987654321", "type": "team"}}}, "type": "team_connection"}]} + And there is a valid "dd_team" in the system + And there is a valid "team_connection" in the system + And body with value {"data": [{"attributes": {"source": "github", "managed_by": "datadog"}, "relationships": {"connected_team": {"data": {"id": "{{ team_connection.relationships.connected_team.data.id }}", "type": "github_team"}}, "team": {"data": {"id": "{{ dd_team.data.id }}", "type": "team"}}}, "type": "team_connection"}]} When the request is sent Then the response status is 409 Conflict - @skip @team:DataDog/aaa-omg + @team:DataDog/aaa-omg Scenario: Create team connections returns "Created" response - Given operation "CreateTeamConnections" enabled - And new "CreateTeamConnections" request + Given new "CreateTeamConnections" request And there is a valid "dd_team" in the system And body with value {"data": [{"type": "team_connection", "attributes": {"source": "github", "managed_by": "datadog"}, "relationships": {"team": {"data": {"id": "{{ dd_team.data.id }}", "type": "team"}}, "connected_team": {"data": {"id": "@MyGitHubAccount/my-team-name", "type": "github_team"}}}}]} When the request is sent Then the response status is 201 Created - And the response "data.data[0].attributes.source" is equal to "github" - And the response "data.data[0].attributes.managed_by" is equal to "datadog" - And the response "data.data[0].relationships.team.data.id" is equal to "{{ dd_team.data.id }}" - And the response "data.data[0].relationships.connected_team.data.id" is equal to "@MyGitHubAccount/my-team-name" - And the response "data.data[0].type" is equal to "team_connection" + And the response "data[0].attributes.source" is equal to "github" + And the response "data[0].attributes.managed_by" is equal to "datadog" + And the response "data[0].relationships.team.data.id" is equal to "{{ dd_team.data.id }}" + And the response "data[0].relationships.connected_team.data.id" is equal to "@MyGitHubAccount/my-team-name" + And the response "data[0].type" is equal to "team_connection" @team:DataDog/aaa-omg Scenario: Create team notification rule returns "API error response." response @@ -166,25 +166,26 @@ Feature: Teams When the request is sent Then the response status is 201 Created - @skip @team:DataDog/aaa-omg + @team:DataDog/aaa-omg Scenario: Delete team connections returns "Bad Request" response - Given operation "DeleteTeamConnections" enabled - And new "DeleteTeamConnections" request - And body with value {"data": [{"type": "team_connection"}]} + Given new "DeleteTeamConnections" request + And body with value {"data": [{"id": "", "type": "team_connection"}]} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/aaa-omg + @team:DataDog/aaa-omg Scenario: Delete team connections returns "No Content" response Given new "DeleteTeamConnections" request - And body with value {"data": [{"id": "12345678-1234-5678-9abc-123456789012", "type": "team_connection"}]} + And there is a valid "dd_team" in the system + And there is a valid "team_connection" in the system + And body with value {"data": [{"id": "{{ team_connection.id }}", "type": "team_connection"}]} When the request is sent Then the response status is 204 No Content - @generated @skip @team:DataDog/aaa-omg + @skip @team:DataDog/aaa-omg Scenario: Delete team connections returns "Not Found" response Given new "DeleteTeamConnections" request - And body with value {"data": [{"id": "12345678-1234-5678-9abc-123456789012", "type": "team_connection"}]} + And body with value {"data": [{"id": "00000000-0000-dead-beef-000000000000", "type": "team_connection"}]} When the request is sent Then the response status is 404 Not Found @@ -474,9 +475,12 @@ Feature: Teams When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/aaa-omg + @team:DataDog/aaa-omg Scenario: List team connections returns "OK" response Given new "ListTeamConnections" request + And there is a valid "dd_team" in the system + And there is a valid "team_connection" in the system + And request contains "page[size]" parameter with value 10 When the request is sent Then the response status is 200 OK @@ -486,10 +490,11 @@ Feature: Teams When the request with pagination is sent Then the response status is 200 OK - @skip @team:DataDog/aaa-omg + @team:DataDog/aaa-omg Scenario: List team connections with filters returns "OK" response - Given operation "ListTeamConnections" enabled - And new "ListTeamConnections" request + Given new "ListTeamConnections" request + And there is a valid "dd_team" in the system + And there is a valid "team_connection" in the system And request contains "filter[sources]" parameter with value ["github"] And request contains "page[size]" parameter with value 10 When the request is sent diff --git a/features/v2/undo.json b/features/v2/undo.json index ed1ec823bd31..67596e3589cb 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -6008,8 +6008,7 @@ "CreateTeamConnections": { "tag": "Teams", "undo": { - "operationId": "DeleteTeamConnections", - "type": "unsafe" + "type": "safe" } }, "GetTeamSync": { @@ -6357,47 +6356,6 @@ "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 deleted file mode 100644 index 54b015711565..000000000000 --- a/features/v2/widgets.feature +++ /dev/null @@ -1,115 +0,0 @@ -@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 843319dad420..ab346bc663c0 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1948,9 +1948,6 @@ 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", @@ -5668,20 +5665,7 @@ 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", @@ -5845,7 +5829,6 @@ 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/widgets_api.rb b/lib/datadog_api_client/v2/api/widgets_api.rb deleted file mode 100644 index 14c104504fa5..000000000000 --- a/lib/datadog_api_client/v2/api/widgets_api.rb +++ /dev/null @@ -1,431 +0,0 @@ -=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 deleted file mode 100644 index e390a9414085..000000000000 --- a/lib/datadog_api_client/v2/models/create_or_update_widget_request.rb +++ /dev/null @@ -1,123 +0,0 @@ -=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 deleted file mode 100644 index 610a72966563..000000000000 --- a/lib/datadog_api_client/v2/models/create_or_update_widget_request_attributes.rb +++ /dev/null @@ -1,143 +0,0 @@ -=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 deleted file mode 100644 index 99303dfd64e9..000000000000 --- a/lib/datadog_api_client/v2/models/create_or_update_widget_request_data.rb +++ /dev/null @@ -1,144 +0,0 @@ -=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/widget_attributes.rb b/lib/datadog_api_client/v2/models/widget_attributes.rb deleted file mode 100644 index af559edf326d..000000000000 --- a/lib/datadog_api_client/v2/models/widget_attributes.rb +++ /dev/null @@ -1,206 +0,0 @@ -=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 deleted file mode 100644 index a8f8444d27df..000000000000 --- a/lib/datadog_api_client/v2/models/widget_data.rb +++ /dev/null @@ -1,175 +0,0 @@ -=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 deleted file mode 100644 index 052cd1967e93..000000000000 --- a/lib/datadog_api_client/v2/models/widget_definition.rb +++ /dev/null @@ -1,153 +0,0 @@ -=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 deleted file mode 100644 index 486817d6d94f..000000000000 --- a/lib/datadog_api_client/v2/models/widget_experience_type.rb +++ /dev/null @@ -1,29 +0,0 @@ -=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 deleted file mode 100644 index 8bebb2f96f21..000000000000 --- a/lib/datadog_api_client/v2/models/widget_included_user.rb +++ /dev/null @@ -1,154 +0,0 @@ -=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 deleted file mode 100644 index ef59859ff741..000000000000 --- a/lib/datadog_api_client/v2/models/widget_included_user_attributes.rb +++ /dev/null @@ -1,123 +0,0 @@ -=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 deleted file mode 100644 index f3e74f8790d4..000000000000 --- a/lib/datadog_api_client/v2/models/widget_list_response.rb +++ /dev/null @@ -1,147 +0,0 @@ -=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 deleted file mode 100644 index 040e428d16ce..000000000000 --- a/lib/datadog_api_client/v2/models/widget_relationship_data.rb +++ /dev/null @@ -1,144 +0,0 @@ -=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 deleted file mode 100644 index e5a0b260d15a..000000000000 --- a/lib/datadog_api_client/v2/models/widget_relationship_item.rb +++ /dev/null @@ -1,105 +0,0 @@ -=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 deleted file mode 100644 index 8322ed087639..000000000000 --- a/lib/datadog_api_client/v2/models/widget_relationships.rb +++ /dev/null @@ -1,115 +0,0 @@ -=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 deleted file mode 100644 index 498546b4623b..000000000000 --- a/lib/datadog_api_client/v2/models/widget_response.rb +++ /dev/null @@ -1,135 +0,0 @@ -=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 deleted file mode 100644 index 111877dca9c6..000000000000 --- a/lib/datadog_api_client/v2/models/widget_search_meta.rb +++ /dev/null @@ -1,135 +0,0 @@ -=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 deleted file mode 100644 index 30c827eac988..000000000000 --- a/lib/datadog_api_client/v2/models/widget_type.rb +++ /dev/null @@ -1,41 +0,0 @@ -=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