diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a8908359f48..afaf75af0f7 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -18223,6 +18223,310 @@ components: $ref: '#/components/schemas/DashboardListItemResponse' type: array type: object + DashboardSearchAggregationBucketKey: + description: Aggregation bucket with a single key value. + properties: + count: + description: Number of results in this bucket. + example: 18 + format: int64 + type: integer + value: + description: Key value for this bucket. + example: team:dashboards-backend + type: string + required: + - count + - value + type: object + DashboardSearchAggregationBucketMultiKey: + description: Aggregation bucket with multiple key values. + properties: + count: + description: Number of results in this bucket. + example: 8 + format: int64 + type: integer + value: + description: Key values for this bucket. + example: + - David Leonard + - david.leonard@datadoghq.com + items: + type: string + type: array + required: + - count + - value + type: object + DashboardSearchAggregations: + description: Aggregations of dashboard search results. + properties: + author: + description: Aggregation by author. + items: + $ref: '#/components/schemas/DashboardSearchAggregationBucketMultiKey' + type: array + is_shared: + description: Aggregation by share status. + items: + $ref: '#/components/schemas/DashboardSearchAggregationBucketKey' + type: array + share_type: + description: Aggregation by share type. + items: + $ref: '#/components/schemas/DashboardSearchAggregationBucketKey' + type: array + shared_by.handle: + description: Aggregation by who shared the dashboard. + items: + $ref: '#/components/schemas/DashboardSearchAggregationBucketKey' + type: array + status: + description: Aggregation by status. + items: + $ref: '#/components/schemas/DashboardSearchAggregationBucketKey' + type: array + tags: + description: Aggregation by tags. + items: + $ref: '#/components/schemas/DashboardSearchAggregationBucketKey' + type: array + template_variables.name: + description: Aggregation by template variable names. + items: + $ref: '#/components/schemas/DashboardSearchAggregationBucketKey' + type: array + type: + description: Aggregation by dashboard type. + items: + $ref: '#/components/schemas/DashboardSearchAggregationBucketKey' + type: array + widgets.metrics: + description: Aggregation by widget metrics. + items: + $ref: '#/components/schemas/DashboardSearchAggregationBucketKey' + type: array + widgets.type: + description: Aggregation by widget type. + items: + $ref: '#/components/schemas/DashboardSearchAggregationBucketKey' + type: array + type: object + DashboardSearchAttributes: + description: Dashboard search result attributes. + properties: + tags: + description: List of tags for the dashboard. + example: + - team:dashboards-backend + items: + type: string + type: array + title: + description: Title of the dashboard. + example: Public Dashboard Metadata caching + type: string + required: + - tags + - title + type: object + DashboardSearchMetadata: + description: Metadata about the dashboard. + properties: + author: + $ref: '#/components/schemas/DashboardSearchUser' + created_at: + description: Time at which the dashboard was created. + example: '2021-10-28T19:10:04.601117Z' + format: date-time + type: string + deleted_at: + description: Time at which the dashboard was deleted, or null if not deleted. + example: null + format: date-time + nullable: true + type: string + embeddable_domains: + description: List of domains the dashboard is allowed to be embedded in. + example: null + items: + type: string + nullable: true + type: array + experience_type: + description: Dashboard experience type. + example: default + type: string + expiration: + description: When the public dashboard link will expire. + example: null + format: date-time + nullable: true + type: string + has_monitors: + description: Whether the dashboard has monitors. + example: null + nullable: true + type: boolean + is_favorited: + description: Whether the dashboard is favorited by the user. + example: false + type: boolean + is_public_dashboard_ownerless: + description: Whether the public dashboard owner is deactivated. + example: false + type: boolean + is_shared: + description: Whether the dashboard is shared publicly. + example: true + type: boolean + last_accessed: + description: Last time the dashboard was accessed. + example: null + format: date-time + nullable: true + type: string + modified_at: + description: Time at which the dashboard was last updated. + example: '2024-02-16T12:43:31.942554Z' + format: date-time + type: string + popularity: + description: Relative measure of dashboard popularity. + example: 0 + format: double + type: number + public_title: + description: Published title of the public dashboard. + example: Public Dashboard Metadata caching + type: string + quality_score: + description: Quality score of the dashboard. + example: null + format: double + nullable: true + type: number + share_list: + description: List of email addresses for invite-only public dashboards. + example: [] + items: + type: string + nullable: true + type: array + share_type: + description: Share type of the public dashboard. + example: invite + type: string + shared_by: + $ref: '#/components/schemas/DashboardSearchUser' + status: + description: Status of the public dashboard. + example: active + type: string + token: + description: Unique public dashboard token. + example: yB5yjZ-f0d1a5802e21f5576f5e34feb9cddc4c + type: string + type: + description: Dashboard type. + example: custom_timeboard + type: string + url: + description: URL path to the dashboard. + example: /dashboard/e8y-qtx-r3w/public-dashboard-metadata-caching + type: string + widget_count: + description: Number of widgets in the dashboard. + example: 1 + format: int64 + type: integer + required: + - author + - created_at + - deleted_at + - is_favorited + - is_shared + - modified_at + - popularity + - quality_score + - has_monitors + - type + - url + - experience_type + - widget_count + - public_title + - shared_by + - is_public_dashboard_ownerless + - share_type + - share_list + - embeddable_domains + - last_accessed + - expiration + - status + - token + type: object + DashboardSearchResponse: + description: Response containing dashboard search results. + properties: + data: + description: List of dashboard search results. + items: + $ref: '#/components/schemas/DashboardSearchResultData' + type: array + meta: + $ref: '#/components/schemas/DashboardSearchResponseMeta' + required: + - data + - meta + type: object + DashboardSearchResponseMeta: + description: Metadata about the dashboard search results. + properties: + aggregations: + $ref: '#/components/schemas/DashboardSearchAggregations' + total: + description: Total number of dashboards found. + example: 18 + format: int64 + type: integer + required: + - total + type: object + DashboardSearchResultData: + description: A dashboard search result. + properties: + attributes: + $ref: '#/components/schemas/DashboardSearchAttributes' + id: + description: Dashboard identifier. + example: e8y-qtx-r3w + type: string + meta: + $ref: '#/components/schemas/DashboardSearchMetadata' + type: + $ref: '#/components/schemas/MetricDashboardType' + required: + - id + - type + - attributes + - meta + type: object + DashboardSearchUser: + description: User information. + properties: + handle: + description: User handle or email. + example: david.leonard@datadoghq.com + type: string + name: + description: User display name. + example: David Leonard + type: string + required: + - handle + - name + type: object DashboardTriggerWrapper: description: Schema for a Dashboard-based trigger. properties: @@ -37764,6 +38068,235 @@ components: meta: $ref: '#/components/schemas/MonthlyCostAttributionMeta' type: object + NotebookSearchAggregationBucketKey: + description: Aggregation bucket with a single key value. + properties: + count: + description: Number of results in this bucket. + example: 10 + format: int64 + type: integer + value: + description: Key value for this bucket. + example: team:notebooks-backend + type: string + required: + - count + - value + type: object + NotebookSearchAggregationBucketMultiKey: + description: Aggregation bucket with multiple key values. + properties: + count: + description: Number of results in this bucket. + example: 5 + format: int64 + type: integer + value: + description: Key values for this bucket. + example: + - User Name + - user@datadoghq.com + items: + type: string + type: array + required: + - count + - value + type: object + NotebookSearchAggregations: + description: Aggregations of notebook search results. + properties: + author: + description: Aggregation by author. + items: + $ref: '#/components/schemas/NotebookSearchAggregationBucketMultiKey' + type: array + tags: + description: Aggregation by tags. + items: + $ref: '#/components/schemas/NotebookSearchAggregationBucketKey' + type: array + template_variables.name: + description: Aggregation by template variable names. + items: + $ref: '#/components/schemas/NotebookSearchAggregationBucketKey' + type: array + type: + description: Aggregation by notebook type. + items: + $ref: '#/components/schemas/NotebookSearchAggregationBucketKey' + type: array + type: object + NotebookSearchAttributes: + description: Notebook search result attributes. + properties: + meta: + $ref: '#/components/schemas/NotebookSearchMetadata' + name: + description: Name of the notebook. + example: My Notebook + type: string + tags: + description: List of tags for the notebook. + example: + - team:notebooks-backend + items: + type: string + type: array + required: + - name + - tags + - meta + type: object + NotebookSearchHighlight: + description: Highlighted fields from the notebook search. + properties: + cells.text: + description: Highlighted cell text matches. + items: + type: string + type: array + cells.title: + description: Highlighted cell title matches. + items: + type: string + type: array + name: + description: Highlighted notebook name matches. + items: + type: string + type: array + type: object + NotebookSearchMetadata: + description: Metadata about the notebook. + properties: + author: + $ref: '#/components/schemas/NotebookSearchUser' + cell_count: + description: Number of cells in the notebook. + example: 5 + format: int64 + type: integer + created_at: + description: Time at which the notebook was created. + example: '2021-10-28T19:10:04.601117Z' + format: date-time + type: string + deleted_at: + description: Time at which the notebook was deleted, or null if not deleted. + example: null + format: date-time + nullable: true + type: string + experience_type: + description: Experience type of the notebook. + example: null + nullable: true + type: string + has_computational_cells: + description: Whether the notebook has computational cells. + example: false + type: boolean + is_favorited: + description: Whether the notebook is favorited by the user. + example: false + type: boolean + is_template: + description: Whether the notebook is a template. + example: false + type: boolean + modified_at: + description: Time at which the notebook was last updated. + example: '2024-02-16T12:43:31.942554Z' + format: date-time + type: string + status: + description: Status of the notebook. + example: published + type: string + take_snapshots: + description: Whether the notebook can take a snapshot. + example: false + type: boolean + type: + description: Notebook type. + example: notebook + type: string + required: + - author + - cell_count + - created_at + - deleted_at + - is_favorited + - is_template + - modified_at + - status + - take_snapshots + - type + - has_computational_cells + - experience_type + type: object + NotebookSearchResponse: + description: Response containing notebook search results. + properties: + data: + description: List of notebook search results. + items: + $ref: '#/components/schemas/NotebookSearchResultData' + type: array + meta: + $ref: '#/components/schemas/NotebookSearchResponseMeta' + required: + - data + - meta + type: object + NotebookSearchResponseMeta: + description: Metadata about the notebook search results. + properties: + aggregations: + $ref: '#/components/schemas/NotebookSearchAggregations' + total: + description: Total number of notebooks found. + example: 25 + format: int64 + type: integer + required: + - total + type: object + NotebookSearchResultData: + description: A notebook search result. + properties: + highlight: + $ref: '#/components/schemas/NotebookSearchHighlight' + id: + description: Notebook identifier. + example: '123456' + type: string + notebook_data: + $ref: '#/components/schemas/NotebookSearchAttributes' + type: + $ref: '#/components/schemas/MetricNotebookType' + required: + - id + - type + - notebook_data + type: object + NotebookSearchUser: + description: User information. + properties: + handle: + description: User handle or email. + example: user@datadoghq.com + type: string + name: + description: User display name. + example: User Name + type: string + required: + - handle + - name + type: object NotebookTriggerWrapper: description: Schema for a Notebook-based trigger. properties: @@ -75312,6 +75845,73 @@ paths: tags: - Dashboard Lists x-codegen-request-body-name: body + /api/v2/dashboards/search: + get: + description: Search for dashboards using a query string. + operationId: SearchDashboards + parameters: + - description: Search query string. + in: query + name: query + required: false + schema: + example: team:dashboards-backend + type: string + - description: Sort field for results. + in: query + name: sort + required: false + schema: + example: metadata.created_at + type: string + - description: Additional data to include in the response. + in: query + name: include + required: false + schema: + example: meta.aggregations + type: string + - description: Page number for pagination. + in: query + name: page + required: false + schema: + example: 0 + type: integer + - description: Maximum number of results to return. + in: query + name: limit + required: false + schema: + example: 10 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DashboardSearchResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Service Unavailable + summary: Search dashboards + tags: + - Dashboards + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/datasets: get: description: Get all datasets that have been configured for an organization. @@ -85387,6 +85987,79 @@ paths: summary: Get all aggregated DNS traffic tags: - Cloud Network Monitoring + /api/v2/notebooks/search: + get: + description: Search for notebooks using a query string. + operationId: SearchNotebooks + parameters: + - description: Search query string. + in: query + name: query + required: false + schema: + example: team:notebooks-backend + type: string + - description: Sort field for results. + in: query + name: sort + required: false + schema: + example: metadata.created_at + type: string + - description: Additional data to include in the response. + in: query + name: include + required: false + schema: + example: meta.aggregations + type: string + - description: Page number for pagination. + in: query + name: page + required: false + schema: + example: 0 + type: integer + - description: Maximum number of results to return. + in: query + name: limit + required: false + schema: + example: 10 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/NotebookSearchResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad Request + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Internal Server Error + '503': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Service Unavailable + summary: Search notebooks + tags: + - Notebooks + x-unstable: '**Note**: This endpoint is in preview and is subject to change. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/obs-pipelines/pipelines: get: description: Retrieve a list of pipelines. @@ -102442,6 +103115,9 @@ tags: organization.' name: Dashboard Lists +- description: Interact with your dashboards through the API to search and retrieve + dashboards. + name: Dashboards - description: The Data Deletion API allows the user to target and delete data from the allowed products. It's currently enabled for Logs and RUM and depends on `logs_delete_data` and `rum_delete_data` permissions respectively. @@ -102686,6 +103362,9 @@ tags: and their attributes. See the [Network Device Monitoring page](https://docs.datadoghq.com/network_monitoring/) for more information. name: Network Device Monitoring +- description: Interact with your notebooks through the API to search and retrieve + notebooks. + name: Notebooks - description: Auto-generated tag OCI Integration name: OCI Integration - description: Observability Pipelines allows you to collect and process logs within diff --git a/examples/v2/dashboards/SearchDashboards.rb b/examples/v2/dashboards/SearchDashboards.rb new file mode 100644 index 00000000000..ff549e2c15b --- /dev/null +++ b/examples/v2/dashboards/SearchDashboards.rb @@ -0,0 +1,8 @@ +# Search dashboards returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.search_dashboards".to_sym] = true +end +api_instance = DatadogAPIClient::V2::DashboardsAPI.new +p api_instance.search_dashboards() diff --git a/examples/v2/notebooks/SearchNotebooks.rb b/examples/v2/notebooks/SearchNotebooks.rb new file mode 100644 index 00000000000..0a51eae7966 --- /dev/null +++ b/examples/v2/notebooks/SearchNotebooks.rb @@ -0,0 +1,8 @@ +# Search notebooks returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.search_notebooks".to_sym] = true +end +api_instance = DatadogAPIClient::V2::NotebooksAPI.new +p api_instance.search_notebooks() diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index f9f955f3192..d68ad89638e 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1932,6 +1932,13 @@ "dashboard_list_id" => "Integer", "body" => "DashboardListUpdateItemsRequest", }, + "v2.SearchDashboards" => { + "query" => "String", + "sort" => "String", + "include" => "String", + "page" => "Integer", + "limit" => "Integer", + }, "v2.CreateDataset" => { "body" => "DatasetCreateRequest", }, @@ -2773,6 +2780,13 @@ "tags" => "String", "limit" => "Integer", }, + "v2.SearchNotebooks" => { + "query" => "String", + "sort" => "String", + "include" => "String", + "page" => "Integer", + "limit" => "Integer", + }, "v2.ListPipelines" => { "page_size" => "Integer", "page_number" => "Integer", diff --git a/features/v2/dashboards.feature b/features/v2/dashboards.feature new file mode 100644 index 00000000000..8601f547e95 --- /dev/null +++ b/features/v2/dashboards.feature @@ -0,0 +1,21 @@ +@endpoint(dashboards) @endpoint(dashboards-v2) +Feature: Dashboards + Interact with your dashboards through the API to search and retrieve + dashboards. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "Dashboards" API + And operation "SearchDashboards" enabled + And new "SearchDashboards" request + + @generated @skip @team:DataDog/notebooks-backend + Scenario: Search dashboards returns "Bad Request" response + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/notebooks-backend + Scenario: Search dashboards returns "OK" response + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/notebooks.feature b/features/v2/notebooks.feature new file mode 100644 index 00000000000..2b5255c89bd --- /dev/null +++ b/features/v2/notebooks.feature @@ -0,0 +1,21 @@ +@endpoint(notebooks) @endpoint(notebooks-v2) +Feature: Notebooks + Interact with your notebooks through the API to search and retrieve + notebooks. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "Notebooks" API + And operation "SearchNotebooks" enabled + And new "SearchNotebooks" request + + @generated @skip @team:DataDog/notebooks-backend + Scenario: Search notebooks returns "Bad Request" response + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/notebooks-backend + Scenario: Search notebooks returns "OK" response + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/undo.json b/features/v2/undo.json index 7e549784ee6..d561c026ced 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1319,6 +1319,12 @@ "type": "safe" } }, + "SearchDashboards": { + "tag": "Dashboards", + "undo": { + "type": "safe" + } + }, "GetAllDatasets": { "tag": "Datasets", "undo": { @@ -3110,6 +3116,12 @@ "type": "safe" } }, + "SearchNotebooks": { + "tag": "Notebooks", + "undo": { + "type": "safe" + } + }, "ListPipelines": { "tag": "Observability Pipelines", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 1c3d360ecc9..a903fbb1cfc 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -230,6 +230,7 @@ def initialize "v2.mute_findings": false, "v2.run_threat_hunting_job": false, "v2.search_security_monitoring_histsignals": false, + "v2.search_dashboards": false, "v2.create_dataset": false, "v2.delete_dataset": false, "v2.get_all_datasets": false, @@ -327,6 +328,7 @@ def initialize "v2.update_monitor_user_template": false, "v2.validate_existing_monitor_user_template": false, "v2.validate_monitor_user_template": false, + "v2.search_notebooks": false, "v2.list_role_templates": false, "v2.create_connection": false, "v2.delete_connection": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 8bcf2052b62..2709170b92f 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1990,6 +1990,15 @@ def overrides "v2.dashboard_list_items" => "DashboardListItems", "v2.dashboard_list_update_items_request" => "DashboardListUpdateItemsRequest", "v2.dashboard_list_update_items_response" => "DashboardListUpdateItemsResponse", + "v2.dashboard_search_aggregation_bucket_key" => "DashboardSearchAggregationBucketKey", + "v2.dashboard_search_aggregation_bucket_multi_key" => "DashboardSearchAggregationBucketMultiKey", + "v2.dashboard_search_aggregations" => "DashboardSearchAggregations", + "v2.dashboard_search_attributes" => "DashboardSearchAttributes", + "v2.dashboard_search_metadata" => "DashboardSearchMetadata", + "v2.dashboard_search_response" => "DashboardSearchResponse", + "v2.dashboard_search_response_meta" => "DashboardSearchResponseMeta", + "v2.dashboard_search_result_data" => "DashboardSearchResultData", + "v2.dashboard_search_user" => "DashboardSearchUser", "v2.dashboard_trigger_wrapper" => "DashboardTriggerWrapper", "v2.dashboard_type" => "DashboardType", "v2.database_monitoring_trigger_wrapper" => "DatabaseMonitoringTriggerWrapper", @@ -3313,6 +3322,16 @@ def overrides "v2.monthly_cost_attribution_response" => "MonthlyCostAttributionResponse", "v2.ms_teams_integration_metadata" => "MSTeamsIntegrationMetadata", "v2.ms_teams_integration_metadata_teams_item" => "MSTeamsIntegrationMetadataTeamsItem", + "v2.notebook_search_aggregation_bucket_key" => "NotebookSearchAggregationBucketKey", + "v2.notebook_search_aggregation_bucket_multi_key" => "NotebookSearchAggregationBucketMultiKey", + "v2.notebook_search_aggregations" => "NotebookSearchAggregations", + "v2.notebook_search_attributes" => "NotebookSearchAttributes", + "v2.notebook_search_highlight" => "NotebookSearchHighlight", + "v2.notebook_search_metadata" => "NotebookSearchMetadata", + "v2.notebook_search_response" => "NotebookSearchResponse", + "v2.notebook_search_response_meta" => "NotebookSearchResponseMeta", + "v2.notebook_search_result_data" => "NotebookSearchResultData", + "v2.notebook_search_user" => "NotebookSearchUser", "v2.notebook_trigger_wrapper" => "NotebookTriggerWrapper", "v2.notification_channel" => "NotificationChannel", "v2.notification_channel_attributes" => "NotificationChannelAttributes", @@ -5252,6 +5271,7 @@ def overrides "v2.csm_coverage_analysis_api" => "CSMCoverageAnalysisAPI", "v2.csm_threats_api" => "CSMThreatsAPI", "v2.dashboard_lists_api" => "DashboardListsAPI", + "v2.dashboards_api" => "DashboardsAPI", "v2.data_deletion_api" => "DataDeletionAPI", "v2.datasets_api" => "DatasetsAPI", "v2.deployment_gates_api" => "DeploymentGatesAPI", @@ -5280,6 +5300,7 @@ def overrides "v2.microsoft_teams_integration_api" => "MicrosoftTeamsIntegrationAPI", "v2.monitors_api" => "MonitorsAPI", "v2.network_device_monitoring_api" => "NetworkDeviceMonitoringAPI", + "v2.notebooks_api" => "NotebooksAPI", "v2.observability_pipelines_api" => "ObservabilityPipelinesAPI", "v2.oci_integration_api" => "OCIIntegrationAPI", "v2.okta_integration_api" => "OktaIntegrationAPI", diff --git a/lib/datadog_api_client/v2/api/dashboards_api.rb b/lib/datadog_api_client/v2/api/dashboards_api.rb new file mode 100644 index 00000000000..22f45e62277 --- /dev/null +++ b/lib/datadog_api_client/v2/api/dashboards_api.rb @@ -0,0 +1,102 @@ +=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 DashboardsAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Search dashboards. + # + # @see #search_dashboards_with_http_info + def search_dashboards(opts = {}) + data, _status_code, _headers = search_dashboards_with_http_info(opts) + data + end + + # Search dashboards. + # + # Search for dashboards using a query string. + # + # @param opts [Hash] the optional parameters + # @option opts [String] :query Search query string. + # @option opts [String] :sort Sort field for results. + # @option opts [String] :include Additional data to include in the response. + # @option opts [Integer] :page Page number for pagination. + # @option opts [Integer] :limit Maximum number of results to return. + # @return [Array<(DashboardSearchResponse, Integer, Hash)>] DashboardSearchResponse data, response status code and response headers + def search_dashboards_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.search_dashboards".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.search_dashboards") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.search_dashboards")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: DashboardsAPI.search_dashboards ...' + end + # resource path + local_var_path = '/api/v2/dashboards/search' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'DashboardSearchResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :search_dashboards, + :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: DashboardsAPI#search_dashboards\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/api/notebooks_api.rb b/lib/datadog_api_client/v2/api/notebooks_api.rb new file mode 100644 index 00000000000..cfca0199e81 --- /dev/null +++ b/lib/datadog_api_client/v2/api/notebooks_api.rb @@ -0,0 +1,102 @@ +=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 NotebooksAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Search notebooks. + # + # @see #search_notebooks_with_http_info + def search_notebooks(opts = {}) + data, _status_code, _headers = search_notebooks_with_http_info(opts) + data + end + + # Search notebooks. + # + # Search for notebooks using a query string. + # + # @param opts [Hash] the optional parameters + # @option opts [String] :query Search query string. + # @option opts [String] :sort Sort field for results. + # @option opts [String] :include Additional data to include in the response. + # @option opts [Integer] :page Page number for pagination. + # @option opts [Integer] :limit Maximum number of results to return. + # @return [Array<(NotebookSearchResponse, Integer, Hash)>] NotebookSearchResponse data, response status code and response headers + def search_notebooks_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.search_notebooks".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.search_notebooks") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.search_notebooks")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: NotebooksAPI.search_notebooks ...' + end + # resource path + local_var_path = '/api/v2/notebooks/search' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? + query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'NotebookSearchResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :search_notebooks, + :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: NotebooksAPI#search_notebooks\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/dashboard_search_aggregation_bucket_key.rb b/lib/datadog_api_client/v2/models/dashboard_search_aggregation_bucket_key.rb new file mode 100644 index 00000000000..9c6f5eb098f --- /dev/null +++ b/lib/datadog_api_client/v2/models/dashboard_search_aggregation_bucket_key.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Aggregation bucket with a single key value. + class DashboardSearchAggregationBucketKey + include BaseGenericModel + + # Number of results in this bucket. + attr_reader :count + + # Key value for this bucket. + attr_reader :value + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'count' => :'count', + :'value' => :'value' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'count' => :'Integer', + :'value' => :'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::DashboardSearchAggregationBucketKey` 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?(:'count') + self.count = attributes[:'count'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + 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 @count.nil? + return false if @value.nil? + true + end + + # Custom attribute writer method with validation + # @param count [Object] Object to be assigned + # @!visibility private + def count=(count) + if count.nil? + fail ArgumentError, 'invalid value for "count", count cannot be nil.' + end + @count = count + end + + # Custom attribute writer method with validation + # @param value [Object] Object to be assigned + # @!visibility private + def value=(value) + if value.nil? + fail ArgumentError, 'invalid value for "value", value cannot be nil.' + end + @value = value + 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 && + count == o.count && + value == o.value && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [count, value, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/dashboard_search_aggregation_bucket_multi_key.rb b/lib/datadog_api_client/v2/models/dashboard_search_aggregation_bucket_multi_key.rb new file mode 100644 index 00000000000..a5e6b2f0f82 --- /dev/null +++ b/lib/datadog_api_client/v2/models/dashboard_search_aggregation_bucket_multi_key.rb @@ -0,0 +1,146 @@ +=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 + # Aggregation bucket with multiple key values. + class DashboardSearchAggregationBucketMultiKey + include BaseGenericModel + + # Number of results in this bucket. + attr_reader :count + + # Key values for this bucket. + attr_reader :value + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'count' => :'count', + :'value' => :'value' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'count' => :'Integer', + :'value' => :'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::DashboardSearchAggregationBucketMultiKey` 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?(:'count') + self.count = attributes[:'count'] + end + + if attributes.key?(:'value') + if (value = attributes[:'value']).is_a?(Array) + self.value = 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 @count.nil? + return false if @value.nil? + true + end + + # Custom attribute writer method with validation + # @param count [Object] Object to be assigned + # @!visibility private + def count=(count) + if count.nil? + fail ArgumentError, 'invalid value for "count", count cannot be nil.' + end + @count = count + end + + # Custom attribute writer method with validation + # @param value [Object] Object to be assigned + # @!visibility private + def value=(value) + if value.nil? + fail ArgumentError, 'invalid value for "value", value cannot be nil.' + end + @value = value + 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 && + count == o.count && + value == o.value && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [count, value, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/dashboard_search_aggregations.rb b/lib/datadog_api_client/v2/models/dashboard_search_aggregations.rb new file mode 100644 index 00000000000..7e407172dc8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/dashboard_search_aggregations.rb @@ -0,0 +1,215 @@ +=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 + # Aggregations of dashboard search results. + class DashboardSearchAggregations + include BaseGenericModel + + # Aggregation by author. + attr_accessor :author + + # Aggregation by share status. + attr_accessor :is_shared + + # Aggregation by share type. + attr_accessor :share_type + + # Aggregation by who shared the dashboard. + attr_accessor :shared_by_handle + + # Aggregation by status. + attr_accessor :status + + # Aggregation by tags. + attr_accessor :tags + + # Aggregation by template variable names. + attr_accessor :template_variables_name + + # Aggregation by dashboard type. + attr_accessor :type + + # Aggregation by widget metrics. + attr_accessor :widgets_metrics + + # Aggregation by widget type. + attr_accessor :widgets_type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'author' => :'author', + :'is_shared' => :'is_shared', + :'share_type' => :'share_type', + :'shared_by_handle' => :'shared_by.handle', + :'status' => :'status', + :'tags' => :'tags', + :'template_variables_name' => :'template_variables.name', + :'type' => :'type', + :'widgets_metrics' => :'widgets.metrics', + :'widgets_type' => :'widgets.type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'author' => :'Array', + :'is_shared' => :'Array', + :'share_type' => :'Array', + :'shared_by_handle' => :'Array', + :'status' => :'Array', + :'tags' => :'Array', + :'template_variables_name' => :'Array', + :'type' => :'Array', + :'widgets_metrics' => :'Array', + :'widgets_type' => :'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::DashboardSearchAggregations` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'author') + if (value = attributes[:'author']).is_a?(Array) + self.author = value + end + end + + if attributes.key?(:'is_shared') + if (value = attributes[:'is_shared']).is_a?(Array) + self.is_shared = value + end + end + + if attributes.key?(:'share_type') + if (value = attributes[:'share_type']).is_a?(Array) + self.share_type = value + end + end + + if attributes.key?(:'shared_by_handle') + if (value = attributes[:'shared_by_handle']).is_a?(Array) + self.shared_by_handle = value + end + end + + if attributes.key?(:'status') + if (value = attributes[:'status']).is_a?(Array) + self.status = value + end + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'template_variables_name') + if (value = attributes[:'template_variables_name']).is_a?(Array) + self.template_variables_name = value + end + end + + if attributes.key?(:'type') + if (value = attributes[:'type']).is_a?(Array) + self.type = value + end + end + + if attributes.key?(:'widgets_metrics') + if (value = attributes[:'widgets_metrics']).is_a?(Array) + self.widgets_metrics = value + end + end + + if attributes.key?(:'widgets_type') + if (value = attributes[:'widgets_type']).is_a?(Array) + self.widgets_type = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + author == o.author && + is_shared == o.is_shared && + share_type == o.share_type && + shared_by_handle == o.shared_by_handle && + status == o.status && + tags == o.tags && + template_variables_name == o.template_variables_name && + type == o.type && + widgets_metrics == o.widgets_metrics && + widgets_type == o.widgets_type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [author, is_shared, share_type, shared_by_handle, status, tags, template_variables_name, type, widgets_metrics, widgets_type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/dashboard_search_attributes.rb b/lib/datadog_api_client/v2/models/dashboard_search_attributes.rb new file mode 100644 index 00000000000..c551b533aea --- /dev/null +++ b/lib/datadog_api_client/v2/models/dashboard_search_attributes.rb @@ -0,0 +1,146 @@ +=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 + # Dashboard search result attributes. + class DashboardSearchAttributes + include BaseGenericModel + + # List of tags for the dashboard. + attr_reader :tags + + # Title of the dashboard. + attr_reader :title + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'tags' => :'tags', + :'title' => :'title' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'tags' => :'Array', + :'title' => :'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::DashboardSearchAttributes` 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?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + 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 @tags.nil? + return false if @title.nil? + true + end + + # Custom attribute writer method with validation + # @param tags [Object] Object to be assigned + # @!visibility private + def tags=(tags) + if tags.nil? + fail ArgumentError, 'invalid value for "tags", tags cannot be nil.' + end + @tags = tags + 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 + @title = title + 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 && + tags == o.tags && + title == o.title && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [tags, title, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/dashboard_search_metadata.rb b/lib/datadog_api_client/v2/models/dashboard_search_metadata.rb new file mode 100644 index 00000000000..44534d1d393 --- /dev/null +++ b/lib/datadog_api_client/v2/models/dashboard_search_metadata.rb @@ -0,0 +1,526 @@ +=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 dashboard. + class DashboardSearchMetadata + include BaseGenericModel + + # User information. + attr_reader :author + + # Time at which the dashboard was created. + attr_reader :created_at + + # Time at which the dashboard was deleted, or null if not deleted. + attr_accessor :deleted_at + + # List of domains the dashboard is allowed to be embedded in. + attr_accessor :embeddable_domains + + # Dashboard experience type. + attr_reader :experience_type + + # When the public dashboard link will expire. + attr_accessor :expiration + + # Whether the dashboard has monitors. + attr_accessor :has_monitors + + # Whether the dashboard is favorited by the user. + attr_reader :is_favorited + + # Whether the public dashboard owner is deactivated. + attr_reader :is_public_dashboard_ownerless + + # Whether the dashboard is shared publicly. + attr_reader :is_shared + + # Last time the dashboard was accessed. + attr_accessor :last_accessed + + # Time at which the dashboard was last updated. + attr_reader :modified_at + + # Relative measure of dashboard popularity. + attr_reader :popularity + + # Published title of the public dashboard. + attr_reader :public_title + + # Quality score of the dashboard. + attr_accessor :quality_score + + # List of email addresses for invite-only public dashboards. + attr_accessor :share_list + + # Share type of the public dashboard. + attr_reader :share_type + + # User information. + attr_reader :shared_by + + # Status of the public dashboard. + attr_reader :status + + # Unique public dashboard token. + attr_reader :token + + # Dashboard type. + attr_reader :type + + # URL path to the dashboard. + attr_reader :url + + # Number of widgets in the dashboard. + attr_reader :widget_count + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'author' => :'author', + :'created_at' => :'created_at', + :'deleted_at' => :'deleted_at', + :'embeddable_domains' => :'embeddable_domains', + :'experience_type' => :'experience_type', + :'expiration' => :'expiration', + :'has_monitors' => :'has_monitors', + :'is_favorited' => :'is_favorited', + :'is_public_dashboard_ownerless' => :'is_public_dashboard_ownerless', + :'is_shared' => :'is_shared', + :'last_accessed' => :'last_accessed', + :'modified_at' => :'modified_at', + :'popularity' => :'popularity', + :'public_title' => :'public_title', + :'quality_score' => :'quality_score', + :'share_list' => :'share_list', + :'share_type' => :'share_type', + :'shared_by' => :'shared_by', + :'status' => :'status', + :'token' => :'token', + :'type' => :'type', + :'url' => :'url', + :'widget_count' => :'widget_count' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'author' => :'DashboardSearchUser', + :'created_at' => :'Time', + :'deleted_at' => :'Time', + :'embeddable_domains' => :'Array', + :'experience_type' => :'String', + :'expiration' => :'Time', + :'has_monitors' => :'Boolean', + :'is_favorited' => :'Boolean', + :'is_public_dashboard_ownerless' => :'Boolean', + :'is_shared' => :'Boolean', + :'last_accessed' => :'Time', + :'modified_at' => :'Time', + :'popularity' => :'Float', + :'public_title' => :'String', + :'quality_score' => :'Float', + :'share_list' => :'Array', + :'share_type' => :'String', + :'shared_by' => :'DashboardSearchUser', + :'status' => :'String', + :'token' => :'String', + :'type' => :'String', + :'url' => :'String', + :'widget_count' => :'Integer' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'deleted_at', + :'embeddable_domains', + :'expiration', + :'has_monitors', + :'last_accessed', + :'quality_score', + :'share_list', + ]) + 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::DashboardSearchMetadata` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'author') + self.author = attributes[:'author'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'deleted_at') + self.deleted_at = attributes[:'deleted_at'] + end + + if attributes.key?(:'embeddable_domains') + if (value = attributes[:'embeddable_domains']).is_a?(Array) + self.embeddable_domains = value + end + end + + if attributes.key?(:'experience_type') + self.experience_type = attributes[:'experience_type'] + end + + if attributes.key?(:'expiration') + self.expiration = attributes[:'expiration'] + end + + if attributes.key?(:'has_monitors') + self.has_monitors = attributes[:'has_monitors'] + end + + if attributes.key?(:'is_favorited') + self.is_favorited = attributes[:'is_favorited'] + end + + if attributes.key?(:'is_public_dashboard_ownerless') + self.is_public_dashboard_ownerless = attributes[:'is_public_dashboard_ownerless'] + end + + if attributes.key?(:'is_shared') + self.is_shared = attributes[:'is_shared'] + end + + if attributes.key?(:'last_accessed') + self.last_accessed = attributes[:'last_accessed'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'popularity') + self.popularity = attributes[:'popularity'] + end + + if attributes.key?(:'public_title') + self.public_title = attributes[:'public_title'] + end + + if attributes.key?(:'quality_score') + self.quality_score = attributes[:'quality_score'] + end + + if attributes.key?(:'share_list') + if (value = attributes[:'share_list']).is_a?(Array) + self.share_list = value + end + end + + if attributes.key?(:'share_type') + self.share_type = attributes[:'share_type'] + end + + if attributes.key?(:'shared_by') + self.shared_by = attributes[:'shared_by'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'token') + self.token = attributes[:'token'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'url') + self.url = attributes[:'url'] + end + + if attributes.key?(:'widget_count') + self.widget_count = attributes[:'widget_count'] + 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 @author.nil? + return false if @created_at.nil? + return false if @experience_type.nil? + return false if @is_favorited.nil? + return false if @is_public_dashboard_ownerless.nil? + return false if @is_shared.nil? + return false if @modified_at.nil? + return false if @popularity.nil? + return false if @public_title.nil? + return false if @share_type.nil? + return false if @shared_by.nil? + return false if @status.nil? + return false if @token.nil? + return false if @type.nil? + return false if @url.nil? + return false if @widget_count.nil? + true + end + + # Custom attribute writer method with validation + # @param author [Object] Object to be assigned + # @!visibility private + def author=(author) + if author.nil? + fail ArgumentError, 'invalid value for "author", author cannot be nil.' + end + @author = author + 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 experience_type [Object] Object to be assigned + # @!visibility private + def experience_type=(experience_type) + if experience_type.nil? + fail ArgumentError, 'invalid value for "experience_type", experience_type cannot be nil.' + end + @experience_type = experience_type + 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 is_public_dashboard_ownerless [Object] Object to be assigned + # @!visibility private + def is_public_dashboard_ownerless=(is_public_dashboard_ownerless) + if is_public_dashboard_ownerless.nil? + fail ArgumentError, 'invalid value for "is_public_dashboard_ownerless", is_public_dashboard_ownerless cannot be nil.' + end + @is_public_dashboard_ownerless = is_public_dashboard_ownerless + end + + # Custom attribute writer method with validation + # @param is_shared [Object] Object to be assigned + # @!visibility private + def is_shared=(is_shared) + if is_shared.nil? + fail ArgumentError, 'invalid value for "is_shared", is_shared cannot be nil.' + end + @is_shared = is_shared + 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 + + # Custom attribute writer method with validation + # @param popularity [Object] Object to be assigned + # @!visibility private + def popularity=(popularity) + if popularity.nil? + fail ArgumentError, 'invalid value for "popularity", popularity cannot be nil.' + end + @popularity = popularity + end + + # Custom attribute writer method with validation + # @param public_title [Object] Object to be assigned + # @!visibility private + def public_title=(public_title) + if public_title.nil? + fail ArgumentError, 'invalid value for "public_title", public_title cannot be nil.' + end + @public_title = public_title + end + + # Custom attribute writer method with validation + # @param share_type [Object] Object to be assigned + # @!visibility private + def share_type=(share_type) + if share_type.nil? + fail ArgumentError, 'invalid value for "share_type", share_type cannot be nil.' + end + @share_type = share_type + end + + # Custom attribute writer method with validation + # @param shared_by [Object] Object to be assigned + # @!visibility private + def shared_by=(shared_by) + if shared_by.nil? + fail ArgumentError, 'invalid value for "shared_by", shared_by cannot be nil.' + end + @shared_by = shared_by + end + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + end + + # Custom attribute writer method with validation + # @param token [Object] Object to be assigned + # @!visibility private + def token=(token) + if token.nil? + fail ArgumentError, 'invalid value for "token", token cannot be nil.' + end + @token = token + 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 + + # Custom attribute writer method with validation + # @param url [Object] Object to be assigned + # @!visibility private + def url=(url) + if url.nil? + fail ArgumentError, 'invalid value for "url", url cannot be nil.' + end + @url = url + end + + # Custom attribute writer method with validation + # @param widget_count [Object] Object to be assigned + # @!visibility private + def widget_count=(widget_count) + if widget_count.nil? + fail ArgumentError, 'invalid value for "widget_count", widget_count cannot be nil.' + end + @widget_count = widget_count + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + author == o.author && + created_at == o.created_at && + deleted_at == o.deleted_at && + embeddable_domains == o.embeddable_domains && + experience_type == o.experience_type && + expiration == o.expiration && + has_monitors == o.has_monitors && + is_favorited == o.is_favorited && + is_public_dashboard_ownerless == o.is_public_dashboard_ownerless && + is_shared == o.is_shared && + last_accessed == o.last_accessed && + modified_at == o.modified_at && + popularity == o.popularity && + public_title == o.public_title && + quality_score == o.quality_score && + share_list == o.share_list && + share_type == o.share_type && + shared_by == o.shared_by && + status == o.status && + token == o.token && + type == o.type && + url == o.url && + widget_count == o.widget_count && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [author, created_at, deleted_at, embeddable_domains, experience_type, expiration, has_monitors, is_favorited, is_public_dashboard_ownerless, is_shared, last_accessed, modified_at, popularity, public_title, quality_score, share_list, share_type, shared_by, status, token, type, url, widget_count, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/dashboard_search_response.rb b/lib/datadog_api_client/v2/models/dashboard_search_response.rb new file mode 100644 index 00000000000..4ec2eda50c8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/dashboard_search_response.rb @@ -0,0 +1,146 @@ +=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 dashboard search results. + class DashboardSearchResponse + include BaseGenericModel + + # List of dashboard search results. + attr_reader :data + + # Metadata about the dashboard search results. + attr_reader :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'meta' => :'DashboardSearchResponseMeta' + } + 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::DashboardSearchResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # 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? + return false if @meta.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 + + # Custom attribute writer method with validation + # @param meta [Object] Object to be assigned + # @!visibility private + def meta=(meta) + if meta.nil? + fail ArgumentError, 'invalid value for "meta", meta cannot be nil.' + end + @meta = meta + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/dashboard_search_response_meta.rb b/lib/datadog_api_client/v2/models/dashboard_search_response_meta.rb new file mode 100644 index 00000000000..d2afa999297 --- /dev/null +++ b/lib/datadog_api_client/v2/models/dashboard_search_response_meta.rb @@ -0,0 +1,133 @@ +=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 dashboard search results. + class DashboardSearchResponseMeta + include BaseGenericModel + + # Aggregations of dashboard search results. + attr_accessor :aggregations + + # Total number of dashboards found. + attr_reader :total + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'aggregations' => :'aggregations', + :'total' => :'total' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'aggregations' => :'DashboardSearchAggregations', + :'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::DashboardSearchResponseMeta` 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?(:'aggregations') + self.aggregations = attributes[:'aggregations'] + end + + if attributes.key?(:'total') + self.total = attributes[:'total'] + 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 @total.nil? + true + end + + # Custom attribute writer method with validation + # @param total [Object] Object to be assigned + # @!visibility private + def total=(total) + if total.nil? + fail ArgumentError, 'invalid value for "total", total cannot be nil.' + end + @total = total + 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 && + aggregations == o.aggregations && + total == o.total && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [aggregations, total, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/dashboard_search_result_data.rb b/lib/datadog_api_client/v2/models/dashboard_search_result_data.rb new file mode 100644 index 00000000000..9cb1c8f09b6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/dashboard_search_result_data.rb @@ -0,0 +1,186 @@ +=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 dashboard search result. + class DashboardSearchResultData + include BaseGenericModel + + # Dashboard search result attributes. + attr_reader :attributes + + # Dashboard identifier. + attr_reader :id + + # Metadata about the dashboard. + attr_reader :meta + + # Dashboard 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', + :'meta' => :'meta', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'DashboardSearchAttributes', + :'id' => :'String', + :'meta' => :'DashboardSearchMetadata', + :'type' => :'MetricDashboardType' + } + 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::DashboardSearchResultData` 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?(:'meta') + self.meta = attributes[:'meta'] + 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 @meta.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 meta [Object] Object to be assigned + # @!visibility private + def meta=(meta) + if meta.nil? + fail ArgumentError, 'invalid value for "meta", meta cannot be nil.' + end + @meta = meta + 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 && + meta == o.meta && + 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, meta, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/dashboard_search_user.rb b/lib/datadog_api_client/v2/models/dashboard_search_user.rb new file mode 100644 index 00000000000..550ff90a99c --- /dev/null +++ b/lib/datadog_api_client/v2/models/dashboard_search_user.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # User information. + class DashboardSearchUser + include BaseGenericModel + + # User handle or email. + attr_reader :handle + + # User display name. + attr_reader :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 + + # 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::DashboardSearchUser` 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 + + # 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 @handle.nil? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param handle [Object] Object to be assigned + # @!visibility private + def handle=(handle) + if handle.nil? + fail ArgumentError, 'invalid value for "handle", handle cannot be nil.' + end + @handle = handle + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + 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/notebook_search_aggregation_bucket_key.rb b/lib/datadog_api_client/v2/models/notebook_search_aggregation_bucket_key.rb new file mode 100644 index 00000000000..026477b099e --- /dev/null +++ b/lib/datadog_api_client/v2/models/notebook_search_aggregation_bucket_key.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Aggregation bucket with a single key value. + class NotebookSearchAggregationBucketKey + include BaseGenericModel + + # Number of results in this bucket. + attr_reader :count + + # Key value for this bucket. + attr_reader :value + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'count' => :'count', + :'value' => :'value' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'count' => :'Integer', + :'value' => :'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::NotebookSearchAggregationBucketKey` 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?(:'count') + self.count = attributes[:'count'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + 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 @count.nil? + return false if @value.nil? + true + end + + # Custom attribute writer method with validation + # @param count [Object] Object to be assigned + # @!visibility private + def count=(count) + if count.nil? + fail ArgumentError, 'invalid value for "count", count cannot be nil.' + end + @count = count + end + + # Custom attribute writer method with validation + # @param value [Object] Object to be assigned + # @!visibility private + def value=(value) + if value.nil? + fail ArgumentError, 'invalid value for "value", value cannot be nil.' + end + @value = value + 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 && + count == o.count && + value == o.value && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [count, value, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/notebook_search_aggregation_bucket_multi_key.rb b/lib/datadog_api_client/v2/models/notebook_search_aggregation_bucket_multi_key.rb new file mode 100644 index 00000000000..e3483de0a78 --- /dev/null +++ b/lib/datadog_api_client/v2/models/notebook_search_aggregation_bucket_multi_key.rb @@ -0,0 +1,146 @@ +=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 + # Aggregation bucket with multiple key values. + class NotebookSearchAggregationBucketMultiKey + include BaseGenericModel + + # Number of results in this bucket. + attr_reader :count + + # Key values for this bucket. + attr_reader :value + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'count' => :'count', + :'value' => :'value' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'count' => :'Integer', + :'value' => :'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::NotebookSearchAggregationBucketMultiKey` 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?(:'count') + self.count = attributes[:'count'] + end + + if attributes.key?(:'value') + if (value = attributes[:'value']).is_a?(Array) + self.value = 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 @count.nil? + return false if @value.nil? + true + end + + # Custom attribute writer method with validation + # @param count [Object] Object to be assigned + # @!visibility private + def count=(count) + if count.nil? + fail ArgumentError, 'invalid value for "count", count cannot be nil.' + end + @count = count + end + + # Custom attribute writer method with validation + # @param value [Object] Object to be assigned + # @!visibility private + def value=(value) + if value.nil? + fail ArgumentError, 'invalid value for "value", value cannot be nil.' + end + @value = value + 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 && + count == o.count && + value == o.value && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [count, value, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/notebook_search_aggregations.rb b/lib/datadog_api_client/v2/models/notebook_search_aggregations.rb new file mode 100644 index 00000000000..510fbfb8960 --- /dev/null +++ b/lib/datadog_api_client/v2/models/notebook_search_aggregations.rb @@ -0,0 +1,143 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Aggregations of notebook search results. + class NotebookSearchAggregations + include BaseGenericModel + + # Aggregation by author. + attr_accessor :author + + # Aggregation by tags. + attr_accessor :tags + + # Aggregation by template variable names. + attr_accessor :template_variables_name + + # Aggregation by notebook type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'author' => :'author', + :'tags' => :'tags', + :'template_variables_name' => :'template_variables.name', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'author' => :'Array', + :'tags' => :'Array', + :'template_variables_name' => :'Array', + :'type' => :'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::NotebookSearchAggregations` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'author') + if (value = attributes[:'author']).is_a?(Array) + self.author = value + end + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'template_variables_name') + if (value = attributes[:'template_variables_name']).is_a?(Array) + self.template_variables_name = value + end + end + + if attributes.key?(:'type') + if (value = attributes[:'type']).is_a?(Array) + self.type = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + author == o.author && + tags == o.tags && + template_variables_name == o.template_variables_name && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [author, tags, template_variables_name, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/notebook_search_attributes.rb b/lib/datadog_api_client/v2/models/notebook_search_attributes.rb new file mode 100644 index 00000000000..b39d033000e --- /dev/null +++ b/lib/datadog_api_client/v2/models/notebook_search_attributes.rb @@ -0,0 +1,167 @@ +=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 + # Notebook search result attributes. + class NotebookSearchAttributes + include BaseGenericModel + + # Metadata about the notebook. + attr_reader :meta + + # Name of the notebook. + attr_reader :name + + # List of tags for the notebook. + attr_reader :tags + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'meta' => :'meta', + :'name' => :'name', + :'tags' => :'tags' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'meta' => :'NotebookSearchMetadata', + :'name' => :'String', + :'tags' => :'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::NotebookSearchAttributes` 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?(:'meta') + self.meta = attributes[:'meta'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + 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 @meta.nil? + return false if @name.nil? + return false if @tags.nil? + true + end + + # Custom attribute writer method with validation + # @param meta [Object] Object to be assigned + # @!visibility private + def meta=(meta) + if meta.nil? + fail ArgumentError, 'invalid value for "meta", meta cannot be nil.' + end + @meta = meta + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param tags [Object] Object to be assigned + # @!visibility private + def tags=(tags) + if tags.nil? + fail ArgumentError, 'invalid value for "tags", tags cannot be nil.' + end + @tags = tags + 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 && + meta == o.meta && + name == o.name && + tags == o.tags && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [meta, name, tags, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/notebook_search_highlight.rb b/lib/datadog_api_client/v2/models/notebook_search_highlight.rb new file mode 100644 index 00000000000..eac08ab5f0a --- /dev/null +++ b/lib/datadog_api_client/v2/models/notebook_search_highlight.rb @@ -0,0 +1,131 @@ +=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 + # Highlighted fields from the notebook search. + class NotebookSearchHighlight + include BaseGenericModel + + # Highlighted cell text matches. + attr_accessor :cells_text + + # Highlighted cell title matches. + attr_accessor :cells_title + + # Highlighted notebook name matches. + attr_accessor :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'cells_text' => :'cells.text', + :'cells_title' => :'cells.title', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'cells_text' => :'Array', + :'cells_title' => :'Array', + :'name' => :'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::NotebookSearchHighlight` 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?(:'cells_text') + if (value = attributes[:'cells_text']).is_a?(Array) + self.cells_text = value + end + end + + if attributes.key?(:'cells_title') + if (value = attributes[:'cells_title']).is_a?(Array) + self.cells_title = value + end + end + + if attributes.key?(:'name') + if (value = attributes[:'name']).is_a?(Array) + self.name = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + cells_text == o.cells_text && + cells_title == o.cells_title && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [cells_text, cells_title, name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/notebook_search_metadata.rb b/lib/datadog_api_client/v2/models/notebook_search_metadata.rb new file mode 100644 index 00000000000..bdd54f3e99c --- /dev/null +++ b/lib/datadog_api_client/v2/models/notebook_search_metadata.rb @@ -0,0 +1,341 @@ +=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 notebook. + class NotebookSearchMetadata + include BaseGenericModel + + # User information. + attr_reader :author + + # Number of cells in the notebook. + attr_reader :cell_count + + # Time at which the notebook was created. + attr_reader :created_at + + # Time at which the notebook was deleted, or null if not deleted. + attr_accessor :deleted_at + + # Experience type of the notebook. + attr_accessor :experience_type + + # Whether the notebook has computational cells. + attr_reader :has_computational_cells + + # Whether the notebook is favorited by the user. + attr_reader :is_favorited + + # Whether the notebook is a template. + attr_reader :is_template + + # Time at which the notebook was last updated. + attr_reader :modified_at + + # Status of the notebook. + attr_reader :status + + # Whether the notebook can take a snapshot. + attr_reader :take_snapshots + + # Notebook type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'author' => :'author', + :'cell_count' => :'cell_count', + :'created_at' => :'created_at', + :'deleted_at' => :'deleted_at', + :'experience_type' => :'experience_type', + :'has_computational_cells' => :'has_computational_cells', + :'is_favorited' => :'is_favorited', + :'is_template' => :'is_template', + :'modified_at' => :'modified_at', + :'status' => :'status', + :'take_snapshots' => :'take_snapshots', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'author' => :'NotebookSearchUser', + :'cell_count' => :'Integer', + :'created_at' => :'Time', + :'deleted_at' => :'Time', + :'experience_type' => :'String', + :'has_computational_cells' => :'Boolean', + :'is_favorited' => :'Boolean', + :'is_template' => :'Boolean', + :'modified_at' => :'Time', + :'status' => :'String', + :'take_snapshots' => :'Boolean', + :'type' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'deleted_at', + :'experience_type', + ]) + 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::NotebookSearchMetadata` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'author') + self.author = attributes[:'author'] + end + + if attributes.key?(:'cell_count') + self.cell_count = attributes[:'cell_count'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'deleted_at') + self.deleted_at = attributes[:'deleted_at'] + end + + if attributes.key?(:'experience_type') + self.experience_type = attributes[:'experience_type'] + end + + if attributes.key?(:'has_computational_cells') + self.has_computational_cells = attributes[:'has_computational_cells'] + end + + if attributes.key?(:'is_favorited') + self.is_favorited = attributes[:'is_favorited'] + end + + if attributes.key?(:'is_template') + self.is_template = attributes[:'is_template'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'take_snapshots') + self.take_snapshots = attributes[:'take_snapshots'] + 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 @author.nil? + return false if @cell_count.nil? + return false if @created_at.nil? + return false if @has_computational_cells.nil? + return false if @is_favorited.nil? + return false if @is_template.nil? + return false if @modified_at.nil? + return false if @status.nil? + return false if @take_snapshots.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param author [Object] Object to be assigned + # @!visibility private + def author=(author) + if author.nil? + fail ArgumentError, 'invalid value for "author", author cannot be nil.' + end + @author = author + end + + # Custom attribute writer method with validation + # @param cell_count [Object] Object to be assigned + # @!visibility private + def cell_count=(cell_count) + if cell_count.nil? + fail ArgumentError, 'invalid value for "cell_count", cell_count cannot be nil.' + end + @cell_count = cell_count + 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 has_computational_cells [Object] Object to be assigned + # @!visibility private + def has_computational_cells=(has_computational_cells) + if has_computational_cells.nil? + fail ArgumentError, 'invalid value for "has_computational_cells", has_computational_cells cannot be nil.' + end + @has_computational_cells = has_computational_cells + 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 is_template [Object] Object to be assigned + # @!visibility private + def is_template=(is_template) + if is_template.nil? + fail ArgumentError, 'invalid value for "is_template", is_template cannot be nil.' + end + @is_template = is_template + 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 + + # Custom attribute writer method with validation + # @param status [Object] Object to be assigned + # @!visibility private + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' + end + @status = status + end + + # Custom attribute writer method with validation + # @param take_snapshots [Object] Object to be assigned + # @!visibility private + def take_snapshots=(take_snapshots) + if take_snapshots.nil? + fail ArgumentError, 'invalid value for "take_snapshots", take_snapshots cannot be nil.' + end + @take_snapshots = take_snapshots + 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 && + author == o.author && + cell_count == o.cell_count && + created_at == o.created_at && + deleted_at == o.deleted_at && + experience_type == o.experience_type && + has_computational_cells == o.has_computational_cells && + is_favorited == o.is_favorited && + is_template == o.is_template && + modified_at == o.modified_at && + status == o.status && + take_snapshots == o.take_snapshots && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [author, cell_count, created_at, deleted_at, experience_type, has_computational_cells, is_favorited, is_template, modified_at, status, take_snapshots, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/notebook_search_response.rb b/lib/datadog_api_client/v2/models/notebook_search_response.rb new file mode 100644 index 00000000000..e07f6724cd5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/notebook_search_response.rb @@ -0,0 +1,146 @@ +=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 notebook search results. + class NotebookSearchResponse + include BaseGenericModel + + # List of notebook search results. + attr_reader :data + + # Metadata about the notebook search results. + attr_reader :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'meta' => :'NotebookSearchResponseMeta' + } + 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::NotebookSearchResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # 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? + return false if @meta.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 + + # Custom attribute writer method with validation + # @param meta [Object] Object to be assigned + # @!visibility private + def meta=(meta) + if meta.nil? + fail ArgumentError, 'invalid value for "meta", meta cannot be nil.' + end + @meta = meta + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/notebook_search_response_meta.rb b/lib/datadog_api_client/v2/models/notebook_search_response_meta.rb new file mode 100644 index 00000000000..6c97d0d9ecc --- /dev/null +++ b/lib/datadog_api_client/v2/models/notebook_search_response_meta.rb @@ -0,0 +1,133 @@ +=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 notebook search results. + class NotebookSearchResponseMeta + include BaseGenericModel + + # Aggregations of notebook search results. + attr_accessor :aggregations + + # Total number of notebooks found. + attr_reader :total + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'aggregations' => :'aggregations', + :'total' => :'total' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'aggregations' => :'NotebookSearchAggregations', + :'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::NotebookSearchResponseMeta` 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?(:'aggregations') + self.aggregations = attributes[:'aggregations'] + end + + if attributes.key?(:'total') + self.total = attributes[:'total'] + 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 @total.nil? + true + end + + # Custom attribute writer method with validation + # @param total [Object] Object to be assigned + # @!visibility private + def total=(total) + if total.nil? + fail ArgumentError, 'invalid value for "total", total cannot be nil.' + end + @total = total + 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 && + aggregations == o.aggregations && + total == o.total && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [aggregations, total, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/notebook_search_result_data.rb b/lib/datadog_api_client/v2/models/notebook_search_result_data.rb new file mode 100644 index 00000000000..9693a8ab9e1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/notebook_search_result_data.rb @@ -0,0 +1,175 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A notebook search result. + class NotebookSearchResultData + include BaseGenericModel + + # Highlighted fields from the notebook search. + attr_accessor :highlight + + # Notebook identifier. + attr_reader :id + + # Notebook search result attributes. + attr_reader :notebook_data + + # Notebook 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 + { + :'highlight' => :'highlight', + :'id' => :'id', + :'notebook_data' => :'notebook_data', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'highlight' => :'NotebookSearchHighlight', + :'id' => :'String', + :'notebook_data' => :'NotebookSearchAttributes', + :'type' => :'MetricNotebookType' + } + 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::NotebookSearchResultData` 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?(:'highlight') + self.highlight = attributes[:'highlight'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'notebook_data') + self.notebook_data = attributes[:'notebook_data'] + 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 @notebook_data.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 notebook_data [Object] Object to be assigned + # @!visibility private + def notebook_data=(notebook_data) + if notebook_data.nil? + fail ArgumentError, 'invalid value for "notebook_data", notebook_data cannot be nil.' + end + @notebook_data = notebook_data + 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 && + highlight == o.highlight && + id == o.id && + notebook_data == o.notebook_data && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [highlight, id, notebook_data, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/notebook_search_user.rb b/lib/datadog_api_client/v2/models/notebook_search_user.rb new file mode 100644 index 00000000000..9e0d0930c33 --- /dev/null +++ b/lib/datadog_api_client/v2/models/notebook_search_user.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # User information. + class NotebookSearchUser + include BaseGenericModel + + # User handle or email. + attr_reader :handle + + # User display name. + attr_reader :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 + + # 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::NotebookSearchUser` 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 + + # 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 @handle.nil? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param handle [Object] Object to be assigned + # @!visibility private + def handle=(handle) + if handle.nil? + fail ArgumentError, 'invalid value for "handle", handle cannot be nil.' + end + @handle = handle + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + 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