diff --git a/.apigentools-info b/.apigentools-info index de86a3e78dbc..9860726fd84d 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-01-22 15:54:16.616972", - "spec_repo_commit": "7a8ea4b1" + "regenerated": "2025-01-23 14:30:03.173234", + "spec_repo_commit": "e2b0a91f" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-01-22 15:54:16.633227", - "spec_repo_commit": "7a8ea4b1" + "regenerated": "2025-01-23 14:30:03.192685", + "spec_repo_commit": "e2b0a91f" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a06d74ae8e66..9f213d57a225 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -782,6 +782,28 @@ components: schema: $ref: '#/components/schemas/APIErrorResponse' description: Forbidden + InboxRulesList: + content: + application/json: + schema: + properties: + data: + items: + $ref: '#/components/schemas/InboxRule' + type: array + type: object + description: The list of inbox rules + MuteRulesList: + content: + application/json: + schema: + properties: + data: + items: + $ref: '#/components/schemas/MuteRule' + type: array + type: object + description: The list of mute rules NotAuthorizedResponse: content: application/json: @@ -836,6 +858,13 @@ components: schema: $ref: '#/components/schemas/APIErrorResponse' description: Unauthorized + UnprocessableEntityResponse: + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: The server cannot process the request because it contains invalid + data. schemas: APIErrorResponse: description: API error response. @@ -1730,6 +1759,31 @@ components: oneOf: - $ref: '#/components/schemas/AWSIntegrationUpdate' - $ref: '#/components/schemas/HTTPIntegrationUpdate' + ActionInbox: + description: Action of the inbox rule + properties: + reason_description: + description: Free text to add a reason description. + example: We want to focus on these items. + type: string + type: object + ActionMute: + description: Action of the mute rule + properties: + expire_at: + description: End date of the mute rule (null means mute forever) + example: 1893452400000 + format: int64 + type: integer + reason: + $ref: '#/components/schemas/MuteReason' + reason_description: + description: Free text to add a reason description. + example: Muting for a while + type: string + required: + - reason + type: object ActiveBillingDimensionsAttributes: description: List of active billing dimensions. properties: @@ -7403,6 +7457,76 @@ components: meta: $ref: '#/components/schemas/DataDeletionResponseMeta' type: object + CreateInboxRuleParameters: + description: Body of the inbox rule create request + properties: + data: + $ref: '#/components/schemas/CreateInboxRuleParametersData' + type: object + CreateInboxRuleParametersData: + description: 'Data of the inbox rule create request: the rule type, and the + rule attributes. All fields are required.' + properties: + attributes: + $ref: '#/components/schemas/CreateInboxRuleParametersDataAttributes' + type: + $ref: '#/components/schemas/InboxRulesType' + required: + - attributes + - type + type: object + CreateInboxRuleParametersDataAttributes: + description: 'Attributes of the inbox rule create request: the rule name, the + rule details, the associated action, and the optional enabled field.' + properties: + action: + $ref: '#/components/schemas/ActionInbox' + enabled: + $ref: '#/components/schemas/Enabled' + name: + $ref: '#/components/schemas/RuleName' + rule: + $ref: '#/components/schemas/Rule' + required: + - action + - name + - rule + type: object + CreateMuteRuleParameters: + description: Body of the mute rule create request + properties: + data: + $ref: '#/components/schemas/CreateMuteRuleParametersData' + type: object + CreateMuteRuleParametersData: + description: 'Data of the mute rule create request: the rule type, and the rule + attributes. All fields are required.' + properties: + attributes: + $ref: '#/components/schemas/CreateMuteRuleParametersDataAttributes' + type: + $ref: '#/components/schemas/MuteRulesType' + required: + - attributes + - type + type: object + CreateMuteRuleParametersDataAttributes: + description: 'Attributes of the mute rule create request: the rule name, the + rule details, the associated action, and the optional enabled field.' + properties: + action: + $ref: '#/components/schemas/ActionMute' + enabled: + $ref: '#/components/schemas/Enabled' + name: + $ref: '#/components/schemas/RuleName' + rule: + $ref: '#/components/schemas/Rule' + required: + - action + - name + - rule + type: object CreateOpenAPIResponse: description: Response for `CreateOpenAPI` operation. properties: @@ -9115,6 +9239,11 @@ components: type: number type: array type: object + Date: + description: Date as Unix timestamp in milliseconds + example: 1722439510282 + format: int64 + type: integer DeleteAppResponse: description: The definition of `DeleteAppResponse` object. properties: @@ -10297,6 +10426,10 @@ components: - score - severity type: object + Enabled: + description: Field used to enable or disable the rule. + example: true + type: boolean EntityAttributes: description: Entity attributes. properties: @@ -13352,6 +13485,67 @@ components: type: string x-mimetype: application/xml type: object + InboxRule: + description: 'Inbox rules are used to prioritize and add relevant vulnerabilities + to your Security Inbox. + + An inbox rule is composed of a rule UUID, a rule type, and the rule attributes. + All fields are required.' + properties: + attributes: + $ref: '#/components/schemas/InboxRuleAttributes' + id: + $ref: '#/components/schemas/UUID' + type: + $ref: '#/components/schemas/InboxRulesType' + required: + - attributes + - id + - type + type: object + InboxRuleAttributes: + description: Attributes of the inbox rule + properties: + action: + $ref: '#/components/schemas/ActionInbox' + created_at: + $ref: '#/components/schemas/Date' + created_by: + $ref: '#/components/schemas/RuleUser' + enabled: + $ref: '#/components/schemas/Enabled' + modified_at: + $ref: '#/components/schemas/Date' + modified_by: + $ref: '#/components/schemas/RuleUser' + name: + $ref: '#/components/schemas/RuleName' + rule: + $ref: '#/components/schemas/Rule' + required: + - action + - created_at + - created_by + - enabled + - modified_at + - modified_by + - name + - rule + type: object + InboxRuleResponse: + description: Response object which includes an inbox rule. + properties: + data: + $ref: '#/components/schemas/InboxRule' + type: object + InboxRulesType: + description: The pipeline rule type associated to inbox rules + enum: + - inbox_rules + example: inbox_rules + type: string + x-enum-varnames: + - INBOX_RULES IncidentAttachmentAttachmentType: description: The type of the incident attachment attributes. enum: @@ -15557,6 +15751,14 @@ components: - DOWN - WARNING - 'OFF' + IssueType: + description: The type of issues on which the rule applies + enum: + - vulnerability + example: vulnerability + type: string + x-enum-varnames: + - VULNERABILITY JSONAPIErrorItem: description: API error response body properties: @@ -19381,6 +19583,91 @@ components: meta: $ref: '#/components/schemas/MonthlyCostAttributionMeta' type: object + MuteReason: + description: Reason for muting a vulnerability + enum: + - duplicate + - external_solution + - false_positive + - internal_solution + - no_fix_available + - other + - pending_fix + - risk_accepted + example: duplicate + type: string + x-enum-varnames: + - DUPLICATE + - EXTERNAL_SOLUTION + - FALSE_POSITIVE + - INTERNAL_SOLUTION + - NO_FIX_AVAILABLE + - OTHER + - PENDING_FIX + - RISK_ACCEPTED + MuteRule: + description: 'Mute rules are used to proactively filter out known false positives + or accepted risks. + + A mute rule is composed of a rule UUID, a rule type, and the rule attributes. + All fields are required. + + ' + properties: + attributes: + $ref: '#/components/schemas/MuteRuleAttributes' + id: + $ref: '#/components/schemas/UUID' + type: + $ref: '#/components/schemas/MuteRulesType' + required: + - attributes + - id + - type + type: object + MuteRuleAttributes: + description: Attributes of the mute rule + properties: + action: + $ref: '#/components/schemas/ActionMute' + created_at: + $ref: '#/components/schemas/Date' + created_by: + $ref: '#/components/schemas/RuleUser' + enabled: + $ref: '#/components/schemas/Enabled' + modified_at: + $ref: '#/components/schemas/Date' + modified_by: + $ref: '#/components/schemas/RuleUser' + name: + $ref: '#/components/schemas/RuleName' + rule: + $ref: '#/components/schemas/Rule' + required: + - action + - created_at + - created_by + - enabled + - modified_at + - modified_by + - name + - rule + type: object + MuteRuleResponse: + description: Response object which includes a mute rule. + properties: + data: + $ref: '#/components/schemas/MuteRule' + type: object + MuteRulesType: + description: The pipeline rule type associated to mute rules + enum: + - mute_rules + example: mute_rules + type: string + x-enum-varnames: + - MUTE_RULES NullableRelationshipToUser: description: Relationship to user. nullable: true @@ -20234,6 +20521,74 @@ components: $ref: '#/components/schemas/ApplicationKeyResponseIncludedItem' type: array type: object + PatchInboxRulesParameters: + description: Body of the inbox rule patch request + properties: + data: + $ref: '#/components/schemas/PatchInboxRulesParametersData' + type: object + PatchInboxRulesParametersData: + description: 'Data of the inbox rule patch request: the rule UUID, the rule + type, and the rule attributes. All fields are required.' + properties: + attributes: + $ref: '#/components/schemas/PatchInboxRulesParametersDataAttributes' + id: + $ref: '#/components/schemas/UUID' + type: + $ref: '#/components/schemas/InboxRulesType' + required: + - attributes + - id + - type + type: object + PatchInboxRulesParametersDataAttributes: + description: 'Attributes of the inbox rule patch request: the rule name, the + rule details, the associated action, and the enabled field.' + properties: + action: + $ref: '#/components/schemas/ActionInbox' + enabled: + $ref: '#/components/schemas/Enabled' + name: + $ref: '#/components/schemas/RuleName' + rule: + $ref: '#/components/schemas/Rule' + type: object + PatchMuteRuleParameters: + description: Body of the mute rule patch request + properties: + data: + $ref: '#/components/schemas/PatchMuteRuleParametersData' + type: object + PatchMuteRuleParametersData: + description: 'Data of the mute rule patch request: the rule UUID, the rule type, + and the rule attributes. All fields are required.' + properties: + attributes: + $ref: '#/components/schemas/PatchMuteRuleParametersDataAttributes' + id: + $ref: '#/components/schemas/UUID' + type: + $ref: '#/components/schemas/MuteRulesType' + required: + - attributes + - id + - type + type: object + PatchMuteRuleParametersDataAttributes: + description: 'Attributes of the mute rule patch request: the rule name, the + rule details, the associated action, and the enabled field.' + properties: + action: + $ref: '#/components/schemas/ActionMute' + enabled: + $ref: '#/components/schemas/Enabled' + name: + $ref: '#/components/schemas/RuleName' + rule: + $ref: '#/components/schemas/Rule' + type: object Permission: description: Permission object. properties: @@ -22227,6 +22582,50 @@ components: - new_advisories - avoided_advisories type: object + ReorderInboxRulesParameters: + description: 'Body of the inbox rule reorder request: the full list of inbox + rules needs to be provided in the new order.' + properties: + data: + description: The `ReorderInboxRulesParameters` `data`. + items: + $ref: '#/components/schemas/ReorderInboxRulesParametersData' + type: array + type: object + ReorderInboxRulesParametersData: + description: 'Data of the inbox rule reorder request: the rule UUID, the rule + type, and the rule attributes. All fields are required.' + properties: + id: + $ref: '#/components/schemas/UUID' + type: + $ref: '#/components/schemas/InboxRulesType' + required: + - id + - type + type: object + ReorderMuteRulesParameters: + description: 'Body of the mute rule reorder request: the full list of mute rules + needs to be provided in the new order.' + properties: + data: + description: The `ReorderMuteRulesParameters` `data`. + items: + $ref: '#/components/schemas/ReorderMuteRulesParametersData' + type: array + type: object + ReorderMuteRulesParametersData: + description: 'Data of the mute rule reorder request: a rule UUID and its type. + All fields are required.' + properties: + id: + $ref: '#/components/schemas/UUID' + type: + $ref: '#/components/schemas/MuteRulesType' + required: + - id + - type + type: object ReorderRetentionFiltersRequest: description: A list of retention filters to reorder. properties: @@ -22874,6 +23273,33 @@ components: type: string x-enum-varnames: - ROLES + Rule: + description: 'The definition of an automation pipeline rule scope. + + A rule can act on specific issue types, security rule types, security rule + IDs, rule severities, or a query. + + The query can be used to filter resources on tags and attributes. + + The issue type and rule types fields are required.' + properties: + issue_type: + $ref: '#/components/schemas/IssueType' + query: + $ref: '#/components/schemas/RuleQuery' + rule_ids: + $ref: '#/components/schemas/RuleIds' + rule_types: + $ref: '#/components/schemas/RuleTypes' + severities: + description: The security rules severities to consider + items: + $ref: '#/components/schemas/RuleSeverity' + type: array + required: + - issue_type + - rule_types + type: object RuleAttributes: description: Details of a rule. properties: @@ -22915,12 +23341,46 @@ components: description: The unique ID for a scorecard rule. example: q8MQxk8TCqrHnWkx type: string + RuleIds: + description: Security rule ids + items: + description: Id of a rule + example: rule-id-1 + type: string + type: array + RuleName: + description: Name of the pipeline rule + example: Rule 1 + type: string RuleOutcomeRelationships: description: The JSON:API relationship to a scorecard rule. properties: rule: $ref: '#/components/schemas/RelationshipToOutcome' type: object + RuleQuery: + description: The query is composed of one or several key:value pairs, which + can be used to filter resources on tags and attributes. + example: key:val + type: string + RuleSeverity: + description: Severity of a security rule + enum: + - critical + - high + - medium + - low + - unknown + - info + example: critical + type: string + x-enum-varnames: + - CRITICAL + - HIGH + - MEDIUM + - LOW + - UNKNOWN + - INFO RuleType: default: rule description: The JSON:API type for scorecard rules. @@ -22930,6 +23390,46 @@ components: type: string x-enum-varnames: - RULE + RuleTypes: + description: Security rule types + example: + - application_code_vulnerability + items: + $ref: '#/components/schemas/RuleTypesItems' + type: array + RuleTypesItems: + description: Security rule type + enum: + - application_code_vulnerability + - application_library_vulnerability + - attack_path + - container_image_vulnerability + - host_vulnerability + - identity_risk + - misconfiguration + - api_security + type: string + x-enum-varnames: + - APPLICATION_CODE_VULNERABILITY + - APPLICATION_LIBRARY_VULNERABILITY + - ATTACK_PATH + - CONTAINER_IMAGE_VULNERABILITY + - HOST_VULNERABILITY + - IDENTITY_RISK + - MISCONFIGURATION + - API_SECURITY + RuleUser: + description: User creating or modifying a rule + properties: + handle: + description: The user handle. + example: john.doe@domain.com + type: string + name: + description: The user name. + example: John Doe + type: string + type: object RumMetricCompute: description: The compute rule to compute the rum-based metric. properties: @@ -29307,6 +29807,11 @@ components: type: string x-enum-varnames: - SECRET + UUID: + description: The ID of a pipeline rule + example: 123e4567-e89b-12d3-a456-426655440000 + format: uuid + type: string Unit: description: Object containing the metric unit family, scale factor, name, and short name. @@ -29540,6 +30045,48 @@ components: deployment: $ref: '#/components/schemas/DeploymentRelationship' type: object + UpdateInboxRuleParameters: + description: Body of the inbox rule update request + properties: + data: + $ref: '#/components/schemas/UpdateInboxRuleParametersData' + type: object + UpdateInboxRuleParametersData: + description: 'Data of the inbox rule update request: the rule id, the rule type, + and the rule attributes. All fields are required.' + properties: + attributes: + $ref: '#/components/schemas/CreateInboxRuleParametersDataAttributes' + id: + $ref: '#/components/schemas/UUID' + type: + $ref: '#/components/schemas/InboxRulesType' + required: + - id + - attributes + - type + type: object + UpdateMuteRuleParameters: + description: Body of the mute rule update request + properties: + data: + $ref: '#/components/schemas/UpdateMuteRuleParametersData' + type: object + UpdateMuteRuleParametersData: + description: 'Data of the mute rule update request: the rule id, the rule type, + and the rule attributes. All fields are required.' + properties: + attributes: + $ref: '#/components/schemas/CreateMuteRuleParametersDataAttributes' + id: + $ref: '#/components/schemas/UUID' + type: + $ref: '#/components/schemas/MuteRulesType' + required: + - id + - attributes + - type + type: object UpdateOpenAPIResponse: description: Response for `UpdateOpenAPI`. properties: @@ -43929,6 +44476,559 @@ paths: x-unstable: '**Note**: This endpoint is a private preview. If you are interested in accessing this API, please [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9).' + /api/v2/security/vulnerabilities/pipelines/inbox_rules: + get: + description: Returns the ordered list of inbox rules in the pipeline (first + match applies) + operationId: GetInboxRules + responses: + '200': + $ref: '#/components/responses/InboxRulesList' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_read + summary: Get the ordered list of inbox rules + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_read + post: + description: Create a new inbox rule and return the created rule. + operationId: CreateInboxRule + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateInboxRuleParameters' + description: 'Mandatory fields are the rule type and the required attributes: + rule name, rule details, and action. + + The rule details are composed of issue types and security rule types on + which the rule applies. Optional security rule IDs, severities, and a tag + or attribute query can be provided. + + The action is composed of the optional reason description. + + ' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/InboxRuleResponse' + description: Successfully created the inbox rule + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_write + summary: Create a new inbox rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + /api/v2/security/vulnerabilities/pipelines/inbox_rules/reorder: + post: + description: 'Reorder the list of inbox rules in the pipeline and return the + reordered list of rules. + + To reorder fields you need to provide the full list of pipeline rules in the + new order.' + operationId: ReorderInboxRules + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ReorderInboxRulesParameters' + description: 'The list of rules to reorder. The order of the rules in the + list will be the new order in the pipeline. + + ' + required: true + responses: + '200': + $ref: '#/components/responses/InboxRulesList' + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_write + summary: Reorder the list of inbox rules in the pipeline + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + /api/v2/security/vulnerabilities/pipelines/inbox_rules/{inbox_rule_id}: + delete: + description: Delete an inbox rule + operationId: DeleteInboxRule + parameters: + - description: ID of the inbox rule + in: path + name: inbox_rule_id + required: true + schema: + format: uuid + type: string + responses: + '204': + description: Rule successfully deleted + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_write + summary: Delete an inbox rule + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_write + get: + description: Get the details of an inbox rule. + operationId: GetInboxRule + parameters: + - description: ID of the inbox rule + in: path + name: inbox_rule_id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/InboxRuleResponse' + description: Inbox rule details + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_read + summary: Get details of an inbox rule + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_read + patch: + description: Partially update the inbox rule. All fields are optional; if a + field is not provided, it will not be updated. + operationId: PatchInboxRule + parameters: + - description: ID of the inbox rule + in: path + name: inbox_rule_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PatchInboxRulesParameters' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/InboxRuleResponse' + description: Inbox rule successfully patched + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '422': + $ref: '#/components/responses/UnprocessableEntityResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_write + summary: Patch an inbox rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + put: + description: Update the whole inbox rule. If an optional field is not provided, + it will be set to its default value. + operationId: UpdateInboxRule + parameters: + - description: ID of the inbox rule + in: path + name: inbox_rule_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateInboxRuleParameters' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/InboxRuleResponse' + description: Inbox rule successfully updated + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '422': + $ref: '#/components/responses/UnprocessableEntityResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_write + summary: Update an inbox rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + /api/v2/security/vulnerabilities/pipelines/mute_rules: + get: + description: Returns the ordered list of mute rules in the pipeline (first match + applies) + operationId: GetMuteRules + responses: + '200': + $ref: '#/components/responses/MuteRulesList' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_read + summary: Get the ordered list of mute rules + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_read + post: + description: Create a new mute rule and return the created rule. + operationId: CreateMuteRule + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateMuteRuleParameters' + description: 'Mandatory fields are the rule type and the required attributes: + rule name, rule details, and action. + + The rule details are composed of issue types and security rule types on + which the rule applies. Optional security rule IDs, severities, and a tag + or attribute query can be provided. + + The action is composed of the reason for muting and the rule expiration + date, and optionally a description of the rule. + + ' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/MuteRuleResponse' + description: Successfully created the mute rule + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_write + summary: Create a new mute rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + /api/v2/security/vulnerabilities/pipelines/mute_rules/reorder: + post: + description: 'Reorder the list of mute rules in the pipeline and return the + reordered list of rules. + + To reorder fields you need to provide the full list of pipeline rules in the + new order.' + operationId: ReorderMuteRules + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ReorderMuteRulesParameters' + description: 'The list of rules to reorder. The order of the rules in the + list will be the new order in the pipeline. + + ' + required: true + responses: + '200': + $ref: '#/components/responses/MuteRulesList' + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_write + summary: Reorder the list of mute rules in the pipeline + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + /api/v2/security/vulnerabilities/pipelines/mute_rules/{mute_rule_id}: + delete: + description: Delete a mute rule + operationId: DeleteMuteRule + parameters: + - description: ID of the mute rule + in: path + name: mute_rule_id + required: true + schema: + format: uuid + type: string + responses: + '204': + description: Rule successfully deleted + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_write + summary: Delete a mute rule + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_write + get: + description: Get the details of a mute rule. + operationId: GetMuteRule + parameters: + - description: ID of the mute rule + in: path + name: mute_rule_id + required: true + schema: + format: uuid + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MuteRuleResponse' + description: Mute rule details + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_read + summary: Get details of a mute rule + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_read + patch: + description: Partially update the mute rule. All fields are optional; if a field + is not provided, it will not be updated. + operationId: PatchMuteRule + parameters: + - description: ID of the mute rule + in: path + name: mute_rule_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PatchMuteRuleParameters' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MuteRuleResponse' + description: Mute rule successfully patched + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '422': + $ref: '#/components/responses/UnprocessableEntityResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_write + summary: Patch a mute rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + put: + description: Update the whole mute rule. If an optional field is not provided, + it will be set to its default value. + operationId: UpdateMuteRule + parameters: + - description: ID of the mute rule + in: path + name: mute_rule_id + required: true + schema: + format: uuid + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateMuteRuleParameters' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MuteRuleResponse' + description: Mute rule successfully updated + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '422': + $ref: '#/components/responses/UnprocessableEntityResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_pipelines_write + summary: Update a mute rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write /api/v2/security_monitoring/cloud_workload_security/agent_rules: get: description: Get the list of Agent rules. diff --git a/cassettes/features/v2/security_monitoring/Create-a-new-inbox-rule-returns-Bad-Request-response.frozen b/cassettes/features/v2/security_monitoring/Create-a-new-inbox-rule-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..10159685ee01 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-a-new-inbox-rule-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-01-23T08:40:24.310Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Create-a-new-inbox-rule-returns-Bad-Request-response.yml b/cassettes/features/v2/security_monitoring/Create-a-new-inbox-rule-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..a47b108c598d --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-a-new-inbox-rule-returns-Bad-Request-response.yml @@ -0,0 +1,26 @@ +http_interactions: +- recorded_at: Thu, 23 Jan 2025 08:40:24 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"reason_description":"We want to focus + on these items."},"enabled":true,"name":"Rule 1","rule":{"issue_type":"vulnerability","query":"key:val","rule_ids":["rule-id-1"],"rule_types":["application_code_vulnerability"],"severities":["critical"]}}}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"got type + \"\" expected one of \"inbox_rules\""}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Create-a-new-inbox-rule-returns-Successfully-created-the-inbox-rule-response.frozen b/cassettes/features/v2/security_monitoring/Create-a-new-inbox-rule-returns-Successfully-created-the-inbox-rule-response.frozen new file mode 100644 index 000000000000..18e27819e0d8 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-a-new-inbox-rule-returns-Successfully-created-the-inbox-rule-response.frozen @@ -0,0 +1 @@ +2025-01-23T08:40:24.671Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Create-a-new-inbox-rule-returns-Successfully-created-the-inbox-rule-response.yml b/cassettes/features/v2/security_monitoring/Create-a-new-inbox-rule-returns-Successfully-created-the-inbox-rule-response.yml new file mode 100644 index 000000000000..41bb02b0ae4c --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-a-new-inbox-rule-returns-Successfully-created-the-inbox-rule-response.yml @@ -0,0 +1,43 @@ +http_interactions: +- recorded_at: Thu, 23 Jan 2025 08:40:24 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"reason_description":"We want to focus + on these items."},"enabled":true,"name":"Rule 1","rule":{"issue_type":"vulnerability","query":"key:val","rule_ids":["rule-id-1"],"rule_types":["application_code_vulnerability"],"severities":["critical"]}},"type":"inbox_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"9699508b-4736-416c-a8a7-1b7343eb9d42","type":"inbox_rules","attributes":{"action":{"reason_description":"We + want to focus on these items."},"created_at":1737621625085,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737621625085,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Rule + 1","rule":{"issue_type":"vulnerability","rule_types":["application_code_vulnerability"],"rule_ids":["rule-id-1"],"query":"key:val","severities":["critical"]}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Thu, 23 Jan 2025 08:40:24 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/9699508b-4736-416c-a8a7-1b7343eb9d42 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Create-a-new-mute-rule-returns-Bad-Request-response.frozen b/cassettes/features/v2/security_monitoring/Create-a-new-mute-rule-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..ce25e954323c --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-a-new-mute-rule-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-01-23T13:40:58.713Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Create-a-new-mute-rule-returns-Bad-Request-response.yml b/cassettes/features/v2/security_monitoring/Create-a-new-mute-rule-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..7b43827c91ee --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-a-new-mute-rule-returns-Bad-Request-response.yml @@ -0,0 +1,26 @@ +http_interactions: +- recorded_at: Thu, 23 Jan 2025 13:40:58 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"expire_at":1893452400000,"reason":"duplicate","reason_description":"Muting + for a while"},"enabled":true,"name":"Rule 1","rule":{"issue_type":"vulnerability","query":"key:val","rule_ids":["rule-id-1"],"rule_types":["application_code_vulnerability"],"severities":["critical"]}}}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"got type + \"\" expected one of \"mute_rules\""}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Create-a-new-mute-rule-returns-Successfully-created-the-mute-rule-response.frozen b/cassettes/features/v2/security_monitoring/Create-a-new-mute-rule-returns-Successfully-created-the-mute-rule-response.frozen new file mode 100644 index 000000000000..3f78331241ea --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-a-new-mute-rule-returns-Successfully-created-the-mute-rule-response.frozen @@ -0,0 +1 @@ +2025-01-23T13:40:59.068Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Create-a-new-mute-rule-returns-Successfully-created-the-mute-rule-response.yml b/cassettes/features/v2/security_monitoring/Create-a-new-mute-rule-returns-Successfully-created-the-mute-rule-response.yml new file mode 100644 index 000000000000..01d88a88c8ac --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-a-new-mute-rule-returns-Successfully-created-the-mute-rule-response.yml @@ -0,0 +1,43 @@ +http_interactions: +- recorded_at: Thu, 23 Jan 2025 13:40:59 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"expire_at":1893452400000,"reason":"duplicate","reason_description":"Muting + for a while"},"enabled":true,"name":"Rule 1","rule":{"issue_type":"vulnerability","query":"key:val","rule_ids":["rule-id-1"],"rule_types":["application_code_vulnerability"],"severities":["critical"]}},"type":"mute_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"f5497c52-4c9b-4a2c-bf17-0a506827464e","type":"mute_rules","attributes":{"action":{"reason":"duplicate","reason_description":"Muting + for a while","expire_at":1893452400000},"created_at":1737639659503,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737639659503,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Rule + 1","rule":{"issue_type":"vulnerability","rule_types":["application_code_vulnerability"],"rule_ids":["rule-id-1"],"query":"key:val","severities":["critical"]}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Thu, 23 Jan 2025 13:40:59 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/f5497c52-4c9b-4a2c-bf17-0a506827464e + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Delete-a-mute-rule-returns-Not-Found-response.frozen b/cassettes/features/v2/security_monitoring/Delete-a-mute-rule-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..bf323f82b6e5 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Delete-a-mute-rule-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2025-01-23T13:41:02.850Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Delete-a-mute-rule-returns-Not-Found-response.yml b/cassettes/features/v2/security_monitoring/Delete-a-mute-rule-returns-Not-Found-response.yml new file mode 100644 index 000000000000..5aa70208fc98 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Delete-a-mute-rule-returns-Not-Found-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Thu, 23 Jan 2025 13:41:02 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/00000000-0000-0000-0000-426655000000 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"Rule does + not exist"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Delete-a-mute-rule-returns-Rule-successfully-deleted-response.frozen b/cassettes/features/v2/security_monitoring/Delete-a-mute-rule-returns-Rule-successfully-deleted-response.frozen new file mode 100644 index 000000000000..adb4a014aefd --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Delete-a-mute-rule-returns-Rule-successfully-deleted-response.frozen @@ -0,0 +1 @@ +2025-01-23T13:41:03.310Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Delete-a-mute-rule-returns-Rule-successfully-deleted-response.yml b/cassettes/features/v2/security_monitoring/Delete-a-mute-rule-returns-Rule-successfully-deleted-response.yml new file mode 100644 index 000000000000..6110bbf1336a --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Delete-a-mute-rule-returns-Rule-successfully-deleted-response.yml @@ -0,0 +1,59 @@ +http_interactions: +- recorded_at: Thu, 23 Jan 2025 13:41:03 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"reason":"duplicate"},"enabled":true,"name":"Test-Delete_a_mute_rule_returns_Rule_successfully_deleted_response-1737639663","rule":{"issue_type":"vulnerability","query":"","rule_ids":[],"rule_types":["misconfiguration","attack_path"],"severities":["critical"]}},"type":"mute_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"ba7a16f1-4f80-417d-a868-6b5f14dd3328","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1737639663734,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737639663734,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Delete_a_mute_rule_returns_Rule_successfully_deleted_response-1737639663","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Thu, 23 Jan 2025 13:41:03 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/ba7a16f1-4f80-417d-a868-6b5f14dd3328 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Thu, 23 Jan 2025 13:41:03 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/ba7a16f1-4f80-417d-a868-6b5f14dd3328 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"Rule does + not exist"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Delete-an-inbox-rule-returns-Not-Found-response.frozen b/cassettes/features/v2/security_monitoring/Delete-an-inbox-rule-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..c04a6bdec536 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Delete-an-inbox-rule-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2025-01-23T08:40:36.673Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Delete-an-inbox-rule-returns-Not-Found-response.yml b/cassettes/features/v2/security_monitoring/Delete-an-inbox-rule-returns-Not-Found-response.yml new file mode 100644 index 000000000000..85eeb20bb8a4 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Delete-an-inbox-rule-returns-Not-Found-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Thu, 23 Jan 2025 08:40:36 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/00000000-0000-0000-0000-426655000000 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"Rule does + not exist"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Delete-an-inbox-rule-returns-Rule-successfully-deleted-response.frozen b/cassettes/features/v2/security_monitoring/Delete-an-inbox-rule-returns-Rule-successfully-deleted-response.frozen new file mode 100644 index 000000000000..83caacd996fe --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Delete-an-inbox-rule-returns-Rule-successfully-deleted-response.frozen @@ -0,0 +1 @@ +2025-01-23T08:40:37.024Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Delete-an-inbox-rule-returns-Rule-successfully-deleted-response.yml b/cassettes/features/v2/security_monitoring/Delete-an-inbox-rule-returns-Rule-successfully-deleted-response.yml new file mode 100644 index 000000000000..93c176ced9d8 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Delete-an-inbox-rule-returns-Rule-successfully-deleted-response.yml @@ -0,0 +1,61 @@ +http_interactions: +- recorded_at: Thu, 23 Jan 2025 08:40:37 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"reason_description":"items to focus + on"},"enabled":true,"name":"Test-Delete_an_inbox_rule_returns_Rule_successfully_deleted_response-1737621637","rule":{"issue_type":"vulnerability","query":"","rule_ids":[],"rule_types":["misconfiguration","attack_path"],"severities":["critical"]}},"type":"inbox_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"6d6379c8-16a2-42a0-9119-5a76c0d947fc","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1737621637438,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737621637438,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Delete_an_inbox_rule_returns_Rule_successfully_deleted_response-1737621637","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Thu, 23 Jan 2025 08:40:37 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/6d6379c8-16a2-42a0-9119-5a76c0d947fc + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Thu, 23 Jan 2025 08:40:37 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/6d6379c8-16a2-42a0-9119-5a76c0d947fc + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"Rule does + not exist"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Get-details-of-a-mute-rule-returns-Bad-Request-response.frozen b/cassettes/features/v2/security_monitoring/Get-details-of-a-mute-rule-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..69d2f61dc59d --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-details-of-a-mute-rule-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-01-23T13:41:21.694Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Get-details-of-a-mute-rule-returns-Bad-Request-response.yml b/cassettes/features/v2/security_monitoring/Get-details-of-a-mute-rule-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..f9e9a356957c --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-details-of-a-mute-rule-returns-Bad-Request-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Thu, 23 Jan 2025 13:41:21 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/invalid-uuid + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"ruleId not + a valid UUID"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Get-details-of-a-mute-rule-returns-Mute-rule-details-response.frozen b/cassettes/features/v2/security_monitoring/Get-details-of-a-mute-rule-returns-Mute-rule-details-response.frozen new file mode 100644 index 000000000000..cc80c8a24b49 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-details-of-a-mute-rule-returns-Mute-rule-details-response.frozen @@ -0,0 +1 @@ +2025-01-23T13:41:22.134Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Get-details-of-a-mute-rule-returns-Mute-rule-details-response.yml b/cassettes/features/v2/security_monitoring/Get-details-of-a-mute-rule-returns-Mute-rule-details-response.yml new file mode 100644 index 000000000000..9583984a972b --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-details-of-a-mute-rule-returns-Mute-rule-details-response.yml @@ -0,0 +1,58 @@ +http_interactions: +- recorded_at: Thu, 23 Jan 2025 13:41:22 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"reason":"duplicate"},"enabled":true,"name":"Test-Get_details_of_a_mute_rule_returns_Mute_rule_details_response-1737639682","rule":{"issue_type":"vulnerability","query":"","rule_ids":[],"rule_types":["misconfiguration","attack_path"],"severities":["critical"]}},"type":"mute_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"54f22733-b8d8-4b02-9b93-a9e608dfd489","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1737639682560,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737639682560,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Get_details_of_a_mute_rule_returns_Mute_rule_details_response-1737639682","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Thu, 23 Jan 2025 13:41:22 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/54f22733-b8d8-4b02-9b93-a9e608dfd489 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"54f22733-b8d8-4b02-9b93-a9e608dfd489","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1737639682560,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737639682560,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Get_details_of_a_mute_rule_returns_Mute_rule_details_response-1737639682","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Thu, 23 Jan 2025 13:41:22 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/54f22733-b8d8-4b02-9b93-a9e608dfd489 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Get-details-of-a-mute-rule-returns-Not-Found-response.frozen b/cassettes/features/v2/security_monitoring/Get-details-of-a-mute-rule-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..fe145d2ba371 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-details-of-a-mute-rule-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2025-01-23T13:41:23.432Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Get-details-of-a-mute-rule-returns-Not-Found-response.yml b/cassettes/features/v2/security_monitoring/Get-details-of-a-mute-rule-returns-Not-Found-response.yml new file mode 100644 index 000000000000..1101560272ce --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-details-of-a-mute-rule-returns-Not-Found-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Thu, 23 Jan 2025 13:41:23 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/00000000-0000-0000-0000-426655000000 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"Rule does + not exist"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Get-details-of-an-inbox-rule-returns-Bad-Request-response.frozen b/cassettes/features/v2/security_monitoring/Get-details-of-an-inbox-rule-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..120578100b19 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-details-of-an-inbox-rule-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-01-23T08:40:49.949Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Get-details-of-an-inbox-rule-returns-Bad-Request-response.yml b/cassettes/features/v2/security_monitoring/Get-details-of-an-inbox-rule-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..712bf64960a9 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-details-of-an-inbox-rule-returns-Bad-Request-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Thu, 23 Jan 2025 08:40:49 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/invalid-uuid + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"ruleId not + a valid UUID"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Get-details-of-an-inbox-rule-returns-Inbox-rule-details-response.frozen b/cassettes/features/v2/security_monitoring/Get-details-of-an-inbox-rule-returns-Inbox-rule-details-response.frozen new file mode 100644 index 000000000000..f28a13e3a993 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-details-of-an-inbox-rule-returns-Inbox-rule-details-response.frozen @@ -0,0 +1 @@ +2025-01-23T08:40:50.399Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Get-details-of-an-inbox-rule-returns-Inbox-rule-details-response.yml b/cassettes/features/v2/security_monitoring/Get-details-of-an-inbox-rule-returns-Inbox-rule-details-response.yml new file mode 100644 index 000000000000..67b786c5b6a6 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-details-of-an-inbox-rule-returns-Inbox-rule-details-response.yml @@ -0,0 +1,61 @@ +http_interactions: +- recorded_at: Thu, 23 Jan 2025 08:40:50 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"reason_description":"items to focus + on"},"enabled":true,"name":"Test-Get_details_of_an_inbox_rule_returns_Inbox_rule_details_response-1737621650","rule":{"issue_type":"vulnerability","query":"","rule_ids":[],"rule_types":["misconfiguration","attack_path"],"severities":["critical"]}},"type":"inbox_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"77f32ef7-0abb-40cd-a36e-51a19999c78a","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1737621650715,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737621650715,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Get_details_of_an_inbox_rule_returns_Inbox_rule_details_response-1737621650","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Thu, 23 Jan 2025 08:40:50 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/77f32ef7-0abb-40cd-a36e-51a19999c78a + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"77f32ef7-0abb-40cd-a36e-51a19999c78a","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1737621650715,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737621650715,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Get_details_of_an_inbox_rule_returns_Inbox_rule_details_response-1737621650","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Thu, 23 Jan 2025 08:40:50 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/77f32ef7-0abb-40cd-a36e-51a19999c78a + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Get-details-of-an-inbox-rule-returns-Not-Found-response.frozen b/cassettes/features/v2/security_monitoring/Get-details-of-an-inbox-rule-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..21366f01877d --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-details-of-an-inbox-rule-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2025-01-23T08:40:51.721Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Get-details-of-an-inbox-rule-returns-Not-Found-response.yml b/cassettes/features/v2/security_monitoring/Get-details-of-an-inbox-rule-returns-Not-Found-response.yml new file mode 100644 index 000000000000..a0daef2c9658 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-details-of-an-inbox-rule-returns-Not-Found-response.yml @@ -0,0 +1,21 @@ +http_interactions: +- recorded_at: Thu, 23 Jan 2025 08:40:51 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/00000000-0000-0000-0000-426655000000 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"Rule does + not exist"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Get-the-ordered-list-of-inbox-rules-returns-The-list-of-inbox-rules-response.frozen b/cassettes/features/v2/security_monitoring/Get-the-ordered-list-of-inbox-rules-returns-The-list-of-inbox-rules-response.frozen new file mode 100644 index 000000000000..1403a6149642 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-the-ordered-list-of-inbox-rules-returns-The-list-of-inbox-rules-response.frozen @@ -0,0 +1 @@ +2025-01-23T08:40:52.068Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Get-the-ordered-list-of-inbox-rules-returns-The-list-of-inbox-rules-response.yml b/cassettes/features/v2/security_monitoring/Get-the-ordered-list-of-inbox-rules-returns-The-list-of-inbox-rules-response.yml new file mode 100644 index 000000000000..34789f5e7551 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-the-ordered-list-of-inbox-rules-returns-The-list-of-inbox-rules-response.yml @@ -0,0 +1,87 @@ +http_interactions: +- recorded_at: Thu, 23 Jan 2025 08:40:52 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"reason_description":"items to focus + on"},"enabled":true,"name":"Test-Get_the_ordered_list_of_inbox_rules_returns_The_list_of_inbox_rules_response-1737621652","rule":{"issue_type":"vulnerability","query":"","rule_ids":[],"rule_types":["misconfiguration","attack_path"],"severities":["critical"]}},"type":"inbox_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"82c9b4a9-d362-46fb-b143-aadc4b89a98d","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1737621652480,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737621652480,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Get_the_ordered_list_of_inbox_rules_returns_The_list_of_inbox_rules_response-1737621652","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Thu, 23 Jan 2025 08:40:52 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"720e23e6-3aa2-4792-9dff-df02f86676ad","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1736869747695,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736869747695,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Delete_an_inbox_rule_returns_Rule_successfully_deleted_response-1736869747","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"307d8a2f-a82d-4272-9d38-6a859251d0a6","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1736936332401,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736936332401,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Update_an_inbox_rule_returns_Bad_Request_response-1736936332","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"9e4361c5-e21b-4e59-90ae-57214151b2b2","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1736936704349,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736936704349,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Patch_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_r-1736936704","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"1ad42562-e1be-4ec2-a510-6923e6d708a4","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1736937094878,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736937094878,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Get_details_of_an_inbox_rule_returns_Inbox_rule_details_response-1736937094","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"2ce28a6e-0975-48cc-9bff-de1a9edd94e2","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1736937364153,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736937364153,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Update_an_inbox_rule_returns_Inbox_rule_successfully_updated_response-1736937363","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"bd638ded-e784-48c9-87bf-a3de72138f44","type":"inbox_rules","attributes":{"action":{"reason_description":"We + want to focus on these items."},"created_at":1736938273788,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736938274279,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Rule + 1","rule":{"issue_type":"vulnerability","rule_types":["application_code_vulnerability"],"rule_ids":["rule-id-1"],"query":"key:val","severities":["critical"]}}},{"id":"6717872d-9ac1-4570-8480-720b0f6f3193","type":"inbox_rules","attributes":{"action":{"reason_description":"We + want to focus on these items."},"created_at":1736938776235,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736938776235,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Rule + 1","rule":{"issue_type":"vulnerability","rule_types":["application_code_vulnerability"],"rule_ids":["rule-id-1"],"query":"key:val","severities":["critical"]}}},{"id":"1b50cdb7-5218-4989-9afc-e0d144d642e2","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1736938883731,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736938883731,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Get_the_ordered_list_of_inbox_rules_returns_The_list_of_inbox_rules_response-1736938883","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"b6ea190b-0317-40ba-a7ad-844e1e89a767","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1736939052699,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736939052699,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Update_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_-1736939052","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"4f18dc53-d185-44d4-846c-561ec59bbf72","type":"inbox_rules","attributes":{"action":{"reason_description":"We + want to focus on these items."},"created_at":1736952258489,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736952258489,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Rule + 1","rule":{"issue_type":"vulnerability","rule_types":["application_code_vulnerability"],"rule_ids":["rule-id-1"],"query":"key:val","severities":["critical"]}}},{"id":"0294b7cd-ecf4-4e30-bf00-542e53e9918b","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1736952539376,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736952539376,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Patch_an_inbox_rule_returns_Inbox_rule_successfully_patched_response-1736952538","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"5e57a84a-a64e-4551-8c70-71e164df56ea","type":"inbox_rules","attributes":{"action":{"reason_description":"We + want to focus on these items."},"created_at":1736952677206,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736952677695,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Rule + 1","rule":{"issue_type":"vulnerability","rule_types":["application_code_vulnerability"],"rule_ids":["rule-id-1"],"query":"key:val","severities":["critical"]}}},{"id":"8db7bc0b-0ff9-4936-8eba-32ff56c42f0d","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1736953111545,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736953111545,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Delete_an_inbox_rule_returns_Rule_successfully_deleted_response-1736953111","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"754ec766-45e1-4617-92f2-2c685640cfa5","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1736953380911,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736953380911,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Patch_an_inbox_rule_returns_Inbox_rule_successfully_patched_response-1736953380","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"5e7dd814-ba12-4536-be51-b29aa3dff555","type":"inbox_rules","attributes":{"action":{"reason_description":"We + want to focus on these items."},"created_at":1736953540702,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736953541190,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Rule + 1","rule":{"issue_type":"vulnerability","rule_types":["application_code_vulnerability"],"rule_ids":["rule-id-1"],"query":"key:val","severities":["critical"]}}},{"id":"9a53ae69-e980-4088-b57c-260f07da4706","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1736953562530,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736953562530,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Update_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_-1736953562","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"b6525132-929b-4c7a-ad7e-c51b66521219","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1736955793842,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736955793842,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Get_the_ordered_list_of_inbox_rules_returns_The_list_of_inbox_rules_response-1736955793","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"f4e5ffe8-b035-4f0e-9fdb-34fc3cbe1d68","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1736956113141,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736956113141,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Patch_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_r-1736956112","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"fdc17395-9f98-4b1f-9643-21642074109c","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1736956188814,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736956188814,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Update_an_inbox_rule_returns_Bad_Request_response-1736956188","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"0d0010f5-0255-46ff-94ac-ae52239d6369","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1736957603847,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736957603847,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Patch_an_inbox_rule_returns_Bad_Request_response-1736957603","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"4079ea57-aa2a-4da6-b7b9-1f186492dc6c","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1736972574272,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736972574272,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Get_the_ordered_list_of_inbox_rules_returns_The_list_of_inbox_rules_response-1736972573","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"82c9b4a9-d362-46fb-b143-aadc4b89a98d","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1737621652480,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737621652480,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Get_the_ordered_list_of_inbox_rules_returns_The_list_of_inbox_rules_response-1737621652","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Thu, 23 Jan 2025 08:40:52 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/82c9b4a9-d362-46fb-b143-aadc4b89a98d + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Get-the-ordered-list-of-mute-rules-returns-The-list-of-mute-rules-response.frozen b/cassettes/features/v2/security_monitoring/Get-the-ordered-list-of-mute-rules-returns-The-list-of-mute-rules-response.frozen new file mode 100644 index 000000000000..617ca30f59aa --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-the-ordered-list-of-mute-rules-returns-The-list-of-mute-rules-response.frozen @@ -0,0 +1 @@ +2025-01-23T13:41:27.633Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Get-the-ordered-list-of-mute-rules-returns-The-list-of-mute-rules-response.yml b/cassettes/features/v2/security_monitoring/Get-the-ordered-list-of-mute-rules-returns-The-list-of-mute-rules-response.yml new file mode 100644 index 000000000000..96a81aa7cb6e --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-the-ordered-list-of-mute-rules-returns-The-list-of-mute-rules-response.yml @@ -0,0 +1,66 @@ +http_interactions: +- recorded_at: Thu, 23 Jan 2025 13:41:27 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"reason":"duplicate"},"enabled":true,"name":"Test-Get_the_ordered_list_of_mute_rules_returns_The_list_of_mute_rules_response-1737639687","rule":{"issue_type":"vulnerability","query":"","rule_ids":[],"rule_types":["misconfiguration","attack_path"],"severities":["critical"]}},"type":"mute_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"7b381b30-fc50-47fb-95a0-0fb56b1f9b58","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1737639688054,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737639688054,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Get_the_ordered_list_of_mute_rules_returns_The_list_of_mute_rules_response-1737639687","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Thu, 23 Jan 2025 13:41:27 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"4601dcaf-d7ee-40ef-9ce5-7eed3a83f69a","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736870838826,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736870838826,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Delete_a_mute_rule_returns_Rule_successfully_deleted_response-1736870838","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"a479725a-8692-42d0-bf9c-0d63ca642345","type":"mute_rules","attributes":{"action":{"reason":"duplicate","reason_description":"Muting + for a while"},"created_at":1736873422906,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736873422906,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Rule + 1","rule":{"issue_type":"vulnerability","rule_types":["application_code_vulnerability"],"rule_ids":["rule-id-1"],"query":"key:val","severities":["critical"]}}},{"id":"48589a8d-1a79-443a-8b05-11209ac9be54","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736931543287,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736931543287,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Patch_a_mute_rule_returns_Mute_rule_successfully_patched_response-1736931542","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"cb8e7dec-f5fa-4d20-b731-21d7685e3084","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736931564718,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736931564718,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Patch_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_res-1736931564","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"714e8c5d-1d83-4646-968d-35586ad7ddc4","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736931593302,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736931593302,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Update_a_mute_rule_returns_Mute_rule_successfully_updated_response-1736931592","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"aec50bc5-e9c0-4101-953e-0f87d5138c10","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736931614635,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736931614635,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Update_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_re-1736931614","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"9e2d8004-e866-47d3-8e47-069051522e60","type":"mute_rules","attributes":{"action":{"reason":"duplicate","reason_description":"Muting + for a while"},"created_at":1736934594769,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736934594769,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Rule + 1","rule":{"issue_type":"vulnerability","rule_types":["application_code_vulnerability"],"rule_ids":["rule-id-1"],"query":"key:val","severities":["critical"]}}},{"id":"1f0eda8c-86a3-4670-889b-4f95d47445e1","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736934778778,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736934778778,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Update_a_mute_rule_returns_Mute_rule_successfully_updated_response-1736934778","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"128ceab0-9c15-4421-be66-f5131b171755","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736934800187,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736934800187,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Update_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_re-1736934799","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"cca4499a-19c3-4642-af33-2051458b9e80","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736935335347,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736935335347,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Get_details_of_a_mute_rule_returns_Mute_rule_details_response-1736935334","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"b77f1a5f-0aeb-4ed7-8451-d9d3f0eef4a0","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736935380165,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736935380165,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Get_the_ordered_list_of_mute_rules_returns_The_list_of_mute_rules_response-1736935379","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"009b952a-5ae5-45ea-bf4c-5b42cd414739","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736935847643,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736935847643,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Patch_a_mute_rule_returns_Bad_Request_response-1736935847","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"82563439-591a-4a2f-9061-eddf0f30cc40","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736936710612,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736936710612,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Update_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_re-1736936710","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"2d2b5a1d-8bb4-440c-a95c-8e4fef7ac478","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736938961065,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736938961065,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Update_a_mute_rule_returns_Mute_rule_successfully_updated_response-1736938960","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"fb6be9d0-fe60-449a-91b2-5a2647ea9b45","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736952343752,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736952343752,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Get_details_of_a_mute_rule_returns_Mute_rule_details_response-1736952343","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"8eaf899d-519f-430e-a03f-bf0001259a78","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736952429326,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736952429326,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Get_the_ordered_list_of_mute_rules_returns_The_list_of_mute_rules_response-1736952428","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"5e08217f-eca0-4502-ac23-3d6490d8cd66","type":"mute_rules","attributes":{"action":{"reason":"duplicate","reason_description":"Muting + for a while","expire_at":1893452400000},"created_at":1736952606711,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736952607199,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Rule + 1","rule":{"issue_type":"vulnerability","rule_types":["application_code_vulnerability"],"rule_ids":["rule-id-1"],"query":"key:val","severities":["critical"]}}},{"id":"11ec6d30-e044-487e-b560-83e17e571001","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736952628631,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736952628631,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Update_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_re-1736952628","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"746e3593-b6ba-4fcd-b100-7d298b4c6454","type":"mute_rules","attributes":{"action":{"reason":"duplicate","reason_description":"Muting + for a while"},"created_at":1736953059610,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736953059610,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Rule + 1","rule":{"issue_type":"vulnerability","rule_types":["application_code_vulnerability"],"rule_ids":["rule-id-1"],"query":"key:val","severities":["critical"]}}},{"id":"2ef91fd4-4e8f-4f47-8745-58cff2874da7","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736953256564,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736953256564,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Patch_a_mute_rule_returns_Bad_Request_response-1736953256","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"dfc987db-7584-4f48-9e80-f5ba91145132","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736953277997,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736953277997,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Patch_a_mute_rule_returns_Mute_rule_successfully_patched_response-1736953277","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"1d1e9077-8c7d-44b4-9a5e-6f3f9e516ff0","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736953429788,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736953429788,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Update_a_mute_rule_returns_Mute_rule_successfully_updated_response-1736953429","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"ab5208f6-88d2-4bd4-9392-a0020b9fec60","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736953491759,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736953491759,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Update_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_re-1736953491","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"3ffd9263-0460-4cd8-95ca-0f1e43624490","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736954925280,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736954925280,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Delete_a_mute_rule_returns_Rule_successfully_deleted_response-1736954924","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"690679b5-99e9-46ed-a11e-ce03915fe063","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736955128456,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736955128456,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Get_the_ordered_list_of_mute_rules_returns_The_list_of_mute_rules_response-1736955128","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"c151d2d4-5917-4d83-bb60-e82eecaf36a1","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736956108775,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736956108775,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Patch_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_res-1736956108","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"c5c3dcfa-b30b-4db6-8fd8-60c96cb94bac","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736963169276,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736963169276,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Update_a_mute_rule_returns_Bad_Request_response-1736963168","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"45d5d101-eb05-4dc2-926b-079900bb7ad6","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1736970911790,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1736970911790,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Typescript-Update_a_mute_rule_returns_Bad_Request_response-1736970911","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}},{"id":"7b381b30-fc50-47fb-95a0-0fb56b1f9b58","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1737639688054,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737639688054,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Get_the_ordered_list_of_mute_rules_returns_The_list_of_mute_rules_response-1737639687","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Thu, 23 Jan 2025 13:41:27 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/7b381b30-fc50-47fb-95a0-0fb56b1f9b58 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Patch-a-mute-rule-returns-Mute-rule-successfully-patched-response.frozen b/cassettes/features/v2/security_monitoring/Patch-a-mute-rule-returns-Mute-rule-successfully-patched-response.frozen new file mode 100644 index 000000000000..61240646a702 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Patch-a-mute-rule-returns-Mute-rule-successfully-patched-response.frozen @@ -0,0 +1 @@ +2025-01-23T13:41:33.878Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Patch-a-mute-rule-returns-Mute-rule-successfully-patched-response.yml b/cassettes/features/v2/security_monitoring/Patch-a-mute-rule-returns-Mute-rule-successfully-patched-response.yml new file mode 100644 index 000000000000..32b78a8b3507 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Patch-a-mute-rule-returns-Mute-rule-successfully-patched-response.yml @@ -0,0 +1,65 @@ +http_interactions: +- recorded_at: Thu, 23 Jan 2025 13:41:33 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"reason":"duplicate"},"enabled":true,"name":"Test-Patch_a_mute_rule_returns_Mute_rule_successfully_patched_response-1737639693","rule":{"issue_type":"vulnerability","query":"","rule_ids":[],"rule_types":["misconfiguration","attack_path"],"severities":["critical"]}},"type":"mute_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"e1af2efd-e6c3-42a7-b0d5-b1250be228f5","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1737639694186,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737639694186,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Patch_a_mute_rule_returns_Mute_rule_successfully_patched_response-1737639693","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Thu, 23 Jan 2025 13:41:33 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"expire_at":1893452400000,"reason":"duplicate","reason_description":"Muting + for a while"},"enabled":true,"name":"Rule 1","rule":{"issue_type":"vulnerability","query":"key:val","rule_ids":["rule-id-1"],"rule_types":["application_code_vulnerability"],"severities":["critical"]}},"id":"e1af2efd-e6c3-42a7-b0d5-b1250be228f5","type":"mute_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/e1af2efd-e6c3-42a7-b0d5-b1250be228f5 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"e1af2efd-e6c3-42a7-b0d5-b1250be228f5","type":"mute_rules","attributes":{"action":{"reason":"duplicate","reason_description":"Muting + for a while","expire_at":1893452400000},"created_at":1737639694186,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737639694642,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Rule + 1","rule":{"issue_type":"vulnerability","rule_types":["application_code_vulnerability"],"rule_ids":["rule-id-1"],"query":"key:val","severities":["critical"]}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Thu, 23 Jan 2025 13:41:33 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/e1af2efd-e6c3-42a7-b0d5-b1250be228f5 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Patch-a-mute-rule-returns-Not-Found-response.frozen b/cassettes/features/v2/security_monitoring/Patch-a-mute-rule-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..11a478123e53 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Patch-a-mute-rule-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2025-01-23T13:41:35.168Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Patch-a-mute-rule-returns-Not-Found-response.yml b/cassettes/features/v2/security_monitoring/Patch-a-mute-rule-returns-Not-Found-response.yml new file mode 100644 index 000000000000..373e9069aa54 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Patch-a-mute-rule-returns-Not-Found-response.yml @@ -0,0 +1,26 @@ +http_interactions: +- recorded_at: Thu, 23 Jan 2025 13:41:35 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"expire_at":1893452400000,"reason":"duplicate","reason_description":"Muting + for a while"},"enabled":true,"name":"Rule 1","rule":{"issue_type":"vulnerability","query":"key:val","rule_ids":["rule-id-1"],"rule_types":["application_code_vulnerability"],"severities":["critical"]}},"id":"00000000-0000-0000-0000-426655000000","type":"mute_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/00000000-0000-0000-0000-426655000000 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"Rule does + not exist"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Patch-a-mute-rule-returns-The-server-cannot-process-the-request-because-it-contains-invalid-data-response.frozen b/cassettes/features/v2/security_monitoring/Patch-a-mute-rule-returns-The-server-cannot-process-the-request-because-it-contains-invalid-data-response.frozen new file mode 100644 index 000000000000..e7595f2f4a29 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Patch-a-mute-rule-returns-The-server-cannot-process-the-request-because-it-contains-invalid-data-response.frozen @@ -0,0 +1 @@ +2025-01-23T13:41:35.525Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Patch-a-mute-rule-returns-The-server-cannot-process-the-request-because-it-contains-invalid-data-response.yml b/cassettes/features/v2/security_monitoring/Patch-a-mute-rule-returns-The-server-cannot-process-the-request-because-it-contains-invalid-data-response.yml new file mode 100644 index 000000000000..df1af9c5cb05 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Patch-a-mute-rule-returns-The-server-cannot-process-the-request-because-it-contains-invalid-data-response.yml @@ -0,0 +1,64 @@ +http_interactions: +- recorded_at: Thu, 23 Jan 2025 13:41:35 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"reason":"duplicate"},"enabled":true,"name":"Test-Patch_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_res-1737639695","rule":{"issue_type":"vulnerability","query":"","rule_ids":[],"rule_types":["misconfiguration","attack_path"],"severities":["critical"]}},"type":"mute_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"887dda05-1701-4530-b21e-0608692270bb","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1737639695933,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737639695933,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Patch_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_res-1737639695","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Thu, 23 Jan 2025 13:41:35 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"expire_at":1893452400000,"reason":"duplicate","reason_description":"Muting + for a while"},"enabled":true,"name":"Rule 1","rule":{"issue_type":"vulnerability","query":"key:val","rule_ids":["rule-id-1"],"rule_types":["application_code_vulnerability"],"severities":["critical"]}},"id":"00000000-0000-0000-0000-426655000000","type":"mute_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/887dda05-1701-4530-b21e-0608692270bb + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"422","title":"Unprocessable Entity","detail":"Rule + Ids in path and in request body differ"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 422 + message: Unprocessable Entity +- recorded_at: Thu, 23 Jan 2025 13:41:35 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/887dda05-1701-4530-b21e-0608692270bb + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Patch-an-inbox-rule-returns-Bad-Request-response.frozen b/cassettes/features/v2/security_monitoring/Patch-an-inbox-rule-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..cf45b6d83fe1 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Patch-an-inbox-rule-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-01-23T08:41:03.189Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Patch-an-inbox-rule-returns-Bad-Request-response.yml b/cassettes/features/v2/security_monitoring/Patch-an-inbox-rule-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..95ba526c61b2 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Patch-an-inbox-rule-returns-Bad-Request-response.yml @@ -0,0 +1,66 @@ +http_interactions: +- recorded_at: Thu, 23 Jan 2025 08:41:03 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"reason_description":"items to focus + on"},"enabled":true,"name":"Test-Patch_an_inbox_rule_returns_Bad_Request_response-1737621663","rule":{"issue_type":"vulnerability","query":"","rule_ids":[],"rule_types":["misconfiguration","attack_path"],"severities":["critical"]}},"type":"inbox_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"b9b74321-b7e6-4b06-b0cf-c3670962467b","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1737621663602,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737621663602,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Patch_an_inbox_rule_returns_Bad_Request_response-1737621663","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Thu, 23 Jan 2025 08:41:03 GMT + request: + body: + encoding: UTF-8 + string: '{"invalid":{"attributes":{"action":{"reason_description":"We want to + focus on these items."},"enabled":true,"name":"Rule 1","rule":{"issue_type":"vulnerability","query":"key:val","rule_ids":["rule-id-1"],"rule_types":["application_code_vulnerability"],"severities":["critical"]}},"id":"b9b74321-b7e6-4b06-b0cf-c3670962467b","type":"inbox_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/b9b74321-b7e6-4b06-b0cf-c3670962467b + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"Error while + unmarshalling JSON API request"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +- recorded_at: Thu, 23 Jan 2025 08:41:03 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/b9b74321-b7e6-4b06-b0cf-c3670962467b + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Patch-an-inbox-rule-returns-Inbox-rule-successfully-patched-response.frozen b/cassettes/features/v2/security_monitoring/Patch-an-inbox-rule-returns-Inbox-rule-successfully-patched-response.frozen new file mode 100644 index 000000000000..7c42250c7925 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Patch-an-inbox-rule-returns-Inbox-rule-successfully-patched-response.frozen @@ -0,0 +1 @@ +2025-01-23T08:41:04.479Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Patch-an-inbox-rule-returns-Inbox-rule-successfully-patched-response.yml b/cassettes/features/v2/security_monitoring/Patch-an-inbox-rule-returns-Inbox-rule-successfully-patched-response.yml new file mode 100644 index 000000000000..f48ea9c50877 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Patch-an-inbox-rule-returns-Inbox-rule-successfully-patched-response.yml @@ -0,0 +1,67 @@ +http_interactions: +- recorded_at: Thu, 23 Jan 2025 08:41:04 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"reason_description":"items to focus + on"},"enabled":true,"name":"Test-Patch_an_inbox_rule_returns_Inbox_rule_successfully_patched_response-1737621664","rule":{"issue_type":"vulnerability","query":"","rule_ids":[],"rule_types":["misconfiguration","attack_path"],"severities":["critical"]}},"type":"inbox_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"1a524ec9-504d-4aa0-9c81-52a994cfe8c1","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1737621664886,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737621664886,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Patch_an_inbox_rule_returns_Inbox_rule_successfully_patched_response-1737621664","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Thu, 23 Jan 2025 08:41:04 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"reason_description":"We want to focus + on these items."},"enabled":true,"name":"Rule 1","rule":{"issue_type":"vulnerability","query":"key:val","rule_ids":["rule-id-1"],"rule_types":["application_code_vulnerability"],"severities":["critical"]}},"id":"1a524ec9-504d-4aa0-9c81-52a994cfe8c1","type":"inbox_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/1a524ec9-504d-4aa0-9c81-52a994cfe8c1 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"1a524ec9-504d-4aa0-9c81-52a994cfe8c1","type":"inbox_rules","attributes":{"action":{"reason_description":"We + want to focus on these items."},"created_at":1737621664886,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737621665366,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Rule + 1","rule":{"issue_type":"vulnerability","rule_types":["application_code_vulnerability"],"rule_ids":["rule-id-1"],"query":"key:val","severities":["critical"]}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Thu, 23 Jan 2025 08:41:04 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/1a524ec9-504d-4aa0-9c81-52a994cfe8c1 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Patch-an-inbox-rule-returns-Not-Found-response.frozen b/cassettes/features/v2/security_monitoring/Patch-an-inbox-rule-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..ee50e94ff1c6 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Patch-an-inbox-rule-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2025-01-23T08:41:05.792Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Patch-an-inbox-rule-returns-Not-Found-response.yml b/cassettes/features/v2/security_monitoring/Patch-an-inbox-rule-returns-Not-Found-response.yml new file mode 100644 index 000000000000..1161c29c034f --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Patch-an-inbox-rule-returns-Not-Found-response.yml @@ -0,0 +1,26 @@ +http_interactions: +- recorded_at: Thu, 23 Jan 2025 08:41:05 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"reason_description":"We want to focus + on these items."},"enabled":true,"name":"Rule 1","rule":{"issue_type":"vulnerability","query":"key:val","rule_ids":["rule-id-1"],"rule_types":["application_code_vulnerability"],"severities":["critical"]}},"id":"00000000-0000-0000-0000-426655000000","type":"inbox_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/00000000-0000-0000-0000-426655000000 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"Rule does + not exist"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Patch-an-inbox-rule-returns-The-server-cannot-process-the-request-because-it-contains-invalid-data-response.frozen b/cassettes/features/v2/security_monitoring/Patch-an-inbox-rule-returns-The-server-cannot-process-the-request-because-it-contains-invalid-data-response.frozen new file mode 100644 index 000000000000..f11dc3ee0e34 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Patch-an-inbox-rule-returns-The-server-cannot-process-the-request-because-it-contains-invalid-data-response.frozen @@ -0,0 +1 @@ +2025-01-23T08:41:06.264Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Patch-an-inbox-rule-returns-The-server-cannot-process-the-request-because-it-contains-invalid-data-response.yml b/cassettes/features/v2/security_monitoring/Patch-an-inbox-rule-returns-The-server-cannot-process-the-request-because-it-contains-invalid-data-response.yml new file mode 100644 index 000000000000..26a43cf2b4bc --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Patch-an-inbox-rule-returns-The-server-cannot-process-the-request-because-it-contains-invalid-data-response.yml @@ -0,0 +1,66 @@ +http_interactions: +- recorded_at: Thu, 23 Jan 2025 08:41:06 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"reason_description":"items to focus + on"},"enabled":true,"name":"Test-Patch_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_r-1737621666","rule":{"issue_type":"vulnerability","query":"","rule_ids":[],"rule_types":["misconfiguration","attack_path"],"severities":["critical"]}},"type":"inbox_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"1068be59-ede3-4937-a632-e99800fae69d","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1737621666672,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737621666672,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Patch_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_r-1737621666","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Thu, 23 Jan 2025 08:41:06 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"reason_description":"We want to focus + on these items."},"enabled":true,"name":"Rule 1","rule":{"issue_type":"vulnerability","query":"key:val","rule_ids":["rule-id-1"],"rule_types":["application_code_vulnerability"],"severities":["critical"]}},"id":"00000000-0000-0000-0000-426655000000","type":"inbox_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/1068be59-ede3-4937-a632-e99800fae69d + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"422","title":"Unprocessable Entity","detail":"Rule + Ids in path and in request body differ"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 422 + message: Unprocessable Entity +- recorded_at: Thu, 23 Jan 2025 08:41:06 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/1068be59-ede3-4937-a632-e99800fae69d + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Update-a-mute-rule-returns-Bad-Request-response.frozen b/cassettes/features/v2/security_monitoring/Update-a-mute-rule-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..a27df8153f52 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Update-a-mute-rule-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-01-23T13:41:44.191Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Update-a-mute-rule-returns-Bad-Request-response.yml b/cassettes/features/v2/security_monitoring/Update-a-mute-rule-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..447726f1c042 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Update-a-mute-rule-returns-Bad-Request-response.yml @@ -0,0 +1,64 @@ +http_interactions: +- recorded_at: Thu, 23 Jan 2025 13:41:44 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"reason":"duplicate"},"enabled":true,"name":"Test-Update_a_mute_rule_returns_Bad_Request_response-1737639704","rule":{"issue_type":"vulnerability","query":"","rule_ids":[],"rule_types":["misconfiguration","attack_path"],"severities":["critical"]}},"type":"mute_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"d54c43cb-1ff0-4f60-a3cc-2794815252a8","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1737639704499,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737639704499,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Update_a_mute_rule_returns_Bad_Request_response-1737639704","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Thu, 23 Jan 2025 13:41:44 GMT + request: + body: + encoding: UTF-8 + string: '{"invalid":{"attributes":{"action":{"expire_at":1893452400000,"reason":"duplicate","reason_description":"Muting + for a while"},"enabled":true,"name":"Rule 1","rule":{"issue_type":"vulnerability","query":"key:val","rule_ids":["rule-id-1"],"rule_types":["application_code_vulnerability"],"severities":["critical"]}},"id":"d54c43cb-1ff0-4f60-a3cc-2794815252a8","type":"mute_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/d54c43cb-1ff0-4f60-a3cc-2794815252a8 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"Error while + unmarshalling JSON API request"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +- recorded_at: Thu, 23 Jan 2025 13:41:44 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/d54c43cb-1ff0-4f60-a3cc-2794815252a8 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Update-a-mute-rule-returns-Mute-rule-successfully-updated-response.frozen b/cassettes/features/v2/security_monitoring/Update-a-mute-rule-returns-Mute-rule-successfully-updated-response.frozen new file mode 100644 index 000000000000..83b8f33ec650 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Update-a-mute-rule-returns-Mute-rule-successfully-updated-response.frozen @@ -0,0 +1 @@ +2025-01-23T13:41:45.445Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Update-a-mute-rule-returns-Mute-rule-successfully-updated-response.yml b/cassettes/features/v2/security_monitoring/Update-a-mute-rule-returns-Mute-rule-successfully-updated-response.yml new file mode 100644 index 000000000000..5b83fd1beaeb --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Update-a-mute-rule-returns-Mute-rule-successfully-updated-response.yml @@ -0,0 +1,65 @@ +http_interactions: +- recorded_at: Thu, 23 Jan 2025 13:41:45 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"reason":"duplicate"},"enabled":true,"name":"Test-Update_a_mute_rule_returns_Mute_rule_successfully_updated_response-1737639705","rule":{"issue_type":"vulnerability","query":"","rule_ids":[],"rule_types":["misconfiguration","attack_path"],"severities":["critical"]}},"type":"mute_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"fa5829ab-aee5-458e-abc7-86b8f0a4687f","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1737639705754,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737639705754,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Update_a_mute_rule_returns_Mute_rule_successfully_updated_response-1737639705","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Thu, 23 Jan 2025 13:41:45 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"expire_at":1893452400000,"reason":"duplicate","reason_description":"Muting + for a while"},"enabled":true,"name":"Rule 1","rule":{"issue_type":"vulnerability","query":"key:val","rule_ids":["rule-id-1"],"rule_types":["application_code_vulnerability"],"severities":["critical"]}},"id":"fa5829ab-aee5-458e-abc7-86b8f0a4687f","type":"mute_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/fa5829ab-aee5-458e-abc7-86b8f0a4687f + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"fa5829ab-aee5-458e-abc7-86b8f0a4687f","type":"mute_rules","attributes":{"action":{"reason":"duplicate","reason_description":"Muting + for a while","expire_at":1893452400000},"created_at":1737639705754,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737639706208,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Rule + 1","rule":{"issue_type":"vulnerability","rule_types":["application_code_vulnerability"],"rule_ids":["rule-id-1"],"query":"key:val","severities":["critical"]}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Thu, 23 Jan 2025 13:41:45 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/fa5829ab-aee5-458e-abc7-86b8f0a4687f + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Update-a-mute-rule-returns-Not-Found-response.frozen b/cassettes/features/v2/security_monitoring/Update-a-mute-rule-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..76217e7065c0 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Update-a-mute-rule-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2025-01-23T13:41:46.701Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Update-a-mute-rule-returns-Not-Found-response.yml b/cassettes/features/v2/security_monitoring/Update-a-mute-rule-returns-Not-Found-response.yml new file mode 100644 index 000000000000..e84daa66a82c --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Update-a-mute-rule-returns-Not-Found-response.yml @@ -0,0 +1,26 @@ +http_interactions: +- recorded_at: Thu, 23 Jan 2025 13:41:46 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"expire_at":1893452400000,"reason":"duplicate","reason_description":"Muting + for a while"},"enabled":true,"name":"Rule 1","rule":{"issue_type":"vulnerability","query":"key:val","rule_ids":["rule-id-1"],"rule_types":["application_code_vulnerability"],"severities":["critical"]}},"id":"00000000-0000-0000-0000-426655000000","type":"mute_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/00000000-0000-0000-0000-426655000000 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"Rule does + not exist"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Update-a-mute-rule-returns-The-server-cannot-process-the-request-because-it-contains-invalid-data-response.frozen b/cassettes/features/v2/security_monitoring/Update-a-mute-rule-returns-The-server-cannot-process-the-request-because-it-contains-invalid-data-response.frozen new file mode 100644 index 000000000000..3e138c549d6d --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Update-a-mute-rule-returns-The-server-cannot-process-the-request-because-it-contains-invalid-data-response.frozen @@ -0,0 +1 @@ +2025-01-23T13:41:47.047Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Update-a-mute-rule-returns-The-server-cannot-process-the-request-because-it-contains-invalid-data-response.yml b/cassettes/features/v2/security_monitoring/Update-a-mute-rule-returns-The-server-cannot-process-the-request-because-it-contains-invalid-data-response.yml new file mode 100644 index 000000000000..909c4298a77d --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Update-a-mute-rule-returns-The-server-cannot-process-the-request-because-it-contains-invalid-data-response.yml @@ -0,0 +1,64 @@ +http_interactions: +- recorded_at: Thu, 23 Jan 2025 13:41:47 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"reason":"duplicate"},"enabled":true,"name":"Test-Update_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_re-1737639707","rule":{"issue_type":"vulnerability","query":"","rule_ids":[],"rule_types":["misconfiguration","attack_path"],"severities":["critical"]}},"type":"mute_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"0582999c-857d-4be3-8aeb-5f70920f04fe","type":"mute_rules","attributes":{"action":{"reason":"duplicate"},"created_at":1737639707463,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737639707463,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Update_a_mute_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_re-1737639707","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Thu, 23 Jan 2025 13:41:47 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"expire_at":1893452400000,"reason":"duplicate","reason_description":"Muting + for a while"},"enabled":true,"name":"Rule 1","rule":{"issue_type":"vulnerability","query":"key:val","rule_ids":["rule-id-1"],"rule_types":["application_code_vulnerability"],"severities":["critical"]}},"id":"00000000-0000-0000-0000-426655000000","type":"mute_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/0582999c-857d-4be3-8aeb-5f70920f04fe + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"422","title":"Unprocessable Entity","detail":"Rule + Ids in path and in request body differ"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 422 + message: Unprocessable Entity +- recorded_at: Thu, 23 Jan 2025 13:41:47 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/mute_rules/0582999c-857d-4be3-8aeb-5f70920f04fe + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Update-an-inbox-rule-returns-Bad-Request-response.frozen b/cassettes/features/v2/security_monitoring/Update-an-inbox-rule-returns-Bad-Request-response.frozen new file mode 100644 index 000000000000..322931425060 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Update-an-inbox-rule-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-01-23T08:41:21.299Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Update-an-inbox-rule-returns-Bad-Request-response.yml b/cassettes/features/v2/security_monitoring/Update-an-inbox-rule-returns-Bad-Request-response.yml new file mode 100644 index 000000000000..6b1d3014c828 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Update-an-inbox-rule-returns-Bad-Request-response.yml @@ -0,0 +1,66 @@ +http_interactions: +- recorded_at: Thu, 23 Jan 2025 08:41:21 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"reason_description":"items to focus + on"},"enabled":true,"name":"Test-Update_an_inbox_rule_returns_Bad_Request_response-1737621681","rule":{"issue_type":"vulnerability","query":"","rule_ids":[],"rule_types":["misconfiguration","attack_path"],"severities":["critical"]}},"type":"inbox_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"ebe5f9b6-a0fe-4422-9909-2116aa9cb057","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1737621681706,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737621681706,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Update_an_inbox_rule_returns_Bad_Request_response-1737621681","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Thu, 23 Jan 2025 08:41:21 GMT + request: + body: + encoding: UTF-8 + string: '{"invalid":{"attributes":{"action":{"reason_description":"We want to + focus on these items."},"enabled":true,"name":"Rule 1","rule":{"issue_type":"vulnerability","query":"key:val","rule_ids":["rule-id-1"],"rule_types":["application_code_vulnerability"],"severities":["critical"]}},"id":"ebe5f9b6-a0fe-4422-9909-2116aa9cb057","type":"inbox_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/ebe5f9b6-a0fe-4422-9909-2116aa9cb057 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"400","title":"Bad Request","detail":"Error while + unmarshalling JSON API request"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +- recorded_at: Thu, 23 Jan 2025 08:41:21 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/ebe5f9b6-a0fe-4422-9909-2116aa9cb057 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Update-an-inbox-rule-returns-Inbox-rule-successfully-updated-response.frozen b/cassettes/features/v2/security_monitoring/Update-an-inbox-rule-returns-Inbox-rule-successfully-updated-response.frozen new file mode 100644 index 000000000000..564f1128075a --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Update-an-inbox-rule-returns-Inbox-rule-successfully-updated-response.frozen @@ -0,0 +1 @@ +2025-01-23T08:41:22.606Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Update-an-inbox-rule-returns-Inbox-rule-successfully-updated-response.yml b/cassettes/features/v2/security_monitoring/Update-an-inbox-rule-returns-Inbox-rule-successfully-updated-response.yml new file mode 100644 index 000000000000..e22277ea6b02 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Update-an-inbox-rule-returns-Inbox-rule-successfully-updated-response.yml @@ -0,0 +1,67 @@ +http_interactions: +- recorded_at: Thu, 23 Jan 2025 08:41:22 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"reason_description":"items to focus + on"},"enabled":true,"name":"Test-Update_an_inbox_rule_returns_Inbox_rule_successfully_updated_response-1737621682","rule":{"issue_type":"vulnerability","query":"","rule_ids":[],"rule_types":["misconfiguration","attack_path"],"severities":["critical"]}},"type":"inbox_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"1cc830c9-b1ea-4a80-bc54-db42bb0ac198","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1737621683029,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737621683029,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Update_an_inbox_rule_returns_Inbox_rule_successfully_updated_response-1737621682","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Thu, 23 Jan 2025 08:41:22 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"reason_description":"We want to focus + on these items."},"enabled":true,"name":"Rule 1","rule":{"issue_type":"vulnerability","query":"key:val","rule_ids":["rule-id-1"],"rule_types":["application_code_vulnerability"],"severities":["critical"]}},"id":"1cc830c9-b1ea-4a80-bc54-db42bb0ac198","type":"inbox_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/1cc830c9-b1ea-4a80-bc54-db42bb0ac198 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"1cc830c9-b1ea-4a80-bc54-db42bb0ac198","type":"inbox_rules","attributes":{"action":{"reason_description":"We + want to focus on these items."},"created_at":1737621683029,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737621683396,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Rule + 1","rule":{"issue_type":"vulnerability","rule_types":["application_code_vulnerability"],"rule_ids":["rule-id-1"],"query":"key:val","severities":["critical"]}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Thu, 23 Jan 2025 08:41:22 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/1cc830c9-b1ea-4a80-bc54-db42bb0ac198 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Update-an-inbox-rule-returns-Not-Found-response.frozen b/cassettes/features/v2/security_monitoring/Update-an-inbox-rule-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..9f7cf1e21638 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Update-an-inbox-rule-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2025-01-23T08:41:23.940Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Update-an-inbox-rule-returns-Not-Found-response.yml b/cassettes/features/v2/security_monitoring/Update-an-inbox-rule-returns-Not-Found-response.yml new file mode 100644 index 000000000000..a95b42868d7e --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Update-an-inbox-rule-returns-Not-Found-response.yml @@ -0,0 +1,26 @@ +http_interactions: +- recorded_at: Thu, 23 Jan 2025 08:41:23 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"reason_description":"We want to focus + on these items."},"enabled":true,"name":"Rule 1","rule":{"issue_type":"vulnerability","query":"key:val","rule_ids":["rule-id-1"],"rule_types":["application_code_vulnerability"],"severities":["critical"]}},"id":"00000000-0000-0000-0000-426655000000","type":"inbox_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/00000000-0000-0000-0000-426655000000 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"Rule does + not exist"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Update-an-inbox-rule-returns-The-server-cannot-process-the-request-because-it-contains-invalid-data-response.frozen b/cassettes/features/v2/security_monitoring/Update-an-inbox-rule-returns-The-server-cannot-process-the-request-because-it-contains-invalid-data-response.frozen new file mode 100644 index 000000000000..09f4343019c8 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Update-an-inbox-rule-returns-The-server-cannot-process-the-request-because-it-contains-invalid-data-response.frozen @@ -0,0 +1 @@ +2025-01-23T08:41:24.430Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Update-an-inbox-rule-returns-The-server-cannot-process-the-request-because-it-contains-invalid-data-response.yml b/cassettes/features/v2/security_monitoring/Update-an-inbox-rule-returns-The-server-cannot-process-the-request-because-it-contains-invalid-data-response.yml new file mode 100644 index 000000000000..d008c694d3a6 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Update-an-inbox-rule-returns-The-server-cannot-process-the-request-because-it-contains-invalid-data-response.yml @@ -0,0 +1,66 @@ +http_interactions: +- recorded_at: Thu, 23 Jan 2025 08:41:24 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"reason_description":"items to focus + on"},"enabled":true,"name":"Test-Update_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_-1737621684","rule":{"issue_type":"vulnerability","query":"","rule_ids":[],"rule_types":["misconfiguration","attack_path"],"severities":["critical"]}},"type":"inbox_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"a7b01380-2a2f-4664-8ac4-912d14791749","type":"inbox_rules","attributes":{"action":{"reason_description":"items + to focus on"},"created_at":1737621684732,"created_by":{"name":"frog","handle":"frog@datadoghq.com"},"enabled":true,"modified_at":1737621684732,"modified_by":{"name":"frog","handle":"frog@datadoghq.com"},"name":"Test-Update_an_inbox_rule_returns_The_server_cannot_process_the_request_because_it_contains_invalid_data_-1737621684","rule":{"issue_type":"vulnerability","rule_types":["misconfiguration","attack_path"],"rule_ids":[],"query":"","severities":["critical"]}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Thu, 23 Jan 2025 08:41:24 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"reason_description":"We want to focus + on these items."},"enabled":true,"name":"Rule 1","rule":{"issue_type":"vulnerability","query":"key:val","rule_ids":["rule-id-1"],"rule_types":["application_code_vulnerability"],"severities":["critical"]}},"id":"00000000-0000-0000-0000-426655000000","type":"inbox_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/a7b01380-2a2f-4664-8ac4-912d14791749 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"422","title":"Unprocessable Entity","detail":"Rule + Ids in path and in request body differ"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 422 + message: Unprocessable Entity +- recorded_at: Thu, 23 Jan 2025 08:41:24 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/vulnerabilities/pipelines/inbox_rules/a7b01380-2a2f-4664-8ac4-912d14791749 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/examples/v2/security-monitoring/CreateInboxRule.rb b/examples/v2/security-monitoring/CreateInboxRule.rb new file mode 100644 index 000000000000..0d826c928ffe --- /dev/null +++ b/examples/v2/security-monitoring/CreateInboxRule.rb @@ -0,0 +1,31 @@ +# Create a new inbox rule returns "Successfully created the inbox rule" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::CreateInboxRuleParameters.new({ + data: DatadogAPIClient::V2::CreateInboxRuleParametersData.new({ + attributes: DatadogAPIClient::V2::CreateInboxRuleParametersDataAttributes.new({ + action: DatadogAPIClient::V2::ActionInbox.new({ + reason_description: "We want to focus on these items.", + }), + enabled: true, + name: "Rule 1", + rule: DatadogAPIClient::V2::Rule.new({ + issue_type: DatadogAPIClient::V2::IssueType::VULNERABILITY, + query: "key:val", + rule_ids: [ + "rule-id-1", + ], + rule_types: [ + DatadogAPIClient::V2::RuleTypesItems::APPLICATION_CODE_VULNERABILITY, + ], + severities: [ + DatadogAPIClient::V2::RuleSeverity::CRITICAL, + ], + }), + }), + type: DatadogAPIClient::V2::InboxRulesType::INBOX_RULES, + }), +}) +p api_instance.create_inbox_rule(body) diff --git a/examples/v2/security-monitoring/CreateMuteRule.rb b/examples/v2/security-monitoring/CreateMuteRule.rb new file mode 100644 index 000000000000..a6933cd9b1c9 --- /dev/null +++ b/examples/v2/security-monitoring/CreateMuteRule.rb @@ -0,0 +1,33 @@ +# Create a new mute rule returns "Successfully created the mute rule" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::CreateMuteRuleParameters.new({ + data: DatadogAPIClient::V2::CreateMuteRuleParametersData.new({ + attributes: DatadogAPIClient::V2::CreateMuteRuleParametersDataAttributes.new({ + action: DatadogAPIClient::V2::ActionMute.new({ + expire_at: 1893452400000, + reason: DatadogAPIClient::V2::MuteReason::DUPLICATE, + reason_description: "Muting for a while", + }), + enabled: true, + name: "Rule 1", + rule: DatadogAPIClient::V2::Rule.new({ + issue_type: DatadogAPIClient::V2::IssueType::VULNERABILITY, + query: "key:val", + rule_ids: [ + "rule-id-1", + ], + rule_types: [ + DatadogAPIClient::V2::RuleTypesItems::APPLICATION_CODE_VULNERABILITY, + ], + severities: [ + DatadogAPIClient::V2::RuleSeverity::CRITICAL, + ], + }), + }), + type: DatadogAPIClient::V2::MuteRulesType::MUTE_RULES, + }), +}) +p api_instance.create_mute_rule(body) diff --git a/examples/v2/security-monitoring/DeleteInboxRule.rb b/examples/v2/security-monitoring/DeleteInboxRule.rb new file mode 100644 index 000000000000..ed24f7c4c30b --- /dev/null +++ b/examples/v2/security-monitoring/DeleteInboxRule.rb @@ -0,0 +1,8 @@ +# Delete an inbox rule returns "Rule successfully deleted" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +# there is a valid "valid_inbox_rule" in the system +VALID_INBOX_RULE_DATA_ID = ENV["VALID_INBOX_RULE_DATA_ID"] +api_instance.delete_inbox_rule(VALID_INBOX_RULE_DATA_ID) diff --git a/examples/v2/security-monitoring/DeleteMuteRule.rb b/examples/v2/security-monitoring/DeleteMuteRule.rb new file mode 100644 index 000000000000..8015c4954634 --- /dev/null +++ b/examples/v2/security-monitoring/DeleteMuteRule.rb @@ -0,0 +1,8 @@ +# Delete a mute rule returns "Rule successfully deleted" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +# there is a valid "valid_mute_rule" in the system +VALID_MUTE_RULE_DATA_ID = ENV["VALID_MUTE_RULE_DATA_ID"] +api_instance.delete_mute_rule(VALID_MUTE_RULE_DATA_ID) diff --git a/examples/v2/security-monitoring/GetInboxRule.rb b/examples/v2/security-monitoring/GetInboxRule.rb new file mode 100644 index 000000000000..2598605c96eb --- /dev/null +++ b/examples/v2/security-monitoring/GetInboxRule.rb @@ -0,0 +1,8 @@ +# Get details of an inbox rule returns "Inbox rule details" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +# there is a valid "valid_inbox_rule" in the system +VALID_INBOX_RULE_DATA_ID = ENV["VALID_INBOX_RULE_DATA_ID"] +p api_instance.get_inbox_rule(VALID_INBOX_RULE_DATA_ID) diff --git a/examples/v2/security-monitoring/GetInboxRules.rb b/examples/v2/security-monitoring/GetInboxRules.rb new file mode 100644 index 000000000000..36c2c3da6c36 --- /dev/null +++ b/examples/v2/security-monitoring/GetInboxRules.rb @@ -0,0 +1,5 @@ +# Get the ordered list of inbox rules returns "The list of inbox rules" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new +p api_instance.get_inbox_rules() diff --git a/examples/v2/security-monitoring/GetMuteRule.rb b/examples/v2/security-monitoring/GetMuteRule.rb new file mode 100644 index 000000000000..ac5eefad2aca --- /dev/null +++ b/examples/v2/security-monitoring/GetMuteRule.rb @@ -0,0 +1,8 @@ +# Get details of a mute rule returns "Mute rule details" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +# there is a valid "valid_mute_rule" in the system +VALID_MUTE_RULE_DATA_ID = ENV["VALID_MUTE_RULE_DATA_ID"] +p api_instance.get_mute_rule(VALID_MUTE_RULE_DATA_ID) diff --git a/examples/v2/security-monitoring/GetMuteRules.rb b/examples/v2/security-monitoring/GetMuteRules.rb new file mode 100644 index 000000000000..508a3953c4dd --- /dev/null +++ b/examples/v2/security-monitoring/GetMuteRules.rb @@ -0,0 +1,5 @@ +# Get the ordered list of mute rules returns "The list of mute rules" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new +p api_instance.get_mute_rules() diff --git a/examples/v2/security-monitoring/PatchInboxRule.rb b/examples/v2/security-monitoring/PatchInboxRule.rb new file mode 100644 index 000000000000..78f78185357e --- /dev/null +++ b/examples/v2/security-monitoring/PatchInboxRule.rb @@ -0,0 +1,35 @@ +# Patch an inbox rule returns "Inbox rule successfully patched" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +# there is a valid "valid_inbox_rule" in the system +VALID_INBOX_RULE_DATA_ID = ENV["VALID_INBOX_RULE_DATA_ID"] + +body = DatadogAPIClient::V2::PatchInboxRulesParameters.new({ + data: DatadogAPIClient::V2::PatchInboxRulesParametersData.new({ + attributes: DatadogAPIClient::V2::PatchInboxRulesParametersDataAttributes.new({ + action: DatadogAPIClient::V2::ActionInbox.new({ + reason_description: "We want to focus on these items.", + }), + enabled: true, + name: "Rule 1", + rule: DatadogAPIClient::V2::Rule.new({ + issue_type: DatadogAPIClient::V2::IssueType::VULNERABILITY, + query: "key:val", + rule_ids: [ + "rule-id-1", + ], + rule_types: [ + DatadogAPIClient::V2::RuleTypesItems::APPLICATION_CODE_VULNERABILITY, + ], + severities: [ + DatadogAPIClient::V2::RuleSeverity::CRITICAL, + ], + }), + }), + id: VALID_INBOX_RULE_DATA_ID, + type: DatadogAPIClient::V2::InboxRulesType::INBOX_RULES, + }), +}) +p api_instance.patch_inbox_rule(VALID_INBOX_RULE_DATA_ID, body) diff --git a/examples/v2/security-monitoring/PatchMuteRule.rb b/examples/v2/security-monitoring/PatchMuteRule.rb new file mode 100644 index 000000000000..a02c420e5078 --- /dev/null +++ b/examples/v2/security-monitoring/PatchMuteRule.rb @@ -0,0 +1,37 @@ +# Patch a mute rule returns "Mute rule successfully patched" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +# there is a valid "valid_mute_rule" in the system +VALID_MUTE_RULE_DATA_ID = ENV["VALID_MUTE_RULE_DATA_ID"] + +body = DatadogAPIClient::V2::PatchMuteRuleParameters.new({ + data: DatadogAPIClient::V2::PatchMuteRuleParametersData.new({ + attributes: DatadogAPIClient::V2::PatchMuteRuleParametersDataAttributes.new({ + action: DatadogAPIClient::V2::ActionMute.new({ + expire_at: 1893452400000, + reason: DatadogAPIClient::V2::MuteReason::DUPLICATE, + reason_description: "Muting for a while", + }), + enabled: true, + name: "Rule 1", + rule: DatadogAPIClient::V2::Rule.new({ + issue_type: DatadogAPIClient::V2::IssueType::VULNERABILITY, + query: "key:val", + rule_ids: [ + "rule-id-1", + ], + rule_types: [ + DatadogAPIClient::V2::RuleTypesItems::APPLICATION_CODE_VULNERABILITY, + ], + severities: [ + DatadogAPIClient::V2::RuleSeverity::CRITICAL, + ], + }), + }), + id: VALID_MUTE_RULE_DATA_ID, + type: DatadogAPIClient::V2::MuteRulesType::MUTE_RULES, + }), +}) +p api_instance.patch_mute_rule(VALID_MUTE_RULE_DATA_ID, body) diff --git a/examples/v2/security-monitoring/ReorderInboxRules.rb b/examples/v2/security-monitoring/ReorderInboxRules.rb new file mode 100644 index 000000000000..c3f29ff1ff29 --- /dev/null +++ b/examples/v2/security-monitoring/ReorderInboxRules.rb @@ -0,0 +1,14 @@ +# Reorder the list of inbox rules in the pipeline returns "The list of inbox rules" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::ReorderInboxRulesParameters.new({ + data: [ + DatadogAPIClient::V2::ReorderInboxRulesParametersData.new({ + id: "123e4567-e89b-12d3-a456-426655440000", + type: DatadogAPIClient::V2::InboxRulesType::INBOX_RULES, + }), + ], +}) +p api_instance.reorder_inbox_rules(body) diff --git a/examples/v2/security-monitoring/ReorderMuteRules.rb b/examples/v2/security-monitoring/ReorderMuteRules.rb new file mode 100644 index 000000000000..6ed30bc713e4 --- /dev/null +++ b/examples/v2/security-monitoring/ReorderMuteRules.rb @@ -0,0 +1,14 @@ +# Reorder the list of mute rules in the pipeline returns "The list of mute rules" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::ReorderMuteRulesParameters.new({ + data: [ + DatadogAPIClient::V2::ReorderMuteRulesParametersData.new({ + id: "123e4567-e89b-12d3-a456-426655440000", + type: DatadogAPIClient::V2::MuteRulesType::MUTE_RULES, + }), + ], +}) +p api_instance.reorder_mute_rules(body) diff --git a/examples/v2/security-monitoring/UpdateInboxRule.rb b/examples/v2/security-monitoring/UpdateInboxRule.rb new file mode 100644 index 000000000000..b3582ae1b0e8 --- /dev/null +++ b/examples/v2/security-monitoring/UpdateInboxRule.rb @@ -0,0 +1,35 @@ +# Update an inbox rule returns "Inbox rule successfully updated" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +# there is a valid "valid_inbox_rule" in the system +VALID_INBOX_RULE_DATA_ID = ENV["VALID_INBOX_RULE_DATA_ID"] + +body = DatadogAPIClient::V2::UpdateInboxRuleParameters.new({ + data: DatadogAPIClient::V2::UpdateInboxRuleParametersData.new({ + attributes: DatadogAPIClient::V2::CreateInboxRuleParametersDataAttributes.new({ + action: DatadogAPIClient::V2::ActionInbox.new({ + reason_description: "We want to focus on these items.", + }), + enabled: true, + name: "Rule 1", + rule: DatadogAPIClient::V2::Rule.new({ + issue_type: DatadogAPIClient::V2::IssueType::VULNERABILITY, + query: "key:val", + rule_ids: [ + "rule-id-1", + ], + rule_types: [ + DatadogAPIClient::V2::RuleTypesItems::APPLICATION_CODE_VULNERABILITY, + ], + severities: [ + DatadogAPIClient::V2::RuleSeverity::CRITICAL, + ], + }), + }), + id: VALID_INBOX_RULE_DATA_ID, + type: DatadogAPIClient::V2::InboxRulesType::INBOX_RULES, + }), +}) +p api_instance.update_inbox_rule(VALID_INBOX_RULE_DATA_ID, body) diff --git a/examples/v2/security-monitoring/UpdateMuteRule.rb b/examples/v2/security-monitoring/UpdateMuteRule.rb new file mode 100644 index 000000000000..7196d8295cf3 --- /dev/null +++ b/examples/v2/security-monitoring/UpdateMuteRule.rb @@ -0,0 +1,37 @@ +# Update a mute rule returns "Mute rule successfully updated" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +# there is a valid "valid_mute_rule" in the system +VALID_MUTE_RULE_DATA_ID = ENV["VALID_MUTE_RULE_DATA_ID"] + +body = DatadogAPIClient::V2::UpdateMuteRuleParameters.new({ + data: DatadogAPIClient::V2::UpdateMuteRuleParametersData.new({ + attributes: DatadogAPIClient::V2::CreateMuteRuleParametersDataAttributes.new({ + action: DatadogAPIClient::V2::ActionMute.new({ + expire_at: 1893452400000, + reason: DatadogAPIClient::V2::MuteReason::DUPLICATE, + reason_description: "Muting for a while", + }), + enabled: true, + name: "Rule 1", + rule: DatadogAPIClient::V2::Rule.new({ + issue_type: DatadogAPIClient::V2::IssueType::VULNERABILITY, + query: "key:val", + rule_ids: [ + "rule-id-1", + ], + rule_types: [ + DatadogAPIClient::V2::RuleTypesItems::APPLICATION_CODE_VULNERABILITY, + ], + severities: [ + DatadogAPIClient::V2::RuleSeverity::CRITICAL, + ], + }), + }), + id: VALID_MUTE_RULE_DATA_ID, + type: DatadogAPIClient::V2::MuteRulesType::MUTE_RULES, + }), +}) +p api_instance.update_mute_rule(VALID_MUTE_RULE_DATA_ID, body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 46ed47ef5118..0e9582aa654f 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1876,6 +1876,46 @@ "filter_asset_operating_system_name" => "String", "filter_asset_operating_system_version" => "String", }, + "v2.CreateInboxRule" => { + "body" => "CreateInboxRuleParameters", + }, + "v2.ReorderInboxRules" => { + "body" => "ReorderInboxRulesParameters", + }, + "v2.DeleteInboxRule" => { + "inbox_rule_id" => "UUID", + }, + "v2.GetInboxRule" => { + "inbox_rule_id" => "UUID", + }, + "v2.PatchInboxRule" => { + "inbox_rule_id" => "UUID", + "body" => "PatchInboxRulesParameters", + }, + "v2.UpdateInboxRule" => { + "inbox_rule_id" => "UUID", + "body" => "UpdateInboxRuleParameters", + }, + "v2.CreateMuteRule" => { + "body" => "CreateMuteRuleParameters", + }, + "v2.ReorderMuteRules" => { + "body" => "ReorderMuteRulesParameters", + }, + "v2.DeleteMuteRule" => { + "mute_rule_id" => "UUID", + }, + "v2.GetMuteRule" => { + "mute_rule_id" => "UUID", + }, + "v2.PatchMuteRule" => { + "mute_rule_id" => "UUID", + "body" => "PatchMuteRuleParameters", + }, + "v2.UpdateMuteRule" => { + "mute_rule_id" => "UUID", + "body" => "UpdateMuteRuleParameters", + }, "v2.CreateSecurityFilter" => { "body" => "SecurityFilterCreateRequest", }, diff --git a/features/v2/given.json b/features/v2/given.json index e5c2cbcc488a..fcafe2e1ff2f 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -547,6 +547,30 @@ "tag": "Service Scorecards", "operationId": "CreateScorecardRule" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"inbox_rules\",\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"rule\": {\n \"issue_type\": \"vulnerability\",\n \"rule_types\": [\"misconfiguration\", \"attack_path\"],\n \"rule_ids\": [],\n \"severities\": [\"critical\"],\n \"query\": \"\"\n },\n \"action\": {\n \"reason_description\": \"items to focus on\"\n },\n \"enabled\": true\n }\n }\n}" + } + ], + "step": "there is a valid \"valid_inbox_rule\" in the system", + "key": "valid_inbox_rule", + "tag": "Security Monitoring", + "operationId": "CreateInboxRule" + }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"mute_rules\",\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"rule\": {\n \"issue_type\": \"vulnerability\",\n \"rule_types\": [\"misconfiguration\", \"attack_path\"],\n \"rule_ids\": [],\n \"severities\": [\"critical\"],\n \"query\": \"\"\n },\n \"action\": {\n \"reason\": \"duplicate\"\n },\n \"enabled\": true\n }\n }\n}" + } + ], + "step": "there is a valid \"valid_mute_rule\" in the system", + "key": "valid_mute_rule", + "tag": "Security Monitoring", + "operationId": "CreateMuteRule" + }, { "parameters": [ { diff --git a/features/v2/security_monitoring.feature b/features/v2/security_monitoring.feature index 5a2330a8f352..58bb35e15d14 100644 --- a/features/v2/security_monitoring.feature +++ b/features/v2/security_monitoring.feature @@ -235,6 +235,34 @@ Feature: Security Monitoring And the response "message" is equal to "Test rule" And the response "isEnabled" is equal to true + @team:DataDog/cloud-security-posture-management + Scenario: Create a new inbox rule returns "Bad Request" response + Given new "CreateInboxRule" request + And body with value {"data": {"attributes": {"action": {"reason_description": "We want to focus on these items."}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/cloud-security-posture-management + Scenario: Create a new inbox rule returns "Successfully created the inbox rule" response + Given new "CreateInboxRule" request + And body with value {"data": {"attributes": {"action": {"reason_description": "We want to focus on these items."}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "type": "inbox_rules"}} + When the request is sent + Then the response status is 201 Successfully created the inbox rule + + @team:DataDog/cloud-security-posture-management + Scenario: Create a new mute rule returns "Bad Request" response + Given new "CreateMuteRule" request + And body with value {"data": {"attributes": {"action": {"expire_at": 1893452400000, "reason": "duplicate", "reason_description": "Muting for a while"}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/cloud-security-posture-management + Scenario: Create a new mute rule returns "Successfully created the mute rule" response + Given new "CreateMuteRule" request + And body with value {"data": {"attributes": {"action": {"expire_at": 1893452400000, "reason": "duplicate", "reason_description": "Muting for a while"}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "type": "mute_rules"}} + When the request is sent + Then the response status is 201 Successfully created the mute rule + @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Create a security filter returns "Bad Request" response Given new "CreateSecurityFilter" request @@ -296,6 +324,21 @@ Feature: Security Monitoring And the response "data.attributes.rule_query" is equal to "type:log_detection source:cloudtrail" And the response "data.attributes.data_exclusion_query" is equal to "account_id:12345" + @team:DataDog/cloud-security-posture-management + Scenario: Delete a mute rule returns "Not Found" response + Given new "DeleteMuteRule" request + And request contains "mute_rule_id" parameter with value "00000000-0000-0000-0000-426655000000" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/cloud-security-posture-management + Scenario: Delete a mute rule returns "Rule successfully deleted" response + Given there is a valid "valid_mute_rule" in the system + And new "DeleteMuteRule" request + And request contains "mute_rule_id" parameter from "valid_mute_rule.data.id" + When the request is sent + Then the response status is 204 Rule successfully deleted + @skip @team:DataDog/k9-cloud-security-platform Scenario: Delete a non existing rule returns "Not Found" response Given new "DeleteSecurityMonitoringRule" request @@ -328,7 +371,7 @@ Feature: Security Monitoring @skip @team:DataDog/k9-cloud-security-platform Scenario: Delete a suppression rule returns "Not Found" response Given new "DeleteSecurityMonitoringSuppression" request - And request contains "suppression_id" parameter with value "does-not-exist" + And request contains "suppression_id" parameter with value "00000000-0000-0000-0000-426655000000" When the request is sent Then the response status is 404 Not Found @@ -387,6 +430,21 @@ Feature: Security Monitoring When the request is sent Then the response status is 204 OK + @team:DataDog/cloud-security-posture-management + Scenario: Delete an inbox rule returns "Not Found" response + Given new "DeleteInboxRule" request + And request contains "inbox_rule_id" parameter with value "00000000-0000-0000-0000-426655000000" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/cloud-security-posture-management + Scenario: Delete an inbox rule returns "Rule successfully deleted" response + Given there is a valid "valid_inbox_rule" in the system + And new "DeleteInboxRule" request + And request contains "inbox_rule_id" parameter from "valid_inbox_rule.data.id" + When the request is sent + Then the response status is 204 Rule successfully deleted + @generated @skip @team:DataDog/asm-vm Scenario: Get SBOM returns "Bad request: The server cannot process the request due to invalid syntax in the request." response Given operation "GetSBOM" enabled @@ -599,6 +657,64 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @team:DataDog/cloud-security-posture-management + Scenario: Get details of a mute rule returns "Bad Request" response + Given new "GetMuteRule" request + And request contains "mute_rule_id" parameter with value "invalid-uuid" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/cloud-security-posture-management + Scenario: Get details of a mute rule returns "Mute rule details" response + Given new "GetMuteRule" request + And there is a valid "valid_mute_rule" in the system + And request contains "mute_rule_id" parameter from "valid_mute_rule.data.id" + When the request is sent + Then the response status is 200 Mute rule details + + @team:DataDog/cloud-security-posture-management + Scenario: Get details of a mute rule returns "Not Found" response + Given new "GetMuteRule" request + And request contains "mute_rule_id" parameter with value "00000000-0000-0000-0000-426655000000" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/cloud-security-posture-management + Scenario: Get details of an inbox rule returns "Bad Request" response + Given new "GetInboxRule" request + And request contains "inbox_rule_id" parameter with value "invalid-uuid" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/cloud-security-posture-management + Scenario: Get details of an inbox rule returns "Inbox rule details" response + Given new "GetInboxRule" request + And there is a valid "valid_inbox_rule" in the system + And request contains "inbox_rule_id" parameter from "valid_inbox_rule.data.id" + When the request is sent + Then the response status is 200 Inbox rule details + + @team:DataDog/cloud-security-posture-management + Scenario: Get details of an inbox rule returns "Not Found" response + Given new "GetInboxRule" request + And request contains "inbox_rule_id" parameter with value "00000000-0000-0000-0000-426655000000" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/cloud-security-posture-management + Scenario: Get the ordered list of inbox rules returns "The list of inbox rules" response + Given new "GetInboxRules" request + And there is a valid "valid_inbox_rule" in the system + When the request is sent + Then the response status is 200 The list of inbox rules + + @team:DataDog/cloud-security-posture-management + Scenario: Get the ordered list of mute rules returns "The list of mute rules" response + Given new "GetMuteRules" request + And there is a valid "valid_mute_rule" in the system + When the request is sent + Then the response status is 200 The list of mute rules + @generated @skip @team:DataDog/cloud-security-posture-management Scenario: List findings returns "Bad Request: The server cannot process the request due to invalid syntax in the request." response Given operation "ListFindings" enabled @@ -773,6 +889,104 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @skip @team:DataDog/cloud-security-posture-management + Scenario: Patch a mute rule returns "Bad Request" response + Given new "PatchMuteRule" request + And there is a valid "valid_mute_rule" in the system + And request contains "mute_rule_id" parameter from "valid_mute_rule.data.id" + And body with value {"invalid": {"attributes": {"action": {"expire_at": 1893452400000, "reason": "duplicate", "reason_description": "Muting for a while"}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "{{ valid_mute_rule.data.id }}", "type": "mute_rules"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/cloud-security-posture-management + Scenario: Patch a mute rule returns "Mute rule successfully patched" response + Given new "PatchMuteRule" request + And there is a valid "valid_mute_rule" in the system + And request contains "mute_rule_id" parameter from "valid_mute_rule.data.id" + And body with value {"data": {"attributes": {"action": {"expire_at": 1893452400000, "reason": "duplicate", "reason_description": "Muting for a while"}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "{{ valid_mute_rule.data.id }}", "type": "mute_rules"}} + When the request is sent + Then the response status is 200 Mute rule successfully patched + + @team:DataDog/cloud-security-posture-management + Scenario: Patch a mute rule returns "Not Found" response + Given new "PatchMuteRule" request + And request contains "mute_rule_id" parameter with value "00000000-0000-0000-0000-426655000000" + And body with value {"data": {"attributes": {"action": {"expire_at": 1893452400000, "reason": "duplicate", "reason_description": "Muting for a while"}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "00000000-0000-0000-0000-426655000000", "type": "mute_rules"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/cloud-security-posture-management + Scenario: Patch a mute rule returns "The server cannot process the request because it contains invalid data." response + Given new "PatchMuteRule" request + And there is a valid "valid_mute_rule" in the system + And request contains "mute_rule_id" parameter from "valid_mute_rule.data.id" + And body with value {"data": {"attributes": {"action": {"expire_at": 1893452400000, "reason": "duplicate", "reason_description": "Muting for a while"}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "00000000-0000-0000-0000-426655000000", "type": "mute_rules"}} + When the request is sent + Then the response status is 422 The server cannot process the request because it contains invalid data. + + @team:DataDog/cloud-security-posture-management + Scenario: Patch an inbox rule returns "Bad Request" response + Given new "PatchInboxRule" request + And there is a valid "valid_inbox_rule" in the system + And request contains "inbox_rule_id" parameter from "valid_inbox_rule.data.id" + And body with value {"invalid": {"attributes": {"action": {"reason_description": "We want to focus on these items."}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "{{ valid_inbox_rule.data.id }}", "type": "inbox_rules"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/cloud-security-posture-management + Scenario: Patch an inbox rule returns "Inbox rule successfully patched" response + Given new "PatchInboxRule" request + And there is a valid "valid_inbox_rule" in the system + And request contains "inbox_rule_id" parameter from "valid_inbox_rule.data.id" + And body with value {"data": {"attributes": {"action": {"reason_description": "We want to focus on these items."}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "{{ valid_inbox_rule.data.id }}", "type": "inbox_rules"}} + When the request is sent + Then the response status is 200 Inbox rule successfully patched + + @team:DataDog/cloud-security-posture-management + Scenario: Patch an inbox rule returns "Not Found" response + Given new "PatchInboxRule" request + And request contains "inbox_rule_id" parameter with value "00000000-0000-0000-0000-426655000000" + And body with value {"data": {"attributes": {"action": {"reason_description": "We want to focus on these items."}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "00000000-0000-0000-0000-426655000000", "type": "inbox_rules"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/cloud-security-posture-management + Scenario: Patch an inbox rule returns "The server cannot process the request because it contains invalid data." response + Given new "PatchInboxRule" request + And there is a valid "valid_inbox_rule" in the system + And request contains "inbox_rule_id" parameter from "valid_inbox_rule.data.id" + And body with value {"data": {"attributes": {"action": {"reason_description": "We want to focus on these items."}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "00000000-0000-0000-0000-426655000000", "type": "inbox_rules"}} + When the request is sent + Then the response status is 422 The server cannot process the request because it contains invalid data. + + @generated @skip @team:DataDog/cloud-security-posture-management + Scenario: Reorder the list of inbox rules in the pipeline returns "Bad Request" response + Given new "ReorderInboxRules" request + And body with value {"data": [{"id": "123e4567-e89b-12d3-a456-426655440000", "type": "inbox_rules"}]} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-security-posture-management + Scenario: Reorder the list of inbox rules in the pipeline returns "The list of inbox rules" response + Given new "ReorderInboxRules" request + And body with value {"data": [{"id": "123e4567-e89b-12d3-a456-426655440000", "type": "inbox_rules"}]} + When the request is sent + Then the response status is 200 The list of inbox rules + + @generated @skip @team:DataDog/cloud-security-posture-management + Scenario: Reorder the list of mute rules in the pipeline returns "Bad Request" response + Given new "ReorderMuteRules" request + And body with value {"data": [{"id": "123e4567-e89b-12d3-a456-426655440000", "type": "mute_rules"}]} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/cloud-security-posture-management + Scenario: Reorder the list of mute rules in the pipeline returns "The list of mute rules" response + Given new "ReorderMuteRules" request + And body with value {"data": [{"id": "123e4567-e89b-12d3-a456-426655440000", "type": "mute_rules"}]} + When the request is sent + Then the response status is 200 The list of mute rules + @team:DataDog/k9-cloud-security-platform Scenario: Run a historical job returns "Bad Request" response Given operation "RunHistoricalJob" enabled @@ -854,6 +1068,41 @@ Feature: Security Monitoring And the response "name" is equal to "{{ unique }}_cloud_updated" And the response "id" has the same value as "cloud_configuration_rule.id" + @team:DataDog/cloud-security-posture-management + Scenario: Update a mute rule returns "Bad Request" response + Given new "UpdateMuteRule" request + And there is a valid "valid_mute_rule" in the system + And request contains "mute_rule_id" parameter from "valid_mute_rule.data.id" + And body with value {"invalid": {"attributes": {"action": {"expire_at": 1893452400000, "reason": "duplicate", "reason_description": "Muting for a while"}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "{{ valid_mute_rule.data.id }}", "type": "mute_rules"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/cloud-security-posture-management + Scenario: Update a mute rule returns "Mute rule successfully updated" response + Given new "UpdateMuteRule" request + And there is a valid "valid_mute_rule" in the system + And request contains "mute_rule_id" parameter from "valid_mute_rule.data.id" + And body with value {"data": {"attributes": {"action": {"expire_at": 1893452400000, "reason": "duplicate", "reason_description": "Muting for a while"}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "{{ valid_mute_rule.data.id }}", "type": "mute_rules"}} + When the request is sent + Then the response status is 200 Mute rule successfully updated + + @team:DataDog/cloud-security-posture-management + Scenario: Update a mute rule returns "Not Found" response + Given new "UpdateMuteRule" request + And request contains "mute_rule_id" parameter with value "00000000-0000-0000-0000-426655000000" + And body with value {"data": {"attributes": {"action": {"expire_at": 1893452400000, "reason": "duplicate", "reason_description": "Muting for a while"}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "00000000-0000-0000-0000-426655000000", "type": "mute_rules"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/cloud-security-posture-management + Scenario: Update a mute rule returns "The server cannot process the request because it contains invalid data." response + Given new "UpdateMuteRule" request + And there is a valid "valid_mute_rule" in the system + And request contains "mute_rule_id" parameter from "valid_mute_rule.data.id" + And body with value {"data": {"attributes": {"action": {"expire_at": 1893452400000, "reason": "duplicate", "reason_description": "Muting for a while"}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "00000000-0000-0000-0000-426655000000", "type": "mute_rules"}} + When the request is sent + Then the response status is 422 The server cannot process the request because it contains invalid data. + @generated @skip @team:DataDog/k9-cloud-security-platform Scenario: Update a security filter returns "Bad Request" response Given new "UpdateSecurityFilter" request @@ -954,6 +1203,41 @@ Feature: Security Monitoring And the response "name" is equal to "{{ unique }}-Updated" And the response "id" has the same value as "security_rule.id" + @team:DataDog/cloud-security-posture-management + Scenario: Update an inbox rule returns "Bad Request" response + Given new "UpdateInboxRule" request + And there is a valid "valid_inbox_rule" in the system + And request contains "inbox_rule_id" parameter from "valid_inbox_rule.data.id" + And body with value {"invalid": {"attributes": {"action": {"reason_description": "We want to focus on these items."}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "{{ valid_inbox_rule.data.id }}", "type": "inbox_rules"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/cloud-security-posture-management + Scenario: Update an inbox rule returns "Inbox rule successfully updated" response + Given new "UpdateInboxRule" request + And there is a valid "valid_inbox_rule" in the system + And request contains "inbox_rule_id" parameter from "valid_inbox_rule.data.id" + And body with value {"data": {"attributes": {"action": {"reason_description": "We want to focus on these items."}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "{{ valid_inbox_rule.data.id }}", "type": "inbox_rules"}} + When the request is sent + Then the response status is 200 Inbox rule successfully updated + + @team:DataDog/cloud-security-posture-management + Scenario: Update an inbox rule returns "Not Found" response + Given new "UpdateInboxRule" request + And request contains "inbox_rule_id" parameter with value "00000000-0000-0000-0000-426655000000" + And body with value {"data": {"attributes": {"action": {"reason_description": "We want to focus on these items."}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "00000000-0000-0000-0000-426655000000", "type": "inbox_rules"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/cloud-security-posture-management + Scenario: Update an inbox rule returns "The server cannot process the request because it contains invalid data." response + Given new "UpdateInboxRule" request + And there is a valid "valid_inbox_rule" in the system + And request contains "inbox_rule_id" parameter from "valid_inbox_rule.data.id" + And body with value {"data": {"attributes": {"action": {"reason_description": "We want to focus on these items."}, "enabled": true, "name": "Rule 1", "rule": {"issue_type": "vulnerability", "query": "key:val", "rule_ids": ["rule-id-1"], "rule_types": ["application_code_vulnerability"], "severities": ["critical"]}}, "id": "00000000-0000-0000-0000-426655000000", "type": "inbox_rules"}} + When the request is sent + Then the response status is 422 The server cannot process the request because it contains invalid data. + @skip-go @skip-java @skip-python @skip-ruby @skip-rust @skip-typescript @skip-validation @team:DataDog/k9-cloud-security-platform Scenario: Validate a detection rule returns "Bad Request" response Given new "ValidateSecurityMonitoringRule" request diff --git a/features/v2/undo.json b/features/v2/undo.json index a195ddc9e5e8..76ae165eb6b5 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -2073,6 +2073,104 @@ "type": "safe" } }, + "GetInboxRules": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "CreateInboxRule": { + "tag": "Security Monitoring", + "undo": { + "operationId": "DeleteInboxRule", + "parameters": [ + { + "name": "inbox_rule_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "ReorderInboxRules": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "DeleteInboxRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "GetInboxRule": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "PatchInboxRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "UpdateInboxRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "GetMuteRules": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "CreateMuteRule": { + "tag": "Security Monitoring", + "undo": { + "operationId": "DeleteMuteRule", + "parameters": [ + { + "name": "mute_rule_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "ReorderMuteRules": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "DeleteMuteRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "GetMuteRule": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "PatchMuteRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "UpdateMuteRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, "ListCloudWorkloadSecurityAgentRules": { "tag": "CSM Threats", "undo": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 431725e797de..b4082d5d2e5a 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -916,6 +916,8 @@ def overrides "v2.action_connection_data_update" => "ActionConnectionDataUpdate", "v2.action_connection_integration" => "ActionConnectionIntegration", "v2.action_connection_integration_update" => "ActionConnectionIntegrationUpdate", + "v2.action_inbox" => "ActionInbox", + "v2.action_mute" => "ActionMute", "v2.active_billing_dimensions_attributes" => "ActiveBillingDimensionsAttributes", "v2.active_billing_dimensions_body" => "ActiveBillingDimensionsBody", "v2.active_billing_dimensions_response" => "ActiveBillingDimensionsResponse", @@ -1317,6 +1319,12 @@ def overrides "v2.create_data_deletion_request_body_data" => "CreateDataDeletionRequestBodyData", "v2.create_data_deletion_request_body_data_type" => "CreateDataDeletionRequestBodyDataType", "v2.create_data_deletion_response_body" => "CreateDataDeletionResponseBody", + "v2.create_inbox_rule_parameters" => "CreateInboxRuleParameters", + "v2.create_inbox_rule_parameters_data" => "CreateInboxRuleParametersData", + "v2.create_inbox_rule_parameters_data_attributes" => "CreateInboxRuleParametersDataAttributes", + "v2.create_mute_rule_parameters" => "CreateMuteRuleParameters", + "v2.create_mute_rule_parameters_data" => "CreateMuteRuleParametersData", + "v2.create_mute_rule_parameters_data_attributes" => "CreateMuteRuleParametersDataAttributes", "v2.create_open_api_response" => "CreateOpenAPIResponse", "v2.create_open_api_response_attributes" => "CreateOpenAPIResponseAttributes", "v2.create_open_api_response_data" => "CreateOpenAPIResponseData", @@ -1688,6 +1696,10 @@ def overrides "v2.http_token_auth_update" => "HTTPTokenAuthUpdate", "v2.http_token_update" => "HTTPTokenUpdate", "v2.idp_metadata_form_data" => "IdPMetadataFormData", + "v2.inbox_rule" => "InboxRule", + "v2.inbox_rule_attributes" => "InboxRuleAttributes", + "v2.inbox_rule_response" => "InboxRuleResponse", + "v2.inbox_rules_type" => "InboxRulesType", "v2.incident_attachment_attachment_type" => "IncidentAttachmentAttachmentType", "v2.incident_attachment_attributes" => "IncidentAttachmentAttributes", "v2.incident_attachment_data" => "IncidentAttachmentData", @@ -1837,6 +1849,7 @@ def overrides "v2.ip_allowlist_response" => "IPAllowlistResponse", "v2.ip_allowlist_type" => "IPAllowlistType", "v2.ip_allowlist_update_request" => "IPAllowlistUpdateRequest", + "v2.issue_type" => "IssueType", "v2.jira_integration_metadata" => "JiraIntegrationMetadata", "v2.jira_integration_metadata_issues_item" => "JiraIntegrationMetadataIssuesItem", "v2.jira_issue" => "JiraIssue", @@ -2096,6 +2109,11 @@ def overrides "v2.monthly_cost_attribution_response" => "MonthlyCostAttributionResponse", "v2.ms_teams_integration_metadata" => "MSTeamsIntegrationMetadata", "v2.ms_teams_integration_metadata_teams_item" => "MSTeamsIntegrationMetadataTeamsItem", + "v2.mute_reason" => "MuteReason", + "v2.mute_rule" => "MuteRule", + "v2.mute_rule_attributes" => "MuteRuleAttributes", + "v2.mute_rule_response" => "MuteRuleResponse", + "v2.mute_rules_type" => "MuteRulesType", "v2.nullable_relationship_to_user" => "NullableRelationshipToUser", "v2.nullable_relationship_to_user_data" => "NullableRelationshipToUserData", "v2.nullable_user_relationship" => "NullableUserRelationship", @@ -2160,6 +2178,12 @@ def overrides "v2.partial_application_key" => "PartialApplicationKey", "v2.partial_application_key_attributes" => "PartialApplicationKeyAttributes", "v2.partial_application_key_response" => "PartialApplicationKeyResponse", + "v2.patch_inbox_rules_parameters" => "PatchInboxRulesParameters", + "v2.patch_inbox_rules_parameters_data" => "PatchInboxRulesParametersData", + "v2.patch_inbox_rules_parameters_data_attributes" => "PatchInboxRulesParametersDataAttributes", + "v2.patch_mute_rule_parameters" => "PatchMuteRuleParameters", + "v2.patch_mute_rule_parameters_data" => "PatchMuteRuleParametersData", + "v2.patch_mute_rule_parameters_data_attributes" => "PatchMuteRuleParametersDataAttributes", "v2.permission" => "Permission", "v2.permission_attributes" => "PermissionAttributes", "v2.permissions_response" => "PermissionsResponse", @@ -2247,6 +2271,10 @@ def overrides "v2.relationship_to_user_team_user_data" => "RelationshipToUserTeamUserData", "v2.relation_type" => "RelationType", "v2.remediation" => "Remediation", + "v2.reorder_inbox_rules_parameters" => "ReorderInboxRulesParameters", + "v2.reorder_inbox_rules_parameters_data" => "ReorderInboxRulesParametersData", + "v2.reorder_mute_rules_parameters" => "ReorderMuteRulesParameters", + "v2.reorder_mute_rules_parameters_data" => "ReorderMuteRulesParametersData", "v2.reorder_retention_filters_request" => "ReorderRetentionFiltersRequest", "v2.response_meta_attributes" => "ResponseMetaAttributes", "v2.restriction_policy" => "RestrictionPolicy", @@ -2292,9 +2320,13 @@ def overrides "v2.role_update_request" => "RoleUpdateRequest", "v2.role_update_response" => "RoleUpdateResponse", "v2.role_update_response_data" => "RoleUpdateResponseData", + "v2.rule" => "Rule", "v2.rule_attributes" => "RuleAttributes", "v2.rule_outcome_relationships" => "RuleOutcomeRelationships", + "v2.rule_severity" => "RuleSeverity", "v2.rule_type" => "RuleType", + "v2.rule_types_items" => "RuleTypesItems", + "v2.rule_user" => "RuleUser", "v2.rum_aggregate_bucket_value" => "RUMAggregateBucketValue", "v2.rum_aggregate_bucket_value_timeseries_point" => "RUMAggregateBucketValueTimeseriesPoint", "v2.rum_aggregate_request" => "RUMAggregateRequest", @@ -2753,6 +2785,10 @@ def overrides "v2.update_app_response_data_attributes" => "UpdateAppResponseDataAttributes", "v2.update_app_response_data_type" => "UpdateAppResponseDataType", "v2.update_app_response_relationship" => "UpdateAppResponseRelationship", + "v2.update_inbox_rule_parameters" => "UpdateInboxRuleParameters", + "v2.update_inbox_rule_parameters_data" => "UpdateInboxRuleParametersData", + "v2.update_mute_rule_parameters" => "UpdateMuteRuleParameters", + "v2.update_mute_rule_parameters_data" => "UpdateMuteRuleParametersData", "v2.update_open_api_response" => "UpdateOpenAPIResponse", "v2.update_open_api_response_attributes" => "UpdateOpenAPIResponseAttributes", "v2.update_open_api_response_data" => "UpdateOpenAPIResponseData", 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 bf386e290def..944857c88724 100644 --- a/lib/datadog_api_client/v2/api/security_monitoring_api.rb +++ b/lib/datadog_api_client/v2/api/security_monitoring_api.rb @@ -301,6 +301,140 @@ def convert_security_monitoring_rule_from_json_to_terraform_with_http_info(body, return data, status_code, headers end + # Create a new inbox rule. + # + # @see #create_inbox_rule_with_http_info + def create_inbox_rule(body, opts = {}) + data, _status_code, _headers = create_inbox_rule_with_http_info(body, opts) + data + end + + # Create a new inbox rule. + # + # Create a new inbox rule and return the created rule. + # + # @param body [CreateInboxRuleParameters] Mandatory fields are the rule type and the required attributes: rule name, rule details, and action. The rule details are composed of issue types and security rule types on which the rule applies. Optional security rule IDs, severities, and a tag or attribute query can be provided. The action is composed of the optional reason description. + # @param opts [Hash] the optional parameters + # @return [Array<(InboxRuleResponse, Integer, Hash)>] InboxRuleResponse data, response status code and response headers + def create_inbox_rule_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.create_inbox_rule ...' + 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_inbox_rule" + end + # resource path + local_var_path = '/api/v2/security/vulnerabilities/pipelines/inbox_rules' + + # 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] || 'InboxRuleResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_inbox_rule, + :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_inbox_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Create a new mute rule. + # + # @see #create_mute_rule_with_http_info + def create_mute_rule(body, opts = {}) + data, _status_code, _headers = create_mute_rule_with_http_info(body, opts) + data + end + + # Create a new mute rule. + # + # Create a new mute rule and return the created rule. + # + # @param body [CreateMuteRuleParameters] Mandatory fields are the rule type and the required attributes: rule name, rule details, and action. The rule details are composed of issue types and security rule types on which the rule applies. Optional security rule IDs, severities, and a tag or attribute query can be provided. The action is composed of the reason for muting and the rule expiration date, and optionally a description of the rule. + # @param opts [Hash] the optional parameters + # @return [Array<(MuteRuleResponse, Integer, Hash)>] MuteRuleResponse data, response status code and response headers + def create_mute_rule_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.create_mute_rule ...' + 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_mute_rule" + end + # resource path + local_var_path = '/api/v2/security/vulnerabilities/pipelines/mute_rules' + + # 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] || 'MuteRuleResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_mute_rule, + :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_mute_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create a security filter. # # @see #create_security_filter_with_http_info @@ -576,6 +710,136 @@ def delete_historical_job_with_http_info(job_id, opts = {}) return data, status_code, headers end + # Delete an inbox rule. + # + # @see #delete_inbox_rule_with_http_info + def delete_inbox_rule(inbox_rule_id, opts = {}) + delete_inbox_rule_with_http_info(inbox_rule_id, opts) + nil + end + + # Delete an inbox rule. + # + # Delete an inbox rule + # + # @param inbox_rule_id [UUID] ID of the inbox rule + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_inbox_rule_with_http_info(inbox_rule_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.delete_inbox_rule ...' + end + # verify the required parameter 'inbox_rule_id' is set + if @api_client.config.client_side_validation && inbox_rule_id.nil? + fail ArgumentError, "Missing the required parameter 'inbox_rule_id' when calling SecurityMonitoringAPI.delete_inbox_rule" + end + # resource path + local_var_path = '/api/v2/security/vulnerabilities/pipelines/inbox_rules/{inbox_rule_id}'.sub('{inbox_rule_id}', CGI.escape(inbox_rule_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :delete_inbox_rule, + :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_inbox_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete a mute rule. + # + # @see #delete_mute_rule_with_http_info + def delete_mute_rule(mute_rule_id, opts = {}) + delete_mute_rule_with_http_info(mute_rule_id, opts) + nil + end + + # Delete a mute rule. + # + # Delete a mute rule + # + # @param mute_rule_id [UUID] ID of the mute rule + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_mute_rule_with_http_info(mute_rule_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.delete_mute_rule ...' + end + # verify the required parameter 'mute_rule_id' is set + if @api_client.config.client_side_validation && mute_rule_id.nil? + fail ArgumentError, "Missing the required parameter 'mute_rule_id' when calling SecurityMonitoringAPI.delete_mute_rule" + end + # resource path + local_var_path = '/api/v2/security/vulnerabilities/pipelines/mute_rules/{mute_rule_id}'.sub('{mute_rule_id}', CGI.escape(mute_rule_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :delete_mute_rule, + :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_mute_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Delete a security filter. # # @see #delete_security_filter_with_http_info @@ -1134,55 +1398,35 @@ def get_historical_job_with_http_info(job_id, opts = {}) return data, status_code, headers end - # Get SBOM. + # Get details of an inbox rule. # - # @see #get_sbom_with_http_info - def get_sbom(asset_type, filter_asset_name, opts = {}) - data, _status_code, _headers = get_sbom_with_http_info(asset_type, filter_asset_name, opts) + # @see #get_inbox_rule_with_http_info + def get_inbox_rule(inbox_rule_id, opts = {}) + data, _status_code, _headers = get_inbox_rule_with_http_info(inbox_rule_id, opts) data end - # Get SBOM. - # - # Get a single SBOM related to an asset by its type and name. + # Get details of an inbox rule. # + # Get the details of an inbox rule. # - # @param asset_type [AssetType] The type of the asset for the SBOM request. - # @param filter_asset_name [String] The name of the asset for the SBOM request. + # @param inbox_rule_id [UUID] ID of the inbox rule # @param opts [Hash] the optional parameters - # @option opts [String] :filter_repo_digest The container image `repo_digest` for the SBOM request. When the requested asset type is 'Image', this filter is mandatory. - # @return [Array<(GetSBOMResponse, Integer, Hash)>] GetSBOMResponse data, response status code and response headers - def get_sbom_with_http_info(asset_type, filter_asset_name, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.get_sbom".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_sbom") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_sbom")) - end + # @return [Array<(InboxRuleResponse, Integer, Hash)>] InboxRuleResponse data, response status code and response headers + def get_inbox_rule_with_http_info(inbox_rule_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_sbom ...' - end - # verify the required parameter 'asset_type' is set - if @api_client.config.client_side_validation && asset_type.nil? - fail ArgumentError, "Missing the required parameter 'asset_type' when calling SecurityMonitoringAPI.get_sbom" - end - # verify enum value - allowable_values = ['Repository', 'Service', 'Host', 'HostImage', 'Image'] - if @api_client.config.client_side_validation && !allowable_values.include?(asset_type) - fail ArgumentError, "invalid value for \"asset_type\", must be one of #{allowable_values}" + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_inbox_rule ...' end - # verify the required parameter 'filter_asset_name' is set - if @api_client.config.client_side_validation && filter_asset_name.nil? - fail ArgumentError, "Missing the required parameter 'filter_asset_name' when calling SecurityMonitoringAPI.get_sbom" + # verify the required parameter 'inbox_rule_id' is set + if @api_client.config.client_side_validation && inbox_rule_id.nil? + fail ArgumentError, "Missing the required parameter 'inbox_rule_id' when calling SecurityMonitoringAPI.get_inbox_rule" end # resource path - local_var_path = '/api/v2/security/sboms/{asset_type}'.sub('{asset_type}', CGI.escape(asset_type.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/security/vulnerabilities/pipelines/inbox_rules/{inbox_rule_id}'.sub('{inbox_rule_id}', CGI.escape(inbox_rule_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} - query_params[:'filter[asset_name]'] = filter_asset_name - query_params[:'filter[repo_digest]'] = opts[:'filter_repo_digest'] if !opts[:'filter_repo_digest'].nil? # header parameters header_params = opts[:header_params] || {} @@ -1196,13 +1440,13 @@ def get_sbom_with_http_info(asset_type, filter_asset_name, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'GetSBOMResponse' + return_type = opts[:debug_return_type] || 'InboxRuleResponse' # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :get_sbom, + :operation => :get_inbox_rule, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1214,33 +1458,303 @@ def get_sbom_with_http_info(asset_type, filter_asset_name, opts = {}) 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_sbom\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#get_inbox_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get a security filter. + # Get the ordered list of inbox rules. # - # @see #get_security_filter_with_http_info - def get_security_filter(security_filter_id, opts = {}) - data, _status_code, _headers = get_security_filter_with_http_info(security_filter_id, opts) + # @see #get_inbox_rules_with_http_info + def get_inbox_rules(opts = {}) + data, _status_code, _headers = get_inbox_rules_with_http_info(opts) data end - # Get a security filter. + # Get the ordered list of inbox rules. # - # Get the details of a specific security filter. - # - # See the [security filter guide](https://docs.datadoghq.com/security_platform/guide/how-to-setup-security-filters-using-security-monitoring-api/) - # for more examples. + # Returns the ordered list of inbox rules in the pipeline (first match applies) # - # @param security_filter_id [String] The ID of the security filter. # @param opts [Hash] the optional parameters - # @return [Array<(SecurityFilterResponse, Integer, Hash)>] SecurityFilterResponse data, response status code and response headers - def get_security_filter_with_http_info(security_filter_id, opts = {}) + # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers + def get_inbox_rules_with_http_info(opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_security_filter ...' + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_inbox_rules ...' + end + # resource path + local_var_path = '/api/v2/security/vulnerabilities/pipelines/inbox_rules' + + # 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] || 'Object' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_inbox_rules, + :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_inbox_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get details of a mute rule. + # + # @see #get_mute_rule_with_http_info + def get_mute_rule(mute_rule_id, opts = {}) + data, _status_code, _headers = get_mute_rule_with_http_info(mute_rule_id, opts) + data + end + + # Get details of a mute rule. + # + # Get the details of a mute rule. + # + # @param mute_rule_id [UUID] ID of the mute rule + # @param opts [Hash] the optional parameters + # @return [Array<(MuteRuleResponse, Integer, Hash)>] MuteRuleResponse data, response status code and response headers + def get_mute_rule_with_http_info(mute_rule_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_mute_rule ...' + end + # verify the required parameter 'mute_rule_id' is set + if @api_client.config.client_side_validation && mute_rule_id.nil? + fail ArgumentError, "Missing the required parameter 'mute_rule_id' when calling SecurityMonitoringAPI.get_mute_rule" + end + # resource path + local_var_path = '/api/v2/security/vulnerabilities/pipelines/mute_rules/{mute_rule_id}'.sub('{mute_rule_id}', CGI.escape(mute_rule_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] || 'MuteRuleResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_mute_rule, + :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_mute_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get the ordered list of mute rules. + # + # @see #get_mute_rules_with_http_info + def get_mute_rules(opts = {}) + data, _status_code, _headers = get_mute_rules_with_http_info(opts) + data + end + + # Get the ordered list of mute rules. + # + # Returns the ordered list of mute rules in the pipeline (first match applies) + # + # @param opts [Hash] the optional parameters + # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers + def get_mute_rules_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_mute_rules ...' + end + # resource path + local_var_path = '/api/v2/security/vulnerabilities/pipelines/mute_rules' + + # 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] || 'Object' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_mute_rules, + :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_mute_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get SBOM. + # + # @see #get_sbom_with_http_info + def get_sbom(asset_type, filter_asset_name, opts = {}) + data, _status_code, _headers = get_sbom_with_http_info(asset_type, filter_asset_name, opts) + data + end + + # Get SBOM. + # + # Get a single SBOM related to an asset by its type and name. + # + # + # @param asset_type [AssetType] The type of the asset for the SBOM request. + # @param filter_asset_name [String] The name of the asset for the SBOM request. + # @param opts [Hash] the optional parameters + # @option opts [String] :filter_repo_digest The container image `repo_digest` for the SBOM request. When the requested asset type is 'Image', this filter is mandatory. + # @return [Array<(GetSBOMResponse, Integer, Hash)>] GetSBOMResponse data, response status code and response headers + def get_sbom_with_http_info(asset_type, filter_asset_name, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_sbom".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_sbom") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_sbom")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_sbom ...' + end + # verify the required parameter 'asset_type' is set + if @api_client.config.client_side_validation && asset_type.nil? + fail ArgumentError, "Missing the required parameter 'asset_type' when calling SecurityMonitoringAPI.get_sbom" + end + # verify enum value + allowable_values = ['Repository', 'Service', 'Host', 'HostImage', 'Image'] + if @api_client.config.client_side_validation && !allowable_values.include?(asset_type) + fail ArgumentError, "invalid value for \"asset_type\", must be one of #{allowable_values}" + end + # verify the required parameter 'filter_asset_name' is set + if @api_client.config.client_side_validation && filter_asset_name.nil? + fail ArgumentError, "Missing the required parameter 'filter_asset_name' when calling SecurityMonitoringAPI.get_sbom" + end + # resource path + local_var_path = '/api/v2/security/sboms/{asset_type}'.sub('{asset_type}', CGI.escape(asset_type.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'filter[asset_name]'] = filter_asset_name + query_params[:'filter[repo_digest]'] = opts[:'filter_repo_digest'] if !opts[:'filter_repo_digest'].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] || 'GetSBOMResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_sbom, + :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_sbom\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get a security filter. + # + # @see #get_security_filter_with_http_info + def get_security_filter(security_filter_id, opts = {}) + data, _status_code, _headers = get_security_filter_with_http_info(security_filter_id, opts) + data + end + + # Get a security filter. + # + # Get the details of a specific security filter. + # + # See the [security filter guide](https://docs.datadoghq.com/security_platform/guide/how-to-setup-security-filters-using-security-monitoring-api/) + # for more examples. + # + # @param security_filter_id [String] The ID of the security filter. + # @param opts [Hash] the optional parameters + # @return [Array<(SecurityFilterResponse, Integer, Hash)>] SecurityFilterResponse data, response status code and response headers + def get_security_filter_with_http_info(security_filter_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_security_filter ...' end # verify the required parameter 'security_filter_id' is set if @api_client.config.client_side_validation && security_filter_id.nil? @@ -2475,31 +2989,311 @@ def mute_findings_with_http_info(body, opts = {}) return data, status_code, headers end - # Run a historical job. + # Patch an inbox rule. # - # @see #run_historical_job_with_http_info - def run_historical_job(body, opts = {}) - data, _status_code, _headers = run_historical_job_with_http_info(body, opts) + # @see #patch_inbox_rule_with_http_info + def patch_inbox_rule(inbox_rule_id, body, opts = {}) + data, _status_code, _headers = patch_inbox_rule_with_http_info(inbox_rule_id, body, opts) data end - # Run a historical job. + # Patch an inbox rule. # - # Run a historical job. + # Partially update the inbox rule. All fields are optional; if a field is not provided, it will not be updated. # - # @param body [RunHistoricalJobRequest] + # @param inbox_rule_id [UUID] ID of the inbox rule + # @param body [PatchInboxRulesParameters] # @param opts [Hash] the optional parameters - # @return [Array<(JobCreateResponse, Integer, Hash)>] JobCreateResponse data, response status code and response headers - def run_historical_job_with_http_info(body, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.run_historical_job".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.run_historical_job") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.run_historical_job")) - end + # @return [Array<(InboxRuleResponse, Integer, Hash)>] InboxRuleResponse data, response status code and response headers + def patch_inbox_rule_with_http_info(inbox_rule_id, body, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.run_historical_job ...' + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.patch_inbox_rule ...' + end + # verify the required parameter 'inbox_rule_id' is set + if @api_client.config.client_side_validation && inbox_rule_id.nil? + fail ArgumentError, "Missing the required parameter 'inbox_rule_id' when calling SecurityMonitoringAPI.patch_inbox_rule" + 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.patch_inbox_rule" + end + # resource path + local_var_path = '/api/v2/security/vulnerabilities/pipelines/inbox_rules/{inbox_rule_id}'.sub('{inbox_rule_id}', CGI.escape(inbox_rule_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'InboxRuleResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :patch_inbox_rule, + :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#patch_inbox_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Patch a mute rule. + # + # @see #patch_mute_rule_with_http_info + def patch_mute_rule(mute_rule_id, body, opts = {}) + data, _status_code, _headers = patch_mute_rule_with_http_info(mute_rule_id, body, opts) + data + end + + # Patch a mute rule. + # + # Partially update the mute rule. All fields are optional; if a field is not provided, it will not be updated. + # + # @param mute_rule_id [UUID] ID of the mute rule + # @param body [PatchMuteRuleParameters] + # @param opts [Hash] the optional parameters + # @return [Array<(MuteRuleResponse, Integer, Hash)>] MuteRuleResponse data, response status code and response headers + def patch_mute_rule_with_http_info(mute_rule_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.patch_mute_rule ...' + end + # verify the required parameter 'mute_rule_id' is set + if @api_client.config.client_side_validation && mute_rule_id.nil? + fail ArgumentError, "Missing the required parameter 'mute_rule_id' when calling SecurityMonitoringAPI.patch_mute_rule" + 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.patch_mute_rule" + end + # resource path + local_var_path = '/api/v2/security/vulnerabilities/pipelines/mute_rules/{mute_rule_id}'.sub('{mute_rule_id}', CGI.escape(mute_rule_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'MuteRuleResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :patch_mute_rule, + :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#patch_mute_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Reorder the list of inbox rules in the pipeline. + # + # @see #reorder_inbox_rules_with_http_info + def reorder_inbox_rules(body, opts = {}) + data, _status_code, _headers = reorder_inbox_rules_with_http_info(body, opts) + data + end + + # Reorder the list of inbox rules in the pipeline. + # + # Reorder the list of inbox rules in the pipeline and return the reordered list of rules. + # To reorder fields you need to provide the full list of pipeline rules in the new order. + # + # @param body [ReorderInboxRulesParameters] The list of rules to reorder. The order of the rules in the list will be the new order in the pipeline. + # @param opts [Hash] the optional parameters + # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers + def reorder_inbox_rules_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.reorder_inbox_rules ...' + 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.reorder_inbox_rules" + end + # resource path + local_var_path = '/api/v2/security/vulnerabilities/pipelines/inbox_rules/reorder' + + # 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] || 'Object' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :reorder_inbox_rules, + :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#reorder_inbox_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Reorder the list of mute rules in the pipeline. + # + # @see #reorder_mute_rules_with_http_info + def reorder_mute_rules(body, opts = {}) + data, _status_code, _headers = reorder_mute_rules_with_http_info(body, opts) + data + end + + # Reorder the list of mute rules in the pipeline. + # + # Reorder the list of mute rules in the pipeline and return the reordered list of rules. + # To reorder fields you need to provide the full list of pipeline rules in the new order. + # + # @param body [ReorderMuteRulesParameters] The list of rules to reorder. The order of the rules in the list will be the new order in the pipeline. + # @param opts [Hash] the optional parameters + # @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers + def reorder_mute_rules_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.reorder_mute_rules ...' + 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.reorder_mute_rules" + end + # resource path + local_var_path = '/api/v2/security/vulnerabilities/pipelines/mute_rules/reorder' + + # 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] || 'Object' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :reorder_mute_rules, + :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#reorder_mute_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Run a historical job. + # + # @see #run_historical_job_with_http_info + def run_historical_job(body, opts = {}) + data, _status_code, _headers = run_historical_job_with_http_info(body, opts) + data + end + + # Run a historical job. + # + # Run a historical job. + # + # @param body [RunHistoricalJobRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(JobCreateResponse, Integer, Hash)>] JobCreateResponse data, response status code and response headers + def run_historical_job_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.run_historical_job".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.run_historical_job") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.run_historical_job")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.run_historical_job ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? @@ -2773,6 +3567,150 @@ def test_security_monitoring_rule_with_http_info(body, opts = {}) return data, status_code, headers end + # Update an inbox rule. + # + # @see #update_inbox_rule_with_http_info + def update_inbox_rule(inbox_rule_id, body, opts = {}) + data, _status_code, _headers = update_inbox_rule_with_http_info(inbox_rule_id, body, opts) + data + end + + # Update an inbox rule. + # + # Update the whole inbox rule. If an optional field is not provided, it will be set to its default value. + # + # @param inbox_rule_id [UUID] ID of the inbox rule + # @param body [UpdateInboxRuleParameters] + # @param opts [Hash] the optional parameters + # @return [Array<(InboxRuleResponse, Integer, Hash)>] InboxRuleResponse data, response status code and response headers + def update_inbox_rule_with_http_info(inbox_rule_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.update_inbox_rule ...' + end + # verify the required parameter 'inbox_rule_id' is set + if @api_client.config.client_side_validation && inbox_rule_id.nil? + fail ArgumentError, "Missing the required parameter 'inbox_rule_id' when calling SecurityMonitoringAPI.update_inbox_rule" + 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_inbox_rule" + end + # resource path + local_var_path = '/api/v2/security/vulnerabilities/pipelines/inbox_rules/{inbox_rule_id}'.sub('{inbox_rule_id}', CGI.escape(inbox_rule_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'InboxRuleResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_inbox_rule, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#update_inbox_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update a mute rule. + # + # @see #update_mute_rule_with_http_info + def update_mute_rule(mute_rule_id, body, opts = {}) + data, _status_code, _headers = update_mute_rule_with_http_info(mute_rule_id, body, opts) + data + end + + # Update a mute rule. + # + # Update the whole mute rule. If an optional field is not provided, it will be set to its default value. + # + # @param mute_rule_id [UUID] ID of the mute rule + # @param body [UpdateMuteRuleParameters] + # @param opts [Hash] the optional parameters + # @return [Array<(MuteRuleResponse, Integer, Hash)>] MuteRuleResponse data, response status code and response headers + def update_mute_rule_with_http_info(mute_rule_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.update_mute_rule ...' + end + # verify the required parameter 'mute_rule_id' is set + if @api_client.config.client_side_validation && mute_rule_id.nil? + fail ArgumentError, "Missing the required parameter 'mute_rule_id' when calling SecurityMonitoringAPI.update_mute_rule" + 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_mute_rule" + end + # resource path + local_var_path = '/api/v2/security/vulnerabilities/pipelines/mute_rules/{mute_rule_id}'.sub('{mute_rule_id}', CGI.escape(mute_rule_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'MuteRuleResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_mute_rule, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#update_mute_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Update a security filter. # # @see #update_security_filter_with_http_info diff --git a/lib/datadog_api_client/v2/models/action_inbox.rb b/lib/datadog_api_client/v2/models/action_inbox.rb new file mode 100644 index 000000000000..f82fb1247739 --- /dev/null +++ b/lib/datadog_api_client/v2/models/action_inbox.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Action of the inbox rule + class ActionInbox + include BaseGenericModel + + # Free text to add a reason description. + attr_accessor :reason_description + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'reason_description' => :'reason_description' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'reason_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::ActionInbox` 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?(:'reason_description') + self.reason_description = attributes[:'reason_description'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + reason_description == o.reason_description && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [reason_description, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/action_mute.rb b/lib/datadog_api_client/v2/models/action_mute.rb new file mode 100644 index 000000000000..a673dcbc4437 --- /dev/null +++ b/lib/datadog_api_client/v2/models/action_mute.rb @@ -0,0 +1,143 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Action of the mute rule + class ActionMute + include BaseGenericModel + + # End date of the mute rule (null means mute forever) + attr_accessor :expire_at + + # Reason for muting a vulnerability + attr_reader :reason + + # Free text to add a reason description. + attr_accessor :reason_description + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'expire_at' => :'expire_at', + :'reason' => :'reason', + :'reason_description' => :'reason_description' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'expire_at' => :'Integer', + :'reason' => :'MuteReason', + :'reason_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::ActionMute` 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?(:'expire_at') + self.expire_at = attributes[:'expire_at'] + end + + if attributes.key?(:'reason') + self.reason = attributes[:'reason'] + end + + if attributes.key?(:'reason_description') + self.reason_description = attributes[:'reason_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 @reason.nil? + true + end + + # Custom attribute writer method with validation + # @param reason [Object] Object to be assigned + # @!visibility private + def reason=(reason) + if reason.nil? + fail ArgumentError, 'invalid value for "reason", reason cannot be nil.' + end + @reason = reason + 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 && + expire_at == o.expire_at && + reason == o.reason && + reason_description == o.reason_description && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [expire_at, reason, reason_description, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_inbox_rule_parameters.rb b/lib/datadog_api_client/v2/models/create_inbox_rule_parameters.rb new file mode 100644 index 000000000000..f50ab714fbf2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_inbox_rule_parameters.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Body of the inbox rule create request + class CreateInboxRuleParameters + include BaseGenericModel + + # Data of the inbox rule create request: the rule type, and the rule attributes. All fields are required. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'CreateInboxRuleParametersData' + } + 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::CreateInboxRuleParameters` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_inbox_rule_parameters_data.rb b/lib/datadog_api_client/v2/models/create_inbox_rule_parameters_data.rb new file mode 100644 index 000000000000..535f06c7b4f6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_inbox_rule_parameters_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data of the inbox rule create request: the rule type, and the rule attributes. All fields are required. + class CreateInboxRuleParametersData + include BaseGenericModel + + # Attributes of the inbox rule create request: the rule name, the rule details, the associated action, and the optional enabled field. + attr_reader :attributes + + # The pipeline rule type associated to inbox rules + 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' => :'CreateInboxRuleParametersDataAttributes', + :'type' => :'InboxRulesType' + } + 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::CreateInboxRuleParametersData` 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/create_inbox_rule_parameters_data_attributes.rb b/lib/datadog_api_client/v2/models/create_inbox_rule_parameters_data_attributes.rb new file mode 100644 index 000000000000..5f246ac8d9db --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_inbox_rule_parameters_data_attributes.rb @@ -0,0 +1,178 @@ +=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 the inbox rule create request: the rule name, the rule details, the associated action, and the optional enabled field. + class CreateInboxRuleParametersDataAttributes + include BaseGenericModel + + # Action of the inbox rule + attr_reader :action + + # Field used to enable or disable the rule. + attr_accessor :enabled + + # Name of the pipeline rule + attr_reader :name + + # The definition of an automation pipeline rule scope. + # A rule can act on specific issue types, security rule types, security rule IDs, rule severities, or a query. + # The query can be used to filter resources on tags and attributes. + # The issue type and rule types fields are required. + attr_reader :rule + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'action' => :'action', + :'enabled' => :'enabled', + :'name' => :'name', + :'rule' => :'rule' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'action' => :'ActionInbox', + :'enabled' => :'Boolean', + :'name' => :'String', + :'rule' => :'Rule' + } + 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::CreateInboxRuleParametersDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'action') + self.action = attributes[:'action'] + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'rule') + self.rule = attributes[:'rule'] + 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 @action.nil? + return false if @name.nil? + return false if @rule.nil? + true + end + + # Custom attribute writer method with validation + # @param action [Object] Object to be assigned + # @!visibility private + def action=(action) + if action.nil? + fail ArgumentError, 'invalid value for "action", action cannot be nil.' + end + @action = action + 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 rule [Object] Object to be assigned + # @!visibility private + def rule=(rule) + if rule.nil? + fail ArgumentError, 'invalid value for "rule", rule cannot be nil.' + end + @rule = rule + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + action == o.action && + enabled == o.enabled && + name == o.name && + rule == o.rule && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [action, enabled, name, rule, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_mute_rule_parameters.rb b/lib/datadog_api_client/v2/models/create_mute_rule_parameters.rb new file mode 100644 index 000000000000..26ea91970146 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_mute_rule_parameters.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Body of the mute rule create request + class CreateMuteRuleParameters + include BaseGenericModel + + # Data of the mute rule create request: the rule type, and the rule attributes. All fields are required. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'CreateMuteRuleParametersData' + } + 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::CreateMuteRuleParameters` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_mute_rule_parameters_data.rb b/lib/datadog_api_client/v2/models/create_mute_rule_parameters_data.rb new file mode 100644 index 000000000000..d6e74606e522 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_mute_rule_parameters_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data of the mute rule create request: the rule type, and the rule attributes. All fields are required. + class CreateMuteRuleParametersData + include BaseGenericModel + + # Attributes of the mute rule create request: the rule name, the rule details, the associated action, and the optional enabled field. + attr_reader :attributes + + # The pipeline rule type associated to mute rules + 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' => :'CreateMuteRuleParametersDataAttributes', + :'type' => :'MuteRulesType' + } + 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::CreateMuteRuleParametersData` 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/create_mute_rule_parameters_data_attributes.rb b/lib/datadog_api_client/v2/models/create_mute_rule_parameters_data_attributes.rb new file mode 100644 index 000000000000..bd96935ba6c5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_mute_rule_parameters_data_attributes.rb @@ -0,0 +1,178 @@ +=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 the mute rule create request: the rule name, the rule details, the associated action, and the optional enabled field. + class CreateMuteRuleParametersDataAttributes + include BaseGenericModel + + # Action of the mute rule + attr_reader :action + + # Field used to enable or disable the rule. + attr_accessor :enabled + + # Name of the pipeline rule + attr_reader :name + + # The definition of an automation pipeline rule scope. + # A rule can act on specific issue types, security rule types, security rule IDs, rule severities, or a query. + # The query can be used to filter resources on tags and attributes. + # The issue type and rule types fields are required. + attr_reader :rule + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'action' => :'action', + :'enabled' => :'enabled', + :'name' => :'name', + :'rule' => :'rule' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'action' => :'ActionMute', + :'enabled' => :'Boolean', + :'name' => :'String', + :'rule' => :'Rule' + } + 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::CreateMuteRuleParametersDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'action') + self.action = attributes[:'action'] + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'rule') + self.rule = attributes[:'rule'] + 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 @action.nil? + return false if @name.nil? + return false if @rule.nil? + true + end + + # Custom attribute writer method with validation + # @param action [Object] Object to be assigned + # @!visibility private + def action=(action) + if action.nil? + fail ArgumentError, 'invalid value for "action", action cannot be nil.' + end + @action = action + 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 rule [Object] Object to be assigned + # @!visibility private + def rule=(rule) + if rule.nil? + fail ArgumentError, 'invalid value for "rule", rule cannot be nil.' + end + @rule = rule + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + action == o.action && + enabled == o.enabled && + name == o.name && + rule == o.rule && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [action, enabled, name, rule, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/inbox_rule.rb b/lib/datadog_api_client/v2/models/inbox_rule.rb new file mode 100644 index 000000000000..113fd4d0f674 --- /dev/null +++ b/lib/datadog_api_client/v2/models/inbox_rule.rb @@ -0,0 +1,166 @@ +=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 + # Inbox rules are used to prioritize and add relevant vulnerabilities to your Security Inbox. + # An inbox rule is composed of a rule UUID, a rule type, and the rule attributes. All fields are required. + class InboxRule + include BaseGenericModel + + # Attributes of the inbox rule + attr_reader :attributes + + # The ID of a pipeline rule + attr_reader :id + + # The pipeline rule type associated to inbox rules + 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' => :'InboxRuleAttributes', + :'id' => :'UUID', + :'type' => :'InboxRulesType' + } + 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::InboxRule` 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/inbox_rule_attributes.rb b/lib/datadog_api_client/v2/models/inbox_rule_attributes.rb new file mode 100644 index 000000000000..2d191d01f46f --- /dev/null +++ b/lib/datadog_api_client/v2/models/inbox_rule_attributes.rb @@ -0,0 +1,273 @@ +=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 the inbox rule + class InboxRuleAttributes + include BaseGenericModel + + # Action of the inbox rule + attr_reader :action + + # Date as Unix timestamp in milliseconds + attr_reader :created_at + + # User creating or modifying a rule + attr_reader :created_by + + # Field used to enable or disable the rule. + attr_reader :enabled + + # Date as Unix timestamp in milliseconds + attr_reader :modified_at + + # User creating or modifying a rule + attr_reader :modified_by + + # Name of the pipeline rule + attr_reader :name + + # The definition of an automation pipeline rule scope. + # A rule can act on specific issue types, security rule types, security rule IDs, rule severities, or a query. + # The query can be used to filter resources on tags and attributes. + # The issue type and rule types fields are required. + attr_reader :rule + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'action' => :'action', + :'created_at' => :'created_at', + :'created_by' => :'created_by', + :'enabled' => :'enabled', + :'modified_at' => :'modified_at', + :'modified_by' => :'modified_by', + :'name' => :'name', + :'rule' => :'rule' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'action' => :'ActionInbox', + :'created_at' => :'Integer', + :'created_by' => :'RuleUser', + :'enabled' => :'Boolean', + :'modified_at' => :'Integer', + :'modified_by' => :'RuleUser', + :'name' => :'String', + :'rule' => :'Rule' + } + 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::InboxRuleAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'action') + self.action = attributes[:'action'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'created_by') + self.created_by = attributes[:'created_by'] + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'modified_by') + self.modified_by = attributes[:'modified_by'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'rule') + self.rule = attributes[:'rule'] + 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 @action.nil? + return false if @created_at.nil? + return false if @created_by.nil? + return false if @enabled.nil? + return false if @modified_at.nil? + return false if @modified_by.nil? + return false if @name.nil? + return false if @rule.nil? + true + end + + # Custom attribute writer method with validation + # @param action [Object] Object to be assigned + # @!visibility private + def action=(action) + if action.nil? + fail ArgumentError, 'invalid value for "action", action cannot be nil.' + end + @action = action + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param created_by [Object] Object to be assigned + # @!visibility private + def created_by=(created_by) + if created_by.nil? + fail ArgumentError, 'invalid value for "created_by", created_by cannot be nil.' + end + @created_by = created_by + end + + # Custom attribute writer method with validation + # @param enabled [Object] Object to be assigned + # @!visibility private + def enabled=(enabled) + if enabled.nil? + fail ArgumentError, 'invalid value for "enabled", enabled cannot be nil.' + end + @enabled = enabled + end + + # Custom attribute writer method with validation + # @param modified_at [Object] Object to be assigned + # @!visibility private + def modified_at=(modified_at) + if modified_at.nil? + fail ArgumentError, 'invalid value for "modified_at", modified_at cannot be nil.' + end + @modified_at = modified_at + end + + # Custom attribute writer method with validation + # @param modified_by [Object] Object to be assigned + # @!visibility private + def modified_by=(modified_by) + if modified_by.nil? + fail ArgumentError, 'invalid value for "modified_by", modified_by cannot be nil.' + end + @modified_by = modified_by + 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 rule [Object] Object to be assigned + # @!visibility private + def rule=(rule) + if rule.nil? + fail ArgumentError, 'invalid value for "rule", rule cannot be nil.' + end + @rule = rule + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + action == o.action && + created_at == o.created_at && + created_by == o.created_by && + enabled == o.enabled && + modified_at == o.modified_at && + modified_by == o.modified_by && + name == o.name && + rule == o.rule && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [action, created_at, created_by, enabled, modified_at, modified_by, name, rule, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/inbox_rule_response.rb b/lib/datadog_api_client/v2/models/inbox_rule_response.rb new file mode 100644 index 000000000000..1060e625ef8b --- /dev/null +++ b/lib/datadog_api_client/v2/models/inbox_rule_response.rb @@ -0,0 +1,106 @@ +=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 object which includes an inbox rule. + class InboxRuleResponse + include BaseGenericModel + + # Inbox rules are used to prioritize and add relevant vulnerabilities to your Security Inbox. + # An inbox rule is composed of a rule UUID, a rule type, and the rule attributes. All fields are required. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'InboxRule' + } + 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::InboxRuleResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/inbox_rules_type.rb b/lib/datadog_api_client/v2/models/inbox_rules_type.rb new file mode 100644 index 000000000000..c9dfc2693a68 --- /dev/null +++ b/lib/datadog_api_client/v2/models/inbox_rules_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 pipeline rule type associated to inbox rules + class InboxRulesType + include BaseEnumModel + + INBOX_RULES = "inbox_rules".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/issue_type.rb b/lib/datadog_api_client/v2/models/issue_type.rb new file mode 100644 index 000000000000..ec45b9af5876 --- /dev/null +++ b/lib/datadog_api_client/v2/models/issue_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 issues on which the rule applies + class IssueType + include BaseEnumModel + + VULNERABILITY = "vulnerability".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/mute_reason.rb b/lib/datadog_api_client/v2/models/mute_reason.rb new file mode 100644 index 000000000000..b2c7f7542ba4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/mute_reason.rb @@ -0,0 +1,33 @@ +=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 + # Reason for muting a vulnerability + class MuteReason + include BaseEnumModel + + DUPLICATE = "duplicate".freeze + EXTERNAL_SOLUTION = "external_solution".freeze + FALSE_POSITIVE = "false_positive".freeze + INTERNAL_SOLUTION = "internal_solution".freeze + NO_FIX_AVAILABLE = "no_fix_available".freeze + OTHER = "other".freeze + PENDING_FIX = "pending_fix".freeze + RISK_ACCEPTED = "risk_accepted".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/mute_rule.rb b/lib/datadog_api_client/v2/models/mute_rule.rb new file mode 100644 index 000000000000..ae5c887fd03c --- /dev/null +++ b/lib/datadog_api_client/v2/models/mute_rule.rb @@ -0,0 +1,166 @@ +=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 + # Mute rules are used to proactively filter out known false positives or accepted risks. + # A mute rule is composed of a rule UUID, a rule type, and the rule attributes. All fields are required. + class MuteRule + include BaseGenericModel + + # Attributes of the mute rule + attr_reader :attributes + + # The ID of a pipeline rule + attr_reader :id + + # The pipeline rule type associated to mute rules + 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' => :'MuteRuleAttributes', + :'id' => :'UUID', + :'type' => :'MuteRulesType' + } + 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::MuteRule` 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/mute_rule_attributes.rb b/lib/datadog_api_client/v2/models/mute_rule_attributes.rb new file mode 100644 index 000000000000..cfcf7f2f36aa --- /dev/null +++ b/lib/datadog_api_client/v2/models/mute_rule_attributes.rb @@ -0,0 +1,273 @@ +=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 the mute rule + class MuteRuleAttributes + include BaseGenericModel + + # Action of the mute rule + attr_reader :action + + # Date as Unix timestamp in milliseconds + attr_reader :created_at + + # User creating or modifying a rule + attr_reader :created_by + + # Field used to enable or disable the rule. + attr_reader :enabled + + # Date as Unix timestamp in milliseconds + attr_reader :modified_at + + # User creating or modifying a rule + attr_reader :modified_by + + # Name of the pipeline rule + attr_reader :name + + # The definition of an automation pipeline rule scope. + # A rule can act on specific issue types, security rule types, security rule IDs, rule severities, or a query. + # The query can be used to filter resources on tags and attributes. + # The issue type and rule types fields are required. + attr_reader :rule + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'action' => :'action', + :'created_at' => :'created_at', + :'created_by' => :'created_by', + :'enabled' => :'enabled', + :'modified_at' => :'modified_at', + :'modified_by' => :'modified_by', + :'name' => :'name', + :'rule' => :'rule' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'action' => :'ActionMute', + :'created_at' => :'Integer', + :'created_by' => :'RuleUser', + :'enabled' => :'Boolean', + :'modified_at' => :'Integer', + :'modified_by' => :'RuleUser', + :'name' => :'String', + :'rule' => :'Rule' + } + 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::MuteRuleAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'action') + self.action = attributes[:'action'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'created_by') + self.created_by = attributes[:'created_by'] + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'modified_by') + self.modified_by = attributes[:'modified_by'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'rule') + self.rule = attributes[:'rule'] + 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 @action.nil? + return false if @created_at.nil? + return false if @created_by.nil? + return false if @enabled.nil? + return false if @modified_at.nil? + return false if @modified_by.nil? + return false if @name.nil? + return false if @rule.nil? + true + end + + # Custom attribute writer method with validation + # @param action [Object] Object to be assigned + # @!visibility private + def action=(action) + if action.nil? + fail ArgumentError, 'invalid value for "action", action cannot be nil.' + end + @action = action + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param created_by [Object] Object to be assigned + # @!visibility private + def created_by=(created_by) + if created_by.nil? + fail ArgumentError, 'invalid value for "created_by", created_by cannot be nil.' + end + @created_by = created_by + end + + # Custom attribute writer method with validation + # @param enabled [Object] Object to be assigned + # @!visibility private + def enabled=(enabled) + if enabled.nil? + fail ArgumentError, 'invalid value for "enabled", enabled cannot be nil.' + end + @enabled = enabled + end + + # Custom attribute writer method with validation + # @param modified_at [Object] Object to be assigned + # @!visibility private + def modified_at=(modified_at) + if modified_at.nil? + fail ArgumentError, 'invalid value for "modified_at", modified_at cannot be nil.' + end + @modified_at = modified_at + end + + # Custom attribute writer method with validation + # @param modified_by [Object] Object to be assigned + # @!visibility private + def modified_by=(modified_by) + if modified_by.nil? + fail ArgumentError, 'invalid value for "modified_by", modified_by cannot be nil.' + end + @modified_by = modified_by + 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 rule [Object] Object to be assigned + # @!visibility private + def rule=(rule) + if rule.nil? + fail ArgumentError, 'invalid value for "rule", rule cannot be nil.' + end + @rule = rule + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + action == o.action && + created_at == o.created_at && + created_by == o.created_by && + enabled == o.enabled && + modified_at == o.modified_at && + modified_by == o.modified_by && + name == o.name && + rule == o.rule && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [action, created_at, created_by, enabled, modified_at, modified_by, name, rule, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/mute_rule_response.rb b/lib/datadog_api_client/v2/models/mute_rule_response.rb new file mode 100644 index 000000000000..f67c7e637e32 --- /dev/null +++ b/lib/datadog_api_client/v2/models/mute_rule_response.rb @@ -0,0 +1,107 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response object which includes a mute rule. + class MuteRuleResponse + include BaseGenericModel + + # Mute rules are used to proactively filter out known false positives or accepted risks. + # A mute rule is composed of a rule UUID, a rule type, and the rule attributes. All fields are required. + # + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'MuteRule' + } + 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::MuteRuleResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/mute_rules_type.rb b/lib/datadog_api_client/v2/models/mute_rules_type.rb new file mode 100644 index 000000000000..02a014220993 --- /dev/null +++ b/lib/datadog_api_client/v2/models/mute_rules_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 pipeline rule type associated to mute rules + class MuteRulesType + include BaseEnumModel + + MUTE_RULES = "mute_rules".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/patch_inbox_rules_parameters.rb b/lib/datadog_api_client/v2/models/patch_inbox_rules_parameters.rb new file mode 100644 index 000000000000..274066eacc0d --- /dev/null +++ b/lib/datadog_api_client/v2/models/patch_inbox_rules_parameters.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Body of the inbox rule patch request + class PatchInboxRulesParameters + include BaseGenericModel + + # Data of the inbox rule patch request: the rule UUID, the rule type, and the rule attributes. All fields are required. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'PatchInboxRulesParametersData' + } + 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::PatchInboxRulesParameters` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/patch_inbox_rules_parameters_data.rb b/lib/datadog_api_client/v2/models/patch_inbox_rules_parameters_data.rb new file mode 100644 index 000000000000..a0354cf21b49 --- /dev/null +++ b/lib/datadog_api_client/v2/models/patch_inbox_rules_parameters_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data of the inbox rule patch request: the rule UUID, the rule type, and the rule attributes. All fields are required. + class PatchInboxRulesParametersData + include BaseGenericModel + + # Attributes of the inbox rule patch request: the rule name, the rule details, the associated action, and the enabled field. + attr_reader :attributes + + # The ID of a pipeline rule + attr_reader :id + + # The pipeline rule type associated to inbox rules + 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' => :'PatchInboxRulesParametersDataAttributes', + :'id' => :'UUID', + :'type' => :'InboxRulesType' + } + 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::PatchInboxRulesParametersData` 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/patch_inbox_rules_parameters_data_attributes.rb b/lib/datadog_api_client/v2/models/patch_inbox_rules_parameters_data_attributes.rb new file mode 100644 index 000000000000..367df7ac7fed --- /dev/null +++ b/lib/datadog_api_client/v2/models/patch_inbox_rules_parameters_data_attributes.rb @@ -0,0 +1,138 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of the inbox rule patch request: the rule name, the rule details, the associated action, and the enabled field. + class PatchInboxRulesParametersDataAttributes + include BaseGenericModel + + # Action of the inbox rule + attr_accessor :action + + # Field used to enable or disable the rule. + attr_accessor :enabled + + # Name of the pipeline rule + attr_accessor :name + + # The definition of an automation pipeline rule scope. + # A rule can act on specific issue types, security rule types, security rule IDs, rule severities, or a query. + # The query can be used to filter resources on tags and attributes. + # The issue type and rule types fields are required. + attr_accessor :rule + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'action' => :'action', + :'enabled' => :'enabled', + :'name' => :'name', + :'rule' => :'rule' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'action' => :'ActionInbox', + :'enabled' => :'Boolean', + :'name' => :'String', + :'rule' => :'Rule' + } + 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::PatchInboxRulesParametersDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'action') + self.action = attributes[:'action'] + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'rule') + self.rule = attributes[:'rule'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + action == o.action && + enabled == o.enabled && + name == o.name && + rule == o.rule && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [action, enabled, name, rule, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/patch_mute_rule_parameters.rb b/lib/datadog_api_client/v2/models/patch_mute_rule_parameters.rb new file mode 100644 index 000000000000..c88898c81691 --- /dev/null +++ b/lib/datadog_api_client/v2/models/patch_mute_rule_parameters.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Body of the mute rule patch request + class PatchMuteRuleParameters + include BaseGenericModel + + # Data of the mute rule patch request: the rule UUID, the rule type, and the rule attributes. All fields are required. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'PatchMuteRuleParametersData' + } + 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::PatchMuteRuleParameters` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/patch_mute_rule_parameters_data.rb b/lib/datadog_api_client/v2/models/patch_mute_rule_parameters_data.rb new file mode 100644 index 000000000000..4fe1a5e12bcd --- /dev/null +++ b/lib/datadog_api_client/v2/models/patch_mute_rule_parameters_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data of the mute rule patch request: the rule UUID, the rule type, and the rule attributes. All fields are required. + class PatchMuteRuleParametersData + include BaseGenericModel + + # Attributes of the mute rule patch request: the rule name, the rule details, the associated action, and the enabled field. + attr_reader :attributes + + # The ID of a pipeline rule + attr_reader :id + + # The pipeline rule type associated to mute rules + 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' => :'PatchMuteRuleParametersDataAttributes', + :'id' => :'UUID', + :'type' => :'MuteRulesType' + } + 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::PatchMuteRuleParametersData` 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/patch_mute_rule_parameters_data_attributes.rb b/lib/datadog_api_client/v2/models/patch_mute_rule_parameters_data_attributes.rb new file mode 100644 index 000000000000..ae20cd83521d --- /dev/null +++ b/lib/datadog_api_client/v2/models/patch_mute_rule_parameters_data_attributes.rb @@ -0,0 +1,138 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of the mute rule patch request: the rule name, the rule details, the associated action, and the enabled field. + class PatchMuteRuleParametersDataAttributes + include BaseGenericModel + + # Action of the mute rule + attr_accessor :action + + # Field used to enable or disable the rule. + attr_accessor :enabled + + # Name of the pipeline rule + attr_accessor :name + + # The definition of an automation pipeline rule scope. + # A rule can act on specific issue types, security rule types, security rule IDs, rule severities, or a query. + # The query can be used to filter resources on tags and attributes. + # The issue type and rule types fields are required. + attr_accessor :rule + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'action' => :'action', + :'enabled' => :'enabled', + :'name' => :'name', + :'rule' => :'rule' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'action' => :'ActionMute', + :'enabled' => :'Boolean', + :'name' => :'String', + :'rule' => :'Rule' + } + 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::PatchMuteRuleParametersDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'action') + self.action = attributes[:'action'] + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'rule') + self.rule = attributes[:'rule'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + action == o.action && + enabled == o.enabled && + name == o.name && + rule == o.rule && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [action, enabled, name, rule, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/reorder_inbox_rules_parameters.rb b/lib/datadog_api_client/v2/models/reorder_inbox_rules_parameters.rb new file mode 100644 index 000000000000..6af49b0ef23c --- /dev/null +++ b/lib/datadog_api_client/v2/models/reorder_inbox_rules_parameters.rb @@ -0,0 +1,107 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Body of the inbox rule reorder request: the full list of inbox rules needs to be provided in the new order. + class ReorderInboxRulesParameters + include BaseGenericModel + + # The `ReorderInboxRulesParameters` `data`. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ReorderInboxRulesParameters` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/reorder_inbox_rules_parameters_data.rb b/lib/datadog_api_client/v2/models/reorder_inbox_rules_parameters_data.rb new file mode 100644 index 000000000000..717515a9d6d2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/reorder_inbox_rules_parameters_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data of the inbox rule reorder request: the rule UUID, the rule type, and the rule attributes. All fields are required. + class ReorderInboxRulesParametersData + include BaseGenericModel + + # The ID of a pipeline rule + attr_reader :id + + # The pipeline rule type associated to inbox rules + 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' => :'UUID', + :'type' => :'InboxRulesType' + } + 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::ReorderInboxRulesParametersData` 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/reorder_mute_rules_parameters.rb b/lib/datadog_api_client/v2/models/reorder_mute_rules_parameters.rb new file mode 100644 index 000000000000..526a1b96fae1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/reorder_mute_rules_parameters.rb @@ -0,0 +1,107 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Body of the mute rule reorder request: the full list of mute rules needs to be provided in the new order. + class ReorderMuteRulesParameters + include BaseGenericModel + + # The `ReorderMuteRulesParameters` `data`. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ReorderMuteRulesParameters` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/reorder_mute_rules_parameters_data.rb b/lib/datadog_api_client/v2/models/reorder_mute_rules_parameters_data.rb new file mode 100644 index 000000000000..aa4d98f03695 --- /dev/null +++ b/lib/datadog_api_client/v2/models/reorder_mute_rules_parameters_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data of the mute rule reorder request: a rule UUID and its type. All fields are required. + class ReorderMuteRulesParametersData + include BaseGenericModel + + # The ID of a pipeline rule + attr_reader :id + + # The pipeline rule type associated to mute rules + 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' => :'UUID', + :'type' => :'MuteRulesType' + } + 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::ReorderMuteRulesParametersData` 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/rule.rb b/lib/datadog_api_client/v2/models/rule.rb new file mode 100644 index 000000000000..7b24a9c87cab --- /dev/null +++ b/lib/datadog_api_client/v2/models/rule.rb @@ -0,0 +1,183 @@ +=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 an automation pipeline rule scope. + # A rule can act on specific issue types, security rule types, security rule IDs, rule severities, or a query. + # The query can be used to filter resources on tags and attributes. + # The issue type and rule types fields are required. + class Rule + include BaseGenericModel + + # The type of issues on which the rule applies + attr_reader :issue_type + + # The query is composed of one or several key:value pairs, which can be used to filter resources on tags and attributes. + attr_accessor :query + + # Security rule ids + attr_accessor :rule_ids + + # Security rule types + attr_reader :rule_types + + # The security rules severities to consider + attr_accessor :severities + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'issue_type' => :'issue_type', + :'query' => :'query', + :'rule_ids' => :'rule_ids', + :'rule_types' => :'rule_types', + :'severities' => :'severities' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'issue_type' => :'IssueType', + :'query' => :'String', + :'rule_ids' => :'Array', + :'rule_types' => :'Array', + :'severities' => :'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::Rule` 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?(:'issue_type') + self.issue_type = attributes[:'issue_type'] + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + + if attributes.key?(:'rule_ids') + if (value = attributes[:'rule_ids']).is_a?(Array) + self.rule_ids = value + end + end + + if attributes.key?(:'rule_types') + if (value = attributes[:'rule_types']).is_a?(Array) + self.rule_types = value + end + end + + if attributes.key?(:'severities') + if (value = attributes[:'severities']).is_a?(Array) + self.severities = 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 @issue_type.nil? + return false if @rule_types.nil? + true + end + + # Custom attribute writer method with validation + # @param issue_type [Object] Object to be assigned + # @!visibility private + def issue_type=(issue_type) + if issue_type.nil? + fail ArgumentError, 'invalid value for "issue_type", issue_type cannot be nil.' + end + @issue_type = issue_type + end + + # Custom attribute writer method with validation + # @param rule_types [Object] Object to be assigned + # @!visibility private + def rule_types=(rule_types) + if rule_types.nil? + fail ArgumentError, 'invalid value for "rule_types", rule_types cannot be nil.' + end + @rule_types = rule_types + 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 && + issue_type == o.issue_type && + query == o.query && + rule_ids == o.rule_ids && + rule_types == o.rule_types && + severities == o.severities && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [issue_type, query, rule_ids, rule_types, severities, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/rule_severity.rb b/lib/datadog_api_client/v2/models/rule_severity.rb new file mode 100644 index 000000000000..c1d6bae9525b --- /dev/null +++ b/lib/datadog_api_client/v2/models/rule_severity.rb @@ -0,0 +1,31 @@ +=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 + # Severity of a security rule + class RuleSeverity + include BaseEnumModel + + CRITICAL = "critical".freeze + HIGH = "high".freeze + MEDIUM = "medium".freeze + LOW = "low".freeze + UNKNOWN = "unknown".freeze + INFO = "info".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/rule_types_items.rb b/lib/datadog_api_client/v2/models/rule_types_items.rb new file mode 100644 index 000000000000..d18a18614d04 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rule_types_items.rb @@ -0,0 +1,33 @@ +=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 + # Security rule type + class RuleTypesItems + include BaseEnumModel + + APPLICATION_CODE_VULNERABILITY = "application_code_vulnerability".freeze + APPLICATION_LIBRARY_VULNERABILITY = "application_library_vulnerability".freeze + ATTACK_PATH = "attack_path".freeze + CONTAINER_IMAGE_VULNERABILITY = "container_image_vulnerability".freeze + HOST_VULNERABILITY = "host_vulnerability".freeze + IDENTITY_RISK = "identity_risk".freeze + MISCONFIGURATION = "misconfiguration".freeze + API_SECURITY = "api_security".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/rule_user.rb b/lib/datadog_api_client/v2/models/rule_user.rb new file mode 100644 index 000000000000..6ad76279b479 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rule_user.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # User creating or modifying a rule + class RuleUser + include BaseGenericModel + + # The user handle. + attr_accessor :handle + + # The user name. + attr_accessor :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'handle' => :'handle', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'handle' => :'String', + :'name' => :'String' + } + end + + # 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::RuleUser` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'handle') + self.handle = attributes[:'handle'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + handle == o.handle && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [handle, name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/update_inbox_rule_parameters.rb b/lib/datadog_api_client/v2/models/update_inbox_rule_parameters.rb new file mode 100644 index 000000000000..6bd3dd447ec0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_inbox_rule_parameters.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Body of the inbox rule update request + class UpdateInboxRuleParameters + include BaseGenericModel + + # Data of the inbox rule update request: the rule id, the rule type, and the rule attributes. All fields are required. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'UpdateInboxRuleParametersData' + } + 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::UpdateInboxRuleParameters` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/update_inbox_rule_parameters_data.rb b/lib/datadog_api_client/v2/models/update_inbox_rule_parameters_data.rb new file mode 100644 index 000000000000..da6f05de99cd --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_inbox_rule_parameters_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data of the inbox rule update request: the rule id, the rule type, and the rule attributes. All fields are required. + class UpdateInboxRuleParametersData + include BaseGenericModel + + # Attributes of the inbox rule create request: the rule name, the rule details, the associated action, and the optional enabled field. + attr_reader :attributes + + # The ID of a pipeline rule + attr_reader :id + + # The pipeline rule type associated to inbox rules + 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' => :'CreateInboxRuleParametersDataAttributes', + :'id' => :'UUID', + :'type' => :'InboxRulesType' + } + 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::UpdateInboxRuleParametersData` 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/update_mute_rule_parameters.rb b/lib/datadog_api_client/v2/models/update_mute_rule_parameters.rb new file mode 100644 index 000000000000..f0a8fda56fea --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_mute_rule_parameters.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Body of the mute rule update request + class UpdateMuteRuleParameters + include BaseGenericModel + + # Data of the mute rule update request: the rule id, the rule type, and the rule attributes. All fields are required. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'UpdateMuteRuleParametersData' + } + 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::UpdateMuteRuleParameters` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/update_mute_rule_parameters_data.rb b/lib/datadog_api_client/v2/models/update_mute_rule_parameters_data.rb new file mode 100644 index 000000000000..cfec58278ee5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/update_mute_rule_parameters_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data of the mute rule update request: the rule id, the rule type, and the rule attributes. All fields are required. + class UpdateMuteRuleParametersData + include BaseGenericModel + + # Attributes of the mute rule create request: the rule name, the rule details, the associated action, and the optional enabled field. + attr_reader :attributes + + # The ID of a pipeline rule + attr_reader :id + + # The pipeline rule type associated to mute rules + 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' => :'CreateMuteRuleParametersDataAttributes', + :'id' => :'UUID', + :'type' => :'MuteRulesType' + } + 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::UpdateMuteRuleParametersData` 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