diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 6e5d1e26206..de9b3ca4f4d 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -5072,6 +5072,20 @@ components: type: string x-enum-varnames: - ARBITRARY_RULE + Argument: + properties: + description: + description: Base64-encoded argument description + example: YXJndW1lbnQgZGVzY3JpcHRpb24= + type: string + name: + description: Base64-encoded argument name + example: YXJndW1lbnRfbmFtZQ== + type: string + required: + - name + - description + type: object AsanaAccessToken: description: The definition of the `AsanaAccessToken` object. properties: @@ -9229,6 +9243,10 @@ components: $ref: '#/components/schemas/ServiceNowTicket' status: $ref: '#/components/schemas/CaseStatus' + status_group: + $ref: '#/components/schemas/CaseStatusGroup' + status_name: + $ref: '#/components/schemas/CaseStatusName' title: description: Title example: Memory leak investigation on API @@ -9295,6 +9313,8 @@ components: type: string priority: $ref: '#/components/schemas/CasePriority' + status_name: + $ref: '#/components/schemas/CaseStatusName' title: description: Title example: Security breach investigation @@ -9463,7 +9483,9 @@ components: - PRIORITY - STATUS CaseStatus: - description: Case status + deprecated: true + description: Deprecated way of representing the case status, which only supports + OPEN, IN_PROGRESS, and CLOSED statuses. Use `status_name` instead. enum: - OPEN - IN_PROGRESS @@ -9474,6 +9496,23 @@ components: - OPEN - IN_PROGRESS - CLOSED + CaseStatusGroup: + description: Status group of the case. + enum: + - SG_OPEN + - SG_IN_PROGRESS + - SG_CLOSED + example: SG_OPEN + type: string + x-enum-varnames: + - SG_OPEN + - SG_IN_PROGRESS + - SG_CLOSED + CaseStatusName: + description: Status of the case. Must be one of the existing statuses for the + case's type. + example: Open + type: string CaseTrigger: description: Trigger a workflow from a Case. For automatic triggering a handle must be configured and the workflow must be published. @@ -9697,8 +9736,9 @@ components: properties: status: $ref: '#/components/schemas/CaseStatus' - required: - - status + deprecated: true + status_name: + $ref: '#/components/schemas/CaseStatusName' type: object CaseUpdateStatusRequest: description: Case update status request @@ -13738,7 +13778,8 @@ components: description: Attributes of the Jira issue to create. properties: assignee_id: - description: Unique identifier of the user assigned to the Jira issue. + description: Unique identifier of the Datadog user assigned to the Jira + issue. example: f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0 type: string description: @@ -13759,8 +13800,9 @@ components: type: object priority: $ref: '#/components/schemas/CasePriority' - description: Priority of the Jira issue. If not provided, the priority will - be automatically set to "NOT_DEFINED". + description: Datadog case priority mapped to the Jira issue priority. If + not provided, the priority will be automatically set to "NOT_DEFINED". + To configure the mapping, see [Bidirectional ticket syncing with Jira](https://docs.datadoghq.com/security/ticketing_integrations/#bidirectional-ticket-syncing-with-jira). example: P4 title: description: Title of the Jira issue. If not provided, the title will be @@ -16371,6 +16413,482 @@ components: - version - name type: object + CustomRule: + properties: + created_at: + description: Creation timestamp + example: '2026-01-09T13:00:57.473141Z' + format: date-time + type: string + created_by: + description: Creator identifier + example: foobarbaz + type: string + last_revision: + $ref: '#/components/schemas/CustomRuleRevision' + description: Most recent revision + nullable: true + name: + description: Rule name + example: my-rule + type: string + required: + - name + - created_at + - created_by + - last_revision + type: object + CustomRuleDataType: + description: Resource type + enum: + - custom_rule + example: custom_rule + type: string + x-enum-varnames: + - CUSTOM_RULE + CustomRuleRequest: + properties: + data: + $ref: '#/components/schemas/CustomRuleRequestData' + type: object + CustomRuleRequestData: + properties: + attributes: + $ref: '#/components/schemas/CustomRuleRequestDataAttributes' + id: + description: Rule identifier + type: string + type: + $ref: '#/components/schemas/CustomRuleDataType' + type: object + CustomRuleRequestDataAttributes: + properties: + name: + description: Rule name + type: string + type: object + CustomRuleResponse: + properties: + data: + $ref: '#/components/schemas/CustomRuleResponseData' + required: + - data + type: object + CustomRuleResponseData: + properties: + attributes: + $ref: '#/components/schemas/CustomRule' + id: + description: Rule identifier + example: my-rule + type: string + type: + $ref: '#/components/schemas/CustomRuleDataType' + required: + - id + - type + - attributes + type: object + CustomRuleRevision: + properties: + attributes: + $ref: '#/components/schemas/CustomRuleRevisionAttributes' + id: + description: Revision identifier + example: revision-123 + type: string + type: + $ref: '#/components/schemas/CustomRuleRevisionDataType' + required: + - id + - type + - attributes + type: object + CustomRuleRevisionAttributes: + properties: + arguments: + description: Rule arguments + items: + $ref: '#/components/schemas/Argument' + type: array + category: + $ref: '#/components/schemas/CustomRuleRevisionAttributesCategory' + checksum: + description: Code checksum + example: 8a66c4e4e631099ad71be3c1ea3ea8fc2d57193e56db2c296e2dd8a508b26b99 + type: string + code: + description: Rule code + example: Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ== + type: string + created_at: + description: Creation timestamp + example: '2026-01-09T13:00:57.473141Z' + format: date-time + type: string + created_by: + description: Creator identifier + example: foobarbaz + type: string + creation_message: + description: Revision creation message + example: Initial revision + type: string + cve: + description: Associated CVE + example: CVE-2024-1234 + nullable: true + type: string + cwe: + description: Associated CWE + example: CWE-79 + nullable: true + type: string + description: + description: Full description + example: bG9uZyBkZXNjcmlwdGlvbg== + type: string + documentation_url: + description: Documentation URL + example: https://docs.example.com/rules/my-rule + nullable: true + type: string + is_published: + description: Whether the revision is published + example: false + type: boolean + is_testing: + description: Whether this is a testing revision + example: false + type: boolean + language: + $ref: '#/components/schemas/Language' + severity: + $ref: '#/components/schemas/CustomRuleRevisionAttributesSeverity' + short_description: + description: Short description + example: c2hvcnQgZGVzY3JpcHRpb24= + type: string + should_use_ai_fix: + description: Whether to use AI for fixes + example: false + type: boolean + tags: + description: Rule tags + example: + - security + - custom + items: + type: string + type: array + tests: + description: Rule tests + items: + $ref: '#/components/schemas/CustomRuleRevisionTest' + type: array + tree_sitter_query: + description: Tree-sitter query + example: Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ== + type: string + required: + - creation_message + - short_description + - description + - code + - checksum + - language + - tree_sitter_query + - created_at + - created_by + - severity + - category + - cve + - cwe + - arguments + - tests + - tags + - is_published + - should_use_ai_fix + - documentation_url + - is_testing + type: object + CustomRuleRevisionAttributesCategory: + description: Rule category + enum: + - SECURITY + - BEST_PRACTICES + - CODE_STYLE + - ERROR_PRONE + - PERFORMANCE + example: SECURITY + type: string + x-enum-varnames: + - SECURITY + - BEST_PRACTICES + - CODE_STYLE + - ERROR_PRONE + - PERFORMANCE + CustomRuleRevisionAttributesSeverity: + description: Rule severity + enum: + - ERROR + - WARNING + - NOTICE + example: ERROR + type: string + x-enum-varnames: + - ERROR + - WARNING + - NOTICE + CustomRuleRevisionDataType: + description: Resource type + enum: + - custom_rule_revision + example: custom_rule_revision + type: string + x-enum-varnames: + - CUSTOM_RULE_REVISION + CustomRuleRevisionInputAttributes: + properties: + arguments: + description: Rule arguments + items: + $ref: '#/components/schemas/Argument' + type: array + category: + $ref: '#/components/schemas/CustomRuleRevisionAttributesCategory' + code: + description: Rule code + example: Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ== + type: string + creation_message: + description: Revision creation message + example: Initial revision + type: string + cve: + description: Associated CVE + example: CVE-2024-1234 + nullable: true + type: string + cwe: + description: Associated CWE + example: CWE-79 + nullable: true + type: string + description: + description: Full description + example: bG9uZyBkZXNjcmlwdGlvbg== + type: string + documentation_url: + description: Documentation URL + example: https://docs.example.com/rules/my-rule + nullable: true + type: string + is_published: + description: Whether the revision is published + example: false + type: boolean + is_testing: + description: Whether this is a testing revision + example: false + type: boolean + language: + $ref: '#/components/schemas/Language' + severity: + $ref: '#/components/schemas/CustomRuleRevisionAttributesSeverity' + short_description: + description: Short description + example: c2hvcnQgZGVzY3JpcHRpb24= + type: string + should_use_ai_fix: + description: Whether to use AI for fixes + example: false + type: boolean + tags: + description: Rule tags + example: + - security + - custom + items: + type: string + type: array + tests: + description: Rule tests + items: + $ref: '#/components/schemas/CustomRuleRevisionTest' + type: array + tree_sitter_query: + description: Tree-sitter query + example: Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ== + type: string + required: + - creation_message + - short_description + - description + - code + - language + - tree_sitter_query + - severity + - category + - cve + - cwe + - arguments + - tests + - tags + - is_published + - should_use_ai_fix + - documentation_url + - is_testing + type: object + CustomRuleRevisionRequest: + properties: + data: + $ref: '#/components/schemas/CustomRuleRevisionRequestData' + type: object + CustomRuleRevisionRequestData: + properties: + attributes: + $ref: '#/components/schemas/CustomRuleRevisionInputAttributes' + id: + description: Revision identifier + type: string + type: + $ref: '#/components/schemas/CustomRuleRevisionDataType' + type: object + CustomRuleRevisionResponse: + properties: + data: + $ref: '#/components/schemas/CustomRuleRevision' + required: + - data + type: object + CustomRuleRevisionTest: + properties: + annotation_count: + description: Expected violation count + example: 1 + format: int64 + type: integer + code: + description: Test code + example: Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ== + type: string + filename: + description: Test filename + example: test.yaml + type: string + required: + - filename + - code + - annotation_count + type: object + CustomRuleRevisionsResponse: + properties: + data: + items: + $ref: '#/components/schemas/CustomRuleRevision' + type: array + type: object + CustomRuleset: + properties: + attributes: + $ref: '#/components/schemas/CustomRulesetAttributes' + id: + description: Ruleset identifier + example: my-ruleset + type: string + type: + $ref: '#/components/schemas/CustomRulesetDataType' + required: + - id + - type + - attributes + type: object + CustomRulesetAttributes: + properties: + created_at: + description: Creation timestamp + example: '2026-01-09T13:00:57.473141Z' + format: date-time + type: string + created_by: + description: Creator identifier + example: foobarbaz + type: string + description: + description: Base64-encoded full description + example: bG9uZyBkZXNjcmlwdGlvbg== + type: string + name: + description: Ruleset name + example: my-ruleset + type: string + rules: + description: Rules in the ruleset + items: + $ref: '#/components/schemas/CustomRule' + nullable: true + type: array + short_description: + description: Base64-encoded short description + example: c2hvcnQgZGVzY3JpcHRpb24= + type: string + required: + - name + - short_description + - description + - created_at + - created_by + - rules + type: object + CustomRulesetDataType: + description: Resource type + enum: + - custom_ruleset + example: custom_ruleset + type: string + x-enum-varnames: + - CUSTOM_RULESET + CustomRulesetRequest: + properties: + data: + $ref: '#/components/schemas/CustomRulesetRequestData' + type: object + CustomRulesetRequestData: + properties: + attributes: + $ref: '#/components/schemas/CustomRulesetRequestDataAttributes' + id: + description: Ruleset identifier + type: string + type: + $ref: '#/components/schemas/CustomRulesetDataType' + type: object + CustomRulesetRequestDataAttributes: + properties: + description: + description: Base64-encoded full description + type: string + name: + description: Ruleset name + type: string + rules: + description: Rules in the ruleset + items: + $ref: '#/components/schemas/CustomRule' + nullable: true + type: array + short_description: + description: Base64-encoded short description + type: string + type: object + CustomRulesetResponse: + properties: + data: + $ref: '#/components/schemas/CustomRuleset' + required: + - data + type: object DORACustomTags: description: A list of user-defined tags. The tags must follow the `key:value` pattern. Up to 100 may be added per event. @@ -31240,6 +31758,34 @@ components: format: int64 type: integer type: object + Language: + description: Programming language + enum: + - PYTHON + - JAVASCRIPT + - TYPESCRIPT + - JAVA + - GO + - YAML + - RUBY + - CSHARP + - PHP + - KOTLIN + - SWIFT + example: PYTHON + type: string + x-enum-varnames: + - PYTHON + - JAVASCRIPT + - TYPESCRIPT + - JAVA + - GO + - YAML + - RUBY + - CSHARP + - PHP + - KOTLIN + - SWIFT LaunchDarklyAPIKey: description: The definition of the `LaunchDarklyAPIKey` object. properties: @@ -47012,6 +47558,37 @@ components: - interval - maxRetries type: object + RevertCustomRuleRevisionDataType: + description: Request type + enum: + - revert_custom_rule_revision_request + type: string + x-enum-varnames: + - REVERT_CUSTOM_RULE_REVISION_REQUEST + RevertCustomRuleRevisionRequest: + properties: + data: + $ref: '#/components/schemas/RevertCustomRuleRevisionRequestData' + type: object + RevertCustomRuleRevisionRequestData: + properties: + attributes: + $ref: '#/components/schemas/RevertCustomRuleRevisionRequestDataAttributes' + id: + description: Request identifier + type: string + type: + $ref: '#/components/schemas/RevertCustomRuleRevisionDataType' + type: object + RevertCustomRuleRevisionRequestDataAttributes: + properties: + currentRevision: + description: Current revision ID + type: string + revertToRevision: + description: Target revision ID to revert to + type: string + type: object Role: description: Role object returned by the API. properties: @@ -87244,9 +87821,6 @@ paths: permissions: - security_monitoring_findings_write - appsec_vm_write - x-unstable: '**Note**: This endpoint is in beta and is subject to change. - - Please check the documentation regularly for updates.' post: description: 'Create Jira issues for security findings. @@ -87290,9 +87864,6 @@ paths: permissions: - security_monitoring_findings_write - appsec_vm_write - x-unstable: '**Note**: This endpoint is in beta and is subject to change. - - Please check the documentation regularly for updates.' /api/v2/security/findings/search: post: description: 'Get a list of security findings that match a search query. [See @@ -92061,6 +92632,514 @@ paths: tags: - Static Analysis x-unstable: '**Note**: This endpoint may be subject to changes.' + /api/v2/static-analysis/custom/rulesets/{ruleset_name}: + delete: + description: Delete a custom ruleset + operationId: DeleteCustomRuleset + parameters: + - description: The ruleset name + in: path + name: ruleset_name + required: true + schema: + type: string + responses: + '200': + description: Successfully deleted + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Unauthorized - custom rules not enabled + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Ruleset not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete Custom Ruleset + tags: + - Static Analysis + x-unstable: 'This endpoint is in Preview and may introduce breaking changes. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + get: + description: Get a custom ruleset by name + operationId: GetCustomRuleset + parameters: + - description: The ruleset name + in: path + name: ruleset_name + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CustomRulesetResponse' + description: Successful response + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Unauthorized - custom rules not enabled + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Ruleset not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Show Custom Ruleset + tags: + - Static Analysis + x-unstable: 'This endpoint is in Preview and may introduce breaking changes. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + patch: + description: Update an existing custom ruleset + operationId: UpdateCustomRuleset + parameters: + - description: The ruleset name + in: path + name: ruleset_name + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CustomRulesetRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CustomRulesetResponse' + description: Successfully updated + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Unauthorized - custom rules not enabled + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Precondition failed - validation error or ruleset not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Update Custom Ruleset + tags: + - Static Analysis + x-unstable: 'This endpoint is in Preview and may introduce breaking changes. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules: + put: + description: Create a new custom rule within a ruleset + operationId: CreateCustomRule + parameters: + - description: The ruleset name + in: path + name: ruleset_name + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CustomRuleRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CustomRuleResponse' + description: Successfully created + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Unauthorized - custom rules not enabled + '409': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Conflict - rule already exists + '412': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Precondition failed - validation error or ruleset not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create Custom Rule + tags: + - Static Analysis + x-unstable: 'This endpoint is in Preview and may introduce breaking changes. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}: + delete: + description: Delete a custom rule + operationId: DeleteCustomRule + parameters: + - description: The ruleset name + in: path + name: ruleset_name + required: true + schema: + type: string + - description: The rule name + in: path + name: rule_name + required: true + schema: + type: string + responses: + '200': + description: Successfully deleted + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Unauthorized - custom rules not enabled + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Rule not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Delete Custom Rule + tags: + - Static Analysis + x-unstable: 'This endpoint is in Preview and may introduce breaking changes. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + get: + description: Get a custom rule by name + operationId: GetCustomRule + parameters: + - description: The ruleset name + in: path + name: ruleset_name + required: true + schema: + type: string + - description: The rule name + in: path + name: rule_name + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CustomRuleResponse' + description: Successful response + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Unauthorized - custom rules not enabled + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Rule not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Show Custom Rule + tags: + - Static Analysis + x-unstable: 'This endpoint is in Preview and may introduce breaking changes. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}/revisions: + get: + description: Get all revisions for a custom rule + operationId: ListCustomRuleRevisions + parameters: + - description: The ruleset name + in: path + name: ruleset_name + required: true + schema: + type: string + - description: The rule name + in: path + name: rule_name + required: true + schema: + type: string + - description: Pagination offset + in: query + name: page[offset] + required: false + schema: + default: 0 + type: integer + - description: Pagination limit + in: query + name: page[limit] + required: false + schema: + default: 10 + type: integer + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CustomRuleRevisionsResponse' + description: Successful response + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Unauthorized - custom rules not enabled + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Rule not found + '429': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Too many requests + summary: List Custom Rule Revisions + tags: + - Static Analysis + x-pagination: + limitParam: page[limit] + pageOffsetParam: page[offset] + resultsPath: data + x-unstable: 'This endpoint is in Preview and may introduce breaking changes. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + put: + description: Create a new revision for a custom rule + operationId: CreateCustomRuleRevision + parameters: + - description: The ruleset name + in: path + name: ruleset_name + required: true + schema: + type: string + - description: The rule name + in: path + name: rule_name + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CustomRuleRevisionRequest' + required: true + responses: + '200': + description: Successfully created + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Unauthorized - custom rules not enabled + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Rule not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Create Custom Rule Revision + tags: + - Static Analysis + x-unstable: 'This endpoint is in Preview and may introduce breaking changes. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}/revisions/revert: + post: + description: Revert a custom rule to a previous revision + operationId: RevertCustomRuleRevision + parameters: + - description: The ruleset name + in: path + name: ruleset_name + required: true + schema: + type: string + - description: The rule name + in: path + name: rule_name + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RevertCustomRuleRevisionRequest' + required: true + responses: + '200': + description: Successfully reverted + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Unauthorized - custom rules not enabled + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Revert Custom Rule Revision + tags: + - Static Analysis + x-unstable: 'This endpoint is in Preview and may introduce breaking changes. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + /api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}/revisions/{id}: + get: + description: Get a specific revision of a custom rule + operationId: GetCustomRuleRevision + parameters: + - description: The ruleset name + in: path + name: ruleset_name + required: true + schema: + type: string + - description: The rule name + in: path + name: rule_name + required: true + schema: + type: string + - description: The revision ID + in: path + name: id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CustomRuleRevisionResponse' + description: Successful response + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Bad request + '401': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Unauthorized - custom rules not enabled + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/JSONAPIErrorResponse' + description: Revision not found + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Show Custom Rule Revision + tags: + - Static Analysis + x-unstable: 'This endpoint is in Preview and may introduce breaking changes. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/static-analysis/rulesets: post: description: Get rules for multiple rulesets in batch. diff --git a/api/datadog/configuration.go b/api/datadog/configuration.go index 5789577f8c5..eedca5cf537 100644 --- a/api/datadog/configuration.go +++ b/api/datadog/configuration.go @@ -672,10 +672,8 @@ func NewConfiguration() *Configuration { "v2.GetOpenAPI": false, "v2.ListAPIs": false, "v2.UpdateOpenAPI": false, - "v2.AttachJiraIssue": false, "v2.CancelThreatHuntingJob": false, "v2.ConvertJobResultToSignal": false, - "v2.CreateJiraIssues": false, "v2.DeleteThreatHuntingJob": false, "v2.GetFinding": false, "v2.GetRuleVersionHistory": false, @@ -808,8 +806,18 @@ func NewConfiguration() *Configuration { "v2.GetSLOReportJobStatus": false, "v2.GetSPARecommendations": false, "v2.GetSPARecommendationsWithShard": false, + "v2.CreateCustomRule": false, + "v2.CreateCustomRuleRevision": false, "v2.CreateSCAResolveVulnerableSymbols": false, "v2.CreateSCAResult": false, + "v2.DeleteCustomRule": false, + "v2.DeleteCustomRuleset": false, + "v2.GetCustomRule": false, + "v2.GetCustomRuleRevision": false, + "v2.GetCustomRuleset": false, + "v2.ListCustomRuleRevisions": false, + "v2.RevertCustomRuleRevision": false, + "v2.UpdateCustomRuleset": false, "v2.AddMemberTeam": false, "v2.ListMemberTeams": false, "v2.RemoveMemberTeam": false, diff --git a/api/datadogV2/api_security_monitoring.go b/api/datadogV2/api_security_monitoring.go index d0273cdf0ba..878bbdf8fcf 100644 --- a/api/datadogV2/api_security_monitoring.go +++ b/api/datadogV2/api_security_monitoring.go @@ -112,15 +112,6 @@ func (a *SecurityMonitoringApi) AttachJiraIssue(ctx _context.Context, body Attac localVarReturnValue FindingCaseResponse ) - operationId := "v2.AttachJiraIssue" - isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) - if !isOperationEnabled { - return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} - } - if isOperationEnabled && a.Client.Cfg.Debug { - _log.Printf("WARNING: Using unstable operation '%s'", operationId) - } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.AttachJiraIssue") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} @@ -763,15 +754,6 @@ func (a *SecurityMonitoringApi) CreateJiraIssues(ctx _context.Context, body Crea localVarReturnValue FindingCaseResponseArray ) - operationId := "v2.CreateJiraIssues" - isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) - if !isOperationEnabled { - return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} - } - if isOperationEnabled && a.Client.Cfg.Debug { - _log.Printf("WARNING: Using unstable operation '%s'", operationId) - } - localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.CreateJiraIssues") if err != nil { return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} diff --git a/api/datadogV2/api_static_analysis.go b/api/datadogV2/api_static_analysis.go index 132ad033402..58d1c5a961b 100644 --- a/api/datadogV2/api_static_analysis.go +++ b/api/datadogV2/api_static_analysis.go @@ -17,6 +17,195 @@ import ( // StaticAnalysisApi service type type StaticAnalysisApi datadog.Service +// CreateCustomRule Create Custom Rule. +// Create a new custom rule within a ruleset +func (a *StaticAnalysisApi) CreateCustomRule(ctx _context.Context, rulesetName string, body CustomRuleRequest) (CustomRuleResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarReturnValue CustomRuleResponse + ) + + operationId := "v2.CreateCustomRule" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.StaticAnalysisApi.CreateCustomRule") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{ruleset_name}", _neturl.PathEscape(datadog.ParameterToString(rulesetName, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "application/json" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 409 || localVarHTTPResponse.StatusCode == 412 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// CreateCustomRuleRevision Create Custom Rule Revision. +// Create a new revision for a custom rule +func (a *StaticAnalysisApi) CreateCustomRuleRevision(ctx _context.Context, rulesetName string, ruleName string, body CustomRuleRevisionRequest) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + ) + + operationId := "v2.CreateCustomRuleRevision" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.StaticAnalysisApi.CreateCustomRuleRevision") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}/revisions" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{ruleset_name}", _neturl.PathEscape(datadog.ParameterToString(rulesetName, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{rule_name}", _neturl.PathEscape(datadog.ParameterToString(ruleName, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "*/*" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 404 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + // CreateSCAResolveVulnerableSymbols POST request to resolve vulnerable symbols. func (a *StaticAnalysisApi) CreateSCAResolveVulnerableSymbols(ctx _context.Context, body ResolveVulnerableSymbolsRequest) (ResolveVulnerableSymbolsResponse, *_nethttp.Response, error) { @@ -185,6 +374,835 @@ func (a *StaticAnalysisApi) CreateSCAResult(ctx _context.Context, body ScaReques return localVarHTTPResponse, nil } +// DeleteCustomRule Delete Custom Rule. +// Delete a custom rule +func (a *StaticAnalysisApi) DeleteCustomRule(ctx _context.Context, rulesetName string, ruleName string) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + ) + + operationId := "v2.DeleteCustomRule" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.StaticAnalysisApi.DeleteCustomRule") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{ruleset_name}", _neturl.PathEscape(datadog.ParameterToString(rulesetName, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{rule_name}", _neturl.PathEscape(datadog.ParameterToString(ruleName, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "*/*" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 404 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +// DeleteCustomRuleset Delete Custom Ruleset. +// Delete a custom ruleset +func (a *StaticAnalysisApi) DeleteCustomRuleset(ctx _context.Context, rulesetName string) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + ) + + operationId := "v2.DeleteCustomRuleset" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.StaticAnalysisApi.DeleteCustomRuleset") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/static-analysis/custom/rulesets/{ruleset_name}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{ruleset_name}", _neturl.PathEscape(datadog.ParameterToString(rulesetName, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "*/*" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 404 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +// GetCustomRule Show Custom Rule. +// Get a custom rule by name +func (a *StaticAnalysisApi) GetCustomRule(ctx _context.Context, rulesetName string, ruleName string) (CustomRuleResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue CustomRuleResponse + ) + + operationId := "v2.GetCustomRule" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.StaticAnalysisApi.GetCustomRule") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{ruleset_name}", _neturl.PathEscape(datadog.ParameterToString(rulesetName, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{rule_name}", _neturl.PathEscape(datadog.ParameterToString(ruleName, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 404 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// GetCustomRuleRevision Show Custom Rule Revision. +// Get a specific revision of a custom rule +func (a *StaticAnalysisApi) GetCustomRuleRevision(ctx _context.Context, rulesetName string, ruleName string, id string) (CustomRuleRevisionResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue CustomRuleRevisionResponse + ) + + operationId := "v2.GetCustomRuleRevision" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.StaticAnalysisApi.GetCustomRuleRevision") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}/revisions/{id}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{ruleset_name}", _neturl.PathEscape(datadog.ParameterToString(rulesetName, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{rule_name}", _neturl.PathEscape(datadog.ParameterToString(ruleName, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{id}", _neturl.PathEscape(datadog.ParameterToString(id, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 404 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// GetCustomRuleset Show Custom Ruleset. +// Get a custom ruleset by name +func (a *StaticAnalysisApi) GetCustomRuleset(ctx _context.Context, rulesetName string) (CustomRulesetResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue CustomRulesetResponse + ) + + operationId := "v2.GetCustomRuleset" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.StaticAnalysisApi.GetCustomRuleset") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/static-analysis/custom/rulesets/{ruleset_name}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{ruleset_name}", _neturl.PathEscape(datadog.ParameterToString(rulesetName, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 404 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListCustomRuleRevisionsOptionalParameters holds optional parameters for ListCustomRuleRevisions. +type ListCustomRuleRevisionsOptionalParameters struct { + PageOffset *int32 + PageLimit *int32 +} + +// NewListCustomRuleRevisionsOptionalParameters creates an empty struct for parameters. +func NewListCustomRuleRevisionsOptionalParameters() *ListCustomRuleRevisionsOptionalParameters { + this := ListCustomRuleRevisionsOptionalParameters{} + return &this +} + +// WithPageOffset sets the corresponding parameter name and returns the struct. +func (r *ListCustomRuleRevisionsOptionalParameters) WithPageOffset(pageOffset int32) *ListCustomRuleRevisionsOptionalParameters { + r.PageOffset = &pageOffset + return r +} + +// WithPageLimit sets the corresponding parameter name and returns the struct. +func (r *ListCustomRuleRevisionsOptionalParameters) WithPageLimit(pageLimit int32) *ListCustomRuleRevisionsOptionalParameters { + r.PageLimit = &pageLimit + return r +} + +// ListCustomRuleRevisions List Custom Rule Revisions. +// Get all revisions for a custom rule +func (a *StaticAnalysisApi) ListCustomRuleRevisions(ctx _context.Context, rulesetName string, ruleName string, o ...ListCustomRuleRevisionsOptionalParameters) (CustomRuleRevisionsResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarReturnValue CustomRuleRevisionsResponse + optionalParams ListCustomRuleRevisionsOptionalParameters + ) + + if len(o) > 1 { + return localVarReturnValue, nil, datadog.ReportError("only one argument of type ListCustomRuleRevisionsOptionalParameters is allowed") + } + if len(o) == 1 { + optionalParams = o[0] + } + + operationId := "v2.ListCustomRuleRevisions" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.StaticAnalysisApi.ListCustomRuleRevisions") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}/revisions" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{ruleset_name}", _neturl.PathEscape(datadog.ParameterToString(rulesetName, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{rule_name}", _neturl.PathEscape(datadog.ParameterToString(ruleName, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if optionalParams.PageOffset != nil { + localVarQueryParams.Add("page[offset]", datadog.ParameterToString(*optionalParams.PageOffset, "")) + } + if optionalParams.PageLimit != nil { + localVarQueryParams.Add("page[limit]", datadog.ParameterToString(*optionalParams.PageLimit, "")) + } + localVarHeaderParams["Accept"] = "application/json" + + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// ListCustomRuleRevisionsWithPagination provides a paginated version of ListCustomRuleRevisions returning a channel with all items. +func (a *StaticAnalysisApi) ListCustomRuleRevisionsWithPagination(ctx _context.Context, rulesetName string, ruleName string, o ...ListCustomRuleRevisionsOptionalParameters) (<-chan datadog.PaginationResult[CustomRuleRevision], func()) { + ctx, cancel := _context.WithCancel(ctx) + pageSize_ := int32(10) + if len(o) == 0 { + o = append(o, ListCustomRuleRevisionsOptionalParameters{}) + } + if o[0].PageLimit != nil { + pageSize_ = *o[0].PageLimit + } + o[0].PageLimit = &pageSize_ + + items := make(chan datadog.PaginationResult[CustomRuleRevision], pageSize_) + go func() { + for { + resp, _, err := a.ListCustomRuleRevisions(ctx, rulesetName, ruleName, o...) + if err != nil { + var returnItem CustomRuleRevision + items <- datadog.PaginationResult[CustomRuleRevision]{Item: returnItem, Error: err} + break + } + respData, ok := resp.GetDataOk() + if !ok { + break + } + results := *respData + + for _, item := range results { + select { + case items <- datadog.PaginationResult[CustomRuleRevision]{Item: item, Error: nil}: + case <-ctx.Done(): + close(items) + return + } + } + if len(results) < int(pageSize_) { + break + } + if o[0].PageOffset == nil { + o[0].PageOffset = &pageSize_ + } else { + pageOffset_ := *o[0].PageOffset + pageSize_ + o[0].PageOffset = &pageOffset_ + } + } + close(items) + }() + return items, cancel +} + +// RevertCustomRuleRevision Revert Custom Rule Revision. +// Revert a custom rule to a previous revision +func (a *StaticAnalysisApi) RevertCustomRuleRevision(ctx _context.Context, rulesetName string, ruleName string, body RevertCustomRuleRevisionRequest) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + ) + + operationId := "v2.RevertCustomRuleRevision" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.StaticAnalysisApi.RevertCustomRuleRevision") + if err != nil { + return nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}/revisions/revert" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{ruleset_name}", _neturl.PathEscape(datadog.ParameterToString(rulesetName, ""))) + localVarPath = datadog.ReplacePathParameter(localVarPath, "{rule_name}", _neturl.PathEscape(datadog.ParameterToString(ruleName, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "*/*" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +// UpdateCustomRuleset Update Custom Ruleset. +// Update an existing custom ruleset +func (a *StaticAnalysisApi) UpdateCustomRuleset(ctx _context.Context, rulesetName string, body CustomRulesetRequest) (CustomRulesetResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarReturnValue CustomRulesetResponse + ) + + operationId := "v2.UpdateCustomRuleset" + isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId) + if !isOperationEnabled { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)} + } + if isOperationEnabled && a.Client.Cfg.Debug { + _log.Printf("WARNING: Using unstable operation '%s'", operationId) + } + + localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.StaticAnalysisApi.UpdateCustomRuleset") + if err != nil { + return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/api/v2/static-analysis/custom/rulesets/{ruleset_name}" + localVarPath = datadog.ReplacePathParameter(localVarPath, "{ruleset_name}", _neturl.PathEscape(datadog.ParameterToString(rulesetName, ""))) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + localVarHeaderParams["Content-Type"] = "application/json" + localVarHeaderParams["Accept"] = "application/json" + + // body params + localVarPostBody = &body + if a.Client.Cfg.DelegatedTokenConfig != nil { + err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig) + if err != nil { + return localVarReturnValue, nil, err + } + } else { + datadog.SetAuthKeys( + ctx, + &localVarHeaderParams, + [2]string{"apiKeyAuth", "DD-API-KEY"}, + [2]string{"appKeyAuth", "DD-APPLICATION-KEY"}, + ) + } + req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.Client.CallAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := datadog.ReadBody(localVarHTTPResponse) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 412 { + var v JSONAPIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v APIErrorResponse + err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.ErrorModel = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := datadog.GenericOpenAPIError{ + ErrorBody: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + // NewStaticAnalysisApi Returns NewStaticAnalysisApi. func NewStaticAnalysisApi(client *datadog.APIClient) *StaticAnalysisApi { return &StaticAnalysisApi{ diff --git a/api/datadogV2/doc.go b/api/datadogV2/doc.go index cce1272f34f..c95c81a211e 100644 --- a/api/datadogV2/doc.go +++ b/api/datadogV2/doc.go @@ -678,8 +678,18 @@ // - [SpansMetricsApi.GetSpansMetric] // - [SpansMetricsApi.ListSpansMetrics] // - [SpansMetricsApi.UpdateSpansMetric] +// - [StaticAnalysisApi.CreateCustomRule] +// - [StaticAnalysisApi.CreateCustomRuleRevision] // - [StaticAnalysisApi.CreateSCAResolveVulnerableSymbols] // - [StaticAnalysisApi.CreateSCAResult] +// - [StaticAnalysisApi.DeleteCustomRule] +// - [StaticAnalysisApi.DeleteCustomRuleset] +// - [StaticAnalysisApi.GetCustomRule] +// - [StaticAnalysisApi.GetCustomRuleRevision] +// - [StaticAnalysisApi.GetCustomRuleset] +// - [StaticAnalysisApi.ListCustomRuleRevisions] +// - [StaticAnalysisApi.RevertCustomRuleRevision] +// - [StaticAnalysisApi.UpdateCustomRuleset] // - [StatusPagesApi.CreateComponent] // - [StatusPagesApi.CreateDegradation] // - [StatusPagesApi.CreateStatusPage] diff --git a/api/datadogV2/model_argument.go b/api/datadogV2/model_argument.go new file mode 100644 index 00000000000..df9570e584d --- /dev/null +++ b/api/datadogV2/model_argument.go @@ -0,0 +1,133 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// Argument +type Argument struct { + // Base64-encoded argument description + Description string `json:"description"` + // Base64-encoded argument name + Name string `json:"name"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewArgument instantiates a new Argument object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewArgument(description string, name string) *Argument { + this := Argument{} + this.Description = description + this.Name = name + return &this +} + +// NewArgumentWithDefaults instantiates a new Argument object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewArgumentWithDefaults() *Argument { + this := Argument{} + return &this +} + +// GetDescription returns the Description field value. +func (o *Argument) GetDescription() string { + if o == nil { + var ret string + return ret + } + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *Argument) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value. +func (o *Argument) SetDescription(v string) { + o.Description = v +} + +// GetName returns the Name field value. +func (o *Argument) GetName() string { + if o == nil { + var ret string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Argument) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value. +func (o *Argument) SetName(v string) { + o.Name = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o Argument) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["description"] = o.Description + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *Argument) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Description *string `json:"description"` + Name *string `json:"name"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Description == nil { + return fmt.Errorf("required field description missing") + } + if all.Name == nil { + return fmt.Errorf("required field name missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"description", "name"}) + } else { + return err + } + o.Description = *all.Description + o.Name = *all.Name + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_case_attributes.go b/api/datadogV2/model_case_attributes.go index 4a2f396a30a..763cd7b5a35 100644 --- a/api/datadogV2/model_case_attributes.go +++ b/api/datadogV2/model_case_attributes.go @@ -34,8 +34,13 @@ type CaseAttributes struct { Priority *CasePriority `json:"priority,omitempty"` // ServiceNow ticket attached to case ServiceNowTicket NullableServiceNowTicket `json:"service_now_ticket,omitempty"` - // Case status + // Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use `status_name` instead. + // Deprecated Status *CaseStatus `json:"status,omitempty"` + // Status group of the case. + StatusGroup *CaseStatusGroup `json:"status_group,omitempty"` + // Status of the case. Must be one of the existing statuses for the case's type. + StatusName *string `json:"status_name,omitempty"` // Title Title *string `json:"title,omitempty"` // Case type @@ -433,6 +438,7 @@ func (o *CaseAttributes) UnsetServiceNowTicket() { } // GetStatus returns the Status field value if set, zero value otherwise. +// Deprecated func (o *CaseAttributes) GetStatus() CaseStatus { if o == nil || o.Status == nil { var ret CaseStatus @@ -443,6 +449,7 @@ func (o *CaseAttributes) GetStatus() CaseStatus { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *CaseAttributes) GetStatusOk() (*CaseStatus, bool) { if o == nil || o.Status == nil { return nil, false @@ -456,10 +463,67 @@ func (o *CaseAttributes) HasStatus() bool { } // SetStatus gets a reference to the given CaseStatus and assigns it to the Status field. +// Deprecated func (o *CaseAttributes) SetStatus(v CaseStatus) { o.Status = &v } +// GetStatusGroup returns the StatusGroup field value if set, zero value otherwise. +func (o *CaseAttributes) GetStatusGroup() CaseStatusGroup { + if o == nil || o.StatusGroup == nil { + var ret CaseStatusGroup + return ret + } + return *o.StatusGroup +} + +// GetStatusGroupOk returns a tuple with the StatusGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CaseAttributes) GetStatusGroupOk() (*CaseStatusGroup, bool) { + if o == nil || o.StatusGroup == nil { + return nil, false + } + return o.StatusGroup, true +} + +// HasStatusGroup returns a boolean if a field has been set. +func (o *CaseAttributes) HasStatusGroup() bool { + return o != nil && o.StatusGroup != nil +} + +// SetStatusGroup gets a reference to the given CaseStatusGroup and assigns it to the StatusGroup field. +func (o *CaseAttributes) SetStatusGroup(v CaseStatusGroup) { + o.StatusGroup = &v +} + +// GetStatusName returns the StatusName field value if set, zero value otherwise. +func (o *CaseAttributes) GetStatusName() string { + if o == nil || o.StatusName == nil { + var ret string + return ret + } + return *o.StatusName +} + +// GetStatusNameOk returns a tuple with the StatusName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CaseAttributes) GetStatusNameOk() (*string, bool) { + if o == nil || o.StatusName == nil { + return nil, false + } + return o.StatusName, true +} + +// HasStatusName returns a boolean if a field has been set. +func (o *CaseAttributes) HasStatusName() bool { + return o != nil && o.StatusName != nil +} + +// SetStatusName gets a reference to the given string and assigns it to the StatusName field. +func (o *CaseAttributes) SetStatusName(v string) { + o.StatusName = &v +} + // GetTitle returns the Title field value if set, zero value otherwise. func (o *CaseAttributes) GetTitle() string { if o == nil || o.Title == nil { @@ -593,6 +657,12 @@ func (o CaseAttributes) MarshalJSON() ([]byte, error) { if o.Status != nil { toSerialize["status"] = o.Status } + if o.StatusGroup != nil { + toSerialize["status_group"] = o.StatusGroup + } + if o.StatusName != nil { + toSerialize["status_name"] = o.StatusName + } if o.Title != nil { toSerialize["title"] = o.Title } @@ -624,6 +694,8 @@ func (o *CaseAttributes) UnmarshalJSON(bytes []byte) (err error) { Priority *CasePriority `json:"priority,omitempty"` ServiceNowTicket NullableServiceNowTicket `json:"service_now_ticket,omitempty"` Status *CaseStatus `json:"status,omitempty"` + StatusGroup *CaseStatusGroup `json:"status_group,omitempty"` + StatusName *string `json:"status_name,omitempty"` Title *string `json:"title,omitempty"` Type *CaseType `json:"type,omitempty"` TypeId *string `json:"type_id,omitempty"` @@ -633,7 +705,7 @@ func (o *CaseAttributes) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"archived_at", "attributes", "closed_at", "created_at", "custom_attributes", "description", "jira_issue", "key", "modified_at", "priority", "service_now_ticket", "status", "title", "type", "type_id"}) + datadog.DeleteKeys(additionalProperties, &[]string{"archived_at", "attributes", "closed_at", "created_at", "custom_attributes", "description", "jira_issue", "key", "modified_at", "priority", "service_now_ticket", "status", "status_group", "status_name", "title", "type", "type_id"}) } else { return err } @@ -659,6 +731,12 @@ func (o *CaseAttributes) UnmarshalJSON(bytes []byte) (err error) { } else { o.Status = all.Status } + if all.StatusGroup != nil && !all.StatusGroup.IsValid() { + hasInvalidField = true + } else { + o.StatusGroup = all.StatusGroup + } + o.StatusName = all.StatusName o.Title = all.Title if all.Type != nil && !all.Type.IsValid() { hasInvalidField = true diff --git a/api/datadogV2/model_case_create_attributes.go b/api/datadogV2/model_case_create_attributes.go index 3f0e2e06036..a8454a6f486 100644 --- a/api/datadogV2/model_case_create_attributes.go +++ b/api/datadogV2/model_case_create_attributes.go @@ -18,6 +18,8 @@ type CaseCreateAttributes struct { Description *string `json:"description,omitempty"` // Case priority Priority *CasePriority `json:"priority,omitempty"` + // Status of the case. Must be one of the existing statuses for the case's type. + StatusName *string `json:"status_name,omitempty"` // Title Title string `json:"title"` // Case type UUID @@ -134,6 +136,34 @@ func (o *CaseCreateAttributes) SetPriority(v CasePriority) { o.Priority = &v } +// GetStatusName returns the StatusName field value if set, zero value otherwise. +func (o *CaseCreateAttributes) GetStatusName() string { + if o == nil || o.StatusName == nil { + var ret string + return ret + } + return *o.StatusName +} + +// GetStatusNameOk returns a tuple with the StatusName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CaseCreateAttributes) GetStatusNameOk() (*string, bool) { + if o == nil || o.StatusName == nil { + return nil, false + } + return o.StatusName, true +} + +// HasStatusName returns a boolean if a field has been set. +func (o *CaseCreateAttributes) HasStatusName() bool { + return o != nil && o.StatusName != nil +} + +// SetStatusName gets a reference to the given string and assigns it to the StatusName field. +func (o *CaseCreateAttributes) SetStatusName(v string) { + o.StatusName = &v +} + // GetTitle returns the Title field value. func (o *CaseCreateAttributes) GetTitle() string { if o == nil { @@ -195,6 +225,9 @@ func (o CaseCreateAttributes) MarshalJSON() ([]byte, error) { if o.Priority != nil { toSerialize["priority"] = o.Priority } + if o.StatusName != nil { + toSerialize["status_name"] = o.StatusName + } toSerialize["title"] = o.Title toSerialize["type_id"] = o.TypeId @@ -210,6 +243,7 @@ func (o *CaseCreateAttributes) UnmarshalJSON(bytes []byte) (err error) { CustomAttributes map[string]CustomAttributeValue `json:"custom_attributes,omitempty"` Description *string `json:"description,omitempty"` Priority *CasePriority `json:"priority,omitempty"` + StatusName *string `json:"status_name,omitempty"` Title *string `json:"title"` TypeId *string `json:"type_id"` }{} @@ -224,7 +258,7 @@ func (o *CaseCreateAttributes) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"custom_attributes", "description", "priority", "title", "type_id"}) + datadog.DeleteKeys(additionalProperties, &[]string{"custom_attributes", "description", "priority", "status_name", "title", "type_id"}) } else { return err } @@ -237,6 +271,7 @@ func (o *CaseCreateAttributes) UnmarshalJSON(bytes []byte) (err error) { } else { o.Priority = all.Priority } + o.StatusName = all.StatusName o.Title = *all.Title o.TypeId = *all.TypeId diff --git a/api/datadogV2/model_case_status.go b/api/datadogV2/model_case_status.go index 7cb4fb26cb7..7f1d7ce3c57 100644 --- a/api/datadogV2/model_case_status.go +++ b/api/datadogV2/model_case_status.go @@ -10,7 +10,7 @@ import ( "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) -// CaseStatus Case status +// CaseStatus Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use `status_name` instead. type CaseStatus string // List of CaseStatus. diff --git a/api/datadogV2/model_case_status_group.go b/api/datadogV2/model_case_status_group.go new file mode 100644 index 00000000000..df1d3ad08bb --- /dev/null +++ b/api/datadogV2/model_case_status_group.go @@ -0,0 +1,68 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CaseStatusGroup Status group of the case. +type CaseStatusGroup string + +// List of CaseStatusGroup. +const ( + CASESTATUSGROUP_SG_OPEN CaseStatusGroup = "SG_OPEN" + CASESTATUSGROUP_SG_IN_PROGRESS CaseStatusGroup = "SG_IN_PROGRESS" + CASESTATUSGROUP_SG_CLOSED CaseStatusGroup = "SG_CLOSED" +) + +var allowedCaseStatusGroupEnumValues = []CaseStatusGroup{ + CASESTATUSGROUP_SG_OPEN, + CASESTATUSGROUP_SG_IN_PROGRESS, + CASESTATUSGROUP_SG_CLOSED, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CaseStatusGroup) GetAllowedValues() []CaseStatusGroup { + return allowedCaseStatusGroupEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CaseStatusGroup) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CaseStatusGroup(value) + return nil +} + +// NewCaseStatusGroupFromValue returns a pointer to a valid CaseStatusGroup +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCaseStatusGroupFromValue(v string) (*CaseStatusGroup, error) { + ev := CaseStatusGroup(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CaseStatusGroup: valid values are %v", v, allowedCaseStatusGroupEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CaseStatusGroup) IsValid() bool { + for _, existing := range allowedCaseStatusGroupEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CaseStatusGroup value. +func (v CaseStatusGroup) Ptr() *CaseStatusGroup { + return &v +} diff --git a/api/datadogV2/model_case_update_status_attributes.go b/api/datadogV2/model_case_update_status_attributes.go index dfdad4751a6..011d2650fc3 100644 --- a/api/datadogV2/model_case_update_status_attributes.go +++ b/api/datadogV2/model_case_update_status_attributes.go @@ -5,15 +5,16 @@ package datadogV2 import ( - "fmt" - "github.com/DataDog/datadog-api-client-go/v2/api/datadog" ) // CaseUpdateStatusAttributes Case update status attributes type CaseUpdateStatusAttributes struct { - // Case status - Status CaseStatus `json:"status"` + // Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use `status_name` instead. + // Deprecated + Status *CaseStatus `json:"status,omitempty"` + // Status of the case. Must be one of the existing statuses for the case's type. + StatusName *string `json:"status_name,omitempty"` // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct UnparsedObject map[string]interface{} `json:"-"` AdditionalProperties map[string]interface{} `json:"-"` @@ -23,9 +24,8 @@ type CaseUpdateStatusAttributes struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed. -func NewCaseUpdateStatusAttributes(status CaseStatus) *CaseUpdateStatusAttributes { +func NewCaseUpdateStatusAttributes() *CaseUpdateStatusAttributes { this := CaseUpdateStatusAttributes{} - this.Status = status return &this } @@ -37,27 +37,63 @@ func NewCaseUpdateStatusAttributesWithDefaults() *CaseUpdateStatusAttributes { return &this } -// GetStatus returns the Status field value. +// GetStatus returns the Status field value if set, zero value otherwise. +// Deprecated func (o *CaseUpdateStatusAttributes) GetStatus() CaseStatus { - if o == nil { + if o == nil || o.Status == nil { var ret CaseStatus return ret } - return o.Status + return *o.Status } -// GetStatusOk returns a tuple with the Status field value +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *CaseUpdateStatusAttributes) GetStatusOk() (*CaseStatus, bool) { - if o == nil { + if o == nil || o.Status == nil { return nil, false } - return &o.Status, true + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *CaseUpdateStatusAttributes) HasStatus() bool { + return o != nil && o.Status != nil } -// SetStatus sets field value. +// SetStatus gets a reference to the given CaseStatus and assigns it to the Status field. +// Deprecated func (o *CaseUpdateStatusAttributes) SetStatus(v CaseStatus) { - o.Status = v + o.Status = &v +} + +// GetStatusName returns the StatusName field value if set, zero value otherwise. +func (o *CaseUpdateStatusAttributes) GetStatusName() string { + if o == nil || o.StatusName == nil { + var ret string + return ret + } + return *o.StatusName +} + +// GetStatusNameOk returns a tuple with the StatusName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CaseUpdateStatusAttributes) GetStatusNameOk() (*string, bool) { + if o == nil || o.StatusName == nil { + return nil, false + } + return o.StatusName, true +} + +// HasStatusName returns a boolean if a field has been set. +func (o *CaseUpdateStatusAttributes) HasStatusName() bool { + return o != nil && o.StatusName != nil +} + +// SetStatusName gets a reference to the given string and assigns it to the StatusName field. +func (o *CaseUpdateStatusAttributes) SetStatusName(v string) { + o.StatusName = &v } // MarshalJSON serializes the struct using spec logic. @@ -66,7 +102,12 @@ func (o CaseUpdateStatusAttributes) MarshalJSON() ([]byte, error) { if o.UnparsedObject != nil { return datadog.Marshal(o.UnparsedObject) } - toSerialize["status"] = o.Status + if o.Status != nil { + toSerialize["status"] = o.Status + } + if o.StatusName != nil { + toSerialize["status_name"] = o.StatusName + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -77,27 +118,26 @@ func (o CaseUpdateStatusAttributes) MarshalJSON() ([]byte, error) { // UnmarshalJSON deserializes the given payload. func (o *CaseUpdateStatusAttributes) UnmarshalJSON(bytes []byte) (err error) { all := struct { - Status *CaseStatus `json:"status"` + Status *CaseStatus `json:"status,omitempty"` + StatusName *string `json:"status_name,omitempty"` }{} if err = datadog.Unmarshal(bytes, &all); err != nil { return datadog.Unmarshal(bytes, &o.UnparsedObject) } - if all.Status == nil { - return fmt.Errorf("required field status missing") - } additionalProperties := make(map[string]interface{}) if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"status"}) + datadog.DeleteKeys(additionalProperties, &[]string{"status", "status_name"}) } else { return err } hasInvalidField := false - if !all.Status.IsValid() { + if all.Status != nil && !all.Status.IsValid() { hasInvalidField = true } else { - o.Status = *all.Status + o.Status = all.Status } + o.StatusName = all.StatusName if len(additionalProperties) > 0 { o.AdditionalProperties = additionalProperties diff --git a/api/datadogV2/model_create_jira_issue_request_data_attributes.go b/api/datadogV2/model_create_jira_issue_request_data_attributes.go index aac79965990..2a168d2ce71 100644 --- a/api/datadogV2/model_create_jira_issue_request_data_attributes.go +++ b/api/datadogV2/model_create_jira_issue_request_data_attributes.go @@ -10,7 +10,7 @@ import ( // CreateJiraIssueRequestDataAttributes Attributes of the Jira issue to create. type CreateJiraIssueRequestDataAttributes struct { - // Unique identifier of the user assigned to the Jira issue. + // Unique identifier of the Datadog user assigned to the Jira issue. AssigneeId *string `json:"assignee_id,omitempty"` // Description of the Jira issue. If not provided, the description will be automatically generated. Description *string `json:"description,omitempty"` diff --git a/api/datadogV2/model_custom_rule.go b/api/datadogV2/model_custom_rule.go new file mode 100644 index 00000000000..3ba6a5fe53a --- /dev/null +++ b/api/datadogV2/model_custom_rule.go @@ -0,0 +1,211 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CustomRule +type CustomRule struct { + // Creation timestamp + CreatedAt time.Time `json:"created_at"` + // Creator identifier + CreatedBy string `json:"created_by"` + // + LastRevision CustomRuleRevision `json:"last_revision"` + // Rule name + Name string `json:"name"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCustomRule instantiates a new CustomRule object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCustomRule(createdAt time.Time, createdBy string, lastRevision CustomRuleRevision, name string) *CustomRule { + this := CustomRule{} + this.CreatedAt = createdAt + this.CreatedBy = createdBy + this.LastRevision = lastRevision + this.Name = name + return &this +} + +// NewCustomRuleWithDefaults instantiates a new CustomRule object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCustomRuleWithDefaults() *CustomRule { + this := CustomRule{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value. +func (o *CustomRule) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *CustomRule) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value. +func (o *CustomRule) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetCreatedBy returns the CreatedBy field value. +func (o *CustomRule) GetCreatedBy() string { + if o == nil { + var ret string + return ret + } + return o.CreatedBy +} + +// GetCreatedByOk returns a tuple with the CreatedBy field value +// and a boolean to check if the value has been set. +func (o *CustomRule) GetCreatedByOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CreatedBy, true +} + +// SetCreatedBy sets field value. +func (o *CustomRule) SetCreatedBy(v string) { + o.CreatedBy = v +} + +// GetLastRevision returns the LastRevision field value. +func (o *CustomRule) GetLastRevision() CustomRuleRevision { + if o == nil { + var ret CustomRuleRevision + return ret + } + return o.LastRevision +} + +// GetLastRevisionOk returns a tuple with the LastRevision field value +// and a boolean to check if the value has been set. +func (o *CustomRule) GetLastRevisionOk() (*CustomRuleRevision, bool) { + if o == nil { + return nil, false + } + return &o.LastRevision, true +} + +// SetLastRevision sets field value. +func (o *CustomRule) SetLastRevision(v CustomRuleRevision) { + o.LastRevision = v +} + +// GetName returns the Name field value. +func (o *CustomRule) GetName() string { + if o == nil { + var ret string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CustomRule) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value. +func (o *CustomRule) SetName(v string) { + o.Name = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CustomRule) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.CreatedAt.Nanosecond() == 0 { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05.000Z07:00") + } + toSerialize["created_by"] = o.CreatedBy + toSerialize["last_revision"] = o.LastRevision + toSerialize["name"] = o.Name + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CustomRule) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + CreatedAt *time.Time `json:"created_at"` + CreatedBy *string `json:"created_by"` + LastRevision *CustomRuleRevision `json:"last_revision"` + Name *string `json:"name"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.CreatedAt == nil { + return fmt.Errorf("required field created_at missing") + } + if all.CreatedBy == nil { + return fmt.Errorf("required field created_by missing") + } + if all.LastRevision == nil { + return fmt.Errorf("required field last_revision missing") + } + if all.Name == nil { + return fmt.Errorf("required field name missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"created_at", "created_by", "last_revision", "name"}) + } else { + return err + } + + hasInvalidField := false + o.CreatedAt = *all.CreatedAt + o.CreatedBy = *all.CreatedBy + if all.LastRevision.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.LastRevision = *all.LastRevision + o.Name = *all.Name + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_custom_rule_data_type.go b/api/datadogV2/model_custom_rule_data_type.go new file mode 100644 index 00000000000..2ea70a0ace3 --- /dev/null +++ b/api/datadogV2/model_custom_rule_data_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CustomRuleDataType Resource type +type CustomRuleDataType string + +// List of CustomRuleDataType. +const ( + CUSTOMRULEDATATYPE_CUSTOM_RULE CustomRuleDataType = "custom_rule" +) + +var allowedCustomRuleDataTypeEnumValues = []CustomRuleDataType{ + CUSTOMRULEDATATYPE_CUSTOM_RULE, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CustomRuleDataType) GetAllowedValues() []CustomRuleDataType { + return allowedCustomRuleDataTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CustomRuleDataType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CustomRuleDataType(value) + return nil +} + +// NewCustomRuleDataTypeFromValue returns a pointer to a valid CustomRuleDataType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCustomRuleDataTypeFromValue(v string) (*CustomRuleDataType, error) { + ev := CustomRuleDataType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CustomRuleDataType: valid values are %v", v, allowedCustomRuleDataTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CustomRuleDataType) IsValid() bool { + for _, existing := range allowedCustomRuleDataTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CustomRuleDataType value. +func (v CustomRuleDataType) Ptr() *CustomRuleDataType { + return &v +} diff --git a/api/datadogV2/model_custom_rule_request.go b/api/datadogV2/model_custom_rule_request.go new file mode 100644 index 00000000000..ff055a6fc35 --- /dev/null +++ b/api/datadogV2/model_custom_rule_request.go @@ -0,0 +1,111 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CustomRuleRequest +type CustomRuleRequest struct { + // + Data *CustomRuleRequestData `json:"data,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCustomRuleRequest instantiates a new CustomRuleRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCustomRuleRequest() *CustomRuleRequest { + this := CustomRuleRequest{} + return &this +} + +// NewCustomRuleRequestWithDefaults instantiates a new CustomRuleRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCustomRuleRequestWithDefaults() *CustomRuleRequest { + this := CustomRuleRequest{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *CustomRuleRequest) GetData() CustomRuleRequestData { + if o == nil || o.Data == nil { + var ret CustomRuleRequestData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomRuleRequest) GetDataOk() (*CustomRuleRequestData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *CustomRuleRequest) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given CustomRuleRequestData and assigns it to the Data field. +func (o *CustomRuleRequest) SetData(v CustomRuleRequestData) { + o.Data = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CustomRuleRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CustomRuleRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *CustomRuleRequestData `json:"data,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_custom_rule_request_data.go b/api/datadogV2/model_custom_rule_request_data.go new file mode 100644 index 00000000000..d8832392c49 --- /dev/null +++ b/api/datadogV2/model_custom_rule_request_data.go @@ -0,0 +1,185 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CustomRuleRequestData +type CustomRuleRequestData struct { + // + Attributes *CustomRuleRequestDataAttributes `json:"attributes,omitempty"` + // Rule identifier + Id *string `json:"id,omitempty"` + // Resource type + Type *CustomRuleDataType `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCustomRuleRequestData instantiates a new CustomRuleRequestData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCustomRuleRequestData() *CustomRuleRequestData { + this := CustomRuleRequestData{} + return &this +} + +// NewCustomRuleRequestDataWithDefaults instantiates a new CustomRuleRequestData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCustomRuleRequestDataWithDefaults() *CustomRuleRequestData { + this := CustomRuleRequestData{} + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *CustomRuleRequestData) GetAttributes() CustomRuleRequestDataAttributes { + if o == nil || o.Attributes == nil { + var ret CustomRuleRequestDataAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomRuleRequestData) GetAttributesOk() (*CustomRuleRequestDataAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *CustomRuleRequestData) HasAttributes() bool { + return o != nil && o.Attributes != nil +} + +// SetAttributes gets a reference to the given CustomRuleRequestDataAttributes and assigns it to the Attributes field. +func (o *CustomRuleRequestData) SetAttributes(v CustomRuleRequestDataAttributes) { + o.Attributes = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CustomRuleRequestData) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomRuleRequestData) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CustomRuleRequestData) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CustomRuleRequestData) SetId(v string) { + o.Id = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *CustomRuleRequestData) GetType() CustomRuleDataType { + if o == nil || o.Type == nil { + var ret CustomRuleDataType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomRuleRequestData) GetTypeOk() (*CustomRuleDataType, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *CustomRuleRequestData) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given CustomRuleDataType and assigns it to the Type field. +func (o *CustomRuleRequestData) SetType(v CustomRuleDataType) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CustomRuleRequestData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CustomRuleRequestData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *CustomRuleRequestDataAttributes `json:"attributes,omitempty"` + Id *string `json:"id,omitempty"` + Type *CustomRuleDataType `json:"type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = all.Attributes + o.Id = all.Id + if all.Type != nil && !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_custom_rule_request_data_attributes.go b/api/datadogV2/model_custom_rule_request_data_attributes.go new file mode 100644 index 00000000000..616623dfc85 --- /dev/null +++ b/api/datadogV2/model_custom_rule_request_data_attributes.go @@ -0,0 +1,102 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CustomRuleRequestDataAttributes +type CustomRuleRequestDataAttributes struct { + // Rule name + Name *string `json:"name,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCustomRuleRequestDataAttributes instantiates a new CustomRuleRequestDataAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCustomRuleRequestDataAttributes() *CustomRuleRequestDataAttributes { + this := CustomRuleRequestDataAttributes{} + return &this +} + +// NewCustomRuleRequestDataAttributesWithDefaults instantiates a new CustomRuleRequestDataAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCustomRuleRequestDataAttributesWithDefaults() *CustomRuleRequestDataAttributes { + this := CustomRuleRequestDataAttributes{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CustomRuleRequestDataAttributes) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomRuleRequestDataAttributes) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *CustomRuleRequestDataAttributes) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *CustomRuleRequestDataAttributes) SetName(v string) { + o.Name = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CustomRuleRequestDataAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CustomRuleRequestDataAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Name *string `json:"name,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"name"}) + } else { + return err + } + o.Name = all.Name + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_custom_rule_response.go b/api/datadogV2/model_custom_rule_response.go new file mode 100644 index 00000000000..439f3e9f508 --- /dev/null +++ b/api/datadogV2/model_custom_rule_response.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CustomRuleResponse +type CustomRuleResponse struct { + // + Data CustomRuleResponseData `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCustomRuleResponse instantiates a new CustomRuleResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCustomRuleResponse(data CustomRuleResponseData) *CustomRuleResponse { + this := CustomRuleResponse{} + this.Data = data + return &this +} + +// NewCustomRuleResponseWithDefaults instantiates a new CustomRuleResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCustomRuleResponseWithDefaults() *CustomRuleResponse { + this := CustomRuleResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *CustomRuleResponse) GetData() CustomRuleResponseData { + if o == nil { + var ret CustomRuleResponseData + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *CustomRuleResponse) GetDataOk() (*CustomRuleResponseData, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *CustomRuleResponse) SetData(v CustomRuleResponseData) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CustomRuleResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CustomRuleResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *CustomRuleResponseData `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_custom_rule_response_data.go b/api/datadogV2/model_custom_rule_response_data.go new file mode 100644 index 00000000000..218ab465911 --- /dev/null +++ b/api/datadogV2/model_custom_rule_response_data.go @@ -0,0 +1,178 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CustomRuleResponseData +type CustomRuleResponseData struct { + // + Attributes CustomRule `json:"attributes"` + // Rule identifier + Id string `json:"id"` + // Resource type + Type CustomRuleDataType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCustomRuleResponseData instantiates a new CustomRuleResponseData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCustomRuleResponseData(attributes CustomRule, id string, typeVar CustomRuleDataType) *CustomRuleResponseData { + this := CustomRuleResponseData{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewCustomRuleResponseDataWithDefaults instantiates a new CustomRuleResponseData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCustomRuleResponseDataWithDefaults() *CustomRuleResponseData { + this := CustomRuleResponseData{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *CustomRuleResponseData) GetAttributes() CustomRule { + if o == nil { + var ret CustomRule + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *CustomRuleResponseData) GetAttributesOk() (*CustomRule, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *CustomRuleResponseData) SetAttributes(v CustomRule) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *CustomRuleResponseData) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CustomRuleResponseData) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *CustomRuleResponseData) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *CustomRuleResponseData) GetType() CustomRuleDataType { + if o == nil { + var ret CustomRuleDataType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CustomRuleResponseData) GetTypeOk() (*CustomRuleDataType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *CustomRuleResponseData) SetType(v CustomRuleDataType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CustomRuleResponseData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CustomRuleResponseData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *CustomRule `json:"attributes"` + Id *string `json:"id"` + Type *CustomRuleDataType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_custom_rule_revision.go b/api/datadogV2/model_custom_rule_revision.go new file mode 100644 index 00000000000..9f7fc53a6e3 --- /dev/null +++ b/api/datadogV2/model_custom_rule_revision.go @@ -0,0 +1,178 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CustomRuleRevision +type CustomRuleRevision struct { + // + Attributes CustomRuleRevisionAttributes `json:"attributes"` + // Revision identifier + Id string `json:"id"` + // Resource type + Type CustomRuleRevisionDataType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCustomRuleRevision instantiates a new CustomRuleRevision object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCustomRuleRevision(attributes CustomRuleRevisionAttributes, id string, typeVar CustomRuleRevisionDataType) *CustomRuleRevision { + this := CustomRuleRevision{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewCustomRuleRevisionWithDefaults instantiates a new CustomRuleRevision object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCustomRuleRevisionWithDefaults() *CustomRuleRevision { + this := CustomRuleRevision{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *CustomRuleRevision) GetAttributes() CustomRuleRevisionAttributes { + if o == nil { + var ret CustomRuleRevisionAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevision) GetAttributesOk() (*CustomRuleRevisionAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *CustomRuleRevision) SetAttributes(v CustomRuleRevisionAttributes) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *CustomRuleRevision) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevision) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *CustomRuleRevision) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *CustomRuleRevision) GetType() CustomRuleRevisionDataType { + if o == nil { + var ret CustomRuleRevisionDataType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevision) GetTypeOk() (*CustomRuleRevisionDataType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *CustomRuleRevision) SetType(v CustomRuleRevisionDataType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CustomRuleRevision) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CustomRuleRevision) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *CustomRuleRevisionAttributes `json:"attributes"` + Id *string `json:"id"` + Type *CustomRuleRevisionDataType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_custom_rule_revision_attributes.go b/api/datadogV2/model_custom_rule_revision_attributes.go new file mode 100644 index 00000000000..7098cfb948d --- /dev/null +++ b/api/datadogV2/model_custom_rule_revision_attributes.go @@ -0,0 +1,738 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CustomRuleRevisionAttributes +type CustomRuleRevisionAttributes struct { + // Rule arguments + Arguments []Argument `json:"arguments"` + // Rule category + Category CustomRuleRevisionAttributesCategory `json:"category"` + // Code checksum + Checksum string `json:"checksum"` + // Rule code + Code string `json:"code"` + // Creation timestamp + CreatedAt time.Time `json:"created_at"` + // Creator identifier + CreatedBy string `json:"created_by"` + // Revision creation message + CreationMessage string `json:"creation_message"` + // Associated CVE + Cve datadog.NullableString `json:"cve"` + // Associated CWE + Cwe datadog.NullableString `json:"cwe"` + // Full description + Description string `json:"description"` + // Documentation URL + DocumentationUrl datadog.NullableString `json:"documentation_url"` + // Whether the revision is published + IsPublished bool `json:"is_published"` + // Whether this is a testing revision + IsTesting bool `json:"is_testing"` + // Programming language + Language Language `json:"language"` + // Rule severity + Severity CustomRuleRevisionAttributesSeverity `json:"severity"` + // Short description + ShortDescription string `json:"short_description"` + // Whether to use AI for fixes + ShouldUseAiFix bool `json:"should_use_ai_fix"` + // Rule tags + Tags []string `json:"tags"` + // Rule tests + Tests []CustomRuleRevisionTest `json:"tests"` + // Tree-sitter query + TreeSitterQuery string `json:"tree_sitter_query"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCustomRuleRevisionAttributes instantiates a new CustomRuleRevisionAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCustomRuleRevisionAttributes(arguments []Argument, category CustomRuleRevisionAttributesCategory, checksum string, code string, createdAt time.Time, createdBy string, creationMessage string, cve datadog.NullableString, cwe datadog.NullableString, description string, documentationUrl datadog.NullableString, isPublished bool, isTesting bool, language Language, severity CustomRuleRevisionAttributesSeverity, shortDescription string, shouldUseAiFix bool, tags []string, tests []CustomRuleRevisionTest, treeSitterQuery string) *CustomRuleRevisionAttributes { + this := CustomRuleRevisionAttributes{} + this.Arguments = arguments + this.Category = category + this.Checksum = checksum + this.Code = code + this.CreatedAt = createdAt + this.CreatedBy = createdBy + this.CreationMessage = creationMessage + this.Cve = cve + this.Cwe = cwe + this.Description = description + this.DocumentationUrl = documentationUrl + this.IsPublished = isPublished + this.IsTesting = isTesting + this.Language = language + this.Severity = severity + this.ShortDescription = shortDescription + this.ShouldUseAiFix = shouldUseAiFix + this.Tags = tags + this.Tests = tests + this.TreeSitterQuery = treeSitterQuery + return &this +} + +// NewCustomRuleRevisionAttributesWithDefaults instantiates a new CustomRuleRevisionAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCustomRuleRevisionAttributesWithDefaults() *CustomRuleRevisionAttributes { + this := CustomRuleRevisionAttributes{} + return &this +} + +// GetArguments returns the Arguments field value. +func (o *CustomRuleRevisionAttributes) GetArguments() []Argument { + if o == nil { + var ret []Argument + return ret + } + return o.Arguments +} + +// GetArgumentsOk returns a tuple with the Arguments field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionAttributes) GetArgumentsOk() (*[]Argument, bool) { + if o == nil { + return nil, false + } + return &o.Arguments, true +} + +// SetArguments sets field value. +func (o *CustomRuleRevisionAttributes) SetArguments(v []Argument) { + o.Arguments = v +} + +// GetCategory returns the Category field value. +func (o *CustomRuleRevisionAttributes) GetCategory() CustomRuleRevisionAttributesCategory { + if o == nil { + var ret CustomRuleRevisionAttributesCategory + return ret + } + return o.Category +} + +// GetCategoryOk returns a tuple with the Category field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionAttributes) GetCategoryOk() (*CustomRuleRevisionAttributesCategory, bool) { + if o == nil { + return nil, false + } + return &o.Category, true +} + +// SetCategory sets field value. +func (o *CustomRuleRevisionAttributes) SetCategory(v CustomRuleRevisionAttributesCategory) { + o.Category = v +} + +// GetChecksum returns the Checksum field value. +func (o *CustomRuleRevisionAttributes) GetChecksum() string { + if o == nil { + var ret string + return ret + } + return o.Checksum +} + +// GetChecksumOk returns a tuple with the Checksum field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionAttributes) GetChecksumOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Checksum, true +} + +// SetChecksum sets field value. +func (o *CustomRuleRevisionAttributes) SetChecksum(v string) { + o.Checksum = v +} + +// GetCode returns the Code field value. +func (o *CustomRuleRevisionAttributes) GetCode() string { + if o == nil { + var ret string + return ret + } + return o.Code +} + +// GetCodeOk returns a tuple with the Code field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionAttributes) GetCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Code, true +} + +// SetCode sets field value. +func (o *CustomRuleRevisionAttributes) SetCode(v string) { + o.Code = v +} + +// GetCreatedAt returns the CreatedAt field value. +func (o *CustomRuleRevisionAttributes) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionAttributes) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value. +func (o *CustomRuleRevisionAttributes) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetCreatedBy returns the CreatedBy field value. +func (o *CustomRuleRevisionAttributes) GetCreatedBy() string { + if o == nil { + var ret string + return ret + } + return o.CreatedBy +} + +// GetCreatedByOk returns a tuple with the CreatedBy field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionAttributes) GetCreatedByOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CreatedBy, true +} + +// SetCreatedBy sets field value. +func (o *CustomRuleRevisionAttributes) SetCreatedBy(v string) { + o.CreatedBy = v +} + +// GetCreationMessage returns the CreationMessage field value. +func (o *CustomRuleRevisionAttributes) GetCreationMessage() string { + if o == nil { + var ret string + return ret + } + return o.CreationMessage +} + +// GetCreationMessageOk returns a tuple with the CreationMessage field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionAttributes) GetCreationMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CreationMessage, true +} + +// SetCreationMessage sets field value. +func (o *CustomRuleRevisionAttributes) SetCreationMessage(v string) { + o.CreationMessage = v +} + +// GetCve returns the Cve field value. +// If the value is explicit nil, the zero value for string will be returned. +func (o *CustomRuleRevisionAttributes) GetCve() string { + if o == nil || o.Cve.Get() == nil { + var ret string + return ret + } + return *o.Cve.Get() +} + +// GetCveOk returns a tuple with the Cve field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *CustomRuleRevisionAttributes) GetCveOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Cve.Get(), o.Cve.IsSet() +} + +// SetCve sets field value. +func (o *CustomRuleRevisionAttributes) SetCve(v string) { + o.Cve.Set(&v) +} + +// GetCwe returns the Cwe field value. +// If the value is explicit nil, the zero value for string will be returned. +func (o *CustomRuleRevisionAttributes) GetCwe() string { + if o == nil || o.Cwe.Get() == nil { + var ret string + return ret + } + return *o.Cwe.Get() +} + +// GetCweOk returns a tuple with the Cwe field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *CustomRuleRevisionAttributes) GetCweOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Cwe.Get(), o.Cwe.IsSet() +} + +// SetCwe sets field value. +func (o *CustomRuleRevisionAttributes) SetCwe(v string) { + o.Cwe.Set(&v) +} + +// GetDescription returns the Description field value. +func (o *CustomRuleRevisionAttributes) GetDescription() string { + if o == nil { + var ret string + return ret + } + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionAttributes) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value. +func (o *CustomRuleRevisionAttributes) SetDescription(v string) { + o.Description = v +} + +// GetDocumentationUrl returns the DocumentationUrl field value. +// If the value is explicit nil, the zero value for string will be returned. +func (o *CustomRuleRevisionAttributes) GetDocumentationUrl() string { + if o == nil || o.DocumentationUrl.Get() == nil { + var ret string + return ret + } + return *o.DocumentationUrl.Get() +} + +// GetDocumentationUrlOk returns a tuple with the DocumentationUrl field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *CustomRuleRevisionAttributes) GetDocumentationUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DocumentationUrl.Get(), o.DocumentationUrl.IsSet() +} + +// SetDocumentationUrl sets field value. +func (o *CustomRuleRevisionAttributes) SetDocumentationUrl(v string) { + o.DocumentationUrl.Set(&v) +} + +// GetIsPublished returns the IsPublished field value. +func (o *CustomRuleRevisionAttributes) GetIsPublished() bool { + if o == nil { + var ret bool + return ret + } + return o.IsPublished +} + +// GetIsPublishedOk returns a tuple with the IsPublished field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionAttributes) GetIsPublishedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsPublished, true +} + +// SetIsPublished sets field value. +func (o *CustomRuleRevisionAttributes) SetIsPublished(v bool) { + o.IsPublished = v +} + +// GetIsTesting returns the IsTesting field value. +func (o *CustomRuleRevisionAttributes) GetIsTesting() bool { + if o == nil { + var ret bool + return ret + } + return o.IsTesting +} + +// GetIsTestingOk returns a tuple with the IsTesting field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionAttributes) GetIsTestingOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsTesting, true +} + +// SetIsTesting sets field value. +func (o *CustomRuleRevisionAttributes) SetIsTesting(v bool) { + o.IsTesting = v +} + +// GetLanguage returns the Language field value. +func (o *CustomRuleRevisionAttributes) GetLanguage() Language { + if o == nil { + var ret Language + return ret + } + return o.Language +} + +// GetLanguageOk returns a tuple with the Language field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionAttributes) GetLanguageOk() (*Language, bool) { + if o == nil { + return nil, false + } + return &o.Language, true +} + +// SetLanguage sets field value. +func (o *CustomRuleRevisionAttributes) SetLanguage(v Language) { + o.Language = v +} + +// GetSeverity returns the Severity field value. +func (o *CustomRuleRevisionAttributes) GetSeverity() CustomRuleRevisionAttributesSeverity { + if o == nil { + var ret CustomRuleRevisionAttributesSeverity + return ret + } + return o.Severity +} + +// GetSeverityOk returns a tuple with the Severity field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionAttributes) GetSeverityOk() (*CustomRuleRevisionAttributesSeverity, bool) { + if o == nil { + return nil, false + } + return &o.Severity, true +} + +// SetSeverity sets field value. +func (o *CustomRuleRevisionAttributes) SetSeverity(v CustomRuleRevisionAttributesSeverity) { + o.Severity = v +} + +// GetShortDescription returns the ShortDescription field value. +func (o *CustomRuleRevisionAttributes) GetShortDescription() string { + if o == nil { + var ret string + return ret + } + return o.ShortDescription +} + +// GetShortDescriptionOk returns a tuple with the ShortDescription field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionAttributes) GetShortDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ShortDescription, true +} + +// SetShortDescription sets field value. +func (o *CustomRuleRevisionAttributes) SetShortDescription(v string) { + o.ShortDescription = v +} + +// GetShouldUseAiFix returns the ShouldUseAiFix field value. +func (o *CustomRuleRevisionAttributes) GetShouldUseAiFix() bool { + if o == nil { + var ret bool + return ret + } + return o.ShouldUseAiFix +} + +// GetShouldUseAiFixOk returns a tuple with the ShouldUseAiFix field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionAttributes) GetShouldUseAiFixOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.ShouldUseAiFix, true +} + +// SetShouldUseAiFix sets field value. +func (o *CustomRuleRevisionAttributes) SetShouldUseAiFix(v bool) { + o.ShouldUseAiFix = v +} + +// GetTags returns the Tags field value. +func (o *CustomRuleRevisionAttributes) GetTags() []string { + if o == nil { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionAttributes) GetTagsOk() (*[]string, bool) { + if o == nil { + return nil, false + } + return &o.Tags, true +} + +// SetTags sets field value. +func (o *CustomRuleRevisionAttributes) SetTags(v []string) { + o.Tags = v +} + +// GetTests returns the Tests field value. +func (o *CustomRuleRevisionAttributes) GetTests() []CustomRuleRevisionTest { + if o == nil { + var ret []CustomRuleRevisionTest + return ret + } + return o.Tests +} + +// GetTestsOk returns a tuple with the Tests field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionAttributes) GetTestsOk() (*[]CustomRuleRevisionTest, bool) { + if o == nil { + return nil, false + } + return &o.Tests, true +} + +// SetTests sets field value. +func (o *CustomRuleRevisionAttributes) SetTests(v []CustomRuleRevisionTest) { + o.Tests = v +} + +// GetTreeSitterQuery returns the TreeSitterQuery field value. +func (o *CustomRuleRevisionAttributes) GetTreeSitterQuery() string { + if o == nil { + var ret string + return ret + } + return o.TreeSitterQuery +} + +// GetTreeSitterQueryOk returns a tuple with the TreeSitterQuery field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionAttributes) GetTreeSitterQueryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TreeSitterQuery, true +} + +// SetTreeSitterQuery sets field value. +func (o *CustomRuleRevisionAttributes) SetTreeSitterQuery(v string) { + o.TreeSitterQuery = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CustomRuleRevisionAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["arguments"] = o.Arguments + toSerialize["category"] = o.Category + toSerialize["checksum"] = o.Checksum + toSerialize["code"] = o.Code + if o.CreatedAt.Nanosecond() == 0 { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05.000Z07:00") + } + toSerialize["created_by"] = o.CreatedBy + toSerialize["creation_message"] = o.CreationMessage + toSerialize["cve"] = o.Cve.Get() + toSerialize["cwe"] = o.Cwe.Get() + toSerialize["description"] = o.Description + toSerialize["documentation_url"] = o.DocumentationUrl.Get() + toSerialize["is_published"] = o.IsPublished + toSerialize["is_testing"] = o.IsTesting + toSerialize["language"] = o.Language + toSerialize["severity"] = o.Severity + toSerialize["short_description"] = o.ShortDescription + toSerialize["should_use_ai_fix"] = o.ShouldUseAiFix + toSerialize["tags"] = o.Tags + toSerialize["tests"] = o.Tests + toSerialize["tree_sitter_query"] = o.TreeSitterQuery + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CustomRuleRevisionAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Arguments *[]Argument `json:"arguments"` + Category *CustomRuleRevisionAttributesCategory `json:"category"` + Checksum *string `json:"checksum"` + Code *string `json:"code"` + CreatedAt *time.Time `json:"created_at"` + CreatedBy *string `json:"created_by"` + CreationMessage *string `json:"creation_message"` + Cve datadog.NullableString `json:"cve"` + Cwe datadog.NullableString `json:"cwe"` + Description *string `json:"description"` + DocumentationUrl datadog.NullableString `json:"documentation_url"` + IsPublished *bool `json:"is_published"` + IsTesting *bool `json:"is_testing"` + Language *Language `json:"language"` + Severity *CustomRuleRevisionAttributesSeverity `json:"severity"` + ShortDescription *string `json:"short_description"` + ShouldUseAiFix *bool `json:"should_use_ai_fix"` + Tags *[]string `json:"tags"` + Tests *[]CustomRuleRevisionTest `json:"tests"` + TreeSitterQuery *string `json:"tree_sitter_query"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Arguments == nil { + return fmt.Errorf("required field arguments missing") + } + if all.Category == nil { + return fmt.Errorf("required field category missing") + } + if all.Checksum == nil { + return fmt.Errorf("required field checksum missing") + } + if all.Code == nil { + return fmt.Errorf("required field code missing") + } + if all.CreatedAt == nil { + return fmt.Errorf("required field created_at missing") + } + if all.CreatedBy == nil { + return fmt.Errorf("required field created_by missing") + } + if all.CreationMessage == nil { + return fmt.Errorf("required field creation_message missing") + } + if !all.Cve.IsSet() { + return fmt.Errorf("required field cve missing") + } + if !all.Cwe.IsSet() { + return fmt.Errorf("required field cwe missing") + } + if all.Description == nil { + return fmt.Errorf("required field description missing") + } + if !all.DocumentationUrl.IsSet() { + return fmt.Errorf("required field documentation_url missing") + } + if all.IsPublished == nil { + return fmt.Errorf("required field is_published missing") + } + if all.IsTesting == nil { + return fmt.Errorf("required field is_testing missing") + } + if all.Language == nil { + return fmt.Errorf("required field language missing") + } + if all.Severity == nil { + return fmt.Errorf("required field severity missing") + } + if all.ShortDescription == nil { + return fmt.Errorf("required field short_description missing") + } + if all.ShouldUseAiFix == nil { + return fmt.Errorf("required field should_use_ai_fix missing") + } + if all.Tags == nil { + return fmt.Errorf("required field tags missing") + } + if all.Tests == nil { + return fmt.Errorf("required field tests missing") + } + if all.TreeSitterQuery == nil { + return fmt.Errorf("required field tree_sitter_query missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"arguments", "category", "checksum", "code", "created_at", "created_by", "creation_message", "cve", "cwe", "description", "documentation_url", "is_published", "is_testing", "language", "severity", "short_description", "should_use_ai_fix", "tags", "tests", "tree_sitter_query"}) + } else { + return err + } + + hasInvalidField := false + o.Arguments = *all.Arguments + if !all.Category.IsValid() { + hasInvalidField = true + } else { + o.Category = *all.Category + } + o.Checksum = *all.Checksum + o.Code = *all.Code + o.CreatedAt = *all.CreatedAt + o.CreatedBy = *all.CreatedBy + o.CreationMessage = *all.CreationMessage + o.Cve = all.Cve + o.Cwe = all.Cwe + o.Description = *all.Description + o.DocumentationUrl = all.DocumentationUrl + o.IsPublished = *all.IsPublished + o.IsTesting = *all.IsTesting + if !all.Language.IsValid() { + hasInvalidField = true + } else { + o.Language = *all.Language + } + if !all.Severity.IsValid() { + hasInvalidField = true + } else { + o.Severity = *all.Severity + } + o.ShortDescription = *all.ShortDescription + o.ShouldUseAiFix = *all.ShouldUseAiFix + o.Tags = *all.Tags + o.Tests = *all.Tests + o.TreeSitterQuery = *all.TreeSitterQuery + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_custom_rule_revision_attributes_category.go b/api/datadogV2/model_custom_rule_revision_attributes_category.go new file mode 100644 index 00000000000..aef0ad66f49 --- /dev/null +++ b/api/datadogV2/model_custom_rule_revision_attributes_category.go @@ -0,0 +1,72 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CustomRuleRevisionAttributesCategory Rule category +type CustomRuleRevisionAttributesCategory string + +// List of CustomRuleRevisionAttributesCategory. +const ( + CUSTOMRULEREVISIONATTRIBUTESCATEGORY_SECURITY CustomRuleRevisionAttributesCategory = "SECURITY" + CUSTOMRULEREVISIONATTRIBUTESCATEGORY_BEST_PRACTICES CustomRuleRevisionAttributesCategory = "BEST_PRACTICES" + CUSTOMRULEREVISIONATTRIBUTESCATEGORY_CODE_STYLE CustomRuleRevisionAttributesCategory = "CODE_STYLE" + CUSTOMRULEREVISIONATTRIBUTESCATEGORY_ERROR_PRONE CustomRuleRevisionAttributesCategory = "ERROR_PRONE" + CUSTOMRULEREVISIONATTRIBUTESCATEGORY_PERFORMANCE CustomRuleRevisionAttributesCategory = "PERFORMANCE" +) + +var allowedCustomRuleRevisionAttributesCategoryEnumValues = []CustomRuleRevisionAttributesCategory{ + CUSTOMRULEREVISIONATTRIBUTESCATEGORY_SECURITY, + CUSTOMRULEREVISIONATTRIBUTESCATEGORY_BEST_PRACTICES, + CUSTOMRULEREVISIONATTRIBUTESCATEGORY_CODE_STYLE, + CUSTOMRULEREVISIONATTRIBUTESCATEGORY_ERROR_PRONE, + CUSTOMRULEREVISIONATTRIBUTESCATEGORY_PERFORMANCE, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CustomRuleRevisionAttributesCategory) GetAllowedValues() []CustomRuleRevisionAttributesCategory { + return allowedCustomRuleRevisionAttributesCategoryEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CustomRuleRevisionAttributesCategory) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CustomRuleRevisionAttributesCategory(value) + return nil +} + +// NewCustomRuleRevisionAttributesCategoryFromValue returns a pointer to a valid CustomRuleRevisionAttributesCategory +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCustomRuleRevisionAttributesCategoryFromValue(v string) (*CustomRuleRevisionAttributesCategory, error) { + ev := CustomRuleRevisionAttributesCategory(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CustomRuleRevisionAttributesCategory: valid values are %v", v, allowedCustomRuleRevisionAttributesCategoryEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CustomRuleRevisionAttributesCategory) IsValid() bool { + for _, existing := range allowedCustomRuleRevisionAttributesCategoryEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CustomRuleRevisionAttributesCategory value. +func (v CustomRuleRevisionAttributesCategory) Ptr() *CustomRuleRevisionAttributesCategory { + return &v +} diff --git a/api/datadogV2/model_custom_rule_revision_attributes_severity.go b/api/datadogV2/model_custom_rule_revision_attributes_severity.go new file mode 100644 index 00000000000..d53df0ccbed --- /dev/null +++ b/api/datadogV2/model_custom_rule_revision_attributes_severity.go @@ -0,0 +1,68 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CustomRuleRevisionAttributesSeverity Rule severity +type CustomRuleRevisionAttributesSeverity string + +// List of CustomRuleRevisionAttributesSeverity. +const ( + CUSTOMRULEREVISIONATTRIBUTESSEVERITY_ERROR CustomRuleRevisionAttributesSeverity = "ERROR" + CUSTOMRULEREVISIONATTRIBUTESSEVERITY_WARNING CustomRuleRevisionAttributesSeverity = "WARNING" + CUSTOMRULEREVISIONATTRIBUTESSEVERITY_NOTICE CustomRuleRevisionAttributesSeverity = "NOTICE" +) + +var allowedCustomRuleRevisionAttributesSeverityEnumValues = []CustomRuleRevisionAttributesSeverity{ + CUSTOMRULEREVISIONATTRIBUTESSEVERITY_ERROR, + CUSTOMRULEREVISIONATTRIBUTESSEVERITY_WARNING, + CUSTOMRULEREVISIONATTRIBUTESSEVERITY_NOTICE, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CustomRuleRevisionAttributesSeverity) GetAllowedValues() []CustomRuleRevisionAttributesSeverity { + return allowedCustomRuleRevisionAttributesSeverityEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CustomRuleRevisionAttributesSeverity) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CustomRuleRevisionAttributesSeverity(value) + return nil +} + +// NewCustomRuleRevisionAttributesSeverityFromValue returns a pointer to a valid CustomRuleRevisionAttributesSeverity +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCustomRuleRevisionAttributesSeverityFromValue(v string) (*CustomRuleRevisionAttributesSeverity, error) { + ev := CustomRuleRevisionAttributesSeverity(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CustomRuleRevisionAttributesSeverity: valid values are %v", v, allowedCustomRuleRevisionAttributesSeverityEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CustomRuleRevisionAttributesSeverity) IsValid() bool { + for _, existing := range allowedCustomRuleRevisionAttributesSeverityEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CustomRuleRevisionAttributesSeverity value. +func (v CustomRuleRevisionAttributesSeverity) Ptr() *CustomRuleRevisionAttributesSeverity { + return &v +} diff --git a/api/datadogV2/model_custom_rule_revision_data_type.go b/api/datadogV2/model_custom_rule_revision_data_type.go new file mode 100644 index 00000000000..021b8ac51d9 --- /dev/null +++ b/api/datadogV2/model_custom_rule_revision_data_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CustomRuleRevisionDataType Resource type +type CustomRuleRevisionDataType string + +// List of CustomRuleRevisionDataType. +const ( + CUSTOMRULEREVISIONDATATYPE_CUSTOM_RULE_REVISION CustomRuleRevisionDataType = "custom_rule_revision" +) + +var allowedCustomRuleRevisionDataTypeEnumValues = []CustomRuleRevisionDataType{ + CUSTOMRULEREVISIONDATATYPE_CUSTOM_RULE_REVISION, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CustomRuleRevisionDataType) GetAllowedValues() []CustomRuleRevisionDataType { + return allowedCustomRuleRevisionDataTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CustomRuleRevisionDataType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CustomRuleRevisionDataType(value) + return nil +} + +// NewCustomRuleRevisionDataTypeFromValue returns a pointer to a valid CustomRuleRevisionDataType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCustomRuleRevisionDataTypeFromValue(v string) (*CustomRuleRevisionDataType, error) { + ev := CustomRuleRevisionDataType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CustomRuleRevisionDataType: valid values are %v", v, allowedCustomRuleRevisionDataTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CustomRuleRevisionDataType) IsValid() bool { + for _, existing := range allowedCustomRuleRevisionDataTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CustomRuleRevisionDataType value. +func (v CustomRuleRevisionDataType) Ptr() *CustomRuleRevisionDataType { + return &v +} diff --git a/api/datadogV2/model_custom_rule_revision_input_attributes.go b/api/datadogV2/model_custom_rule_revision_input_attributes.go new file mode 100644 index 00000000000..27a73f17899 --- /dev/null +++ b/api/datadogV2/model_custom_rule_revision_input_attributes.go @@ -0,0 +1,637 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CustomRuleRevisionInputAttributes +type CustomRuleRevisionInputAttributes struct { + // Rule arguments + Arguments []Argument `json:"arguments"` + // Rule category + Category CustomRuleRevisionAttributesCategory `json:"category"` + // Rule code + Code string `json:"code"` + // Revision creation message + CreationMessage string `json:"creation_message"` + // Associated CVE + Cve datadog.NullableString `json:"cve"` + // Associated CWE + Cwe datadog.NullableString `json:"cwe"` + // Full description + Description string `json:"description"` + // Documentation URL + DocumentationUrl datadog.NullableString `json:"documentation_url"` + // Whether the revision is published + IsPublished bool `json:"is_published"` + // Whether this is a testing revision + IsTesting bool `json:"is_testing"` + // Programming language + Language Language `json:"language"` + // Rule severity + Severity CustomRuleRevisionAttributesSeverity `json:"severity"` + // Short description + ShortDescription string `json:"short_description"` + // Whether to use AI for fixes + ShouldUseAiFix bool `json:"should_use_ai_fix"` + // Rule tags + Tags []string `json:"tags"` + // Rule tests + Tests []CustomRuleRevisionTest `json:"tests"` + // Tree-sitter query + TreeSitterQuery string `json:"tree_sitter_query"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCustomRuleRevisionInputAttributes instantiates a new CustomRuleRevisionInputAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCustomRuleRevisionInputAttributes(arguments []Argument, category CustomRuleRevisionAttributesCategory, code string, creationMessage string, cve datadog.NullableString, cwe datadog.NullableString, description string, documentationUrl datadog.NullableString, isPublished bool, isTesting bool, language Language, severity CustomRuleRevisionAttributesSeverity, shortDescription string, shouldUseAiFix bool, tags []string, tests []CustomRuleRevisionTest, treeSitterQuery string) *CustomRuleRevisionInputAttributes { + this := CustomRuleRevisionInputAttributes{} + this.Arguments = arguments + this.Category = category + this.Code = code + this.CreationMessage = creationMessage + this.Cve = cve + this.Cwe = cwe + this.Description = description + this.DocumentationUrl = documentationUrl + this.IsPublished = isPublished + this.IsTesting = isTesting + this.Language = language + this.Severity = severity + this.ShortDescription = shortDescription + this.ShouldUseAiFix = shouldUseAiFix + this.Tags = tags + this.Tests = tests + this.TreeSitterQuery = treeSitterQuery + return &this +} + +// NewCustomRuleRevisionInputAttributesWithDefaults instantiates a new CustomRuleRevisionInputAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCustomRuleRevisionInputAttributesWithDefaults() *CustomRuleRevisionInputAttributes { + this := CustomRuleRevisionInputAttributes{} + return &this +} + +// GetArguments returns the Arguments field value. +func (o *CustomRuleRevisionInputAttributes) GetArguments() []Argument { + if o == nil { + var ret []Argument + return ret + } + return o.Arguments +} + +// GetArgumentsOk returns a tuple with the Arguments field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionInputAttributes) GetArgumentsOk() (*[]Argument, bool) { + if o == nil { + return nil, false + } + return &o.Arguments, true +} + +// SetArguments sets field value. +func (o *CustomRuleRevisionInputAttributes) SetArguments(v []Argument) { + o.Arguments = v +} + +// GetCategory returns the Category field value. +func (o *CustomRuleRevisionInputAttributes) GetCategory() CustomRuleRevisionAttributesCategory { + if o == nil { + var ret CustomRuleRevisionAttributesCategory + return ret + } + return o.Category +} + +// GetCategoryOk returns a tuple with the Category field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionInputAttributes) GetCategoryOk() (*CustomRuleRevisionAttributesCategory, bool) { + if o == nil { + return nil, false + } + return &o.Category, true +} + +// SetCategory sets field value. +func (o *CustomRuleRevisionInputAttributes) SetCategory(v CustomRuleRevisionAttributesCategory) { + o.Category = v +} + +// GetCode returns the Code field value. +func (o *CustomRuleRevisionInputAttributes) GetCode() string { + if o == nil { + var ret string + return ret + } + return o.Code +} + +// GetCodeOk returns a tuple with the Code field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionInputAttributes) GetCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Code, true +} + +// SetCode sets field value. +func (o *CustomRuleRevisionInputAttributes) SetCode(v string) { + o.Code = v +} + +// GetCreationMessage returns the CreationMessage field value. +func (o *CustomRuleRevisionInputAttributes) GetCreationMessage() string { + if o == nil { + var ret string + return ret + } + return o.CreationMessage +} + +// GetCreationMessageOk returns a tuple with the CreationMessage field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionInputAttributes) GetCreationMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CreationMessage, true +} + +// SetCreationMessage sets field value. +func (o *CustomRuleRevisionInputAttributes) SetCreationMessage(v string) { + o.CreationMessage = v +} + +// GetCve returns the Cve field value. +// If the value is explicit nil, the zero value for string will be returned. +func (o *CustomRuleRevisionInputAttributes) GetCve() string { + if o == nil || o.Cve.Get() == nil { + var ret string + return ret + } + return *o.Cve.Get() +} + +// GetCveOk returns a tuple with the Cve field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *CustomRuleRevisionInputAttributes) GetCveOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Cve.Get(), o.Cve.IsSet() +} + +// SetCve sets field value. +func (o *CustomRuleRevisionInputAttributes) SetCve(v string) { + o.Cve.Set(&v) +} + +// GetCwe returns the Cwe field value. +// If the value is explicit nil, the zero value for string will be returned. +func (o *CustomRuleRevisionInputAttributes) GetCwe() string { + if o == nil || o.Cwe.Get() == nil { + var ret string + return ret + } + return *o.Cwe.Get() +} + +// GetCweOk returns a tuple with the Cwe field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *CustomRuleRevisionInputAttributes) GetCweOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Cwe.Get(), o.Cwe.IsSet() +} + +// SetCwe sets field value. +func (o *CustomRuleRevisionInputAttributes) SetCwe(v string) { + o.Cwe.Set(&v) +} + +// GetDescription returns the Description field value. +func (o *CustomRuleRevisionInputAttributes) GetDescription() string { + if o == nil { + var ret string + return ret + } + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionInputAttributes) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value. +func (o *CustomRuleRevisionInputAttributes) SetDescription(v string) { + o.Description = v +} + +// GetDocumentationUrl returns the DocumentationUrl field value. +// If the value is explicit nil, the zero value for string will be returned. +func (o *CustomRuleRevisionInputAttributes) GetDocumentationUrl() string { + if o == nil || o.DocumentationUrl.Get() == nil { + var ret string + return ret + } + return *o.DocumentationUrl.Get() +} + +// GetDocumentationUrlOk returns a tuple with the DocumentationUrl field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *CustomRuleRevisionInputAttributes) GetDocumentationUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DocumentationUrl.Get(), o.DocumentationUrl.IsSet() +} + +// SetDocumentationUrl sets field value. +func (o *CustomRuleRevisionInputAttributes) SetDocumentationUrl(v string) { + o.DocumentationUrl.Set(&v) +} + +// GetIsPublished returns the IsPublished field value. +func (o *CustomRuleRevisionInputAttributes) GetIsPublished() bool { + if o == nil { + var ret bool + return ret + } + return o.IsPublished +} + +// GetIsPublishedOk returns a tuple with the IsPublished field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionInputAttributes) GetIsPublishedOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsPublished, true +} + +// SetIsPublished sets field value. +func (o *CustomRuleRevisionInputAttributes) SetIsPublished(v bool) { + o.IsPublished = v +} + +// GetIsTesting returns the IsTesting field value. +func (o *CustomRuleRevisionInputAttributes) GetIsTesting() bool { + if o == nil { + var ret bool + return ret + } + return o.IsTesting +} + +// GetIsTestingOk returns a tuple with the IsTesting field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionInputAttributes) GetIsTestingOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.IsTesting, true +} + +// SetIsTesting sets field value. +func (o *CustomRuleRevisionInputAttributes) SetIsTesting(v bool) { + o.IsTesting = v +} + +// GetLanguage returns the Language field value. +func (o *CustomRuleRevisionInputAttributes) GetLanguage() Language { + if o == nil { + var ret Language + return ret + } + return o.Language +} + +// GetLanguageOk returns a tuple with the Language field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionInputAttributes) GetLanguageOk() (*Language, bool) { + if o == nil { + return nil, false + } + return &o.Language, true +} + +// SetLanguage sets field value. +func (o *CustomRuleRevisionInputAttributes) SetLanguage(v Language) { + o.Language = v +} + +// GetSeverity returns the Severity field value. +func (o *CustomRuleRevisionInputAttributes) GetSeverity() CustomRuleRevisionAttributesSeverity { + if o == nil { + var ret CustomRuleRevisionAttributesSeverity + return ret + } + return o.Severity +} + +// GetSeverityOk returns a tuple with the Severity field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionInputAttributes) GetSeverityOk() (*CustomRuleRevisionAttributesSeverity, bool) { + if o == nil { + return nil, false + } + return &o.Severity, true +} + +// SetSeverity sets field value. +func (o *CustomRuleRevisionInputAttributes) SetSeverity(v CustomRuleRevisionAttributesSeverity) { + o.Severity = v +} + +// GetShortDescription returns the ShortDescription field value. +func (o *CustomRuleRevisionInputAttributes) GetShortDescription() string { + if o == nil { + var ret string + return ret + } + return o.ShortDescription +} + +// GetShortDescriptionOk returns a tuple with the ShortDescription field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionInputAttributes) GetShortDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ShortDescription, true +} + +// SetShortDescription sets field value. +func (o *CustomRuleRevisionInputAttributes) SetShortDescription(v string) { + o.ShortDescription = v +} + +// GetShouldUseAiFix returns the ShouldUseAiFix field value. +func (o *CustomRuleRevisionInputAttributes) GetShouldUseAiFix() bool { + if o == nil { + var ret bool + return ret + } + return o.ShouldUseAiFix +} + +// GetShouldUseAiFixOk returns a tuple with the ShouldUseAiFix field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionInputAttributes) GetShouldUseAiFixOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.ShouldUseAiFix, true +} + +// SetShouldUseAiFix sets field value. +func (o *CustomRuleRevisionInputAttributes) SetShouldUseAiFix(v bool) { + o.ShouldUseAiFix = v +} + +// GetTags returns the Tags field value. +func (o *CustomRuleRevisionInputAttributes) GetTags() []string { + if o == nil { + var ret []string + return ret + } + return o.Tags +} + +// GetTagsOk returns a tuple with the Tags field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionInputAttributes) GetTagsOk() (*[]string, bool) { + if o == nil { + return nil, false + } + return &o.Tags, true +} + +// SetTags sets field value. +func (o *CustomRuleRevisionInputAttributes) SetTags(v []string) { + o.Tags = v +} + +// GetTests returns the Tests field value. +func (o *CustomRuleRevisionInputAttributes) GetTests() []CustomRuleRevisionTest { + if o == nil { + var ret []CustomRuleRevisionTest + return ret + } + return o.Tests +} + +// GetTestsOk returns a tuple with the Tests field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionInputAttributes) GetTestsOk() (*[]CustomRuleRevisionTest, bool) { + if o == nil { + return nil, false + } + return &o.Tests, true +} + +// SetTests sets field value. +func (o *CustomRuleRevisionInputAttributes) SetTests(v []CustomRuleRevisionTest) { + o.Tests = v +} + +// GetTreeSitterQuery returns the TreeSitterQuery field value. +func (o *CustomRuleRevisionInputAttributes) GetTreeSitterQuery() string { + if o == nil { + var ret string + return ret + } + return o.TreeSitterQuery +} + +// GetTreeSitterQueryOk returns a tuple with the TreeSitterQuery field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionInputAttributes) GetTreeSitterQueryOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TreeSitterQuery, true +} + +// SetTreeSitterQuery sets field value. +func (o *CustomRuleRevisionInputAttributes) SetTreeSitterQuery(v string) { + o.TreeSitterQuery = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CustomRuleRevisionInputAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["arguments"] = o.Arguments + toSerialize["category"] = o.Category + toSerialize["code"] = o.Code + toSerialize["creation_message"] = o.CreationMessage + toSerialize["cve"] = o.Cve.Get() + toSerialize["cwe"] = o.Cwe.Get() + toSerialize["description"] = o.Description + toSerialize["documentation_url"] = o.DocumentationUrl.Get() + toSerialize["is_published"] = o.IsPublished + toSerialize["is_testing"] = o.IsTesting + toSerialize["language"] = o.Language + toSerialize["severity"] = o.Severity + toSerialize["short_description"] = o.ShortDescription + toSerialize["should_use_ai_fix"] = o.ShouldUseAiFix + toSerialize["tags"] = o.Tags + toSerialize["tests"] = o.Tests + toSerialize["tree_sitter_query"] = o.TreeSitterQuery + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CustomRuleRevisionInputAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Arguments *[]Argument `json:"arguments"` + Category *CustomRuleRevisionAttributesCategory `json:"category"` + Code *string `json:"code"` + CreationMessage *string `json:"creation_message"` + Cve datadog.NullableString `json:"cve"` + Cwe datadog.NullableString `json:"cwe"` + Description *string `json:"description"` + DocumentationUrl datadog.NullableString `json:"documentation_url"` + IsPublished *bool `json:"is_published"` + IsTesting *bool `json:"is_testing"` + Language *Language `json:"language"` + Severity *CustomRuleRevisionAttributesSeverity `json:"severity"` + ShortDescription *string `json:"short_description"` + ShouldUseAiFix *bool `json:"should_use_ai_fix"` + Tags *[]string `json:"tags"` + Tests *[]CustomRuleRevisionTest `json:"tests"` + TreeSitterQuery *string `json:"tree_sitter_query"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Arguments == nil { + return fmt.Errorf("required field arguments missing") + } + if all.Category == nil { + return fmt.Errorf("required field category missing") + } + if all.Code == nil { + return fmt.Errorf("required field code missing") + } + if all.CreationMessage == nil { + return fmt.Errorf("required field creation_message missing") + } + if !all.Cve.IsSet() { + return fmt.Errorf("required field cve missing") + } + if !all.Cwe.IsSet() { + return fmt.Errorf("required field cwe missing") + } + if all.Description == nil { + return fmt.Errorf("required field description missing") + } + if !all.DocumentationUrl.IsSet() { + return fmt.Errorf("required field documentation_url missing") + } + if all.IsPublished == nil { + return fmt.Errorf("required field is_published missing") + } + if all.IsTesting == nil { + return fmt.Errorf("required field is_testing missing") + } + if all.Language == nil { + return fmt.Errorf("required field language missing") + } + if all.Severity == nil { + return fmt.Errorf("required field severity missing") + } + if all.ShortDescription == nil { + return fmt.Errorf("required field short_description missing") + } + if all.ShouldUseAiFix == nil { + return fmt.Errorf("required field should_use_ai_fix missing") + } + if all.Tags == nil { + return fmt.Errorf("required field tags missing") + } + if all.Tests == nil { + return fmt.Errorf("required field tests missing") + } + if all.TreeSitterQuery == nil { + return fmt.Errorf("required field tree_sitter_query missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"arguments", "category", "code", "creation_message", "cve", "cwe", "description", "documentation_url", "is_published", "is_testing", "language", "severity", "short_description", "should_use_ai_fix", "tags", "tests", "tree_sitter_query"}) + } else { + return err + } + + hasInvalidField := false + o.Arguments = *all.Arguments + if !all.Category.IsValid() { + hasInvalidField = true + } else { + o.Category = *all.Category + } + o.Code = *all.Code + o.CreationMessage = *all.CreationMessage + o.Cve = all.Cve + o.Cwe = all.Cwe + o.Description = *all.Description + o.DocumentationUrl = all.DocumentationUrl + o.IsPublished = *all.IsPublished + o.IsTesting = *all.IsTesting + if !all.Language.IsValid() { + hasInvalidField = true + } else { + o.Language = *all.Language + } + if !all.Severity.IsValid() { + hasInvalidField = true + } else { + o.Severity = *all.Severity + } + o.ShortDescription = *all.ShortDescription + o.ShouldUseAiFix = *all.ShouldUseAiFix + o.Tags = *all.Tags + o.Tests = *all.Tests + o.TreeSitterQuery = *all.TreeSitterQuery + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_custom_rule_revision_request.go b/api/datadogV2/model_custom_rule_revision_request.go new file mode 100644 index 00000000000..83e8c783665 --- /dev/null +++ b/api/datadogV2/model_custom_rule_revision_request.go @@ -0,0 +1,111 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CustomRuleRevisionRequest +type CustomRuleRevisionRequest struct { + // + Data *CustomRuleRevisionRequestData `json:"data,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCustomRuleRevisionRequest instantiates a new CustomRuleRevisionRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCustomRuleRevisionRequest() *CustomRuleRevisionRequest { + this := CustomRuleRevisionRequest{} + return &this +} + +// NewCustomRuleRevisionRequestWithDefaults instantiates a new CustomRuleRevisionRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCustomRuleRevisionRequestWithDefaults() *CustomRuleRevisionRequest { + this := CustomRuleRevisionRequest{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *CustomRuleRevisionRequest) GetData() CustomRuleRevisionRequestData { + if o == nil || o.Data == nil { + var ret CustomRuleRevisionRequestData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionRequest) GetDataOk() (*CustomRuleRevisionRequestData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *CustomRuleRevisionRequest) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given CustomRuleRevisionRequestData and assigns it to the Data field. +func (o *CustomRuleRevisionRequest) SetData(v CustomRuleRevisionRequestData) { + o.Data = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CustomRuleRevisionRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CustomRuleRevisionRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *CustomRuleRevisionRequestData `json:"data,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_custom_rule_revision_request_data.go b/api/datadogV2/model_custom_rule_revision_request_data.go new file mode 100644 index 00000000000..6490b97e4e2 --- /dev/null +++ b/api/datadogV2/model_custom_rule_revision_request_data.go @@ -0,0 +1,185 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CustomRuleRevisionRequestData +type CustomRuleRevisionRequestData struct { + // + Attributes *CustomRuleRevisionInputAttributes `json:"attributes,omitempty"` + // Revision identifier + Id *string `json:"id,omitempty"` + // Resource type + Type *CustomRuleRevisionDataType `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCustomRuleRevisionRequestData instantiates a new CustomRuleRevisionRequestData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCustomRuleRevisionRequestData() *CustomRuleRevisionRequestData { + this := CustomRuleRevisionRequestData{} + return &this +} + +// NewCustomRuleRevisionRequestDataWithDefaults instantiates a new CustomRuleRevisionRequestData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCustomRuleRevisionRequestDataWithDefaults() *CustomRuleRevisionRequestData { + this := CustomRuleRevisionRequestData{} + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *CustomRuleRevisionRequestData) GetAttributes() CustomRuleRevisionInputAttributes { + if o == nil || o.Attributes == nil { + var ret CustomRuleRevisionInputAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionRequestData) GetAttributesOk() (*CustomRuleRevisionInputAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *CustomRuleRevisionRequestData) HasAttributes() bool { + return o != nil && o.Attributes != nil +} + +// SetAttributes gets a reference to the given CustomRuleRevisionInputAttributes and assigns it to the Attributes field. +func (o *CustomRuleRevisionRequestData) SetAttributes(v CustomRuleRevisionInputAttributes) { + o.Attributes = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CustomRuleRevisionRequestData) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionRequestData) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CustomRuleRevisionRequestData) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CustomRuleRevisionRequestData) SetId(v string) { + o.Id = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *CustomRuleRevisionRequestData) GetType() CustomRuleRevisionDataType { + if o == nil || o.Type == nil { + var ret CustomRuleRevisionDataType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionRequestData) GetTypeOk() (*CustomRuleRevisionDataType, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *CustomRuleRevisionRequestData) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given CustomRuleRevisionDataType and assigns it to the Type field. +func (o *CustomRuleRevisionRequestData) SetType(v CustomRuleRevisionDataType) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CustomRuleRevisionRequestData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CustomRuleRevisionRequestData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *CustomRuleRevisionInputAttributes `json:"attributes,omitempty"` + Id *string `json:"id,omitempty"` + Type *CustomRuleRevisionDataType `json:"type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = all.Attributes + o.Id = all.Id + if all.Type != nil && !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_custom_rule_revision_response.go b/api/datadogV2/model_custom_rule_revision_response.go new file mode 100644 index 00000000000..ef66e99c081 --- /dev/null +++ b/api/datadogV2/model_custom_rule_revision_response.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CustomRuleRevisionResponse +type CustomRuleRevisionResponse struct { + // + Data CustomRuleRevision `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCustomRuleRevisionResponse instantiates a new CustomRuleRevisionResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCustomRuleRevisionResponse(data CustomRuleRevision) *CustomRuleRevisionResponse { + this := CustomRuleRevisionResponse{} + this.Data = data + return &this +} + +// NewCustomRuleRevisionResponseWithDefaults instantiates a new CustomRuleRevisionResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCustomRuleRevisionResponseWithDefaults() *CustomRuleRevisionResponse { + this := CustomRuleRevisionResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *CustomRuleRevisionResponse) GetData() CustomRuleRevision { + if o == nil { + var ret CustomRuleRevision + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionResponse) GetDataOk() (*CustomRuleRevision, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *CustomRuleRevisionResponse) SetData(v CustomRuleRevision) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CustomRuleRevisionResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CustomRuleRevisionResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *CustomRuleRevision `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_custom_rule_revision_test_.go b/api/datadogV2/model_custom_rule_revision_test_.go new file mode 100644 index 00000000000..b199e6e63ff --- /dev/null +++ b/api/datadogV2/model_custom_rule_revision_test_.go @@ -0,0 +1,165 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CustomRuleRevisionTest +type CustomRuleRevisionTest struct { + // Expected violation count + AnnotationCount int64 `json:"annotation_count"` + // Test code + Code string `json:"code"` + // Test filename + Filename string `json:"filename"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCustomRuleRevisionTest instantiates a new CustomRuleRevisionTest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCustomRuleRevisionTest(annotationCount int64, code string, filename string) *CustomRuleRevisionTest { + this := CustomRuleRevisionTest{} + this.AnnotationCount = annotationCount + this.Code = code + this.Filename = filename + return &this +} + +// NewCustomRuleRevisionTestWithDefaults instantiates a new CustomRuleRevisionTest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCustomRuleRevisionTestWithDefaults() *CustomRuleRevisionTest { + this := CustomRuleRevisionTest{} + return &this +} + +// GetAnnotationCount returns the AnnotationCount field value. +func (o *CustomRuleRevisionTest) GetAnnotationCount() int64 { + if o == nil { + var ret int64 + return ret + } + return o.AnnotationCount +} + +// GetAnnotationCountOk returns a tuple with the AnnotationCount field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionTest) GetAnnotationCountOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.AnnotationCount, true +} + +// SetAnnotationCount sets field value. +func (o *CustomRuleRevisionTest) SetAnnotationCount(v int64) { + o.AnnotationCount = v +} + +// GetCode returns the Code field value. +func (o *CustomRuleRevisionTest) GetCode() string { + if o == nil { + var ret string + return ret + } + return o.Code +} + +// GetCodeOk returns a tuple with the Code field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionTest) GetCodeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Code, true +} + +// SetCode sets field value. +func (o *CustomRuleRevisionTest) SetCode(v string) { + o.Code = v +} + +// GetFilename returns the Filename field value. +func (o *CustomRuleRevisionTest) GetFilename() string { + if o == nil { + var ret string + return ret + } + return o.Filename +} + +// GetFilenameOk returns a tuple with the Filename field value +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionTest) GetFilenameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Filename, true +} + +// SetFilename sets field value. +func (o *CustomRuleRevisionTest) SetFilename(v string) { + o.Filename = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CustomRuleRevisionTest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["annotation_count"] = o.AnnotationCount + toSerialize["code"] = o.Code + toSerialize["filename"] = o.Filename + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CustomRuleRevisionTest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + AnnotationCount *int64 `json:"annotation_count"` + Code *string `json:"code"` + Filename *string `json:"filename"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.AnnotationCount == nil { + return fmt.Errorf("required field annotation_count missing") + } + if all.Code == nil { + return fmt.Errorf("required field code missing") + } + if all.Filename == nil { + return fmt.Errorf("required field filename missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"annotation_count", "code", "filename"}) + } else { + return err + } + o.AnnotationCount = *all.AnnotationCount + o.Code = *all.Code + o.Filename = *all.Filename + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_custom_rule_revisions_response.go b/api/datadogV2/model_custom_rule_revisions_response.go new file mode 100644 index 00000000000..610f745eb34 --- /dev/null +++ b/api/datadogV2/model_custom_rule_revisions_response.go @@ -0,0 +1,102 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CustomRuleRevisionsResponse +type CustomRuleRevisionsResponse struct { + // + Data []CustomRuleRevision `json:"data,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCustomRuleRevisionsResponse instantiates a new CustomRuleRevisionsResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCustomRuleRevisionsResponse() *CustomRuleRevisionsResponse { + this := CustomRuleRevisionsResponse{} + return &this +} + +// NewCustomRuleRevisionsResponseWithDefaults instantiates a new CustomRuleRevisionsResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCustomRuleRevisionsResponseWithDefaults() *CustomRuleRevisionsResponse { + this := CustomRuleRevisionsResponse{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *CustomRuleRevisionsResponse) GetData() []CustomRuleRevision { + if o == nil || o.Data == nil { + var ret []CustomRuleRevision + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomRuleRevisionsResponse) GetDataOk() (*[]CustomRuleRevision, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return &o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *CustomRuleRevisionsResponse) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given []CustomRuleRevision and assigns it to the Data field. +func (o *CustomRuleRevisionsResponse) SetData(v []CustomRuleRevision) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CustomRuleRevisionsResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CustomRuleRevisionsResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data []CustomRuleRevision `json:"data,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + o.Data = all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_custom_ruleset.go b/api/datadogV2/model_custom_ruleset.go new file mode 100644 index 00000000000..74737fb6fb7 --- /dev/null +++ b/api/datadogV2/model_custom_ruleset.go @@ -0,0 +1,178 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CustomRuleset +type CustomRuleset struct { + // + Attributes CustomRulesetAttributes `json:"attributes"` + // Ruleset identifier + Id string `json:"id"` + // Resource type + Type CustomRulesetDataType `json:"type"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCustomRuleset instantiates a new CustomRuleset object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCustomRuleset(attributes CustomRulesetAttributes, id string, typeVar CustomRulesetDataType) *CustomRuleset { + this := CustomRuleset{} + this.Attributes = attributes + this.Id = id + this.Type = typeVar + return &this +} + +// NewCustomRulesetWithDefaults instantiates a new CustomRuleset object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCustomRulesetWithDefaults() *CustomRuleset { + this := CustomRuleset{} + return &this +} + +// GetAttributes returns the Attributes field value. +func (o *CustomRuleset) GetAttributes() CustomRulesetAttributes { + if o == nil { + var ret CustomRulesetAttributes + return ret + } + return o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value +// and a boolean to check if the value has been set. +func (o *CustomRuleset) GetAttributesOk() (*CustomRulesetAttributes, bool) { + if o == nil { + return nil, false + } + return &o.Attributes, true +} + +// SetAttributes sets field value. +func (o *CustomRuleset) SetAttributes(v CustomRulesetAttributes) { + o.Attributes = v +} + +// GetId returns the Id field value. +func (o *CustomRuleset) GetId() string { + if o == nil { + var ret string + return ret + } + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *CustomRuleset) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value. +func (o *CustomRuleset) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value. +func (o *CustomRuleset) GetType() CustomRulesetDataType { + if o == nil { + var ret CustomRulesetDataType + return ret + } + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *CustomRuleset) GetTypeOk() (*CustomRulesetDataType, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value. +func (o *CustomRuleset) SetType(v CustomRulesetDataType) { + o.Type = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CustomRuleset) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["attributes"] = o.Attributes + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CustomRuleset) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *CustomRulesetAttributes `json:"attributes"` + Id *string `json:"id"` + Type *CustomRulesetDataType `json:"type"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Attributes == nil { + return fmt.Errorf("required field attributes missing") + } + if all.Id == nil { + return fmt.Errorf("required field id missing") + } + if all.Type == nil { + return fmt.Errorf("required field type missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = *all.Attributes + o.Id = *all.Id + if !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = *all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_custom_ruleset_attributes.go b/api/datadogV2/model_custom_ruleset_attributes.go new file mode 100644 index 00000000000..8858ed3e2e9 --- /dev/null +++ b/api/datadogV2/model_custom_ruleset_attributes.go @@ -0,0 +1,268 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CustomRulesetAttributes +type CustomRulesetAttributes struct { + // Creation timestamp + CreatedAt time.Time `json:"created_at"` + // Creator identifier + CreatedBy string `json:"created_by"` + // Base64-encoded full description + Description string `json:"description"` + // Ruleset name + Name string `json:"name"` + // Rules in the ruleset + Rules datadog.NullableList[CustomRule] `json:"rules"` + // Base64-encoded short description + ShortDescription string `json:"short_description"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCustomRulesetAttributes instantiates a new CustomRulesetAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCustomRulesetAttributes(createdAt time.Time, createdBy string, description string, name string, rules datadog.NullableList[CustomRule], shortDescription string) *CustomRulesetAttributes { + this := CustomRulesetAttributes{} + this.CreatedAt = createdAt + this.CreatedBy = createdBy + this.Description = description + this.Name = name + this.Rules = rules + this.ShortDescription = shortDescription + return &this +} + +// NewCustomRulesetAttributesWithDefaults instantiates a new CustomRulesetAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCustomRulesetAttributesWithDefaults() *CustomRulesetAttributes { + this := CustomRulesetAttributes{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value. +func (o *CustomRulesetAttributes) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *CustomRulesetAttributes) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value. +func (o *CustomRulesetAttributes) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetCreatedBy returns the CreatedBy field value. +func (o *CustomRulesetAttributes) GetCreatedBy() string { + if o == nil { + var ret string + return ret + } + return o.CreatedBy +} + +// GetCreatedByOk returns a tuple with the CreatedBy field value +// and a boolean to check if the value has been set. +func (o *CustomRulesetAttributes) GetCreatedByOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.CreatedBy, true +} + +// SetCreatedBy sets field value. +func (o *CustomRulesetAttributes) SetCreatedBy(v string) { + o.CreatedBy = v +} + +// GetDescription returns the Description field value. +func (o *CustomRulesetAttributes) GetDescription() string { + if o == nil { + var ret string + return ret + } + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *CustomRulesetAttributes) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value. +func (o *CustomRulesetAttributes) SetDescription(v string) { + o.Description = v +} + +// GetName returns the Name field value. +func (o *CustomRulesetAttributes) GetName() string { + if o == nil { + var ret string + return ret + } + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CustomRulesetAttributes) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value. +func (o *CustomRulesetAttributes) SetName(v string) { + o.Name = v +} + +// GetRules returns the Rules field value. +// If the value is explicit nil, the zero value for []CustomRule will be returned. +func (o *CustomRulesetAttributes) GetRules() []CustomRule { + if o == nil { + var ret []CustomRule + return ret + } + return *o.Rules.Get() +} + +// GetRulesOk returns a tuple with the Rules field value +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *CustomRulesetAttributes) GetRulesOk() (*[]CustomRule, bool) { + if o == nil { + return nil, false + } + return o.Rules.Get(), o.Rules.IsSet() +} + +// SetRules sets field value. +func (o *CustomRulesetAttributes) SetRules(v []CustomRule) { + o.Rules.Set(&v) +} + +// GetShortDescription returns the ShortDescription field value. +func (o *CustomRulesetAttributes) GetShortDescription() string { + if o == nil { + var ret string + return ret + } + return o.ShortDescription +} + +// GetShortDescriptionOk returns a tuple with the ShortDescription field value +// and a boolean to check if the value has been set. +func (o *CustomRulesetAttributes) GetShortDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ShortDescription, true +} + +// SetShortDescription sets field value. +func (o *CustomRulesetAttributes) SetShortDescription(v string) { + o.ShortDescription = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CustomRulesetAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.CreatedAt.Nanosecond() == 0 { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05Z07:00") + } else { + toSerialize["created_at"] = o.CreatedAt.Format("2006-01-02T15:04:05.000Z07:00") + } + toSerialize["created_by"] = o.CreatedBy + toSerialize["description"] = o.Description + toSerialize["name"] = o.Name + toSerialize["rules"] = o.Rules.Get() + toSerialize["short_description"] = o.ShortDescription + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CustomRulesetAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + CreatedAt *time.Time `json:"created_at"` + CreatedBy *string `json:"created_by"` + Description *string `json:"description"` + Name *string `json:"name"` + Rules datadog.NullableList[CustomRule] `json:"rules"` + ShortDescription *string `json:"short_description"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.CreatedAt == nil { + return fmt.Errorf("required field created_at missing") + } + if all.CreatedBy == nil { + return fmt.Errorf("required field created_by missing") + } + if all.Description == nil { + return fmt.Errorf("required field description missing") + } + if all.Name == nil { + return fmt.Errorf("required field name missing") + } + if !all.Rules.IsSet() { + return fmt.Errorf("required field rules missing") + } + if all.ShortDescription == nil { + return fmt.Errorf("required field short_description missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"created_at", "created_by", "description", "name", "rules", "short_description"}) + } else { + return err + } + o.CreatedAt = *all.CreatedAt + o.CreatedBy = *all.CreatedBy + o.Description = *all.Description + o.Name = *all.Name + o.Rules = all.Rules + o.ShortDescription = *all.ShortDescription + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_custom_ruleset_data_type.go b/api/datadogV2/model_custom_ruleset_data_type.go new file mode 100644 index 00000000000..3323894fde1 --- /dev/null +++ b/api/datadogV2/model_custom_ruleset_data_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CustomRulesetDataType Resource type +type CustomRulesetDataType string + +// List of CustomRulesetDataType. +const ( + CUSTOMRULESETDATATYPE_CUSTOM_RULESET CustomRulesetDataType = "custom_ruleset" +) + +var allowedCustomRulesetDataTypeEnumValues = []CustomRulesetDataType{ + CUSTOMRULESETDATATYPE_CUSTOM_RULESET, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *CustomRulesetDataType) GetAllowedValues() []CustomRulesetDataType { + return allowedCustomRulesetDataTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *CustomRulesetDataType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = CustomRulesetDataType(value) + return nil +} + +// NewCustomRulesetDataTypeFromValue returns a pointer to a valid CustomRulesetDataType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewCustomRulesetDataTypeFromValue(v string) (*CustomRulesetDataType, error) { + ev := CustomRulesetDataType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for CustomRulesetDataType: valid values are %v", v, allowedCustomRulesetDataTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v CustomRulesetDataType) IsValid() bool { + for _, existing := range allowedCustomRulesetDataTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to CustomRulesetDataType value. +func (v CustomRulesetDataType) Ptr() *CustomRulesetDataType { + return &v +} diff --git a/api/datadogV2/model_custom_ruleset_request.go b/api/datadogV2/model_custom_ruleset_request.go new file mode 100644 index 00000000000..8a961acf531 --- /dev/null +++ b/api/datadogV2/model_custom_ruleset_request.go @@ -0,0 +1,111 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CustomRulesetRequest +type CustomRulesetRequest struct { + // + Data *CustomRulesetRequestData `json:"data,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCustomRulesetRequest instantiates a new CustomRulesetRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCustomRulesetRequest() *CustomRulesetRequest { + this := CustomRulesetRequest{} + return &this +} + +// NewCustomRulesetRequestWithDefaults instantiates a new CustomRulesetRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCustomRulesetRequestWithDefaults() *CustomRulesetRequest { + this := CustomRulesetRequest{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *CustomRulesetRequest) GetData() CustomRulesetRequestData { + if o == nil || o.Data == nil { + var ret CustomRulesetRequestData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomRulesetRequest) GetDataOk() (*CustomRulesetRequestData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *CustomRulesetRequest) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given CustomRulesetRequestData and assigns it to the Data field. +func (o *CustomRulesetRequest) SetData(v CustomRulesetRequestData) { + o.Data = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CustomRulesetRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CustomRulesetRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *CustomRulesetRequestData `json:"data,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_custom_ruleset_request_data.go b/api/datadogV2/model_custom_ruleset_request_data.go new file mode 100644 index 00000000000..186f79bc48e --- /dev/null +++ b/api/datadogV2/model_custom_ruleset_request_data.go @@ -0,0 +1,185 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CustomRulesetRequestData +type CustomRulesetRequestData struct { + // + Attributes *CustomRulesetRequestDataAttributes `json:"attributes,omitempty"` + // Ruleset identifier + Id *string `json:"id,omitempty"` + // Resource type + Type *CustomRulesetDataType `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCustomRulesetRequestData instantiates a new CustomRulesetRequestData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCustomRulesetRequestData() *CustomRulesetRequestData { + this := CustomRulesetRequestData{} + return &this +} + +// NewCustomRulesetRequestDataWithDefaults instantiates a new CustomRulesetRequestData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCustomRulesetRequestDataWithDefaults() *CustomRulesetRequestData { + this := CustomRulesetRequestData{} + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *CustomRulesetRequestData) GetAttributes() CustomRulesetRequestDataAttributes { + if o == nil || o.Attributes == nil { + var ret CustomRulesetRequestDataAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomRulesetRequestData) GetAttributesOk() (*CustomRulesetRequestDataAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *CustomRulesetRequestData) HasAttributes() bool { + return o != nil && o.Attributes != nil +} + +// SetAttributes gets a reference to the given CustomRulesetRequestDataAttributes and assigns it to the Attributes field. +func (o *CustomRulesetRequestData) SetAttributes(v CustomRulesetRequestDataAttributes) { + o.Attributes = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CustomRulesetRequestData) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomRulesetRequestData) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CustomRulesetRequestData) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CustomRulesetRequestData) SetId(v string) { + o.Id = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *CustomRulesetRequestData) GetType() CustomRulesetDataType { + if o == nil || o.Type == nil { + var ret CustomRulesetDataType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomRulesetRequestData) GetTypeOk() (*CustomRulesetDataType, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *CustomRulesetRequestData) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given CustomRulesetDataType and assigns it to the Type field. +func (o *CustomRulesetRequestData) SetType(v CustomRulesetDataType) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CustomRulesetRequestData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CustomRulesetRequestData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *CustomRulesetRequestDataAttributes `json:"attributes,omitempty"` + Id *string `json:"id,omitempty"` + Type *CustomRulesetDataType `json:"type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = all.Attributes + o.Id = all.Id + if all.Type != nil && !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_custom_ruleset_request_data_attributes.go b/api/datadogV2/model_custom_ruleset_request_data_attributes.go new file mode 100644 index 00000000000..47bc956f01c --- /dev/null +++ b/api/datadogV2/model_custom_ruleset_request_data_attributes.go @@ -0,0 +1,208 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CustomRulesetRequestDataAttributes +type CustomRulesetRequestDataAttributes struct { + // Base64-encoded full description + Description *string `json:"description,omitempty"` + // Ruleset name + Name *string `json:"name,omitempty"` + // Rules in the ruleset + Rules []CustomRule `json:"rules,omitempty"` + // Base64-encoded short description + ShortDescription *string `json:"short_description,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCustomRulesetRequestDataAttributes instantiates a new CustomRulesetRequestDataAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCustomRulesetRequestDataAttributes() *CustomRulesetRequestDataAttributes { + this := CustomRulesetRequestDataAttributes{} + return &this +} + +// NewCustomRulesetRequestDataAttributesWithDefaults instantiates a new CustomRulesetRequestDataAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCustomRulesetRequestDataAttributesWithDefaults() *CustomRulesetRequestDataAttributes { + this := CustomRulesetRequestDataAttributes{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CustomRulesetRequestDataAttributes) GetDescription() string { + if o == nil || o.Description == nil { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomRulesetRequestDataAttributes) GetDescriptionOk() (*string, bool) { + if o == nil || o.Description == nil { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *CustomRulesetRequestDataAttributes) HasDescription() bool { + return o != nil && o.Description != nil +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CustomRulesetRequestDataAttributes) SetDescription(v string) { + o.Description = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CustomRulesetRequestDataAttributes) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomRulesetRequestDataAttributes) GetNameOk() (*string, bool) { + if o == nil || o.Name == nil { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *CustomRulesetRequestDataAttributes) HasName() bool { + return o != nil && o.Name != nil +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *CustomRulesetRequestDataAttributes) SetName(v string) { + o.Name = &v +} + +// GetRules returns the Rules field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CustomRulesetRequestDataAttributes) GetRules() []CustomRule { + if o == nil { + var ret []CustomRule + return ret + } + return o.Rules +} + +// GetRulesOk returns a tuple with the Rules field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned. +func (o *CustomRulesetRequestDataAttributes) GetRulesOk() (*[]CustomRule, bool) { + if o == nil || o.Rules == nil { + return nil, false + } + return &o.Rules, true +} + +// HasRules returns a boolean if a field has been set. +func (o *CustomRulesetRequestDataAttributes) HasRules() bool { + return o != nil && o.Rules != nil +} + +// SetRules gets a reference to the given []CustomRule and assigns it to the Rules field. +func (o *CustomRulesetRequestDataAttributes) SetRules(v []CustomRule) { + o.Rules = v +} + +// GetShortDescription returns the ShortDescription field value if set, zero value otherwise. +func (o *CustomRulesetRequestDataAttributes) GetShortDescription() string { + if o == nil || o.ShortDescription == nil { + var ret string + return ret + } + return *o.ShortDescription +} + +// GetShortDescriptionOk returns a tuple with the ShortDescription field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CustomRulesetRequestDataAttributes) GetShortDescriptionOk() (*string, bool) { + if o == nil || o.ShortDescription == nil { + return nil, false + } + return o.ShortDescription, true +} + +// HasShortDescription returns a boolean if a field has been set. +func (o *CustomRulesetRequestDataAttributes) HasShortDescription() bool { + return o != nil && o.ShortDescription != nil +} + +// SetShortDescription gets a reference to the given string and assigns it to the ShortDescription field. +func (o *CustomRulesetRequestDataAttributes) SetShortDescription(v string) { + o.ShortDescription = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CustomRulesetRequestDataAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Description != nil { + toSerialize["description"] = o.Description + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Rules != nil { + toSerialize["rules"] = o.Rules + } + if o.ShortDescription != nil { + toSerialize["short_description"] = o.ShortDescription + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CustomRulesetRequestDataAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` + Rules []CustomRule `json:"rules,omitempty"` + ShortDescription *string `json:"short_description,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"description", "name", "rules", "short_description"}) + } else { + return err + } + o.Description = all.Description + o.Name = all.Name + o.Rules = all.Rules + o.ShortDescription = all.ShortDescription + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV2/model_custom_ruleset_response.go b/api/datadogV2/model_custom_ruleset_response.go new file mode 100644 index 00000000000..a6de8119150 --- /dev/null +++ b/api/datadogV2/model_custom_ruleset_response.go @@ -0,0 +1,110 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// CustomRulesetResponse +type CustomRulesetResponse struct { + // + Data CustomRuleset `json:"data"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewCustomRulesetResponse instantiates a new CustomRulesetResponse object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewCustomRulesetResponse(data CustomRuleset) *CustomRulesetResponse { + this := CustomRulesetResponse{} + this.Data = data + return &this +} + +// NewCustomRulesetResponseWithDefaults instantiates a new CustomRulesetResponse object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewCustomRulesetResponseWithDefaults() *CustomRulesetResponse { + this := CustomRulesetResponse{} + return &this +} + +// GetData returns the Data field value. +func (o *CustomRulesetResponse) GetData() CustomRuleset { + if o == nil { + var ret CustomRuleset + return ret + } + return o.Data +} + +// GetDataOk returns a tuple with the Data field value +// and a boolean to check if the value has been set. +func (o *CustomRulesetResponse) GetDataOk() (*CustomRuleset, bool) { + if o == nil { + return nil, false + } + return &o.Data, true +} + +// SetData sets field value. +func (o *CustomRulesetResponse) SetData(v CustomRuleset) { + o.Data = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o CustomRulesetResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + toSerialize["data"] = o.Data + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *CustomRulesetResponse) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *CustomRuleset `json:"data"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + if all.Data == nil { + return fmt.Errorf("required field data missing") + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = *all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_issue_case_attributes.go b/api/datadogV2/model_issue_case_attributes.go index a8d3e543838..82eed6d843a 100644 --- a/api/datadogV2/model_issue_case_attributes.go +++ b/api/datadogV2/model_issue_case_attributes.go @@ -34,7 +34,8 @@ type IssueCaseAttributes struct { ModifiedAt *time.Time `json:"modified_at,omitempty"` // Case priority Priority *CasePriority `json:"priority,omitempty"` - // Case status + // Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and CLOSED statuses. Use `status_name` instead. + // Deprecated Status *CaseStatus `json:"status,omitempty"` // Title of the case. Title *string `json:"title,omitempty"` @@ -375,6 +376,7 @@ func (o *IssueCaseAttributes) SetPriority(v CasePriority) { } // GetStatus returns the Status field value if set, zero value otherwise. +// Deprecated func (o *IssueCaseAttributes) GetStatus() CaseStatus { if o == nil || o.Status == nil { var ret CaseStatus @@ -385,6 +387,7 @@ func (o *IssueCaseAttributes) GetStatus() CaseStatus { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated func (o *IssueCaseAttributes) GetStatusOk() (*CaseStatus, bool) { if o == nil || o.Status == nil { return nil, false @@ -398,6 +401,7 @@ func (o *IssueCaseAttributes) HasStatus() bool { } // SetStatus gets a reference to the given CaseStatus and assigns it to the Status field. +// Deprecated func (o *IssueCaseAttributes) SetStatus(v CaseStatus) { o.Status = &v } diff --git a/api/datadogV2/model_language.go b/api/datadogV2/model_language.go new file mode 100644 index 00000000000..bd3726623fe --- /dev/null +++ b/api/datadogV2/model_language.go @@ -0,0 +1,84 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// Language Programming language +type Language string + +// List of Language. +const ( + LANGUAGE_PYTHON Language = "PYTHON" + LANGUAGE_JAVASCRIPT Language = "JAVASCRIPT" + LANGUAGE_TYPESCRIPT Language = "TYPESCRIPT" + LANGUAGE_JAVA Language = "JAVA" + LANGUAGE_GO Language = "GO" + LANGUAGE_YAML Language = "YAML" + LANGUAGE_RUBY Language = "RUBY" + LANGUAGE_CSHARP Language = "CSHARP" + LANGUAGE_PHP Language = "PHP" + LANGUAGE_KOTLIN Language = "KOTLIN" + LANGUAGE_SWIFT Language = "SWIFT" +) + +var allowedLanguageEnumValues = []Language{ + LANGUAGE_PYTHON, + LANGUAGE_JAVASCRIPT, + LANGUAGE_TYPESCRIPT, + LANGUAGE_JAVA, + LANGUAGE_GO, + LANGUAGE_YAML, + LANGUAGE_RUBY, + LANGUAGE_CSHARP, + LANGUAGE_PHP, + LANGUAGE_KOTLIN, + LANGUAGE_SWIFT, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *Language) GetAllowedValues() []Language { + return allowedLanguageEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *Language) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = Language(value) + return nil +} + +// NewLanguageFromValue returns a pointer to a valid Language +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewLanguageFromValue(v string) (*Language, error) { + ev := Language(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for Language: valid values are %v", v, allowedLanguageEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v Language) IsValid() bool { + for _, existing := range allowedLanguageEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to Language value. +func (v Language) Ptr() *Language { + return &v +} diff --git a/api/datadogV2/model_revert_custom_rule_revision_data_type.go b/api/datadogV2/model_revert_custom_rule_revision_data_type.go new file mode 100644 index 00000000000..3ff30eb705d --- /dev/null +++ b/api/datadogV2/model_revert_custom_rule_revision_data_type.go @@ -0,0 +1,64 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "fmt" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// RevertCustomRuleRevisionDataType Request type +type RevertCustomRuleRevisionDataType string + +// List of RevertCustomRuleRevisionDataType. +const ( + REVERTCUSTOMRULEREVISIONDATATYPE_REVERT_CUSTOM_RULE_REVISION_REQUEST RevertCustomRuleRevisionDataType = "revert_custom_rule_revision_request" +) + +var allowedRevertCustomRuleRevisionDataTypeEnumValues = []RevertCustomRuleRevisionDataType{ + REVERTCUSTOMRULEREVISIONDATATYPE_REVERT_CUSTOM_RULE_REVISION_REQUEST, +} + +// GetAllowedValues reeturns the list of possible values. +func (v *RevertCustomRuleRevisionDataType) GetAllowedValues() []RevertCustomRuleRevisionDataType { + return allowedRevertCustomRuleRevisionDataTypeEnumValues +} + +// UnmarshalJSON deserializes the given payload. +func (v *RevertCustomRuleRevisionDataType) UnmarshalJSON(src []byte) error { + var value string + err := datadog.Unmarshal(src, &value) + if err != nil { + return err + } + *v = RevertCustomRuleRevisionDataType(value) + return nil +} + +// NewRevertCustomRuleRevisionDataTypeFromValue returns a pointer to a valid RevertCustomRuleRevisionDataType +// for the value passed as argument, or an error if the value passed is not allowed by the enum. +func NewRevertCustomRuleRevisionDataTypeFromValue(v string) (*RevertCustomRuleRevisionDataType, error) { + ev := RevertCustomRuleRevisionDataType(v) + if ev.IsValid() { + return &ev, nil + } + return nil, fmt.Errorf("invalid value '%v' for RevertCustomRuleRevisionDataType: valid values are %v", v, allowedRevertCustomRuleRevisionDataTypeEnumValues) +} + +// IsValid return true if the value is valid for the enum, false otherwise. +func (v RevertCustomRuleRevisionDataType) IsValid() bool { + for _, existing := range allowedRevertCustomRuleRevisionDataTypeEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to RevertCustomRuleRevisionDataType value. +func (v RevertCustomRuleRevisionDataType) Ptr() *RevertCustomRuleRevisionDataType { + return &v +} diff --git a/api/datadogV2/model_revert_custom_rule_revision_request.go b/api/datadogV2/model_revert_custom_rule_revision_request.go new file mode 100644 index 00000000000..2bc47538c87 --- /dev/null +++ b/api/datadogV2/model_revert_custom_rule_revision_request.go @@ -0,0 +1,111 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// RevertCustomRuleRevisionRequest +type RevertCustomRuleRevisionRequest struct { + // + Data *RevertCustomRuleRevisionRequestData `json:"data,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewRevertCustomRuleRevisionRequest instantiates a new RevertCustomRuleRevisionRequest object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewRevertCustomRuleRevisionRequest() *RevertCustomRuleRevisionRequest { + this := RevertCustomRuleRevisionRequest{} + return &this +} + +// NewRevertCustomRuleRevisionRequestWithDefaults instantiates a new RevertCustomRuleRevisionRequest object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewRevertCustomRuleRevisionRequestWithDefaults() *RevertCustomRuleRevisionRequest { + this := RevertCustomRuleRevisionRequest{} + return &this +} + +// GetData returns the Data field value if set, zero value otherwise. +func (o *RevertCustomRuleRevisionRequest) GetData() RevertCustomRuleRevisionRequestData { + if o == nil || o.Data == nil { + var ret RevertCustomRuleRevisionRequestData + return ret + } + return *o.Data +} + +// GetDataOk returns a tuple with the Data field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RevertCustomRuleRevisionRequest) GetDataOk() (*RevertCustomRuleRevisionRequestData, bool) { + if o == nil || o.Data == nil { + return nil, false + } + return o.Data, true +} + +// HasData returns a boolean if a field has been set. +func (o *RevertCustomRuleRevisionRequest) HasData() bool { + return o != nil && o.Data != nil +} + +// SetData gets a reference to the given RevertCustomRuleRevisionRequestData and assigns it to the Data field. +func (o *RevertCustomRuleRevisionRequest) SetData(v RevertCustomRuleRevisionRequestData) { + o.Data = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o RevertCustomRuleRevisionRequest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Data != nil { + toSerialize["data"] = o.Data + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *RevertCustomRuleRevisionRequest) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Data *RevertCustomRuleRevisionRequestData `json:"data,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"data"}) + } else { + return err + } + + hasInvalidField := false + if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Data = all.Data + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_revert_custom_rule_revision_request_data.go b/api/datadogV2/model_revert_custom_rule_revision_request_data.go new file mode 100644 index 00000000000..7e8df247de9 --- /dev/null +++ b/api/datadogV2/model_revert_custom_rule_revision_request_data.go @@ -0,0 +1,185 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// RevertCustomRuleRevisionRequestData +type RevertCustomRuleRevisionRequestData struct { + // + Attributes *RevertCustomRuleRevisionRequestDataAttributes `json:"attributes,omitempty"` + // Request identifier + Id *string `json:"id,omitempty"` + // Request type + Type *RevertCustomRuleRevisionDataType `json:"type,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewRevertCustomRuleRevisionRequestData instantiates a new RevertCustomRuleRevisionRequestData object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewRevertCustomRuleRevisionRequestData() *RevertCustomRuleRevisionRequestData { + this := RevertCustomRuleRevisionRequestData{} + return &this +} + +// NewRevertCustomRuleRevisionRequestDataWithDefaults instantiates a new RevertCustomRuleRevisionRequestData object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewRevertCustomRuleRevisionRequestDataWithDefaults() *RevertCustomRuleRevisionRequestData { + this := RevertCustomRuleRevisionRequestData{} + return &this +} + +// GetAttributes returns the Attributes field value if set, zero value otherwise. +func (o *RevertCustomRuleRevisionRequestData) GetAttributes() RevertCustomRuleRevisionRequestDataAttributes { + if o == nil || o.Attributes == nil { + var ret RevertCustomRuleRevisionRequestDataAttributes + return ret + } + return *o.Attributes +} + +// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RevertCustomRuleRevisionRequestData) GetAttributesOk() (*RevertCustomRuleRevisionRequestDataAttributes, bool) { + if o == nil || o.Attributes == nil { + return nil, false + } + return o.Attributes, true +} + +// HasAttributes returns a boolean if a field has been set. +func (o *RevertCustomRuleRevisionRequestData) HasAttributes() bool { + return o != nil && o.Attributes != nil +} + +// SetAttributes gets a reference to the given RevertCustomRuleRevisionRequestDataAttributes and assigns it to the Attributes field. +func (o *RevertCustomRuleRevisionRequestData) SetAttributes(v RevertCustomRuleRevisionRequestDataAttributes) { + o.Attributes = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *RevertCustomRuleRevisionRequestData) GetId() string { + if o == nil || o.Id == nil { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RevertCustomRuleRevisionRequestData) GetIdOk() (*string, bool) { + if o == nil || o.Id == nil { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *RevertCustomRuleRevisionRequestData) HasId() bool { + return o != nil && o.Id != nil +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *RevertCustomRuleRevisionRequestData) SetId(v string) { + o.Id = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *RevertCustomRuleRevisionRequestData) GetType() RevertCustomRuleRevisionDataType { + if o == nil || o.Type == nil { + var ret RevertCustomRuleRevisionDataType + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RevertCustomRuleRevisionRequestData) GetTypeOk() (*RevertCustomRuleRevisionDataType, bool) { + if o == nil || o.Type == nil { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *RevertCustomRuleRevisionRequestData) HasType() bool { + return o != nil && o.Type != nil +} + +// SetType gets a reference to the given RevertCustomRuleRevisionDataType and assigns it to the Type field. +func (o *RevertCustomRuleRevisionRequestData) SetType(v RevertCustomRuleRevisionDataType) { + o.Type = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o RevertCustomRuleRevisionRequestData) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.Attributes != nil { + toSerialize["attributes"] = o.Attributes + } + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *RevertCustomRuleRevisionRequestData) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + Attributes *RevertCustomRuleRevisionRequestDataAttributes `json:"attributes,omitempty"` + Id *string `json:"id,omitempty"` + Type *RevertCustomRuleRevisionDataType `json:"type,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"}) + } else { + return err + } + + hasInvalidField := false + if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Attributes = all.Attributes + o.Id = all.Id + if all.Type != nil && !all.Type.IsValid() { + hasInvalidField = true + } else { + o.Type = all.Type + } + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + if hasInvalidField { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + + return nil +} diff --git a/api/datadogV2/model_revert_custom_rule_revision_request_data_attributes.go b/api/datadogV2/model_revert_custom_rule_revision_request_data_attributes.go new file mode 100644 index 00000000000..d3ab63be4c2 --- /dev/null +++ b/api/datadogV2/model_revert_custom_rule_revision_request_data_attributes.go @@ -0,0 +1,137 @@ +// 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 2019-Present Datadog, Inc. + +package datadogV2 + +import ( + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// RevertCustomRuleRevisionRequestDataAttributes +type RevertCustomRuleRevisionRequestDataAttributes struct { + // Current revision ID + CurrentRevision *string `json:"currentRevision,omitempty"` + // Target revision ID to revert to + RevertToRevision *string `json:"revertToRevision,omitempty"` + // UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct + UnparsedObject map[string]interface{} `json:"-"` + AdditionalProperties map[string]interface{} `json:"-"` +} + +// NewRevertCustomRuleRevisionRequestDataAttributes instantiates a new RevertCustomRuleRevisionRequestDataAttributes object. +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed. +func NewRevertCustomRuleRevisionRequestDataAttributes() *RevertCustomRuleRevisionRequestDataAttributes { + this := RevertCustomRuleRevisionRequestDataAttributes{} + return &this +} + +// NewRevertCustomRuleRevisionRequestDataAttributesWithDefaults instantiates a new RevertCustomRuleRevisionRequestDataAttributes object. +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set. +func NewRevertCustomRuleRevisionRequestDataAttributesWithDefaults() *RevertCustomRuleRevisionRequestDataAttributes { + this := RevertCustomRuleRevisionRequestDataAttributes{} + return &this +} + +// GetCurrentRevision returns the CurrentRevision field value if set, zero value otherwise. +func (o *RevertCustomRuleRevisionRequestDataAttributes) GetCurrentRevision() string { + if o == nil || o.CurrentRevision == nil { + var ret string + return ret + } + return *o.CurrentRevision +} + +// GetCurrentRevisionOk returns a tuple with the CurrentRevision field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RevertCustomRuleRevisionRequestDataAttributes) GetCurrentRevisionOk() (*string, bool) { + if o == nil || o.CurrentRevision == nil { + return nil, false + } + return o.CurrentRevision, true +} + +// HasCurrentRevision returns a boolean if a field has been set. +func (o *RevertCustomRuleRevisionRequestDataAttributes) HasCurrentRevision() bool { + return o != nil && o.CurrentRevision != nil +} + +// SetCurrentRevision gets a reference to the given string and assigns it to the CurrentRevision field. +func (o *RevertCustomRuleRevisionRequestDataAttributes) SetCurrentRevision(v string) { + o.CurrentRevision = &v +} + +// GetRevertToRevision returns the RevertToRevision field value if set, zero value otherwise. +func (o *RevertCustomRuleRevisionRequestDataAttributes) GetRevertToRevision() string { + if o == nil || o.RevertToRevision == nil { + var ret string + return ret + } + return *o.RevertToRevision +} + +// GetRevertToRevisionOk returns a tuple with the RevertToRevision field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RevertCustomRuleRevisionRequestDataAttributes) GetRevertToRevisionOk() (*string, bool) { + if o == nil || o.RevertToRevision == nil { + return nil, false + } + return o.RevertToRevision, true +} + +// HasRevertToRevision returns a boolean if a field has been set. +func (o *RevertCustomRuleRevisionRequestDataAttributes) HasRevertToRevision() bool { + return o != nil && o.RevertToRevision != nil +} + +// SetRevertToRevision gets a reference to the given string and assigns it to the RevertToRevision field. +func (o *RevertCustomRuleRevisionRequestDataAttributes) SetRevertToRevision(v string) { + o.RevertToRevision = &v +} + +// MarshalJSON serializes the struct using spec logic. +func (o RevertCustomRuleRevisionRequestDataAttributes) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return datadog.Marshal(o.UnparsedObject) + } + if o.CurrentRevision != nil { + toSerialize["currentRevision"] = o.CurrentRevision + } + if o.RevertToRevision != nil { + toSerialize["revertToRevision"] = o.RevertToRevision + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return datadog.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *RevertCustomRuleRevisionRequestDataAttributes) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + CurrentRevision *string `json:"currentRevision,omitempty"` + RevertToRevision *string `json:"revertToRevision,omitempty"` + }{} + if err = datadog.Unmarshal(bytes, &all); err != nil { + return datadog.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"currentRevision", "revertToRevision"}) + } else { + return err + } + o.CurrentRevision = all.CurrentRevision + o.RevertToRevision = all.RevertToRevision + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/examples/v2/case-management/UpdateStatus.go b/examples/v2/case-management/UpdateStatus.go index c136e8b9e17..7e14f5042f0 100644 --- a/examples/v2/case-management/UpdateStatus.go +++ b/examples/v2/case-management/UpdateStatus.go @@ -19,7 +19,7 @@ func main() { body := datadogV2.CaseUpdateStatusRequest{ Data: datadogV2.CaseUpdateStatus{ Attributes: datadogV2.CaseUpdateStatusAttributes{ - Status: datadogV2.CASESTATUS_IN_PROGRESS, + Status: datadogV2.CASESTATUS_IN_PROGRESS.Ptr(), }, Type: datadogV2.CASERESOURCETYPE_CASE, }, diff --git a/examples/v2/security-monitoring/CreateJiraIssues.go b/examples/v2/security-monitoring/CreateJiraIssues.go index cbfdb69e1c1..6b2e024ccba 100644 --- a/examples/v2/security-monitoring/CreateJiraIssues.go +++ b/examples/v2/security-monitoring/CreateJiraIssues.go @@ -17,28 +17,44 @@ func main() { Data: []datadogV2.CreateJiraIssueRequestData{ { Attributes: &datadogV2.CreateJiraIssueRequestDataAttributes{ - AssigneeId: datadog.PtrString("f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0"), - Description: datadog.PtrString("A description of the Jira issue."), - Fields: map[string]interface{}{ - "key1": "value", - "key2": "['value']", - "key3": "{'key4': 'value'}", + Title: datadog.PtrString("A title"), + Description: datadog.PtrString("A description"), + }, + Relationships: &datadogV2.CreateJiraIssueRequestDataRelationships{ + Findings: datadogV2.Findings{ + Data: []datadogV2.FindingData{ + { + Id: "eWswLWJsdC1hZm5-aS0wMjRlYTgwMzVkZTU1MGIwYQ==", + Type: datadogV2.FINDINGDATATYPE_FINDINGS, + }, + }, + }, + Project: datadogV2.CaseManagementProject{ + Data: datadogV2.CaseManagementProjectData{ + Id: "959a6f71-bac8-4027-b1d3-2264f569296f", + Type: datadogV2.CASEMANAGEMENTPROJECTDATATYPE_PROJECTS, + }, }, - Priority: datadogV2.CASEPRIORITY_NOT_DEFINED.Ptr(), - Title: datadog.PtrString("A title for the Jira issue."), + }, + Type: datadogV2.JIRAISSUESDATATYPE_JIRA_ISSUES, + }, + { + Attributes: &datadogV2.CreateJiraIssueRequestDataAttributes{ + Title: datadog.PtrString("A title"), + Description: datadog.PtrString("A description"), }, Relationships: &datadogV2.CreateJiraIssueRequestDataRelationships{ Findings: datadogV2.Findings{ Data: []datadogV2.FindingData{ { - Id: "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", + Id: "a3ZoLXNjbS14eXV-aS0wNWY5MGYwMGE4NDg2ODdlOA==", Type: datadogV2.FINDINGDATATYPE_FINDINGS, }, }, }, Project: datadogV2.CaseManagementProject{ Data: datadogV2.CaseManagementProjectData{ - Id: "aeadc05e-98a8-11ec-ac2c-da7ad0900001", + Id: "959a6f71-bac8-4027-b1d3-2264f569296f", Type: datadogV2.CASEMANAGEMENTPROJECTDATATYPE_PROJECTS, }, }, @@ -49,7 +65,6 @@ func main() { } ctx := datadog.NewDefaultContext(context.Background()) configuration := datadog.NewConfiguration() - configuration.SetUnstableOperationEnabled("v2.CreateJiraIssues", true) apiClient := datadog.NewAPIClient(configuration) api := datadogV2.NewSecurityMonitoringApi(apiClient) resp, r, err := api.CreateJiraIssues(ctx, body) diff --git a/examples/v2/security-monitoring/CreateJiraIssues_379590688.go b/examples/v2/security-monitoring/CreateJiraIssues_379590688.go new file mode 100644 index 00000000000..2256c08e332 --- /dev/null +++ b/examples/v2/security-monitoring/CreateJiraIssues_379590688.go @@ -0,0 +1,56 @@ +// Create Jira issue for security finding returns "Created" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.CreateJiraIssueRequestArray{ + Data: []datadogV2.CreateJiraIssueRequestData{ + { + Attributes: &datadogV2.CreateJiraIssueRequestDataAttributes{ + Title: datadog.PtrString("A title"), + Description: datadog.PtrString("A description"), + }, + Relationships: &datadogV2.CreateJiraIssueRequestDataRelationships{ + Findings: datadogV2.Findings{ + Data: []datadogV2.FindingData{ + { + Id: "YmNlZmJhYTcyMDU5ZDk0ZDhiNjRmNGI0NDk4MDdiNzN-MDJlMjg0NzNmYzJiODY2MzJkNjU0OTI4NmVhZTUyY2U=", + Type: datadogV2.FINDINGDATATYPE_FINDINGS, + }, + }, + }, + Project: datadogV2.CaseManagementProject{ + Data: datadogV2.CaseManagementProjectData{ + Id: "959a6f71-bac8-4027-b1d3-2264f569296f", + Type: datadogV2.CASEMANAGEMENTPROJECTDATATYPE_PROJECTS, + }, + }, + }, + Type: datadogV2.JIRAISSUESDATATYPE_JIRA_ISSUES, + }, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewSecurityMonitoringApi(apiClient) + resp, r, err := api.CreateJiraIssues(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SecurityMonitoringApi.CreateJiraIssues`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `SecurityMonitoringApi.CreateJiraIssues`:\n%s\n", responseContent) +} diff --git a/examples/v2/security-monitoring/CreateJiraIssues_829823123.go b/examples/v2/security-monitoring/CreateJiraIssues_829823123.go new file mode 100644 index 00000000000..8b38a5d8631 --- /dev/null +++ b/examples/v2/security-monitoring/CreateJiraIssues_829823123.go @@ -0,0 +1,60 @@ +// Create Jira issue for security findings returns "Created" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.CreateJiraIssueRequestArray{ + Data: []datadogV2.CreateJiraIssueRequestData{ + { + Attributes: &datadogV2.CreateJiraIssueRequestDataAttributes{ + Title: datadog.PtrString("A title"), + Description: datadog.PtrString("A description"), + }, + Relationships: &datadogV2.CreateJiraIssueRequestDataRelationships{ + Findings: datadogV2.Findings{ + Data: []datadogV2.FindingData{ + { + Id: "a3ZoLXNjbS14eXV-aS0wNWY5MGYwMGE4NDg2ODdlOA==", + Type: datadogV2.FINDINGDATATYPE_FINDINGS, + }, + { + Id: "eWswLWJsdC1hZm5-aS0wMjRlYTgwMzVkZTU1MGIwYQ==", + Type: datadogV2.FINDINGDATATYPE_FINDINGS, + }, + }, + }, + Project: datadogV2.CaseManagementProject{ + Data: datadogV2.CaseManagementProjectData{ + Id: "959a6f71-bac8-4027-b1d3-2264f569296f", + Type: datadogV2.CASEMANAGEMENTPROJECTDATATYPE_PROJECTS, + }, + }, + }, + Type: datadogV2.JIRAISSUESDATATYPE_JIRA_ISSUES, + }, + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewSecurityMonitoringApi(apiClient) + resp, r, err := api.CreateJiraIssues(ctx, body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `SecurityMonitoringApi.CreateJiraIssues`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `SecurityMonitoringApi.CreateJiraIssues`:\n%s\n", responseContent) +} diff --git a/examples/v2/static-analysis/CreateCustomRule.go b/examples/v2/static-analysis/CreateCustomRule.go new file mode 100644 index 00000000000..a104b9c2a22 --- /dev/null +++ b/examples/v2/static-analysis/CreateCustomRule.go @@ -0,0 +1,36 @@ +// Create Custom Rule returns "Successfully created" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.CustomRuleRequest{ + Data: &datadogV2.CustomRuleRequestData{ + Attributes: &datadogV2.CustomRuleRequestDataAttributes{}, + Type: datadogV2.CUSTOMRULEDATATYPE_CUSTOM_RULE.Ptr(), + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.CreateCustomRule", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewStaticAnalysisApi(apiClient) + resp, r, err := api.CreateCustomRule(ctx, "ruleset_name", body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StaticAnalysisApi.CreateCustomRule`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `StaticAnalysisApi.CreateCustomRule`:\n%s\n", responseContent) +} diff --git a/examples/v2/static-analysis/CreateCustomRuleRevision.go b/examples/v2/static-analysis/CreateCustomRuleRevision.go new file mode 100644 index 00000000000..d81c62d679a --- /dev/null +++ b/examples/v2/static-analysis/CreateCustomRuleRevision.go @@ -0,0 +1,64 @@ +// Create Custom Rule Revision returns "Successfully created" response + +package main + +import ( + "context" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.CustomRuleRevisionRequest{ + Data: &datadogV2.CustomRuleRevisionRequestData{ + Attributes: &datadogV2.CustomRuleRevisionInputAttributes{ + Arguments: []datadogV2.Argument{ + { + Description: "YXJndW1lbnQgZGVzY3JpcHRpb24=", + Name: "YXJndW1lbnRfbmFtZQ==", + }, + }, + Category: datadogV2.CUSTOMRULEREVISIONATTRIBUTESCATEGORY_SECURITY, + Code: "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==", + CreationMessage: "Initial revision", + Cve: *datadog.NewNullableString(datadog.PtrString("CVE-2024-1234")), + Cwe: *datadog.NewNullableString(datadog.PtrString("CWE-79")), + Description: "bG9uZyBkZXNjcmlwdGlvbg==", + DocumentationUrl: *datadog.NewNullableString(datadog.PtrString("https://docs.example.com/rules/my-rule")), + IsPublished: false, + IsTesting: false, + Language: datadogV2.LANGUAGE_PYTHON, + Severity: datadogV2.CUSTOMRULEREVISIONATTRIBUTESSEVERITY_ERROR, + ShortDescription: "c2hvcnQgZGVzY3JpcHRpb24=", + ShouldUseAiFix: false, + Tags: []string{ + "security", + "custom", + }, + Tests: []datadogV2.CustomRuleRevisionTest{ + { + AnnotationCount: 1, + Code: "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==", + Filename: "test.yaml", + }, + }, + TreeSitterQuery: "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==", + }, + Type: datadogV2.CUSTOMRULEREVISIONDATATYPE_CUSTOM_RULE_REVISION.Ptr(), + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.CreateCustomRuleRevision", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewStaticAnalysisApi(apiClient) + r, err := api.CreateCustomRuleRevision(ctx, "ruleset_name", "rule_name", body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StaticAnalysisApi.CreateCustomRuleRevision`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} diff --git a/examples/v2/static-analysis/DeleteCustomRule.go b/examples/v2/static-analysis/DeleteCustomRule.go new file mode 100644 index 00000000000..4800bd13d77 --- /dev/null +++ b/examples/v2/static-analysis/DeleteCustomRule.go @@ -0,0 +1,26 @@ +// Delete Custom Rule returns "Successfully deleted" response + +package main + +import ( + "context" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.DeleteCustomRule", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewStaticAnalysisApi(apiClient) + r, err := api.DeleteCustomRule(ctx, "ruleset_name", "rule_name") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StaticAnalysisApi.DeleteCustomRule`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} diff --git a/examples/v2/static-analysis/DeleteCustomRuleset.go b/examples/v2/static-analysis/DeleteCustomRuleset.go new file mode 100644 index 00000000000..cd477fd434b --- /dev/null +++ b/examples/v2/static-analysis/DeleteCustomRuleset.go @@ -0,0 +1,26 @@ +// Delete Custom Ruleset returns "Successfully deleted" response + +package main + +import ( + "context" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.DeleteCustomRuleset", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewStaticAnalysisApi(apiClient) + r, err := api.DeleteCustomRuleset(ctx, "ruleset_name") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StaticAnalysisApi.DeleteCustomRuleset`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} diff --git a/examples/v2/static-analysis/GetCustomRule.go b/examples/v2/static-analysis/GetCustomRule.go new file mode 100644 index 00000000000..c1fcd8bb973 --- /dev/null +++ b/examples/v2/static-analysis/GetCustomRule.go @@ -0,0 +1,30 @@ +// Show Custom Rule returns "Successful response" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.GetCustomRule", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewStaticAnalysisApi(apiClient) + resp, r, err := api.GetCustomRule(ctx, "ruleset_name", "rule_name") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StaticAnalysisApi.GetCustomRule`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `StaticAnalysisApi.GetCustomRule`:\n%s\n", responseContent) +} diff --git a/examples/v2/static-analysis/GetCustomRuleRevision.go b/examples/v2/static-analysis/GetCustomRuleRevision.go new file mode 100644 index 00000000000..38bd676f12c --- /dev/null +++ b/examples/v2/static-analysis/GetCustomRuleRevision.go @@ -0,0 +1,30 @@ +// Show Custom Rule Revision returns "Successful response" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.GetCustomRuleRevision", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewStaticAnalysisApi(apiClient) + resp, r, err := api.GetCustomRuleRevision(ctx, "ruleset_name", "rule_name", "id") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StaticAnalysisApi.GetCustomRuleRevision`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `StaticAnalysisApi.GetCustomRuleRevision`:\n%s\n", responseContent) +} diff --git a/examples/v2/static-analysis/GetCustomRuleset.go b/examples/v2/static-analysis/GetCustomRuleset.go new file mode 100644 index 00000000000..8c5d8142107 --- /dev/null +++ b/examples/v2/static-analysis/GetCustomRuleset.go @@ -0,0 +1,30 @@ +// Show Custom Ruleset returns "Successful response" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.GetCustomRuleset", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewStaticAnalysisApi(apiClient) + resp, r, err := api.GetCustomRuleset(ctx, "ruleset_name") + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StaticAnalysisApi.GetCustomRuleset`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `StaticAnalysisApi.GetCustomRuleset`:\n%s\n", responseContent) +} diff --git a/examples/v2/static-analysis/ListCustomRuleRevisions.go b/examples/v2/static-analysis/ListCustomRuleRevisions.go new file mode 100644 index 00000000000..e0824c7b3e6 --- /dev/null +++ b/examples/v2/static-analysis/ListCustomRuleRevisions.go @@ -0,0 +1,30 @@ +// List Custom Rule Revisions returns "Successful response" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.ListCustomRuleRevisions", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewStaticAnalysisApi(apiClient) + resp, r, err := api.ListCustomRuleRevisions(ctx, "ruleset_name", "rule_name", *datadogV2.NewListCustomRuleRevisionsOptionalParameters()) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StaticAnalysisApi.ListCustomRuleRevisions`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `StaticAnalysisApi.ListCustomRuleRevisions`:\n%s\n", responseContent) +} diff --git a/examples/v2/static-analysis/ListCustomRuleRevisions_3739033293.go b/examples/v2/static-analysis/ListCustomRuleRevisions_3739033293.go new file mode 100644 index 00000000000..3424b9bf1a5 --- /dev/null +++ b/examples/v2/static-analysis/ListCustomRuleRevisions_3739033293.go @@ -0,0 +1,30 @@ +// List Custom Rule Revisions returns "Successful response" response with pagination + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.ListCustomRuleRevisions", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewStaticAnalysisApi(apiClient) + resp, _ := api.ListCustomRuleRevisionsWithPagination(ctx, "ruleset_name", "rule_name", *datadogV2.NewListCustomRuleRevisionsOptionalParameters()) + + for paginationResult := range resp { + if paginationResult.Error != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StaticAnalysisApi.ListCustomRuleRevisions`: %v\n", paginationResult.Error) + } + responseContent, _ := json.MarshalIndent(paginationResult.Item, "", " ") + fmt.Fprintf(os.Stdout, "%s\n", responseContent) + } +} diff --git a/examples/v2/static-analysis/RevertCustomRuleRevision.go b/examples/v2/static-analysis/RevertCustomRuleRevision.go new file mode 100644 index 00000000000..34a53f40520 --- /dev/null +++ b/examples/v2/static-analysis/RevertCustomRuleRevision.go @@ -0,0 +1,32 @@ +// Revert Custom Rule Revision returns "Successfully reverted" response + +package main + +import ( + "context" + "fmt" + "os" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.RevertCustomRuleRevisionRequest{ + Data: &datadogV2.RevertCustomRuleRevisionRequestData{ + Attributes: &datadogV2.RevertCustomRuleRevisionRequestDataAttributes{}, + Type: datadogV2.REVERTCUSTOMRULEREVISIONDATATYPE_REVERT_CUSTOM_RULE_REVISION_REQUEST.Ptr(), + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.RevertCustomRuleRevision", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewStaticAnalysisApi(apiClient) + r, err := api.RevertCustomRuleRevision(ctx, "ruleset_name", "rule_name", body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StaticAnalysisApi.RevertCustomRuleRevision`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } +} diff --git a/examples/v2/static-analysis/UpdateCustomRuleset.go b/examples/v2/static-analysis/UpdateCustomRuleset.go new file mode 100644 index 00000000000..9a72e97c54f --- /dev/null +++ b/examples/v2/static-analysis/UpdateCustomRuleset.go @@ -0,0 +1,85 @@ +// Update Custom Ruleset returns "Successfully updated" response + +package main + +import ( + "context" + "encoding/json" + "fmt" + "os" + "time" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" + "github.com/DataDog/datadog-api-client-go/v2/api/datadogV2" +) + +func main() { + body := datadogV2.CustomRulesetRequest{ + Data: &datadogV2.CustomRulesetRequestData{ + Attributes: &datadogV2.CustomRulesetRequestDataAttributes{ + Rules: []datadogV2.CustomRule{ + { + CreatedAt: time.Date(2026, 1, 9, 13, 0, 57, 473141, time.UTC), + CreatedBy: "foobarbaz", + LastRevision: datadogV2.CustomRuleRevision{ + Attributes: datadogV2.CustomRuleRevisionAttributes{ + Arguments: []datadogV2.Argument{ + { + Description: "YXJndW1lbnQgZGVzY3JpcHRpb24=", + Name: "YXJndW1lbnRfbmFtZQ==", + }, + }, + Category: datadogV2.CUSTOMRULEREVISIONATTRIBUTESCATEGORY_SECURITY, + Checksum: "8a66c4e4e631099ad71be3c1ea3ea8fc2d57193e56db2c296e2dd8a508b26b99", + Code: "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==", + CreatedAt: time.Date(2026, 1, 9, 13, 0, 57, 473141, time.UTC), + CreatedBy: "foobarbaz", + CreationMessage: "Initial revision", + Cve: *datadog.NewNullableString(datadog.PtrString("CVE-2024-1234")), + Cwe: *datadog.NewNullableString(datadog.PtrString("CWE-79")), + Description: "bG9uZyBkZXNjcmlwdGlvbg==", + DocumentationUrl: *datadog.NewNullableString(datadog.PtrString("https://docs.example.com/rules/my-rule")), + IsPublished: false, + IsTesting: false, + Language: datadogV2.LANGUAGE_PYTHON, + Severity: datadogV2.CUSTOMRULEREVISIONATTRIBUTESSEVERITY_ERROR, + ShortDescription: "c2hvcnQgZGVzY3JpcHRpb24=", + ShouldUseAiFix: false, + Tags: []string{ + "security", + "custom", + }, + Tests: []datadogV2.CustomRuleRevisionTest{ + { + AnnotationCount: 1, + Code: "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==", + Filename: "test.yaml", + }, + }, + TreeSitterQuery: "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==", + }, + Id: "revision-123", + Type: datadogV2.CUSTOMRULEREVISIONDATATYPE_CUSTOM_RULE_REVISION, + }, + Name: "my-rule", + }, + }, + }, + Type: datadogV2.CUSTOMRULESETDATATYPE_CUSTOM_RULESET.Ptr(), + }, + } + ctx := datadog.NewDefaultContext(context.Background()) + configuration := datadog.NewConfiguration() + configuration.SetUnstableOperationEnabled("v2.UpdateCustomRuleset", true) + apiClient := datadog.NewAPIClient(configuration) + api := datadogV2.NewStaticAnalysisApi(apiClient) + resp, r, err := api.UpdateCustomRuleset(ctx, "ruleset_name", body) + + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StaticAnalysisApi.UpdateCustomRuleset`: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + + responseContent, _ := json.MarshalIndent(resp, "", " ") + fmt.Fprintf(os.Stdout, "Response from `StaticAnalysisApi.UpdateCustomRuleset`:\n%s\n", responseContent) +} diff --git a/examples/v2/status-pages/CreateStatusPage.go b/examples/v2/status-pages/CreateStatusPage.go index 3ec3221d25d..b9121cc2551 100644 --- a/examples/v2/status-pages/CreateStatusPage.go +++ b/examples/v2/status-pages/CreateStatusPage.go @@ -17,7 +17,7 @@ func main() { Data: &datadogV2.CreateStatusPageRequestData{ Attributes: &datadogV2.CreateStatusPageRequestDataAttributes{ Name: "A Status Page", - DomainPrefix: "status-page-5e2fd69be33e79aa", + DomainPrefix: "5e2fd69be33e79aa", Components: []datadogV2.CreateStatusPageRequestDataAttributesComponentsItems{ { Name: datadog.PtrString("Login"), diff --git a/tests/scenarios/actions.go b/tests/scenarios/actions.go index ea57626153b..1697682c931 100644 --- a/tests/scenarios/actions.go +++ b/tests/scenarios/actions.go @@ -343,6 +343,34 @@ func GetRequestsUndo(ctx gobdd.Context, version string, operationID string) (fun } } sourceJSONData = requestJSON + } else if *undo.Undo.Parameters[i-1].Origin == "path" { + // Extract from stored path parameters + pathParams := GetPathParameters(ctx) + if undo.Undo.Parameters[i-1].Source != nil { + paramName := *undo.Undo.Parameters[i-1].Source + if val, ok := pathParams[paramName]; ok { + // Convert the stored value to the expected type + object := reflect.New(undoOperation.Type().In(i)) + sourceJSON, err := datadog.Marshal(val) + if err != nil { + t.Fatalf("Error marshalling path parameter '%s': %v", paramName, err) + return + } + err = datadog.Unmarshal(sourceJSON, object.Interface()) + if err != nil { + t.Fatalf("Error unmarshalling path parameter '%s': %v", paramName, err) + return + } + in[i] = object.Elem() + continue // Skip template/source processing for path parameters + } else { + t.Fatalf("Path parameter '%s' not found", paramName) + return + } + } else { + t.Fatalf("Path origin requires 'source' field") + return + } } else if *undo.Undo.Parameters[i-1].Origin == "response" { sourceJSONData = responseJSON } diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_Jira_issue_for_security_finding_returns_Created_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_Jira_issue_for_security_finding_returns_Created_response.freeze new file mode 100644 index 00000000000..a96661d790d --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_Jira_issue_for_security_finding_returns_Created_response.freeze @@ -0,0 +1 @@ +2026-01-02T17:04:07.979Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_Jira_issue_for_security_finding_returns_Created_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_Jira_issue_for_security_finding_returns_Created_response.yaml new file mode 100644 index 00000000000..0bddcfb10a7 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_Jira_issue_for_security_finding_returns_Created_response.yaml @@ -0,0 +1,42 @@ +interactions: +- request: + body: | + {"data":[{"attributes":{"description":"A description","title":"A title"},"relationships":{"findings":{"data":[{"id":"YmNlZmJhYTcyMDU5ZDk0ZDhiNjRmNGI0NDk4MDdiNzN-MDJlMjg0NzNmYzJiODY2MzJkNjU0OTI4NmVhZTUyY2U=","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"jira_issues"}]} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/security/findings/jira_issues + response: + body: '{"data":[{"id":"b5b9ee39-29f8-4b84-a878-28e597e2a33f","type":"cases","attributes":{"created_at":"2026-01-02T17:04:10.514692Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/csm/vm?query=%40workflow.integrations.cases.id%3A%2A\u0026vulnerability=bcefbaa72059d94d8b64f4b449807b73","resource_id":"YmNlZmJhYTcyMDU5ZDk0ZDhiNjRmNGI0NDk4MDdiNzN-MDJlMjg0NzNmYzJiODY2MzJkNjU0OTI4NmVhZTUyY2U="}],"jira_issue":{"status":"COMPLETED","result":{"issue_id":"2523546","issue_key":"CSMSEC-105847","issue_url":"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105847","account_id":"fdcffa62-24ab-4914-a195-a22bdc607030"}},"key":"CSMINV-521","modified_at":"2026-01-02T17:04:11.504549Z","priority":"P4","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}}]}' + code: 201 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 201 Created +- request: + body: | + {"data":{"relationships":{"findings":{"data":[{"id":"YmNlZmJhYTcyMDU5ZDk0ZDhiNjRmNGI0NDk4MDdiNzN-MDJlMjg0NzNmYzJiODY2MzJkNjU0OTI4NmVhZTUyY2U=","type":"findings"}]}},"type":"cases"}} + form: {} + headers: + Accept: + - '*/*' + Content-Type: + - application/json + id: 1 + method: DELETE + url: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: '' + code: 204 + duration: 0ms + headers: {} + status: 204 No Content +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_Jira_issue_for_security_findings_returns_Created_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_Jira_issue_for_security_findings_returns_Created_response.freeze new file mode 100644 index 00000000000..536270faa5a --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_Jira_issue_for_security_findings_returns_Created_response.freeze @@ -0,0 +1 @@ +2026-01-02T17:21:33.080Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_Jira_issue_for_security_findings_returns_Created_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_Jira_issue_for_security_findings_returns_Created_response.yaml new file mode 100644 index 00000000000..d09946f374d --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_Jira_issue_for_security_findings_returns_Created_response.yaml @@ -0,0 +1,42 @@ +interactions: +- request: + body: | + {"data":[{"attributes":{"description":"A description","title":"A title"},"relationships":{"findings":{"data":[{"id":"a3ZoLXNjbS14eXV-aS0wNWY5MGYwMGE4NDg2ODdlOA==","type":"findings"},{"id":"eWswLWJsdC1hZm5-aS0wMjRlYTgwMzVkZTU1MGIwYQ==","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"jira_issues"}]} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/security/findings/jira_issues + response: + body: '{"data":[{"id":"527aa591-d40e-4445-be80-9d012ba8397e","type":"cases","attributes":{"created_at":"2026-01-02T17:21:34.65318Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/compliance?panels=cpfinding%7Cevent%7CruleId%3Akvh-scm-xyu%7CresourceId%3Ai-05f90f00a848687e8\u0026query=%40finding_id%3Aa3ZoLXNjbS14eXV-aS0wNWY5MGYwMGE4NDg2ODdlOA%3D%3D","resource_id":"a3ZoLXNjbS14eXV-aS0wNWY5MGYwMGE4NDg2ODdlOA=="},{"type":"SECURITY_FINDING","ref":"/security/compliance?panels=cpfinding%7Cevent%7CruleId%3Ayk0-blt-afn%7CresourceId%3Ai-024ea8035de550b0a\u0026query=%40finding_id%3AeWswLWJsdC1hZm5-aS0wMjRlYTgwMzVkZTU1MGIwYQ%3D%3D","resource_id":"eWswLWJsdC1hZm5-aS0wMjRlYTgwMzVkZTU1MGIwYQ=="}],"jira_issue":{"status":"COMPLETED","result":{"issue_id":"2523579","issue_key":"CSMSEC-105849","issue_url":"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105849","account_id":"fdcffa62-24ab-4914-a195-a22bdc607030"}},"key":"CSMINV-523","modified_at":"2026-01-02T17:21:35.836445Z","priority":"P3","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}}]}' + code: 201 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 201 Created +- request: + body: | + {"data":{"relationships":{"findings":{"data":[{"id":"a3ZoLXNjbS14eXV-aS0wNWY5MGYwMGE4NDg2ODdlOA==","type":"findings"}]}},"type":"cases"}} + form: {} + headers: + Accept: + - '*/*' + Content-Type: + - application/json + id: 1 + method: DELETE + url: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: '' + code: 204 + duration: 0ms + headers: {} + status: 204 No Content +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_Jira_issues_for_security_findings_returns_Bad_Request_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_Jira_issues_for_security_findings_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..6b40b01ad63 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_Jira_issues_for_security_findings_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2026-01-02T16:54:04.434Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_Jira_issues_for_security_findings_returns_Bad_Request_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_Jira_issues_for_security_findings_returns_Bad_Request_response.yaml new file mode 100644 index 00000000000..820d7350770 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_Jira_issues_for_security_findings_returns_Bad_Request_response.yaml @@ -0,0 +1,22 @@ +interactions: +- request: + body: | + {"data":[{"attributes":{},"relationships":{"findings":{"data":[]},"project":{"data":{"id":"7f198869-c7ef-4afc-97cf-da5cdc13b5c3","type":"projects"}}},"type":"jira_issues"}]} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/security/findings/jira_issues + response: + body: '{"errors":[{"status":"400","title":"Bad Request","detail":"no finding provided"}]}' + code: 400 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 400 Bad Request +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_Jira_issues_for_security_findings_returns_Created_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_Jira_issues_for_security_findings_returns_Created_response.freeze new file mode 100644 index 00000000000..0a903f8222a --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_Jira_issues_for_security_findings_returns_Created_response.freeze @@ -0,0 +1 @@ +2026-01-02T17:23:28.665Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_Jira_issues_for_security_findings_returns_Created_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_Jira_issues_for_security_findings_returns_Created_response.yaml new file mode 100644 index 00000000000..6f00e519b62 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_Jira_issues_for_security_findings_returns_Created_response.yaml @@ -0,0 +1,44 @@ +interactions: +- request: + body: | + {"data":[{"attributes":{"description":"A description","title":"A title"},"relationships":{"findings":{"data":[{"id":"eWswLWJsdC1hZm5-aS0wMjRlYTgwMzVkZTU1MGIwYQ==","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"jira_issues"},{"attributes":{"description":"A description","title":"A title"},"relationships":{"findings":{"data":[{"id":"a3ZoLXNjbS14eXV-aS0wNWY5MGYwMGE4NDg2ODdlOA==","type":"findings"}]},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}},"type":"jira_issues"}]} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/security/findings/jira_issues + response: + body: '{"data":[{"id":"3f234879-c155-4104-8605-a956c6157fa2","type":"cases","attributes":{"created_at":"2026-01-02T17:23:30.862128Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/compliance?panels=cpfinding%7Cevent%7CruleId%3Ayk0-blt-afn%7CresourceId%3Ai-024ea8035de550b0a\u0026query=%40finding_id%3AeWswLWJsdC1hZm5-aS0wMjRlYTgwMzVkZTU1MGIwYQ%3D%3D","resource_id":"eWswLWJsdC1hZm5-aS0wMjRlYTgwMzVkZTU1MGIwYQ=="}],"jira_issue":{"status":"COMPLETED","result":{"issue_id":"2523584","issue_key":"CSMSEC-105851","issue_url":"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105851","account_id":"fdcffa62-24ab-4914-a195-a22bdc607030"}},"key":"CSMINV-524","modified_at":"2026-01-02T17:23:32.188706Z","priority":"P3","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}},{"id":"55b8c3c1-7080-4e13-b5fc-6bb658609fb7","type":"cases","attributes":{"created_at":"2026-01-02T17:23:30.862076Z","creation_source":"CS_SECURITY_FINDING","description":"A + description","insights":[{"type":"SECURITY_FINDING","ref":"/security/compliance?panels=cpfinding%7Cevent%7CruleId%3Akvh-scm-xyu%7CresourceId%3Ai-05f90f00a848687e8\u0026query=%40finding_id%3Aa3ZoLXNjbS14eXV-aS0wNWY5MGYwMGE4NDg2ODdlOA%3D%3D","resource_id":"a3ZoLXNjbS14eXV-aS0wNWY5MGYwMGE4NDg2ODdlOA=="}],"jira_issue":{"status":"COMPLETED","result":{"issue_id":"2523583","issue_key":"CSMSEC-105850","issue_url":"https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105850","account_id":"fdcffa62-24ab-4914-a195-a22bdc607030"}},"key":"CSMINV-525","modified_at":"2026-01-02T17:23:31.898339Z","priority":"P3","status":"OPEN","status_group":"SG_OPEN","status_name":"Open","title":"A + title","type":"SECURITY"},"relationships":{"created_by":{"data":{"id":"dc09afab-6ae7-11ef-92b1-828dac1b0195","type":"users"}},"project":{"data":{"id":"959a6f71-bac8-4027-b1d3-2264f569296f","type":"projects"}}}}]}' + code: 201 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 201 Created +- request: + body: | + {"data":{"relationships":{"findings":{"data":[{"id":"eWswLWJsdC1hZm5-aS0wMjRlYTgwMzVkZTU1MGIwYQ==","type":"findings"}]}},"type":"cases"}} + form: {} + headers: + Accept: + - '*/*' + Content-Type: + - application/json + id: 1 + method: DELETE + url: https://api.datadoghq.com/api/v2/security/findings/cases + response: + body: '' + code: 204 + duration: 0ms + headers: {} + status: 204 No Content +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_Jira_issues_for_security_findings_returns_Not_Found_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_Jira_issues_for_security_findings_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..9fd2d2504eb --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_Jira_issues_for_security_findings_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2026-01-02T16:58:53.646Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_Jira_issues_for_security_findings_returns_Not_Found_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_Jira_issues_for_security_findings_returns_Not_Found_response.yaml new file mode 100644 index 00000000000..2b5bc2ae531 --- /dev/null +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Create_Jira_issues_for_security_findings_returns_Not_Found_response.yaml @@ -0,0 +1,22 @@ +interactions: +- request: + body: | + {"data":[{"attributes":{},"relationships":{"findings":{"data":[{"id":"ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=","type":"findings"}]},"project":{"data":{"id":"00000000-0000-0000-0000-000000000000","type":"projects"}}},"type":"jira_issues"}]} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + id: 0 + method: POST + url: https://api.datadoghq.com/api/v2/security/findings/jira_issues + response: + body: '{"errors":[{"status":"404","title":"Not Found","detail":"finding not found"}]}' + code: 404 + duration: 0ms + headers: + Content-Type: + - application/vnd.api+json + status: 404 Not Found +version: 2 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Delete_a_suppression_rule_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Delete_a_suppression_rule_returns_OK_response.freeze index ec35b858851..e97b2eea30e 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Delete_a_suppression_rule_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Delete_a_suppression_rule_returns_OK_response.freeze @@ -1 +1 @@ -2026-01-14T17:29:03.168Z \ No newline at end of file +2026-01-21T15:35:04.231Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Delete_a_suppression_rule_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Delete_a_suppression_rule_returns_OK_response.yaml index 2f5acbe912e..afc43fa741c 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Delete_a_suppression_rule_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Delete_a_suppression_rule_returns_OK_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"description":"Test-Delete_a_suppression_rule_returns_OK_response-1768411743","enabled":true,"name":"suppression Test-Delete_a_suppression_rule_returns_OK_response-1768411743","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}} + {"data":{"attributes":{"description":"Test-Delete_a_suppression_rule_returns_OK_response-1769009704","enabled":true,"name":"suppression cf0b1697c5006472","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}} form: {} headers: Accept: @@ -12,9 +12,9 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions response: - body: '{"data":{"id":"itm-ljs-0qw","type":"suppressions","attributes":{"creation_date":1768411744411,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account"},"data_exclusion_query":"","description":"Test-Delete_a_suppression_rule_returns_OK_response-1768411743","editable":true,"enabled":true,"name":"suppression - Test-Delete_a_suppression_rule_returns_OK_response-1768411743","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1768411744411,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + body: '{"data":{"id":"9e0-jx9-qxd","type":"suppressions","attributes":{"creation_date":1769009705137,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"data_exclusion_query":"","description":"Test-Delete_a_suppression_rule_returns_OK_response-1769009704","editable":true,"enabled":true,"name":"suppression + cf0b1697c5006472","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1769009705137,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI Account"},"version":1}}}' code: 200 duration: 0ms @@ -30,7 +30,7 @@ interactions: - '*/*' id: 1 method: DELETE - url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/itm-ljs-0qw + url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/9e0-jx9-qxd response: body: '' code: 204 @@ -45,9 +45,9 @@ interactions: - '*/*' id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/itm-ljs-0qw + url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/9e0-jx9-qxd response: - body: '{"errors":["not_found(Suppression with ID itm-ljs-0qw not found)"]}' + body: '{"errors":["not_found(Suppression with ID 9e0-jx9-qxd not found)"]}' code: 404 duration: 0ms headers: diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_a_suppression_rule_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_a_suppression_rule_returns_OK_response.freeze index 16f1a15eddc..1587aa37ce9 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_a_suppression_rule_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_a_suppression_rule_returns_OK_response.freeze @@ -1 +1 @@ -2026-01-14T17:29:04.856Z \ No newline at end of file +2026-01-21T15:35:05.393Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_a_suppression_rule_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_a_suppression_rule_returns_OK_response.yaml index 311c988db53..03dfc9845d7 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_a_suppression_rule_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_a_suppression_rule_returns_OK_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"description":"Test-Get_a_suppression_rule_returns_OK_response-1768411744","enabled":true,"name":"suppression Test-Get_a_suppression_rule_returns_OK_response-1768411744","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}} + {"data":{"attributes":{"description":"Test-Get_a_suppression_rule_returns_OK_response-1769009705","enabled":true,"name":"suppression 561a22ed12317d7c","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}} form: {} headers: Accept: @@ -12,9 +12,9 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions response: - body: '{"data":{"id":"xno-kwg-8df","type":"suppressions","attributes":{"creation_date":1768411744987,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account"},"data_exclusion_query":"","description":"Test-Get_a_suppression_rule_returns_OK_response-1768411744","editable":true,"enabled":true,"name":"suppression - Test-Get_a_suppression_rule_returns_OK_response-1768411744","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1768411744987,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + body: '{"data":{"id":"k8l-r8a-pfs","type":"suppressions","attributes":{"creation_date":1769009705474,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"data_exclusion_query":"","description":"Test-Get_a_suppression_rule_returns_OK_response-1769009705","editable":true,"enabled":true,"name":"suppression + 561a22ed12317d7c","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1769009705474,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI Account"},"version":1}}}' code: 200 duration: 0ms @@ -30,11 +30,11 @@ interactions: - application/json id: 1 method: GET - url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/xno-kwg-8df + url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/k8l-r8a-pfs response: - body: '{"data":{"id":"xno-kwg-8df","type":"suppressions","attributes":{"creation_date":1768411744987,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account"},"data_exclusion_query":"","description":"Test-Get_a_suppression_rule_returns_OK_response-1768411744","editable":true,"enabled":true,"name":"suppression - Test-Get_a_suppression_rule_returns_OK_response-1768411744","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1768411744987,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + body: '{"data":{"id":"k8l-r8a-pfs","type":"suppressions","attributes":{"creation_date":1769009705474,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"data_exclusion_query":"","description":"Test-Get_a_suppression_rule_returns_OK_response-1769009705","editable":true,"enabled":true,"name":"suppression + 561a22ed12317d7c","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1769009705474,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI Account"},"version":1}}}' code: 200 duration: 0ms @@ -50,7 +50,7 @@ interactions: - '*/*' id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/xno-kwg-8df + url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/k8l-r8a-pfs response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_a_suppressions_version_history_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_a_suppressions_version_history_returns_OK_response.freeze index 66913264132..f398064da83 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_a_suppressions_version_history_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_a_suppressions_version_history_returns_OK_response.freeze @@ -1 +1 @@ -2026-01-14T17:29:05.317Z \ No newline at end of file +2026-01-21T15:35:05.712Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_a_suppressions_version_history_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_a_suppressions_version_history_returns_OK_response.yaml index 9af84b745d6..49777ccfb1a 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_a_suppressions_version_history_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_a_suppressions_version_history_returns_OK_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"description":"Test-Get_a_suppression_s_version_history_returns_OK_response-1768411745","enabled":true,"name":"suppression Test-Get_a_suppression_s_version_history_returns_OK_response-1768411745","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}} + {"data":{"attributes":{"description":"Test-Get_a_suppression_s_version_history_returns_OK_response-1769009705","enabled":true,"name":"suppression ee42c68404916b9e","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}} form: {} headers: Accept: @@ -12,9 +12,9 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions response: - body: '{"data":{"id":"sro-unv-k08","type":"suppressions","attributes":{"creation_date":1768411745430,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account"},"data_exclusion_query":"","description":"Test-Get_a_suppression_s_version_history_returns_OK_response-1768411745","editable":true,"enabled":true,"name":"suppression - Test-Get_a_suppression_s_version_history_returns_OK_response-1768411745","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1768411745430,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + body: '{"data":{"id":"joc-mpc-lbz","type":"suppressions","attributes":{"creation_date":1769009705785,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"data_exclusion_query":"","description":"Test-Get_a_suppression_s_version_history_returns_OK_response-1769009705","editable":true,"enabled":true,"name":"suppression + ee42c68404916b9e","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1769009705785,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI Account"},"version":1}}}' code: 200 duration: 0ms @@ -30,12 +30,12 @@ interactions: - application/json id: 1 method: GET - url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/sro-unv-k08/version_history + url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/joc-mpc-lbz/version_history response: - body: '{"data":{"id":"sro-unv-k08","type":"suppression_version_history","attributes":{"count":1,"data":{"1":{"suppression":{"id":"sro-unv-k08","name":"suppression - Test-Get_a_suppression_s_version_history_returns_OK_response-1768411745","enabled":true,"description":"Test-Get_a_suppression_s_version_history_returns_OK_response-1768411745","rule_query":"source:cloudtrail","suppression_query":"env:test","data_exclusion_query":"","version":1,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + body: '{"data":{"id":"joc-mpc-lbz","type":"suppression_version_history","attributes":{"count":1,"data":{"1":{"suppression":{"id":"joc-mpc-lbz","name":"suppression + ee42c68404916b9e","enabled":true,"description":"Test-Get_a_suppression_s_version_history_returns_OK_response-1769009705","rule_query":"source:cloudtrail","suppression_query":"env:test","data_exclusion_query":"","version":1,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI Account"},"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account"},"creation_date":1768411745430,"update_date":1768411745430,"editable":true,"tags":["source:cloudtrail","technique:T1110-brute-force"]},"changes":[]}}}}}' + Account"},"creation_date":1769009705785,"update_date":1769009705785,"editable":true,"tags":["source:cloudtrail","technique:T1110-brute-force"]},"changes":[]}}}}}' code: 200 duration: 0ms headers: @@ -50,7 +50,7 @@ interactions: - '*/*' id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/sro-unv-k08 + url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/joc-mpc-lbz response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_all_suppression_rules_returns_OK_response_with_pagination.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_all_suppression_rules_returns_OK_response_with_pagination.freeze index 23cdf460db7..cbc0a8127fd 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_all_suppression_rules_returns_OK_response_with_pagination.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_all_suppression_rules_returns_OK_response_with_pagination.freeze @@ -1 +1 @@ -2026-01-14T17:12:28.523Z \ No newline at end of file +2026-01-21T15:35:06.001Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_all_suppression_rules_returns_OK_response_with_pagination.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_all_suppression_rules_returns_OK_response_with_pagination.yaml index 0385aceb47f..2cb0e3336cd 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_all_suppression_rules_returns_OK_response_with_pagination.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_all_suppression_rules_returns_OK_response_with_pagination.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"description":"Test-Get_all_suppression_rules_returns_OK_response_with_pagination-1768410748","enabled":true,"name":"suppression Test-Get_all_suppression_rules_returns_OK_response_with_pagination-1768410748","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}} + {"data":{"attributes":{"description":"Test-Get_all_suppression_rules_returns_OK_response_with_pagination-1769009706","enabled":true,"name":"suppression 5a71acf7699e3a9e","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}} form: {} headers: Accept: @@ -12,8 +12,10 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions response: - body: '{"data":{"id":"fgz-hyr-ibu","type":"suppressions","attributes":{"creation_date":1768410748883,"creator":{"handle":"frog@datadoghq.com","name":"frog"},"data_exclusion_query":"","description":"Test-Get_all_suppression_rules_returns_OK_response_with_pagination-1768410748","editable":true,"enabled":true,"name":"suppression - Test-Get_all_suppression_rules_returns_OK_response_with_pagination-1768410748","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1768410748883,"updater":{"handle":"frog@datadoghq.com","name":"frog"},"version":1}}}' + body: '{"data":{"id":"dgv-9mh-i77","type":"suppressions","attributes":{"creation_date":1769009706064,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"data_exclusion_query":"","description":"Test-Get_all_suppression_rules_returns_OK_response_with_pagination-1769009706","editable":true,"enabled":true,"name":"suppression + 5a71acf7699e3a9e","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1769009706064,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"version":1}}}' code: 200 duration: 0ms headers: @@ -22,7 +24,7 @@ interactions: status: 200 OK - request: body: | - {"data":{"attributes":{"description":"Test-Get_all_suppression_rules_returns_OK_response_with_pagination-1768410748","enabled":true,"name":"suppression2 Test-Get_all_suppression_rules_returns_OK_response_with_pagination-1768410748","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}} + {"data":{"attributes":{"description":"Test-Get_all_suppression_rules_returns_OK_response_with_pagination-1769009706","enabled":true,"name":"suppression2 5a71acf7699e3a9e","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}} form: {} headers: Accept: @@ -33,8 +35,10 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions response: - body: '{"data":{"id":"lgh-7no-380","type":"suppressions","attributes":{"creation_date":1768410749324,"creator":{"handle":"frog@datadoghq.com","name":"frog"},"data_exclusion_query":"","description":"Test-Get_all_suppression_rules_returns_OK_response_with_pagination-1768410748","editable":true,"enabled":true,"name":"suppression2 - Test-Get_all_suppression_rules_returns_OK_response_with_pagination-1768410748","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1768410749324,"updater":{"handle":"frog@datadoghq.com","name":"frog"},"version":1}}}' + body: '{"data":{"id":"23j-s8c-mlt","type":"suppressions","attributes":{"creation_date":1769009706152,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"data_exclusion_query":"","description":"Test-Get_all_suppression_rules_returns_OK_response_with_pagination-1769009706","editable":true,"enabled":true,"name":"suppression2 + 5a71acf7699e3a9e","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1769009706152,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"version":1}}}' code: 200 duration: 0ms headers: @@ -49,10 +53,12 @@ interactions: - application/json id: 2 method: GET - url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions?page%5Bsize%5D=1&page%5Bnumber%5D=0&query=id%3Afgz-hyr-ibu%20OR%20id%3Algh-7no-380 + url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions?page%5Bsize%5D=1&page%5Bnumber%5D=0&query=id%3Adgv-9mh-i77%20OR%20id%3A23j-s8c-mlt response: - body: '{"data":[{"id":"fgz-hyr-ibu","type":"suppressions","attributes":{"creation_date":1768410748883,"creator":{"handle":"frog@datadoghq.com","name":"frog"},"data_exclusion_query":"","description":"Test-Get_all_suppression_rules_returns_OK_response_with_pagination-1768410748","editable":true,"enabled":true,"name":"suppression - Test-Get_all_suppression_rules_returns_OK_response_with_pagination-1768410748","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1768410748883,"updater":{"handle":"frog@datadoghq.com","name":"frog"},"version":1}}],"meta":{"page":{"totalCount":2,"pageSize":1,"pageNumber":0}}}' + body: '{"data":[{"id":"dgv-9mh-i77","type":"suppressions","attributes":{"creation_date":1769009706064,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"data_exclusion_query":"","description":"Test-Get_all_suppression_rules_returns_OK_response_with_pagination-1769009706","editable":true,"enabled":true,"name":"suppression + 5a71acf7699e3a9e","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1769009706064,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"version":1}}],"meta":{"page":{"totalCount":2,"pageSize":1,"pageNumber":0}}}' code: 200 duration: 0ms headers: @@ -67,7 +73,7 @@ interactions: - '*/*' id: 3 method: DELETE - url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/lgh-7no-380 + url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/23j-s8c-mlt response: body: '' code: 204 @@ -82,7 +88,7 @@ interactions: - '*/*' id: 4 method: DELETE - url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/fgz-hyr-ibu + url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/dgv-9mh-i77 response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_all_suppression_rules_returns_OK_response_with_sort_ascending.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_all_suppression_rules_returns_OK_response_with_sort_ascending.freeze index 89bfc8cd8ef..dac8fbb4d4a 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_all_suppression_rules_returns_OK_response_with_sort_ascending.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_all_suppression_rules_returns_OK_response_with_sort_ascending.freeze @@ -1 +1 @@ -2026-01-14T17:12:30.925Z \ No newline at end of file +2026-01-21T15:35:06.453Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_all_suppression_rules_returns_OK_response_with_sort_ascending.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_all_suppression_rules_returns_OK_response_with_sort_ascending.yaml index f3bc879a757..dd4facc22c5 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_all_suppression_rules_returns_OK_response_with_sort_ascending.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_all_suppression_rules_returns_OK_response_with_sort_ascending.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_ascending-1768410750","enabled":true,"name":"suppression Test-Get_all_suppression_rules_returns_OK_response_with_sort_ascending-1768410750","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}} + {"data":{"attributes":{"description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_ascending-1769009706","enabled":true,"name":"suppression 9acb44c7d1cc0bd2","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}} form: {} headers: Accept: @@ -12,8 +12,10 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions response: - body: '{"data":{"id":"5cq-vnw-eza","type":"suppressions","attributes":{"creation_date":1768410751276,"creator":{"handle":"frog@datadoghq.com","name":"frog"},"data_exclusion_query":"","description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_ascending-1768410750","editable":true,"enabled":true,"name":"suppression - Test-Get_all_suppression_rules_returns_OK_response_with_sort_ascending-1768410750","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1768410751276,"updater":{"handle":"frog@datadoghq.com","name":"frog"},"version":1}}}' + body: '{"data":{"id":"x91-nfr-3ws","type":"suppressions","attributes":{"creation_date":1769009706525,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"data_exclusion_query":"","description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_ascending-1769009706","editable":true,"enabled":true,"name":"suppression + 9acb44c7d1cc0bd2","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1769009706525,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"version":1}}}' code: 200 duration: 0ms headers: @@ -22,7 +24,7 @@ interactions: status: 200 OK - request: body: | - {"data":{"attributes":{"description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_ascending-1768410750","enabled":true,"name":"suppression2 Test-Get_all_suppression_rules_returns_OK_response_with_sort_ascending-1768410750","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}} + {"data":{"attributes":{"description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_ascending-1769009706","enabled":true,"name":"suppression2 9acb44c7d1cc0bd2","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}} form: {} headers: Accept: @@ -33,8 +35,10 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions response: - body: '{"data":{"id":"fuu-xxd-kjd","type":"suppressions","attributes":{"creation_date":1768410751710,"creator":{"handle":"frog@datadoghq.com","name":"frog"},"data_exclusion_query":"","description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_ascending-1768410750","editable":true,"enabled":true,"name":"suppression2 - Test-Get_all_suppression_rules_returns_OK_response_with_sort_ascending-1768410750","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1768410751710,"updater":{"handle":"frog@datadoghq.com","name":"frog"},"version":1}}}' + body: '{"data":{"id":"4ni-qbs-lxd","type":"suppressions","attributes":{"creation_date":1769009706684,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"data_exclusion_query":"","description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_ascending-1769009706","editable":true,"enabled":true,"name":"suppression2 + 9acb44c7d1cc0bd2","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1769009706684,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"version":1}}}' code: 200 duration: 0ms headers: @@ -49,11 +53,15 @@ interactions: - application/json id: 2 method: GET - url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions?sort=name&query=id%3A5cq-vnw-eza%20OR%20id%3Afuu-xxd-kjd + url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions?sort=name&query=id%3Ax91-nfr-3ws%20OR%20id%3A4ni-qbs-lxd response: - body: '{"data":[{"id":"5cq-vnw-eza","type":"suppressions","attributes":{"creation_date":1768410751276,"creator":{"handle":"frog@datadoghq.com","name":"frog"},"data_exclusion_query":"","description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_ascending-1768410750","editable":true,"enabled":true,"name":"suppression - Test-Get_all_suppression_rules_returns_OK_response_with_sort_ascending-1768410750","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1768410751276,"updater":{"handle":"frog@datadoghq.com","name":"frog"},"version":1}},{"id":"fuu-xxd-kjd","type":"suppressions","attributes":{"creation_date":1768410751710,"creator":{"handle":"frog@datadoghq.com","name":"frog"},"data_exclusion_query":"","description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_ascending-1768410750","editable":true,"enabled":true,"name":"suppression2 - Test-Get_all_suppression_rules_returns_OK_response_with_sort_ascending-1768410750","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1768410751710,"updater":{"handle":"frog@datadoghq.com","name":"frog"},"version":1}}],"meta":{"page":{"totalCount":2,"pageSize":2,"pageNumber":0}}}' + body: '{"data":[{"id":"x91-nfr-3ws","type":"suppressions","attributes":{"creation_date":1769009706525,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"data_exclusion_query":"","description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_ascending-1769009706","editable":true,"enabled":true,"name":"suppression + 9acb44c7d1cc0bd2","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1769009706525,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"version":1}},{"id":"4ni-qbs-lxd","type":"suppressions","attributes":{"creation_date":1769009706684,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"data_exclusion_query":"","description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_ascending-1769009706","editable":true,"enabled":true,"name":"suppression2 + 9acb44c7d1cc0bd2","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1769009706684,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"version":1}}],"meta":{"page":{"totalCount":2,"pageSize":2,"pageNumber":0}}}' code: 200 duration: 0ms headers: @@ -68,7 +76,7 @@ interactions: - '*/*' id: 3 method: DELETE - url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/fuu-xxd-kjd + url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/4ni-qbs-lxd response: body: '' code: 204 @@ -83,7 +91,7 @@ interactions: - '*/*' id: 4 method: DELETE - url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/5cq-vnw-eza + url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/x91-nfr-3ws response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_all_suppression_rules_returns_OK_response_with_sort_descending.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_all_suppression_rules_returns_OK_response_with_sort_descending.freeze index d184a46ea08..ef4d4a296f2 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_all_suppression_rules_returns_OK_response_with_sort_descending.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_all_suppression_rules_returns_OK_response_with_sort_descending.freeze @@ -1 +1 @@ -2026-01-14T17:12:33.088Z \ No newline at end of file +2026-01-21T15:35:07.003Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_all_suppression_rules_returns_OK_response_with_sort_descending.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_all_suppression_rules_returns_OK_response_with_sort_descending.yaml index cd1fc9a60aa..4439d9d1d1d 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_all_suppression_rules_returns_OK_response_with_sort_descending.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Get_all_suppression_rules_returns_OK_response_with_sort_descending.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_descending-1768410753","enabled":true,"name":"suppression Test-Get_all_suppression_rules_returns_OK_response_with_sort_descending-1768410753","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}} + {"data":{"attributes":{"description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_descending-1769009707","enabled":true,"name":"suppression 4668d111f32d9934","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}} form: {} headers: Accept: @@ -12,8 +12,10 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions response: - body: '{"data":{"id":"osw-qyf-tqn","type":"suppressions","attributes":{"creation_date":1768410753455,"creator":{"handle":"frog@datadoghq.com","name":"frog"},"data_exclusion_query":"","description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_descending-1768410753","editable":true,"enabled":true,"name":"suppression - Test-Get_all_suppression_rules_returns_OK_response_with_sort_descending-1768410753","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1768410753455,"updater":{"handle":"frog@datadoghq.com","name":"frog"},"version":1}}}' + body: '{"data":{"id":"mru-avx-npf","type":"suppressions","attributes":{"creation_date":1769009707069,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"data_exclusion_query":"","description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_descending-1769009707","editable":true,"enabled":true,"name":"suppression + 4668d111f32d9934","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1769009707069,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"version":1}}}' code: 200 duration: 0ms headers: @@ -22,7 +24,7 @@ interactions: status: 200 OK - request: body: | - {"data":{"attributes":{"description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_descending-1768410753","enabled":true,"name":"suppression2 Test-Get_all_suppression_rules_returns_OK_response_with_sort_descending-1768410753","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}} + {"data":{"attributes":{"description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_descending-1769009707","enabled":true,"name":"suppression2 4668d111f32d9934","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}} form: {} headers: Accept: @@ -33,8 +35,10 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions response: - body: '{"data":{"id":"pe9-gdi-ee2","type":"suppressions","attributes":{"creation_date":1768410753872,"creator":{"handle":"frog@datadoghq.com","name":"frog"},"data_exclusion_query":"","description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_descending-1768410753","editable":true,"enabled":true,"name":"suppression2 - Test-Get_all_suppression_rules_returns_OK_response_with_sort_descending-1768410753","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1768410753872,"updater":{"handle":"frog@datadoghq.com","name":"frog"},"version":1}}}' + body: '{"data":{"id":"qjl-xxu-vlo","type":"suppressions","attributes":{"creation_date":1769009707163,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"data_exclusion_query":"","description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_descending-1769009707","editable":true,"enabled":true,"name":"suppression2 + 4668d111f32d9934","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1769009707163,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"version":1}}}' code: 200 duration: 0ms headers: @@ -49,11 +53,15 @@ interactions: - application/json id: 2 method: GET - url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions?sort=-name&query=id%3Aosw-qyf-tqn%20OR%20id%3Ape9-gdi-ee2 + url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions?sort=-name&query=id%3Amru-avx-npf%20OR%20id%3Aqjl-xxu-vlo response: - body: '{"data":[{"id":"pe9-gdi-ee2","type":"suppressions","attributes":{"creation_date":1768410753872,"creator":{"handle":"frog@datadoghq.com","name":"frog"},"data_exclusion_query":"","description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_descending-1768410753","editable":true,"enabled":true,"name":"suppression2 - Test-Get_all_suppression_rules_returns_OK_response_with_sort_descending-1768410753","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1768410753872,"updater":{"handle":"frog@datadoghq.com","name":"frog"},"version":1}},{"id":"osw-qyf-tqn","type":"suppressions","attributes":{"creation_date":1768410753455,"creator":{"handle":"frog@datadoghq.com","name":"frog"},"data_exclusion_query":"","description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_descending-1768410753","editable":true,"enabled":true,"name":"suppression - Test-Get_all_suppression_rules_returns_OK_response_with_sort_descending-1768410753","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1768410753455,"updater":{"handle":"frog@datadoghq.com","name":"frog"},"version":1}}],"meta":{"page":{"totalCount":2,"pageSize":2,"pageNumber":0}}}' + body: '{"data":[{"id":"qjl-xxu-vlo","type":"suppressions","attributes":{"creation_date":1769009707163,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"data_exclusion_query":"","description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_descending-1769009707","editable":true,"enabled":true,"name":"suppression2 + 4668d111f32d9934","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1769009707163,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"version":1}},{"id":"mru-avx-npf","type":"suppressions","attributes":{"creation_date":1769009707069,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"data_exclusion_query":"","description":"Test-Get_all_suppression_rules_returns_OK_response_with_sort_descending-1769009707","editable":true,"enabled":true,"name":"suppression + 4668d111f32d9934","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1769009707069,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"version":1}}],"meta":{"page":{"totalCount":2,"pageSize":2,"pageNumber":0}}}' code: 200 duration: 0ms headers: @@ -68,7 +76,7 @@ interactions: - '*/*' id: 3 method: DELETE - url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/pe9-gdi-ee2 + url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/qjl-xxu-vlo response: body: '' code: 204 @@ -83,7 +91,7 @@ interactions: - '*/*' id: 4 method: DELETE - url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/osw-qyf-tqn + url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/mru-avx-npf response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Update_a_suppression_rule_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Update_a_suppression_rule_returns_OK_response.freeze index e05f55dd710..efe791d5186 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Update_a_suppression_rule_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Update_a_suppression_rule_returns_OK_response.freeze @@ -1 +1 @@ -2026-01-14T17:29:05.825Z \ No newline at end of file +2026-01-21T15:35:07.497Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Update_a_suppression_rule_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Update_a_suppression_rule_returns_OK_response.yaml index edfb4d1023d..9df18240a3e 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Update_a_suppression_rule_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Security_Monitoring/Scenario_Update_a_suppression_rule_returns_OK_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"description":"Test-Update_a_suppression_rule_returns_OK_response-1768411745","enabled":true,"name":"suppression Test-Update_a_suppression_rule_returns_OK_response-1768411745","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}} + {"data":{"attributes":{"description":"Test-Update_a_suppression_rule_returns_OK_response-1769009707","enabled":true,"name":"suppression 181539185fcb1be7","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["technique:T1110-brute-force","source:cloudtrail"]},"type":"suppressions"}} form: {} headers: Accept: @@ -12,9 +12,9 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions response: - body: '{"data":{"id":"ucv-bpf-4bc","type":"suppressions","attributes":{"creation_date":1768411745950,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account"},"data_exclusion_query":"","description":"Test-Update_a_suppression_rule_returns_OK_response-1768411745","editable":true,"enabled":true,"name":"suppression - Test-Update_a_suppression_rule_returns_OK_response-1768411745","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1768411745950,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + body: '{"data":{"id":"h6t-xj1-5jw","type":"suppressions","attributes":{"creation_date":1769009707555,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"data_exclusion_query":"","description":"Test-Update_a_suppression_rule_returns_OK_response-1769009707","editable":true,"enabled":true,"name":"suppression + 181539185fcb1be7","rule_query":"source:cloudtrail","suppression_query":"env:test","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1769009707555,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI Account"},"version":1}}}' code: 200 duration: 0ms @@ -33,12 +33,12 @@ interactions: - application/json id: 1 method: PATCH - url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/ucv-bpf-4bc + url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/h6t-xj1-5jw response: - body: '{"data":{"id":"ucv-bpf-4bc","type":"suppressions","attributes":{"creation_date":1768411745950,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI - Account"},"data_exclusion_query":"","description":"Test-Update_a_suppression_rule_returns_OK_response-1768411745","editable":true,"enabled":true,"name":"suppression - Test-Update_a_suppression_rule_returns_OK_response-1768411745","rule_query":"source:cloudtrail","suppression_query":"env:staging - status:low","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1768411746111,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + body: '{"data":{"id":"h6t-xj1-5jw","type":"suppressions","attributes":{"creation_date":1769009707555,"creator":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"data_exclusion_query":"","description":"Test-Update_a_suppression_rule_returns_OK_response-1769009707","editable":true,"enabled":true,"name":"suppression + 181539185fcb1be7","rule_query":"source:cloudtrail","suppression_query":"env:staging + status:low","tags":["source:cloudtrail","technique:T1110-brute-force"],"update_date":1769009707651,"updater":{"handle":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI Account"},"version":2}}}' code: 200 duration: 0ms @@ -54,7 +54,7 @@ interactions: - '*/*' id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/ucv-bpf-4bc + url: https://api.datadoghq.com/api/v2/security_monitoring/configuration/suppressions/h6t-xj1-5jw response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Create_component_returns_Created_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Create_component_returns_Created_response.freeze index 8776d9784d5..7323200d4a6 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Create_component_returns_Created_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Create_component_returns_Created_response.freeze @@ -1 +1 @@ -2026-01-14T18:34:16.644Z \ No newline at end of file +2026-01-21T21:23:35.707Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Create_component_returns_Created_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Create_component_returns_Created_response.yaml index 69250aea648..b87c0bde3e4 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Create_component_returns_Created_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Create_component_returns_Created_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"components":[{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"name":"Application","type":"group"}],"domain_prefix":"status-page-34bcfd8351c0bf6c","enabled":true,"name":"A Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}} + {"data":{"attributes":{"components":[{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"name":"Application","type":"group"}],"domain_prefix":"8b6cd6e80c23846d","enabled":true,"name":"A Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}} form: {} headers: Accept: @@ -12,8 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/statuspages response: - body: '{"data":{"id":"9f8ede40-b32f-4efb-bc55-a3442b846412","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"5cb2f4f2-361a-4902-9a1a-b84e71164678","name":"Application","type":"group","position":0,"components":[{"id":"ff7ccb5e-ab5a-4fff-b6ed-39746cadc2ac","name":"Login","type":"component","status":"operational","position":0},{"id":"0cbdbc69-6b3c-4a96-8566-8e71492c2bab","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-01-14T18:34:16.802269Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"status-page-34bcfd8351c0bf6c","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-14T18:34:16.802269Z","name":"A - Status Page","page_url":"https://frog.datadoghq.com/status-pages/9f8ede40-b32f-4efb-bc55-a3442b846412/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' + body: '{"data":{"id":"b53231b9-4737-47eb-8bb8-90d2b51e0803","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"1cdd6cef-6732-4202-934c-69eb21701b5a","name":"Application","type":"group","position":0,"components":[{"id":"85c38440-50b4-4db7-b9fc-4372c4b36555","name":"Login","type":"component","status":"operational","position":0},{"id":"bfd82882-3607-4d7d-8242-072ec5b94492","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-01-21T21:23:35.875217Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"8b6cd6e80c23846d","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-21T21:23:35.875217Z","name":"A + Status Page","page_url":"https://frog.datadoghq.com/status-pages/b53231b9-4737-47eb-8bb8-90d2b51e0803/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' code: 201 duration: 0ms headers: @@ -31,9 +31,9 @@ interactions: - application/json id: 1 method: POST - url: https://api.datadoghq.com/api/v2/statuspages/9f8ede40-b32f-4efb-bc55-a3442b846412/components + url: https://api.datadoghq.com/api/v2/statuspages/b53231b9-4737-47eb-8bb8-90d2b51e0803/components response: - body: '{"data":{"id":"ad01c370-832f-4b2d-a071-9f965238bedd","type":"components","attributes":{"created_at":"2026-01-14T18:34:17.271005Z","modified_at":"2026-01-14T18:34:17.271005Z","name":"Logs","position":0,"status":"operational","type":"component"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"group":{"data":null},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"status_page":{"data":{"id":"9f8ede40-b32f-4efb-bc55-a3442b846412","type":"status_pages"}}}}}' + body: '{"data":{"id":"42f96d69-9136-4888-b822-ca0dc2013978","type":"components","attributes":{"created_at":"2026-01-21T21:23:36.340483Z","modified_at":"2026-01-21T21:23:36.340483Z","name":"Logs","position":0,"status":"operational","type":"component"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"group":{"data":null},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"status_page":{"data":{"id":"b53231b9-4737-47eb-8bb8-90d2b51e0803","type":"status_pages"}}}}}' code: 201 duration: 0ms headers: @@ -48,7 +48,7 @@ interactions: - '*/*' id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/statuspages/9f8ede40-b32f-4efb-bc55-a3442b846412/components/ad01c370-832f-4b2d-a071-9f965238bedd + url: https://api.datadoghq.com/api/v2/statuspages/b53231b9-4737-47eb-8bb8-90d2b51e0803/components/42f96d69-9136-4888-b822-ca0dc2013978 response: body: '' code: 204 @@ -63,7 +63,7 @@ interactions: - '*/*' id: 3 method: DELETE - url: https://api.datadoghq.com/api/v2/statuspages/9f8ede40-b32f-4efb-bc55-a3442b846412 + url: https://api.datadoghq.com/api/v2/statuspages/b53231b9-4737-47eb-8bb8-90d2b51e0803 response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Create_degradation_returns_Created_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Create_degradation_returns_Created_response.freeze index efeea9f60fc..2c73d078040 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Create_degradation_returns_Created_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Create_degradation_returns_Created_response.freeze @@ -1 +1 @@ -2026-01-14T18:34:17.948Z \ No newline at end of file +2026-01-21T21:23:36.959Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Create_degradation_returns_Created_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Create_degradation_returns_Created_response.yaml index de8e7ac4736..69fa63448b1 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Create_degradation_returns_Created_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Create_degradation_returns_Created_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"components":[{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"name":"Application","type":"group"}],"domain_prefix":"status-page-789a0331b83650e4","enabled":true,"name":"A Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}} + {"data":{"attributes":{"components":[{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"name":"Application","type":"group"}],"domain_prefix":"f594e675bf08d5d7","enabled":true,"name":"A Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}} form: {} headers: Accept: @@ -12,8 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/statuspages response: - body: '{"data":{"id":"df0612f3-4ee3-4627-b8a6-a34b3043e31d","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"9dd5c0f9-5bcb-4694-a8be-4f9b70b63c7e","name":"Application","type":"group","position":0,"components":[{"id":"da61bfdd-4282-49e1-bf83-d3df9f0b2e1c","name":"Login","type":"component","status":"operational","position":0},{"id":"b7ad28fd-a485-452c-81f6-2a72b5e22135","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-01-14T18:34:18.052972Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"status-page-789a0331b83650e4","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-14T18:34:18.052972Z","name":"A - Status Page","page_url":"https://frog.datadoghq.com/status-pages/df0612f3-4ee3-4627-b8a6-a34b3043e31d/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' + body: '{"data":{"id":"bb4afad2-f893-464a-82a4-d2ab29d5105c","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"8b6c8c24-95a9-449b-b508-9d3320e5cba2","name":"Application","type":"group","position":0,"components":[{"id":"43c959d9-3dda-4dc9-ae42-74b71ea39f08","name":"Login","type":"component","status":"operational","position":0},{"id":"5dcfa87c-9147-4c77-9ef9-658ae70db253","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-01-21T21:23:37.073734Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"f594e675bf08d5d7","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-21T21:23:37.073734Z","name":"A + Status Page","page_url":"https://frog.datadoghq.com/status-pages/bb4afad2-f893-464a-82a4-d2ab29d5105c/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' code: 201 duration: 0ms headers: @@ -22,7 +22,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"components_affected":[{"id":"da61bfdd-4282-49e1-bf83-d3df9f0b2e1c","status":"major_outage"}],"description":"Our API is experiencing elevated latency. We are investigating the issue.","status":"investigating","title":"Elevated API Latency"},"type":"degradations"}} + {"data":{"attributes":{"components_affected":[{"id":"43c959d9-3dda-4dc9-ae42-74b71ea39f08","status":"major_outage"}],"description":"Our API is experiencing elevated latency. We are investigating the issue.","status":"investigating","title":"Elevated API Latency"},"type":"degradations"}} form: {} headers: Accept: @@ -31,12 +31,12 @@ interactions: - application/json id: 1 method: POST - url: https://api.datadoghq.com/api/v2/statuspages/df0612f3-4ee3-4627-b8a6-a34b3043e31d/degradations + url: https://api.datadoghq.com/api/v2/statuspages/bb4afad2-f893-464a-82a4-d2ab29d5105c/degradations response: - body: '{"data":{"id":"56a84290-5371-4d6e-b106-b1d5cc52ed79","type":"degradations","attributes":{"components_affected":[{"id":"da61bfdd-4282-49e1-bf83-d3df9f0b2e1c","name":"Login","status":"major_outage"}],"created_at":"2026-01-14T18:34:18.643353Z","description":"Our - API is experiencing elevated latency. We are investigating the issue.","modified_at":"2026-01-14T18:34:18.643353Z","status":"investigating","title":"Elevated - API Latency","updates":[{"id":"1c212f1c-fa94-4f8e-b94e-051e24057d52","created_at":"2026-01-14T18:34:18.643353Z","modified_at":"2026-01-14T18:34:18.643353Z","status":"investigating","description":"Our - API is experiencing elevated latency. We are investigating the issue.","components_affected":[{"id":"da61bfdd-4282-49e1-bf83-d3df9f0b2e1c","name":"Login","status":"major_outage"}]}]},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"status_page":{"data":{"id":"df0612f3-4ee3-4627-b8a6-a34b3043e31d","type":"status_pages"}}}}}' + body: '{"data":{"id":"e4e76067-6b16-48d1-b943-734d0d81f715","type":"degradations","attributes":{"components_affected":[{"id":"43c959d9-3dda-4dc9-ae42-74b71ea39f08","name":"Login","status":"major_outage"}],"created_at":"2026-01-21T21:23:37.592566Z","description":"Our + API is experiencing elevated latency. We are investigating the issue.","modified_at":"2026-01-21T21:23:37.592566Z","status":"investigating","title":"Elevated + API Latency","updates":[{"id":"af2de416-ec54-4e72-a973-7be879f26886","created_at":"2026-01-21T21:23:37.592566Z","modified_at":"2026-01-21T21:23:37.592566Z","status":"investigating","description":"Our + API is experiencing elevated latency. We are investigating the issue.","components_affected":[{"id":"43c959d9-3dda-4dc9-ae42-74b71ea39f08","name":"Login","status":"major_outage"}]}]},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"status_page":{"data":{"id":"bb4afad2-f893-464a-82a4-d2ab29d5105c","type":"status_pages"}}}}}' code: 201 duration: 0ms headers: @@ -51,7 +51,7 @@ interactions: - '*/*' id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/statuspages/df0612f3-4ee3-4627-b8a6-a34b3043e31d/degradations/56a84290-5371-4d6e-b106-b1d5cc52ed79 + url: https://api.datadoghq.com/api/v2/statuspages/bb4afad2-f893-464a-82a4-d2ab29d5105c/degradations/e4e76067-6b16-48d1-b943-734d0d81f715 response: body: '' code: 204 @@ -66,7 +66,7 @@ interactions: - '*/*' id: 3 method: DELETE - url: https://api.datadoghq.com/api/v2/statuspages/df0612f3-4ee3-4627-b8a6-a34b3043e31d + url: https://api.datadoghq.com/api/v2/statuspages/bb4afad2-f893-464a-82a4-d2ab29d5105c response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Create_status_page_returns_Created_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Create_status_page_returns_Created_response.freeze index 6162587fbd6..f09a7049e48 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Create_status_page_returns_Created_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Create_status_page_returns_Created_response.freeze @@ -1 +1 @@ -2026-01-14T18:34:19.425Z \ No newline at end of file +2026-01-21T21:23:38.324Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Create_status_page_returns_Created_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Create_status_page_returns_Created_response.yaml index 20e7fbc1b72..5f82d399ea2 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Create_status_page_returns_Created_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Create_status_page_returns_Created_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"domain_prefix":"status-page-a2eaf7555bc991fb","enabled":true,"name":"A Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}} + {"data":{"attributes":{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"domain_prefix":"bd769f64d06a9cdb","enabled":true,"name":"A Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}} form: {} headers: Accept: @@ -12,8 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/statuspages response: - body: '{"data":{"id":"c55c1c53-c6ad-4a15-9093-4445213c3b79","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"e73ac741-c54d-43b8-90bc-a7258a0ec9fb","name":"Login","type":"component","status":"operational","position":0},{"id":"a3b31d36-202f-444a-9ea4-3fb20794c2f8","name":"Settings","type":"component","status":"operational","position":1}],"created_at":"2026-01-14T18:34:19.55001Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"status-page-a2eaf7555bc991fb","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-14T18:34:19.55001Z","name":"A - Status Page","page_url":"https://frog.datadoghq.com/status-pages/c55c1c53-c6ad-4a15-9093-4445213c3b79/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' + body: '{"data":{"id":"f59e184f-4019-40d6-be90-b59f2381976d","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"c66f749f-12f7-4813-92a3-0e70df06cbd8","name":"Login","type":"component","status":"operational","position":0},{"id":"2478dc16-435c-493d-93ad-dcea6421a281","name":"Settings","type":"component","status":"operational","position":1}],"created_at":"2026-01-21T21:23:38.486999Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"bd769f64d06a9cdb","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-21T21:23:38.486999Z","name":"A + Status Page","page_url":"https://frog.datadoghq.com/status-pages/f59e184f-4019-40d6-be90-b59f2381976d/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' code: 201 duration: 0ms headers: @@ -28,7 +28,7 @@ interactions: - '*/*' id: 1 method: DELETE - url: https://api.datadoghq.com/api/v2/statuspages/c55c1c53-c6ad-4a15-9093-4445213c3b79 + url: https://api.datadoghq.com/api/v2/statuspages/f59e184f-4019-40d6-be90-b59f2381976d response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Delete_component_returns_No_Content_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Delete_component_returns_No_Content_response.freeze index 6778c0ddc72..dccc0cd79e6 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Delete_component_returns_No_Content_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Delete_component_returns_No_Content_response.freeze @@ -1 +1 @@ -2026-01-14T18:34:20.644Z \ No newline at end of file +2026-01-21T21:23:39.373Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Delete_component_returns_No_Content_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Delete_component_returns_No_Content_response.yaml index ef9e99ef065..68290952156 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Delete_component_returns_No_Content_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Delete_component_returns_No_Content_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"components":[{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"name":"Application","type":"group"}],"domain_prefix":"status-page-0d2d7c9c3a7223ad","enabled":true,"name":"A Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}} + {"data":{"attributes":{"components":[{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"name":"Application","type":"group"}],"domain_prefix":"52506f44627e27d9","enabled":true,"name":"A Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}} form: {} headers: Accept: @@ -12,8 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/statuspages response: - body: '{"data":{"id":"a2a7be87-a517-45c5-9fde-71d0a2bdeb79","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"21dd43f5-3fe0-40be-a8e8-2d6b9d7e3c5a","name":"Application","type":"group","position":0,"components":[{"id":"159fd76a-661a-4b01-a4f3-b993ddde6efb","name":"Login","type":"component","status":"operational","position":0},{"id":"4c7b8f87-564a-4372-837e-e8aea00b2a47","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-01-14T18:34:20.819798Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"status-page-0d2d7c9c3a7223ad","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-14T18:34:20.819798Z","name":"A - Status Page","page_url":"https://frog.datadoghq.com/status-pages/a2a7be87-a517-45c5-9fde-71d0a2bdeb79/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' + body: '{"data":{"id":"e4365564-6c49-4a14-b9c2-736c038a62a9","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"be6cbe05-c28b-4cd1-be92-0323c2399a6c","name":"Application","type":"group","position":0,"components":[{"id":"da518ded-9db2-4cba-919e-0ad04d208561","name":"Login","type":"component","status":"operational","position":0},{"id":"06e4ed67-1231-409e-a0b1-da84785d64a0","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-01-21T21:23:39.487738Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"52506f44627e27d9","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-21T21:23:39.487738Z","name":"A + Status Page","page_url":"https://frog.datadoghq.com/status-pages/e4365564-6c49-4a14-b9c2-736c038a62a9/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' code: 201 duration: 0ms headers: @@ -28,7 +28,7 @@ interactions: - '*/*' id: 1 method: DELETE - url: https://api.datadoghq.com/api/v2/statuspages/a2a7be87-a517-45c5-9fde-71d0a2bdeb79/components/21dd43f5-3fe0-40be-a8e8-2d6b9d7e3c5a + url: https://api.datadoghq.com/api/v2/statuspages/e4365564-6c49-4a14-b9c2-736c038a62a9/components/be6cbe05-c28b-4cd1-be92-0323c2399a6c response: body: '' code: 204 @@ -43,7 +43,7 @@ interactions: - '*/*' id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/statuspages/a2a7be87-a517-45c5-9fde-71d0a2bdeb79 + url: https://api.datadoghq.com/api/v2/statuspages/e4365564-6c49-4a14-b9c2-736c038a62a9 response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Delete_degradation_returns_No_Content_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Delete_degradation_returns_No_Content_response.freeze index 139657491cc..f9dac8fe0f8 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Delete_degradation_returns_No_Content_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Delete_degradation_returns_No_Content_response.freeze @@ -1 +1 @@ -2026-01-14T18:34:21.866Z \ No newline at end of file +2026-01-21T21:23:40.553Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Delete_degradation_returns_No_Content_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Delete_degradation_returns_No_Content_response.yaml index 861addf9753..89111417d2c 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Delete_degradation_returns_No_Content_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Delete_degradation_returns_No_Content_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"components":[{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"name":"Application","type":"group"}],"domain_prefix":"status-page-b5fbb76b83d2a5d0","enabled":true,"name":"A Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}} + {"data":{"attributes":{"components":[{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"name":"Application","type":"group"}],"domain_prefix":"854d0635d9daaa12","enabled":true,"name":"A Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}} form: {} headers: Accept: @@ -12,8 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/statuspages response: - body: '{"data":{"id":"94baf28b-48d1-4105-8895-1174cb9c8b98","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"d29f3ffb-f72b-4b0d-99f0-e857d0f21c1a","name":"Application","type":"group","position":0,"components":[{"id":"3a491a7c-1816-4129-b12a-c84390a70c3f","name":"Login","type":"component","status":"operational","position":0},{"id":"66727ad7-0687-4da2-91fe-b3e5ad418863","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-01-14T18:34:21.969023Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"status-page-b5fbb76b83d2a5d0","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-14T18:34:21.969023Z","name":"A - Status Page","page_url":"https://frog.datadoghq.com/status-pages/94baf28b-48d1-4105-8895-1174cb9c8b98/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' + body: '{"data":{"id":"6be99142-8929-473e-9799-041e6372f114","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"82cd6444-b15f-467d-bba2-b0c946de1965","name":"Application","type":"group","position":0,"components":[{"id":"45221c15-9e84-469a-bc08-be9e3988f3ea","name":"Login","type":"component","status":"operational","position":0},{"id":"694d84bb-afb7-4a0a-854f-d9eee42fff7f","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-01-21T21:23:40.659745Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"854d0635d9daaa12","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-21T21:23:40.659745Z","name":"A + Status Page","page_url":"https://frog.datadoghq.com/status-pages/6be99142-8929-473e-9799-041e6372f114/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' code: 201 duration: 0ms headers: @@ -22,7 +22,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"components_affected":[{"id":"3a491a7c-1816-4129-b12a-c84390a70c3f","status":"major_outage"}],"description":"Our API is experiencing elevated latency. We are investigating the issue.","status":"investigating","title":"Elevated API Latency"},"type":"degradations"}} + {"data":{"attributes":{"components_affected":[{"id":"45221c15-9e84-469a-bc08-be9e3988f3ea","status":"major_outage"}],"description":"Our API is experiencing elevated latency. We are investigating the issue.","status":"investigating","title":"Elevated API Latency"},"type":"degradations"}} form: {} headers: Accept: @@ -31,12 +31,12 @@ interactions: - application/json id: 1 method: POST - url: https://api.datadoghq.com/api/v2/statuspages/94baf28b-48d1-4105-8895-1174cb9c8b98/degradations + url: https://api.datadoghq.com/api/v2/statuspages/6be99142-8929-473e-9799-041e6372f114/degradations response: - body: '{"data":{"id":"6a6cc623-ef7b-4099-8a68-ee9cd6e625fa","type":"degradations","attributes":{"components_affected":[{"id":"3a491a7c-1816-4129-b12a-c84390a70c3f","name":"Login","status":"major_outage"}],"created_at":"2026-01-14T18:34:22.48327Z","description":"Our - API is experiencing elevated latency. We are investigating the issue.","modified_at":"2026-01-14T18:34:22.48327Z","status":"investigating","title":"Elevated - API Latency","updates":[{"id":"1639ecee-77fc-4424-b719-7bc9a8d9ac10","created_at":"2026-01-14T18:34:22.48327Z","modified_at":"2026-01-14T18:34:22.48327Z","status":"investigating","description":"Our - API is experiencing elevated latency. We are investigating the issue.","components_affected":[{"id":"3a491a7c-1816-4129-b12a-c84390a70c3f","name":"Login","status":"major_outage"}]}]},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"status_page":{"data":{"id":"94baf28b-48d1-4105-8895-1174cb9c8b98","type":"status_pages"}}}}}' + body: '{"data":{"id":"bd0e77e0-83e5-4556-809b-f582969f1441","type":"degradations","attributes":{"components_affected":[{"id":"45221c15-9e84-469a-bc08-be9e3988f3ea","name":"Login","status":"major_outage"}],"created_at":"2026-01-21T21:23:41.199085Z","description":"Our + API is experiencing elevated latency. We are investigating the issue.","modified_at":"2026-01-21T21:23:41.199085Z","status":"investigating","title":"Elevated + API Latency","updates":[{"id":"a899c951-a528-4edb-86e7-8eca80ff1a92","created_at":"2026-01-21T21:23:41.199085Z","modified_at":"2026-01-21T21:23:41.199085Z","status":"investigating","description":"Our + API is experiencing elevated latency. We are investigating the issue.","components_affected":[{"id":"45221c15-9e84-469a-bc08-be9e3988f3ea","name":"Login","status":"major_outage"}]}]},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"status_page":{"data":{"id":"6be99142-8929-473e-9799-041e6372f114","type":"status_pages"}}}}}' code: 201 duration: 0ms headers: @@ -51,7 +51,7 @@ interactions: - '*/*' id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/statuspages/94baf28b-48d1-4105-8895-1174cb9c8b98/degradations/6a6cc623-ef7b-4099-8a68-ee9cd6e625fa + url: https://api.datadoghq.com/api/v2/statuspages/6be99142-8929-473e-9799-041e6372f114/degradations/bd0e77e0-83e5-4556-809b-f582969f1441 response: body: '' code: 204 @@ -66,7 +66,7 @@ interactions: - '*/*' id: 3 method: DELETE - url: https://api.datadoghq.com/api/v2/statuspages/94baf28b-48d1-4105-8895-1174cb9c8b98/degradations/6a6cc623-ef7b-4099-8a68-ee9cd6e625fa + url: https://api.datadoghq.com/api/v2/statuspages/6be99142-8929-473e-9799-041e6372f114/degradations/bd0e77e0-83e5-4556-809b-f582969f1441 response: body: '{"errors":[{"title":"Generic Error","detail":"degradation not found"}]}' code: 404 @@ -83,7 +83,7 @@ interactions: - '*/*' id: 4 method: DELETE - url: https://api.datadoghq.com/api/v2/statuspages/94baf28b-48d1-4105-8895-1174cb9c8b98 + url: https://api.datadoghq.com/api/v2/statuspages/6be99142-8929-473e-9799-041e6372f114 response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Delete_status_page_returns_No_Content_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Delete_status_page_returns_No_Content_response.freeze index b96710261e7..dbcea3ddf98 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Delete_status_page_returns_No_Content_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Delete_status_page_returns_No_Content_response.freeze @@ -1 +1 @@ -2026-01-14T18:34:23.304Z \ No newline at end of file +2026-01-21T21:23:41.981Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Delete_status_page_returns_No_Content_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Delete_status_page_returns_No_Content_response.yaml index 17cf68a6d89..5049a0cc6d7 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Delete_status_page_returns_No_Content_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Delete_status_page_returns_No_Content_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"components":[{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"name":"Application","type":"group"}],"domain_prefix":"status-page-608a5828d74082cd","enabled":true,"name":"A Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}} + {"data":{"attributes":{"components":[{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"name":"Application","type":"group"}],"domain_prefix":"cb21c38e7fab0cfc","enabled":true,"name":"A Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}} form: {} headers: Accept: @@ -12,8 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/statuspages response: - body: '{"data":{"id":"fe6f8e30-59be-43e6-9836-b2a0bd4af24f","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"ba00bba3-9057-454e-8497-5a5acd5c7793","name":"Application","type":"group","position":0,"components":[{"id":"68a65da3-072c-46a3-927f-e7cd0ce4d48f","name":"Login","type":"component","status":"operational","position":0},{"id":"3034604b-1324-4908-8f30-f91a1528a38e","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-01-14T18:34:23.396957Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"status-page-608a5828d74082cd","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-14T18:34:23.396957Z","name":"A - Status Page","page_url":"https://frog.datadoghq.com/status-pages/fe6f8e30-59be-43e6-9836-b2a0bd4af24f/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' + body: '{"data":{"id":"bc81fd89-62a4-4c28-b5e1-167c63ce3249","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"e6286170-1f58-4d8d-9432-7112ebc32be7","name":"Application","type":"group","position":0,"components":[{"id":"c7753c9e-7f28-4111-b7ab-f801c75b4945","name":"Login","type":"component","status":"operational","position":0},{"id":"a6e70d8d-7457-4d09-88a7-ef5cd4674698","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-01-21T21:23:42.084545Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"cb21c38e7fab0cfc","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-21T21:23:42.084545Z","name":"A + Status Page","page_url":"https://frog.datadoghq.com/status-pages/bc81fd89-62a4-4c28-b5e1-167c63ce3249/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' code: 201 duration: 0ms headers: @@ -28,7 +28,7 @@ interactions: - '*/*' id: 1 method: DELETE - url: https://api.datadoghq.com/api/v2/statuspages/fe6f8e30-59be-43e6-9836-b2a0bd4af24f + url: https://api.datadoghq.com/api/v2/statuspages/bc81fd89-62a4-4c28-b5e1-167c63ce3249 response: body: '' code: 204 @@ -43,7 +43,7 @@ interactions: - '*/*' id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/statuspages/fe6f8e30-59be-43e6-9836-b2a0bd4af24f + url: https://api.datadoghq.com/api/v2/statuspages/bc81fd89-62a4-4c28-b5e1-167c63ce3249 response: body: '{"errors":[{"title":"Generic Error","detail":"status page not found"}]}' code: 404 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Get_component_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Get_component_returns_OK_response.freeze index 6866a930a2c..06ecf5ee7c9 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Get_component_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Get_component_returns_OK_response.freeze @@ -1 +1 @@ -2026-01-14T18:34:24.440Z \ No newline at end of file +2026-01-21T21:23:43.141Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Get_component_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Get_component_returns_OK_response.yaml index 8879f930e9d..2d999b12f70 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Get_component_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Get_component_returns_OK_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"components":[{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"name":"Application","type":"group"}],"domain_prefix":"status-page-563dcf7a5f0d37a0","enabled":true,"name":"A Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}} + {"data":{"attributes":{"components":[{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"name":"Application","type":"group"}],"domain_prefix":"06de602b320cfdb0","enabled":true,"name":"A Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}} form: {} headers: Accept: @@ -12,8 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/statuspages response: - body: '{"data":{"id":"db83fc2f-bc0f-4ef4-84d8-bf62b84a4ab5","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"7b449f70-f51b-4133-9339-864ecd98685d","name":"Application","type":"group","position":0,"components":[{"id":"c9ad5347-14a8-422c-b597-972a066968ec","name":"Login","type":"component","status":"operational","position":0},{"id":"d03ae495-668c-4e79-9dae-ff5ecfe6e260","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-01-14T18:34:24.533596Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"status-page-563dcf7a5f0d37a0","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-14T18:34:24.533596Z","name":"A - Status Page","page_url":"https://frog.datadoghq.com/status-pages/db83fc2f-bc0f-4ef4-84d8-bf62b84a4ab5/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' + body: '{"data":{"id":"70f5256d-c03f-45e1-8057-bc036d4793eb","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"7a270e4e-a064-44d0-bf07-326cf1f51cad","name":"Application","type":"group","position":0,"components":[{"id":"3a6c227c-52ea-4ed1-849c-4b4c1179881a","name":"Login","type":"component","status":"operational","position":0},{"id":"dff9c5c3-0b49-4f04-b801-83cdec88432a","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-01-21T21:23:43.257592Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"06de602b320cfdb0","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-21T21:23:43.257592Z","name":"A + Status Page","page_url":"https://frog.datadoghq.com/status-pages/70f5256d-c03f-45e1-8057-bc036d4793eb/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' code: 201 duration: 0ms headers: @@ -28,9 +28,9 @@ interactions: - application/json id: 1 method: GET - url: https://api.datadoghq.com/api/v2/statuspages/db83fc2f-bc0f-4ef4-84d8-bf62b84a4ab5/components/7b449f70-f51b-4133-9339-864ecd98685d + url: https://api.datadoghq.com/api/v2/statuspages/70f5256d-c03f-45e1-8057-bc036d4793eb/components/7a270e4e-a064-44d0-bf07-326cf1f51cad response: - body: '{"data":{"id":"7b449f70-f51b-4133-9339-864ecd98685d","type":"components","attributes":{"components":[{"id":"c9ad5347-14a8-422c-b597-972a066968ec","name":"Login","type":"component","status":"operational","position":0},{"id":"d03ae495-668c-4e79-9dae-ff5ecfe6e260","name":"Settings","type":"component","status":"operational","position":1}],"created_at":"2026-01-14T18:34:24.533596Z","modified_at":"2026-01-14T18:34:24.533596Z","name":"Application","position":0,"type":"group"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"group":{"data":null},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"status_page":{"data":{"id":"db83fc2f-bc0f-4ef4-84d8-bf62b84a4ab5","type":"status_pages"}}}}}' + body: '{"data":{"id":"7a270e4e-a064-44d0-bf07-326cf1f51cad","type":"components","attributes":{"components":[{"id":"3a6c227c-52ea-4ed1-849c-4b4c1179881a","name":"Login","type":"component","status":"operational","position":0},{"id":"dff9c5c3-0b49-4f04-b801-83cdec88432a","name":"Settings","type":"component","status":"operational","position":1}],"created_at":"2026-01-21T21:23:43.257592Z","modified_at":"2026-01-21T21:23:43.257592Z","name":"Application","position":0,"type":"group"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"group":{"data":null},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"status_page":{"data":{"id":"70f5256d-c03f-45e1-8057-bc036d4793eb","type":"status_pages"}}}}}' code: 200 duration: 0ms headers: @@ -45,7 +45,7 @@ interactions: - '*/*' id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/statuspages/db83fc2f-bc0f-4ef4-84d8-bf62b84a4ab5 + url: https://api.datadoghq.com/api/v2/statuspages/70f5256d-c03f-45e1-8057-bc036d4793eb response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Get_degradation_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Get_degradation_returns_OK_response.freeze index 686f91dc763..5bf876ce9e7 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Get_degradation_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Get_degradation_returns_OK_response.freeze @@ -1 +1 @@ -2026-01-14T18:34:25.959Z \ No newline at end of file +2026-01-21T21:23:44.279Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Get_degradation_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Get_degradation_returns_OK_response.yaml index 3182d0063f9..0c8f616749d 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Get_degradation_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Get_degradation_returns_OK_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"components":[{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"name":"Application","type":"group"}],"domain_prefix":"status-page-5fee2f719be82f29","enabled":true,"name":"A Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}} + {"data":{"attributes":{"components":[{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"name":"Application","type":"group"}],"domain_prefix":"5eb6437773268884","enabled":true,"name":"A Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}} form: {} headers: Accept: @@ -12,8 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/statuspages response: - body: '{"data":{"id":"ebf59ea3-337a-4bf7-8229-22714b514a2f","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"a2743d27-3cc3-4a60-ba6e-291f3fe06deb","name":"Application","type":"group","position":0,"components":[{"id":"eae8808a-3353-43da-9d84-a0c79c7c5517","name":"Login","type":"component","status":"operational","position":0},{"id":"a2476857-5843-4bfd-a77d-0b5b65fec5df","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-01-14T18:34:26.056352Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"status-page-5fee2f719be82f29","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-14T18:34:26.056352Z","name":"A - Status Page","page_url":"https://frog.datadoghq.com/status-pages/ebf59ea3-337a-4bf7-8229-22714b514a2f/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' + body: '{"data":{"id":"a0e1ebd1-38d3-4b7b-bb90-9a7427ce7c45","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"3397266a-8b0e-49c9-bc1c-0866a14eca08","name":"Application","type":"group","position":0,"components":[{"id":"bd226a05-e4f4-41bd-bb65-6c575acb55df","name":"Login","type":"component","status":"operational","position":0},{"id":"5db10808-905b-43a6-9226-97057e049486","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-01-21T21:23:44.415385Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"5eb6437773268884","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-21T21:23:44.415385Z","name":"A + Status Page","page_url":"https://frog.datadoghq.com/status-pages/a0e1ebd1-38d3-4b7b-bb90-9a7427ce7c45/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' code: 201 duration: 0ms headers: @@ -22,7 +22,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"components_affected":[{"id":"eae8808a-3353-43da-9d84-a0c79c7c5517","status":"major_outage"}],"description":"Our API is experiencing elevated latency. We are investigating the issue.","status":"investigating","title":"Elevated API Latency"},"type":"degradations"}} + {"data":{"attributes":{"components_affected":[{"id":"bd226a05-e4f4-41bd-bb65-6c575acb55df","status":"major_outage"}],"description":"Our API is experiencing elevated latency. We are investigating the issue.","status":"investigating","title":"Elevated API Latency"},"type":"degradations"}} form: {} headers: Accept: @@ -31,12 +31,12 @@ interactions: - application/json id: 1 method: POST - url: https://api.datadoghq.com/api/v2/statuspages/ebf59ea3-337a-4bf7-8229-22714b514a2f/degradations + url: https://api.datadoghq.com/api/v2/statuspages/a0e1ebd1-38d3-4b7b-bb90-9a7427ce7c45/degradations response: - body: '{"data":{"id":"034207a4-1a7e-4cd5-abd5-fbd9fa30a097","type":"degradations","attributes":{"components_affected":[{"id":"eae8808a-3353-43da-9d84-a0c79c7c5517","name":"Login","status":"major_outage"}],"created_at":"2026-01-14T18:34:26.977362Z","description":"Our - API is experiencing elevated latency. We are investigating the issue.","modified_at":"2026-01-14T18:34:26.977362Z","status":"investigating","title":"Elevated - API Latency","updates":[{"id":"2e12dc61-747b-4997-95f7-a28549d0d6d2","created_at":"2026-01-14T18:34:26.977362Z","modified_at":"2026-01-14T18:34:26.977362Z","status":"investigating","description":"Our - API is experiencing elevated latency. We are investigating the issue.","components_affected":[{"id":"eae8808a-3353-43da-9d84-a0c79c7c5517","name":"Login","status":"major_outage"}]}]},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"status_page":{"data":{"id":"ebf59ea3-337a-4bf7-8229-22714b514a2f","type":"status_pages"}}}}}' + body: '{"data":{"id":"ce318082-f158-4f69-a325-dfcc3a4e0cd4","type":"degradations","attributes":{"components_affected":[{"id":"bd226a05-e4f4-41bd-bb65-6c575acb55df","name":"Login","status":"major_outage"}],"created_at":"2026-01-21T21:23:44.970381Z","description":"Our + API is experiencing elevated latency. We are investigating the issue.","modified_at":"2026-01-21T21:23:44.970381Z","status":"investigating","title":"Elevated + API Latency","updates":[{"id":"07162b04-aa24-4bb9-8f4e-549ceda01252","created_at":"2026-01-21T21:23:44.970381Z","modified_at":"2026-01-21T21:23:44.970381Z","status":"investigating","description":"Our + API is experiencing elevated latency. We are investigating the issue.","components_affected":[{"id":"bd226a05-e4f4-41bd-bb65-6c575acb55df","name":"Login","status":"major_outage"}]}]},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"status_page":{"data":{"id":"a0e1ebd1-38d3-4b7b-bb90-9a7427ce7c45","type":"status_pages"}}}}}' code: 201 duration: 0ms headers: @@ -51,12 +51,12 @@ interactions: - application/json id: 2 method: GET - url: https://api.datadoghq.com/api/v2/statuspages/ebf59ea3-337a-4bf7-8229-22714b514a2f/degradations/034207a4-1a7e-4cd5-abd5-fbd9fa30a097 + url: https://api.datadoghq.com/api/v2/statuspages/a0e1ebd1-38d3-4b7b-bb90-9a7427ce7c45/degradations/ce318082-f158-4f69-a325-dfcc3a4e0cd4 response: - body: '{"data":{"id":"034207a4-1a7e-4cd5-abd5-fbd9fa30a097","type":"degradations","attributes":{"components_affected":[{"id":"eae8808a-3353-43da-9d84-a0c79c7c5517","name":"Login","status":"major_outage"}],"created_at":"2026-01-14T18:34:26.977362Z","description":"Our - API is experiencing elevated latency. We are investigating the issue.","modified_at":"2026-01-14T18:34:26.977362Z","status":"investigating","title":"Elevated - API Latency","updates":[{"id":"2e12dc61-747b-4997-95f7-a28549d0d6d2","created_at":"2026-01-14T18:34:26.977362Z","modified_at":"2026-01-14T18:34:26.977362Z","status":"investigating","description":"Our - API is experiencing elevated latency. We are investigating the issue.","components_affected":[{"id":"eae8808a-3353-43da-9d84-a0c79c7c5517","name":"Login","status":"major_outage"}]}]},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"status_page":{"data":{"id":"ebf59ea3-337a-4bf7-8229-22714b514a2f","type":"status_pages"}}}}}' + body: '{"data":{"id":"ce318082-f158-4f69-a325-dfcc3a4e0cd4","type":"degradations","attributes":{"components_affected":[{"id":"bd226a05-e4f4-41bd-bb65-6c575acb55df","name":"Login","status":"major_outage"}],"created_at":"2026-01-21T21:23:44.970381Z","description":"Our + API is experiencing elevated latency. We are investigating the issue.","modified_at":"2026-01-21T21:23:44.970381Z","status":"investigating","title":"Elevated + API Latency","updates":[{"id":"07162b04-aa24-4bb9-8f4e-549ceda01252","created_at":"2026-01-21T21:23:44.970381Z","modified_at":"2026-01-21T21:23:44.970381Z","status":"investigating","description":"Our + API is experiencing elevated latency. We are investigating the issue.","components_affected":[{"id":"bd226a05-e4f4-41bd-bb65-6c575acb55df","name":"Login","status":"major_outage"}]}]},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"status_page":{"data":{"id":"a0e1ebd1-38d3-4b7b-bb90-9a7427ce7c45","type":"status_pages"}}}}}' code: 200 duration: 0ms headers: @@ -71,7 +71,7 @@ interactions: - '*/*' id: 3 method: DELETE - url: https://api.datadoghq.com/api/v2/statuspages/ebf59ea3-337a-4bf7-8229-22714b514a2f/degradations/034207a4-1a7e-4cd5-abd5-fbd9fa30a097 + url: https://api.datadoghq.com/api/v2/statuspages/a0e1ebd1-38d3-4b7b-bb90-9a7427ce7c45/degradations/ce318082-f158-4f69-a325-dfcc3a4e0cd4 response: body: '' code: 204 @@ -86,7 +86,7 @@ interactions: - '*/*' id: 4 method: DELETE - url: https://api.datadoghq.com/api/v2/statuspages/ebf59ea3-337a-4bf7-8229-22714b514a2f + url: https://api.datadoghq.com/api/v2/statuspages/a0e1ebd1-38d3-4b7b-bb90-9a7427ce7c45 response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Get_status_page_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Get_status_page_returns_OK_response.freeze index 2488910ba13..712b01c4720 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Get_status_page_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Get_status_page_returns_OK_response.freeze @@ -1 +1 @@ -2026-01-14T18:34:27.756Z \ No newline at end of file +2026-01-21T21:23:45.761Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Get_status_page_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Get_status_page_returns_OK_response.yaml index 6ef47af4cd2..042d65d2cdd 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Get_status_page_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Get_status_page_returns_OK_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"components":[{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"name":"Application","type":"group"}],"domain_prefix":"status-page-640ff16a0cef647e","enabled":true,"name":"A Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}} + {"data":{"attributes":{"components":[{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"name":"Application","type":"group"}],"domain_prefix":"385491266043d794","enabled":true,"name":"A Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}} form: {} headers: Accept: @@ -12,8 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/statuspages response: - body: '{"data":{"id":"3d09da75-7a53-486c-be0e-29a1d38626f0","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"5405090a-cfae-4747-a4a1-420c249348b7","name":"Application","type":"group","position":0,"components":[{"id":"c0f34aff-6c67-4c2d-8a84-ec0f05ffd310","name":"Login","type":"component","status":"operational","position":0},{"id":"be2b41a2-dff3-47a1-a4e8-4a42820882f3","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-01-14T18:34:27.933167Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"status-page-640ff16a0cef647e","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-14T18:34:27.933167Z","name":"A - Status Page","page_url":"https://frog.datadoghq.com/status-pages/3d09da75-7a53-486c-be0e-29a1d38626f0/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' + body: '{"data":{"id":"24205612-f1dc-444f-aec6-7010c3097cb5","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"70916c47-93e6-4e73-b97c-0e13b5450faf","name":"Application","type":"group","position":0,"components":[{"id":"dcb07405-f8ea-4518-9c37-9ccb6c3c247b","name":"Login","type":"component","status":"operational","position":0},{"id":"2287c0bf-d342-4a65-998d-22bb80c63c27","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-01-21T21:23:45.863862Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"385491266043d794","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-21T21:23:45.863862Z","name":"A + Status Page","page_url":"https://frog.datadoghq.com/status-pages/24205612-f1dc-444f-aec6-7010c3097cb5/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' code: 201 duration: 0ms headers: @@ -28,10 +28,10 @@ interactions: - application/json id: 1 method: GET - url: https://api.datadoghq.com/api/v2/statuspages/3d09da75-7a53-486c-be0e-29a1d38626f0 + url: https://api.datadoghq.com/api/v2/statuspages/24205612-f1dc-444f-aec6-7010c3097cb5 response: - body: '{"data":{"id":"3d09da75-7a53-486c-be0e-29a1d38626f0","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"5405090a-cfae-4747-a4a1-420c249348b7","name":"Application","type":"group","position":0,"components":[{"id":"c0f34aff-6c67-4c2d-8a84-ec0f05ffd310","name":"Login","type":"component","status":"operational","position":0},{"id":"be2b41a2-dff3-47a1-a4e8-4a42820882f3","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-01-14T18:34:27.933167Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"status-page-640ff16a0cef647e","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-14T18:34:27.933167Z","name":"A - Status Page","page_url":"https://frog.datadoghq.com/status-pages/3d09da75-7a53-486c-be0e-29a1d38626f0/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' + body: '{"data":{"id":"24205612-f1dc-444f-aec6-7010c3097cb5","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"70916c47-93e6-4e73-b97c-0e13b5450faf","name":"Application","type":"group","position":0,"components":[{"id":"dcb07405-f8ea-4518-9c37-9ccb6c3c247b","name":"Login","type":"component","status":"operational","position":0},{"id":"2287c0bf-d342-4a65-998d-22bb80c63c27","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-01-21T21:23:45.863862Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"385491266043d794","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-21T21:23:45.863862Z","name":"A + Status Page","page_url":"https://frog.datadoghq.com/status-pages/24205612-f1dc-444f-aec6-7010c3097cb5/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' code: 200 duration: 0ms headers: @@ -46,7 +46,7 @@ interactions: - '*/*' id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/statuspages/3d09da75-7a53-486c-be0e-29a1d38626f0 + url: https://api.datadoghq.com/api/v2/statuspages/24205612-f1dc-444f-aec6-7010c3097cb5 response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_List_components_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_List_components_returns_OK_response.freeze index 1a78119b28d..d9b768691c7 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_List_components_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_List_components_returns_OK_response.freeze @@ -1 +1 @@ -2026-01-14T18:34:29.043Z \ No newline at end of file +2026-01-21T21:23:46.975Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_List_components_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_List_components_returns_OK_response.yaml index 41d552efc66..7cc3967c7d3 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_List_components_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_List_components_returns_OK_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"components":[{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"name":"Application","type":"group"}],"domain_prefix":"status-page-634e6c2db3b869de","enabled":true,"name":"A Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}} + {"data":{"attributes":{"components":[{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"name":"Application","type":"group"}],"domain_prefix":"f577abf9d8b6cac4","enabled":true,"name":"A Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}} form: {} headers: Accept: @@ -12,8 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/statuspages response: - body: '{"data":{"id":"5ca46325-bac2-4a5e-aa26-5e7d5e1c029e","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"d8b8c3c9-595a-4499-a21e-1f04e853d1a7","name":"Application","type":"group","position":0,"components":[{"id":"933d9347-1271-45f0-bd1d-ce3701e35bef","name":"Login","type":"component","status":"operational","position":0},{"id":"5da24db1-597c-4c01-8f61-5ff87ec805b2","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-01-14T18:34:29.150095Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"status-page-634e6c2db3b869de","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-14T18:34:29.150095Z","name":"A - Status Page","page_url":"https://frog.datadoghq.com/status-pages/5ca46325-bac2-4a5e-aa26-5e7d5e1c029e/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' + body: '{"data":{"id":"02b22755-8a22-449f-817b-c4f649f37ebd","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"bac73feb-3b3a-4f9b-81ad-b5532acfc96b","name":"Application","type":"group","position":0,"components":[{"id":"d993969d-ca6c-4b74-aed6-7a0f93016e7f","name":"Login","type":"component","status":"operational","position":0},{"id":"457c3e35-56a5-472f-a284-4e2222c77631","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-01-21T21:23:47.079687Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"f577abf9d8b6cac4","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-21T21:23:47.079687Z","name":"A + Status Page","page_url":"https://frog.datadoghq.com/status-pages/02b22755-8a22-449f-817b-c4f649f37ebd/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' code: 201 duration: 0ms headers: @@ -28,9 +28,9 @@ interactions: - application/json id: 1 method: GET - url: https://api.datadoghq.com/api/v2/statuspages/5ca46325-bac2-4a5e-aa26-5e7d5e1c029e/components + url: https://api.datadoghq.com/api/v2/statuspages/02b22755-8a22-449f-817b-c4f649f37ebd/components response: - body: '{"data":[{"id":"d8b8c3c9-595a-4499-a21e-1f04e853d1a7","type":"components","attributes":{"components":[{"id":"933d9347-1271-45f0-bd1d-ce3701e35bef","name":"Login","type":"component","status":"operational","position":0},{"id":"5da24db1-597c-4c01-8f61-5ff87ec805b2","name":"Settings","type":"component","status":"operational","position":1}],"created_at":"2026-01-14T18:34:29.150095Z","modified_at":"2026-01-14T18:34:29.150095Z","name":"Application","position":0,"type":"group"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"group":{"data":null},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"status_page":{"data":{"id":"5ca46325-bac2-4a5e-aa26-5e7d5e1c029e","type":"status_pages"}}}}]}' + body: '{"data":[{"id":"bac73feb-3b3a-4f9b-81ad-b5532acfc96b","type":"components","attributes":{"components":[{"id":"d993969d-ca6c-4b74-aed6-7a0f93016e7f","name":"Login","type":"component","status":"operational","position":0},{"id":"457c3e35-56a5-472f-a284-4e2222c77631","name":"Settings","type":"component","status":"operational","position":1}],"created_at":"2026-01-21T21:23:47.079687Z","modified_at":"2026-01-21T21:23:47.079687Z","name":"Application","position":0,"type":"group"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"group":{"data":null},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"status_page":{"data":{"id":"02b22755-8a22-449f-817b-c4f649f37ebd","type":"status_pages"}}}}]}' code: 200 duration: 0ms headers: @@ -45,7 +45,7 @@ interactions: - '*/*' id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/statuspages/5ca46325-bac2-4a5e-aa26-5e7d5e1c029e + url: https://api.datadoghq.com/api/v2/statuspages/02b22755-8a22-449f-817b-c4f649f37ebd response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_List_degradations_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_List_degradations_returns_OK_response.freeze index 46d453f1cfd..5ef43ee5a2e 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_List_degradations_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_List_degradations_returns_OK_response.freeze @@ -1 +1 @@ -2026-01-14T18:34:30.142Z \ No newline at end of file +2026-01-21T21:23:48.128Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_List_degradations_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_List_degradations_returns_OK_response.yaml index df853d9ae0a..f109c413352 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_List_degradations_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_List_degradations_returns_OK_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"components":[{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"name":"Application","type":"group"}],"domain_prefix":"status-page-af0603c6bb50c13f","enabled":true,"name":"A Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}} + {"data":{"attributes":{"components":[{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"name":"Application","type":"group"}],"domain_prefix":"9e7f8b0822635170","enabled":true,"name":"A Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}} form: {} headers: Accept: @@ -12,8 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/statuspages response: - body: '{"data":{"id":"19846f06-cd73-44f5-aed1-73dbaa31d58d","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"b2c0e2dd-69e3-4e5a-b8d3-45a26d9428f7","name":"Application","type":"group","position":0,"components":[{"id":"0e309a2e-7cac-47d2-90c9-0301ed7e55e7","name":"Login","type":"component","status":"operational","position":0},{"id":"b0d0261c-d58d-438b-98aa-1828a0aaac36","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-01-14T18:34:30.242647Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"status-page-af0603c6bb50c13f","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-14T18:34:30.242647Z","name":"A - Status Page","page_url":"https://frog.datadoghq.com/status-pages/19846f06-cd73-44f5-aed1-73dbaa31d58d/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' + body: '{"data":{"id":"fcf5cb92-aa21-43c1-b2c3-54ff692fef7b","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"0b52346d-8cd1-407b-a085-44f7f3c47ba4","name":"Application","type":"group","position":0,"components":[{"id":"b257b99d-355b-4b2c-82c0-335694c1e940","name":"Login","type":"component","status":"operational","position":0},{"id":"27415b2b-1759-49a9-a298-34fec18177c1","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-01-21T21:23:48.239521Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"9e7f8b0822635170","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-21T21:23:48.239521Z","name":"A + Status Page","page_url":"https://frog.datadoghq.com/status-pages/fcf5cb92-aa21-43c1-b2c3-54ff692fef7b/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' code: 201 duration: 0ms headers: @@ -22,7 +22,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"components_affected":[{"id":"0e309a2e-7cac-47d2-90c9-0301ed7e55e7","status":"major_outage"}],"description":"Our API is experiencing elevated latency. We are investigating the issue.","status":"investigating","title":"Elevated API Latency"},"type":"degradations"}} + {"data":{"attributes":{"components_affected":[{"id":"b257b99d-355b-4b2c-82c0-335694c1e940","status":"major_outage"}],"description":"Our API is experiencing elevated latency. We are investigating the issue.","status":"investigating","title":"Elevated API Latency"},"type":"degradations"}} form: {} headers: Accept: @@ -31,12 +31,12 @@ interactions: - application/json id: 1 method: POST - url: https://api.datadoghq.com/api/v2/statuspages/19846f06-cd73-44f5-aed1-73dbaa31d58d/degradations + url: https://api.datadoghq.com/api/v2/statuspages/fcf5cb92-aa21-43c1-b2c3-54ff692fef7b/degradations response: - body: '{"data":{"id":"3679c370-8e6c-4779-89ca-2952c68800ac","type":"degradations","attributes":{"components_affected":[{"id":"0e309a2e-7cac-47d2-90c9-0301ed7e55e7","name":"Login","status":"major_outage"}],"created_at":"2026-01-14T18:34:30.903058Z","description":"Our - API is experiencing elevated latency. We are investigating the issue.","modified_at":"2026-01-14T18:34:30.903058Z","status":"investigating","title":"Elevated - API Latency","updates":[{"id":"214cdbcb-f1e3-48fb-a8bc-7211fdb02922","created_at":"2026-01-14T18:34:30.903058Z","modified_at":"2026-01-14T18:34:30.903058Z","status":"investigating","description":"Our - API is experiencing elevated latency. We are investigating the issue.","components_affected":[{"id":"0e309a2e-7cac-47d2-90c9-0301ed7e55e7","name":"Login","status":"major_outage"}]}]},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"status_page":{"data":{"id":"19846f06-cd73-44f5-aed1-73dbaa31d58d","type":"status_pages"}}}}}' + body: '{"data":{"id":"2339dce7-c32c-42f4-88c6-ce3ff16f0cbd","type":"degradations","attributes":{"components_affected":[{"id":"b257b99d-355b-4b2c-82c0-335694c1e940","name":"Login","status":"major_outage"}],"created_at":"2026-01-21T21:23:48.836304Z","description":"Our + API is experiencing elevated latency. We are investigating the issue.","modified_at":"2026-01-21T21:23:48.836304Z","status":"investigating","title":"Elevated + API Latency","updates":[{"id":"7959ea84-30c5-4c55-a12a-8272fab2b1cd","created_at":"2026-01-21T21:23:48.836304Z","modified_at":"2026-01-21T21:23:48.836304Z","status":"investigating","description":"Our + API is experiencing elevated latency. We are investigating the issue.","components_affected":[{"id":"b257b99d-355b-4b2c-82c0-335694c1e940","name":"Login","status":"major_outage"}]}]},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"status_page":{"data":{"id":"fcf5cb92-aa21-43c1-b2c3-54ff692fef7b","type":"status_pages"}}}}}' code: 201 duration: 0ms headers: @@ -53,10 +53,10 @@ interactions: method: GET url: https://api.datadoghq.com/api/v2/statuspages/degradations response: - body: '{"data":[{"id":"3679c370-8e6c-4779-89ca-2952c68800ac","type":"degradations","attributes":{"components_affected":[{"id":"0e309a2e-7cac-47d2-90c9-0301ed7e55e7","name":"Login","status":"major_outage"}],"created_at":"2026-01-14T18:34:30.903058Z","description":"Our - API is experiencing elevated latency. We are investigating the issue.","modified_at":"2026-01-14T18:34:30.903058Z","status":"investigating","title":"Elevated - API Latency","updates":[{"id":"214cdbcb-f1e3-48fb-a8bc-7211fdb02922","created_at":"2026-01-14T18:34:30.903058Z","modified_at":"2026-01-14T18:34:30.903058Z","status":"investigating","description":"Our - API is experiencing elevated latency. We are investigating the issue.","components_affected":[{"id":"0e309a2e-7cac-47d2-90c9-0301ed7e55e7","name":"Login","status":"major_outage"}]}]},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"status_page":{"data":{"id":"19846f06-cd73-44f5-aed1-73dbaa31d58d","type":"status_pages"}}}}],"meta":{"page":{"type":"offset_limit","offset":0,"limit":50,"total":1,"first_offset":0,"prev_offset":null,"next_offset":null,"last_offset":0}}}' + body: '{"data":[{"id":"2339dce7-c32c-42f4-88c6-ce3ff16f0cbd","type":"degradations","attributes":{"components_affected":[{"id":"b257b99d-355b-4b2c-82c0-335694c1e940","name":"Login","status":"major_outage"}],"created_at":"2026-01-21T21:23:48.836304Z","description":"Our + API is experiencing elevated latency. We are investigating the issue.","modified_at":"2026-01-21T21:23:48.836304Z","status":"investigating","title":"Elevated + API Latency","updates":[{"id":"7959ea84-30c5-4c55-a12a-8272fab2b1cd","created_at":"2026-01-21T21:23:48.836304Z","modified_at":"2026-01-21T21:23:48.836304Z","status":"investigating","description":"Our + API is experiencing elevated latency. We are investigating the issue.","components_affected":[{"id":"b257b99d-355b-4b2c-82c0-335694c1e940","name":"Login","status":"major_outage"}]}]},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"status_page":{"data":{"id":"fcf5cb92-aa21-43c1-b2c3-54ff692fef7b","type":"status_pages"}}}}],"meta":{"page":{"type":"offset_limit","offset":0,"limit":50,"total":1,"first_offset":0,"prev_offset":null,"next_offset":null,"last_offset":0}}}' code: 200 duration: 0ms headers: @@ -71,7 +71,7 @@ interactions: - '*/*' id: 3 method: DELETE - url: https://api.datadoghq.com/api/v2/statuspages/19846f06-cd73-44f5-aed1-73dbaa31d58d/degradations/3679c370-8e6c-4779-89ca-2952c68800ac + url: https://api.datadoghq.com/api/v2/statuspages/fcf5cb92-aa21-43c1-b2c3-54ff692fef7b/degradations/2339dce7-c32c-42f4-88c6-ce3ff16f0cbd response: body: '' code: 204 @@ -86,7 +86,7 @@ interactions: - '*/*' id: 4 method: DELETE - url: https://api.datadoghq.com/api/v2/statuspages/19846f06-cd73-44f5-aed1-73dbaa31d58d + url: https://api.datadoghq.com/api/v2/statuspages/fcf5cb92-aa21-43c1-b2c3-54ff692fef7b response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_List_status_pages_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_List_status_pages_returns_OK_response.freeze index d3bb3e54b29..95c95875d8d 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_List_status_pages_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_List_status_pages_returns_OK_response.freeze @@ -1 +1 @@ -2026-01-14T18:34:31.731Z \ No newline at end of file +2026-01-21T21:23:49.653Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_List_status_pages_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_List_status_pages_returns_OK_response.yaml index 95cd20eff12..fedae7ce357 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_List_status_pages_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_List_status_pages_returns_OK_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"components":[{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"name":"Application","type":"group"}],"domain_prefix":"status-page-473ecd94e34d0b23","enabled":true,"name":"A Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}} + {"data":{"attributes":{"components":[{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"name":"Application","type":"group"}],"domain_prefix":"a292a726f79d8dd3","enabled":true,"name":"A Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}} form: {} headers: Accept: @@ -12,8 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/statuspages response: - body: '{"data":{"id":"259141bd-d78b-4c24-9529-b8f9c4f881ed","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"1913d8c1-711f-41b9-9dcc-96820c18f1c4","name":"Application","type":"group","position":0,"components":[{"id":"b564dd30-d03c-41b7-9012-fed1bcf04e6c","name":"Login","type":"component","status":"operational","position":0},{"id":"f1db5443-7982-436a-85b1-f83f055aa298","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-01-14T18:34:31.824982Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"status-page-473ecd94e34d0b23","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-14T18:34:31.824982Z","name":"A - Status Page","page_url":"https://frog.datadoghq.com/status-pages/259141bd-d78b-4c24-9529-b8f9c4f881ed/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' + body: '{"data":{"id":"2fb5cefa-a43b-4974-b439-96cef54df054","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"82aa9ec5-5394-4138-8d6c-475ed209b03d","name":"Application","type":"group","position":0,"components":[{"id":"5e7fc960-39ed-4522-aa38-187f41ace1fd","name":"Login","type":"component","status":"operational","position":0},{"id":"eda28835-e8a6-44a1-87f7-8da14819152b","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-01-21T21:23:49.763982Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"a292a726f79d8dd3","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-21T21:23:49.763982Z","name":"A + Status Page","page_url":"https://frog.datadoghq.com/status-pages/2fb5cefa-a43b-4974-b439-96cef54df054/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' code: 201 duration: 0ms headers: @@ -30,8 +30,8 @@ interactions: method: GET url: https://api.datadoghq.com/api/v2/statuspages response: - body: '{"data":[{"id":"259141bd-d78b-4c24-9529-b8f9c4f881ed","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"1913d8c1-711f-41b9-9dcc-96820c18f1c4","name":"Application","type":"group","position":0,"components":[{"id":"b564dd30-d03c-41b7-9012-fed1bcf04e6c","name":"Login","type":"component","status":"operational","position":0},{"id":"f1db5443-7982-436a-85b1-f83f055aa298","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-01-14T18:34:31.824982Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"status-page-473ecd94e34d0b23","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-14T18:34:31.824982Z","name":"A - Status Page","page_url":"https://frog.datadoghq.com/status-pages/259141bd-d78b-4c24-9529-b8f9c4f881ed/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}],"meta":{"page":{"type":"offset_limit","offset":0,"limit":50,"total":null,"first_offset":0,"prev_offset":null,"next_offset":50,"last_offset":null}}}' + body: '{"data":[{"id":"2fb5cefa-a43b-4974-b439-96cef54df054","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"82aa9ec5-5394-4138-8d6c-475ed209b03d","name":"Application","type":"group","position":0,"components":[{"id":"5e7fc960-39ed-4522-aa38-187f41ace1fd","name":"Login","type":"component","status":"operational","position":0},{"id":"eda28835-e8a6-44a1-87f7-8da14819152b","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-01-21T21:23:49.763982Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"a292a726f79d8dd3","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-21T21:23:49.763982Z","name":"A + Status Page","page_url":"https://frog.datadoghq.com/status-pages/2fb5cefa-a43b-4974-b439-96cef54df054/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}],"meta":{"page":{"type":"offset_limit","offset":0,"limit":50,"total":null,"first_offset":0,"prev_offset":null,"next_offset":50,"last_offset":null}}}' code: 200 duration: 0ms headers: @@ -46,7 +46,7 @@ interactions: - '*/*' id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/statuspages/259141bd-d78b-4c24-9529-b8f9c4f881ed + url: https://api.datadoghq.com/api/v2/statuspages/2fb5cefa-a43b-4974-b439-96cef54df054 response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Update_component_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Update_component_returns_OK_response.freeze index 7d008cc05ba..7b2cd91b767 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Update_component_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Update_component_returns_OK_response.freeze @@ -1 +1 @@ -2026-01-14T18:34:32.900Z \ No newline at end of file +2026-01-21T21:23:50.959Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Update_component_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Update_component_returns_OK_response.yaml index f13ff8b4f5b..3dae18060bc 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Update_component_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Update_component_returns_OK_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"components":[{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"name":"Application","type":"group"}],"domain_prefix":"status-page-50dba6ea54427f33","enabled":true,"name":"A Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}} + {"data":{"attributes":{"components":[{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"name":"Application","type":"group"}],"domain_prefix":"18ce7dca5f31f286","enabled":true,"name":"A Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}} form: {} headers: Accept: @@ -12,8 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/statuspages response: - body: '{"data":{"id":"d26e4f72-b0a3-4f13-bd0d-59f338781de3","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"40034290-5bed-4588-bf4e-121b23d20c6e","name":"Application","type":"group","position":0,"components":[{"id":"2a49e23f-d513-4b9c-871b-86f03887349a","name":"Login","type":"component","status":"operational","position":0},{"id":"6cddd877-ea55-41ac-b3d9-dc0c737771cb","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-01-14T18:34:32.985561Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"status-page-50dba6ea54427f33","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-14T18:34:32.985561Z","name":"A - Status Page","page_url":"https://frog.datadoghq.com/status-pages/d26e4f72-b0a3-4f13-bd0d-59f338781de3/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' + body: '{"data":{"id":"2f95d75e-d08f-4c37-8808-2b0246f86e16","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"7a828867-d56d-41a9-bc35-9eec112fd334","name":"Application","type":"group","position":0,"components":[{"id":"424cedb4-c0c1-4726-871a-5927588ca835","name":"Login","type":"component","status":"operational","position":0},{"id":"1cdf79d4-4c20-4388-ab76-c24f6c140bcb","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-01-21T21:23:51.072685Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"18ce7dca5f31f286","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-21T21:23:51.072685Z","name":"A + Status Page","page_url":"https://frog.datadoghq.com/status-pages/2f95d75e-d08f-4c37-8808-2b0246f86e16/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' code: 201 duration: 0ms headers: @@ -22,7 +22,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"name":"Logs Indexing"},"id":"40034290-5bed-4588-bf4e-121b23d20c6e","type":"components"}} + {"data":{"attributes":{"name":"Logs Indexing"},"id":"7a828867-d56d-41a9-bc35-9eec112fd334","type":"components"}} form: {} headers: Accept: @@ -31,10 +31,10 @@ interactions: - application/json id: 1 method: PATCH - url: https://api.datadoghq.com/api/v2/statuspages/d26e4f72-b0a3-4f13-bd0d-59f338781de3/components/40034290-5bed-4588-bf4e-121b23d20c6e + url: https://api.datadoghq.com/api/v2/statuspages/2f95d75e-d08f-4c37-8808-2b0246f86e16/components/7a828867-d56d-41a9-bc35-9eec112fd334 response: - body: '{"data":{"id":"40034290-5bed-4588-bf4e-121b23d20c6e","type":"components","attributes":{"components":[{"id":"2a49e23f-d513-4b9c-871b-86f03887349a","name":"Login","type":"component","status":"operational","position":0},{"id":"6cddd877-ea55-41ac-b3d9-dc0c737771cb","name":"Settings","type":"component","status":"operational","position":1}],"created_at":"2026-01-14T18:34:32.985561Z","modified_at":"2026-01-14T18:34:33.510873Z","name":"Logs - Indexing","position":0,"type":"group"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"group":{"data":null},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"status_page":{"data":{"id":"d26e4f72-b0a3-4f13-bd0d-59f338781de3","type":"status_pages"}}}}}' + body: '{"data":{"id":"7a828867-d56d-41a9-bc35-9eec112fd334","type":"components","attributes":{"components":[{"id":"424cedb4-c0c1-4726-871a-5927588ca835","name":"Login","type":"component","status":"operational","position":0},{"id":"1cdf79d4-4c20-4388-ab76-c24f6c140bcb","name":"Settings","type":"component","status":"operational","position":1}],"created_at":"2026-01-21T21:23:51.072685Z","modified_at":"2026-01-21T21:23:51.606861Z","name":"Logs + Indexing","position":0,"type":"group"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"group":{"data":null},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"status_page":{"data":{"id":"2f95d75e-d08f-4c37-8808-2b0246f86e16","type":"status_pages"}}}}}' code: 200 duration: 0ms headers: @@ -49,7 +49,7 @@ interactions: - '*/*' id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/statuspages/d26e4f72-b0a3-4f13-bd0d-59f338781de3 + url: https://api.datadoghq.com/api/v2/statuspages/2f95d75e-d08f-4c37-8808-2b0246f86e16 response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Update_degradation_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Update_degradation_returns_OK_response.freeze index 9a463992e0d..7ba365b7947 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Update_degradation_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Update_degradation_returns_OK_response.freeze @@ -1 +1 @@ -2026-01-14T18:34:34.017Z \ No newline at end of file +2026-01-21T21:23:52.130Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Update_degradation_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Update_degradation_returns_OK_response.yaml index dabf7ae423d..80d7cc898b6 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Update_degradation_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Update_degradation_returns_OK_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"components":[{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"name":"Application","type":"group"}],"domain_prefix":"status-page-b3f9b4292208c5ac","enabled":true,"name":"A Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}} + {"data":{"attributes":{"components":[{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"name":"Application","type":"group"}],"domain_prefix":"63b50a302c459f7c","enabled":true,"name":"A Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}} form: {} headers: Accept: @@ -12,8 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/statuspages response: - body: '{"data":{"id":"4d07df0b-455e-4fc6-99ee-5b5bc300ebc9","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"5c2c9b2c-653f-404c-8121-93c7817a40aa","name":"Application","type":"group","position":0,"components":[{"id":"148f4a30-5e7d-42ba-9152-dbffc76ce411","name":"Login","type":"component","status":"operational","position":0},{"id":"3a81534a-ae51-4ad3-b904-4fd964ff33b5","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-01-14T18:34:34.127897Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"status-page-b3f9b4292208c5ac","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-14T18:34:34.127897Z","name":"A - Status Page","page_url":"https://frog.datadoghq.com/status-pages/4d07df0b-455e-4fc6-99ee-5b5bc300ebc9/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' + body: '{"data":{"id":"5df6e8f7-b903-4ba9-b0c5-d603536e23fa","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"545201a0-a23f-4cbd-ae78-9e392a686b0d","name":"Application","type":"group","position":0,"components":[{"id":"681d4866-a4ff-4e4e-b295-6b9586892675","name":"Login","type":"component","status":"operational","position":0},{"id":"e0c7b0ec-2517-43bd-a489-2f2f23eb0bc4","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-01-21T21:23:52.260223Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"63b50a302c459f7c","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-21T21:23:52.260223Z","name":"A + Status Page","page_url":"https://frog.datadoghq.com/status-pages/5df6e8f7-b903-4ba9-b0c5-d603536e23fa/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' code: 201 duration: 0ms headers: @@ -22,7 +22,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"components_affected":[{"id":"148f4a30-5e7d-42ba-9152-dbffc76ce411","status":"major_outage"}],"description":"Our API is experiencing elevated latency. We are investigating the issue.","status":"investigating","title":"Elevated API Latency"},"type":"degradations"}} + {"data":{"attributes":{"components_affected":[{"id":"681d4866-a4ff-4e4e-b295-6b9586892675","status":"major_outage"}],"description":"Our API is experiencing elevated latency. We are investigating the issue.","status":"investigating","title":"Elevated API Latency"},"type":"degradations"}} form: {} headers: Accept: @@ -31,12 +31,12 @@ interactions: - application/json id: 1 method: POST - url: https://api.datadoghq.com/api/v2/statuspages/4d07df0b-455e-4fc6-99ee-5b5bc300ebc9/degradations + url: https://api.datadoghq.com/api/v2/statuspages/5df6e8f7-b903-4ba9-b0c5-d603536e23fa/degradations response: - body: '{"data":{"id":"560e8fe9-ddfe-4376-9bb3-da8c0e1e1ec3","type":"degradations","attributes":{"components_affected":[{"id":"148f4a30-5e7d-42ba-9152-dbffc76ce411","name":"Login","status":"major_outage"}],"created_at":"2026-01-14T18:34:34.59942Z","description":"Our - API is experiencing elevated latency. We are investigating the issue.","modified_at":"2026-01-14T18:34:34.59942Z","status":"investigating","title":"Elevated - API Latency","updates":[{"id":"83b7db45-8432-4c8e-b543-49deacdb7f2e","created_at":"2026-01-14T18:34:34.59942Z","modified_at":"2026-01-14T18:34:34.59942Z","status":"investigating","description":"Our - API is experiencing elevated latency. We are investigating the issue.","components_affected":[{"id":"148f4a30-5e7d-42ba-9152-dbffc76ce411","name":"Login","status":"major_outage"}]}]},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"status_page":{"data":{"id":"4d07df0b-455e-4fc6-99ee-5b5bc300ebc9","type":"status_pages"}}}}}' + body: '{"data":{"id":"3e8741c2-3c93-4346-9ddc-67d381baee05","type":"degradations","attributes":{"components_affected":[{"id":"681d4866-a4ff-4e4e-b295-6b9586892675","name":"Login","status":"major_outage"}],"created_at":"2026-01-21T21:23:52.827013Z","description":"Our + API is experiencing elevated latency. We are investigating the issue.","modified_at":"2026-01-21T21:23:52.827013Z","status":"investigating","title":"Elevated + API Latency","updates":[{"id":"e97d38d6-936d-4a4c-b07e-fad1379f414f","created_at":"2026-01-21T21:23:52.827013Z","modified_at":"2026-01-21T21:23:52.827013Z","status":"investigating","description":"Our + API is experiencing elevated latency. We are investigating the issue.","components_affected":[{"id":"681d4866-a4ff-4e4e-b295-6b9586892675","name":"Login","status":"major_outage"}]}]},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"status_page":{"data":{"id":"5df6e8f7-b903-4ba9-b0c5-d603536e23fa","type":"status_pages"}}}}}' code: 201 duration: 0ms headers: @@ -45,7 +45,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"title":"Elevated API Latency in US1"},"id":"560e8fe9-ddfe-4376-9bb3-da8c0e1e1ec3","type":"degradations"}} + {"data":{"attributes":{"title":"Elevated API Latency in US1"},"id":"3e8741c2-3c93-4346-9ddc-67d381baee05","type":"degradations"}} form: {} headers: Accept: @@ -54,12 +54,12 @@ interactions: - application/json id: 2 method: PATCH - url: https://api.datadoghq.com/api/v2/statuspages/4d07df0b-455e-4fc6-99ee-5b5bc300ebc9/degradations/560e8fe9-ddfe-4376-9bb3-da8c0e1e1ec3 + url: https://api.datadoghq.com/api/v2/statuspages/5df6e8f7-b903-4ba9-b0c5-d603536e23fa/degradations/3e8741c2-3c93-4346-9ddc-67d381baee05 response: - body: '{"data":{"id":"560e8fe9-ddfe-4376-9bb3-da8c0e1e1ec3","type":"degradations","attributes":{"components_affected":[{"id":"148f4a30-5e7d-42ba-9152-dbffc76ce411","name":"Login","status":"major_outage"}],"created_at":"2026-01-14T18:34:34.59942Z","description":"Our - API is experiencing elevated latency. We are investigating the issue.","modified_at":"2026-01-14T18:34:34.781458Z","status":"investigating","title":"Elevated - API Latency in US1","updates":[{"id":"83b7db45-8432-4c8e-b543-49deacdb7f2e","created_at":"2026-01-14T18:34:34.59942Z","modified_at":"2026-01-14T18:34:34.59942Z","status":"investigating","description":"Our - API is experiencing elevated latency. We are investigating the issue.","components_affected":[{"id":"148f4a30-5e7d-42ba-9152-dbffc76ce411","name":"Login","status":"major_outage"}]}]},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"status_page":{"data":{"id":"4d07df0b-455e-4fc6-99ee-5b5bc300ebc9","type":"status_pages"}}}}}' + body: '{"data":{"id":"3e8741c2-3c93-4346-9ddc-67d381baee05","type":"degradations","attributes":{"components_affected":[{"id":"681d4866-a4ff-4e4e-b295-6b9586892675","name":"Login","status":"major_outage"}],"created_at":"2026-01-21T21:23:52.827013Z","description":"Our + API is experiencing elevated latency. We are investigating the issue.","modified_at":"2026-01-21T21:23:52.984252Z","status":"investigating","title":"Elevated + API Latency in US1","updates":[{"id":"e97d38d6-936d-4a4c-b07e-fad1379f414f","created_at":"2026-01-21T21:23:52.827013Z","modified_at":"2026-01-21T21:23:52.827013Z","status":"investigating","description":"Our + API is experiencing elevated latency. We are investigating the issue.","components_affected":[{"id":"681d4866-a4ff-4e4e-b295-6b9586892675","name":"Login","status":"major_outage"}]}]},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"status_page":{"data":{"id":"5df6e8f7-b903-4ba9-b0c5-d603536e23fa","type":"status_pages"}}}}}' code: 200 duration: 0ms headers: @@ -74,7 +74,7 @@ interactions: - '*/*' id: 3 method: DELETE - url: https://api.datadoghq.com/api/v2/statuspages/4d07df0b-455e-4fc6-99ee-5b5bc300ebc9/degradations/560e8fe9-ddfe-4376-9bb3-da8c0e1e1ec3 + url: https://api.datadoghq.com/api/v2/statuspages/5df6e8f7-b903-4ba9-b0c5-d603536e23fa/degradations/3e8741c2-3c93-4346-9ddc-67d381baee05 response: body: '' code: 204 @@ -89,7 +89,7 @@ interactions: - '*/*' id: 4 method: DELETE - url: https://api.datadoghq.com/api/v2/statuspages/4d07df0b-455e-4fc6-99ee-5b5bc300ebc9 + url: https://api.datadoghq.com/api/v2/statuspages/5df6e8f7-b903-4ba9-b0c5-d603536e23fa response: body: '' code: 204 diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Update_status_page_returns_OK_response.freeze b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Update_status_page_returns_OK_response.freeze index 8256c1a6203..bbf12a2e765 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Update_status_page_returns_OK_response.freeze +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Update_status_page_returns_OK_response.freeze @@ -1 +1 @@ -2026-01-14T18:34:35.491Z \ No newline at end of file +2026-01-21T21:23:53.747Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Update_status_page_returns_OK_response.yaml b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Update_status_page_returns_OK_response.yaml index dad5e6f158a..575d2b75513 100644 --- a/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Update_status_page_returns_OK_response.yaml +++ b/tests/scenarios/cassettes/TestScenarios/v2/Feature_Status_Pages/Scenario_Update_status_page_returns_OK_response.yaml @@ -1,7 +1,7 @@ interactions: - request: body: | - {"data":{"attributes":{"components":[{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"name":"Application","type":"group"}],"domain_prefix":"status-page-0de3b6407596e7bc","enabled":true,"name":"A Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}} + {"data":{"attributes":{"components":[{"components":[{"name":"Login","position":0,"type":"component"},{"name":"Settings","position":1,"type":"component"}],"name":"Application","type":"group"}],"domain_prefix":"f7d669fd50a8ce89","enabled":true,"name":"A Status Page","type":"internal","visualization_type":"bars_and_uptime_percentage"},"type":"status_pages"}} form: {} headers: Accept: @@ -12,8 +12,8 @@ interactions: method: POST url: https://api.datadoghq.com/api/v2/statuspages response: - body: '{"data":{"id":"a82d0d18-667c-453a-8365-36a24caff175","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"ea5ac828-654d-4bf9-a919-65a1dd24720a","name":"Application","type":"group","position":0,"components":[{"id":"f83cbfff-d702-4602-9706-97a3b2041434","name":"Login","type":"component","status":"operational","position":0},{"id":"2f8de9a3-10c7-44b1-b882-66dc063b4afa","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-01-14T18:34:35.581608Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"status-page-0de3b6407596e7bc","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-14T18:34:35.581608Z","name":"A - Status Page","page_url":"https://frog.datadoghq.com/status-pages/a82d0d18-667c-453a-8365-36a24caff175/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' + body: '{"data":{"id":"197028d4-9c5e-420f-acb1-963ae82ebf22","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"8f68e844-d983-473a-84c7-f5a4544ef430","name":"Application","type":"group","position":0,"components":[{"id":"a22c28e9-d717-45b7-bab8-d1cda9349dd4","name":"Login","type":"component","status":"operational","position":0},{"id":"310a77dd-1afd-426d-8e3e-3652da90db23","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-01-21T21:23:53.873851Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"f7d669fd50a8ce89","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-21T21:23:53.873851Z","name":"A + Status Page","page_url":"https://frog.datadoghq.com/status-pages/197028d4-9c5e-420f-acb1-963ae82ebf22/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' code: 201 duration: 0ms headers: @@ -22,7 +22,7 @@ interactions: status: 201 Created - request: body: | - {"data":{"attributes":{"name":"A Status Page in US1"},"id":"a82d0d18-667c-453a-8365-36a24caff175","type":"status_pages"}} + {"data":{"attributes":{"name":"A Status Page in US1"},"id":"197028d4-9c5e-420f-acb1-963ae82ebf22","type":"status_pages"}} form: {} headers: Accept: @@ -31,10 +31,10 @@ interactions: - application/json id: 1 method: PATCH - url: https://api.datadoghq.com/api/v2/statuspages/a82d0d18-667c-453a-8365-36a24caff175 + url: https://api.datadoghq.com/api/v2/statuspages/197028d4-9c5e-420f-acb1-963ae82ebf22 response: - body: '{"data":{"id":"a82d0d18-667c-453a-8365-36a24caff175","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"ea5ac828-654d-4bf9-a919-65a1dd24720a","name":"Application","type":"group","position":0,"components":[{"id":"f83cbfff-d702-4602-9706-97a3b2041434","name":"Login","type":"component","status":"operational","position":0},{"id":"2f8de9a3-10c7-44b1-b882-66dc063b4afa","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-01-14T18:34:35.581608Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"status-page-0de3b6407596e7bc","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-14T18:34:36.073572Z","name":"A - Status Page in US1","page_url":"https://frog.datadoghq.com/status-pages/a82d0d18-667c-453a-8365-36a24caff175/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' + body: '{"data":{"id":"197028d4-9c5e-420f-acb1-963ae82ebf22","type":"status_pages","attributes":{"company_logo":null,"components":[{"id":"8f68e844-d983-473a-84c7-f5a4544ef430","name":"Application","type":"group","position":0,"components":[{"id":"a22c28e9-d717-45b7-bab8-d1cda9349dd4","name":"Login","type":"component","status":"operational","position":0},{"id":"310a77dd-1afd-426d-8e3e-3652da90db23","name":"Settings","type":"component","status":"operational","position":1}]}],"created_at":"2026-01-21T21:23:53.873851Z","custom_domain":null,"custom_domain_enabled":false,"domain_prefix":"f7d669fd50a8ce89","email_header_image":null,"enabled":true,"favicon":null,"modified_at":"2026-01-21T21:23:54.528957Z","name":"A + Status Page in US1","page_url":"https://frog.datadoghq.com/status-pages/197028d4-9c5e-420f-acb1-963ae82ebf22/view","subscriptions_enabled":false,"type":"internal","visualization_type":"bars_and_uptime_percentage"},"relationships":{"created_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}},"last_modified_by_user":{"data":{"id":"3ad549bf-eba0-11e9-a77a-0705486660d0","type":"users"}}}}}' code: 200 duration: 0ms headers: @@ -49,7 +49,7 @@ interactions: - '*/*' id: 2 method: DELETE - url: https://api.datadoghq.com/api/v2/statuspages/a82d0d18-667c-453a-8365-36a24caff175 + url: https://api.datadoghq.com/api/v2/statuspages/197028d4-9c5e-420f-acb1-963ae82ebf22 response: body: '' code: 204 diff --git a/tests/scenarios/features/v2/given.json b/tests/scenarios/features/v2/given.json index 230c0a622b4..1d65907ff13 100644 --- a/tests/scenarios/features/v2/given.json +++ b/tests/scenarios/features/v2/given.json @@ -1051,7 +1051,7 @@ "parameters": [ { "name": "body", - "value": "{\n \"data\": {\n \"type\": \"suppressions\",\n \"attributes\": {\n \"enabled\": true,\n \"name\": \"suppression {{ unique }}\",\n \"description\": \"{{ unique }}\",\n \"rule_query\": \"source:cloudtrail\",\n \"suppression_query\": \"env:test\",\n \"tags\": [\"technique:T1110-brute-force\", \"source:cloudtrail\"]\n }\n }\n}" + "value": "{\n \"data\": {\n \"type\": \"suppressions\",\n \"attributes\": {\n \"enabled\": true,\n \"name\": \"suppression {{ unique_hash }}\",\n \"description\": \"{{ unique }}\",\n \"rule_query\": \"source:cloudtrail\",\n \"suppression_query\": \"env:test\",\n \"tags\": [\"technique:T1110-brute-force\", \"source:cloudtrail\"]\n }\n }\n}" } ], "step": "there is a valid \"suppression\" in the system", @@ -1063,7 +1063,7 @@ "parameters": [ { "name": "body", - "value": "{\n \"data\": {\n \"type\": \"suppressions\",\n \"attributes\": {\n \"enabled\": true,\n \"name\": \"suppression2 {{ unique }}\",\n \"description\": \"{{ unique }}\",\n \"rule_query\": \"source:cloudtrail\",\n \"suppression_query\": \"env:test\",\n \"tags\": [\"technique:T1110-brute-force\", \"source:cloudtrail\"]\n }\n }\n}" + "value": "{\n \"data\": {\n \"type\": \"suppressions\",\n \"attributes\": {\n \"enabled\": true,\n \"name\": \"suppression2 {{ unique_hash }}\",\n \"description\": \"{{ unique }}\",\n \"rule_query\": \"source:cloudtrail\",\n \"suppression_query\": \"env:test\",\n \"tags\": [\"technique:T1110-brute-force\", \"source:cloudtrail\"]\n }\n }\n}" } ], "step": "there is a valid \"suppression2\" in the system", @@ -1229,7 +1229,7 @@ "parameters": [ { "name": "body", - "value": "{\n \"data\": {\n \"attributes\": {\n \"name\": \"A Status Page\",\n \"domain_prefix\": \"status-page-{{ unique_hash }}\",\n \"components\": [{\"name\": \"Application\", \"type\": \"group\", \"components\":[{\"name\": \"Login\", \"type\": \"component\", \"position\": 0},{\"name\": \"Settings\", \"type\": \"component\", \"position\": 1}]}],\n \"type\": \"internal\",\n \"visualization_type\": \"bars_and_uptime_percentage\",\n \"enabled\": true\n },\n \"type\": \"status_pages\"\n }\n}" + "value": "{\n \"data\": {\n \"attributes\": {\n \"name\": \"A Status Page\",\n \"domain_prefix\": \"{{ unique_hash }}\",\n \"components\": [{\"name\": \"Application\", \"type\": \"group\", \"components\":[{\"name\": \"Login\", \"type\": \"component\", \"position\": 0},{\"name\": \"Settings\", \"type\": \"component\", \"position\": 1}]}],\n \"type\": \"internal\",\n \"visualization_type\": \"bars_and_uptime_percentage\",\n \"enabled\": true\n },\n \"type\": \"status_pages\"\n }\n}" } ], "step": "there is a valid \"status_page\" in the system", diff --git a/tests/scenarios/features/v2/security_monitoring.feature b/tests/scenarios/features/v2/security_monitoring.feature index 2366d2f3043..ccc027734e2 100644 --- a/tests/scenarios/features/v2/security_monitoring.feature +++ b/tests/scenarios/features/v2/security_monitoring.feature @@ -9,7 +9,7 @@ Feature: Security Monitoring And a valid "appKeyAuth" key in the system And an instance of "SecurityMonitoring" API - @skip @team:DataDog/k9-investigation + @team:DataDog/k9-investigation Scenario: Attach security finding to a Jira issue returns "OK" response Given new "AttachJiraIssue" request And body with value {"data": {"attributes": {"jira_issue_url": "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"}, "relationships": {"findings": {"data": [{"id": "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}} @@ -30,21 +30,21 @@ Feature: Security Monitoring And the response "data.attributes.status_group" is equal to "SG_OPEN" And the response "data.attributes.insights" has item with field "resource_id" with value "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=" - @skip @team:DataDog/k9-investigation + @team:DataDog/k9-investigation Scenario: Attach security findings to a Jira issue returns "Bad Request" response Given new "AttachJiraIssue" request And body with value {"data": {"attributes": {"jira_issue_url": "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"}, "relationships": {"findings": {"data": []}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}} When the request is sent Then the response status is 400 Bad Request - @skip @team:DataDog/k9-investigation + @team:DataDog/k9-investigation Scenario: Attach security findings to a Jira issue returns "Not Found" response Given new "AttachJiraIssue" request And body with value {"data": {"attributes": {"jira_issue_url": "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"}, "relationships": {"findings": {"data": [{"id": "wrong-finding-id", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}} When the request is sent Then the response status is 404 Not Found - @skip @team:DataDog/k9-investigation + @team:DataDog/k9-investigation Scenario: Attach security findings to a Jira issue returns "OK" response Given new "AttachJiraIssue" request And body with value {"data": {"attributes": {"jira_issue_url": "https://datadoghq-sandbox-538.atlassian.net/browse/CSMSEC-105476"}, "relationships": {"findings": {"data": [{"id": "OTQ3NjJkMmYwMTIzMzMxNTc1Y2Q4MTA5NWU0NTBmMDl-ZjE3NjMxZWVkYzBjZGI1NDY2NWY2OGQxZDk4MDY4MmI=", "type": "findings"}, {"id": "MTNjN2ZmYWMzMDIxYmU1ZDFiZDRjNWUwN2I1NzVmY2F-YTA3MzllMTUzNWM3NmEyZjdiNzEzOWM5YmViZTMzOGM=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}} @@ -280,27 +280,75 @@ Feature: Security Monitoring Then the response status is 200 OK And the response "terraformContent" is equal to "resource \"datadog_security_monitoring_rule\" \"_{{ unique_hash }}\" {\n\tname = \"_{{ unique_hash }}\"\n\tenabled = true\n\tquery {\n\t\tquery = \"@test:true\"\n\t\tgroup_by_fields = []\n\t\thas_optional_group_by_fields = false\n\t\tdistinct_fields = []\n\t\taggregation = \"count\"\n\t\tname = \"\"\n\t\tdata_source = \"logs\"\n\t}\n\toptions {\n\t\tkeep_alive = 3600\n\t\tmax_signal_duration = 86400\n\t\tdetection_method = \"threshold\"\n\t\tevaluation_window = 900\n\t}\n\tcase {\n\t\tname = \"\"\n\t\tstatus = \"info\"\n\t\tnotifications = []\n\t\tcondition = \"a > 0\"\n\t}\n\tmessage = \"Test rule\"\n\ttags = []\n\thas_extended_title = false\n\ttype = \"log_detection\"\n}\n" - @generated @skip @team:DataDog/k9-investigation + @team:DataDog/k9-investigation + Scenario: Create Jira issue for security finding returns "Created" response + Given new "CreateJiraIssues" request + And body with value {"data": [{"attributes": {"title": "A title", "description": "A description"}, "relationships": {"findings": {"data": [{"id": "YmNlZmJhYTcyMDU5ZDk0ZDhiNjRmNGI0NDk4MDdiNzN-MDJlMjg0NzNmYzJiODY2MzJkNjU0OTI4NmVhZTUyY2U=", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}]} + When the request is sent + Then the response status is 201 Created + And the response "data" has length 1 + And the response "data[0]" has field "id" + And the response "data[0].attributes.title" is equal to "A title" + And the response "data[0].attributes.description" is equal to "A description" + And the response "data[0].attributes.type" is equal to "SECURITY" + And the response "data[0].attributes.insights" has length 1 + And the response "data[0].attributes.insights[0].resource_id" is equal to "YmNlZmJhYTcyMDU5ZDk0ZDhiNjRmNGI0NDk4MDdiNzN-MDJlMjg0NzNmYzJiODY2MzJkNjU0OTI4NmVhZTUyY2U=" + And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING" + And the response "data[0].attributes.jira_issue.status" is equal to "COMPLETED" + + @team:DataDog/k9-investigation + Scenario: Create Jira issue for security findings returns "Created" response + Given new "CreateJiraIssues" request + And body with value {"data": [{"attributes": {"title": "A title", "description": "A description"}, "relationships": {"findings": {"data": [{"id": "a3ZoLXNjbS14eXV-aS0wNWY5MGYwMGE4NDg2ODdlOA==", "type": "findings"}, {"id": "eWswLWJsdC1hZm5-aS0wMjRlYTgwMzVkZTU1MGIwYQ==", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}]} + When the request is sent + Then the response status is 201 Created + And the response "data" has length 1 + And the response "data[0]" has field "id" + And the response "data[0].attributes.title" is equal to "A title" + And the response "data[0].attributes.description" is equal to "A description" + And the response "data[0].attributes.type" is equal to "SECURITY" + And the response "data[0].attributes.insights" has length 2 + And the response "data[0].attributes.insights[1].resource_id" is equal to "eWswLWJsdC1hZm5-aS0wMjRlYTgwMzVkZTU1MGIwYQ==" + And the response "data[0].attributes.insights[1].type" is equal to "SECURITY_FINDING" + And the response "data[0].attributes.insights[0].resource_id" is equal to "a3ZoLXNjbS14eXV-aS0wNWY5MGYwMGE4NDg2ODdlOA==" + And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING" + And the response "data[0].attributes.jira_issue.status" is equal to "COMPLETED" + + @team:DataDog/k9-investigation Scenario: Create Jira issues for security findings returns "Bad Request" response - Given operation "CreateJiraIssues" enabled - And new "CreateJiraIssues" request - And body with value {"data": [{"attributes": {"assignee_id": "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0", "description": "A description of the Jira issue.", "fields": {"key1": "value", "key2": ["value"], "key3": {"key4": "value"}}, "priority": "NOT_DEFINED", "title": "A title for the Jira issue."}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "jira_issues"}]} + Given new "CreateJiraIssues" request + And body with value {"data": [{"attributes": {}, "relationships": {"findings": {"data": []}, "project": {"data": {"id": "7f198869-c7ef-4afc-97cf-da5cdc13b5c3", "type": "projects"}}}, "type": "jira_issues"}]} When the request is sent Then the response status is 400 Bad Request - @generated @skip @team:DataDog/k9-investigation + @team:DataDog/k9-investigation Scenario: Create Jira issues for security findings returns "Created" response - Given operation "CreateJiraIssues" enabled - And new "CreateJiraIssues" request - And body with value {"data": [{"attributes": {"assignee_id": "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0", "description": "A description of the Jira issue.", "fields": {"key1": "value", "key2": ["value"], "key3": {"key4": "value"}}, "priority": "NOT_DEFINED", "title": "A title for the Jira issue."}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "jira_issues"}]} + Given new "CreateJiraIssues" request + And body with value {"data": [{"attributes": {"title": "A title", "description": "A description"}, "relationships": {"findings": {"data": [{"id": "eWswLWJsdC1hZm5-aS0wMjRlYTgwMzVkZTU1MGIwYQ==", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}, {"attributes": {"title": "A title", "description": "A description"}, "relationships": {"findings": {"data": [{"id": "a3ZoLXNjbS14eXV-aS0wNWY5MGYwMGE4NDg2ODdlOA==", "type": "findings"}]}, "project": {"data": {"id": "959a6f71-bac8-4027-b1d3-2264f569296f", "type": "projects"}}}, "type": "jira_issues"}]} When the request is sent Then the response status is 201 Created + And the response "data" has length 2 + And the response "data[0]" has field "id" + And the response "data[0].attributes.title" is equal to "A title" + And the response "data[0].attributes.description" is equal to "A description" + And the response "data[0].attributes.type" is equal to "SECURITY" + And the response "data[0].attributes.insights" has length 1 + And the response "data[0].attributes.insights[0].resource_id" is equal to "eWswLWJsdC1hZm5-aS0wMjRlYTgwMzVkZTU1MGIwYQ==" + And the response "data[0].attributes.insights[0].type" is equal to "SECURITY_FINDING" + And the response "data[0].attributes.jira_issue.status" is equal to "COMPLETED" + And the response "data[1]" has field "id" + And the response "data[1].attributes.title" is equal to "A title" + And the response "data[1].attributes.description" is equal to "A description" + And the response "data[1].attributes.type" is equal to "SECURITY" + And the response "data[1].attributes.insights" has length 1 + And the response "data[1].attributes.insights[0].resource_id" is equal to "a3ZoLXNjbS14eXV-aS0wNWY5MGYwMGE4NDg2ODdlOA==" + And the response "data[1].attributes.insights[0].type" is equal to "SECURITY_FINDING" + And the response "data[1].attributes.jira_issue.status" is equal to "COMPLETED" - @generated @skip @team:DataDog/k9-investigation + @team:DataDog/k9-investigation Scenario: Create Jira issues for security findings returns "Not Found" response - Given operation "CreateJiraIssues" enabled - And new "CreateJiraIssues" request - And body with value {"data": [{"attributes": {"assignee_id": "f315bdaf-9ee7-4808-a9c1-99c15bf0f4d0", "description": "A description of the Jira issue.", "fields": {"key1": "value", "key2": ["value"], "key3": {"key4": "value"}}, "priority": "NOT_DEFINED", "title": "A title for the Jira issue."}, "relationships": {"findings": {"data": [{"id": "ZGVmLTAwcC1pZXJ-aS0wZjhjNjMyZDNmMzRlZTgzNw==", "type": "findings"}]}, "project": {"data": {"id": "aeadc05e-98a8-11ec-ac2c-da7ad0900001", "type": "projects"}}}, "type": "jira_issues"}]} + Given new "CreateJiraIssues" request + And body with value {"data": [{"attributes": {}, "relationships": {"findings": {"data": [{"id": "ZGZhMDI3ZjdjMDM3YjJmNzcxNTlhZGMwMjdmZWNiNTZ-MTVlYTNmYWU3NjNlOTNlYTE2YjM4N2JmZmI4Yjk5N2Y=", "type": "findings"}]}, "project": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "projects"}}}, "type": "jira_issues"}]} When the request is sent Then the response status is 404 Not Found @@ -1164,7 +1212,7 @@ Feature: Security Monitoring And request contains "query" parameter with value "id:{{ suppression.data.id }} OR id:{{ suppression2.data.id }}" When the request is sent Then the response status is 200 OK - And the response "data[0].attributes.name" is equal to "suppression {{ unique }}" + And the response "data[0].attributes.name" is equal to "suppression {{ unique_hash }}" @team:DataDog/k9-cloud-security-platform Scenario: Get all suppression rules returns "OK" response with sort descending @@ -1175,7 +1223,7 @@ Feature: Security Monitoring And request contains "query" parameter with value "id:{{ suppression.data.id }} OR id:{{ suppression2.data.id }}" When the request is sent Then the response status is 200 OK - And the response "data[0].attributes.name" is equal to "suppression2 {{ unique }}" + And the response "data[0].attributes.name" is equal to "suppression2 {{ unique_hash }}" @skip @team:DataDog/k9-cloud-security-platform Scenario: Get critical assets affecting a specific rule returns "Not Found" response diff --git a/tests/scenarios/features/v2/static_analysis.feature b/tests/scenarios/features/v2/static_analysis.feature index 85bf4d83ae1..879e8dca94f 100644 --- a/tests/scenarios/features/v2/static_analysis.feature +++ b/tests/scenarios/features/v2/static_analysis.feature @@ -7,6 +7,159 @@ Feature: Static Analysis And a valid "appKeyAuth" key in the system And an instance of "StaticAnalysis" API + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Create Custom Rule Revision returns "Bad request" response + Given operation "CreateCustomRuleRevision" enabled + And new "CreateCustomRuleRevision" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And request contains "rule_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"arguments": [{"description": "YXJndW1lbnQgZGVzY3JpcHRpb24=", "name": "YXJndW1lbnRfbmFtZQ=="}], "category": "SECURITY", "code": "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==", "creation_message": "Initial revision", "cve": "CVE-2024-1234", "cwe": "CWE-79", "description": "bG9uZyBkZXNjcmlwdGlvbg==", "documentation_url": "https://docs.example.com/rules/my-rule", "is_published": false, "is_testing": false, "language": "PYTHON", "severity": "ERROR", "short_description": "c2hvcnQgZGVzY3JpcHRpb24=", "should_use_ai_fix": false, "tags": ["security", "custom"], "tests": [{"annotation_count": 1, "code": "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==", "filename": "test.yaml"}], "tree_sitter_query": "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ=="}, "type": "custom_rule_revision"}} + When the request is sent + Then the response status is 400 Bad request + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Create Custom Rule Revision returns "Rule not found" response + Given operation "CreateCustomRuleRevision" enabled + And new "CreateCustomRuleRevision" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And request contains "rule_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"arguments": [{"description": "YXJndW1lbnQgZGVzY3JpcHRpb24=", "name": "YXJndW1lbnRfbmFtZQ=="}], "category": "SECURITY", "code": "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==", "creation_message": "Initial revision", "cve": "CVE-2024-1234", "cwe": "CWE-79", "description": "bG9uZyBkZXNjcmlwdGlvbg==", "documentation_url": "https://docs.example.com/rules/my-rule", "is_published": false, "is_testing": false, "language": "PYTHON", "severity": "ERROR", "short_description": "c2hvcnQgZGVzY3JpcHRpb24=", "should_use_ai_fix": false, "tags": ["security", "custom"], "tests": [{"annotation_count": 1, "code": "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==", "filename": "test.yaml"}], "tree_sitter_query": "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ=="}, "type": "custom_rule_revision"}} + When the request is sent + Then the response status is 404 Rule not found + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Create Custom Rule Revision returns "Successfully created" response + Given operation "CreateCustomRuleRevision" enabled + And new "CreateCustomRuleRevision" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And request contains "rule_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"arguments": [{"description": "YXJndW1lbnQgZGVzY3JpcHRpb24=", "name": "YXJndW1lbnRfbmFtZQ=="}], "category": "SECURITY", "code": "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==", "creation_message": "Initial revision", "cve": "CVE-2024-1234", "cwe": "CWE-79", "description": "bG9uZyBkZXNjcmlwdGlvbg==", "documentation_url": "https://docs.example.com/rules/my-rule", "is_published": false, "is_testing": false, "language": "PYTHON", "severity": "ERROR", "short_description": "c2hvcnQgZGVzY3JpcHRpb24=", "should_use_ai_fix": false, "tags": ["security", "custom"], "tests": [{"annotation_count": 1, "code": "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==", "filename": "test.yaml"}], "tree_sitter_query": "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ=="}, "type": "custom_rule_revision"}} + When the request is sent + Then the response status is 200 Successfully created + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Create Custom Rule returns "Bad request" response + Given operation "CreateCustomRule" enabled + And new "CreateCustomRule" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {}, "type": "custom_rule"}} + When the request is sent + Then the response status is 400 Bad request + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Create Custom Rule returns "Conflict - rule already exists" response + Given operation "CreateCustomRule" enabled + And new "CreateCustomRule" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {}, "type": "custom_rule"}} + When the request is sent + Then the response status is 409 Conflict - rule already exists + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Create Custom Rule returns "Precondition failed - validation error or ruleset not found" response + Given operation "CreateCustomRule" enabled + And new "CreateCustomRule" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {}, "type": "custom_rule"}} + When the request is sent + Then the response status is 412 Precondition failed - validation error or ruleset not found + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Create Custom Rule returns "Successfully created" response + Given operation "CreateCustomRule" enabled + And new "CreateCustomRule" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {}, "type": "custom_rule"}} + When the request is sent + Then the response status is 200 Successfully created + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Delete Custom Rule returns "Bad request" response + Given operation "DeleteCustomRule" enabled + And new "DeleteCustomRule" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And request contains "rule_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad request + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Delete Custom Rule returns "Rule not found" response + Given operation "DeleteCustomRule" enabled + And new "DeleteCustomRule" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And request contains "rule_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Rule not found + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Delete Custom Rule returns "Successfully deleted" response + Given operation "DeleteCustomRule" enabled + And new "DeleteCustomRule" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And request contains "rule_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 Successfully deleted + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Delete Custom Ruleset returns "Bad request" response + Given operation "DeleteCustomRuleset" enabled + And new "DeleteCustomRuleset" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad request + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Delete Custom Ruleset returns "Ruleset not found" response + Given operation "DeleteCustomRuleset" enabled + And new "DeleteCustomRuleset" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Ruleset not found + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Delete Custom Ruleset returns "Successfully deleted" response + Given operation "DeleteCustomRuleset" enabled + And new "DeleteCustomRuleset" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 Successfully deleted + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: List Custom Rule Revisions returns "Bad request" response + Given operation "ListCustomRuleRevisions" enabled + And new "ListCustomRuleRevisions" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And request contains "rule_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad request + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: List Custom Rule Revisions returns "Rule not found" response + Given operation "ListCustomRuleRevisions" enabled + And new "ListCustomRuleRevisions" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And request contains "rule_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Rule not found + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: List Custom Rule Revisions returns "Successful response" response + Given operation "ListCustomRuleRevisions" enabled + And new "ListCustomRuleRevisions" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And request contains "rule_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 Successful response + + @generated @skip @team:DataDog/k9-vm-ast @with-pagination + Scenario: List Custom Rule Revisions returns "Successful response" response with pagination + Given operation "ListCustomRuleRevisions" enabled + And new "ListCustomRuleRevisions" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And request contains "rule_name" parameter from "REPLACE.ME" + When the request with pagination is sent + Then the response status is 200 Successful response + @generated @skip @team:DataDog/k9-vm-sca Scenario: POST request to resolve vulnerable symbols returns "OK" response Given operation "CreateSCAResolveVulnerableSymbols" enabled @@ -22,3 +175,131 @@ Feature: Static Analysis And body with value {"data": {"attributes": {"commit": {}, "dependencies": [{"exclusions": [], "locations": [{"block": {"end": {}, "start": {}}, "name": {"end": {}, "start": {}}, "namespace": {"end": {}, "start": {}}, "version": {"end": {}, "start": {}}}], "reachable_symbol_properties": [{}]}], "files": [{}], "relations": [{"depends_on": []}], "repository": {}, "vulnerabilities": [{"affects": [{}]}]}, "type": "scarequests"}} When the request is sent Then the response status is 200 OK + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Revert Custom Rule Revision returns "Bad request" response + Given operation "RevertCustomRuleRevision" enabled + And new "RevertCustomRuleRevision" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And request contains "rule_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {}, "type": "revert_custom_rule_revision_request"}} + When the request is sent + Then the response status is 400 Bad request + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Revert Custom Rule Revision returns "Successfully reverted" response + Given operation "RevertCustomRuleRevision" enabled + And new "RevertCustomRuleRevision" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And request contains "rule_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {}, "type": "revert_custom_rule_revision_request"}} + When the request is sent + Then the response status is 200 Successfully reverted + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Show Custom Rule Revision returns "Bad request" response + Given operation "GetCustomRuleRevision" enabled + And new "GetCustomRuleRevision" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And request contains "rule_name" parameter from "REPLACE.ME" + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad request + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Show Custom Rule Revision returns "Revision not found" response + Given operation "GetCustomRuleRevision" enabled + And new "GetCustomRuleRevision" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And request contains "rule_name" parameter from "REPLACE.ME" + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Revision not found + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Show Custom Rule Revision returns "Successful response" response + Given operation "GetCustomRuleRevision" enabled + And new "GetCustomRuleRevision" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And request contains "rule_name" parameter from "REPLACE.ME" + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 Successful response + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Show Custom Rule returns "Bad request" response + Given operation "GetCustomRule" enabled + And new "GetCustomRule" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And request contains "rule_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad request + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Show Custom Rule returns "Rule not found" response + Given operation "GetCustomRule" enabled + And new "GetCustomRule" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And request contains "rule_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Rule not found + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Show Custom Rule returns "Successful response" response + Given operation "GetCustomRule" enabled + And new "GetCustomRule" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And request contains "rule_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 Successful response + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Show Custom Ruleset returns "Bad request" response + Given operation "GetCustomRuleset" enabled + And new "GetCustomRuleset" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad request + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Show Custom Ruleset returns "Ruleset not found" response + Given operation "GetCustomRuleset" enabled + And new "GetCustomRuleset" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Ruleset not found + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Show Custom Ruleset returns "Successful response" response + Given operation "GetCustomRuleset" enabled + And new "GetCustomRuleset" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 Successful response + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Update Custom Ruleset returns "Bad request" response + Given operation "UpdateCustomRuleset" enabled + And new "UpdateCustomRuleset" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"rules": [{"created_at": "2026-01-09T13:00:57.473141Z", "created_by": "foobarbaz", "last_revision": {"attributes": {"arguments": [{"description": "YXJndW1lbnQgZGVzY3JpcHRpb24=", "name": "YXJndW1lbnRfbmFtZQ=="}], "category": "SECURITY", "checksum": "8a66c4e4e631099ad71be3c1ea3ea8fc2d57193e56db2c296e2dd8a508b26b99", "code": "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==", "created_at": "2026-01-09T13:00:57.473141Z", "created_by": "foobarbaz", "creation_message": "Initial revision", "cve": "CVE-2024-1234", "cwe": "CWE-79", "description": "bG9uZyBkZXNjcmlwdGlvbg==", "documentation_url": "https://docs.example.com/rules/my-rule", "is_published": false, "is_testing": false, "language": "PYTHON", "severity": "ERROR", "short_description": "c2hvcnQgZGVzY3JpcHRpb24=", "should_use_ai_fix": false, "tags": ["security", "custom"], "tests": [{"annotation_count": 1, "code": "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==", "filename": "test.yaml"}], "tree_sitter_query": "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ=="}, "id": "revision-123", "type": "custom_rule_revision"}, "name": "my-rule"}]}, "type": "custom_ruleset"}} + When the request is sent + Then the response status is 400 Bad request + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Update Custom Ruleset returns "Precondition failed - validation error or ruleset not found" response + Given operation "UpdateCustomRuleset" enabled + And new "UpdateCustomRuleset" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"rules": [{"created_at": "2026-01-09T13:00:57.473141Z", "created_by": "foobarbaz", "last_revision": {"attributes": {"arguments": [{"description": "YXJndW1lbnQgZGVzY3JpcHRpb24=", "name": "YXJndW1lbnRfbmFtZQ=="}], "category": "SECURITY", "checksum": "8a66c4e4e631099ad71be3c1ea3ea8fc2d57193e56db2c296e2dd8a508b26b99", "code": "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==", "created_at": "2026-01-09T13:00:57.473141Z", "created_by": "foobarbaz", "creation_message": "Initial revision", "cve": "CVE-2024-1234", "cwe": "CWE-79", "description": "bG9uZyBkZXNjcmlwdGlvbg==", "documentation_url": "https://docs.example.com/rules/my-rule", "is_published": false, "is_testing": false, "language": "PYTHON", "severity": "ERROR", "short_description": "c2hvcnQgZGVzY3JpcHRpb24=", "should_use_ai_fix": false, "tags": ["security", "custom"], "tests": [{"annotation_count": 1, "code": "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==", "filename": "test.yaml"}], "tree_sitter_query": "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ=="}, "id": "revision-123", "type": "custom_rule_revision"}, "name": "my-rule"}]}, "type": "custom_ruleset"}} + When the request is sent + Then the response status is 412 Precondition failed - validation error or ruleset not found + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Update Custom Ruleset returns "Successfully updated" response + Given operation "UpdateCustomRuleset" enabled + And new "UpdateCustomRuleset" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"rules": [{"created_at": "2026-01-09T13:00:57.473141Z", "created_by": "foobarbaz", "last_revision": {"attributes": {"arguments": [{"description": "YXJndW1lbnQgZGVzY3JpcHRpb24=", "name": "YXJndW1lbnRfbmFtZQ=="}], "category": "SECURITY", "checksum": "8a66c4e4e631099ad71be3c1ea3ea8fc2d57193e56db2c296e2dd8a508b26b99", "code": "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==", "created_at": "2026-01-09T13:00:57.473141Z", "created_by": "foobarbaz", "creation_message": "Initial revision", "cve": "CVE-2024-1234", "cwe": "CWE-79", "description": "bG9uZyBkZXNjcmlwdGlvbg==", "documentation_url": "https://docs.example.com/rules/my-rule", "is_published": false, "is_testing": false, "language": "PYTHON", "severity": "ERROR", "short_description": "c2hvcnQgZGVzY3JpcHRpb24=", "should_use_ai_fix": false, "tags": ["security", "custom"], "tests": [{"annotation_count": 1, "code": "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==", "filename": "test.yaml"}], "tree_sitter_query": "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ=="}, "id": "revision-123", "type": "custom_rule_revision"}, "name": "my-rule"}]}, "type": "custom_ruleset"}} + When the request is sent + Then the response status is 200 Successfully updated diff --git a/tests/scenarios/features/v2/status_pages.feature b/tests/scenarios/features/v2/status_pages.feature index 1646a25db96..35d80dd2fed 100644 --- a/tests/scenarios/features/v2/status_pages.feature +++ b/tests/scenarios/features/v2/status_pages.feature @@ -33,7 +33,7 @@ Feature: Status Pages @team:DataDog/incident-app Scenario: Create status page returns "Created" response Given new "CreateStatusPage" request - And body with value {"data": {"attributes": {"name": "A Status Page", "domain_prefix": "status-page-{{ unique_hash }}", "components":[{"name": "Login", "type": "component", "position": 0},{"name": "Settings", "type": "component", "position": 1}], "enabled": true, "type": "internal", "visualization_type": "bars_and_uptime_percentage"}, "type": "status_pages"}} + And body with value {"data": {"attributes": {"name": "A Status Page", "domain_prefix": "{{ unique_hash }}", "components":[{"name": "Login", "type": "component", "position": 0},{"name": "Settings", "type": "component", "position": 1}], "enabled": true, "type": "internal", "visualization_type": "bars_and_uptime_percentage"}, "type": "status_pages"}} When the request is sent Then the response status is 201 Created diff --git a/tests/scenarios/features/v2/undo.json b/tests/scenarios/features/v2/undo.json index 7db8ef9f2af..7619933d2f8 100644 --- a/tests/scenarios/features/v2/undo.json +++ b/tests/scenarios/features/v2/undo.json @@ -4658,6 +4658,68 @@ "type": "safe" } }, + "DeleteCustomRuleset": { + "tag": "Static Analysis", + "undo": { + "type": "idempotent" + } + }, + "GetCustomRuleset": { + "tag": "Static Analysis", + "undo": { + "type": "safe" + } + }, + "UpdateCustomRuleset": { + "tag": "Static Analysis", + "undo": { + "type": "idempotent" + } + }, + "CreateCustomRule": { + "tag": "Static Analysis", + "undo": { + "type": "idempotent" + } + }, + "DeleteCustomRule": { + "tag": "Static Analysis", + "undo": { + "type": "idempotent" + } + }, + "GetCustomRule": { + "tag": "Static Analysis", + "undo": { + "type": "safe" + } + }, + "ListCustomRuleRevisions": { + "tag": "Static Analysis", + "undo": { + "type": "safe" + } + }, + "CreateCustomRuleRevision": { + "tag": "Static Analysis", + "undo": { + "type": "idempotent" + } + }, + "RevertCustomRuleRevision": { + "tag": "Static Analysis", + "undo": { + "operationId": "TODO", + "parameters": [], + "type": "unsafe" + } + }, + "GetCustomRuleRevision": { + "tag": "Static Analysis", + "undo": { + "type": "safe" + } + }, "ListMultipleRulesets": { "tag": "Security Monitoring", "undo": { diff --git a/tests/scenarios/scenarios.go b/tests/scenarios/scenarios.go index 8a9c9fe7464..0975b8c3026 100644 --- a/tests/scenarios/scenarios.go +++ b/tests/scenarios/scenarios.go @@ -83,6 +83,7 @@ type jsonResponseKey struct{} type dataKey struct{} type cleanupKey struct{} type pathParamCountKey struct{} +type pathParametersKey struct{} // GetIgnoredTags returns list of ignored tags. func GetIgnoredTags() []string { @@ -326,6 +327,29 @@ func SetData(ctx gobdd.Context, value map[string]interface{}) { ctx.Set(dataKey{}, value) } +// GetPathParameters returns stored path parameters by name. +func GetPathParameters(ctx gobdd.Context) map[string]interface{} { + c, err := ctx.Get(pathParametersKey{}) + if err != nil { + params := make(map[string]interface{}) + ctx.Set(pathParametersKey{}, params) + return params + } + return c.(map[string]interface{}) +} + +// SetPathParameter stores a path parameter. +func SetPathParameter(ctx gobdd.Context, name string, value interface{}) { + params := GetPathParameters(ctx) + params[name] = value + ctx.Set(pathParametersKey{}, params) +} + +// ClearPathParameters clears stored path parameters. +func ClearPathParameters(ctx gobdd.Context) { + ctx.Set(pathParametersKey{}, make(map[string]interface{})) +} + // GetRequestParameters helps to build a request. func GetRequestParameters(ctx gobdd.Context) map[string]interface{} { c, err := ctx.Get(requestParamsKey{}) diff --git a/tests/scenarios/step_definitions.go b/tests/scenarios/step_definitions.go index bf55c1d361e..44d4cfe7167 100644 --- a/tests/scenarios/step_definitions.go +++ b/tests/scenarios/step_definitions.go @@ -89,6 +89,7 @@ func newRequest(t gobdd.StepTest, ctx gobdd.Context, name string) { ctx.Set(requestParamsKey{}, make(map[string]interface{})) ctx.Set(requestArgsKey{}, make([]interface{}, 0)) ctx.Set(pathParamCountKey{}, 1) + ClearPathParameters(ctx) } func statusIs(t gobdd.StepTest, ctx gobdd.Context, expected int, text string) { @@ -141,9 +142,13 @@ func addParameterFrom(t gobdd.StepTest, ctx gobdd.Context, name string, path str datadog.Unmarshal(data, varType.Interface()) GetRequestParameters(ctx)[name] = varType.Elem() ctx.Set(requestArgsKey{}, append(GetRequestArguments(ctx), varType.Elem())) + // Store path parameter for undo operations + SetPathParameter(ctx, name, varType.Elem().Interface()) } else { GetRequestParameters(ctx)[name] = value ctx.Set(requestArgsKey{}, append(GetRequestArguments(ctx), value)) + // Store path parameter for undo operations + SetPathParameter(ctx, name, value.Interface()) } } @@ -159,6 +164,10 @@ func addPathArgumentWithValue(t gobdd.StepTest, ctx gobdd.Context, param string, ctx.Set(pathParamCountKey{}, pathCount.(int)+1) templatedValue := Templated(t, GetData(ctx), value) + + // Store path parameter by name for undo operations + SetPathParameter(ctx, param, templatedValue) + var varType reflect.Value if request.Type().IsVariadic() && pathCount.(int) > numArgs-2 {