From a9cc9ad389f3cf18eb2fa8f1d6753799d37656f5 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 29 Jan 2026 11:53:09 +0000 Subject: [PATCH] Regenerate client from commit c15f9cf of spec repo --- .generator/schemas/v2/openapi.yaml | 753 ++++++++++++++++++ ...etSecurityMonitoringDatasetDependencies.rb | 19 + .../CreateSecurityMonitoringDataset.rb | 30 + .../DeleteSecurityMonitoringDataset.rb | 8 + .../GetSecurityMonitoringDataset.rb | 8 + .../GetSecurityMonitoringDatasetByVersion.rb | 8 + .../GetSecurityMonitoringDatasetHistory.rb | 8 + .../ListSecurityMonitoringDatasets.rb | 8 + .../UpdateSecurityMonitoringDataset.rb | 31 + features/scenarios_model_mapping.rb | 29 + features/v2/security_monitoring.feature | 188 +++++ features/v2/undo.json | 57 ++ lib/datadog_api_client/configuration.rb | 8 + lib/datadog_api_client/inflector.rb | 25 + .../v2/api/security_monitoring_api.rb | 587 ++++++++++++++ ..._monitoring_dataset_attributes_response.rb | 278 +++++++ ...oring_dataset_create_attributes_request.rb | 144 ++++ ..._monitoring_dataset_create_data_request.rb | 144 ++++ ...monitoring_dataset_create_data_response.rb | 144 ++++ ...urity_monitoring_dataset_create_request.rb | 123 +++ ...rity_monitoring_dataset_create_response.rb | 123 +++ ...curity_monitoring_dataset_data_response.rb | 165 ++++ .../security_monitoring_dataset_definition.rb | 179 +++++ ...ty_monitoring_dataset_definition_column.rb | 144 ++++ ...nitoring_dataset_definition_column_type.rb | 29 + ...dataset_dependencies_attributes_request.rb | 133 ++++ ...oring_dataset_dependencies_data_request.rb | 144 ++++ ...monitoring_dataset_dependencies_request.rb | 123 +++ ...onitoring_dataset_dependencies_response.rb | 125 +++ ...ty_monitoring_dataset_dependencies_type.rb | 26 + ..._dataset_dependency_attributes_response.rb | 167 ++++ ...toring_dataset_dependency_data_response.rb | 165 ++++ .../security_monitoring_dataset_list_meta.rb | 123 +++ .../security_monitoring_dataset_response.rb | 123 +++ .../security_monitoring_dataset_type.rb | 26 + ...oring_dataset_update_attributes_request.rb | 154 ++++ ..._monitoring_dataset_update_data_request.rb | 144 ++++ ...urity_monitoring_dataset_update_request.rb | 123 +++ ...ty_monitoring_datasets_history_response.rb | 125 +++ ...urity_monitoring_datasets_list_response.rb | 146 ++++ 40 files changed, 5087 insertions(+) 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/GetSecurityMonitoringDatasetHistory.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_response.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_create_attributes_request.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_create_data_request.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_create_data_response.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_data_response.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_definition_column.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_definition_column_type.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_dependencies_attributes_request.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_dependencies_data_request.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_response.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_dependencies_type.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_dependency_attributes_response.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_dependency_data_response.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_list_meta.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_type.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_update_attributes_request.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_dataset_update_data_request.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_datasets_history_response.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 147e01bf6b94..827803dc9f91 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -51812,6 +51812,375 @@ components: $ref: '#/components/schemas/SecurityMonitoringCriticalAsset' type: array type: object + SecurityMonitoringDatasetAttributesResponse: + description: Attributes of a security monitoring dataset. + properties: + createdAt: + description: The creation timestamp of the dataset. + example: 2025-03-20 10:00:00+00:00 + format: date-time + type: string + createdByHandle: + description: The handle of the user who created the dataset. + example: bruce.lee + type: string + createdByName: + description: The name of the user who created the dataset. + example: Bruce Lee + type: string + definition: + $ref: '#/components/schemas/SecurityMonitoringDatasetDefinition' + description: + description: A description of the dataset. + example: A dataset for monitoring authentication events + type: string + modifiedAt: + description: The last modification timestamp of the dataset. + example: 2025-03-20 12:00:00+00:00 + format: date-time + type: string + name: + description: The name of the dataset. + example: authentication_dataset + type: string + orgId: + description: The organization ID. + example: 123456 + format: int64 + type: integer + updatedByHandle: + description: The handle of the user who last updated the dataset. + example: chuck.norris + type: string + updatedByName: + description: The name of the user who last updated the dataset. + example: Chuck Norris + type: string + version: + description: The version of the dataset. + example: 1 + format: int64 + type: integer + required: + - description + - name + - version + - orgId + - definition + - createdAt + type: object + SecurityMonitoringDatasetCreateAttributesRequest: + description: Attributes for creating a security monitoring dataset. + properties: + definition: + $ref: '#/components/schemas/SecurityMonitoringDatasetDefinition' + description: + description: A description of the dataset (maximum 255 characters). + example: A dataset for monitoring authentication events + type: string + required: + - description + - definition + type: object + SecurityMonitoringDatasetCreateDataRequest: + description: Data for creating a security monitoring dataset. + properties: + attributes: + $ref: '#/components/schemas/SecurityMonitoringDatasetCreateAttributesRequest' + type: + $ref: '#/components/schemas/SecurityMonitoringDatasetType' + required: + - type + - attributes + type: object + SecurityMonitoringDatasetCreateDataResponse: + description: Data returned after creating a security monitoring dataset. + properties: + id: + description: The unique identifier of the created dataset. + example: 123e4567-e89b-12d3-a456-426614174000 + type: string + type: + $ref: '#/components/schemas/SecurityMonitoringDatasetType' + required: + - id + - type + type: object + SecurityMonitoringDatasetCreateRequest: + description: Request to create a security monitoring dataset. + properties: + data: + $ref: '#/components/schemas/SecurityMonitoringDatasetCreateDataRequest' + required: + - data + type: object + SecurityMonitoringDatasetCreateResponse: + description: Response after creating a security monitoring dataset. + properties: + data: + $ref: '#/components/schemas/SecurityMonitoringDatasetCreateDataResponse' + required: + - data + type: object + SecurityMonitoringDatasetDataResponse: + description: A security monitoring dataset. + properties: + attributes: + $ref: '#/components/schemas/SecurityMonitoringDatasetAttributesResponse' + id: + description: The unique identifier 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 a dataset, including its data source, name, indexes, + and columns. + properties: + columns: + description: The columns in the dataset. + items: + $ref: '#/components/schemas/SecurityMonitoringDatasetDefinitionColumn' + type: array + data_source: + description: The data source for the dataset. + example: logs + type: string + indexes: + description: The indexes to use for the dataset. + items: + example: k9 + type: string + type: array + name: + description: The name of the dataset. Must start with a letter, contain + only lowercase letters, numbers, and underscores, and be at most 255 characters + long. + example: my_dataset + type: string + required: + - data_source + - name + - columns + type: object + SecurityMonitoringDatasetDefinitionColumn: + description: A column in a dataset definition. + properties: + column: + description: The name of the column. + example: message + type: string + type: + $ref: '#/components/schemas/SecurityMonitoringDatasetDefinitionColumnType' + required: + - column + - type + type: object + SecurityMonitoringDatasetDefinitionColumnType: + description: The type of the column in a dataset definition. + enum: + - string + - integer + - double + - boolean + example: string + type: string + x-enum-varnames: + - STRING + - INTEGER + - DOUBLE + - BOOLEAN + SecurityMonitoringDatasetDependenciesAttributesRequest: + description: Attributes for dataset dependencies request. + properties: + datasetIds: + description: Array of dataset IDs to check dependencies for (minimum 1, + maximum 100). + example: + - dataset-1 + items: + example: dataset-1 + type: string + maxItems: 100 + minItems: 1 + type: array + required: + - datasetIds + type: object + SecurityMonitoringDatasetDependenciesDataRequest: + description: Data for dataset dependencies request. + properties: + attributes: + $ref: '#/components/schemas/SecurityMonitoringDatasetDependenciesAttributesRequest' + type: + $ref: '#/components/schemas/SecurityMonitoringDatasetDependenciesType' + required: + - type + - attributes + type: object + SecurityMonitoringDatasetDependenciesRequest: + description: Request to get dataset dependencies. + properties: + data: + $ref: '#/components/schemas/SecurityMonitoringDatasetDependenciesDataRequest' + required: + - data + type: object + SecurityMonitoringDatasetDependenciesResponse: + description: Response containing dataset dependencies. + properties: + data: + description: Array of dataset dependencies. + items: + $ref: '#/components/schemas/SecurityMonitoringDatasetDependencyDataResponse' + type: array + required: + - data + type: object + SecurityMonitoringDatasetDependenciesType: + description: The type of the response. + enum: + - security_monitoring_dataset_dependencies + example: security_monitoring_dataset_dependencies + type: string + x-enum-varnames: + - SECURITY_MONITORING_DATASET_DEPENDENCIES + SecurityMonitoringDatasetDependencyAttributesResponse: + description: Attributes for dataset dependency. + properties: + count: + description: The count of resources that depend on the dataset. + example: 2 + format: int64 + type: integer + ids: + description: Array of IDs of resources that depend on the dataset. + example: + - rule-1 + items: + example: rule-1 + type: string + type: array + resource_type: + description: The type of resource that depends on the dataset. + example: security_detection_rule + type: string + required: + - resource_type + - ids + - count + type: object + SecurityMonitoringDatasetDependencyDataResponse: + description: Dependencies for a dataset. + properties: + attributes: + $ref: '#/components/schemas/SecurityMonitoringDatasetDependencyAttributesResponse' + id: + description: The dataset ID. + example: dataset-1 + type: string + type: + $ref: '#/components/schemas/SecurityMonitoringDatasetDependenciesType' + required: + - id + - type + - attributes + type: object + SecurityMonitoringDatasetListMeta: + description: Metadata for dataset list responses. + properties: + totalCount: + description: The total count of datasets. + example: 42 + format: int64 + type: integer + required: + - totalCount + type: object + SecurityMonitoringDatasetResponse: + description: Response containing a security monitoring dataset. + properties: + data: + $ref: '#/components/schemas/SecurityMonitoringDatasetDataResponse' + required: + - data + type: object + SecurityMonitoringDatasetType: + description: Type for security monitoring dataset objects. + enum: + - security_monitoring_dataset + example: security_monitoring_dataset + type: string + x-enum-varnames: + - SECURITY_MONITORING_DATASET + SecurityMonitoringDatasetUpdateAttributesRequest: + description: Attributes for updating a security monitoring dataset. + properties: + definition: + $ref: '#/components/schemas/SecurityMonitoringDatasetDefinition' + description: + description: A description of the dataset (maximum 255 characters). + example: Updated dataset description + type: string + version: + description: The expected version of the dataset for concurrent modification + detection. + example: 1 + format: int64 + type: integer + required: + - description + - definition + type: object + SecurityMonitoringDatasetUpdateDataRequest: + description: Data for updating a security monitoring dataset. + properties: + attributes: + $ref: '#/components/schemas/SecurityMonitoringDatasetUpdateAttributesRequest' + type: + $ref: '#/components/schemas/SecurityMonitoringDatasetType' + required: + - type + - attributes + type: object + SecurityMonitoringDatasetUpdateRequest: + description: Request to update a security monitoring dataset. + properties: + data: + $ref: '#/components/schemas/SecurityMonitoringDatasetUpdateDataRequest' + required: + - data + type: object + SecurityMonitoringDatasetsHistoryResponse: + description: Response containing the history of a security monitoring dataset. + properties: + data: + description: Array of dataset versions ordered by version descending. + items: + $ref: '#/components/schemas/SecurityMonitoringDatasetDataResponse' + type: array + required: + - data + type: object + SecurityMonitoringDatasetsListResponse: + description: Response containing a list of security monitoring datasets. + properties: + data: + description: Array of datasets. + items: + $ref: '#/components/schemas/SecurityMonitoringDatasetDataResponse' + type: array + meta: + $ref: '#/components/schemas/SecurityMonitoringDatasetListMeta' + required: + - data + - meta + type: object SecurityMonitoringFilter: description: The rule's suppression filter. properties: @@ -91214,6 +91583,390 @@ paths: summary: Get a suppression's version history tags: - Security Monitoring + /api/v2/security_monitoring/datasets: + get: + description: List all datasets for the organization with optional pagination, + filtering, and sorting. + operationId: ListSecurityMonitoringDatasets + parameters: + - 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 + - description: Sort datasets by name, created at, or modified at. Prefix with + '-' for descending order. + in: query + name: sort + required: false + schema: + example: -createdAt + type: string + - description: Filter datasets by name or description. + in: query + name: filter[query] + required: false + schema: + example: my_dataset + type: string + responses: + '200': + content: + application/json: + 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 + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Not Found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List all datasets + tags: + - Security Monitoring + 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 dataset for security monitoring. + operationId: CreateSecurityMonitoringDataset + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SecurityMonitoringDatasetCreateRequest' + required: true + responses: + '201': + content: + application/json: + 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 + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create a dataset + tags: + - Security Monitoring + 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: Batch retrieves which security rules depend on specified datasets. + operationId: BatchGetSecurityMonitoringDatasetDependencies + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SecurityMonitoringDatasetDependenciesRequest' + required: true + responses: + '200': + content: + application/json: + 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' + summary: Get dataset dependencies + tags: + - Security Monitoring + 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 dataset by its ID. + operationId: DeleteSecurityMonitoringDataset + parameters: + - description: The ID of the dataset. + in: path + name: dataset_id + required: true + schema: + example: 123e4567-e89b-12d3-a456-426614174000 + format: uuid + type: string + 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' + summary: Delete a dataset + tags: + - Security Monitoring + 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 a specific dataset by its ID. + operationId: GetSecurityMonitoringDataset + parameters: + - description: The ID of the dataset. + in: path + name: dataset_id + required: true + schema: + example: 123e4567-e89b-12d3-a456-426614174000 + format: uuid + type: string + responses: + '200': + content: + application/json: + 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' + summary: Get a dataset + tags: + - Security Monitoring + 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 dataset. + operationId: UpdateSecurityMonitoringDataset + parameters: + - description: The ID of the dataset. + in: path + name: dataset_id + required: true + schema: + example: 123e4567-e89b-12d3-a456-426614174000 + format: uuid + type: string + requestBody: + content: + application/json: + 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' + summary: Update a dataset + tags: + - Security Monitoring + 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}/history: + get: + description: Get all historical versions of a dataset. + operationId: GetSecurityMonitoringDatasetHistory + parameters: + - description: The ID of the dataset. + in: path + name: dataset_id + required: true + schema: + example: 123e4567-e89b-12d3-a456-426614174000 + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SecurityMonitoringDatasetsHistoryResponse' + 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' + summary: Get dataset history + tags: + - Security Monitoring + 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: Get a specific version of a dataset. + operationId: GetSecurityMonitoringDatasetByVersion + parameters: + - description: The ID of the dataset. + in: path + name: dataset_id + required: true + schema: + example: 123e4567-e89b-12d3-a456-426614174000 + format: uuid + type: string + - description: The version of the dataset. + in: path + name: version + required: true + schema: + example: 1 + type: integer + responses: + '200': + content: + application/json: + 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' + summary: Get a dataset by version + tags: + - Security Monitoring + 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/rules: get: description: List rules. diff --git a/examples/v2/security-monitoring/BatchGetSecurityMonitoringDatasetDependencies.rb b/examples/v2/security-monitoring/BatchGetSecurityMonitoringDatasetDependencies.rb new file mode 100644 index 000000000000..f36efd0f70da --- /dev/null +++ b/examples/v2/security-monitoring/BatchGetSecurityMonitoringDatasetDependencies.rb @@ -0,0 +1,19 @@ +# 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::SecurityMonitoringDatasetDependenciesDataRequest.new({ + attributes: DatadogAPIClient::V2::SecurityMonitoringDatasetDependenciesAttributesRequest.new({ + dataset_ids: [ + "dataset-1", + ], + }), + type: DatadogAPIClient::V2::SecurityMonitoringDatasetDependenciesType::SECURITY_MONITORING_DATASET_DEPENDENCIES, + }), +}) +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..deebeb253814 --- /dev/null +++ b/examples/v2/security-monitoring/CreateSecurityMonitoringDataset.rb @@ -0,0 +1,30 @@ +# 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::SecurityMonitoringDatasetCreateDataRequest.new({ + attributes: DatadogAPIClient::V2::SecurityMonitoringDatasetCreateAttributesRequest.new({ + definition: DatadogAPIClient::V2::SecurityMonitoringDatasetDefinition.new({ + columns: [ + DatadogAPIClient::V2::SecurityMonitoringDatasetDefinitionColumn.new({ + column: "message", + type: DatadogAPIClient::V2::SecurityMonitoringDatasetDefinitionColumnType::STRING, + }), + ], + data_source: "logs", + indexes: [ + "k9", + ], + name: "my_dataset", + }), + description: "A dataset for monitoring authentication events", + }), + type: DatadogAPIClient::V2::SecurityMonitoringDatasetType::SECURITY_MONITORING_DATASET, + }), +}) +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..fddcc8f2fae8 --- /dev/null +++ b/examples/v2/security-monitoring/GetSecurityMonitoringDatasetByVersion.rb @@ -0,0 +1,8 @@ +# Get a dataset by 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/GetSecurityMonitoringDatasetHistory.rb b/examples/v2/security-monitoring/GetSecurityMonitoringDatasetHistory.rb new file mode 100644 index 000000000000..9116801029c3 --- /dev/null +++ b/examples/v2/security-monitoring/GetSecurityMonitoringDatasetHistory.rb @@ -0,0 +1,8 @@ +# Get dataset history returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_security_monitoring_dataset_history".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new +p api_instance.get_security_monitoring_dataset_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..f8af4a3f9e04 --- /dev/null +++ b/examples/v2/security-monitoring/ListSecurityMonitoringDatasets.rb @@ -0,0 +1,8 @@ +# List all 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..50957f772663 --- /dev/null +++ b/examples/v2/security-monitoring/UpdateSecurityMonitoringDataset.rb @@ -0,0 +1,31 @@ +# 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::SecurityMonitoringDatasetUpdateDataRequest.new({ + attributes: DatadogAPIClient::V2::SecurityMonitoringDatasetUpdateAttributesRequest.new({ + definition: DatadogAPIClient::V2::SecurityMonitoringDatasetDefinition.new({ + columns: [ + DatadogAPIClient::V2::SecurityMonitoringDatasetDefinitionColumn.new({ + column: "message", + type: DatadogAPIClient::V2::SecurityMonitoringDatasetDefinitionColumnType::STRING, + }), + ], + data_source: "logs", + indexes: [ + "k9", + ], + name: "my_dataset", + }), + description: "Updated dataset description", + version: 1, + }), + type: DatadogAPIClient::V2::SecurityMonitoringDatasetType::SECURITY_MONITORING_DATASET, + }), +}) +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 6674c3b1a047..f046aac38ea5 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1590,6 +1590,35 @@ "page_size" => "Integer", "page_number" => "Integer", }, + "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" => "UUID", + }, + "v2.GetSecurityMonitoringDataset" => { + "dataset_id" => "UUID", + }, + "v2.UpdateSecurityMonitoringDataset" => { + "dataset_id" => "UUID", + "body" => "SecurityMonitoringDatasetUpdateRequest", + }, + "v2.GetSecurityMonitoringDatasetHistory" => { + "dataset_id" => "UUID", + }, + "v2.GetSecurityMonitoringDatasetByVersion" => { + "dataset_id" => "UUID", + "version" => "Integer", + }, "v2.ListSecurityMonitoringRules" => { "page_size" => "Integer", "page_number" => "Integer", diff --git a/features/v2/security_monitoring.feature b/features/v2/security_monitoring.feature index ccc027734e22..95feb5d34696 100644 --- a/features/v2/security_monitoring.feature +++ b/features/v2/security_monitoring.feature @@ -408,6 +408,22 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/k9-cloud-security-platform + 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": ["k9"], "name": "my_dataset"}, "description": "A dataset for monitoring authentication events"}, "type": "security_monitoring_dataset"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-security-platform + 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": ["k9"], "name": "my_dataset"}, "description": "A dataset for monitoring authentication events"}, "type": "security_monitoring_dataset"}} + When the request is sent + Then the response status is 201 Created + @skip @team:DataDog/k9-cloud-security-platform Scenario: Create a detection rule returns "Bad Request" response Given new "CreateSecurityMonitoringRule" request @@ -713,6 +729,30 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/k9-cloud-security-platform + 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-security-platform + 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-security-platform + 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-security-platform Scenario: Delete a non existing rule returns "Not Found" response Given new "DeleteSecurityMonitoringRule" request @@ -923,6 +963,57 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/k9-cloud-security-platform + Scenario: Get a dataset by 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-security-platform + Scenario: Get a dataset by 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-security-platform + Scenario: Get a dataset by 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-security-platform + 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-security-platform + 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-security-platform + 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 @@ -1240,6 +1331,46 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/k9-cloud-security-platform + Scenario: Get dataset dependencies returns "Bad Request" response + Given operation "BatchGetSecurityMonitoringDatasetDependencies" enabled + And new "BatchGetSecurityMonitoringDatasetDependencies" request + And body with value {"data": {"attributes": {"datasetIds": ["dataset-1"]}, "type": "security_monitoring_dataset_dependencies"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-security-platform + Scenario: Get dataset dependencies returns "OK" response + Given operation "BatchGetSecurityMonitoringDatasetDependencies" enabled + And new "BatchGetSecurityMonitoringDatasetDependencies" request + And body with value {"data": {"attributes": {"datasetIds": ["dataset-1"]}, "type": "security_monitoring_dataset_dependencies"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/k9-cloud-security-platform + Scenario: Get dataset history returns "Bad Request" response + Given operation "GetSecurityMonitoringDatasetHistory" enabled + And new "GetSecurityMonitoringDatasetHistory" 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-security-platform + Scenario: Get dataset history returns "Not Found" response + Given operation "GetSecurityMonitoringDatasetHistory" enabled + And new "GetSecurityMonitoringDatasetHistory" 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-security-platform + Scenario: Get dataset history returns "OK" response + Given operation "GetSecurityMonitoringDatasetHistory" enabled + And new "GetSecurityMonitoringDatasetHistory" 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 details of a signal-based notification rule returns "Bad Request" response Given new "GetSignalNotificationRule" request @@ -1340,6 +1471,27 @@ 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-security-platform + Scenario: List all 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-security-platform + Scenario: List all datasets returns "Not Found" response + Given operation "ListSecurityMonitoringDatasets" enabled + And new "ListSecurityMonitoringDatasets" request + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/k9-cloud-security-platform + Scenario: List all 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-vm Scenario: List assets SBOMs returns "Bad request: The server cannot process the request due to invalid syntax in the request." response Given new "ListAssetsSBOMs" request @@ -1907,6 +2059,42 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/k9-cloud-security-platform + 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": ["k9"], "name": "my_dataset"}, "description": "Updated dataset description", "version": 1}, "type": "security_monitoring_dataset"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-cloud-security-platform + 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": ["k9"], "name": "my_dataset"}, "description": "Updated dataset description", "version": 1}, "type": "security_monitoring_dataset"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/k9-cloud-security-platform + 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": ["k9"], "name": "my_dataset"}, "description": "Updated dataset description", "version": 1}, "type": "security_monitoring_dataset"}} + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/k9-cloud-security-platform + 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": ["k9"], "name": "my_dataset"}, "description": "Updated dataset description", "version": 1}, "type": "security_monitoring_dataset"}} + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/k9-cloud-security-platform 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 5a347bddf111..4a80121b5df2 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -4317,6 +4317,63 @@ "type": "safe" } }, + "ListSecurityMonitoringDatasets": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "CreateSecurityMonitoringDataset": { + "tag": "Security Monitoring", + "undo": { + "operationId": "DeleteSecurityMonitoringDataset", + "parameters": [ + { + "name": "dataset_id", + "source": "" + } + ], + "type": "unsafe" + } + }, + "BatchGetSecurityMonitoringDatasetDependencies": { + "tag": "Security Monitoring", + "undo": { + "operationId": "TODO", + "parameters": [], + "type": "unsafe" + } + }, + "DeleteSecurityMonitoringDataset": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "GetSecurityMonitoringDataset": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "UpdateSecurityMonitoringDataset": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "GetSecurityMonitoringDatasetHistory": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "GetSecurityMonitoringDatasetByVersion": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, "ListSecurityMonitoringRules": { "tag": "Security Monitoring", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 7085b0efde5e..22c972a35b0e 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -208,18 +208,25 @@ def initialize "v2.get_open_api": false, "v2.list_apis": false, "v2.update_open_api": false, + "v2.batch_get_security_monitoring_dataset_dependencies": false, "v2.cancel_threat_hunting_job": false, "v2.convert_job_result_to_signal": false, + "v2.create_security_monitoring_dataset": false, + "v2.delete_security_monitoring_dataset": false, "v2.delete_threat_hunting_job": false, "v2.get_finding": 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_history": false, "v2.get_security_monitoring_histsignal": false, "v2.get_security_monitoring_histsignals_by_job_id": false, "v2.get_threat_hunting_job": false, "v2.list_findings": false, "v2.list_multiple_rulesets": false, "v2.list_scanned_assets_metadata": false, + "v2.list_security_monitoring_datasets": false, "v2.list_security_monitoring_histsignals": false, "v2.list_threat_hunting_jobs": false, "v2.list_vulnerabilities": false, @@ -227,6 +234,7 @@ def initialize "v2.mute_findings": false, "v2.run_threat_hunting_job": false, "v2.search_security_monitoring_histsignals": false, + "v2.update_security_monitoring_dataset": false, "v2.create_dataset": false, "v2.delete_dataset": false, "v2.get_all_datasets": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 1b7a7bac0e8b..b75280ddf489 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -4217,6 +4217,31 @@ 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_response" => "SecurityMonitoringDatasetAttributesResponse", + "v2.security_monitoring_dataset_create_attributes_request" => "SecurityMonitoringDatasetCreateAttributesRequest", + "v2.security_monitoring_dataset_create_data_request" => "SecurityMonitoringDatasetCreateDataRequest", + "v2.security_monitoring_dataset_create_data_response" => "SecurityMonitoringDatasetCreateDataResponse", + "v2.security_monitoring_dataset_create_request" => "SecurityMonitoringDatasetCreateRequest", + "v2.security_monitoring_dataset_create_response" => "SecurityMonitoringDatasetCreateResponse", + "v2.security_monitoring_dataset_data_response" => "SecurityMonitoringDatasetDataResponse", + "v2.security_monitoring_dataset_definition" => "SecurityMonitoringDatasetDefinition", + "v2.security_monitoring_dataset_definition_column" => "SecurityMonitoringDatasetDefinitionColumn", + "v2.security_monitoring_dataset_definition_column_type" => "SecurityMonitoringDatasetDefinitionColumnType", + "v2.security_monitoring_dataset_dependencies_attributes_request" => "SecurityMonitoringDatasetDependenciesAttributesRequest", + "v2.security_monitoring_dataset_dependencies_data_request" => "SecurityMonitoringDatasetDependenciesDataRequest", + "v2.security_monitoring_dataset_dependencies_request" => "SecurityMonitoringDatasetDependenciesRequest", + "v2.security_monitoring_dataset_dependencies_response" => "SecurityMonitoringDatasetDependenciesResponse", + "v2.security_monitoring_dataset_dependencies_type" => "SecurityMonitoringDatasetDependenciesType", + "v2.security_monitoring_dataset_dependency_attributes_response" => "SecurityMonitoringDatasetDependencyAttributesResponse", + "v2.security_monitoring_dataset_dependency_data_response" => "SecurityMonitoringDatasetDependencyDataResponse", + "v2.security_monitoring_dataset_list_meta" => "SecurityMonitoringDatasetListMeta", + "v2.security_monitoring_dataset_response" => "SecurityMonitoringDatasetResponse", + "v2.security_monitoring_datasets_history_response" => "SecurityMonitoringDatasetsHistoryResponse", + "v2.security_monitoring_datasets_list_response" => "SecurityMonitoringDatasetsListResponse", + "v2.security_monitoring_dataset_type" => "SecurityMonitoringDatasetType", + "v2.security_monitoring_dataset_update_attributes_request" => "SecurityMonitoringDatasetUpdateAttributesRequest", + "v2.security_monitoring_dataset_update_data_request" => "SecurityMonitoringDatasetUpdateDataRequest", + "v2.security_monitoring_dataset_update_request" => "SecurityMonitoringDatasetUpdateRequest", "v2.security_monitoring_filter" => "SecurityMonitoringFilter", "v2.security_monitoring_filter_action" => "SecurityMonitoringFilterAction", "v2.security_monitoring_list_rules_response" => "SecurityMonitoringListRulesResponse", 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 442daffdb1e5..9ff2ada79adf 100644 --- a/lib/datadog_api_client/v2/api/security_monitoring_api.rb +++ b/lib/datadog_api_client/v2/api/security_monitoring_api.rb @@ -164,6 +164,79 @@ 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. + # + # Batch retrieves which security rules depend on specified datasets. + # + # @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] + + 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 export security monitoring rules. # # @see #bulk_export_security_monitoring_rules_with_http_info @@ -861,6 +934,79 @@ 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 dataset for security monitoring. + # + # @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] + + 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 a detection rule. # # @see #create_security_monitoring_rule_with_http_info @@ -1329,6 +1475,77 @@ 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 dataset by its ID. + # + # @param dataset_id [UUID] The ID 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] + + 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 existing rule. # # @see #delete_security_monitoring_rule_with_http_info @@ -2579,6 +2796,224 @@ 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 a specific dataset by its ID. + # + # @param dataset_id [UUID] The ID 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] + + 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 by 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 by version. + # + # Get a specific version of a dataset. + # + # @param dataset_id [UUID] The ID of the dataset. + # @param version [Integer] The version 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_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] + + 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 dataset history. + # + # @see #get_security_monitoring_dataset_history_with_http_info + def get_security_monitoring_dataset_history(dataset_id, opts = {}) + data, _status_code, _headers = get_security_monitoring_dataset_history_with_http_info(dataset_id, opts) + data + end + + # Get dataset history. + # + # Get all historical versions of a dataset. + # + # @param dataset_id [UUID] The ID of the dataset. + # @param opts [Hash] the optional parameters + # @return [Array<(SecurityMonitoringDatasetsHistoryResponse, Integer, Hash)>] SecurityMonitoringDatasetsHistoryResponse data, response status code and response headers + def get_security_monitoring_dataset_history_with_http_info(dataset_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_security_monitoring_dataset_history".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_security_monitoring_dataset_history") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_security_monitoring_dataset_history")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_security_monitoring_dataset_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_history" + end + # resource path + local_var_path = '/api/v2/security_monitoring/datasets/{dataset_id}/history'.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] || 'SecurityMonitoringDatasetsHistoryResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_security_monitoring_dataset_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_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 @@ -4162,6 +4597,80 @@ def list_security_monitoring_critical_assets_with_http_info(opts = {}) return data, status_code, headers end + # List all 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 all datasets. + # + # List all datasets for the organization with optional pagination, filtering, and sorting. + # + # @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 Sort datasets by name, created at, or modified at. Prefix with '-' for descending order. + # @option opts [String] :filter_query 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] + + 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 @@ -5940,6 +6449,84 @@ 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 dataset. + # + # @param dataset_id [UUID] The ID 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] + + 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 existing rule. # # @see #update_security_monitoring_rule_with_http_info 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..2599e792cb46 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_attributes_response.rb @@ -0,0 +1,278 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a security monitoring dataset. + class SecurityMonitoringDatasetAttributesResponse + include BaseGenericModel + + # The creation timestamp of the dataset. + attr_reader :created_at + + # The handle of the user who created the dataset. + attr_accessor :created_by_handle + + # The name of the user who created the dataset. + attr_accessor :created_by_name + + # The definition of a dataset, including its data source, name, indexes, and columns. + attr_reader :definition + + # A description of the dataset. + attr_reader :description + + # The last modification timestamp of the dataset. + attr_accessor :modified_at + + # The name of the dataset. + attr_reader :name + + # The organization ID. + attr_reader :org_id + + # The handle of the user who last updated the dataset. + attr_accessor :updated_by_handle + + # The name of the user who last updated the dataset. + attr_accessor :updated_by_name + + # The 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', + :'modified_at' => :'modifiedAt', + :'name' => :'name', + :'org_id' => :'orgId', + :'updated_by_handle' => :'updatedByHandle', + :'updated_by_name' => :'updatedByName', + :'version' => :'version' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Time', + :'created_by_handle' => :'String', + :'created_by_name' => :'String', + :'definition' => :'SecurityMonitoringDatasetDefinition', + :'description' => :'String', + :'modified_at' => :'Time', + :'name' => :'String', + :'org_id' => :'Integer', + :'updated_by_handle' => :'String', + :'updated_by_name' => :'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::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?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'org_id') + self.org_id = attributes[:'org_id'] + 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 @definition.nil? + return false if @description.nil? + return false if @name.nil? + return false if @org_id.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 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 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 org_id [Object] Object to be assigned + # @!visibility private + def org_id=(org_id) + if org_id.nil? + fail ArgumentError, 'invalid value for "org_id", org_id cannot be nil.' + end + @org_id = org_id + 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 && + modified_at == o.modified_at && + name == o.name && + org_id == o.org_id && + 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, modified_at, name, org_id, 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_create_attributes_request.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_create_attributes_request.rb new file mode 100644 index 000000000000..e7de3a419ec2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_create_attributes_request.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 + # Attributes for creating a security monitoring dataset. + class SecurityMonitoringDatasetCreateAttributesRequest + include BaseGenericModel + + # The definition of a dataset, including its data source, name, indexes, and columns. + attr_reader :definition + + # A description of the dataset (maximum 255 characters). + attr_reader :description + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'definition' => :'definition', + :'description' => :'description' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'definition' => :'SecurityMonitoringDatasetDefinition', + :'description' => :'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::SecurityMonitoringDatasetCreateAttributesRequest` 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 + 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? + return false if @description.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 + + # 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 + + # 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 && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [definition, description, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_create_data_request.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_create_data_request.rb new file mode 100644 index 000000000000..a641bebf35e2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_create_data_request.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for creating a security monitoring dataset. + class SecurityMonitoringDatasetCreateDataRequest + include BaseGenericModel + + # Attributes for creating a security monitoring dataset. + attr_reader :attributes + + # Type for security monitoring dataset objects. + 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' => :'SecurityMonitoringDatasetCreateAttributesRequest', + :'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::SecurityMonitoringDatasetCreateDataRequest` 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_data_response.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_create_data_response.rb new file mode 100644 index 000000000000..daf190dddf39 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_create_data_response.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data returned after creating a security monitoring dataset. + class SecurityMonitoringDatasetCreateDataResponse + include BaseGenericModel + + # The unique identifier of the created dataset. + attr_reader :id + + # Type for security monitoring dataset objects. + 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::SecurityMonitoringDatasetCreateDataResponse` 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_request.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_create_request.rb new file mode 100644 index 000000000000..fea337524083 --- /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 to create a security monitoring dataset. + class SecurityMonitoringDatasetCreateRequest + include BaseGenericModel + + # Data for creating a security monitoring dataset. + 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' => :'SecurityMonitoringDatasetCreateDataRequest' + } + 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..d1c114056ebe --- /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 after creating a security monitoring dataset. + class SecurityMonitoringDatasetCreateResponse + include BaseGenericModel + + # Data returned after creating a security monitoring dataset. + 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' => :'SecurityMonitoringDatasetCreateDataResponse' + } + 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_data_response.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_data_response.rb new file mode 100644 index 000000000000..0aa8e2c0b795 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_data_response.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 security monitoring dataset. + class SecurityMonitoringDatasetDataResponse + include BaseGenericModel + + # Attributes of a security monitoring dataset. + attr_reader :attributes + + # The unique identifier of the dataset. + attr_reader :id + + # Type for security monitoring dataset objects. + 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::SecurityMonitoringDatasetDataResponse` 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..eb1e07dfd4d7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_definition.rb @@ -0,0 +1,179 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The definition of a dataset, including its data source, name, indexes, and columns. + class SecurityMonitoringDatasetDefinition + include BaseGenericModel + + # The columns in the dataset. + attr_reader :columns + + # The data source for the dataset. + attr_reader :data_source + + # The indexes to use for the dataset. + attr_accessor :indexes + + # The name of the dataset. Must start with a letter, contain only lowercase letters, numbers, and underscores, and be at most 255 characters long. + attr_reader :name + + 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' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'columns' => :'Array', + :'data_source' => :'String', + :'indexes' => :'Array', + :'name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::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 + 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 @columns.nil? + return false if @data_source.nil? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param columns [Object] Object to be assigned + # @!visibility private + def columns=(columns) + if columns.nil? + fail ArgumentError, 'invalid value for "columns", columns cannot be nil.' + end + @columns = columns + 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 && + 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, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_definition_column.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_definition_column.rb new file mode 100644 index 000000000000..b82f0bef5d3a --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_definition_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 in a dataset definition. + class SecurityMonitoringDatasetDefinitionColumn + include BaseGenericModel + + # The name of the column. + attr_reader :column + + # The type of the column in a dataset definition. + 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' => :'SecurityMonitoringDatasetDefinitionColumnType' + } + 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::SecurityMonitoringDatasetDefinitionColumn` 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_definition_column_type.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_definition_column_type.rb new file mode 100644 index 000000000000..5fda268d2dfd --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_definition_column_type.rb @@ -0,0 +1,29 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of the column in a dataset definition. + class SecurityMonitoringDatasetDefinitionColumnType + include BaseEnumModel + + STRING = "string".freeze + INTEGER = "integer".freeze + DOUBLE = "double".freeze + BOOLEAN = "boolean".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependencies_attributes_request.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependencies_attributes_request.rb new file mode 100644 index 000000000000..e681bf7ea4cb --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependencies_attributes_request.rb @@ -0,0 +1,133 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for dataset dependencies request. + class SecurityMonitoringDatasetDependenciesAttributesRequest + include BaseGenericModel + + # Array of dataset IDs to check dependencies for (minimum 1, maximum 100). + 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::SecurityMonitoringDatasetDependenciesAttributesRequest` 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? + return false if @dataset_ids.length > 100 + return false if @dataset_ids.length < 1 + 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 + if dataset_ids.length > 100 + fail ArgumentError, 'invalid value for "dataset_ids", number of items must be less than or equal to 100.' + end + if dataset_ids.length < 1 + fail ArgumentError, 'invalid value for "dataset_ids", number of items must be greater than or equal to 1.' + 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_data_request.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependencies_data_request.rb new file mode 100644 index 000000000000..67b0693be8d6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependencies_data_request.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for dataset dependencies request. + class SecurityMonitoringDatasetDependenciesDataRequest + include BaseGenericModel + + # Attributes for dataset dependencies request. + attr_reader :attributes + + # The type of the 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', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SecurityMonitoringDatasetDependenciesAttributesRequest', + :'type' => :'SecurityMonitoringDatasetDependenciesType' + } + 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::SecurityMonitoringDatasetDependenciesDataRequest` 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_dependencies_request.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependencies_request.rb new file mode 100644 index 000000000000..a0e627ed35af --- /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 to get dataset dependencies. + class SecurityMonitoringDatasetDependenciesRequest + include BaseGenericModel + + # Data for 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' => :'SecurityMonitoringDatasetDependenciesDataRequest' + } + 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_response.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependencies_response.rb new file mode 100644 index 000000000000..c6badf1b5f81 --- /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 containing dataset dependencies. + class SecurityMonitoringDatasetDependenciesResponse + include BaseGenericModel + + # Array of dataset dependencies. + 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_dependencies_type.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependencies_type.rb new file mode 100644 index 000000000000..b8e4befcd167 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependencies_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 the response. + class SecurityMonitoringDatasetDependenciesType + include BaseEnumModel + + SECURITY_MONITORING_DATASET_DEPENDENCIES = "security_monitoring_dataset_dependencies".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependency_attributes_response.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependency_attributes_response.rb new file mode 100644 index 000000000000..db27f5a6f5ad --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependency_attributes_response.rb @@ -0,0 +1,167 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for dataset dependency. + class SecurityMonitoringDatasetDependencyAttributesResponse + include BaseGenericModel + + # The count of resources that depend on the dataset. + attr_reader :count + + # Array of IDs of resources 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', + :'ids' => :'ids', + :'resource_type' => :'resource_type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'count' => :'Integer', + :'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::SecurityMonitoringDatasetDependencyAttributesResponse` 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?(:'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 @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 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 && + 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, ids, resource_type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependency_data_response.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependency_data_response.rb new file mode 100644 index 000000000000..93b6116bff27 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_dependency_data_response.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 + # Dependencies for a dataset. + class SecurityMonitoringDatasetDependencyDataResponse + include BaseGenericModel + + # Attributes for dataset dependency. + attr_reader :attributes + + # The dataset ID. + attr_reader :id + + # The type of the 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' => :'SecurityMonitoringDatasetDependencyAttributesResponse', + :'id' => :'String', + :'type' => :'SecurityMonitoringDatasetDependenciesType' + } + 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::SecurityMonitoringDatasetDependencyDataResponse` 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_list_meta.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_list_meta.rb new file mode 100644 index 000000000000..48064190a8f3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_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 for dataset list responses. + class SecurityMonitoringDatasetListMeta + include BaseGenericModel + + # The total count of datasets. + 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::SecurityMonitoringDatasetListMeta` 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_dataset_response.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_response.rb new file mode 100644 index 000000000000..98b81b536969 --- /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 security monitoring dataset. + class SecurityMonitoringDatasetResponse + include BaseGenericModel + + # A security monitoring dataset. + 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' => :'SecurityMonitoringDatasetDataResponse' + } + 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_type.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_type.rb new file mode 100644 index 000000000000..2869f809ea2f --- /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 + # Type for security monitoring dataset objects. + class SecurityMonitoringDatasetType + include BaseEnumModel + + SECURITY_MONITORING_DATASET = "security_monitoring_dataset".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_dataset_update_attributes_request.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_update_attributes_request.rb new file mode 100644 index 000000000000..781f015410f4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_update_attributes_request.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for updating a security monitoring dataset. + class SecurityMonitoringDatasetUpdateAttributesRequest + include BaseGenericModel + + # The definition of a dataset, including its data source, name, indexes, and columns. + attr_reader :definition + + # A description of the dataset (maximum 255 characters). + attr_reader :description + + # The expected version of the dataset for concurrent modification detection. + 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::SecurityMonitoringDatasetUpdateAttributesRequest` 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? + return false if @description.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 + + # 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 + + # 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_update_data_request.rb b/lib/datadog_api_client/v2/models/security_monitoring_dataset_update_data_request.rb new file mode 100644 index 000000000000..99813a603c50 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_dataset_update_data_request.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for updating a security monitoring dataset. + class SecurityMonitoringDatasetUpdateDataRequest + include BaseGenericModel + + # Attributes for updating a security monitoring dataset. + attr_reader :attributes + + # Type for security monitoring dataset objects. + 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' => :'SecurityMonitoringDatasetUpdateAttributesRequest', + :'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::SecurityMonitoringDatasetUpdateDataRequest` 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..f6cbc3299359 --- /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 to update a security monitoring dataset. + class SecurityMonitoringDatasetUpdateRequest + include BaseGenericModel + + # Data for updating a security monitoring dataset. + 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' => :'SecurityMonitoringDatasetUpdateDataRequest' + } + 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_datasets_history_response.rb b/lib/datadog_api_client/v2/models/security_monitoring_datasets_history_response.rb new file mode 100644 index 000000000000..eea72bc817f8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_datasets_history_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 containing the history of a security monitoring dataset. + class SecurityMonitoringDatasetsHistoryResponse + include BaseGenericModel + + # Array of dataset versions ordered by version descending. + 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::SecurityMonitoringDatasetsHistoryResponse` 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_datasets_list_response.rb b/lib/datadog_api_client/v2/models/security_monitoring_datasets_list_response.rb new file mode 100644 index 000000000000..901f2fe02ba9 --- /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 list of security monitoring datasets. + class SecurityMonitoringDatasetsListResponse + include BaseGenericModel + + # Array of datasets. + attr_reader :data + + # Metadata for dataset list responses. + 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' => :'SecurityMonitoringDatasetListMeta' + } + 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