From 3f8aeb246fd6c86114dc7579c6ebbe05a5eae6ec Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 26 May 2026 15:41:11 +0000 Subject: [PATCH] Regenerate client from commit deba7b6 of spec repo --- .generator/schemas/v2/openapi.yaml | 1138 ++++++++++++++++- ...etSecurityMonitoringDatasetDependencies.rb | 18 + .../CreateSecurityMonitoringDataset.rb | 39 + .../DeleteSecurityMonitoringDataset.rb | 8 + .../GetSecurityMonitoringDataset.rb | 8 + .../GetSecurityMonitoringDatasetByVersion.rb | 8 + ...SecurityMonitoringDatasetVersionHistory.rb | 8 + .../ListSecurityMonitoringDatasets.rb | 8 + .../UpdateSecurityMonitoringDataset.rb | 39 + features/scenarios_model_mapping.rb | 31 + features/v2/security_monitoring.feature | 189 +++ features/v2/undo.json | 55 + lib/datadog_api_client/configuration.rb | 8 + lib/datadog_api_client/inflector.rb | 32 + .../v2/api/security_monitoring_api.rb | 596 +++++++++ .../models/recommendations_filter_request.rb | 12 +- ...y_monitoring_dataset_attributes_request.rb | 147 +++ ..._monitoring_dataset_attributes_response.rb | 365 ++++++ .../security_monitoring_dataset_column.rb | 144 +++ ...security_monitoring_dataset_create_data.rb | 144 +++ ...urity_monitoring_dataset_create_request.rb | 123 ++ ...rity_monitoring_dataset_create_response.rb | 123 ++ ...monitoring_dataset_create_response_data.rb | 144 +++ ...security_monitoring_dataset_create_type.rb | 26 + .../security_monitoring_dataset_data.rb | 165 +++ .../security_monitoring_dataset_definition.rb | 221 ++++ ...monitoring_dataset_dependencies_request.rb | 123 ++ ...dataset_dependencies_request_attributes.rb | 125 ++ ...oring_dataset_dependencies_request_data.rb | 123 ++ ...onitoring_dataset_dependencies_response.rb | 125 ++ ...onitoring_dataset_dependents_attributes.rb | 188 +++ ...rity_monitoring_dataset_dependents_data.rb | 165 +++ ...rity_monitoring_dataset_dependents_type.rb | 26 + .../security_monitoring_dataset_response.rb | 123 ++ .../security_monitoring_dataset_search.rb | 123 ++ ...security_monitoring_dataset_time_window.rb | 115 ++ .../security_monitoring_dataset_type.rb | 26 + ...security_monitoring_dataset_update_data.rb | 144 +++ ...urity_monitoring_dataset_update_request.rb | 123 ++ ...security_monitoring_dataset_update_type.rb | 26 + ...curity_monitoring_dataset_version_entry.rb | 146 +++ ...monitoring_dataset_version_field_change.rb | 165 +++ ...ring_dataset_version_history_attributes.rb | 144 +++ ...monitoring_dataset_version_history_data.rb | 165 +++ ...toring_dataset_version_history_response.rb | 123 ++ ...monitoring_dataset_version_history_type.rb | 26 + .../security_monitoring_datasets_list_meta.rb | 123 ++ ...urity_monitoring_datasets_list_response.rb | 146 +++ 48 files changed, 6378 insertions(+), 14 deletions(-) create mode 100644 examples/v2/security-monitoring/BatchGetSecurityMonitoringDatasetDependencies.rb create mode 100644 examples/v2/security-monitoring/CreateSecurityMonitoringDataset.rb create mode 100644 examples/v2/security-monitoring/DeleteSecurityMonitoringDataset.rb create mode 100644 examples/v2/security-monitoring/GetSecurityMonitoringDataset.rb create mode 100644 examples/v2/security-monitoring/GetSecurityMonitoringDatasetByVersion.rb create mode 100644 examples/v2/security-monitoring/GetSecurityMonitoringDatasetVersionHistory.rb create mode 100644 examples/v2/security-monitoring/ListSecurityMonitoringDatasets.rb create mode 100644 examples/v2/security-monitoring/UpdateSecurityMonitoringDataset.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_attributes_request.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_attributes_response.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_column.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_create_data.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_create_request.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_create_response.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_create_response_data.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_create_type.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_data.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_definition.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_dependencies_request.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_dependencies_request_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_dependencies_request_data.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_dependencies_response.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_dependents_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_dependents_data.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_dependents_type.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_response.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_search.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_time_window.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_type.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_update_data.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_update_request.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_update_type.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_version_entry.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_version_field_change.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_version_history_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_version_history_data.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_version_history_response.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_version_history_type.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_datasets_list_meta.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_datasets_list_response.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 2692eaaf1cfc..c1ed29256660 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1557,6 +1557,14 @@ components: required: true schema: type: string + SecurityMonitoringDatasetID: + description: The UUID of the dataset. + in: path + name: dataset_id + required: true + schema: + example: 123e4567-e89b-12d3-a456-426614174000 + type: string SecurityMonitoringIntegrationConfigID: description: The ID of the entity context sync configuration. in: path @@ -66681,9 +66689,6 @@ components: filter: description: Filter expression applied to the recommendations. type: string - scope: - description: Recommendations scope. Defaults to `ccm`; use `experiment` for experimental recommendations or `*` for both. - type: string sort: description: Ordered list of sort clauses applied to the result set. items: @@ -74006,6 +74011,495 @@ components: $ref: "#/components/schemas/SecurityMonitoringCriticalAsset" type: array type: object + SecurityMonitoringDatasetAttributesRequest: + description: The attributes of a dataset create or update request. + properties: + definition: + $ref: "#/components/schemas/SecurityMonitoringDatasetDefinition" + description: + description: The description of the dataset. Maximum 255 characters. + example: A sample dataset used for detection rules. + type: string + version: + description: |- + The expected current version of the dataset for optimistic concurrency control on updates. + If the dataset's current version does not match, the request is rejected with a 409 Conflict. + example: 1 + format: int64 + type: integer + required: + - definition + type: object + SecurityMonitoringDatasetAttributesResponse: + description: The attributes of a Cloud SIEM dataset. + properties: + createdAt: + description: The creation timestamp of the dataset, in ISO 8601 format. + example: "2025-03-20T10:00:00Z" + type: string + createdByHandle: + description: The Datadog handle of the user who created the dataset. + example: bruce.lee + type: string + createdByName: + description: The display name of the user who created the dataset. + example: Bruce Lee + type: string + definition: + $ref: "#/components/schemas/SecurityMonitoringDatasetDefinition" + description: + description: The description of the dataset. + example: A sample dataset used for detection rules. + type: string + id: + description: The UUID of the dataset. + example: 123e4567-e89b-12d3-a456-426614174000 + type: string + isDefault: + description: Whether the dataset is an out-of-the-box dataset provided by Datadog. + example: false + type: boolean + isDeprecated: + description: Whether the dataset is marked as deprecated. + example: false + type: boolean + modifiedAt: + description: The timestamp of the last modification of the dataset, in ISO 8601 format. + example: "2025-03-20T10:00:00Z" + type: string + name: + description: The unique name of the dataset. + example: sample_dataset + type: string + updatedByHandle: + description: The Datadog handle of the user who last updated the dataset. + example: bruce.lee + nullable: true + type: string + updatedByName: + description: The display name of the user who last updated the dataset. + example: Bruce Lee + nullable: true + type: string + version: + description: The current version of the dataset. + example: 1 + format: int64 + type: integer + required: + - id + - name + - description + - version + - definition + - createdAt + - createdByHandle + - createdByName + - modifiedAt + - updatedByHandle + - updatedByName + - isDefault + - isDeprecated + type: object + SecurityMonitoringDatasetColumn: + description: A column exposed by an event platform dataset. + properties: + column: + description: The name of the column. + example: message + type: string + type: + description: The type of the column value. + example: string + type: string + required: + - column + - type + type: object + SecurityMonitoringDatasetCreateData: + description: The data wrapper of a dataset create request. + properties: + attributes: + $ref: "#/components/schemas/SecurityMonitoringDatasetAttributesRequest" + type: + $ref: "#/components/schemas/SecurityMonitoringDatasetCreateType" + required: + - type + - attributes + type: object + SecurityMonitoringDatasetCreateRequest: + description: Request body for creating a Cloud SIEM dataset. + properties: + data: + $ref: "#/components/schemas/SecurityMonitoringDatasetCreateData" + required: + - data + type: object + SecurityMonitoringDatasetCreateResponse: + description: Response returned after creating a dataset. + properties: + data: + $ref: "#/components/schemas/SecurityMonitoringDatasetCreateResponseData" + required: + - data + type: object + SecurityMonitoringDatasetCreateResponseData: + description: The data wrapper of a dataset create response. + properties: + id: + description: The UUID of the newly created dataset. + example: 123e4567-e89b-12d3-a456-426614174000 + type: string + type: + $ref: "#/components/schemas/SecurityMonitoringDatasetType" + required: + - id + - type + type: object + SecurityMonitoringDatasetCreateType: + description: The type of resource for a dataset create request. + enum: + - datasetCreate + example: datasetCreate + type: string + x-enum-varnames: + - DATASET_CREATE + SecurityMonitoringDatasetData: + description: The data wrapper of a dataset response. + properties: + attributes: + $ref: "#/components/schemas/SecurityMonitoringDatasetAttributesResponse" + id: + description: The UUID of the dataset. + example: 123e4567-e89b-12d3-a456-426614174000 + type: string + type: + $ref: "#/components/schemas/SecurityMonitoringDatasetType" + required: + - id + - type + - attributes + type: object + SecurityMonitoringDatasetDefinition: + description: |- + The definition of the dataset. The shape depends on the value of `data_source`. + Use `reference_table` or `managed_resource` for a referential dataset, or one of the + event platform sources (for example `logs`, `audit`, `events`, `spans`, `rum`) for + an event platform dataset. + properties: + columns: + description: For event platform datasets, the list of columns exposed by the dataset. + items: + $ref: "#/components/schemas/SecurityMonitoringDatasetColumn" + type: array + data_source: + description: The data source backing this dataset definition. + example: logs + type: string + indexes: + description: For event platform datasets, the list of indexes to query. + items: + type: string + type: array + name: + description: The unique name of the dataset. Must start with a lowercase letter and contain only lowercase letters, digits, and underscores (max 255 characters). + example: sample_dataset + type: string + query_filter: + description: For referential datasets, an optional filter expression applied to the table. + example: status = 'active' + type: string + search: + $ref: "#/components/schemas/SecurityMonitoringDatasetSearch" + storage: + description: Storage tier the dataset reads from. Applies to event platform datasets. + example: hot + type: string + table_name: + description: For referential datasets, the name of the underlying table. + example: my_reference_table + type: string + time_window: + $ref: "#/components/schemas/SecurityMonitoringDatasetTimeWindow" + required: + - data_source + - name + type: object + SecurityMonitoringDatasetDependenciesRequest: + description: Request body for retrieving dependencies of a batch of datasets. + properties: + data: + $ref: "#/components/schemas/SecurityMonitoringDatasetDependenciesRequestData" + required: + - data + type: object + SecurityMonitoringDatasetDependenciesRequestAttributes: + description: The attributes of a dataset dependencies request. + properties: + datasetIds: + description: The list of dataset UUIDs to query dependencies for. Must contain between 1 and 100 items. + example: + - 123e4567-e89b-12d3-a456-426614174000 + items: + type: string + type: array + required: + - datasetIds + type: object + SecurityMonitoringDatasetDependenciesRequestData: + description: The data wrapper of a dataset dependencies request. + properties: + attributes: + $ref: "#/components/schemas/SecurityMonitoringDatasetDependenciesRequestAttributes" + required: + - attributes + type: object + SecurityMonitoringDatasetDependenciesResponse: + description: Response listing the dependents of each requested dataset. + properties: + data: + $ref: "#/components/schemas/SecurityMonitoringDatasetDependenciesResponseData" + required: + - data + type: object + SecurityMonitoringDatasetDependenciesResponseData: + description: The list of dataset dependents entries. + items: + $ref: "#/components/schemas/SecurityMonitoringDatasetDependentsData" + type: array + SecurityMonitoringDatasetDependentsAttributes: + description: The attributes of a dataset dependents entry. + properties: + count: + description: The number of resources that depend on the dataset. + example: 0 + format: int64 + type: integer + datasetId: + description: The UUID of the dataset whose dependencies are being reported. + example: 123e4567-e89b-12d3-a456-426614174000 + type: string + ids: + $ref: "#/components/schemas/SecurityMonitoringDatasetDependentsIds" + resource_type: + description: The type of resource that depends on the dataset. + example: security_detection_rule + type: string + required: + - datasetId + - resource_type + - ids + - count + type: object + SecurityMonitoringDatasetDependentsData: + description: A single entry describing the dependents of one dataset. + properties: + attributes: + $ref: "#/components/schemas/SecurityMonitoringDatasetDependentsAttributes" + id: + description: The UUID of the dataset. + example: 123e4567-e89b-12d3-a456-426614174000 + type: string + type: + $ref: "#/components/schemas/SecurityMonitoringDatasetDependentsType" + required: + - id + - type + - attributes + type: object + SecurityMonitoringDatasetDependentsIds: + description: The list of resource IDs that depend on the dataset. + example: [] + items: + type: string + type: array + SecurityMonitoringDatasetDependentsType: + description: The type of resource for a dataset dependents entry. + enum: + - datasetDependents + example: datasetDependents + type: string + x-enum-varnames: + - DATASET_DEPENDENTS + SecurityMonitoringDatasetResponse: + description: Response containing a single Cloud SIEM dataset. + properties: + data: + $ref: "#/components/schemas/SecurityMonitoringDatasetData" + required: + - data + type: object + SecurityMonitoringDatasetSearch: + description: The search clause applied to an event platform dataset. + properties: + query: + description: The search query expression. + example: "*" + type: string + required: + - query + type: object + SecurityMonitoringDatasetTimeWindow: + description: An optional time window that overrides the default query time range. + properties: + from: + description: Inclusive start of the time window, in milliseconds since the Unix epoch. + example: 1700000000000 + format: int64 + type: integer + to: + description: Exclusive end of the time window, in milliseconds since the Unix epoch. + example: 1700003600000 + format: int64 + type: integer + type: object + SecurityMonitoringDatasetType: + description: The type of resource for a dataset response. + enum: + - dataset + example: dataset + type: string + x-enum-varnames: + - DATASET + SecurityMonitoringDatasetUpdateData: + description: The data wrapper of a dataset update request. + properties: + attributes: + $ref: "#/components/schemas/SecurityMonitoringDatasetAttributesRequest" + type: + $ref: "#/components/schemas/SecurityMonitoringDatasetUpdateType" + required: + - type + - attributes + type: object + SecurityMonitoringDatasetUpdateRequest: + description: Request body for updating a Cloud SIEM dataset. + properties: + data: + $ref: "#/components/schemas/SecurityMonitoringDatasetUpdateData" + required: + - data + type: object + SecurityMonitoringDatasetUpdateType: + description: The type of resource for a dataset update request. + enum: + - datasetUpdate + example: datasetUpdate + type: string + x-enum-varnames: + - DATASET_UPDATE + SecurityMonitoringDatasetVersionChanges: + description: The list of field changes between this version of the dataset and the previous one. + items: + $ref: "#/components/schemas/SecurityMonitoringDatasetVersionFieldChange" + type: array + SecurityMonitoringDatasetVersionEntry: + description: A single entry in the version history of a dataset. + properties: + changes: + $ref: "#/components/schemas/SecurityMonitoringDatasetVersionChanges" + dataset: + $ref: "#/components/schemas/SecurityMonitoringDatasetAttributesResponse" + required: + - dataset + - changes + type: object + SecurityMonitoringDatasetVersionFieldChange: + description: A single field change between two versions of a dataset. + properties: + current: + description: The current value of the field, serialized as a JSON value. + example: New description. + field: + description: The name of the field that changed. + example: description + type: string + previous: + description: The previous value of the field, serialized as a JSON value. + example: Old description. + required: + - field + - previous + - current + type: object + SecurityMonitoringDatasetVersionHistoryAttributes: + description: The attributes of a dataset version history response. + properties: + count: + description: The total number of versions available for this dataset. + example: 1 + format: int64 + type: integer + data: + $ref: "#/components/schemas/SecurityMonitoringDatasetVersionHistoryEntries" + required: + - data + - count + type: object + SecurityMonitoringDatasetVersionHistoryData: + description: The data wrapper of a dataset version history response. + properties: + attributes: + $ref: "#/components/schemas/SecurityMonitoringDatasetVersionHistoryAttributes" + id: + description: The UUID of the dataset. + example: 123e4567-e89b-12d3-a456-426614174000 + type: string + type: + $ref: "#/components/schemas/SecurityMonitoringDatasetVersionHistoryType" + required: + - id + - type + - attributes + type: object + SecurityMonitoringDatasetVersionHistoryEntries: + additionalProperties: + $ref: "#/components/schemas/SecurityMonitoringDatasetVersionEntry" + description: A map from version number (as a string) to the dataset state at that version. + type: object + SecurityMonitoringDatasetVersionHistoryResponse: + description: Response containing the version history of a Cloud SIEM dataset. + properties: + data: + $ref: "#/components/schemas/SecurityMonitoringDatasetVersionHistoryData" + required: + - data + type: object + SecurityMonitoringDatasetVersionHistoryType: + description: The type of resource for a dataset version history response. + enum: + - dataset_version_history + example: dataset_version_history + type: string + x-enum-varnames: + - DATASET_VERSION_HISTORY + SecurityMonitoringDatasetsListData: + description: A list of dataset data items. + items: + $ref: "#/components/schemas/SecurityMonitoringDatasetData" + type: array + SecurityMonitoringDatasetsListMeta: + description: Metadata returned with a list of datasets. + properties: + totalCount: + description: The total number of datasets matching the request, across all pages. + example: 1 + format: int64 + type: integer + required: + - totalCount + type: object + SecurityMonitoringDatasetsListResponse: + description: Response containing a paginated list of Cloud SIEM datasets. + properties: + data: + $ref: "#/components/schemas/SecurityMonitoringDatasetsListData" + meta: + $ref: "#/components/schemas/SecurityMonitoringDatasetsListMeta" + required: + - data + - meta + type: object SecurityMonitoringEntityContextEntityType: default: entity description: |- @@ -149621,6 +150115,644 @@ paths: 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/security_monitoring/datasets: + get: + description: |- + List all Cloud SIEM datasets available to the organization, including both + customer-defined datasets and Datadog out-of-the-box datasets. + operationId: ListSecurityMonitoringDatasets + parameters: + - description: Size for a given page. The maximum allowed value is 100. + in: query + name: page[size] + required: false + schema: + default: 50 + example: 50 + format: int64 + type: integer + - description: Specific page number to return. + in: query + name: page[number] + required: false + schema: + default: 1 + example: 1 + format: int64 + type: integer + - description: Attribute used to sort datasets. Prefix with `-` to sort in descending order. + in: query + name: sort + required: false + schema: + example: name + type: string + - description: A search query to filter datasets by name or description. + in: query + name: filter[query] + required: false + schema: + example: sample_dataset + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + createdAt: "2025-03-20T10:00:00Z" + createdByHandle: bruce.lee + createdByName: Bruce Lee + definition: + columns: + - column: message + type: string + data_source: logs + indexes: + - main + name: sample_dataset + search: + query: "*" + description: A sample dataset used for detection rules. + id: 123e4567-e89b-12d3-a456-426614174000 + isDefault: false + isDeprecated: false + modifiedAt: "2025-03-20T10:00:00Z" + name: sample_dataset + updatedByHandle: + updatedByName: + version: 1 + id: 123e4567-e89b-12d3-a456-426614174000 + type: dataset + meta: + totalCount: 1 + schema: + $ref: "#/components/schemas/SecurityMonitoringDatasetsListResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_rules_read + summary: List datasets + tags: + - Security Monitoring + "x-permission": + operator: OR + permissions: + - security_monitoring_rules_read + - security_monitoring_dataset_read + 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/). + post: + description: |- + Create a new Cloud SIEM dataset. A dataset bundles a data source, a set of + indexes, and a search query that can be referenced from detection rules. + operationId: CreateSecurityMonitoringDataset + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + definition: + columns: + - column: message + type: string + data_source: logs + indexes: + - main + name: sample_dataset + search: + query: "*" + description: A sample dataset used for detection rules. + type: datasetCreate + schema: + $ref: "#/components/schemas/SecurityMonitoringDatasetCreateRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + id: 123e4567-e89b-12d3-a456-426614174000 + type: dataset + schema: + $ref: "#/components/schemas/SecurityMonitoringDatasetCreateResponse" + description: Created + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Conflict + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_rules_write + summary: Create a dataset + tags: + - Security Monitoring + "x-permission": + operator: OR + permissions: + - security_monitoring_rules_write + - security_monitoring_dataset_write + 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/security_monitoring/datasets/dependencies: + post: + description: |- + Return, for each of the requested datasets, the list of detection rules that depend + on it. Useful for understanding the impact of updating or deleting a dataset. + operationId: BatchGetSecurityMonitoringDatasetDependencies + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + datasetIds: + - 123e4567-e89b-12d3-a456-426614174000 + schema: + $ref: "#/components/schemas/SecurityMonitoringDatasetDependenciesRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + count: 0 + datasetId: 123e4567-e89b-12d3-a456-426614174000 + ids: [] + resource_type: security_detection_rule + id: 123e4567-e89b-12d3-a456-426614174000 + type: datasetDependents + schema: + $ref: "#/components/schemas/SecurityMonitoringDatasetDependenciesResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_rules_read + summary: Get dataset dependencies + tags: + - Security Monitoring + "x-permission": + operator: OR + permissions: + - security_monitoring_rules_read + - security_monitoring_dataset_read + 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/security_monitoring/datasets/{dataset_id}: + delete: + description: |- + Delete a Cloud SIEM dataset. Out-of-the-box datasets cannot be deleted and + deleting a dataset that is referenced by a detection rule is rejected. + operationId: DeleteSecurityMonitoringDataset + parameters: + - $ref: "#/components/parameters/SecurityMonitoringDatasetID" + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_rules_write + summary: Delete a dataset + tags: + - Security Monitoring + "x-permission": + operator: OR + permissions: + - security_monitoring_rules_write + - security_monitoring_dataset_write + 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/). + get: + description: Get the current version of a Cloud SIEM dataset by ID. + operationId: GetSecurityMonitoringDataset + parameters: + - $ref: "#/components/parameters/SecurityMonitoringDatasetID" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + createdAt: "2025-03-20T10:00:00Z" + createdByHandle: bruce.lee + createdByName: Bruce Lee + definition: + columns: + - column: message + type: string + data_source: logs + indexes: + - main + name: sample_dataset + search: + query: "*" + description: A sample dataset used for detection rules. + id: 123e4567-e89b-12d3-a456-426614174000 + isDefault: false + isDeprecated: false + modifiedAt: "2025-03-20T10:00:00Z" + name: sample_dataset + updatedByHandle: + updatedByName: + version: 1 + id: 123e4567-e89b-12d3-a456-426614174000 + type: dataset + schema: + $ref: "#/components/schemas/SecurityMonitoringDatasetResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_rules_read + summary: Get a dataset + tags: + - Security Monitoring + "x-permission": + operator: OR + permissions: + - security_monitoring_rules_read + - security_monitoring_dataset_read + 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/). + patch: + description: |- + Update an existing Cloud SIEM dataset. The current version of the dataset can be + provided to detect concurrent modifications. + operationId: UpdateSecurityMonitoringDataset + parameters: + - $ref: "#/components/parameters/SecurityMonitoringDatasetID" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + definition: + columns: + - column: message + type: string + data_source: logs + indexes: + - main + name: sample_dataset + search: + query: "*" + description: An updated description for the dataset. + version: 1 + type: datasetUpdate + schema: + $ref: "#/components/schemas/SecurityMonitoringDatasetUpdateRequest" + required: true + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Conflict + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_rules_write + summary: Update a dataset + tags: + - Security Monitoring + "x-permission": + operator: OR + permissions: + - security_monitoring_rules_write + - security_monitoring_dataset_write + 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/security_monitoring/datasets/{dataset_id}/version/{version}: + get: + description: Retrieve a specific historical version of a Cloud SIEM dataset. + operationId: GetSecurityMonitoringDatasetByVersion + parameters: + - $ref: "#/components/parameters/SecurityMonitoringDatasetID" + - description: The version number of the dataset to retrieve. + in: path + name: version + required: true + schema: + example: 1 + format: int64 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + createdAt: "2025-03-20T10:00:00Z" + createdByHandle: bruce.lee + createdByName: Bruce Lee + definition: + columns: + - column: message + type: string + data_source: logs + indexes: + - main + name: sample_dataset + search: + query: "*" + description: A sample dataset used for detection rules. + id: 123e4567-e89b-12d3-a456-426614174000 + isDefault: false + isDeprecated: false + modifiedAt: "2025-03-20T10:00:00Z" + name: sample_dataset + updatedByHandle: + updatedByName: + version: 1 + id: 123e4567-e89b-12d3-a456-426614174000 + type: dataset + schema: + $ref: "#/components/schemas/SecurityMonitoringDatasetResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_rules_read + summary: Get a dataset at a specific version + tags: + - Security Monitoring + "x-permission": + operator: OR + permissions: + - security_monitoring_rules_read + - security_monitoring_dataset_read + 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/security_monitoring/datasets/{dataset_id}/version_history: + get: + description: Retrieve the version history of a Cloud SIEM dataset, including the changes made at each version. + operationId: GetSecurityMonitoringDatasetVersionHistory + parameters: + - $ref: "#/components/parameters/SecurityMonitoringDatasetID" + - description: Size for a given page. The maximum allowed value is 100. + in: query + name: page[size] + required: false + schema: + default: 10 + example: 10 + format: int64 + type: integer + - description: Specific page number to return. + in: query + name: page[number] + required: false + schema: + default: 0 + example: 0 + format: int64 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + count: 1 + data: + "1": + changes: [] + dataset: + createdAt: "2025-03-20T10:00:00Z" + createdByHandle: bruce.lee + createdByName: Bruce Lee + definition: + columns: + - column: message + type: string + data_source: logs + indexes: + - main + name: sample_dataset + search: + query: "*" + description: A sample dataset used for detection rules. + id: 123e4567-e89b-12d3-a456-426614174000 + isDefault: false + isDeprecated: false + modifiedAt: "2025-03-20T10:00:00Z" + name: sample_dataset + updatedByHandle: + updatedByName: + version: 1 + id: 123e4567-e89b-12d3-a456-426614174000 + type: dataset_version_history + schema: + $ref: "#/components/schemas/SecurityMonitoringDatasetVersionHistoryResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_rules_read + summary: Get the version history of a dataset + tags: + - Security Monitoring + "x-permission": + operator: OR + permissions: + - security_monitoring_rules_read + - security_monitoring_dataset_read + 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/security_monitoring/entity_context: get: description: |- diff --git a/examples/v2/security-monitoring/BatchGetSecurityMonitoringDatasetDependencies.rb b/examples/v2/security-monitoring/BatchGetSecurityMonitoringDatasetDependencies.rb new file mode 100644 index 000000000000..f01de9ffeb66 --- /dev/null +++ b/examples/v2/security-monitoring/BatchGetSecurityMonitoringDatasetDependencies.rb @@ -0,0 +1,18 @@ +# Get dataset dependencies returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.batch_get_security_monitoring_dataset_dependencies".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::SecurityMonitoringDatasetDependenciesRequest.new({ + data: DatadogAPIClient::V2::SecurityMonitoringDatasetDependenciesRequestData.new({ + attributes: DatadogAPIClient::V2::SecurityMonitoringDatasetDependenciesRequestAttributes.new({ + dataset_ids: [ + "123e4567-e89b-12d3-a456-426614174000", + ], + }), + }), +}) +p api_instance.batch_get_security_monitoring_dataset_dependencies(body) diff --git a/examples/v2/security-monitoring/CreateSecurityMonitoringDataset.rb b/examples/v2/security-monitoring/CreateSecurityMonitoringDataset.rb new file mode 100644 index 000000000000..484517f1e623 --- /dev/null +++ b/examples/v2/security-monitoring/CreateSecurityMonitoringDataset.rb @@ -0,0 +1,39 @@ +# Create a dataset returns "Created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_security_monitoring_dataset".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::SecurityMonitoringDatasetCreateRequest.new({ + data: DatadogAPIClient::V2::SecurityMonitoringDatasetCreateData.new({ + attributes: DatadogAPIClient::V2::SecurityMonitoringDatasetAttributesRequest.new({ + definition: DatadogAPIClient::V2::SecurityMonitoringDatasetDefinition.new({ + columns: [ + DatadogAPIClient::V2::SecurityMonitoringDatasetColumn.new({ + column: "message", + type: "string", + }), + ], + data_source: "logs", + indexes: [], + name: "sample_dataset", + query_filter: "status = 'active'", + search: DatadogAPIClient::V2::SecurityMonitoringDatasetSearch.new({ + query: "*", + }), + storage: "hot", + table_name: "my_reference_table", + time_window: DatadogAPIClient::V2::SecurityMonitoringDatasetTimeWindow.new({ + from: 1700000000000, + to: 1700003600000, + }), + }), + description: "A sample dataset used for detection rules.", + version: 1, + }), + type: DatadogAPIClient::V2::SecurityMonitoringDatasetCreateType::DATASET_CREATE, + }), +}) +p api_instance.create_security_monitoring_dataset(body) diff --git a/examples/v2/security-monitoring/DeleteSecurityMonitoringDataset.rb b/examples/v2/security-monitoring/DeleteSecurityMonitoringDataset.rb new file mode 100644 index 000000000000..d5a02ff3fe1e --- /dev/null +++ b/examples/v2/security-monitoring/DeleteSecurityMonitoringDataset.rb @@ -0,0 +1,8 @@ +# Delete a dataset returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_security_monitoring_dataset".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new +api_instance.delete_security_monitoring_dataset("123e4567-e89b-12d3-a456-426614174000") diff --git a/examples/v2/security-monitoring/GetSecurityMonitoringDataset.rb b/examples/v2/security-monitoring/GetSecurityMonitoringDataset.rb new file mode 100644 index 000000000000..a45797fc3c3d --- /dev/null +++ b/examples/v2/security-monitoring/GetSecurityMonitoringDataset.rb @@ -0,0 +1,8 @@ +# Get a dataset returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_security_monitoring_dataset".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new +p api_instance.get_security_monitoring_dataset("123e4567-e89b-12d3-a456-426614174000") diff --git a/examples/v2/security-monitoring/GetSecurityMonitoringDatasetByVersion.rb b/examples/v2/security-monitoring/GetSecurityMonitoringDatasetByVersion.rb new file mode 100644 index 000000000000..a766fe1a38b9 --- /dev/null +++ b/examples/v2/security-monitoring/GetSecurityMonitoringDatasetByVersion.rb @@ -0,0 +1,8 @@ +# Get a dataset at a specific version returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_security_monitoring_dataset_by_version".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new +p api_instance.get_security_monitoring_dataset_by_version("123e4567-e89b-12d3-a456-426614174000", 1) diff --git a/examples/v2/security-monitoring/GetSecurityMonitoringDatasetVersionHistory.rb b/examples/v2/security-monitoring/GetSecurityMonitoringDatasetVersionHistory.rb new file mode 100644 index 000000000000..0e139aa4e91f --- /dev/null +++ b/examples/v2/security-monitoring/GetSecurityMonitoringDatasetVersionHistory.rb @@ -0,0 +1,8 @@ +# Get the version history of a dataset returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_security_monitoring_dataset_version_history".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new +p api_instance.get_security_monitoring_dataset_version_history("123e4567-e89b-12d3-a456-426614174000") diff --git a/examples/v2/security-monitoring/ListSecurityMonitoringDatasets.rb b/examples/v2/security-monitoring/ListSecurityMonitoringDatasets.rb new file mode 100644 index 000000000000..95f686f338a9 --- /dev/null +++ b/examples/v2/security-monitoring/ListSecurityMonitoringDatasets.rb @@ -0,0 +1,8 @@ +# List datasets returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_security_monitoring_datasets".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new +p api_instance.list_security_monitoring_datasets() diff --git a/examples/v2/security-monitoring/UpdateSecurityMonitoringDataset.rb b/examples/v2/security-monitoring/UpdateSecurityMonitoringDataset.rb new file mode 100644 index 000000000000..d0730f97e4f8 --- /dev/null +++ b/examples/v2/security-monitoring/UpdateSecurityMonitoringDataset.rb @@ -0,0 +1,39 @@ +# Update a dataset returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_security_monitoring_dataset".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::SecurityMonitoringDatasetUpdateRequest.new({ + data: DatadogAPIClient::V2::SecurityMonitoringDatasetUpdateData.new({ + attributes: DatadogAPIClient::V2::SecurityMonitoringDatasetAttributesRequest.new({ + definition: DatadogAPIClient::V2::SecurityMonitoringDatasetDefinition.new({ + columns: [ + DatadogAPIClient::V2::SecurityMonitoringDatasetColumn.new({ + column: "message", + type: "string", + }), + ], + data_source: "logs", + indexes: [], + name: "sample_dataset", + query_filter: "status = 'active'", + search: DatadogAPIClient::V2::SecurityMonitoringDatasetSearch.new({ + query: "*", + }), + storage: "hot", + table_name: "my_reference_table", + time_window: DatadogAPIClient::V2::SecurityMonitoringDatasetTimeWindow.new({ + from: 1700000000000, + to: 1700003600000, + }), + }), + description: "A sample dataset used for detection rules.", + version: 1, + }), + type: DatadogAPIClient::V2::SecurityMonitoringDatasetUpdateType::DATASET_UPDATE, + }), +}) +api_instance.update_security_monitoring_dataset("123e4567-e89b-12d3-a456-426614174000", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index aa666f33aa07..0f058611cc2b 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2193,6 +2193,37 @@ "v2.DeactivateContentPack" => { "content_pack_id" => "String", }, + "v2.ListSecurityMonitoringDatasets" => { + "page_size" => "Integer", + "page_number" => "Integer", + "sort" => "String", + "filter_query" => "String", + }, + "v2.CreateSecurityMonitoringDataset" => { + "body" => "SecurityMonitoringDatasetCreateRequest", + }, + "v2.BatchGetSecurityMonitoringDatasetDependencies" => { + "body" => "SecurityMonitoringDatasetDependenciesRequest", + }, + "v2.DeleteSecurityMonitoringDataset" => { + "dataset_id" => "String", + }, + "v2.GetSecurityMonitoringDataset" => { + "dataset_id" => "String", + }, + "v2.UpdateSecurityMonitoringDataset" => { + "dataset_id" => "String", + "body" => "SecurityMonitoringDatasetUpdateRequest", + }, + "v2.GetSecurityMonitoringDatasetByVersion" => { + "dataset_id" => "String", + "version" => "Integer", + }, + "v2.GetSecurityMonitoringDatasetVersionHistory" => { + "dataset_id" => "String", + "page_size" => "Integer", + "page_number" => "Integer", + }, "v2.GetEntityContext" => { "query" => "String", "from" => "String", diff --git a/features/v2/security_monitoring.feature b/features/v2/security_monitoring.feature index 5e6f325a43ad..f982d3c7077b 100644 --- a/features/v2/security_monitoring.feature +++ b/features/v2/security_monitoring.feature @@ -517,6 +517,30 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Create a dataset returns "Bad Request" response + Given operation "CreateSecurityMonitoringDataset" enabled + And new "CreateSecurityMonitoringDataset" request + And body with value {"data": {"attributes": {"definition": {"columns": [{"column": "message", "type": "string"}], "data_source": "logs", "indexes": [], "name": "sample_dataset", "query_filter": "status = 'active'", "search": {"query": "*"}, "storage": "hot", "table_name": "my_reference_table", "time_window": {"from": 1700000000000, "to": 1700003600000}}, "description": "A sample dataset used for detection rules.", "version": 1}, "type": "datasetCreate"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Create a dataset returns "Conflict" response + Given operation "CreateSecurityMonitoringDataset" enabled + And new "CreateSecurityMonitoringDataset" request + And body with value {"data": {"attributes": {"definition": {"columns": [{"column": "message", "type": "string"}], "data_source": "logs", "indexes": [], "name": "sample_dataset", "query_filter": "status = 'active'", "search": {"query": "*"}, "storage": "hot", "table_name": "my_reference_table", "time_window": {"from": 1700000000000, "to": 1700003600000}}, "description": "A sample dataset used for detection rules.", "version": 1}, "type": "datasetCreate"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Create a dataset returns "Created" response + Given operation "CreateSecurityMonitoringDataset" enabled + And new "CreateSecurityMonitoringDataset" request + And body with value {"data": {"attributes": {"definition": {"columns": [{"column": "message", "type": "string"}], "data_source": "logs", "indexes": [], "name": "sample_dataset", "query_filter": "status = 'active'", "search": {"query": "*"}, "storage": "hot", "table_name": "my_reference_table", "time_window": {"from": 1700000000000, "to": 1700003600000}}, "description": "A sample dataset used for detection rules.", "version": 1}, "type": "datasetCreate"}} + When the request is sent + Then the response status is 201 Created + @skip @team:DataDog/k9-cloud-siem Scenario: Create a detection rule returns "Bad Request" response Given new "CreateSecurityMonitoringRule" request @@ -885,6 +909,30 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Delete a dataset returns "Bad Request" response + Given operation "DeleteSecurityMonitoringDataset" enabled + And new "DeleteSecurityMonitoringDataset" request + And request contains "dataset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Delete a dataset returns "No Content" response + Given operation "DeleteSecurityMonitoringDataset" enabled + And new "DeleteSecurityMonitoringDataset" request + And request contains "dataset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Delete a dataset returns "Not Found" response + Given operation "DeleteSecurityMonitoringDataset" enabled + And new "DeleteSecurityMonitoringDataset" request + And request contains "dataset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @skip @team:DataDog/k9-cloud-siem Scenario: Delete a non existing rule returns "Not Found" response Given new "DeleteSecurityMonitoringRule" request @@ -1200,6 +1248,57 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get a dataset at a specific version returns "Bad Request" response + Given operation "GetSecurityMonitoringDatasetByVersion" enabled + And new "GetSecurityMonitoringDatasetByVersion" request + And request contains "dataset_id" parameter from "REPLACE.ME" + And request contains "version" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get a dataset at a specific version returns "Not Found" response + Given operation "GetSecurityMonitoringDatasetByVersion" enabled + And new "GetSecurityMonitoringDatasetByVersion" request + And request contains "dataset_id" parameter from "REPLACE.ME" + And request contains "version" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get a dataset at a specific version returns "OK" response + Given operation "GetSecurityMonitoringDatasetByVersion" enabled + And new "GetSecurityMonitoringDatasetByVersion" request + And request contains "dataset_id" parameter from "REPLACE.ME" + And request contains "version" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get a dataset returns "Bad Request" response + Given operation "GetSecurityMonitoringDataset" enabled + And new "GetSecurityMonitoringDataset" request + And request contains "dataset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get a dataset returns "Not Found" response + Given operation "GetSecurityMonitoringDataset" enabled + And new "GetSecurityMonitoringDataset" request + And request contains "dataset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get a dataset returns "OK" response + Given operation "GetSecurityMonitoringDataset" enabled + And new "GetSecurityMonitoringDataset" request + And request contains "dataset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-security-posture-management Scenario: Get a finding returns "Bad Request: The server cannot process the request due to invalid syntax in the request." response Given operation "GetFinding" enabled @@ -1571,6 +1670,22 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get dataset dependencies returns "Bad Request" response + Given operation "BatchGetSecurityMonitoringDatasetDependencies" enabled + And new "BatchGetSecurityMonitoringDatasetDependencies" request + And body with value {"data": {"attributes": {"datasetIds": ["123e4567-e89b-12d3-a456-426614174000"]}}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get dataset dependencies returns "OK" response + Given operation "BatchGetSecurityMonitoringDatasetDependencies" enabled + And new "BatchGetSecurityMonitoringDatasetDependencies" request + And body with value {"data": {"attributes": {"datasetIds": ["123e4567-e89b-12d3-a456-426614174000"]}}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/k9-vm-ast Scenario: Get default rulesets for a language returns "Bad Request" response Given operation "GetStaticAnalysisDefaultRulesets" enabled @@ -1797,6 +1912,30 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 The list of notification rules. + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get the version history of a dataset returns "Bad Request" response + Given operation "GetSecurityMonitoringDatasetVersionHistory" enabled + And new "GetSecurityMonitoringDatasetVersionHistory" request + And request contains "dataset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get the version history of a dataset returns "Not Found" response + Given operation "GetSecurityMonitoringDatasetVersionHistory" enabled + And new "GetSecurityMonitoringDatasetVersionHistory" request + And request contains "dataset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get the version history of a dataset returns "OK" response + Given operation "GetSecurityMonitoringDatasetVersionHistory" enabled + And new "GetSecurityMonitoringDatasetVersionHistory" request + And request contains "dataset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/k9-cloud-siem Scenario: Get the version history of security filters returns "OK" response Given new "ListSecurityFilterVersions" request @@ -1861,6 +2000,20 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: List datasets returns "Bad Request" response + Given operation "ListSecurityMonitoringDatasets" enabled + And new "ListSecurityMonitoringDatasets" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: List datasets returns "OK" response + Given operation "ListSecurityMonitoringDatasets" enabled + And new "ListSecurityMonitoringDatasets" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/k9-cloud-siem Scenario: List entity context sync configurations returns "OK" response Given operation "ListSecurityMonitoringIntegrationConfigs" enabled @@ -2525,6 +2678,42 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Update a dataset returns "Bad Request" response + Given operation "UpdateSecurityMonitoringDataset" enabled + And new "UpdateSecurityMonitoringDataset" request + And request contains "dataset_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"definition": {"columns": [{"column": "message", "type": "string"}], "data_source": "logs", "indexes": [], "name": "sample_dataset", "query_filter": "status = 'active'", "search": {"query": "*"}, "storage": "hot", "table_name": "my_reference_table", "time_window": {"from": 1700000000000, "to": 1700003600000}}, "description": "A sample dataset used for detection rules.", "version": 1}, "type": "datasetUpdate"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Update a dataset returns "Conflict" response + Given operation "UpdateSecurityMonitoringDataset" enabled + And new "UpdateSecurityMonitoringDataset" request + And request contains "dataset_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"definition": {"columns": [{"column": "message", "type": "string"}], "data_source": "logs", "indexes": [], "name": "sample_dataset", "query_filter": "status = 'active'", "search": {"query": "*"}, "storage": "hot", "table_name": "my_reference_table", "time_window": {"from": 1700000000000, "to": 1700003600000}}, "description": "A sample dataset used for detection rules.", "version": 1}, "type": "datasetUpdate"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Update a dataset returns "No Content" response + Given operation "UpdateSecurityMonitoringDataset" enabled + And new "UpdateSecurityMonitoringDataset" request + And request contains "dataset_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"definition": {"columns": [{"column": "message", "type": "string"}], "data_source": "logs", "indexes": [], "name": "sample_dataset", "query_filter": "status = 'active'", "search": {"query": "*"}, "storage": "hot", "table_name": "my_reference_table", "time_window": {"from": 1700000000000, "to": 1700003600000}}, "description": "A sample dataset used for detection rules.", "version": 1}, "type": "datasetUpdate"}} + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Update a dataset returns "Not Found" response + Given operation "UpdateSecurityMonitoringDataset" enabled + And new "UpdateSecurityMonitoringDataset" request + And request contains "dataset_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"definition": {"columns": [{"column": "message", "type": "string"}], "data_source": "logs", "indexes": [], "name": "sample_dataset", "query_filter": "status = 'active'", "search": {"query": "*"}, "storage": "hot", "table_name": "my_reference_table", "time_window": {"from": 1700000000000, "to": 1700003600000}}, "description": "A sample dataset used for detection rules.", "version": 1}, "type": "datasetUpdate"}} + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/k9-cloud-siem Scenario: Update a security filter returns "Bad Request" response Given new "UpdateSecurityFilter" request diff --git a/features/v2/undo.json b/features/v2/undo.json index a359fccfe1e1..d86d61c22888 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -6487,6 +6487,61 @@ "type": "idempotent" } }, + "ListSecurityMonitoringDatasets": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "CreateSecurityMonitoringDataset": { + "tag": "Security Monitoring", + "undo": { + "operationId": "DeleteSecurityMonitoringDataset", + "parameters": [ + { + "name": "dataset_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "BatchGetSecurityMonitoringDatasetDependencies": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "DeleteSecurityMonitoringDataset": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "GetSecurityMonitoringDataset": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "UpdateSecurityMonitoringDataset": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "GetSecurityMonitoringDatasetByVersion": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "GetSecurityMonitoringDatasetVersionHistory": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, "GetEntityContext": { "tag": "Security Monitoring", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 5a03723136cb..ed737191502f 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -315,18 +315,21 @@ def initialize "v2.get_aws_cloud_auth_persona_mapping": false, "v2.list_aws_cloud_auth_persona_mappings": false, "v2.activate_content_pack": false, + "v2.batch_get_security_monitoring_dataset_dependencies": false, "v2.bulk_create_sample_log_generation_subscriptions": false, "v2.bulk_export_security_monitoring_terraform_resources": false, "v2.cancel_historical_job": false, "v2.convert_job_result_to_signal": false, "v2.convert_security_monitoring_terraform_resource": false, "v2.create_sample_log_generation_subscription": false, + "v2.create_security_monitoring_dataset": false, "v2.create_security_monitoring_integration_config": false, "v2.create_static_analysis_ast": false, "v2.create_static_analysis_server_analysis": false, "v2.deactivate_content_pack": false, "v2.delete_historical_job": false, "v2.delete_sample_log_generation_subscription": false, + "v2.delete_security_monitoring_dataset": false, "v2.delete_security_monitoring_integration_config": false, "v2.export_security_monitoring_terraform_resource": false, "v2.get_content_packs_states": false, @@ -336,6 +339,9 @@ def initialize "v2.get_indicator_of_compromise": false, "v2.get_rule_version_history": false, "v2.get_secrets_rules": false, + "v2.get_security_monitoring_dataset": false, + "v2.get_security_monitoring_dataset_by_version": false, + "v2.get_security_monitoring_dataset_version_history": false, "v2.get_security_monitoring_histsignal": false, "v2.get_security_monitoring_histsignals_by_job_id": false, "v2.get_security_monitoring_integration_config": false, @@ -350,6 +356,7 @@ def initialize "v2.list_multiple_rulesets": false, "v2.list_sample_log_generation_subscriptions": false, "v2.list_scanned_assets_metadata": false, + "v2.list_security_monitoring_datasets": false, "v2.list_security_monitoring_histsignals": false, "v2.list_security_monitoring_integration_configs": false, "v2.list_static_analysis_codegen_rulesets": false, @@ -359,6 +366,7 @@ def initialize "v2.mute_security_findings": false, "v2.run_historical_job": false, "v2.search_security_monitoring_histsignals": false, + "v2.update_security_monitoring_dataset": false, "v2.update_security_monitoring_integration_config": false, "v2.validate_security_monitoring_integration_config": false, "v2.validate_security_monitoring_integration_credentials": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 339c8adea522..0ebb3083ada8 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -5700,6 +5700,38 @@ def overrides "v2.security_monitoring_critical_asset_update_attributes" => "SecurityMonitoringCriticalAssetUpdateAttributes", "v2.security_monitoring_critical_asset_update_data" => "SecurityMonitoringCriticalAssetUpdateData", "v2.security_monitoring_critical_asset_update_request" => "SecurityMonitoringCriticalAssetUpdateRequest", + "v2.security_monitoring_dataset_attributes_request" => "SecurityMonitoringDatasetAttributesRequest", + "v2.security_monitoring_dataset_attributes_response" => "SecurityMonitoringDatasetAttributesResponse", + "v2.security_monitoring_dataset_column" => "SecurityMonitoringDatasetColumn", + "v2.security_monitoring_dataset_create_data" => "SecurityMonitoringDatasetCreateData", + "v2.security_monitoring_dataset_create_request" => "SecurityMonitoringDatasetCreateRequest", + "v2.security_monitoring_dataset_create_response" => "SecurityMonitoringDatasetCreateResponse", + "v2.security_monitoring_dataset_create_response_data" => "SecurityMonitoringDatasetCreateResponseData", + "v2.security_monitoring_dataset_create_type" => "SecurityMonitoringDatasetCreateType", + "v2.security_monitoring_dataset_data" => "SecurityMonitoringDatasetData", + "v2.security_monitoring_dataset_definition" => "SecurityMonitoringDatasetDefinition", + "v2.security_monitoring_dataset_dependencies_request" => "SecurityMonitoringDatasetDependenciesRequest", + "v2.security_monitoring_dataset_dependencies_request_attributes" => "SecurityMonitoringDatasetDependenciesRequestAttributes", + "v2.security_monitoring_dataset_dependencies_request_data" => "SecurityMonitoringDatasetDependenciesRequestData", + "v2.security_monitoring_dataset_dependencies_response" => "SecurityMonitoringDatasetDependenciesResponse", + "v2.security_monitoring_dataset_dependents_attributes" => "SecurityMonitoringDatasetDependentsAttributes", + "v2.security_monitoring_dataset_dependents_data" => "SecurityMonitoringDatasetDependentsData", + "v2.security_monitoring_dataset_dependents_type" => "SecurityMonitoringDatasetDependentsType", + "v2.security_monitoring_dataset_response" => "SecurityMonitoringDatasetResponse", + "v2.security_monitoring_dataset_search" => "SecurityMonitoringDatasetSearch", + "v2.security_monitoring_datasets_list_meta" => "SecurityMonitoringDatasetsListMeta", + "v2.security_monitoring_datasets_list_response" => "SecurityMonitoringDatasetsListResponse", + "v2.security_monitoring_dataset_time_window" => "SecurityMonitoringDatasetTimeWindow", + "v2.security_monitoring_dataset_type" => "SecurityMonitoringDatasetType", + "v2.security_monitoring_dataset_update_data" => "SecurityMonitoringDatasetUpdateData", + "v2.security_monitoring_dataset_update_request" => "SecurityMonitoringDatasetUpdateRequest", + "v2.security_monitoring_dataset_update_type" => "SecurityMonitoringDatasetUpdateType", + "v2.security_monitoring_dataset_version_entry" => "SecurityMonitoringDatasetVersionEntry", + "v2.security_monitoring_dataset_version_field_change" => "SecurityMonitoringDatasetVersionFieldChange", + "v2.security_monitoring_dataset_version_history_attributes" => "SecurityMonitoringDatasetVersionHistoryAttributes", + "v2.security_monitoring_dataset_version_history_data" => "SecurityMonitoringDatasetVersionHistoryData", + "v2.security_monitoring_dataset_version_history_response" => "SecurityMonitoringDatasetVersionHistoryResponse", + "v2.security_monitoring_dataset_version_history_type" => "SecurityMonitoringDatasetVersionHistoryType", "v2.security_monitoring_filter" => "SecurityMonitoringFilter", "v2.security_monitoring_filter_action" => "SecurityMonitoringFilterAction", "v2.security_monitoring_integration_config_attributes" => "SecurityMonitoringIntegrationConfigAttributes", diff --git a/lib/datadog_api_client/v2/api/security_monitoring_api.rb b/lib/datadog_api_client/v2/api/security_monitoring_api.rb index ffdabf0f2b09..588888fdea20 100644 --- a/lib/datadog_api_client/v2/api/security_monitoring_api.rb +++ b/lib/datadog_api_client/v2/api/security_monitoring_api.rb @@ -237,6 +237,80 @@ def attach_jira_issue_with_http_info(body, opts = {}) return data, status_code, headers end + # Get dataset dependencies. + # + # @see #batch_get_security_monitoring_dataset_dependencies_with_http_info + def batch_get_security_monitoring_dataset_dependencies(body, opts = {}) + data, _status_code, _headers = batch_get_security_monitoring_dataset_dependencies_with_http_info(body, opts) + data + end + + # Get dataset dependencies. + # + # Return, for each of the requested datasets, the list of detection rules that depend + # on it. Useful for understanding the impact of updating or deleting a dataset. + # + # @param body [SecurityMonitoringDatasetDependenciesRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(SecurityMonitoringDatasetDependenciesResponse, Integer, Hash)>] SecurityMonitoringDatasetDependenciesResponse data, response status code and response headers + def batch_get_security_monitoring_dataset_dependencies_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.batch_get_security_monitoring_dataset_dependencies".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.batch_get_security_monitoring_dataset_dependencies") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.batch_get_security_monitoring_dataset_dependencies")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.batch_get_security_monitoring_dataset_dependencies ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.batch_get_security_monitoring_dataset_dependencies" + end + # resource path + local_var_path = '/api/v2/security_monitoring/datasets/dependencies' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'SecurityMonitoringDatasetDependenciesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :batch_get_security_monitoring_dataset_dependencies, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#batch_get_security_monitoring_dataset_dependencies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Bulk subscribe to sample log generation. # # @see #bulk_create_sample_log_generation_subscriptions_with_http_info @@ -1534,6 +1608,80 @@ def create_security_monitoring_critical_asset_with_http_info(body, opts = {}) return data, status_code, headers end + # Create a dataset. + # + # @see #create_security_monitoring_dataset_with_http_info + def create_security_monitoring_dataset(body, opts = {}) + data, _status_code, _headers = create_security_monitoring_dataset_with_http_info(body, opts) + data + end + + # Create a dataset. + # + # Create a new Cloud SIEM dataset. A dataset bundles a data source, a set of + # indexes, and a search query that can be referenced from detection rules. + # + # @param body [SecurityMonitoringDatasetCreateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(SecurityMonitoringDatasetCreateResponse, Integer, Hash)>] SecurityMonitoringDatasetCreateResponse data, response status code and response headers + def create_security_monitoring_dataset_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_security_monitoring_dataset".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_security_monitoring_dataset") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_security_monitoring_dataset")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.create_security_monitoring_dataset ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.create_security_monitoring_dataset" + end + # resource path + local_var_path = '/api/v2/security_monitoring/datasets' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'SecurityMonitoringDatasetCreateResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_security_monitoring_dataset, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#create_security_monitoring_dataset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create an entity context sync configuration. # # @see #create_security_monitoring_integration_config_with_http_info @@ -2442,6 +2590,78 @@ def delete_security_monitoring_critical_asset_with_http_info(critical_asset_id, return data, status_code, headers end + # Delete a dataset. + # + # @see #delete_security_monitoring_dataset_with_http_info + def delete_security_monitoring_dataset(dataset_id, opts = {}) + delete_security_monitoring_dataset_with_http_info(dataset_id, opts) + nil + end + + # Delete a dataset. + # + # Delete a Cloud SIEM dataset. Out-of-the-box datasets cannot be deleted and + # deleting a dataset that is referenced by a detection rule is rejected. + # + # @param dataset_id [String] The UUID of the dataset. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_security_monitoring_dataset_with_http_info(dataset_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_security_monitoring_dataset".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_security_monitoring_dataset") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_security_monitoring_dataset")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.delete_security_monitoring_dataset ...' + end + # verify the required parameter 'dataset_id' is set + if @api_client.config.client_side_validation && dataset_id.nil? + fail ArgumentError, "Missing the required parameter 'dataset_id' when calling SecurityMonitoringAPI.delete_security_monitoring_dataset" + end + # resource path + local_var_path = '/api/v2/security_monitoring/datasets/{dataset_id}'.sub('{dataset_id}', CGI.escape(dataset_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :delete_security_monitoring_dataset, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#delete_security_monitoring_dataset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Delete an entity context sync configuration. # # @see #delete_security_monitoring_integration_config_with_http_info @@ -4204,6 +4424,228 @@ def get_security_monitoring_critical_asset_with_http_info(critical_asset_id, opt return data, status_code, headers end + # Get a dataset. + # + # @see #get_security_monitoring_dataset_with_http_info + def get_security_monitoring_dataset(dataset_id, opts = {}) + data, _status_code, _headers = get_security_monitoring_dataset_with_http_info(dataset_id, opts) + data + end + + # Get a dataset. + # + # Get the current version of a Cloud SIEM dataset by ID. + # + # @param dataset_id [String] The UUID of the dataset. + # @param opts [Hash] the optional parameters + # @return [Array<(SecurityMonitoringDatasetResponse, Integer, Hash)>] SecurityMonitoringDatasetResponse data, response status code and response headers + def get_security_monitoring_dataset_with_http_info(dataset_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_security_monitoring_dataset".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_security_monitoring_dataset") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_security_monitoring_dataset")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_security_monitoring_dataset ...' + end + # verify the required parameter 'dataset_id' is set + if @api_client.config.client_side_validation && dataset_id.nil? + fail ArgumentError, "Missing the required parameter 'dataset_id' when calling SecurityMonitoringAPI.get_security_monitoring_dataset" + end + # resource path + local_var_path = '/api/v2/security_monitoring/datasets/{dataset_id}'.sub('{dataset_id}', CGI.escape(dataset_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'SecurityMonitoringDatasetResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_security_monitoring_dataset, + :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: SecurityMonitoringAPI#get_security_monitoring_dataset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get a dataset at a specific version. + # + # @see #get_security_monitoring_dataset_by_version_with_http_info + def get_security_monitoring_dataset_by_version(dataset_id, version, opts = {}) + data, _status_code, _headers = get_security_monitoring_dataset_by_version_with_http_info(dataset_id, version, opts) + data + end + + # Get a dataset at a specific version. + # + # Retrieve a specific historical version of a Cloud SIEM dataset. + # + # @param dataset_id [String] The UUID of the dataset. + # @param version [Integer] The version number of the dataset to retrieve. + # @param opts [Hash] the optional parameters + # @return [Array<(SecurityMonitoringDatasetResponse, Integer, Hash)>] SecurityMonitoringDatasetResponse data, response status code and response headers + def get_security_monitoring_dataset_by_version_with_http_info(dataset_id, version, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_security_monitoring_dataset_by_version".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_security_monitoring_dataset_by_version") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_security_monitoring_dataset_by_version")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_security_monitoring_dataset_by_version ...' + end + # verify the required parameter 'dataset_id' is set + if @api_client.config.client_side_validation && dataset_id.nil? + fail ArgumentError, "Missing the required parameter 'dataset_id' when calling SecurityMonitoringAPI.get_security_monitoring_dataset_by_version" + end + # verify the required parameter 'version' is set + if @api_client.config.client_side_validation && version.nil? + fail ArgumentError, "Missing the required parameter 'version' when calling SecurityMonitoringAPI.get_security_monitoring_dataset_by_version" + end + # resource path + local_var_path = '/api/v2/security_monitoring/datasets/{dataset_id}/version/{version}'.sub('{dataset_id}', CGI.escape(dataset_id.to_s).gsub('%2F', '/')).sub('{version}', CGI.escape(version.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'SecurityMonitoringDatasetResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_security_monitoring_dataset_by_version, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#get_security_monitoring_dataset_by_version\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get the version history of a dataset. + # + # @see #get_security_monitoring_dataset_version_history_with_http_info + def get_security_monitoring_dataset_version_history(dataset_id, opts = {}) + data, _status_code, _headers = get_security_monitoring_dataset_version_history_with_http_info(dataset_id, opts) + data + end + + # Get the version history of a dataset. + # + # Retrieve the version history of a Cloud SIEM dataset, including the changes made at each version. + # + # @param dataset_id [String] The UUID of the dataset. + # @param opts [Hash] the optional parameters + # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. + # @option opts [Integer] :page_number Specific page number to return. + # @return [Array<(SecurityMonitoringDatasetVersionHistoryResponse, Integer, Hash)>] SecurityMonitoringDatasetVersionHistoryResponse data, response status code and response headers + def get_security_monitoring_dataset_version_history_with_http_info(dataset_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_security_monitoring_dataset_version_history".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_security_monitoring_dataset_version_history") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_security_monitoring_dataset_version_history")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_security_monitoring_dataset_version_history ...' + end + # verify the required parameter 'dataset_id' is set + if @api_client.config.client_side_validation && dataset_id.nil? + fail ArgumentError, "Missing the required parameter 'dataset_id' when calling SecurityMonitoringAPI.get_security_monitoring_dataset_version_history" + end + # resource path + local_var_path = '/api/v2/security_monitoring/datasets/{dataset_id}/version_history'.sub('{dataset_id}', CGI.escape(dataset_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].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] || 'SecurityMonitoringDatasetVersionHistoryResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_security_monitoring_dataset_version_history, + :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: SecurityMonitoringAPI#get_security_monitoring_dataset_version_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get a hist signal's details. # # @see #get_security_monitoring_histsignal_with_http_info @@ -6514,6 +6956,81 @@ def list_security_monitoring_critical_assets_with_http_info(opts = {}) return data, status_code, headers end + # List datasets. + # + # @see #list_security_monitoring_datasets_with_http_info + def list_security_monitoring_datasets(opts = {}) + data, _status_code, _headers = list_security_monitoring_datasets_with_http_info(opts) + data + end + + # List datasets. + # + # List all Cloud SIEM datasets available to the organization, including both + # customer-defined datasets and Datadog out-of-the-box datasets. + # + # @param opts [Hash] the optional parameters + # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. + # @option opts [Integer] :page_number Specific page number to return. + # @option opts [String] :sort Attribute used to sort datasets. Prefix with `-` to sort in descending order. + # @option opts [String] :filter_query A search query to filter datasets by name or description. + # @return [Array<(SecurityMonitoringDatasetsListResponse, Integer, Hash)>] SecurityMonitoringDatasetsListResponse data, response status code and response headers + def list_security_monitoring_datasets_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_security_monitoring_datasets".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_security_monitoring_datasets") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_security_monitoring_datasets")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_security_monitoring_datasets ...' + end + # resource path + local_var_path = '/api/v2/security_monitoring/datasets' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + query_params[:'filter[query]'] = opts[:'filter_query'] if !opts[:'filter_query'].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] || 'SecurityMonitoringDatasetsListResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_security_monitoring_datasets, + :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: SecurityMonitoringAPI#list_security_monitoring_datasets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # List hist signals. # # @see #list_security_monitoring_histsignals_with_http_info @@ -8443,6 +8960,85 @@ def update_security_monitoring_critical_asset_with_http_info(critical_asset_id, return data, status_code, headers end + # Update a dataset. + # + # @see #update_security_monitoring_dataset_with_http_info + def update_security_monitoring_dataset(dataset_id, body, opts = {}) + update_security_monitoring_dataset_with_http_info(dataset_id, body, opts) + nil + end + + # Update a dataset. + # + # Update an existing Cloud SIEM dataset. The current version of the dataset can be + # provided to detect concurrent modifications. + # + # @param dataset_id [String] The UUID of the dataset. + # @param body [SecurityMonitoringDatasetUpdateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_security_monitoring_dataset_with_http_info(dataset_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_security_monitoring_dataset".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_security_monitoring_dataset") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_security_monitoring_dataset")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.update_security_monitoring_dataset ...' + end + # verify the required parameter 'dataset_id' is set + if @api_client.config.client_side_validation && dataset_id.nil? + fail ArgumentError, "Missing the required parameter 'dataset_id' when calling SecurityMonitoringAPI.update_security_monitoring_dataset" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.update_security_monitoring_dataset" + end + # resource path + local_var_path = '/api/v2/security_monitoring/datasets/{dataset_id}'.sub('{dataset_id}', CGI.escape(dataset_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_security_monitoring_dataset, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#update_security_monitoring_dataset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Update an entity context sync configuration. # # @see #update_security_monitoring_integration_config_with_http_info diff --git a/lib/datadog_api_client/v2/models/recommendations_filter_request.rb b/lib/datadog_api_client/v2/models/recommendations_filter_request.rb index f46c56cfe498..c18f10b6c257 100644 --- a/lib/datadog_api_client/v2/models/recommendations_filter_request.rb +++ b/lib/datadog_api_client/v2/models/recommendations_filter_request.rb @@ -24,9 +24,6 @@ class RecommendationsFilterRequest # Filter expression applied to the recommendations. attr_accessor :filter - # Recommendations scope. Defaults to `ccm`; use `experiment` for experimental recommendations or `*` for both. - attr_accessor :scope - # Ordered list of sort clauses applied to the result set. attr_accessor :sort @@ -40,7 +37,6 @@ class RecommendationsFilterRequest def self.attribute_map { :'filter' => :'filter', - :'scope' => :'scope', :'sort' => :'sort', :'view' => :'view' } @@ -51,7 +47,6 @@ def self.attribute_map def self.openapi_types { :'filter' => :'String', - :'scope' => :'String', :'sort' => :'Array', :'view' => :'String' } @@ -79,10 +74,6 @@ def initialize(attributes = {}) self.filter = attributes[:'filter'] end - if attributes.key?(:'scope') - self.scope = attributes[:'scope'] - end - if attributes.key?(:'sort') if (value = attributes[:'sort']).is_a?(Array) self.sort = value @@ -121,7 +112,6 @@ def ==(o) return true if self.equal?(o) self.class == o.class && filter == o.filter && - scope == o.scope && sort == o.sort && view == o.view && additional_properties == o.additional_properties @@ -131,7 +121,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [filter, scope, sort, view, additional_properties].hash + [filter, sort, view, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_attributes_request.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_attributes_request.rb new file mode 100644 index 000000000000..11a6a9e414b7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_attributes_request.rb @@ -0,0 +1,147 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes of a dataset create or update request. + class SecurityMonitoringDatasetAttributesRequest + include BaseGenericModel + + # The definition of the dataset. The shape depends on the value of `data_source`. + # Use `reference_table` or `managed_resource` for a referential dataset, or one of the + # event platform sources (for example `logs`, `audit`, `events`, `spans`, `rum`) for + # an event platform dataset. + attr_reader :definition + + # The description of the dataset. Maximum 255 characters. + attr_accessor :description + + # The expected current version of the dataset for optimistic concurrency control on updates. + # If the dataset's current version does not match, the request is rejected with a 409 Conflict. + attr_accessor :version + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'definition' => :'definition', + :'description' => :'description', + :'version' => :'version' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'definition' => :'SecurityMonitoringDatasetDefinition', + :'description' => :'String', + :'version' => :'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::SecurityMonitoringDatasetAttributesRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'definition') + self.definition = attributes[:'definition'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @definition.nil? + true + end + + # Custom attribute writer method with validation + # @param definition [Object] Object to be assigned + # @!visibility private + def definition=(definition) + if definition.nil? + fail ArgumentError, 'invalid value for "definition", definition cannot be nil.' + end + @definition = definition + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + definition == o.definition && + description == o.description && + version == o.version && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [definition, description, version, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_attributes_response.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_attributes_response.rb new file mode 100644 index 000000000000..bab60c152551 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_attributes_response.rb @@ -0,0 +1,365 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes of a Cloud SIEM dataset. + class SecurityMonitoringDatasetAttributesResponse + include BaseGenericModel + + # The creation timestamp of the dataset, in ISO 8601 format. + attr_reader :created_at + + # The Datadog handle of the user who created the dataset. + attr_reader :created_by_handle + + # The display name of the user who created the dataset. + attr_reader :created_by_name + + # The definition of the dataset. The shape depends on the value of `data_source`. + # Use `reference_table` or `managed_resource` for a referential dataset, or one of the + # event platform sources (for example `logs`, `audit`, `events`, `spans`, `rum`) for + # an event platform dataset. + attr_reader :definition + + # The description of the dataset. + attr_reader :description + + # The UUID of the dataset. + attr_reader :id + + # Whether the dataset is an out-of-the-box dataset provided by Datadog. + attr_reader :is_default + + # Whether the dataset is marked as deprecated. + attr_reader :is_deprecated + + # The timestamp of the last modification of the dataset, in ISO 8601 format. + attr_reader :modified_at + + # The unique name of the dataset. + attr_reader :name + + # The Datadog handle of the user who last updated the dataset. + attr_accessor :updated_by_handle + + # The display name of the user who last updated the dataset. + attr_accessor :updated_by_name + + # The current version of the dataset. + attr_reader :version + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_at' => :'createdAt', + :'created_by_handle' => :'createdByHandle', + :'created_by_name' => :'createdByName', + :'definition' => :'definition', + :'description' => :'description', + :'id' => :'id', + :'is_default' => :'isDefault', + :'is_deprecated' => :'isDeprecated', + :'modified_at' => :'modifiedAt', + :'name' => :'name', + :'updated_by_handle' => :'updatedByHandle', + :'updated_by_name' => :'updatedByName', + :'version' => :'version' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'String', + :'created_by_handle' => :'String', + :'created_by_name' => :'String', + :'definition' => :'SecurityMonitoringDatasetDefinition', + :'description' => :'String', + :'id' => :'String', + :'is_default' => :'Boolean', + :'is_deprecated' => :'Boolean', + :'modified_at' => :'String', + :'name' => :'String', + :'updated_by_handle' => :'String', + :'updated_by_name' => :'String', + :'version' => :'Integer' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'updated_by_handle', + :'updated_by_name', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringDatasetAttributesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'created_by_handle') + self.created_by_handle = attributes[:'created_by_handle'] + end + + if attributes.key?(:'created_by_name') + self.created_by_name = attributes[:'created_by_name'] + end + + if attributes.key?(:'definition') + self.definition = attributes[:'definition'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'is_default') + self.is_default = attributes[:'is_default'] + end + + if attributes.key?(:'is_deprecated') + self.is_deprecated = attributes[:'is_deprecated'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'updated_by_handle') + self.updated_by_handle = attributes[:'updated_by_handle'] + end + + if attributes.key?(:'updated_by_name') + self.updated_by_name = attributes[:'updated_by_name'] + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @created_at.nil? + return false if @created_by_handle.nil? + return false if @created_by_name.nil? + return false if @definition.nil? + return false if @description.nil? + return false if @id.nil? + return false if @is_default.nil? + return false if @is_deprecated.nil? + return false if @modified_at.nil? + return false if @name.nil? + return false if @version.nil? + true + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param created_by_handle [Object] Object to be assigned + # @!visibility private + def created_by_handle=(created_by_handle) + if created_by_handle.nil? + fail ArgumentError, 'invalid value for "created_by_handle", created_by_handle cannot be nil.' + end + @created_by_handle = created_by_handle + end + + # Custom attribute writer method with validation + # @param created_by_name [Object] Object to be assigned + # @!visibility private + def created_by_name=(created_by_name) + if created_by_name.nil? + fail ArgumentError, 'invalid value for "created_by_name", created_by_name cannot be nil.' + end + @created_by_name = created_by_name + end + + # Custom attribute writer method with validation + # @param definition [Object] Object to be assigned + # @!visibility private + def definition=(definition) + if definition.nil? + fail ArgumentError, 'invalid value for "definition", definition cannot be nil.' + end + @definition = definition + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if description.nil? + fail ArgumentError, 'invalid value for "description", description cannot be nil.' + end + @description = description + 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 is_default [Object] Object to be assigned + # @!visibility private + def is_default=(is_default) + if is_default.nil? + fail ArgumentError, 'invalid value for "is_default", is_default cannot be nil.' + end + @is_default = is_default + end + + # Custom attribute writer method with validation + # @param is_deprecated [Object] Object to be assigned + # @!visibility private + def is_deprecated=(is_deprecated) + if is_deprecated.nil? + fail ArgumentError, 'invalid value for "is_deprecated", is_deprecated cannot be nil.' + end + @is_deprecated = is_deprecated + 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 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 version [Object] Object to be assigned + # @!visibility private + def version=(version) + if version.nil? + fail ArgumentError, 'invalid value for "version", version cannot be nil.' + end + @version = version + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_at == o.created_at && + created_by_handle == o.created_by_handle && + created_by_name == o.created_by_name && + definition == o.definition && + description == o.description && + id == o.id && + is_default == o.is_default && + is_deprecated == o.is_deprecated && + modified_at == o.modified_at && + name == o.name && + updated_by_handle == o.updated_by_handle && + updated_by_name == o.updated_by_name && + version == o.version && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, created_by_handle, created_by_name, definition, description, id, is_default, is_deprecated, modified_at, name, updated_by_handle, updated_by_name, version, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_column.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_column.rb new file mode 100644 index 000000000000..efcbc9e813ca --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_column.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 + # A column exposed by an event platform dataset. + class SecurityMonitoringDatasetColumn + include BaseGenericModel + + # The name of the column. + attr_reader :column + + # The type of the column value. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'column' => :'column', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'column' => :'String', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringDatasetColumn` 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?(:'column') + self.column = attributes[:'column'] + 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 @column.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param column [Object] Object to be assigned + # @!visibility private + def column=(column) + if column.nil? + fail ArgumentError, 'invalid value for "column", column cannot be nil.' + end + @column = column + 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 && + column == o.column && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [column, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_create_data.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_create_data.rb new file mode 100644 index 000000000000..0bd5e111a354 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_create_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The data wrapper of a dataset create request. + class SecurityMonitoringDatasetCreateData + include BaseGenericModel + + # The attributes of a dataset create or update request. + attr_reader :attributes + + # The type of resource for a dataset create request. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SecurityMonitoringDatasetAttributesRequest', + :'type' => :'SecurityMonitoringDatasetCreateType' + } + 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::SecurityMonitoringDatasetCreateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_create_request.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_create_request.rb new file mode 100644 index 000000000000..4e7217a5c484 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_create_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request body for creating a Cloud SIEM dataset. + class SecurityMonitoringDatasetCreateRequest + include BaseGenericModel + + # The data wrapper of a dataset create request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'SecurityMonitoringDatasetCreateData' + } + 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::SecurityMonitoringDatasetCreateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_create_response.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_create_response.rb new file mode 100644 index 000000000000..ccfbf9d6e598 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_create_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response returned after creating a dataset. + class SecurityMonitoringDatasetCreateResponse + include BaseGenericModel + + # The data wrapper of a dataset create response. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'SecurityMonitoringDatasetCreateResponseData' + } + 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::SecurityMonitoringDatasetCreateResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_create_response_data.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_create_response_data.rb new file mode 100644 index 000000000000..07e787b3615a --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_create_response_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The data wrapper of a dataset create response. + class SecurityMonitoringDatasetCreateResponseData + include BaseGenericModel + + # The UUID of the newly created dataset. + attr_reader :id + + # The type of resource for a dataset response. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'type' => :'SecurityMonitoringDatasetType' + } + 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::SecurityMonitoringDatasetCreateResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_create_type.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_create_type.rb new file mode 100644 index 000000000000..e3cbbdc1c103 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_create_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of resource for a dataset create request. + class SecurityMonitoringDatasetCreateType + include BaseEnumModel + + DATASET_CREATE = "datasetCreate".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_data.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_data.rb new file mode 100644 index 000000000000..2454f3e672dd --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The data wrapper of a dataset response. + class SecurityMonitoringDatasetData + include BaseGenericModel + + # The attributes of a Cloud SIEM dataset. + attr_reader :attributes + + # The UUID of the dataset. + attr_reader :id + + # The type of resource for a dataset response. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SecurityMonitoringDatasetAttributesResponse', + :'id' => :'String', + :'type' => :'SecurityMonitoringDatasetType' + } + 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::SecurityMonitoringDatasetData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_definition.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_definition.rb new file mode 100644 index 000000000000..a1f28c183f2c --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_definition.rb @@ -0,0 +1,221 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The definition of the dataset. The shape depends on the value of `data_source`. + # Use `reference_table` or `managed_resource` for a referential dataset, or one of the + # event platform sources (for example `logs`, `audit`, `events`, `spans`, `rum`) for + # an event platform dataset. + class SecurityMonitoringDatasetDefinition + include BaseGenericModel + + # For event platform datasets, the list of columns exposed by the dataset. + attr_accessor :columns + + # The data source backing this dataset definition. + attr_reader :data_source + + # For event platform datasets, the list of indexes to query. + attr_accessor :indexes + + # The unique name of the dataset. Must start with a lowercase letter and contain only lowercase letters, digits, and underscores (max 255 characters). + attr_reader :name + + # For referential datasets, an optional filter expression applied to the table. + attr_accessor :query_filter + + # The search clause applied to an event platform dataset. + attr_accessor :search + + # Storage tier the dataset reads from. Applies to event platform datasets. + attr_accessor :storage + + # For referential datasets, the name of the underlying table. + attr_accessor :table_name + + # An optional time window that overrides the default query time range. + attr_accessor :time_window + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'columns' => :'columns', + :'data_source' => :'data_source', + :'indexes' => :'indexes', + :'name' => :'name', + :'query_filter' => :'query_filter', + :'search' => :'search', + :'storage' => :'storage', + :'table_name' => :'table_name', + :'time_window' => :'time_window' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'columns' => :'Array', + :'data_source' => :'String', + :'indexes' => :'Array', + :'name' => :'String', + :'query_filter' => :'String', + :'search' => :'SecurityMonitoringDatasetSearch', + :'storage' => :'String', + :'table_name' => :'String', + :'time_window' => :'SecurityMonitoringDatasetTimeWindow' + } + 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::SecurityMonitoringDatasetDefinition` 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?(:'columns') + if (value = attributes[:'columns']).is_a?(Array) + self.columns = value + end + end + + if attributes.key?(:'data_source') + self.data_source = attributes[:'data_source'] + end + + if attributes.key?(:'indexes') + if (value = attributes[:'indexes']).is_a?(Array) + self.indexes = value + end + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'query_filter') + self.query_filter = attributes[:'query_filter'] + end + + if attributes.key?(:'search') + self.search = attributes[:'search'] + end + + if attributes.key?(:'storage') + self.storage = attributes[:'storage'] + end + + if attributes.key?(:'table_name') + self.table_name = attributes[:'table_name'] + end + + if attributes.key?(:'time_window') + self.time_window = attributes[:'time_window'] + 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_source.nil? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param data_source [Object] Object to be assigned + # @!visibility private + def data_source=(data_source) + if data_source.nil? + fail ArgumentError, 'invalid value for "data_source", data_source cannot be nil.' + end + @data_source = data_source + 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 && + columns == o.columns && + data_source == o.data_source && + indexes == o.indexes && + name == o.name && + query_filter == o.query_filter && + search == o.search && + storage == o.storage && + table_name == o.table_name && + time_window == o.time_window && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [columns, data_source, indexes, name, query_filter, search, storage, table_name, time_window, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependencies_request.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependencies_request.rb new file mode 100644 index 000000000000..94f6e3f31894 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependencies_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request body for retrieving dependencies of a batch of datasets. + class SecurityMonitoringDatasetDependenciesRequest + include BaseGenericModel + + # The data wrapper of a dataset dependencies request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'SecurityMonitoringDatasetDependenciesRequestData' + } + 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::SecurityMonitoringDatasetDependenciesRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependencies_request_attributes.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependencies_request_attributes.rb new file mode 100644 index 000000000000..a029e1fe5fa3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependencies_request_attributes.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes of a dataset dependencies request. + class SecurityMonitoringDatasetDependenciesRequestAttributes + include BaseGenericModel + + # The list of dataset UUIDs to query dependencies for. Must contain between 1 and 100 items. + attr_reader :dataset_ids + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'dataset_ids' => :'datasetIds' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'dataset_ids' => :'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::SecurityMonitoringDatasetDependenciesRequestAttributes` 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?(:'dataset_ids') + if (value = attributes[:'dataset_ids']).is_a?(Array) + self.dataset_ids = 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 @dataset_ids.nil? + true + end + + # Custom attribute writer method with validation + # @param dataset_ids [Object] Object to be assigned + # @!visibility private + def dataset_ids=(dataset_ids) + if dataset_ids.nil? + fail ArgumentError, 'invalid value for "dataset_ids", dataset_ids cannot be nil.' + end + @dataset_ids = dataset_ids + 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 && + dataset_ids == o.dataset_ids && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [dataset_ids, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependencies_request_data.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependencies_request_data.rb new file mode 100644 index 000000000000..ca42409e2ef7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependencies_request_data.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The data wrapper of a dataset dependencies request. + class SecurityMonitoringDatasetDependenciesRequestData + include BaseGenericModel + + # The attributes of a dataset dependencies request. + attr_reader :attributes + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SecurityMonitoringDatasetDependenciesRequestAttributes' + } + 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::SecurityMonitoringDatasetDependenciesRequestData` 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 + 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? + 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 + + # 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 && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependencies_response.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependencies_response.rb new file mode 100644 index 000000000000..e111b681a320 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependencies_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response listing the dependents of each requested dataset. + class SecurityMonitoringDatasetDependenciesResponse + include BaseGenericModel + + # The list of dataset dependents entries. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'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::SecurityMonitoringDatasetDependenciesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependents_attributes.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependents_attributes.rb new file mode 100644 index 000000000000..5f310b29ff7b --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependents_attributes.rb @@ -0,0 +1,188 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes of a dataset dependents entry. + class SecurityMonitoringDatasetDependentsAttributes + include BaseGenericModel + + # The number of resources that depend on the dataset. + attr_reader :count + + # The UUID of the dataset whose dependencies are being reported. + attr_reader :dataset_id + + # The list of resource IDs that depend on the dataset. + attr_reader :ids + + # The type of resource that depends on the dataset. + attr_reader :resource_type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'count' => :'count', + :'dataset_id' => :'datasetId', + :'ids' => :'ids', + :'resource_type' => :'resource_type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'count' => :'Integer', + :'dataset_id' => :'String', + :'ids' => :'Array', + :'resource_type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityMonitoringDatasetDependentsAttributes` 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?(:'dataset_id') + self.dataset_id = attributes[:'dataset_id'] + end + + if attributes.key?(:'ids') + if (value = attributes[:'ids']).is_a?(Array) + self.ids = value + end + end + + if attributes.key?(:'resource_type') + self.resource_type = attributes[:'resource_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 @count.nil? + return false if @dataset_id.nil? + return false if @ids.nil? + return false if @resource_type.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 dataset_id [Object] Object to be assigned + # @!visibility private + def dataset_id=(dataset_id) + if dataset_id.nil? + fail ArgumentError, 'invalid value for "dataset_id", dataset_id cannot be nil.' + end + @dataset_id = dataset_id + end + + # Custom attribute writer method with validation + # @param ids [Object] Object to be assigned + # @!visibility private + def ids=(ids) + if ids.nil? + fail ArgumentError, 'invalid value for "ids", ids cannot be nil.' + end + @ids = ids + end + + # Custom attribute writer method with validation + # @param resource_type [Object] Object to be assigned + # @!visibility private + def resource_type=(resource_type) + if resource_type.nil? + fail ArgumentError, 'invalid value for "resource_type", resource_type cannot be nil.' + end + @resource_type = resource_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 && + count == o.count && + dataset_id == o.dataset_id && + ids == o.ids && + resource_type == o.resource_type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [count, dataset_id, ids, resource_type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependents_data.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependents_data.rb new file mode 100644 index 000000000000..d24fb7848b20 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependents_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A single entry describing the dependents of one dataset. + class SecurityMonitoringDatasetDependentsData + include BaseGenericModel + + # The attributes of a dataset dependents entry. + attr_reader :attributes + + # The UUID of the dataset. + attr_reader :id + + # The type of resource for a dataset dependents entry. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SecurityMonitoringDatasetDependentsAttributes', + :'id' => :'String', + :'type' => :'SecurityMonitoringDatasetDependentsType' + } + 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::SecurityMonitoringDatasetDependentsData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependents_type.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependents_type.rb new file mode 100644 index 000000000000..11dff047da85 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependents_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of resource for a dataset dependents entry. + class SecurityMonitoringDatasetDependentsType + include BaseEnumModel + + DATASET_DEPENDENTS = "datasetDependents".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_response.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_response.rb new file mode 100644 index 000000000000..0ef0598fa1b0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a single Cloud SIEM dataset. + class SecurityMonitoringDatasetResponse + include BaseGenericModel + + # The data wrapper of a dataset response. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'SecurityMonitoringDatasetData' + } + 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::SecurityMonitoringDatasetResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_search.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_search.rb new file mode 100644 index 000000000000..4668a747c4b5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_search.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The search clause applied to an event platform dataset. + class SecurityMonitoringDatasetSearch + include BaseGenericModel + + # The search query expression. + attr_reader :query + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'query' => :'query' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'query' => :'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::SecurityMonitoringDatasetSearch` 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?(:'query') + self.query = attributes[:'query'] + 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 @query.nil? + true + end + + # Custom attribute writer method with validation + # @param query [Object] Object to be assigned + # @!visibility private + def query=(query) + if query.nil? + fail ArgumentError, 'invalid value for "query", query cannot be nil.' + end + @query = query + 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 && + query == o.query && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [query, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_time_window.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_time_window.rb new file mode 100644 index 000000000000..95dca5cd1607 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_time_window.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # An optional time window that overrides the default query time range. + class SecurityMonitoringDatasetTimeWindow + include BaseGenericModel + + # Inclusive start of the time window, in milliseconds since the Unix epoch. + attr_accessor :from + + # Exclusive end of the time window, in milliseconds since the Unix epoch. + attr_accessor :to + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'from' => :'from', + :'to' => :'to' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'from' => :'Integer', + :'to' => :'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::SecurityMonitoringDatasetTimeWindow` 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?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + 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 && + from == o.from && + to == o.to && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [from, to, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_type.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_type.rb new file mode 100644 index 000000000000..1d70b415e78a --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of resource for a dataset response. + class SecurityMonitoringDatasetType + include BaseEnumModel + + DATASET = "dataset".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_update_data.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_update_data.rb new file mode 100644 index 000000000000..488a3f02afa5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_update_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The data wrapper of a dataset update request. + class SecurityMonitoringDatasetUpdateData + include BaseGenericModel + + # The attributes of a dataset create or update request. + attr_reader :attributes + + # The type of resource for a dataset update request. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SecurityMonitoringDatasetAttributesRequest', + :'type' => :'SecurityMonitoringDatasetUpdateType' + } + 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::SecurityMonitoringDatasetUpdateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_update_request.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_update_request.rb new file mode 100644 index 000000000000..eb60caa3658e --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_update_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request body for updating a Cloud SIEM dataset. + class SecurityMonitoringDatasetUpdateRequest + include BaseGenericModel + + # The data wrapper of a dataset update request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'SecurityMonitoringDatasetUpdateData' + } + 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::SecurityMonitoringDatasetUpdateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_update_type.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_update_type.rb new file mode 100644 index 000000000000..1bc77ac51e5e --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_update_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of resource for a dataset update request. + class SecurityMonitoringDatasetUpdateType + include BaseEnumModel + + DATASET_UPDATE = "datasetUpdate".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_version_entry.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_version_entry.rb new file mode 100644 index 000000000000..641d7d8a406c --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_version_entry.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 + # A single entry in the version history of a dataset. + class SecurityMonitoringDatasetVersionEntry + include BaseGenericModel + + # The list of field changes between this version of the dataset and the previous one. + attr_reader :changes + + # The attributes of a Cloud SIEM dataset. + attr_reader :dataset + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'changes' => :'changes', + :'dataset' => :'dataset' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'changes' => :'Array', + :'dataset' => :'SecurityMonitoringDatasetAttributesResponse' + } + 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::SecurityMonitoringDatasetVersionEntry` 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?(:'changes') + if (value = attributes[:'changes']).is_a?(Array) + self.changes = value + end + end + + if attributes.key?(:'dataset') + self.dataset = attributes[:'dataset'] + 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 @changes.nil? + return false if @dataset.nil? + true + end + + # Custom attribute writer method with validation + # @param changes [Object] Object to be assigned + # @!visibility private + def changes=(changes) + if changes.nil? + fail ArgumentError, 'invalid value for "changes", changes cannot be nil.' + end + @changes = changes + end + + # Custom attribute writer method with validation + # @param dataset [Object] Object to be assigned + # @!visibility private + def dataset=(dataset) + if dataset.nil? + fail ArgumentError, 'invalid value for "dataset", dataset cannot be nil.' + end + @dataset = dataset + 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 && + changes == o.changes && + dataset == o.dataset && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [changes, dataset, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_version_field_change.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_version_field_change.rb new file mode 100644 index 000000000000..f78e9535407a --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_version_field_change.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A single field change between two versions of a dataset. + class SecurityMonitoringDatasetVersionFieldChange + include BaseGenericModel + + # The current value of the field, serialized as a JSON value. + attr_reader :current + + # The name of the field that changed. + attr_reader :field + + # The previous value of the field, serialized as a JSON value. + attr_reader :previous + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'current' => :'current', + :'field' => :'field', + :'previous' => :'previous' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'current' => :'Object', + :'field' => :'String', + :'previous' => :'Object' + } + 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::SecurityMonitoringDatasetVersionFieldChange` 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?(:'current') + self.current = attributes[:'current'] + end + + if attributes.key?(:'field') + self.field = attributes[:'field'] + end + + if attributes.key?(:'previous') + self.previous = attributes[:'previous'] + 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 @current.nil? + return false if @field.nil? + return false if @previous.nil? + true + end + + # Custom attribute writer method with validation + # @param current [Object] Object to be assigned + # @!visibility private + def current=(current) + if current.nil? + fail ArgumentError, 'invalid value for "current", current cannot be nil.' + end + @current = current + end + + # Custom attribute writer method with validation + # @param field [Object] Object to be assigned + # @!visibility private + def field=(field) + if field.nil? + fail ArgumentError, 'invalid value for "field", field cannot be nil.' + end + @field = field + end + + # Custom attribute writer method with validation + # @param previous [Object] Object to be assigned + # @!visibility private + def previous=(previous) + if previous.nil? + fail ArgumentError, 'invalid value for "previous", previous cannot be nil.' + end + @previous = previous + 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 && + current == o.current && + field == o.field && + previous == o.previous && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [current, field, previous, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_version_history_attributes.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_version_history_attributes.rb new file mode 100644 index 000000000000..43293fb75043 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_version_history_attributes.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 + # The attributes of a dataset version history response. + class SecurityMonitoringDatasetVersionHistoryAttributes + include BaseGenericModel + + # The total number of versions available for this dataset. + attr_reader :count + + # A map from version number (as a string) to the dataset state at that version. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'count' => :'count', + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'count' => :'Integer', + :'data' => :'Hash' + } + 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::SecurityMonitoringDatasetVersionHistoryAttributes` 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?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @count.nil? + return false if @data.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 data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + count == o.count && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [count, data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_version_history_data.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_version_history_data.rb new file mode 100644 index 000000000000..41f38c9cc975 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_version_history_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The data wrapper of a dataset version history response. + class SecurityMonitoringDatasetVersionHistoryData + include BaseGenericModel + + # The attributes of a dataset version history response. + attr_reader :attributes + + # The UUID of the dataset. + attr_reader :id + + # The type of resource for a dataset version history response. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SecurityMonitoringDatasetVersionHistoryAttributes', + :'id' => :'String', + :'type' => :'SecurityMonitoringDatasetVersionHistoryType' + } + 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::SecurityMonitoringDatasetVersionHistoryData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_version_history_response.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_version_history_response.rb new file mode 100644 index 000000000000..7f847618bbf5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_version_history_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing the version history of a Cloud SIEM dataset. + class SecurityMonitoringDatasetVersionHistoryResponse + include BaseGenericModel + + # The data wrapper of a dataset version history response. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'SecurityMonitoringDatasetVersionHistoryData' + } + 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::SecurityMonitoringDatasetVersionHistoryResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_version_history_type.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_version_history_type.rb new file mode 100644 index 000000000000..b6e5c2f98039 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_version_history_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of resource for a dataset version history response. + class SecurityMonitoringDatasetVersionHistoryType + include BaseEnumModel + + DATASET_VERSION_HISTORY = "dataset_version_history".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_datasets_list_meta.rb b/lib/datadog_api_client/v2/models/security_monitoring_datasets_list_meta.rb new file mode 100644 index 000000000000..0b07fb5d3acc --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_datasets_list_meta.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Metadata returned with a list of datasets. + class SecurityMonitoringDatasetsListMeta + include BaseGenericModel + + # The total number of datasets matching the request, across all pages. + attr_reader :total_count + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'total_count' => :'totalCount' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'total_count' => :'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::SecurityMonitoringDatasetsListMeta` 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?(:'total_count') + self.total_count = attributes[:'total_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 @total_count.nil? + true + end + + # Custom attribute writer method with validation + # @param total_count [Object] Object to be assigned + # @!visibility private + def total_count=(total_count) + if total_count.nil? + fail ArgumentError, 'invalid value for "total_count", total_count cannot be nil.' + end + @total_count = total_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 && + total_count == o.total_count && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [total_count, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_datasets_list_response.rb b/lib/datadog_api_client/v2/models/security_monitoring_datasets_list_response.rb new file mode 100644 index 000000000000..d6128d67afce --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_datasets_list_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 a paginated list of Cloud SIEM datasets. + class SecurityMonitoringDatasetsListResponse + include BaseGenericModel + + # A list of dataset data items. + attr_reader :data + + # Metadata returned with a list of datasets. + 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' => :'SecurityMonitoringDatasetsListMeta' + } + 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::SecurityMonitoringDatasetsListResponse` 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