diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml
index e6df2f158a6..b7341779fb6 100644
--- a/.generator/schemas/v2/openapi.yaml
+++ b/.generator/schemas/v2/openapi.yaml
@@ -5057,6 +5057,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:
@@ -15872,6 +15886,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.
@@ -30051,6 +30541,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:
@@ -45473,6 +45991,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:
@@ -87967,6 +88516,510 @@ 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: ShowCustomRuleset
+ 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: ShowCustomRule
+ 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-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: ShowCustomRuleRevision
+ 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/examples/v2/static-analysis/CreateCustomRule.java b/examples/v2/static-analysis/CreateCustomRule.java
new file mode 100644
index 00000000000..2b0d1be34d2
--- /dev/null
+++ b/examples/v2/static-analysis/CreateCustomRule.java
@@ -0,0 +1,36 @@
+// Create Custom Rule returns "Successfully created" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.StaticAnalysisApi;
+import com.datadog.api.client.v2.model.CustomRuleDataType;
+import com.datadog.api.client.v2.model.CustomRuleRequest;
+import com.datadog.api.client.v2.model.CustomRuleRequestData;
+import com.datadog.api.client.v2.model.CustomRuleRequestDataAttributes;
+import com.datadog.api.client.v2.model.CustomRuleResponse;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.createCustomRule", true);
+ StaticAnalysisApi apiInstance = new StaticAnalysisApi(defaultClient);
+
+ CustomRuleRequest body =
+ new CustomRuleRequest()
+ .data(
+ new CustomRuleRequestData()
+ .attributes(new CustomRuleRequestDataAttributes())
+ .type(CustomRuleDataType.CUSTOM_RULE));
+
+ try {
+ CustomRuleResponse result = apiInstance.createCustomRule("ruleset_name", body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling StaticAnalysisApi#createCustomRule");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/static-analysis/CreateCustomRuleRevision.java b/examples/v2/static-analysis/CreateCustomRuleRevision.java
new file mode 100644
index 00000000000..158d1b18374
--- /dev/null
+++ b/examples/v2/static-analysis/CreateCustomRuleRevision.java
@@ -0,0 +1,68 @@
+// Create Custom Rule Revision returns "Successfully created" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.StaticAnalysisApi;
+import com.datadog.api.client.v2.model.Argument;
+import com.datadog.api.client.v2.model.CustomRuleRevisionAttributesCategory;
+import com.datadog.api.client.v2.model.CustomRuleRevisionAttributesSeverity;
+import com.datadog.api.client.v2.model.CustomRuleRevisionDataType;
+import com.datadog.api.client.v2.model.CustomRuleRevisionInputAttributes;
+import com.datadog.api.client.v2.model.CustomRuleRevisionRequest;
+import com.datadog.api.client.v2.model.CustomRuleRevisionRequestData;
+import com.datadog.api.client.v2.model.CustomRuleRevisionTest;
+import com.datadog.api.client.v2.model.Language;
+import java.util.Arrays;
+import java.util.Collections;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.createCustomRuleRevision", true);
+ StaticAnalysisApi apiInstance = new StaticAnalysisApi(defaultClient);
+
+ CustomRuleRevisionRequest body =
+ new CustomRuleRevisionRequest()
+ .data(
+ new CustomRuleRevisionRequestData()
+ .attributes(
+ new CustomRuleRevisionInputAttributes()
+ .arguments(
+ Collections.singletonList(
+ new Argument()
+ .description("YXJndW1lbnQgZGVzY3JpcHRpb24=")
+ .name("YXJndW1lbnRfbmFtZQ==")))
+ .category(CustomRuleRevisionAttributesCategory.SECURITY)
+ .code("Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==")
+ .creationMessage("Initial revision")
+ .cve("CVE-2024-1234")
+ .cwe("CWE-79")
+ .description("bG9uZyBkZXNjcmlwdGlvbg==")
+ .documentationUrl("https://docs.example.com/rules/my-rule")
+ .isPublished(false)
+ .isTesting(false)
+ .language(Language.PYTHON)
+ .severity(CustomRuleRevisionAttributesSeverity.ERROR)
+ .shortDescription("c2hvcnQgZGVzY3JpcHRpb24=")
+ .shouldUseAiFix(false)
+ .tags(Arrays.asList("security", "custom"))
+ .tests(
+ Collections.singletonList(
+ new CustomRuleRevisionTest()
+ .annotationCount(1L)
+ .code("Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==")
+ .filename("test.yaml")))
+ .treeSitterQuery("Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ=="))
+ .type(CustomRuleRevisionDataType.CUSTOM_RULE_REVISION));
+
+ try {
+ apiInstance.createCustomRuleRevision("ruleset_name", "rule_name", body);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling StaticAnalysisApi#createCustomRuleRevision");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/static-analysis/DeleteCustomRule.java b/examples/v2/static-analysis/DeleteCustomRule.java
new file mode 100644
index 00000000000..b1db1dc6a83
--- /dev/null
+++ b/examples/v2/static-analysis/DeleteCustomRule.java
@@ -0,0 +1,23 @@
+// Delete Custom Rule returns "Successfully deleted" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.StaticAnalysisApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.deleteCustomRule", true);
+ StaticAnalysisApi apiInstance = new StaticAnalysisApi(defaultClient);
+
+ try {
+ apiInstance.deleteCustomRule("ruleset_name", "rule_name");
+ } catch (ApiException e) {
+ System.err.println("Exception when calling StaticAnalysisApi#deleteCustomRule");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/static-analysis/DeleteCustomRuleset.java b/examples/v2/static-analysis/DeleteCustomRuleset.java
new file mode 100644
index 00000000000..92a8d39e959
--- /dev/null
+++ b/examples/v2/static-analysis/DeleteCustomRuleset.java
@@ -0,0 +1,23 @@
+// Delete Custom Ruleset returns "Successfully deleted" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.StaticAnalysisApi;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.deleteCustomRuleset", true);
+ StaticAnalysisApi apiInstance = new StaticAnalysisApi(defaultClient);
+
+ try {
+ apiInstance.deleteCustomRuleset("ruleset_name");
+ } catch (ApiException e) {
+ System.err.println("Exception when calling StaticAnalysisApi#deleteCustomRuleset");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/static-analysis/ListCustomRuleRevisions.java b/examples/v2/static-analysis/ListCustomRuleRevisions.java
new file mode 100644
index 00000000000..4e1fc532b68
--- /dev/null
+++ b/examples/v2/static-analysis/ListCustomRuleRevisions.java
@@ -0,0 +1,26 @@
+// List Custom Rule Revisions returns "Successful response" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.StaticAnalysisApi;
+import com.datadog.api.client.v2.model.CustomRuleRevisionsResponse;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.listCustomRuleRevisions", true);
+ StaticAnalysisApi apiInstance = new StaticAnalysisApi(defaultClient);
+
+ try {
+ CustomRuleRevisionsResponse result =
+ apiInstance.listCustomRuleRevisions("ruleset_name", "rule_name");
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling StaticAnalysisApi#listCustomRuleRevisions");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/static-analysis/RevertCustomRuleRevision.java b/examples/v2/static-analysis/RevertCustomRuleRevision.java
new file mode 100644
index 00000000000..d61f4edf805
--- /dev/null
+++ b/examples/v2/static-analysis/RevertCustomRuleRevision.java
@@ -0,0 +1,34 @@
+// Revert Custom Rule Revision returns "Successfully reverted" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.StaticAnalysisApi;
+import com.datadog.api.client.v2.model.RevertCustomRuleRevisionDataType;
+import com.datadog.api.client.v2.model.RevertCustomRuleRevisionRequest;
+import com.datadog.api.client.v2.model.RevertCustomRuleRevisionRequestData;
+import com.datadog.api.client.v2.model.RevertCustomRuleRevisionRequestDataAttributes;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.revertCustomRuleRevision", true);
+ StaticAnalysisApi apiInstance = new StaticAnalysisApi(defaultClient);
+
+ RevertCustomRuleRevisionRequest body =
+ new RevertCustomRuleRevisionRequest()
+ .data(
+ new RevertCustomRuleRevisionRequestData()
+ .attributes(new RevertCustomRuleRevisionRequestDataAttributes())
+ .type(RevertCustomRuleRevisionDataType.REVERT_CUSTOM_RULE_REVISION_REQUEST));
+
+ try {
+ apiInstance.revertCustomRuleRevision("ruleset_name", "rule_name", body);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling StaticAnalysisApi#revertCustomRuleRevision");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/static-analysis/ShowCustomRule.java b/examples/v2/static-analysis/ShowCustomRule.java
new file mode 100644
index 00000000000..ec353a092d2
--- /dev/null
+++ b/examples/v2/static-analysis/ShowCustomRule.java
@@ -0,0 +1,25 @@
+// Show Custom Rule returns "Successful response" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.StaticAnalysisApi;
+import com.datadog.api.client.v2.model.CustomRuleResponse;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.showCustomRule", true);
+ StaticAnalysisApi apiInstance = new StaticAnalysisApi(defaultClient);
+
+ try {
+ CustomRuleResponse result = apiInstance.showCustomRule("ruleset_name", "rule_name");
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling StaticAnalysisApi#showCustomRule");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/static-analysis/ShowCustomRuleRevision.java b/examples/v2/static-analysis/ShowCustomRuleRevision.java
new file mode 100644
index 00000000000..1401452e02b
--- /dev/null
+++ b/examples/v2/static-analysis/ShowCustomRuleRevision.java
@@ -0,0 +1,26 @@
+// Show Custom Rule Revision returns "Successful response" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.StaticAnalysisApi;
+import com.datadog.api.client.v2.model.CustomRuleRevisionResponse;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.showCustomRuleRevision", true);
+ StaticAnalysisApi apiInstance = new StaticAnalysisApi(defaultClient);
+
+ try {
+ CustomRuleRevisionResponse result =
+ apiInstance.showCustomRuleRevision("ruleset_name", "rule_name", "id");
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling StaticAnalysisApi#showCustomRuleRevision");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/static-analysis/ShowCustomRuleset.java b/examples/v2/static-analysis/ShowCustomRuleset.java
new file mode 100644
index 00000000000..b897c301951
--- /dev/null
+++ b/examples/v2/static-analysis/ShowCustomRuleset.java
@@ -0,0 +1,25 @@
+// Show Custom Ruleset returns "Successful response" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.StaticAnalysisApi;
+import com.datadog.api.client.v2.model.CustomRulesetResponse;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.showCustomRuleset", true);
+ StaticAnalysisApi apiInstance = new StaticAnalysisApi(defaultClient);
+
+ try {
+ CustomRulesetResponse result = apiInstance.showCustomRuleset("ruleset_name");
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling StaticAnalysisApi#showCustomRuleset");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/examples/v2/static-analysis/UpdateCustomRuleset.java b/examples/v2/static-analysis/UpdateCustomRuleset.java
new file mode 100644
index 00000000000..a7274fa946b
--- /dev/null
+++ b/examples/v2/static-analysis/UpdateCustomRuleset.java
@@ -0,0 +1,106 @@
+// Update Custom Ruleset returns "Successfully updated" response
+
+import com.datadog.api.client.ApiClient;
+import com.datadog.api.client.ApiException;
+import com.datadog.api.client.v2.api.StaticAnalysisApi;
+import com.datadog.api.client.v2.model.Argument;
+import com.datadog.api.client.v2.model.CustomRule;
+import com.datadog.api.client.v2.model.CustomRuleRevision;
+import com.datadog.api.client.v2.model.CustomRuleRevisionAttributes;
+import com.datadog.api.client.v2.model.CustomRuleRevisionAttributesCategory;
+import com.datadog.api.client.v2.model.CustomRuleRevisionAttributesSeverity;
+import com.datadog.api.client.v2.model.CustomRuleRevisionDataType;
+import com.datadog.api.client.v2.model.CustomRuleRevisionTest;
+import com.datadog.api.client.v2.model.CustomRulesetDataType;
+import com.datadog.api.client.v2.model.CustomRulesetRequest;
+import com.datadog.api.client.v2.model.CustomRulesetRequestData;
+import com.datadog.api.client.v2.model.CustomRulesetRequestDataAttributes;
+import com.datadog.api.client.v2.model.CustomRulesetResponse;
+import com.datadog.api.client.v2.model.Language;
+import java.time.OffsetDateTime;
+import java.util.Arrays;
+import java.util.Collections;
+
+public class Example {
+ public static void main(String[] args) {
+ ApiClient defaultClient = ApiClient.getDefaultApiClient();
+ defaultClient.setUnstableOperationEnabled("v2.updateCustomRuleset", true);
+ StaticAnalysisApi apiInstance = new StaticAnalysisApi(defaultClient);
+
+ CustomRulesetRequest body =
+ new CustomRulesetRequest()
+ .data(
+ new CustomRulesetRequestData()
+ .attributes(
+ new CustomRulesetRequestDataAttributes()
+ .rules(
+ Collections.singletonList(
+ new CustomRule()
+ .createdAt(
+ OffsetDateTime.parse("2026-01-09T13:00:57.473141Z"))
+ .createdBy("foobarbaz")
+ .lastRevision(
+ new CustomRuleRevision()
+ .attributes(
+ new CustomRuleRevisionAttributes()
+ .arguments(
+ Collections.singletonList(
+ new Argument()
+ .description(
+ "YXJndW1lbnQgZGVzY3JpcHRpb24=")
+ .name("YXJndW1lbnRfbmFtZQ==")))
+ .category(
+ CustomRuleRevisionAttributesCategory
+ .SECURITY)
+ .checksum(
+ "8a66c4e4e631099ad71be3c1ea3ea8fc2d57193e56db2c296e2dd8a508b26b99")
+ .code(
+ "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==")
+ .createdAt(
+ OffsetDateTime.parse(
+ "2026-01-09T13:00:57.473141Z"))
+ .createdBy("foobarbaz")
+ .creationMessage("Initial revision")
+ .cve("CVE-2024-1234")
+ .cwe("CWE-79")
+ .description("bG9uZyBkZXNjcmlwdGlvbg==")
+ .documentationUrl(
+ "https://docs.example.com/rules/my-rule")
+ .isPublished(false)
+ .isTesting(false)
+ .language(Language.PYTHON)
+ .severity(
+ CustomRuleRevisionAttributesSeverity
+ .ERROR)
+ .shortDescription(
+ "c2hvcnQgZGVzY3JpcHRpb24=")
+ .shouldUseAiFix(false)
+ .tags(Arrays.asList("security", "custom"))
+ .tests(
+ Collections.singletonList(
+ new CustomRuleRevisionTest()
+ .annotationCount(1L)
+ .code(
+ "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==")
+ .filename("test.yaml")))
+ .treeSitterQuery(
+ "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ=="))
+ .id("revision-123")
+ .type(
+ CustomRuleRevisionDataType
+ .CUSTOM_RULE_REVISION))
+ .name("my-rule"))))
+ .type(CustomRulesetDataType.CUSTOM_RULESET));
+
+ try {
+ CustomRulesetResponse result = apiInstance.updateCustomRuleset("ruleset_name", body);
+ System.out.println(result);
+ } catch (ApiException e) {
+ System.err.println("Exception when calling StaticAnalysisApi#updateCustomRuleset");
+ System.err.println("Status code: " + e.getCode());
+ System.err.println("Reason: " + e.getResponseBody());
+ System.err.println("Response headers: " + e.getResponseHeaders());
+ e.printStackTrace();
+ }
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java
index 013c656b24d..89d5ebc545f 100644
--- a/src/main/java/com/datadog/api/client/ApiClient.java
+++ b/src/main/java/com/datadog/api/client/ApiClient.java
@@ -902,8 +902,18 @@ public class ApiClient {
put("v2.getSLOReportJobStatus", false);
put("v2.getSPARecommendations", false);
put("v2.getSPARecommendationsWithShard", false);
+ put("v2.createCustomRule", false);
+ put("v2.createCustomRuleRevision", false);
put("v2.createSCAResolveVulnerableSymbols", false);
put("v2.createSCAResult", false);
+ put("v2.deleteCustomRule", false);
+ put("v2.deleteCustomRuleset", false);
+ put("v2.listCustomRuleRevisions", false);
+ put("v2.revertCustomRuleRevision", false);
+ put("v2.showCustomRule", false);
+ put("v2.showCustomRuleRevision", false);
+ put("v2.showCustomRuleset", false);
+ put("v2.updateCustomRuleset", false);
put("v2.addMemberTeam", false);
put("v2.listMemberTeams", false);
put("v2.removeMemberTeam", false);
diff --git a/src/main/java/com/datadog/api/client/v2/api/StaticAnalysisApi.java b/src/main/java/com/datadog/api/client/v2/api/StaticAnalysisApi.java
index aab0103c376..a40613d4d03 100644
--- a/src/main/java/com/datadog/api/client/v2/api/StaticAnalysisApi.java
+++ b/src/main/java/com/datadog/api/client/v2/api/StaticAnalysisApi.java
@@ -4,13 +4,22 @@
import com.datadog.api.client.ApiException;
import com.datadog.api.client.ApiResponse;
import com.datadog.api.client.Pair;
+import com.datadog.api.client.v2.model.CustomRuleRequest;
+import com.datadog.api.client.v2.model.CustomRuleResponse;
+import com.datadog.api.client.v2.model.CustomRuleRevisionRequest;
+import com.datadog.api.client.v2.model.CustomRuleRevisionResponse;
+import com.datadog.api.client.v2.model.CustomRuleRevisionsResponse;
+import com.datadog.api.client.v2.model.CustomRulesetRequest;
+import com.datadog.api.client.v2.model.CustomRulesetResponse;
import com.datadog.api.client.v2.model.ResolveVulnerableSymbolsRequest;
import com.datadog.api.client.v2.model.ResolveVulnerableSymbolsResponse;
+import com.datadog.api.client.v2.model.RevertCustomRuleRevisionRequest;
import com.datadog.api.client.v2.model.ScaRequest;
import jakarta.ws.rs.client.Invocation;
import jakarta.ws.rs.core.GenericType;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
@@ -45,6 +54,383 @@ public void setApiClient(ApiClient apiClient) {
this.apiClient = apiClient;
}
+ /**
+ * Create Custom Rule.
+ *
+ *
See {@link #createCustomRuleWithHttpInfo}.
+ *
+ * @param rulesetName The ruleset name (required)
+ * @param body (required)
+ * @return CustomRuleResponse
+ * @throws ApiException if fails to make API call
+ */
+ public CustomRuleResponse createCustomRule(String rulesetName, CustomRuleRequest body)
+ throws ApiException {
+ return createCustomRuleWithHttpInfo(rulesetName, body).getData();
+ }
+
+ /**
+ * Create Custom Rule.
+ *
+ *
See {@link #createCustomRuleWithHttpInfoAsync}.
+ *
+ * @param rulesetName The ruleset name (required)
+ * @param body (required)
+ * @return CompletableFuture<CustomRuleResponse>
+ */
+ public CompletableFuture createCustomRuleAsync(
+ String rulesetName, CustomRuleRequest body) {
+ return createCustomRuleWithHttpInfoAsync(rulesetName, body)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Create a new custom rule within a ruleset
+ *
+ * @param rulesetName The ruleset name (required)
+ * @param body (required)
+ * @return ApiResponse<CustomRuleResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | Successfully created | - |
+ * | 400 | Bad request | - |
+ * | 401 | Unauthorized - custom rules not enabled | - |
+ * | 409 | Conflict - rule already exists | - |
+ * | 412 | Precondition failed - validation error or ruleset not found | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse createCustomRuleWithHttpInfo(
+ String rulesetName, CustomRuleRequest body) throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "createCustomRule";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'rulesetName' is set
+ if (rulesetName == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'rulesetName' when calling createCustomRule");
+ }
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'body' when calling createCustomRule");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules"
+ .replaceAll(
+ "\\{" + "ruleset_name" + "\\}", apiClient.escapeString(rulesetName.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.StaticAnalysisApi.createCustomRule",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ return apiClient.invokeAPI(
+ "PUT",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Create Custom Rule.
+ *
+ * See {@link #createCustomRuleWithHttpInfo}.
+ *
+ * @param rulesetName The ruleset name (required)
+ * @param body (required)
+ * @return CompletableFuture<ApiResponse<CustomRuleResponse>>
+ */
+ public CompletableFuture> createCustomRuleWithHttpInfoAsync(
+ String rulesetName, CustomRuleRequest body) {
+ // Check if unstable operation is enabled
+ String operationId = "createCustomRule";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'rulesetName' is set
+ if (rulesetName == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400, "Missing the required parameter 'rulesetName' when calling createCustomRule"));
+ return result;
+ }
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400, "Missing the required parameter 'body' when calling createCustomRule"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules"
+ .replaceAll(
+ "\\{" + "ruleset_name" + "\\}", apiClient.escapeString(rulesetName.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.StaticAnalysisApi.createCustomRule",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "PUT",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Create Custom Rule Revision.
+ *
+ * See {@link #createCustomRuleRevisionWithHttpInfo}.
+ *
+ * @param rulesetName The ruleset name (required)
+ * @param ruleName The rule name (required)
+ * @param body (required)
+ * @throws ApiException if fails to make API call
+ */
+ public void createCustomRuleRevision(
+ String rulesetName, String ruleName, CustomRuleRevisionRequest body) throws ApiException {
+ createCustomRuleRevisionWithHttpInfo(rulesetName, ruleName, body);
+ }
+
+ /**
+ * Create Custom Rule Revision.
+ *
+ *
See {@link #createCustomRuleRevisionWithHttpInfoAsync}.
+ *
+ * @param rulesetName The ruleset name (required)
+ * @param ruleName The rule name (required)
+ * @param body (required)
+ * @return CompletableFuture
+ */
+ public CompletableFuture createCustomRuleRevisionAsync(
+ String rulesetName, String ruleName, CustomRuleRevisionRequest body) {
+ return createCustomRuleRevisionWithHttpInfoAsync(rulesetName, ruleName, body)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Create a new revision for a custom rule
+ *
+ * @param rulesetName The ruleset name (required)
+ * @param ruleName The rule name (required)
+ * @param body (required)
+ * @return ApiResponse<Void>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | Successfully created | - |
+ * | 400 | Bad request | - |
+ * | 401 | Unauthorized - custom rules not enabled | - |
+ * | 404 | Rule not found | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse createCustomRuleRevisionWithHttpInfo(
+ String rulesetName, String ruleName, CustomRuleRevisionRequest body) throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "createCustomRuleRevision";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'rulesetName' is set
+ if (rulesetName == null) {
+ throw new ApiException(
+ 400,
+ "Missing the required parameter 'rulesetName' when calling createCustomRuleRevision");
+ }
+
+ // verify the required parameter 'ruleName' is set
+ if (ruleName == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'ruleName' when calling createCustomRuleRevision");
+ }
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'body' when calling createCustomRuleRevision");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}/revisions"
+ .replaceAll(
+ "\\{" + "ruleset_name" + "\\}", apiClient.escapeString(rulesetName.toString()))
+ .replaceAll("\\{" + "rule_name" + "\\}", apiClient.escapeString(ruleName.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.StaticAnalysisApi.createCustomRuleRevision",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"*/*"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ return apiClient.invokeAPI(
+ "PUT",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ null);
+ }
+
+ /**
+ * Create Custom Rule Revision.
+ *
+ * See {@link #createCustomRuleRevisionWithHttpInfo}.
+ *
+ * @param rulesetName The ruleset name (required)
+ * @param ruleName The rule name (required)
+ * @param body (required)
+ * @return CompletableFuture<ApiResponse<Void>>
+ */
+ public CompletableFuture> createCustomRuleRevisionWithHttpInfoAsync(
+ String rulesetName, String ruleName, CustomRuleRevisionRequest body) {
+ // Check if unstable operation is enabled
+ String operationId = "createCustomRuleRevision";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'rulesetName' is set
+ if (rulesetName == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'rulesetName' when calling"
+ + " createCustomRuleRevision"));
+ return result;
+ }
+
+ // verify the required parameter 'ruleName' is set
+ if (ruleName == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'ruleName' when calling createCustomRuleRevision"));
+ return result;
+ }
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400, "Missing the required parameter 'body' when calling createCustomRuleRevision"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}/revisions"
+ .replaceAll(
+ "\\{" + "ruleset_name" + "\\}", apiClient.escapeString(rulesetName.toString()))
+ .replaceAll("\\{" + "rule_name" + "\\}", apiClient.escapeString(ruleName.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.StaticAnalysisApi.createCustomRuleRevision",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"*/*"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "PUT",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ null);
+ }
+
/**
* POST request to resolve vulnerable symbols.
*
@@ -338,4 +724,1514 @@ public CompletableFuture> createSCAResultWithHttpInfoAsync(Sca
false,
null);
}
+
+ /**
+ * Delete Custom Rule.
+ *
+ * See {@link #deleteCustomRuleWithHttpInfo}.
+ *
+ * @param rulesetName The ruleset name (required)
+ * @param ruleName The rule name (required)
+ * @throws ApiException if fails to make API call
+ */
+ public void deleteCustomRule(String rulesetName, String ruleName) throws ApiException {
+ deleteCustomRuleWithHttpInfo(rulesetName, ruleName);
+ }
+
+ /**
+ * Delete Custom Rule.
+ *
+ *
See {@link #deleteCustomRuleWithHttpInfoAsync}.
+ *
+ * @param rulesetName The ruleset name (required)
+ * @param ruleName The rule name (required)
+ * @return CompletableFuture
+ */
+ public CompletableFuture deleteCustomRuleAsync(String rulesetName, String ruleName) {
+ return deleteCustomRuleWithHttpInfoAsync(rulesetName, ruleName)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Delete a custom rule
+ *
+ * @param rulesetName The ruleset name (required)
+ * @param ruleName The rule name (required)
+ * @return ApiResponse<Void>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | Successfully deleted | - |
+ * | 400 | Bad request | - |
+ * | 401 | Unauthorized - custom rules not enabled | - |
+ * | 404 | Rule not found | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse deleteCustomRuleWithHttpInfo(String rulesetName, String ruleName)
+ throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "deleteCustomRule";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'rulesetName' is set
+ if (rulesetName == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'rulesetName' when calling deleteCustomRule");
+ }
+
+ // verify the required parameter 'ruleName' is set
+ if (ruleName == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'ruleName' when calling deleteCustomRule");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}"
+ .replaceAll(
+ "\\{" + "ruleset_name" + "\\}", apiClient.escapeString(rulesetName.toString()))
+ .replaceAll("\\{" + "rule_name" + "\\}", apiClient.escapeString(ruleName.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.StaticAnalysisApi.deleteCustomRule",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"*/*"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ return apiClient.invokeAPI(
+ "DELETE",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ null);
+ }
+
+ /**
+ * Delete Custom Rule.
+ *
+ * See {@link #deleteCustomRuleWithHttpInfo}.
+ *
+ * @param rulesetName The ruleset name (required)
+ * @param ruleName The rule name (required)
+ * @return CompletableFuture<ApiResponse<Void>>
+ */
+ public CompletableFuture> deleteCustomRuleWithHttpInfoAsync(
+ String rulesetName, String ruleName) {
+ // Check if unstable operation is enabled
+ String operationId = "deleteCustomRule";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'rulesetName' is set
+ if (rulesetName == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400, "Missing the required parameter 'rulesetName' when calling deleteCustomRule"));
+ return result;
+ }
+
+ // verify the required parameter 'ruleName' is set
+ if (ruleName == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400, "Missing the required parameter 'ruleName' when calling deleteCustomRule"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}"
+ .replaceAll(
+ "\\{" + "ruleset_name" + "\\}", apiClient.escapeString(rulesetName.toString()))
+ .replaceAll("\\{" + "rule_name" + "\\}", apiClient.escapeString(ruleName.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.StaticAnalysisApi.deleteCustomRule",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"*/*"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "DELETE",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ null);
+ }
+
+ /**
+ * Delete Custom Ruleset.
+ *
+ * See {@link #deleteCustomRulesetWithHttpInfo}.
+ *
+ * @param rulesetName The ruleset name (required)
+ * @throws ApiException if fails to make API call
+ */
+ public void deleteCustomRuleset(String rulesetName) throws ApiException {
+ deleteCustomRulesetWithHttpInfo(rulesetName);
+ }
+
+ /**
+ * Delete Custom Ruleset.
+ *
+ *
See {@link #deleteCustomRulesetWithHttpInfoAsync}.
+ *
+ * @param rulesetName The ruleset name (required)
+ * @return CompletableFuture
+ */
+ public CompletableFuture deleteCustomRulesetAsync(String rulesetName) {
+ return deleteCustomRulesetWithHttpInfoAsync(rulesetName)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Delete a custom ruleset
+ *
+ * @param rulesetName The ruleset name (required)
+ * @return ApiResponse<Void>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | Successfully deleted | - |
+ * | 400 | Bad request | - |
+ * | 401 | Unauthorized - custom rules not enabled | - |
+ * | 404 | Ruleset not found | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse deleteCustomRulesetWithHttpInfo(String rulesetName) throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "deleteCustomRuleset";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'rulesetName' is set
+ if (rulesetName == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'rulesetName' when calling deleteCustomRuleset");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/static-analysis/custom/rulesets/{ruleset_name}"
+ .replaceAll(
+ "\\{" + "ruleset_name" + "\\}", apiClient.escapeString(rulesetName.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.StaticAnalysisApi.deleteCustomRuleset",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"*/*"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ return apiClient.invokeAPI(
+ "DELETE",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ null);
+ }
+
+ /**
+ * Delete Custom Ruleset.
+ *
+ * See {@link #deleteCustomRulesetWithHttpInfo}.
+ *
+ * @param rulesetName The ruleset name (required)
+ * @return CompletableFuture<ApiResponse<Void>>
+ */
+ public CompletableFuture> deleteCustomRulesetWithHttpInfoAsync(
+ String rulesetName) {
+ // Check if unstable operation is enabled
+ String operationId = "deleteCustomRuleset";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'rulesetName' is set
+ if (rulesetName == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'rulesetName' when calling deleteCustomRuleset"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/static-analysis/custom/rulesets/{ruleset_name}"
+ .replaceAll(
+ "\\{" + "ruleset_name" + "\\}", apiClient.escapeString(rulesetName.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.StaticAnalysisApi.deleteCustomRuleset",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"*/*"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "DELETE",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ null);
+ }
+
+ /** Manage optional parameters to listCustomRuleRevisions. */
+ public static class ListCustomRuleRevisionsOptionalParameters {
+ private Integer pageOffset;
+ private Integer pageLimit;
+
+ /**
+ * Set pageOffset.
+ *
+ * @param pageOffset Pagination offset (optional, default to 0)
+ * @return ListCustomRuleRevisionsOptionalParameters
+ */
+ public ListCustomRuleRevisionsOptionalParameters pageOffset(Integer pageOffset) {
+ this.pageOffset = pageOffset;
+ return this;
+ }
+
+ /**
+ * Set pageLimit.
+ *
+ * @param pageLimit Pagination limit (optional, default to 10)
+ * @return ListCustomRuleRevisionsOptionalParameters
+ */
+ public ListCustomRuleRevisionsOptionalParameters pageLimit(Integer pageLimit) {
+ this.pageLimit = pageLimit;
+ return this;
+ }
+ }
+
+ /**
+ * List Custom Rule Revisions.
+ *
+ * See {@link #listCustomRuleRevisionsWithHttpInfo}.
+ *
+ * @param rulesetName The ruleset name (required)
+ * @param ruleName The rule name (required)
+ * @return CustomRuleRevisionsResponse
+ * @throws ApiException if fails to make API call
+ */
+ public CustomRuleRevisionsResponse listCustomRuleRevisions(String rulesetName, String ruleName)
+ throws ApiException {
+ return listCustomRuleRevisionsWithHttpInfo(
+ rulesetName, ruleName, new ListCustomRuleRevisionsOptionalParameters())
+ .getData();
+ }
+
+ /**
+ * List Custom Rule Revisions.
+ *
+ *
See {@link #listCustomRuleRevisionsWithHttpInfoAsync}.
+ *
+ * @param rulesetName The ruleset name (required)
+ * @param ruleName The rule name (required)
+ * @return CompletableFuture<CustomRuleRevisionsResponse>
+ */
+ public CompletableFuture listCustomRuleRevisionsAsync(
+ String rulesetName, String ruleName) {
+ return listCustomRuleRevisionsWithHttpInfoAsync(
+ rulesetName, ruleName, new ListCustomRuleRevisionsOptionalParameters())
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * List Custom Rule Revisions.
+ *
+ * See {@link #listCustomRuleRevisionsWithHttpInfo}.
+ *
+ * @param rulesetName The ruleset name (required)
+ * @param ruleName The rule name (required)
+ * @param parameters Optional parameters for the request.
+ * @return CustomRuleRevisionsResponse
+ * @throws ApiException if fails to make API call
+ */
+ public CustomRuleRevisionsResponse listCustomRuleRevisions(
+ String rulesetName, String ruleName, ListCustomRuleRevisionsOptionalParameters parameters)
+ throws ApiException {
+ return listCustomRuleRevisionsWithHttpInfo(rulesetName, ruleName, parameters).getData();
+ }
+
+ /**
+ * List Custom Rule Revisions.
+ *
+ *
See {@link #listCustomRuleRevisionsWithHttpInfoAsync}.
+ *
+ * @param rulesetName The ruleset name (required)
+ * @param ruleName The rule name (required)
+ * @param parameters Optional parameters for the request.
+ * @return CompletableFuture<CustomRuleRevisionsResponse>
+ */
+ public CompletableFuture listCustomRuleRevisionsAsync(
+ String rulesetName, String ruleName, ListCustomRuleRevisionsOptionalParameters parameters) {
+ return listCustomRuleRevisionsWithHttpInfoAsync(rulesetName, ruleName, parameters)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Get all revisions for a custom rule
+ *
+ * @param rulesetName The ruleset name (required)
+ * @param ruleName The rule name (required)
+ * @param parameters Optional parameters for the request.
+ * @return ApiResponse<CustomRuleRevisionsResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | Successful response | - |
+ * | 400 | Bad request | - |
+ * | 401 | Unauthorized - custom rules not enabled | - |
+ * | 404 | Rule not found | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse listCustomRuleRevisionsWithHttpInfo(
+ String rulesetName, String ruleName, ListCustomRuleRevisionsOptionalParameters parameters)
+ throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "listCustomRuleRevisions";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'rulesetName' is set
+ if (rulesetName == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'rulesetName' when calling listCustomRuleRevisions");
+ }
+
+ // verify the required parameter 'ruleName' is set
+ if (ruleName == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'ruleName' when calling listCustomRuleRevisions");
+ }
+ Integer pageOffset = parameters.pageOffset;
+ Integer pageLimit = parameters.pageLimit;
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}/revisions"
+ .replaceAll(
+ "\\{" + "ruleset_name" + "\\}", apiClient.escapeString(rulesetName.toString()))
+ .replaceAll("\\{" + "rule_name" + "\\}", apiClient.escapeString(ruleName.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[offset]", pageOffset));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit));
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.StaticAnalysisApi.listCustomRuleRevisions",
+ localVarPath,
+ localVarQueryParams,
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ return apiClient.invokeAPI(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * List Custom Rule Revisions.
+ *
+ * See {@link #listCustomRuleRevisionsWithHttpInfo}.
+ *
+ * @param rulesetName The ruleset name (required)
+ * @param ruleName The rule name (required)
+ * @param parameters Optional parameters for the request.
+ * @return CompletableFuture<ApiResponse<CustomRuleRevisionsResponse>>
+ */
+ public CompletableFuture>
+ listCustomRuleRevisionsWithHttpInfoAsync(
+ String rulesetName,
+ String ruleName,
+ ListCustomRuleRevisionsOptionalParameters parameters) {
+ // Check if unstable operation is enabled
+ String operationId = "listCustomRuleRevisions";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'rulesetName' is set
+ if (rulesetName == null) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'rulesetName' when calling listCustomRuleRevisions"));
+ return result;
+ }
+
+ // verify the required parameter 'ruleName' is set
+ if (ruleName == null) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'ruleName' when calling listCustomRuleRevisions"));
+ return result;
+ }
+ Integer pageOffset = parameters.pageOffset;
+ Integer pageLimit = parameters.pageLimit;
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}/revisions"
+ .replaceAll(
+ "\\{" + "ruleset_name" + "\\}", apiClient.escapeString(rulesetName.toString()))
+ .replaceAll("\\{" + "rule_name" + "\\}", apiClient.escapeString(ruleName.toString()));
+
+ List localVarQueryParams = new ArrayList();
+ Map localVarHeaderParams = new HashMap();
+
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[offset]", pageOffset));
+ localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit));
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.StaticAnalysisApi.listCustomRuleRevisions",
+ localVarPath,
+ localVarQueryParams,
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ } catch (ApiException ex) {
+ CompletableFuture> result =
+ new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Revert Custom Rule Revision.
+ *
+ * See {@link #revertCustomRuleRevisionWithHttpInfo}.
+ *
+ * @param rulesetName The ruleset name (required)
+ * @param ruleName The rule name (required)
+ * @param body (required)
+ * @throws ApiException if fails to make API call
+ */
+ public void revertCustomRuleRevision(
+ String rulesetName, String ruleName, RevertCustomRuleRevisionRequest body)
+ throws ApiException {
+ revertCustomRuleRevisionWithHttpInfo(rulesetName, ruleName, body);
+ }
+
+ /**
+ * Revert Custom Rule Revision.
+ *
+ *
See {@link #revertCustomRuleRevisionWithHttpInfoAsync}.
+ *
+ * @param rulesetName The ruleset name (required)
+ * @param ruleName The rule name (required)
+ * @param body (required)
+ * @return CompletableFuture
+ */
+ public CompletableFuture revertCustomRuleRevisionAsync(
+ String rulesetName, String ruleName, RevertCustomRuleRevisionRequest body) {
+ return revertCustomRuleRevisionWithHttpInfoAsync(rulesetName, ruleName, body)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Revert a custom rule to a previous revision
+ *
+ * @param rulesetName The ruleset name (required)
+ * @param ruleName The rule name (required)
+ * @param body (required)
+ * @return ApiResponse<Void>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | Successfully reverted | - |
+ * | 400 | Bad request | - |
+ * | 401 | Unauthorized - custom rules not enabled | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse revertCustomRuleRevisionWithHttpInfo(
+ String rulesetName, String ruleName, RevertCustomRuleRevisionRequest body)
+ throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "revertCustomRuleRevision";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'rulesetName' is set
+ if (rulesetName == null) {
+ throw new ApiException(
+ 400,
+ "Missing the required parameter 'rulesetName' when calling revertCustomRuleRevision");
+ }
+
+ // verify the required parameter 'ruleName' is set
+ if (ruleName == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'ruleName' when calling revertCustomRuleRevision");
+ }
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'body' when calling revertCustomRuleRevision");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}/revisions/revert"
+ .replaceAll(
+ "\\{" + "ruleset_name" + "\\}", apiClient.escapeString(rulesetName.toString()))
+ .replaceAll("\\{" + "rule_name" + "\\}", apiClient.escapeString(ruleName.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.StaticAnalysisApi.revertCustomRuleRevision",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"*/*"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ return apiClient.invokeAPI(
+ "POST",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ null);
+ }
+
+ /**
+ * Revert Custom Rule Revision.
+ *
+ * See {@link #revertCustomRuleRevisionWithHttpInfo}.
+ *
+ * @param rulesetName The ruleset name (required)
+ * @param ruleName The rule name (required)
+ * @param body (required)
+ * @return CompletableFuture<ApiResponse<Void>>
+ */
+ public CompletableFuture> revertCustomRuleRevisionWithHttpInfoAsync(
+ String rulesetName, String ruleName, RevertCustomRuleRevisionRequest body) {
+ // Check if unstable operation is enabled
+ String operationId = "revertCustomRuleRevision";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'rulesetName' is set
+ if (rulesetName == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'rulesetName' when calling"
+ + " revertCustomRuleRevision"));
+ return result;
+ }
+
+ // verify the required parameter 'ruleName' is set
+ if (ruleName == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'ruleName' when calling revertCustomRuleRevision"));
+ return result;
+ }
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400, "Missing the required parameter 'body' when calling revertCustomRuleRevision"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}/revisions/revert"
+ .replaceAll(
+ "\\{" + "ruleset_name" + "\\}", apiClient.escapeString(rulesetName.toString()))
+ .replaceAll("\\{" + "rule_name" + "\\}", apiClient.escapeString(ruleName.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.StaticAnalysisApi.revertCustomRuleRevision",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"*/*"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "POST",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ null);
+ }
+
+ /**
+ * Show Custom Rule.
+ *
+ * See {@link #showCustomRuleWithHttpInfo}.
+ *
+ * @param rulesetName The ruleset name (required)
+ * @param ruleName The rule name (required)
+ * @return CustomRuleResponse
+ * @throws ApiException if fails to make API call
+ */
+ public CustomRuleResponse showCustomRule(String rulesetName, String ruleName)
+ throws ApiException {
+ return showCustomRuleWithHttpInfo(rulesetName, ruleName).getData();
+ }
+
+ /**
+ * Show Custom Rule.
+ *
+ *
See {@link #showCustomRuleWithHttpInfoAsync}.
+ *
+ * @param rulesetName The ruleset name (required)
+ * @param ruleName The rule name (required)
+ * @return CompletableFuture<CustomRuleResponse>
+ */
+ public CompletableFuture showCustomRuleAsync(
+ String rulesetName, String ruleName) {
+ return showCustomRuleWithHttpInfoAsync(rulesetName, ruleName)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Get a custom rule by name
+ *
+ * @param rulesetName The ruleset name (required)
+ * @param ruleName The rule name (required)
+ * @return ApiResponse<CustomRuleResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | Successful response | - |
+ * | 400 | Bad request | - |
+ * | 401 | Unauthorized - custom rules not enabled | - |
+ * | 404 | Rule not found | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse showCustomRuleWithHttpInfo(
+ String rulesetName, String ruleName) throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "showCustomRule";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'rulesetName' is set
+ if (rulesetName == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'rulesetName' when calling showCustomRule");
+ }
+
+ // verify the required parameter 'ruleName' is set
+ if (ruleName == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'ruleName' when calling showCustomRule");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}"
+ .replaceAll(
+ "\\{" + "ruleset_name" + "\\}", apiClient.escapeString(rulesetName.toString()))
+ .replaceAll("\\{" + "rule_name" + "\\}", apiClient.escapeString(ruleName.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.StaticAnalysisApi.showCustomRule",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ return apiClient.invokeAPI(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Show Custom Rule.
+ *
+ * See {@link #showCustomRuleWithHttpInfo}.
+ *
+ * @param rulesetName The ruleset name (required)
+ * @param ruleName The rule name (required)
+ * @return CompletableFuture<ApiResponse<CustomRuleResponse>>
+ */
+ public CompletableFuture> showCustomRuleWithHttpInfoAsync(
+ String rulesetName, String ruleName) {
+ // Check if unstable operation is enabled
+ String operationId = "showCustomRule";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'rulesetName' is set
+ if (rulesetName == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400, "Missing the required parameter 'rulesetName' when calling showCustomRule"));
+ return result;
+ }
+
+ // verify the required parameter 'ruleName' is set
+ if (ruleName == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400, "Missing the required parameter 'ruleName' when calling showCustomRule"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}"
+ .replaceAll(
+ "\\{" + "ruleset_name" + "\\}", apiClient.escapeString(rulesetName.toString()))
+ .replaceAll("\\{" + "rule_name" + "\\}", apiClient.escapeString(ruleName.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.StaticAnalysisApi.showCustomRule",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Show Custom Rule Revision.
+ *
+ * See {@link #showCustomRuleRevisionWithHttpInfo}.
+ *
+ * @param rulesetName The ruleset name (required)
+ * @param ruleName The rule name (required)
+ * @param id The revision ID (required)
+ * @return CustomRuleRevisionResponse
+ * @throws ApiException if fails to make API call
+ */
+ public CustomRuleRevisionResponse showCustomRuleRevision(
+ String rulesetName, String ruleName, String id) throws ApiException {
+ return showCustomRuleRevisionWithHttpInfo(rulesetName, ruleName, id).getData();
+ }
+
+ /**
+ * Show Custom Rule Revision.
+ *
+ *
See {@link #showCustomRuleRevisionWithHttpInfoAsync}.
+ *
+ * @param rulesetName The ruleset name (required)
+ * @param ruleName The rule name (required)
+ * @param id The revision ID (required)
+ * @return CompletableFuture<CustomRuleRevisionResponse>
+ */
+ public CompletableFuture showCustomRuleRevisionAsync(
+ String rulesetName, String ruleName, String id) {
+ return showCustomRuleRevisionWithHttpInfoAsync(rulesetName, ruleName, id)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Get a specific revision of a custom rule
+ *
+ * @param rulesetName The ruleset name (required)
+ * @param ruleName The rule name (required)
+ * @param id The revision ID (required)
+ * @return ApiResponse<CustomRuleRevisionResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | Successful response | - |
+ * | 400 | Bad request | - |
+ * | 401 | Unauthorized - custom rules not enabled | - |
+ * | 404 | Revision not found | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse showCustomRuleRevisionWithHttpInfo(
+ String rulesetName, String ruleName, String id) throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "showCustomRuleRevision";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'rulesetName' is set
+ if (rulesetName == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'rulesetName' when calling showCustomRuleRevision");
+ }
+
+ // verify the required parameter 'ruleName' is set
+ if (ruleName == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'ruleName' when calling showCustomRuleRevision");
+ }
+
+ // verify the required parameter 'id' is set
+ if (id == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'id' when calling showCustomRuleRevision");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}/revisions/{id}"
+ .replaceAll(
+ "\\{" + "ruleset_name" + "\\}", apiClient.escapeString(rulesetName.toString()))
+ .replaceAll("\\{" + "rule_name" + "\\}", apiClient.escapeString(ruleName.toString()))
+ .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.StaticAnalysisApi.showCustomRuleRevision",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ return apiClient.invokeAPI(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Show Custom Rule Revision.
+ *
+ * See {@link #showCustomRuleRevisionWithHttpInfo}.
+ *
+ * @param rulesetName The ruleset name (required)
+ * @param ruleName The rule name (required)
+ * @param id The revision ID (required)
+ * @return CompletableFuture<ApiResponse<CustomRuleRevisionResponse>>
+ */
+ public CompletableFuture>
+ showCustomRuleRevisionWithHttpInfoAsync(String rulesetName, String ruleName, String id) {
+ // Check if unstable operation is enabled
+ String operationId = "showCustomRuleRevision";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'rulesetName' is set
+ if (rulesetName == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'rulesetName' when calling showCustomRuleRevision"));
+ return result;
+ }
+
+ // verify the required parameter 'ruleName' is set
+ if (ruleName == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'ruleName' when calling showCustomRuleRevision"));
+ return result;
+ }
+
+ // verify the required parameter 'id' is set
+ if (id == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400, "Missing the required parameter 'id' when calling showCustomRuleRevision"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}/revisions/{id}"
+ .replaceAll(
+ "\\{" + "ruleset_name" + "\\}", apiClient.escapeString(rulesetName.toString()))
+ .replaceAll("\\{" + "rule_name" + "\\}", apiClient.escapeString(ruleName.toString()))
+ .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.StaticAnalysisApi.showCustomRuleRevision",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Show Custom Ruleset.
+ *
+ * See {@link #showCustomRulesetWithHttpInfo}.
+ *
+ * @param rulesetName The ruleset name (required)
+ * @return CustomRulesetResponse
+ * @throws ApiException if fails to make API call
+ */
+ public CustomRulesetResponse showCustomRuleset(String rulesetName) throws ApiException {
+ return showCustomRulesetWithHttpInfo(rulesetName).getData();
+ }
+
+ /**
+ * Show Custom Ruleset.
+ *
+ *
See {@link #showCustomRulesetWithHttpInfoAsync}.
+ *
+ * @param rulesetName The ruleset name (required)
+ * @return CompletableFuture<CustomRulesetResponse>
+ */
+ public CompletableFuture showCustomRulesetAsync(String rulesetName) {
+ return showCustomRulesetWithHttpInfoAsync(rulesetName)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Get a custom ruleset by name
+ *
+ * @param rulesetName The ruleset name (required)
+ * @return ApiResponse<CustomRulesetResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | Successful response | - |
+ * | 400 | Bad request | - |
+ * | 401 | Unauthorized - custom rules not enabled | - |
+ * | 404 | Ruleset not found | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse showCustomRulesetWithHttpInfo(String rulesetName)
+ throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "showCustomRuleset";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'rulesetName' is set
+ if (rulesetName == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'rulesetName' when calling showCustomRuleset");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/static-analysis/custom/rulesets/{ruleset_name}"
+ .replaceAll(
+ "\\{" + "ruleset_name" + "\\}", apiClient.escapeString(rulesetName.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.StaticAnalysisApi.showCustomRuleset",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ return apiClient.invokeAPI(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Show Custom Ruleset.
+ *
+ * See {@link #showCustomRulesetWithHttpInfo}.
+ *
+ * @param rulesetName The ruleset name (required)
+ * @return CompletableFuture<ApiResponse<CustomRulesetResponse>>
+ */
+ public CompletableFuture> showCustomRulesetWithHttpInfoAsync(
+ String rulesetName) {
+ // Check if unstable operation is enabled
+ String operationId = "showCustomRuleset";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = null;
+
+ // verify the required parameter 'rulesetName' is set
+ if (rulesetName == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400, "Missing the required parameter 'rulesetName' when calling showCustomRuleset"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/static-analysis/custom/rulesets/{ruleset_name}"
+ .replaceAll(
+ "\\{" + "ruleset_name" + "\\}", apiClient.escapeString(rulesetName.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.StaticAnalysisApi.showCustomRuleset",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "GET",
+ builder,
+ localVarHeaderParams,
+ new String[] {},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Update Custom Ruleset.
+ *
+ * See {@link #updateCustomRulesetWithHttpInfo}.
+ *
+ * @param rulesetName The ruleset name (required)
+ * @param body (required)
+ * @return CustomRulesetResponse
+ * @throws ApiException if fails to make API call
+ */
+ public CustomRulesetResponse updateCustomRuleset(String rulesetName, CustomRulesetRequest body)
+ throws ApiException {
+ return updateCustomRulesetWithHttpInfo(rulesetName, body).getData();
+ }
+
+ /**
+ * Update Custom Ruleset.
+ *
+ *
See {@link #updateCustomRulesetWithHttpInfoAsync}.
+ *
+ * @param rulesetName The ruleset name (required)
+ * @param body (required)
+ * @return CompletableFuture<CustomRulesetResponse>
+ */
+ public CompletableFuture updateCustomRulesetAsync(
+ String rulesetName, CustomRulesetRequest body) {
+ return updateCustomRulesetWithHttpInfoAsync(rulesetName, body)
+ .thenApply(
+ response -> {
+ return response.getData();
+ });
+ }
+
+ /**
+ * Update an existing custom ruleset
+ *
+ * @param rulesetName The ruleset name (required)
+ * @param body (required)
+ * @return ApiResponse<CustomRulesetResponse>
+ * @throws ApiException if fails to make API call
+ * @http.response.details
+ *
+ * Response details
+ * | Status Code | Description | Response Headers |
+ * | 200 | Successfully updated | - |
+ * | 400 | Bad request | - |
+ * | 401 | Unauthorized - custom rules not enabled | - |
+ * | 412 | Precondition failed - validation error or ruleset not found | - |
+ * | 429 | Too many requests | - |
+ *
+ */
+ public ApiResponse updateCustomRulesetWithHttpInfo(
+ String rulesetName, CustomRulesetRequest body) throws ApiException {
+ // Check if unstable operation is enabled
+ String operationId = "updateCustomRuleset";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId));
+ }
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'rulesetName' is set
+ if (rulesetName == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'rulesetName' when calling updateCustomRuleset");
+ }
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ throw new ApiException(
+ 400, "Missing the required parameter 'body' when calling updateCustomRuleset");
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/static-analysis/custom/rulesets/{ruleset_name}"
+ .replaceAll(
+ "\\{" + "ruleset_name" + "\\}", apiClient.escapeString(rulesetName.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder =
+ apiClient.createBuilder(
+ "v2.StaticAnalysisApi.updateCustomRuleset",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ return apiClient.invokeAPI(
+ "PATCH",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
+
+ /**
+ * Update Custom Ruleset.
+ *
+ * See {@link #updateCustomRulesetWithHttpInfo}.
+ *
+ * @param rulesetName The ruleset name (required)
+ * @param body (required)
+ * @return CompletableFuture<ApiResponse<CustomRulesetResponse>>
+ */
+ public CompletableFuture> updateCustomRulesetWithHttpInfoAsync(
+ String rulesetName, CustomRulesetRequest body) {
+ // Check if unstable operation is enabled
+ String operationId = "updateCustomRuleset";
+ if (apiClient.isUnstableOperationEnabled("v2." + operationId)) {
+ apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId));
+ } else {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)));
+ return result;
+ }
+ Object localVarPostBody = body;
+
+ // verify the required parameter 'rulesetName' is set
+ if (rulesetName == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400,
+ "Missing the required parameter 'rulesetName' when calling updateCustomRuleset"));
+ return result;
+ }
+
+ // verify the required parameter 'body' is set
+ if (body == null) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(
+ new ApiException(
+ 400, "Missing the required parameter 'body' when calling updateCustomRuleset"));
+ return result;
+ }
+ // create path and map variables
+ String localVarPath =
+ "/api/v2/static-analysis/custom/rulesets/{ruleset_name}"
+ .replaceAll(
+ "\\{" + "ruleset_name" + "\\}", apiClient.escapeString(rulesetName.toString()));
+
+ Map localVarHeaderParams = new HashMap();
+
+ Invocation.Builder builder;
+ try {
+ builder =
+ apiClient.createBuilder(
+ "v2.StaticAnalysisApi.updateCustomRuleset",
+ localVarPath,
+ new ArrayList(),
+ localVarHeaderParams,
+ new HashMap(),
+ new String[] {"application/json"},
+ new String[] {"apiKeyAuth", "appKeyAuth"});
+ } catch (ApiException ex) {
+ CompletableFuture> result = new CompletableFuture<>();
+ result.completeExceptionally(ex);
+ return result;
+ }
+ return apiClient.invokeAPIAsync(
+ "PATCH",
+ builder,
+ localVarHeaderParams,
+ new String[] {"application/json"},
+ localVarPostBody,
+ new HashMap(),
+ false,
+ new GenericType() {});
+ }
}
diff --git a/src/main/java/com/datadog/api/client/v2/model/Argument.java b/src/main/java/com/datadog/api/client/v2/model/Argument.java
new file mode 100644
index 00000000000..a43bc969b3d
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/Argument.java
@@ -0,0 +1,170 @@
+/*
+ * 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 com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/** */
+@JsonPropertyOrder({Argument.JSON_PROPERTY_DESCRIPTION, Argument.JSON_PROPERTY_NAME})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class Argument {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_DESCRIPTION = "description";
+ private String description;
+
+ public static final String JSON_PROPERTY_NAME = "name";
+ private String name;
+
+ public Argument() {}
+
+ @JsonCreator
+ public Argument(
+ @JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description,
+ @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) {
+ this.description = description;
+ this.name = name;
+ }
+
+ public Argument description(String description) {
+ this.description = description;
+ return this;
+ }
+
+ /**
+ * Base64-encoded argument description
+ *
+ * @return description
+ */
+ @JsonProperty(JSON_PROPERTY_DESCRIPTION)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public Argument name(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Base64-encoded argument name
+ *
+ * @return name
+ */
+ @JsonProperty(JSON_PROPERTY_NAME)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * A container for additional, undeclared properties. This is a holder for any undeclared
+ * properties as specified with the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value. If the property
+ * does not already exist, create it otherwise replace it.
+ *
+ * @param key The arbitrary key to set
+ * @param value The associated value
+ * @return Argument
+ */
+ @JsonAnySetter
+ public Argument putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return The additional properties
+ */
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key The arbitrary key to get
+ * @return The specific additional property for the given key
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
+
+ /** Return true if this Argument object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ Argument argument = (Argument) o;
+ return Objects.equals(this.description, argument.description)
+ && Objects.equals(this.name, argument.name)
+ && Objects.equals(this.additionalProperties, argument.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(description, name, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class Argument {\n");
+ sb.append(" description: ").append(toIndentedString(description)).append("\n");
+ sb.append(" name: ").append(toIndentedString(name)).append("\n");
+ sb.append(" additionalProperties: ")
+ .append(toIndentedString(additionalProperties))
+ .append("\n");
+ sb.append('}');
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/CustomRule.java b/src/main/java/com/datadog/api/client/v2/model/CustomRule.java
new file mode 100644
index 00000000000..9587df95d4f
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/CustomRule.java
@@ -0,0 +1,233 @@
+/*
+ * 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 com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.time.OffsetDateTime;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/** */
+@JsonPropertyOrder({
+ CustomRule.JSON_PROPERTY_CREATED_AT,
+ CustomRule.JSON_PROPERTY_CREATED_BY,
+ CustomRule.JSON_PROPERTY_LAST_REVISION,
+ CustomRule.JSON_PROPERTY_NAME
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class CustomRule {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_CREATED_AT = "created_at";
+ private OffsetDateTime createdAt;
+
+ public static final String JSON_PROPERTY_CREATED_BY = "created_by";
+ private String createdBy;
+
+ public static final String JSON_PROPERTY_LAST_REVISION = "last_revision";
+ private CustomRuleRevision lastRevision;
+
+ public static final String JSON_PROPERTY_NAME = "name";
+ private String name;
+
+ public CustomRule() {}
+
+ @JsonCreator
+ public CustomRule(
+ @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) OffsetDateTime createdAt,
+ @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_BY) String createdBy,
+ @JsonProperty(required = true, value = JSON_PROPERTY_LAST_REVISION)
+ CustomRuleRevision lastRevision,
+ @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name) {
+ this.createdAt = createdAt;
+ this.createdBy = createdBy;
+ this.lastRevision = lastRevision;
+ this.unparsed |= lastRevision.unparsed;
+ this.name = name;
+ }
+
+ public CustomRule createdAt(OffsetDateTime createdAt) {
+ this.createdAt = createdAt;
+ return this;
+ }
+
+ /**
+ * Creation timestamp
+ *
+ * @return createdAt
+ */
+ @JsonProperty(JSON_PROPERTY_CREATED_AT)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public OffsetDateTime getCreatedAt() {
+ return createdAt;
+ }
+
+ public void setCreatedAt(OffsetDateTime createdAt) {
+ this.createdAt = createdAt;
+ }
+
+ public CustomRule createdBy(String createdBy) {
+ this.createdBy = createdBy;
+ return this;
+ }
+
+ /**
+ * Creator identifier
+ *
+ * @return createdBy
+ */
+ @JsonProperty(JSON_PROPERTY_CREATED_BY)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getCreatedBy() {
+ return createdBy;
+ }
+
+ public void setCreatedBy(String createdBy) {
+ this.createdBy = createdBy;
+ }
+
+ public CustomRule lastRevision(CustomRuleRevision lastRevision) {
+ this.lastRevision = lastRevision;
+ this.unparsed |= lastRevision.unparsed;
+ return this;
+ }
+
+ /**
+ * GetlastRevision
+ *
+ * @return lastRevision
+ */
+ @JsonProperty(JSON_PROPERTY_LAST_REVISION)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public CustomRuleRevision getLastRevision() {
+ return lastRevision;
+ }
+
+ public void setLastRevision(CustomRuleRevision lastRevision) {
+ this.lastRevision = lastRevision;
+ }
+
+ public CustomRule name(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Rule name
+ *
+ * @return name
+ */
+ @JsonProperty(JSON_PROPERTY_NAME)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * A container for additional, undeclared properties. This is a holder for any undeclared
+ * properties as specified with the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value. If the property
+ * does not already exist, create it otherwise replace it.
+ *
+ * @param key The arbitrary key to set
+ * @param value The associated value
+ * @return CustomRule
+ */
+ @JsonAnySetter
+ public CustomRule putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return The additional properties
+ */
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key The arbitrary key to get
+ * @return The specific additional property for the given key
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
+
+ /** Return true if this CustomRule object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ CustomRule customRule = (CustomRule) o;
+ return Objects.equals(this.createdAt, customRule.createdAt)
+ && Objects.equals(this.createdBy, customRule.createdBy)
+ && Objects.equals(this.lastRevision, customRule.lastRevision)
+ && Objects.equals(this.name, customRule.name)
+ && Objects.equals(this.additionalProperties, customRule.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(createdAt, createdBy, lastRevision, name, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class CustomRule {\n");
+ sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n");
+ sb.append(" createdBy: ").append(toIndentedString(createdBy)).append("\n");
+ sb.append(" lastRevision: ").append(toIndentedString(lastRevision)).append("\n");
+ sb.append(" name: ").append(toIndentedString(name)).append("\n");
+ sb.append(" additionalProperties: ")
+ .append(toIndentedString(additionalProperties))
+ .append("\n");
+ sb.append('}');
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/CustomRuleDataType.java b/src/main/java/com/datadog/api/client/v2/model/CustomRuleDataType.java
new file mode 100644
index 00000000000..257c056cc04
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/CustomRuleDataType.java
@@ -0,0 +1,54 @@
+/*
+ * 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 com.datadog.api.client.v2.model;
+
+import com.datadog.api.client.ModelEnum;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.SerializerProvider;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.StdSerializer;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+/** Resource type */
+@JsonSerialize(using = CustomRuleDataType.CustomRuleDataTypeSerializer.class)
+public class CustomRuleDataType extends ModelEnum {
+
+ private static final Set allowedValues =
+ new HashSet(Arrays.asList("custom_rule"));
+
+ public static final CustomRuleDataType CUSTOM_RULE = new CustomRuleDataType("custom_rule");
+
+ CustomRuleDataType(String value) {
+ super(value, allowedValues);
+ }
+
+ public static class CustomRuleDataTypeSerializer extends StdSerializer {
+ public CustomRuleDataTypeSerializer(Class t) {
+ super(t);
+ }
+
+ public CustomRuleDataTypeSerializer() {
+ this(null);
+ }
+
+ @Override
+ public void serialize(CustomRuleDataType value, JsonGenerator jgen, SerializerProvider provider)
+ throws IOException, JsonProcessingException {
+ jgen.writeObject(value.value);
+ }
+ }
+
+ @JsonCreator
+ public static CustomRuleDataType fromValue(String value) {
+ return new CustomRuleDataType(value);
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/CustomRuleRequest.java b/src/main/java/com/datadog/api/client/v2/model/CustomRuleRequest.java
new file mode 100644
index 00000000000..fc576f2e075
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/CustomRuleRequest.java
@@ -0,0 +1,136 @@
+/*
+ * 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 com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/** */
+@JsonPropertyOrder({CustomRuleRequest.JSON_PROPERTY_DATA})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class CustomRuleRequest {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_DATA = "data";
+ private CustomRuleRequestData data;
+
+ public CustomRuleRequest data(CustomRuleRequestData data) {
+ this.data = data;
+ this.unparsed |= data.unparsed;
+ return this;
+ }
+
+ /**
+ * Getdata
+ *
+ * @return data
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_DATA)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public CustomRuleRequestData getData() {
+ return data;
+ }
+
+ public void setData(CustomRuleRequestData data) {
+ this.data = data;
+ }
+
+ /**
+ * A container for additional, undeclared properties. This is a holder for any undeclared
+ * properties as specified with the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value. If the property
+ * does not already exist, create it otherwise replace it.
+ *
+ * @param key The arbitrary key to set
+ * @param value The associated value
+ * @return CustomRuleRequest
+ */
+ @JsonAnySetter
+ public CustomRuleRequest putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return The additional properties
+ */
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key The arbitrary key to get
+ * @return The specific additional property for the given key
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
+
+ /** Return true if this CustomRuleRequest object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ CustomRuleRequest customRuleRequest = (CustomRuleRequest) o;
+ return Objects.equals(this.data, customRuleRequest.data)
+ && Objects.equals(this.additionalProperties, customRuleRequest.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(data, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class CustomRuleRequest {\n");
+ sb.append(" data: ").append(toIndentedString(data)).append("\n");
+ sb.append(" additionalProperties: ")
+ .append(toIndentedString(additionalProperties))
+ .append("\n");
+ sb.append('}');
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/CustomRuleRequestData.java b/src/main/java/com/datadog/api/client/v2/model/CustomRuleRequestData.java
new file mode 100644
index 00000000000..d541ad59825
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/CustomRuleRequestData.java
@@ -0,0 +1,196 @@
+/*
+ * 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 com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/** */
+@JsonPropertyOrder({
+ CustomRuleRequestData.JSON_PROPERTY_ATTRIBUTES,
+ CustomRuleRequestData.JSON_PROPERTY_ID,
+ CustomRuleRequestData.JSON_PROPERTY_TYPE
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class CustomRuleRequestData {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_ATTRIBUTES = "attributes";
+ private CustomRuleRequestDataAttributes attributes;
+
+ public static final String JSON_PROPERTY_ID = "id";
+ private String id;
+
+ public static final String JSON_PROPERTY_TYPE = "type";
+ private CustomRuleDataType type;
+
+ public CustomRuleRequestData attributes(CustomRuleRequestDataAttributes attributes) {
+ this.attributes = attributes;
+ this.unparsed |= attributes.unparsed;
+ return this;
+ }
+
+ /**
+ * Getattributes
+ *
+ * @return attributes
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_ATTRIBUTES)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public CustomRuleRequestDataAttributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(CustomRuleRequestDataAttributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public CustomRuleRequestData id(String id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Rule identifier
+ *
+ * @return id
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_ID)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public CustomRuleRequestData type(CustomRuleDataType type) {
+ this.type = type;
+ this.unparsed |= !type.isValid();
+ return this;
+ }
+
+ /**
+ * Resource type
+ *
+ * @return type
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_TYPE)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public CustomRuleDataType getType() {
+ return type;
+ }
+
+ public void setType(CustomRuleDataType type) {
+ if (!type.isValid()) {
+ this.unparsed = true;
+ }
+ this.type = type;
+ }
+
+ /**
+ * A container for additional, undeclared properties. This is a holder for any undeclared
+ * properties as specified with the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value. If the property
+ * does not already exist, create it otherwise replace it.
+ *
+ * @param key The arbitrary key to set
+ * @param value The associated value
+ * @return CustomRuleRequestData
+ */
+ @JsonAnySetter
+ public CustomRuleRequestData putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return The additional properties
+ */
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key The arbitrary key to get
+ * @return The specific additional property for the given key
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
+
+ /** Return true if this CustomRuleRequestData object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ CustomRuleRequestData customRuleRequestData = (CustomRuleRequestData) o;
+ return Objects.equals(this.attributes, customRuleRequestData.attributes)
+ && Objects.equals(this.id, customRuleRequestData.id)
+ && Objects.equals(this.type, customRuleRequestData.type)
+ && Objects.equals(this.additionalProperties, customRuleRequestData.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(attributes, id, type, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class CustomRuleRequestData {\n");
+ sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n");
+ sb.append(" id: ").append(toIndentedString(id)).append("\n");
+ sb.append(" type: ").append(toIndentedString(type)).append("\n");
+ sb.append(" additionalProperties: ")
+ .append(toIndentedString(additionalProperties))
+ .append("\n");
+ sb.append('}');
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/CustomRuleRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CustomRuleRequestDataAttributes.java
new file mode 100644
index 00000000000..cccd3f26129
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/CustomRuleRequestDataAttributes.java
@@ -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 com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/** */
+@JsonPropertyOrder({CustomRuleRequestDataAttributes.JSON_PROPERTY_NAME})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class CustomRuleRequestDataAttributes {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_NAME = "name";
+ private String name;
+
+ public CustomRuleRequestDataAttributes name(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Rule name
+ *
+ * @return name
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_NAME)
+ @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * A container for additional, undeclared properties. This is a holder for any undeclared
+ * properties as specified with the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value. If the property
+ * does not already exist, create it otherwise replace it.
+ *
+ * @param key The arbitrary key to set
+ * @param value The associated value
+ * @return CustomRuleRequestDataAttributes
+ */
+ @JsonAnySetter
+ public CustomRuleRequestDataAttributes putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return The additional properties
+ */
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key The arbitrary key to get
+ * @return The specific additional property for the given key
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
+
+ /** Return true if this CustomRuleRequestDataAttributes object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ CustomRuleRequestDataAttributes customRuleRequestDataAttributes =
+ (CustomRuleRequestDataAttributes) o;
+ return Objects.equals(this.name, customRuleRequestDataAttributes.name)
+ && Objects.equals(
+ this.additionalProperties, customRuleRequestDataAttributes.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(name, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class CustomRuleRequestDataAttributes {\n");
+ sb.append(" name: ").append(toIndentedString(name)).append("\n");
+ sb.append(" additionalProperties: ")
+ .append(toIndentedString(additionalProperties))
+ .append("\n");
+ sb.append('}');
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/CustomRuleResponse.java b/src/main/java/com/datadog/api/client/v2/model/CustomRuleResponse.java
new file mode 100644
index 00000000000..bf409655053
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/CustomRuleResponse.java
@@ -0,0 +1,145 @@
+/*
+ * 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 com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/** */
+@JsonPropertyOrder({CustomRuleResponse.JSON_PROPERTY_DATA})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class CustomRuleResponse {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_DATA = "data";
+ private CustomRuleResponseData data;
+
+ public CustomRuleResponse() {}
+
+ @JsonCreator
+ public CustomRuleResponse(
+ @JsonProperty(required = true, value = JSON_PROPERTY_DATA) CustomRuleResponseData data) {
+ this.data = data;
+ this.unparsed |= data.unparsed;
+ }
+
+ public CustomRuleResponse data(CustomRuleResponseData data) {
+ this.data = data;
+ this.unparsed |= data.unparsed;
+ return this;
+ }
+
+ /**
+ * Getdata
+ *
+ * @return data
+ */
+ @JsonProperty(JSON_PROPERTY_DATA)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public CustomRuleResponseData getData() {
+ return data;
+ }
+
+ public void setData(CustomRuleResponseData data) {
+ this.data = data;
+ }
+
+ /**
+ * A container for additional, undeclared properties. This is a holder for any undeclared
+ * properties as specified with the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value. If the property
+ * does not already exist, create it otherwise replace it.
+ *
+ * @param key The arbitrary key to set
+ * @param value The associated value
+ * @return CustomRuleResponse
+ */
+ @JsonAnySetter
+ public CustomRuleResponse putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return The additional properties
+ */
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key The arbitrary key to get
+ * @return The specific additional property for the given key
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
+
+ /** Return true if this CustomRuleResponse object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ CustomRuleResponse customRuleResponse = (CustomRuleResponse) o;
+ return Objects.equals(this.data, customRuleResponse.data)
+ && Objects.equals(this.additionalProperties, customRuleResponse.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(data, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class CustomRuleResponse {\n");
+ sb.append(" data: ").append(toIndentedString(data)).append("\n");
+ sb.append(" additionalProperties: ")
+ .append(toIndentedString(additionalProperties))
+ .append("\n");
+ sb.append('}');
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/CustomRuleResponseData.java b/src/main/java/com/datadog/api/client/v2/model/CustomRuleResponseData.java
new file mode 100644
index 00000000000..6f6c6f59d83
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/CustomRuleResponseData.java
@@ -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 com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/** */
+@JsonPropertyOrder({
+ CustomRuleResponseData.JSON_PROPERTY_ATTRIBUTES,
+ CustomRuleResponseData.JSON_PROPERTY_ID,
+ CustomRuleResponseData.JSON_PROPERTY_TYPE
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class CustomRuleResponseData {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_ATTRIBUTES = "attributes";
+ private CustomRule attributes;
+
+ public static final String JSON_PROPERTY_ID = "id";
+ private String id;
+
+ public static final String JSON_PROPERTY_TYPE = "type";
+ private CustomRuleDataType type;
+
+ public CustomRuleResponseData() {}
+
+ @JsonCreator
+ public CustomRuleResponseData(
+ @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) CustomRule attributes,
+ @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id,
+ @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CustomRuleDataType type) {
+ this.attributes = attributes;
+ this.unparsed |= attributes.unparsed;
+ this.id = id;
+ this.type = type;
+ this.unparsed |= !type.isValid();
+ }
+
+ public CustomRuleResponseData attributes(CustomRule attributes) {
+ this.attributes = attributes;
+ this.unparsed |= attributes.unparsed;
+ return this;
+ }
+
+ /**
+ * Getattributes
+ *
+ * @return attributes
+ */
+ @JsonProperty(JSON_PROPERTY_ATTRIBUTES)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public CustomRule getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(CustomRule attributes) {
+ this.attributes = attributes;
+ }
+
+ public CustomRuleResponseData id(String id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Rule identifier
+ *
+ * @return id
+ */
+ @JsonProperty(JSON_PROPERTY_ID)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public CustomRuleResponseData type(CustomRuleDataType type) {
+ this.type = type;
+ this.unparsed |= !type.isValid();
+ return this;
+ }
+
+ /**
+ * Resource type
+ *
+ * @return type
+ */
+ @JsonProperty(JSON_PROPERTY_TYPE)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public CustomRuleDataType getType() {
+ return type;
+ }
+
+ public void setType(CustomRuleDataType type) {
+ if (!type.isValid()) {
+ this.unparsed = true;
+ }
+ this.type = type;
+ }
+
+ /**
+ * A container for additional, undeclared properties. This is a holder for any undeclared
+ * properties as specified with the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value. If the property
+ * does not already exist, create it otherwise replace it.
+ *
+ * @param key The arbitrary key to set
+ * @param value The associated value
+ * @return CustomRuleResponseData
+ */
+ @JsonAnySetter
+ public CustomRuleResponseData putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return The additional properties
+ */
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key The arbitrary key to get
+ * @return The specific additional property for the given key
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
+
+ /** Return true if this CustomRuleResponseData object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ CustomRuleResponseData customRuleResponseData = (CustomRuleResponseData) o;
+ return Objects.equals(this.attributes, customRuleResponseData.attributes)
+ && Objects.equals(this.id, customRuleResponseData.id)
+ && Objects.equals(this.type, customRuleResponseData.type)
+ && Objects.equals(this.additionalProperties, customRuleResponseData.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(attributes, id, type, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class CustomRuleResponseData {\n");
+ sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n");
+ sb.append(" id: ").append(toIndentedString(id)).append("\n");
+ sb.append(" type: ").append(toIndentedString(type)).append("\n");
+ sb.append(" additionalProperties: ")
+ .append(toIndentedString(additionalProperties))
+ .append("\n");
+ sb.append('}');
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/CustomRuleRevision.java b/src/main/java/com/datadog/api/client/v2/model/CustomRuleRevision.java
new file mode 100644
index 00000000000..37782822512
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/CustomRuleRevision.java
@@ -0,0 +1,209 @@
+/*
+ * 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 com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+
+/** */
+@JsonPropertyOrder({
+ CustomRuleRevision.JSON_PROPERTY_ATTRIBUTES,
+ CustomRuleRevision.JSON_PROPERTY_ID,
+ CustomRuleRevision.JSON_PROPERTY_TYPE
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class CustomRuleRevision {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_ATTRIBUTES = "attributes";
+ private CustomRuleRevisionAttributes attributes;
+
+ public static final String JSON_PROPERTY_ID = "id";
+ private String id;
+
+ public static final String JSON_PROPERTY_TYPE = "type";
+ private CustomRuleRevisionDataType type;
+
+ public CustomRuleRevision() {}
+
+ @JsonCreator
+ public CustomRuleRevision(
+ @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES)
+ CustomRuleRevisionAttributes attributes,
+ @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id,
+ @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) CustomRuleRevisionDataType type) {
+ this.attributes = attributes;
+ this.unparsed |= attributes.unparsed;
+ this.id = id;
+ this.type = type;
+ this.unparsed |= !type.isValid();
+ }
+
+ public CustomRuleRevision attributes(CustomRuleRevisionAttributes attributes) {
+ this.attributes = attributes;
+ this.unparsed |= attributes.unparsed;
+ return this;
+ }
+
+ /**
+ * Getattributes
+ *
+ * @return attributes
+ */
+ @JsonProperty(JSON_PROPERTY_ATTRIBUTES)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public CustomRuleRevisionAttributes getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(CustomRuleRevisionAttributes attributes) {
+ this.attributes = attributes;
+ }
+
+ public CustomRuleRevision id(String id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Revision identifier
+ *
+ * @return id
+ */
+ @JsonProperty(JSON_PROPERTY_ID)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public CustomRuleRevision type(CustomRuleRevisionDataType type) {
+ this.type = type;
+ this.unparsed |= !type.isValid();
+ return this;
+ }
+
+ /**
+ * Resource type
+ *
+ * @return type
+ */
+ @JsonProperty(JSON_PROPERTY_TYPE)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public CustomRuleRevisionDataType getType() {
+ return type;
+ }
+
+ public void setType(CustomRuleRevisionDataType type) {
+ if (!type.isValid()) {
+ this.unparsed = true;
+ }
+ this.type = type;
+ }
+
+ /**
+ * A container for additional, undeclared properties. This is a holder for any undeclared
+ * properties as specified with the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value. If the property
+ * does not already exist, create it otherwise replace it.
+ *
+ * @param key The arbitrary key to set
+ * @param value The associated value
+ * @return CustomRuleRevision
+ */
+ @JsonAnySetter
+ public CustomRuleRevision putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap();
+ }
+ this.additionalProperties.put(key, value);
+ return this;
+ }
+
+ /**
+ * Return the additional (undeclared) property.
+ *
+ * @return The additional properties
+ */
+ @JsonAnyGetter
+ public Map getAdditionalProperties() {
+ return additionalProperties;
+ }
+
+ /**
+ * Return the additional (undeclared) property with the specified name.
+ *
+ * @param key The arbitrary key to get
+ * @return The specific additional property for the given key
+ */
+ public Object getAdditionalProperty(String key) {
+ if (this.additionalProperties == null) {
+ return null;
+ }
+ return this.additionalProperties.get(key);
+ }
+
+ /** Return true if this CustomRuleRevision object is equal to o. */
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ CustomRuleRevision customRuleRevision = (CustomRuleRevision) o;
+ return Objects.equals(this.attributes, customRuleRevision.attributes)
+ && Objects.equals(this.id, customRuleRevision.id)
+ && Objects.equals(this.type, customRuleRevision.type)
+ && Objects.equals(this.additionalProperties, customRuleRevision.additionalProperties);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(attributes, id, type, additionalProperties);
+ }
+
+ @Override
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("class CustomRuleRevision {\n");
+ sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n");
+ sb.append(" id: ").append(toIndentedString(id)).append("\n");
+ sb.append(" type: ").append(toIndentedString(type)).append("\n");
+ sb.append(" additionalProperties: ")
+ .append(toIndentedString(additionalProperties))
+ .append("\n");
+ sb.append('}');
+ return sb.toString();
+ }
+
+ /**
+ * Convert the given object to string with each line indented by 4 spaces (except the first line).
+ */
+ private String toIndentedString(Object o) {
+ if (o == null) {
+ return "null";
+ }
+ return o.toString().replace("\n", "\n ");
+ }
+}
diff --git a/src/main/java/com/datadog/api/client/v2/model/CustomRuleRevisionAttributes.java b/src/main/java/com/datadog/api/client/v2/model/CustomRuleRevisionAttributes.java
new file mode 100644
index 00000000000..8fd0e2660b7
--- /dev/null
+++ b/src/main/java/com/datadog/api/client/v2/model/CustomRuleRevisionAttributes.java
@@ -0,0 +1,756 @@
+/*
+ * 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 com.datadog.api.client.v2.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import java.time.OffsetDateTime;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+
+/** */
+@JsonPropertyOrder({
+ CustomRuleRevisionAttributes.JSON_PROPERTY_ARGUMENTS,
+ CustomRuleRevisionAttributes.JSON_PROPERTY_CATEGORY,
+ CustomRuleRevisionAttributes.JSON_PROPERTY_CHECKSUM,
+ CustomRuleRevisionAttributes.JSON_PROPERTY_CODE,
+ CustomRuleRevisionAttributes.JSON_PROPERTY_CREATED_AT,
+ CustomRuleRevisionAttributes.JSON_PROPERTY_CREATED_BY,
+ CustomRuleRevisionAttributes.JSON_PROPERTY_CREATION_MESSAGE,
+ CustomRuleRevisionAttributes.JSON_PROPERTY_CVE,
+ CustomRuleRevisionAttributes.JSON_PROPERTY_CWE,
+ CustomRuleRevisionAttributes.JSON_PROPERTY_DESCRIPTION,
+ CustomRuleRevisionAttributes.JSON_PROPERTY_DOCUMENTATION_URL,
+ CustomRuleRevisionAttributes.JSON_PROPERTY_IS_PUBLISHED,
+ CustomRuleRevisionAttributes.JSON_PROPERTY_IS_TESTING,
+ CustomRuleRevisionAttributes.JSON_PROPERTY_LANGUAGE,
+ CustomRuleRevisionAttributes.JSON_PROPERTY_SEVERITY,
+ CustomRuleRevisionAttributes.JSON_PROPERTY_SHORT_DESCRIPTION,
+ CustomRuleRevisionAttributes.JSON_PROPERTY_SHOULD_USE_AI_FIX,
+ CustomRuleRevisionAttributes.JSON_PROPERTY_TAGS,
+ CustomRuleRevisionAttributes.JSON_PROPERTY_TESTS,
+ CustomRuleRevisionAttributes.JSON_PROPERTY_TREE_SITTER_QUERY
+})
+@jakarta.annotation.Generated(
+ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
+public class CustomRuleRevisionAttributes {
+ @JsonIgnore public boolean unparsed = false;
+ public static final String JSON_PROPERTY_ARGUMENTS = "arguments";
+ private List arguments = new ArrayList<>();
+
+ public static final String JSON_PROPERTY_CATEGORY = "category";
+ private CustomRuleRevisionAttributesCategory category;
+
+ public static final String JSON_PROPERTY_CHECKSUM = "checksum";
+ private String checksum;
+
+ public static final String JSON_PROPERTY_CODE = "code";
+ private String code;
+
+ public static final String JSON_PROPERTY_CREATED_AT = "created_at";
+ private OffsetDateTime createdAt;
+
+ public static final String JSON_PROPERTY_CREATED_BY = "created_by";
+ private String createdBy;
+
+ public static final String JSON_PROPERTY_CREATION_MESSAGE = "creation_message";
+ private String creationMessage;
+
+ public static final String JSON_PROPERTY_CVE = "cve";
+ private String cve;
+
+ public static final String JSON_PROPERTY_CWE = "cwe";
+ private String cwe;
+
+ public static final String JSON_PROPERTY_DESCRIPTION = "description";
+ private String description;
+
+ public static final String JSON_PROPERTY_DOCUMENTATION_URL = "documentation_url";
+ private String documentationUrl;
+
+ public static final String JSON_PROPERTY_IS_PUBLISHED = "is_published";
+ private Boolean isPublished;
+
+ public static final String JSON_PROPERTY_IS_TESTING = "is_testing";
+ private Boolean isTesting;
+
+ public static final String JSON_PROPERTY_LANGUAGE = "language";
+ private Language language;
+
+ public static final String JSON_PROPERTY_SEVERITY = "severity";
+ private CustomRuleRevisionAttributesSeverity severity;
+
+ public static final String JSON_PROPERTY_SHORT_DESCRIPTION = "short_description";
+ private String shortDescription;
+
+ public static final String JSON_PROPERTY_SHOULD_USE_AI_FIX = "should_use_ai_fix";
+ private Boolean shouldUseAiFix;
+
+ public static final String JSON_PROPERTY_TAGS = "tags";
+ private List tags = new ArrayList<>();
+
+ public static final String JSON_PROPERTY_TESTS = "tests";
+ private List tests = new ArrayList<>();
+
+ public static final String JSON_PROPERTY_TREE_SITTER_QUERY = "tree_sitter_query";
+ private String treeSitterQuery;
+
+ public CustomRuleRevisionAttributes() {}
+
+ @JsonCreator
+ public CustomRuleRevisionAttributes(
+ @JsonProperty(required = true, value = JSON_PROPERTY_ARGUMENTS) List arguments,
+ @JsonProperty(required = true, value = JSON_PROPERTY_CATEGORY)
+ CustomRuleRevisionAttributesCategory category,
+ @JsonProperty(required = true, value = JSON_PROPERTY_CHECKSUM) String checksum,
+ @JsonProperty(required = true, value = JSON_PROPERTY_CODE) String code,
+ @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_AT) OffsetDateTime createdAt,
+ @JsonProperty(required = true, value = JSON_PROPERTY_CREATED_BY) String createdBy,
+ @JsonProperty(required = true, value = JSON_PROPERTY_CREATION_MESSAGE) String creationMessage,
+ @JsonProperty(required = true, value = JSON_PROPERTY_CVE) String cve,
+ @JsonProperty(required = true, value = JSON_PROPERTY_CWE) String cwe,
+ @JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description,
+ @JsonProperty(required = true, value = JSON_PROPERTY_DOCUMENTATION_URL)
+ String documentationUrl,
+ @JsonProperty(required = true, value = JSON_PROPERTY_IS_PUBLISHED) Boolean isPublished,
+ @JsonProperty(required = true, value = JSON_PROPERTY_IS_TESTING) Boolean isTesting,
+ @JsonProperty(required = true, value = JSON_PROPERTY_LANGUAGE) Language language,
+ @JsonProperty(required = true, value = JSON_PROPERTY_SEVERITY)
+ CustomRuleRevisionAttributesSeverity severity,
+ @JsonProperty(required = true, value = JSON_PROPERTY_SHORT_DESCRIPTION)
+ String shortDescription,
+ @JsonProperty(required = true, value = JSON_PROPERTY_SHOULD_USE_AI_FIX)
+ Boolean shouldUseAiFix,
+ @JsonProperty(required = true, value = JSON_PROPERTY_TAGS) List tags,
+ @JsonProperty(required = true, value = JSON_PROPERTY_TESTS)
+ List tests,
+ @JsonProperty(required = true, value = JSON_PROPERTY_TREE_SITTER_QUERY)
+ String treeSitterQuery) {
+ this.arguments = arguments;
+ this.category = category;
+ this.unparsed |= !category.isValid();
+ this.checksum = checksum;
+ this.code = code;
+ this.createdAt = createdAt;
+ this.createdBy = createdBy;
+ this.creationMessage = creationMessage;
+ this.cve = cve;
+ if (cve != null) {}
+ this.cwe = cwe;
+ if (cwe != null) {}
+ this.description = description;
+ this.documentationUrl = documentationUrl;
+ if (documentationUrl != null) {}
+ this.isPublished = isPublished;
+ this.isTesting = isTesting;
+ this.language = language;
+ this.unparsed |= !language.isValid();
+ this.severity = severity;
+ this.unparsed |= !severity.isValid();
+ this.shortDescription = shortDescription;
+ this.shouldUseAiFix = shouldUseAiFix;
+ this.tags = tags;
+ this.tests = tests;
+ this.treeSitterQuery = treeSitterQuery;
+ }
+
+ public CustomRuleRevisionAttributes arguments(List arguments) {
+ this.arguments = arguments;
+ for (Argument item : arguments) {
+ this.unparsed |= item.unparsed;
+ }
+ return this;
+ }
+
+ public CustomRuleRevisionAttributes addArgumentsItem(Argument argumentsItem) {
+ this.arguments.add(argumentsItem);
+ this.unparsed |= argumentsItem.unparsed;
+ return this;
+ }
+
+ /**
+ * Rule arguments
+ *
+ * @return arguments
+ */
+ @JsonProperty(JSON_PROPERTY_ARGUMENTS)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public List getArguments() {
+ return arguments;
+ }
+
+ public void setArguments(List arguments) {
+ this.arguments = arguments;
+ }
+
+ public CustomRuleRevisionAttributes category(CustomRuleRevisionAttributesCategory category) {
+ this.category = category;
+ this.unparsed |= !category.isValid();
+ return this;
+ }
+
+ /**
+ * Rule category
+ *
+ * @return category
+ */
+ @JsonProperty(JSON_PROPERTY_CATEGORY)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public CustomRuleRevisionAttributesCategory getCategory() {
+ return category;
+ }
+
+ public void setCategory(CustomRuleRevisionAttributesCategory category) {
+ if (!category.isValid()) {
+ this.unparsed = true;
+ }
+ this.category = category;
+ }
+
+ public CustomRuleRevisionAttributes checksum(String checksum) {
+ this.checksum = checksum;
+ return this;
+ }
+
+ /**
+ * Code checksum
+ *
+ * @return checksum
+ */
+ @JsonProperty(JSON_PROPERTY_CHECKSUM)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getChecksum() {
+ return checksum;
+ }
+
+ public void setChecksum(String checksum) {
+ this.checksum = checksum;
+ }
+
+ public CustomRuleRevisionAttributes code(String code) {
+ this.code = code;
+ return this;
+ }
+
+ /**
+ * Rule code
+ *
+ * @return code
+ */
+ @JsonProperty(JSON_PROPERTY_CODE)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getCode() {
+ return code;
+ }
+
+ public void setCode(String code) {
+ this.code = code;
+ }
+
+ public CustomRuleRevisionAttributes createdAt(OffsetDateTime createdAt) {
+ this.createdAt = createdAt;
+ return this;
+ }
+
+ /**
+ * Creation timestamp
+ *
+ * @return createdAt
+ */
+ @JsonProperty(JSON_PROPERTY_CREATED_AT)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public OffsetDateTime getCreatedAt() {
+ return createdAt;
+ }
+
+ public void setCreatedAt(OffsetDateTime createdAt) {
+ this.createdAt = createdAt;
+ }
+
+ public CustomRuleRevisionAttributes createdBy(String createdBy) {
+ this.createdBy = createdBy;
+ return this;
+ }
+
+ /**
+ * Creator identifier
+ *
+ * @return createdBy
+ */
+ @JsonProperty(JSON_PROPERTY_CREATED_BY)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getCreatedBy() {
+ return createdBy;
+ }
+
+ public void setCreatedBy(String createdBy) {
+ this.createdBy = createdBy;
+ }
+
+ public CustomRuleRevisionAttributes creationMessage(String creationMessage) {
+ this.creationMessage = creationMessage;
+ return this;
+ }
+
+ /**
+ * Revision creation message
+ *
+ * @return creationMessage
+ */
+ @JsonProperty(JSON_PROPERTY_CREATION_MESSAGE)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getCreationMessage() {
+ return creationMessage;
+ }
+
+ public void setCreationMessage(String creationMessage) {
+ this.creationMessage = creationMessage;
+ }
+
+ public CustomRuleRevisionAttributes cve(String cve) {
+ this.cve = cve;
+ if (cve != null) {}
+ return this;
+ }
+
+ /**
+ * Associated CVE
+ *
+ * @return cve
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_CVE)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getCve() {
+ return cve;
+ }
+
+ public void setCve(String cve) {
+ this.cve = cve;
+ }
+
+ public CustomRuleRevisionAttributes cwe(String cwe) {
+ this.cwe = cwe;
+ if (cwe != null) {}
+ return this;
+ }
+
+ /**
+ * Associated CWE
+ *
+ * @return cwe
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_CWE)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getCwe() {
+ return cwe;
+ }
+
+ public void setCwe(String cwe) {
+ this.cwe = cwe;
+ }
+
+ public CustomRuleRevisionAttributes description(String description) {
+ this.description = description;
+ return this;
+ }
+
+ /**
+ * Full description
+ *
+ * @return description
+ */
+ @JsonProperty(JSON_PROPERTY_DESCRIPTION)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ public CustomRuleRevisionAttributes documentationUrl(String documentationUrl) {
+ this.documentationUrl = documentationUrl;
+ if (documentationUrl != null) {}
+ return this;
+ }
+
+ /**
+ * Documentation URL
+ *
+ * @return documentationUrl
+ */
+ @jakarta.annotation.Nullable
+ @JsonProperty(JSON_PROPERTY_DOCUMENTATION_URL)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getDocumentationUrl() {
+ return documentationUrl;
+ }
+
+ public void setDocumentationUrl(String documentationUrl) {
+ this.documentationUrl = documentationUrl;
+ }
+
+ public CustomRuleRevisionAttributes isPublished(Boolean isPublished) {
+ this.isPublished = isPublished;
+ return this;
+ }
+
+ /**
+ * Whether the revision is published
+ *
+ * @return isPublished
+ */
+ @JsonProperty(JSON_PROPERTY_IS_PUBLISHED)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public Boolean getIsPublished() {
+ return isPublished;
+ }
+
+ public void setIsPublished(Boolean isPublished) {
+ this.isPublished = isPublished;
+ }
+
+ public CustomRuleRevisionAttributes isTesting(Boolean isTesting) {
+ this.isTesting = isTesting;
+ return this;
+ }
+
+ /**
+ * Whether this is a testing revision
+ *
+ * @return isTesting
+ */
+ @JsonProperty(JSON_PROPERTY_IS_TESTING)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public Boolean getIsTesting() {
+ return isTesting;
+ }
+
+ public void setIsTesting(Boolean isTesting) {
+ this.isTesting = isTesting;
+ }
+
+ public CustomRuleRevisionAttributes language(Language language) {
+ this.language = language;
+ this.unparsed |= !language.isValid();
+ return this;
+ }
+
+ /**
+ * Programming language
+ *
+ * @return language
+ */
+ @JsonProperty(JSON_PROPERTY_LANGUAGE)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public Language getLanguage() {
+ return language;
+ }
+
+ public void setLanguage(Language language) {
+ if (!language.isValid()) {
+ this.unparsed = true;
+ }
+ this.language = language;
+ }
+
+ public CustomRuleRevisionAttributes severity(CustomRuleRevisionAttributesSeverity severity) {
+ this.severity = severity;
+ this.unparsed |= !severity.isValid();
+ return this;
+ }
+
+ /**
+ * Rule severity
+ *
+ * @return severity
+ */
+ @JsonProperty(JSON_PROPERTY_SEVERITY)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public CustomRuleRevisionAttributesSeverity getSeverity() {
+ return severity;
+ }
+
+ public void setSeverity(CustomRuleRevisionAttributesSeverity severity) {
+ if (!severity.isValid()) {
+ this.unparsed = true;
+ }
+ this.severity = severity;
+ }
+
+ public CustomRuleRevisionAttributes shortDescription(String shortDescription) {
+ this.shortDescription = shortDescription;
+ return this;
+ }
+
+ /**
+ * Short description
+ *
+ * @return shortDescription
+ */
+ @JsonProperty(JSON_PROPERTY_SHORT_DESCRIPTION)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getShortDescription() {
+ return shortDescription;
+ }
+
+ public void setShortDescription(String shortDescription) {
+ this.shortDescription = shortDescription;
+ }
+
+ public CustomRuleRevisionAttributes shouldUseAiFix(Boolean shouldUseAiFix) {
+ this.shouldUseAiFix = shouldUseAiFix;
+ return this;
+ }
+
+ /**
+ * Whether to use AI for fixes
+ *
+ * @return shouldUseAiFix
+ */
+ @JsonProperty(JSON_PROPERTY_SHOULD_USE_AI_FIX)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public Boolean getShouldUseAiFix() {
+ return shouldUseAiFix;
+ }
+
+ public void setShouldUseAiFix(Boolean shouldUseAiFix) {
+ this.shouldUseAiFix = shouldUseAiFix;
+ }
+
+ public CustomRuleRevisionAttributes tags(List tags) {
+ this.tags = tags;
+ return this;
+ }
+
+ public CustomRuleRevisionAttributes addTagsItem(String tagsItem) {
+ this.tags.add(tagsItem);
+ return this;
+ }
+
+ /**
+ * Rule tags
+ *
+ * @return tags
+ */
+ @JsonProperty(JSON_PROPERTY_TAGS)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public List getTags() {
+ return tags;
+ }
+
+ public void setTags(List tags) {
+ this.tags = tags;
+ }
+
+ public CustomRuleRevisionAttributes tests(List tests) {
+ this.tests = tests;
+ for (CustomRuleRevisionTest item : tests) {
+ this.unparsed |= item.unparsed;
+ }
+ return this;
+ }
+
+ public CustomRuleRevisionAttributes addTestsItem(CustomRuleRevisionTest testsItem) {
+ this.tests.add(testsItem);
+ this.unparsed |= testsItem.unparsed;
+ return this;
+ }
+
+ /**
+ * Rule tests
+ *
+ * @return tests
+ */
+ @JsonProperty(JSON_PROPERTY_TESTS)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public List getTests() {
+ return tests;
+ }
+
+ public void setTests(List tests) {
+ this.tests = tests;
+ }
+
+ public CustomRuleRevisionAttributes treeSitterQuery(String treeSitterQuery) {
+ this.treeSitterQuery = treeSitterQuery;
+ return this;
+ }
+
+ /**
+ * Tree-sitter query
+ *
+ * @return treeSitterQuery
+ */
+ @JsonProperty(JSON_PROPERTY_TREE_SITTER_QUERY)
+ @JsonInclude(value = JsonInclude.Include.ALWAYS)
+ public String getTreeSitterQuery() {
+ return treeSitterQuery;
+ }
+
+ public void setTreeSitterQuery(String treeSitterQuery) {
+ this.treeSitterQuery = treeSitterQuery;
+ }
+
+ /**
+ * A container for additional, undeclared properties. This is a holder for any undeclared
+ * properties as specified with the 'additionalProperties' keyword in the OAS document.
+ */
+ private Map additionalProperties;
+
+ /**
+ * Set the additional (undeclared) property with the specified name and value. If the property
+ * does not already exist, create it otherwise replace it.
+ *
+ * @param key The arbitrary key to set
+ * @param value The associated value
+ * @return CustomRuleRevisionAttributes
+ */
+ @JsonAnySetter
+ public CustomRuleRevisionAttributes putAdditionalProperty(String key, Object value) {
+ if (this.additionalProperties == null) {
+ this.additionalProperties = new HashMap