diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 25a447b57951..0eb8762ac2b2 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -4884,6 +4884,8 @@ components: - sds_scanned_bytes_usage - serverless_apps_usage - serverless_apps_apm_usage + - siem_12mo_retention_usage + - siem_6mo_retention_usage - siem_analyzed_logs_add_on_usage - siem_ingested_bytes_usage - snmp_usage @@ -4973,6 +4975,8 @@ components: - SDS_SCANNED_BYTES_USAGE - SERVERLESS_APPS_USAGE - SERVERLESS_APPS_APM_USAGE + - SIEM_12MO_RETENTION_USAGE + - SIEM_6MO_RETENTION_USAGE - SIEM_ANALYZED_LOGS_ADD_ON_USAGE - SIEM_INGESTED_BYTES_USAGE - SNMP_USAGE @@ -9605,6 +9609,10 @@ components: - rum_browser_mobile_sessions_percentage - ingested_spans_bytes_usage - ingested_spans_bytes_percentage + - siem_12mo_retention_usage + - siem_12mo_retention_percentage + - siem_6mo_retention_usage + - siem_6mo_retention_percentage - siem_analyzed_logs_add_on_usage - siem_analyzed_logs_add_on_percentage - siem_ingested_bytes_usage @@ -9774,6 +9782,10 @@ components: - RUM_BROWSER_MOBILE_SESSIONS_PERCENTAGE - INGESTED_SPANS_BYTES_USAGE - INGESTED_SPANS_BYTES_PERCENTAGE + - SIEM_12MO_RETENTION_USAGE + - SIEM_12MO_RETENTION_PERCENTAGE + - SIEM_6MO_RETENTION_USAGE + - SIEM_6MO_RETENTION_PERCENTAGE - SIEM_ANALYZED_LOGS_ADD_ON_USAGE - SIEM_ANALYZED_LOGS_ADD_ON_PERCENTAGE - SIEM_INGESTED_BYTES_USAGE @@ -10403,6 +10415,22 @@ components: description: The total Serverless Apps usage by tag(s). format: double type: number + siem_12mo_retention_percentage: + description: The percentage of Cloud SIEM Indexed Logs (12-month retention) usage by tag(s). + format: double + type: number + siem_12mo_retention_usage: + description: The Cloud SIEM Indexed Logs (12-month retention) usage by tag(s). + format: double + type: number + siem_6mo_retention_percentage: + description: The percentage of Cloud SIEM Indexed Logs (6-month retention) usage by tag(s). + format: double + type: number + siem_6mo_retention_usage: + description: The Cloud SIEM Indexed Logs (6-month retention) usage by tag(s). + format: double + type: number siem_analyzed_logs_add_on_percentage: description: The percentage of log events analyzed by Cloud SIEM usage by tag(s). format: double @@ -22467,6 +22495,10 @@ components: description: Shows the sum of all Cloud Security Information and Event Management events over all hours in the current date for the given org. format: int64 type: integer + cloud_siem_indexed_logs_sum: + description: Shows the sum of all Cloud SIEM Indexed Logs over all hours in the current date for the given org. + format: int64 + type: integer code_analysis_sa_committers_hwm: description: Shows the high-water mark of all Static Analysis committers over all hours in the current date for the given org. format: int64 @@ -23231,6 +23263,14 @@ components: description: Shows the average number of Serverless Apps for Azure and Google Cloud for the given date and given org. format: int64 type: integer + siem_12mo_retention_sum: + description: Shows the sum of Cloud SIEM Indexed Logs (12-month retention) over all hours in the current date for the given org. + format: int64 + type: integer + siem_6mo_retention_sum: + description: Shows the sum of Cloud SIEM Indexed Logs (6-month retention) over all hours in the current date for the given org. + format: int64 + type: integer siem_analyzed_logs_add_on_count_sum: description: Shows the sum of all log events analyzed by Cloud SIEM over all hours in the current date for the given org. format: int64 @@ -23480,6 +23520,10 @@ components: description: Shows the sum of all Cloud Security Information and Event Management events over all hours in the current date for the given org. format: int64 type: integer + cloud_siem_indexed_logs_sum: + description: Shows the sum of all Cloud SIEM Indexed Logs over all hours in the current date for the given org. + format: int64 + type: integer code_analysis_sa_committers_hwm: description: Shows the high-water mark of all Static Analysis committers over all hours in the current date for the given org. format: int64 @@ -24256,6 +24300,14 @@ components: description: Shows the average number of Serverless Apps for Azure and Google Cloud for the given date and given org. format: int64 type: integer + siem_12mo_retention_sum: + description: Shows the sum of Cloud SIEM Indexed Logs (12-month retention) over all hours in the current date for the given org. + format: int64 + type: integer + siem_6mo_retention_sum: + description: Shows the sum of Cloud SIEM Indexed Logs (6-month retention) over all hours in the current date for the given org. + format: int64 + type: integer siem_analyzed_logs_add_on_count_sum: description: Shows the sum of all log events analyzed by Cloud SIEM over all hours in the current date for the given org. format: int64 @@ -24503,6 +24555,10 @@ components: description: Shows the sum of all Cloud Security Information and Event Management events over all hours in the current month for all organizations. format: int64 type: integer + cloud_siem_indexed_logs_agg_sum: + description: Shows the sum of all Cloud SIEM Indexed Logs over all hours in the current month for all organizations. + format: int64 + type: integer code_analysis_sa_committers_hwm_sum: description: Shows the high-water mark of all Static Analysis committers over all hours in the current month for all organizations. format: int64 @@ -25299,6 +25355,14 @@ components: description: Sum of the average number of Serverless Apps for Azure and Google Cloud in the current month for all organizations. format: int64 type: integer + siem_12mo_retention_agg_sum: + description: Shows the sum of Cloud SIEM Indexed Logs (12-month retention) over all hours in the current month for all organizations. + format: int64 + type: integer + siem_6mo_retention_agg_sum: + description: Shows the sum of Cloud SIEM Indexed Logs (6-month retention) over all hours in the current month for all organizations. + format: int64 + type: integer siem_analyzed_logs_add_on_count_agg_sum: description: Shows the sum of all log events analyzed by Cloud SIEM over all hours in the current month for all organizations. format: int64 diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 3bd4dc4902da..2692eaaf1cfc 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -155,6 +155,14 @@ components: required: false schema: $ref: "#/components/schemas/ApplicationKeysSort" + ApplicationSecurityPolicyIDParam: + description: The ID of the policy. + example: recommended + in: path + name: policy_id + required: true + schema: + type: string ApplicationSecurityWafCustomRuleIDParam: description: The ID of the custom rule. example: 3b5-v82-ns6 @@ -3603,6 +3611,729 @@ components: - id - base_severity type: object + AiCustomRuleDataType: + description: AI custom rule resource type. + enum: [ai_rule] + example: ai_rule + type: string + x-enum-varnames: + - AI_RULE + AiCustomRuleItem: + description: An AI custom rule embedded within a ruleset response. + properties: + created_at: + description: The creation timestamp. + example: "2024-01-01T00:00:00+00:00" + format: date-time + type: string + created_by: + description: The identifier of the user who created the rule. + example: example-handle + type: string + last_revision: + $ref: "#/components/schemas/AiCustomRuleRevisionResponseAttributes" + description: The most recent revision of the rule. + nullable: true + name: + description: The rule name. + example: my-ai-rule + type: string + required: + - name + - created_at + - created_by + - last_revision + type: object + AiCustomRuleRequest: + description: Request body for creating an AI custom rule. + properties: + data: + $ref: "#/components/schemas/AiCustomRuleRequestData" + type: object + AiCustomRuleRequestAttributes: + description: Attributes for creating an AI custom rule. + properties: + name: + description: The rule name. + example: my-ai-rule + type: string + type: object + AiCustomRuleRequestData: + description: Request data for creating an AI custom rule. + properties: + attributes: + $ref: "#/components/schemas/AiCustomRuleRequestAttributes" + id: + description: The rule identifier, which must match the name. + example: my-ai-rule + type: string + type: + $ref: "#/components/schemas/AiCustomRuleDataType" + type: object + AiCustomRuleResponse: + description: Response containing a single AI custom rule. + properties: + data: + $ref: "#/components/schemas/AiCustomRuleResponseData" + required: + - data + type: object + AiCustomRuleResponseData: + description: Response data for an AI custom rule. + properties: + attributes: + $ref: "#/components/schemas/AiCustomRuleItem" + id: + description: The rule identifier. + example: my-ai-rule + type: string + type: + $ref: "#/components/schemas/AiCustomRuleDataType" + required: + - id + - type + - attributes + type: object + AiCustomRuleRevisionDataType: + description: AI custom rule revision resource type. + enum: [ai_rule_revision] + example: ai_rule_revision + type: string + x-enum-varnames: + - AI_RULE_REVISION + AiCustomRuleRevisionExecutionMode: + description: The execution mode for an AI rule revision. + enum: [auto, manual, always] + example: auto + type: string + x-enum-varnames: + - AUTO + - MANUAL + - ALWAYS + AiCustomRuleRevisionRequest: + description: Request body for creating an AI custom rule revision. + properties: + data: + $ref: "#/components/schemas/AiCustomRuleRevisionRequestData" + type: object + AiCustomRuleRevisionRequestAttributes: + description: Attributes for creating an AI custom rule revision. + properties: + category: + $ref: "#/components/schemas/CustomRuleRevisionAttributesCategory" + content: + description: Base64-encoded AI model content for this revision. + example: Content + type: string + cwe: + description: The associated CWE identifier. + example: "79" + nullable: true + type: string + description: + description: Base64-encoded full description. + example: Ruleset description + type: string + directories: + description: Directory patterns this rule applies to. + example: [] + items: + type: string + type: array + execution_mode: + $ref: "#/components/schemas/AiCustomRuleRevisionExecutionMode" + globs: + description: File glob patterns this rule applies to. + example: + - "**/*.py" + items: + type: string + type: array + is_published: + description: Whether this revision is published. + example: false + type: boolean + is_testing: + description: Whether this revision is for testing only. + example: false + type: boolean + severity: + $ref: "#/components/schemas/CustomRuleRevisionAttributesSeverity" + short_description: + description: Base64-encoded short description. + example: Ruleset short description + type: string + version_id: + description: The version identifier for this revision. + example: 1 + format: int64 + type: integer + required: + - short_description + - description + - content + - globs + - directories + - execution_mode + - severity + - category + - is_published + - is_testing + type: object + AiCustomRuleRevisionRequestData: + description: Request data for creating an AI custom rule revision. + properties: + attributes: + $ref: "#/components/schemas/AiCustomRuleRevisionRequestAttributes" + id: + description: The revision identifier. + example: revision-abc-123 + type: string + type: + $ref: "#/components/schemas/AiCustomRuleRevisionDataType" + type: object + AiCustomRuleRevisionResponse: + description: Response containing a single AI custom rule revision. + properties: + data: + $ref: "#/components/schemas/AiCustomRuleRevisionResponseData" + required: + - data + type: object + AiCustomRuleRevisionResponseAttributes: + description: Response attributes of an AI custom rule revision. + properties: + category: + $ref: "#/components/schemas/CustomRuleRevisionAttributesCategory" + checksum: + description: Checksum of the revision content. + example: abc123def456 + type: string + content: + description: Base64-encoded AI model content for this revision. + example: Content + type: string + created_at: + description: The creation timestamp. + example: "2024-01-01T00:00:00+00:00" + format: date-time + type: string + created_by: + description: The identifier of the user who created the revision. + example: example-handle + type: string + cwe: + description: The associated CWE identifier. + example: "79" + nullable: true + type: string + description: + description: Base64-encoded full description. + example: Ruleset description + type: string + directories: + description: Directory patterns this rule applies to. + example: [] + items: + type: string + type: array + execution_mode: + $ref: "#/components/schemas/AiCustomRuleRevisionExecutionMode" + globs: + description: File glob patterns this rule applies to. + example: + - "**/*.py" + items: + type: string + type: array + is_default: + description: Whether this is a default Datadog rule. + example: false + type: boolean + is_published: + description: Whether this revision is published. + example: false + type: boolean + is_testing: + description: Whether this revision is for testing only. + example: false + type: boolean + severity: + $ref: "#/components/schemas/CustomRuleRevisionAttributesSeverity" + short_description: + description: Base64-encoded short description. + example: Ruleset short description + type: string + version_id: + description: The version identifier for this revision. + example: 1 + format: int64 + type: integer + required: + - version_id + - short_description + - description + - content + - globs + - directories + - execution_mode + - cwe + - checksum + - created_at + - created_by + - severity + - category + - is_published + - is_testing + - is_default + type: object + AiCustomRuleRevisionResponseData: + description: Response data for an AI custom rule revision. + properties: + attributes: + $ref: "#/components/schemas/AiCustomRuleRevisionResponseAttributes" + id: + description: The revision identifier. + example: revision-abc-123 + type: string + type: + $ref: "#/components/schemas/AiCustomRuleRevisionDataType" + required: + - id + - type + - attributes + type: object + AiCustomRuleRevisionsResponse: + description: Response containing a list of AI custom rule revisions. + properties: + data: + description: The list of AI custom rule revisions. + items: + $ref: "#/components/schemas/AiCustomRuleRevisionResponseData" + type: array + required: + - data + type: object + AiCustomRulesetDataType: + description: AI custom ruleset resource type. + enum: [ai_ruleset] + example: ai_ruleset + type: string + x-enum-varnames: + - AI_RULESET + AiCustomRulesetRequest: + description: Request body for creating an AI custom ruleset. + properties: + data: + $ref: "#/components/schemas/AiCustomRulesetRequestData" + type: object + AiCustomRulesetRequestAttributes: + description: Attributes for creating an AI custom ruleset. + properties: + description: + description: Base64-encoded full description of the ruleset. + example: Ruleset description + type: string + name: + description: The ruleset name. + example: my-ai-ruleset + type: string + short_description: + description: Base64-encoded short description of the ruleset. + example: Ruleset short description + type: string + required: + - name + - short_description + - description + type: object + AiCustomRulesetRequestData: + description: Request data for creating an AI custom ruleset. + properties: + attributes: + $ref: "#/components/schemas/AiCustomRulesetRequestAttributes" + id: + description: The ruleset identifier, which must match the name. + example: my-ai-ruleset + type: string + type: + $ref: "#/components/schemas/AiCustomRulesetDataType" + type: object + AiCustomRulesetResponse: + description: Response containing a single AI custom ruleset. + properties: + data: + $ref: "#/components/schemas/AiCustomRulesetResponseData" + required: + - data + type: object + AiCustomRulesetResponseAttributes: + description: Response attributes of an AI custom ruleset. + properties: + created_at: + description: The creation timestamp. + example: "2024-01-01T00:00:00+00:00" + format: date-time + type: string + created_by: + description: The identifier of the user who created the ruleset. + example: example-handle + type: string + description: + description: Base64-encoded full description of the ruleset. + example: Ruleset description + type: string + name: + description: The ruleset name. + example: my-ai-ruleset + type: string + rules: + description: The rules contained in the ruleset. + items: + $ref: "#/components/schemas/AiCustomRuleItem" + nullable: true + type: array + short_description: + description: Base64-encoded short description of the ruleset. + example: Ruleset short description + type: string + required: + - name + - short_description + - description + - created_at + - created_by + - rules + type: object + AiCustomRulesetResponseData: + description: Response data for an AI custom ruleset. + properties: + attributes: + $ref: "#/components/schemas/AiCustomRulesetResponseAttributes" + id: + description: The ruleset identifier. + example: my-ai-ruleset + type: string + type: + $ref: "#/components/schemas/AiCustomRulesetDataType" + required: + - id + - type + - attributes + type: object + AiCustomRulesetUpdateAttributes: + description: Attributes for updating an AI custom ruleset. + properties: + description: + description: Base64-encoded full description of the ruleset. + example: Ruleset description + type: string + name: + description: The ruleset name. + example: my-ai-ruleset + type: string + short_description: + description: Base64-encoded short description of the ruleset. + example: Ruleset short description + type: string + type: object + AiCustomRulesetUpdateData: + description: Request data for updating an AI custom ruleset. + properties: + attributes: + $ref: "#/components/schemas/AiCustomRulesetUpdateAttributes" + id: + description: The ruleset identifier. + example: my-ai-ruleset + type: string + type: + $ref: "#/components/schemas/AiCustomRulesetDataType" + type: object + AiCustomRulesetUpdateRequest: + description: Request body for updating an AI custom ruleset. + properties: + data: + $ref: "#/components/schemas/AiCustomRulesetUpdateData" + type: object + AiCustomRulesetsResponse: + description: Response containing a list of AI custom rulesets. + properties: + data: + description: The list of AI custom rulesets. + items: + $ref: "#/components/schemas/AiCustomRulesetResponseData" + type: array + required: + - data + type: object + AiMemoryViolationResultDataType: + description: AI memory violation result resource type. + enum: [ai_memory_violation_result] + example: ai_memory_violation_result + type: string + x-enum-varnames: + - AI_MEMORY_VIOLATION_RESULT + AiMemoryViolationResultRequest: + description: Request body for creating an AI memory violation result. + properties: + data: + $ref: "#/components/schemas/AiMemoryViolationResultRequestData" + type: object + AiMemoryViolationResultRequestAttributes: + description: Attributes for creating an AI memory violation result. + properties: + line: + description: The line number where the violation was found. + example: 10 + format: int64 + type: integer + message: + description: A message explaining the violation result. + example: This is a false positive because the input is sanitized. + type: string + name: + description: The file path where the violation was found. + example: src/main.py + type: string + repository_id: + description: The repository identifier. + example: my-repo + type: string + rule: + description: The rule identifier in the format ruleset/rule. + example: my-ai-ruleset/my-ai-rule + type: string + sha: + description: The git commit SHA where the violation was found. + example: abc123def456789012345678901234567890abcd + type: string + type: + $ref: "#/components/schemas/AiMemoryViolationType" + required: + - rule + - repository_id + - sha + - name + - line + - type + - message + type: object + AiMemoryViolationResultRequestData: + description: Request data for creating an AI memory violation result. + properties: + attributes: + $ref: "#/components/schemas/AiMemoryViolationResultRequestAttributes" + id: + description: The violation result identifier. + example: violation-abc + type: string + type: + $ref: "#/components/schemas/AiMemoryViolationResultDataType" + type: object + AiMemoryViolationResultResponseAttributes: + description: Response attributes of an AI memory violation result. + properties: + created_at: + description: The creation timestamp. + example: "2024-01-01T00:00:00+00:00" + format: date-time + type: string + created_by: + description: The identifier of the user who created the result. + example: example-handle + type: string + line: + description: The line number where the violation was found. + example: 10 + format: int64 + type: integer + message: + description: A message explaining the violation result. + example: This is a false positive because the input is sanitized. + type: string + name: + description: The file path where the violation was found. + example: src/main.py + type: string + repository_id: + description: The repository identifier. + example: my-repo + type: string + rule: + description: The rule identifier in the format ruleset/rule. + example: my-ai-ruleset/my-ai-rule + type: string + sha: + description: The git commit SHA where the violation was found. + example: abc123def456789012345678901234567890abcd + type: string + type: + $ref: "#/components/schemas/AiMemoryViolationType" + required: + - rule + - repository_id + - sha + - name + - line + - created_at + - created_by + - type + - message + type: object + AiMemoryViolationResultResponseData: + description: Response data for an AI memory violation result. + properties: + attributes: + $ref: "#/components/schemas/AiMemoryViolationResultResponseAttributes" + id: + description: The numeric identifier of the violation result. + example: "42" + type: string + type: + $ref: "#/components/schemas/AiMemoryViolationResultDataType" + required: + - id + - type + - attributes + type: object + AiMemoryViolationResultsResponse: + description: Response containing a list of AI memory violation results. + properties: + data: + description: The list of AI memory violation results. + items: + $ref: "#/components/schemas/AiMemoryViolationResultResponseData" + type: array + required: + - data + type: object + AiMemoryViolationType: + description: The type of AI memory violation result indicating whether it is a true positive or false positive. + enum: [TP, FP] + example: FP + type: string + x-enum-varnames: + - TP + - FP + AiPromptDataType: + description: AI prompt resource type. + enum: [ai_prompt] + example: ai_prompt + type: string + x-enum-varnames: + - AI_PROMPT + AiPromptResponseAttributes: + description: Response attributes of an AI prompt. + properties: + category: + $ref: "#/components/schemas/CustomRuleRevisionAttributesCategory" + checksum: + description: Checksum of the prompt content. + example: abc123 + type: string + content: + description: Base64-encoded AI prompt content. + example: Content + type: string + cwe: + description: The CWE identifier associated with this prompt. + example: "79" + type: string + description: + description: Base64-encoded full description. + example: Ruleset description + type: string + directories: + description: Directory patterns this prompt applies to. + example: [] + items: + type: string + type: array + execution_mode: + $ref: "#/components/schemas/AiCustomRuleRevisionExecutionMode" + file_search_keywords: + description: Keywords used to search for relevant files. + example: + - import + items: + type: string + type: array + globs: + description: File glob patterns this prompt applies to. + example: + - "**/*.py" + items: + type: string + type: array + is_default: + description: Whether this is a default Datadog prompt. + example: false + type: boolean + is_testing: + description: Whether this prompt is for testing only. + example: false + type: boolean + language: + $ref: "#/components/schemas/Language" + result_keywords_exclude: + description: Keywords to exclude from results. + example: [] + items: + type: string + type: array + rule_version: + description: The version of the rule this prompt is associated with. + example: "1" + type: string + severity: + $ref: "#/components/schemas/CustomRuleRevisionAttributesSeverity" + short_description: + description: Base64-encoded short description. + example: Ruleset short description + type: string + required: + - rule_version + - globs + - short_description + - description + - severity + - category + - file_search_keywords + - result_keywords_exclude + - content + - checksum + - execution_mode + - directories + - is_testing + - is_default + type: object + AiPromptResponseData: + description: Response data for an AI prompt. + properties: + attributes: + $ref: "#/components/schemas/AiPromptResponseAttributes" + id: + description: The prompt identifier. + example: my-ai-ruleset/my-ai-rule + type: string + type: + $ref: "#/components/schemas/AiPromptDataType" + required: + - id + - type + - attributes + type: object + AiPromptsResponse: + description: Response containing a list of AI prompts. + properties: + data: + description: The list of AI prompts. + items: + $ref: "#/components/schemas/AiPromptResponseData" + type: array + required: + - data + type: object AlertEventAttributes: description: Alert event attributes. properties: @@ -4114,6 +4845,312 @@ components: x-enum-varnames: - FEATURE_GATE - CANARY + AnalysisEdit: + description: A single edit operation within a fix suggestion for a rule violation. + properties: + content: + description: The content to insert or replace at the specified position, if applicable. + example: "safe_alternative()" + nullable: true + type: string + edit_type: + $ref: "#/components/schemas/AnalysisEditType" + end: + $ref: "#/components/schemas/AnalysisPosition" + description: The end position of the edit, or null for pure insertions. + nullable: true + start: + $ref: "#/components/schemas/AnalysisPosition" + required: + - start + - end + - edit_type + - content + type: object + AnalysisEditType: + default: ADD + description: The type of code edit to apply when fixing a violation. + enum: + - ADD + - UPDATE + - REMOVE + example: ADD + type: string + x-enum-varnames: + - ADD + - UPDATE + - REMOVE + AnalysisFix: + description: A fix suggestion for a rule violation, consisting of one or more edit operations. + properties: + description: + description: A human-readable description of what the fix does. + example: Replace with a safe alternative. + type: string + edits: + description: The list of edit operations that constitute the fix. + items: + $ref: "#/components/schemas/AnalysisEdit" + type: array + required: + - description + - edits + type: object + AnalysisPosition: + description: A position in source code, identified by line and column numbers. + properties: + col: + description: The column number in the source file (1-based). + example: 5 + format: int64 + type: integer + line: + description: The line number in the source file (1-based). + example: 10 + format: int64 + type: integer + required: + - line + - col + type: object + AnalysisRequest: + description: The request payload for running static analysis on source code. + properties: + data: + $ref: "#/components/schemas/AnalysisRequestData" + required: + - data + type: object + AnalysisRequestData: + description: The primary data object in the analysis request. + properties: + attributes: + $ref: "#/components/schemas/AnalysisRequestDataAttributes" + id: + description: An optional identifier for the analysis request resource. + type: string + type: + $ref: "#/components/schemas/AnalysisRequestDataType" + required: + - type + - attributes + type: object + AnalysisRequestDataAttributes: + description: The attributes of the analysis request, containing the source code and rules to apply. + properties: + code: + description: The base64-encoded source code to analyze. + example: aW1wb3J0IHN5cw== + type: string + file_encoding: + description: The encoding of the source code file (must be `utf-8`). + example: utf-8 + type: string + filename: + description: The name of the file being analyzed. + example: test.py + type: string + language: + description: The programming language of the source code. + example: python + type: string + rules: + description: The list of static analysis rules to apply during analysis. + items: + $ref: "#/components/schemas/AnalysisRequestRule" + type: array + required: + - code + - file_encoding + - filename + - language + - rules + type: object + AnalysisRequestDataType: + default: analysis_request + description: Analysis request resource type. + enum: + - analysis_request + example: analysis_request + type: string + x-enum-varnames: + - ANALYSIS_REQUEST + AnalysisRequestRule: + description: A static analysis rule to apply during code analysis. + properties: + category: + description: The category of the rule (for example, `BEST_PRACTICES`, `SECURITY`). + example: BEST_PRACTICES + type: string + checksum: + description: A checksum of the rule definition. + example: abc123def456 + type: string + code: + description: The base64-encoded rule implementation code. + example: ZnVuY3Rpb24gdmlzaXQobm9kZSkge30= + type: string + entity_checked: + description: The code entity type checked by the rule, applicable when rule type is `AST_CHECK`. + nullable: true + type: string + id: + description: The unique identifier of the rule. + example: python-best-practices/no-exit + type: string + language: + description: The programming language this rule targets. + example: python + type: string + regex: + description: A base64-encoded regex pattern used by the rule, applicable when rule type is `REGEX`. + nullable: true + type: string + severity: + description: The severity of findings from this rule (for example, `ERROR`, `WARNING`). + example: WARNING + type: string + tree_sitter_query: + description: The base64-encoded tree-sitter query used by the rule. + example: KGNhbGwgbmFtZTogKGF0dHJpYnV0ZSkpQHZhbA== + type: string + type: + description: The rule type indicating the detection mechanism (for example, `TREE_SITTER_QUERY`). + example: TREE_SITTER_QUERY + type: string + required: + - id + - category + - checksum + - language + - severity + - tree_sitter_query + - type + - code + type: object + AnalysisResponse: + description: The response payload from running static analysis on source code. + properties: + data: + $ref: "#/components/schemas/AnalysisResponseData" + required: + - data + type: object + AnalysisResponseData: + description: The primary data object in the analysis response. + properties: + attributes: + $ref: "#/components/schemas/AnalysisResponseDataAttributes" + id: + description: The unique identifier of the analysis response resource. + example: abc-123 + type: string + type: + $ref: "#/components/schemas/AnalysisResponseDataType" + required: + - id + - type + - attributes + type: object + AnalysisResponseDataAttributes: + description: The attributes of the analysis response, containing rule results and any top-level errors. + properties: + errors: + description: Top-level error messages encountered during the analysis operation. + example: [] + items: + type: string + type: array + rule_responses: + description: The list of results for each static analysis rule applied during analysis. + items: + $ref: "#/components/schemas/AnalysisRuleResponse" + type: array + required: + - rule_responses + - errors + type: object + AnalysisResponseDataType: + default: server_request + description: Analysis response resource type. + enum: + - server_request + example: server_request + type: string + x-enum-varnames: + - SERVER_REQUEST + AnalysisRuleResponse: + description: The result of applying a single static analysis rule to the analyzed source code. + properties: + errors: + description: A list of error messages encountered while executing the rule. + example: [] + items: + type: string + type: array + execution_error: + description: An error message if the rule execution failed, or null if execution succeeded. + example: + nullable: true + type: string + execution_time_ms: + description: The time taken to execute the rule, in milliseconds. + example: 42 + format: int64 + type: integer + identifier: + description: The identifier of the rule that produced this response. + example: python-best-practices/no-exit + type: string + output: + description: The raw output produced by the rule engine during execution. + example: "" + type: string + violations: + description: The list of violations found by this rule. + items: + $ref: "#/components/schemas/AnalysisViolation" + type: array + required: + - errors + - execution_error + - execution_time_ms + - identifier + - output + - violations + type: object + AnalysisViolation: + description: A rule violation found in the analyzed source code. + properties: + category: + description: The category of the violation. + example: BEST_PRACTICES + type: string + end: + $ref: "#/components/schemas/AnalysisPosition" + fixes: + description: The list of suggested fixes for this violation. + items: + $ref: "#/components/schemas/AnalysisFix" + type: array + message: + description: A human-readable description of the violation. + example: Use of sys.exit() is discouraged. + type: string + severity: + description: The severity level of the violation. + example: WARNING + type: string + start: + $ref: "#/components/schemas/AnalysisPosition" + required: + - category + - severity + - message + - start + - end + - fixes + type: object Annotation: description: "A list of annotations used in the workflow. These are like sticky notes for your workflow!" properties: @@ -5113,6 +6150,333 @@ components: type: string x-enum-varnames: - APPLICATION_KEYS + ApplicationSecurityPolicyAttributes: + description: "A WAF policy." + properties: + description: + description: Description of the WAF policy. + example: "Policy applied to internal web applications." + type: string + isDefault: + description: |- + Make this policy the default policy. The default policy is applied to + every service not specifically assigned to another policy. + example: false + type: boolean + name: + description: The name of the WAF policy. + example: "Internal Network Policy" + type: string + protectionPresets: + description: Presets enabled on this policy. + items: + example: attack-tools + type: string + type: array + rules: + description: Rule overrides applied by the policy. + items: + $ref: "#/components/schemas/ApplicationSecurityPolicyRuleOverride" + type: array + rulesets: + deprecated: true + description: "Deprecated: Ruleset overrides. Use `protectionPresets` instead." + items: + $ref: "#/components/schemas/ApplicationSecurityPolicyRulesetOverride" + type: array + scope: + description: The scope of the WAF policy. + items: + $ref: "#/components/schemas/ApplicationSecurityPolicyScope" + type: array + version: + default: 0 + description: Version of the WAF ruleset maintained by Datadog used by this policy. 0 is the default value. + example: 0 + format: int64 + type: integer + required: + - name + - description + type: object + ApplicationSecurityPolicyCreateAttributes: + description: "Create a new WAF policy." + properties: + basedOn: + description: When creating a new policy, clone the policy indicated by this identifier. + example: recommended + type: string + description: + description: Description of the WAF policy. + example: "Policy applied to internal web applications." + type: string + isDefault: + description: |- + Make this policy the default policy. The default policy is applied to + every service not specifically assigned to another policy. + example: false + type: boolean + name: + description: The name of the WAF policy. + example: "Internal Network Policy" + type: string + protectionPresets: + description: Presets enabled on this policy. + items: + example: attack-tools + type: string + type: array + rules: + description: Rule overrides applied by the policy. + items: + $ref: "#/components/schemas/ApplicationSecurityPolicyRuleOverride" + type: array + rulesets: + deprecated: true + description: "Deprecated: Ruleset overrides. Use `protectionPresets` instead." + items: + $ref: "#/components/schemas/ApplicationSecurityPolicyRulesetOverride" + type: array + scope: + description: The scope of the WAF policy. + items: + $ref: "#/components/schemas/ApplicationSecurityPolicyScope" + type: array + version: + default: 0 + description: Version of the WAF ruleset maintained by Datadog used by this policy. 0 is the default value. + example: 0 + format: int64 + type: integer + required: + - name + - description + - basedOn + type: object + ApplicationSecurityPolicyCreateData: + description: Object for a single WAF policy. + properties: + attributes: + $ref: "#/components/schemas/ApplicationSecurityPolicyCreateAttributes" + type: + $ref: "#/components/schemas/ApplicationSecurityPolicyType" + required: + - attributes + - type + type: object + ApplicationSecurityPolicyCreateRequest: + description: Request object that includes the policy to create. + properties: + data: + $ref: "#/components/schemas/ApplicationSecurityPolicyCreateData" + required: + - data + type: object + ApplicationSecurityPolicyData: + description: Object for a single WAF policy. + properties: + attributes: + $ref: "#/components/schemas/ApplicationSecurityPolicyAttributes" + id: + description: "The ID of the policy." + example: "2857c47d-1e3a-4300-8b2f-dc24089c084b" + readOnly: true + type: string + meta: + $ref: "#/components/schemas/ApplicationSecurityPolicyMetadata" + type: + $ref: "#/components/schemas/ApplicationSecurityPolicyType" + type: object + ApplicationSecurityPolicyListResponse: + description: Response object that includes a list of WAF policies. + properties: + data: + description: The WAF policy data. + items: + $ref: "#/components/schemas/ApplicationSecurityPolicyData" + type: array + type: object + ApplicationSecurityPolicyMetadata: + description: Metadata associated with the WAF policy. + properties: + added_at: + description: The date and time the WAF policy was created. + example: "2021-01-01T00:00:00Z" + format: date-time + type: string + added_by: + description: The handle of the user who created the WAF policy. + example: "john.doe@datadoghq.com" + type: string + added_by_name: + description: The name of the user who created the WAF policy. + example: "John Doe" + type: string + modified_at: + description: The date and time the WAF policy was last updated. + example: "2021-01-01T00:00:00Z" + format: date-time + type: string + modified_by: + description: The handle of the user who last updated the WAF policy. + example: "john.doe@datadoghq.com" + type: string + modified_by_name: + description: The name of the user who last updated the WAF policy. + example: "John Doe" + type: string + readOnly: true + type: object + ApplicationSecurityPolicyResponse: + description: Response object that includes a single WAF policy. + properties: + data: + $ref: "#/components/schemas/ApplicationSecurityPolicyData" + type: object + ApplicationSecurityPolicyRuleOverride: + description: Override WAF rule parameters for services in a policy. + properties: + blocking: + description: When blocking is enabled, the rule will block the traffic matched by this rule. + example: false + type: boolean + enabled: + description: When false, this rule will not match any traffic. + example: true + type: boolean + extended_data_collection: + description: When true, collects additional data from the WAF for this rule. + example: false + type: boolean + id: + description: Override the parameters for this WAF rule identifier. + example: rasp-001-002 + type: string + required: + - id + - enabled + - blocking + type: object + ApplicationSecurityPolicyRulesetOverride: + deprecated: true + description: "Deprecated: Override WAF ruleset parameters. Use `protectionPresets` instead." + properties: + blocking: + description: When blocking is enabled, the ruleset will block the traffic it matches. + example: false + type: boolean + enabled: + description: When false, this ruleset will not match any traffic. + example: true + type: boolean + id: + description: The identifier of the ruleset to override. + example: attack_tool + type: string + required: + - id + - enabled + - blocking + type: object + ApplicationSecurityPolicyScope: + description: The scope of the WAF policy. + properties: + env: + description: The environment scope for the WAF policy. + example: "prod" + type: string + service: + description: The service scope for the WAF policy. + example: "billing-service" + type: string + required: + - service + - env + type: object + ApplicationSecurityPolicyType: + default: policy + description: The type of the resource. The value should always be `policy`. + enum: + - policy + example: policy + type: string + x-enum-varnames: + - POLICY + ApplicationSecurityPolicyUpdateAttributes: + description: "Update a WAF policy." + properties: + description: + description: Description of the WAF policy. + example: "Policy applied to internal web applications." + type: string + isDefault: + description: |- + Make this policy the default policy. The default policy is applied to + every service not specifically assigned to another policy. + example: false + type: boolean + name: + description: The name of the WAF policy. + example: "Internal Network Policy" + type: string + protectionPresets: + description: Presets enabled on this policy. + example: + - attack-tools + items: + example: attack-tools + type: string + type: array + rules: + description: Rule overrides applied by the policy. + items: + $ref: "#/components/schemas/ApplicationSecurityPolicyRuleOverride" + type: array + rulesets: + deprecated: true + description: "Deprecated: Ruleset overrides. Use `protectionPresets` instead." + items: + $ref: "#/components/schemas/ApplicationSecurityPolicyRulesetOverride" + type: array + scope: + description: The scope of the WAF policy. + items: + $ref: "#/components/schemas/ApplicationSecurityPolicyScope" + type: array + version: + default: 0 + description: Version of the WAF ruleset maintained by Datadog used by this policy. 0 is the default value. + example: 0 + format: int64 + type: integer + required: + - name + - description + - version + - isDefault + - rules + - protectionPresets + - scope + type: object + ApplicationSecurityPolicyUpdateData: + description: Object for a single WAF policy. + properties: + attributes: + $ref: "#/components/schemas/ApplicationSecurityPolicyUpdateAttributes" + type: + $ref: "#/components/schemas/ApplicationSecurityPolicyType" + required: + - attributes + - type + type: object + ApplicationSecurityPolicyUpdateRequest: + description: Request object that includes the policy to update. + properties: + data: + $ref: "#/components/schemas/ApplicationSecurityPolicyUpdateData" + required: + - data + type: object ApplicationSecurityWafCustomRuleAction: description: The definition of `ApplicationSecurityWafCustomRuleAction` object. properties: @@ -5169,7 +6533,7 @@ components: metadata: $ref: "#/components/schemas/ApplicationSecurityWafCustomRuleMetadata" name: - description: The Name of the WAF custom rule. + description: The name of the WAF custom rule. example: "Block request from bad useragent" type: string path_glob: @@ -5406,7 +6770,7 @@ components: example: false type: boolean name: - description: The Name of the WAF custom rule. + description: The name of the WAF custom rule. example: "Block request from a bad useragent" type: string path_glob: @@ -5580,7 +6944,7 @@ components: example: false type: boolean name: - description: The Name of the WAF custom rule. + description: The name of the WAF custom rule. example: "Block request from bad useragent" type: string path_glob: @@ -23312,6 +24676,17 @@ components: type: string x-enum-varnames: - CUSTOM_RULESET + CustomRulesetListResponse: + description: Response containing a list of custom rulesets for the authenticated organization. + properties: + data: + description: The list of custom rulesets. + items: + $ref: "#/components/schemas/CustomRuleset" + type: array + required: + - data + type: object CustomRulesetRequest: description: Request body for creating or updating a custom ruleset. properties: @@ -25030,6 +26405,52 @@ components: example: 1722439510282 format: int64 type: integer + DefaultRulesetsPerLanguageData: + description: The primary data object in the default rulesets per language response. + properties: + attributes: + $ref: "#/components/schemas/DefaultRulesetsPerLanguageDataAttributes" + id: + description: The language identifier used as the resource identifier. + example: python + type: string + type: + $ref: "#/components/schemas/DefaultRulesetsPerLanguageDataType" + required: + - id + - type + - attributes + type: object + DefaultRulesetsPerLanguageDataAttributes: + description: The attributes of the default rulesets per language response, containing the list of default ruleset names. + properties: + rulesets: + description: The list of default ruleset names for the specified programming language. + example: + - python-best-practices + items: + type: string + type: array + required: + - rulesets + type: object + DefaultRulesetsPerLanguageDataType: + default: defaultRulesetsPerLanguage + description: Default rulesets per language resource type. + enum: + - defaultRulesetsPerLanguage + example: defaultRulesetsPerLanguage + type: string + x-enum-varnames: + - DEFAULT_RULESETS_PER_LANGUAGE + DefaultRulesetsPerLanguageResponse: + description: The response payload containing the default ruleset names for a programming language. + properties: + data: + $ref: "#/components/schemas/DefaultRulesetsPerLanguageData" + required: + - data + type: object Degradation: description: Response object for a single degradation. properties: @@ -34198,6 +35619,98 @@ components: type: string type: array type: object + GetAstRequest: + description: The request payload for parsing source code into an abstract syntax tree. + properties: + data: + $ref: "#/components/schemas/GetAstRequestData" + required: + - data + type: object + GetAstRequestData: + description: The primary data object in the get-AST request. + properties: + attributes: + $ref: "#/components/schemas/GetAstRequestDataAttributes" + id: + description: An optional identifier for the get-AST request resource. + type: string + type: + $ref: "#/components/schemas/GetAstRequestDataType" + required: + - type + - attributes + type: object + GetAstRequestDataAttributes: + description: The attributes of the get-AST request, containing the source code to parse. + properties: + code: + description: The base64-encoded source code to parse into an abstract syntax tree. + example: aW1wb3J0IHN5cw== + type: string + file_encoding: + description: The encoding of the source code file (must be utf-8). + example: utf-8 + type: string + language: + description: The programming language of the source code to parse. + example: python + type: string + required: + - code + - file_encoding + - language + type: object + GetAstRequestDataType: + default: get_ast_request + description: Get AST request resource type. + enum: + - get_ast_request + example: get_ast_request + type: string + x-enum-varnames: + - GET_AST_REQUEST + GetAstResponse: + description: The response payload containing the parsed abstract syntax tree. + properties: + data: + $ref: "#/components/schemas/GetAstResponseData" + required: + - data + type: object + GetAstResponseData: + description: The primary data object in the get-AST response. + properties: + attributes: + $ref: "#/components/schemas/GetAstResponseDataAttributes" + id: + description: The identifier of the get-AST response resource. + type: string + type: + $ref: "#/components/schemas/GetAstResponseDataType" + required: + - type + - attributes + type: object + GetAstResponseDataAttributes: + description: The attributes of the get-AST response, containing the parsed abstract syntax tree. + properties: + ast: + additionalProperties: {} + description: The parsed abstract syntax tree as a JSON object. + type: object + required: + - ast + type: object + GetAstResponseDataType: + default: get_ast_response + description: Get AST response resource type. + enum: + - get_ast_response + example: get_ast_response + type: string + x-enum-varnames: + - GET_AST_RESPONSE GetBlueprintResponse: description: The response for retrieving a single blueprint. properties: @@ -52644,6 +54157,54 @@ components: - type - id type: object + NodeType: + additionalProperties: {} + description: A tree-sitter node type definition for a given language, describing the node's structure, subtypes, and fields. + type: object + NodeTypesResponse: + description: The response payload containing tree-sitter node type definitions for a programming language. + properties: + data: + $ref: "#/components/schemas/NodeTypesResponseData" + required: + - data + type: object + NodeTypesResponseData: + description: The primary data object in the node types response. + properties: + attributes: + $ref: "#/components/schemas/NodeTypesResponseDataAttributes" + id: + description: The unique identifier of the node types response resource. + example: python + type: string + type: + $ref: "#/components/schemas/NodeTypesResponseDataType" + required: + - id + - type + - attributes + type: object + NodeTypesResponseDataAttributes: + description: The attributes of the node types response, containing the list of node type definitions for the requested language. + properties: + node_types: + description: The list of tree-sitter node type definitions for the language. + items: + $ref: "#/components/schemas/NodeType" + type: array + required: + - node_types + type: object + NodeTypesResponseDataType: + default: get_node_types_response + description: Get node types response resource type. + enum: + - get_node_types_response + example: get_node_types_response + type: string + x-enum-varnames: + - GET_NODE_TYPES_RESPONSE NotebookCreateData: description: Notebook creation data properties: @@ -69362,6 +70923,67 @@ components: x-enum-varnames: - ACTIVE - ALL + SastRulesetData: + description: The primary data object representing a SAST ruleset. + properties: + attributes: + $ref: "#/components/schemas/SastRulesetDataAttributes" + id: + description: The unique identifier of the ruleset resource. + example: python-best-practices + type: string + type: + $ref: "#/components/schemas/GetMultipleRulesetsResponseDataAttributesRulesetsItemsDataType" + required: + - id + - type + - attributes + type: object + SastRulesetDataAttributes: + description: The attributes of a SAST ruleset, including its name, description, and rules. + properties: + description: + description: A detailed description of the ruleset's purpose and the types of issues it targets. + example: A collection of Python best practice rules. + type: string + name: + description: The unique name of the ruleset. + example: python-best-practices + type: string + rules: + description: The list of static analysis rules included in this ruleset. + items: + $ref: "#/components/schemas/GetMultipleRulesetsResponseDataAttributesRulesetsItemsRulesItems" + type: array + short_description: + description: A brief summary of the ruleset, suitable for display in listings. + example: Python best practices ruleset. + type: string + required: + - name + - short_description + - description + - rules + type: object + SastRulesetResponse: + description: The response payload containing a single SAST ruleset and its rules. + properties: + data: + $ref: "#/components/schemas/SastRulesetData" + required: + - data + type: object + SastRulesetsResponse: + description: The response payload containing a list of SAST rulesets and their rules. + properties: + data: + description: The list of SAST rulesets returned in the response. + items: + $ref: "#/components/schemas/SastRulesetData" + type: array + required: + - data + type: object ScaRequest: description: The top-level request object for submitting a Software Composition Analysis (SCA) scan result. properties: @@ -139123,6 +140745,265 @@ paths: permissions: - appsec_protect_write x-terraform-resource: appsec_waf_exclusion_filter + /api/v2/remote_config/products/asm/waf/policies: + get: + description: Retrieve a list of WAF policies. + operationId: ListApplicationSecurityWAFPolicies + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + description: Monitor security scanners and application attacks such as Server-Side-Request-Forgery (SSRF), SQL Injection, Log4Shell, and Cross-Site-Scripting (XSS). + isDefault: true + name: Managed - Monitoring-only + rules: [] + rulesets: [] + scope: [] + version: 0 + id: recommended + meta: {} + type: policy + - attributes: + description: Block known attack tools without impacting legitimate security scans. + isDefault: false + name: Managed - Block attack tools + protectionPresets: + - attack-tools + rules: [] + rulesets: [] + scope: [] + version: 0 + id: recommended-attack-tools + meta: {} + type: policy + schema: + $ref: "#/components/schemas/ApplicationSecurityPolicyListResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List all WAF policies + tags: + - "Application Security" + post: + description: Create a new WAF policy. + operationId: CreateApplicationSecurityWafPolicy + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + basedOn: recommended + description: Policy applied to internal web applications. + isDefault: false + name: Internal Network Policy + protectionPresets: + - attack-tools + rules: + - blocking: false + enabled: true + id: rasp-001-002 + scope: + - env: prod + service: billing-service + version: 0 + type: policy + schema: + $ref: "#/components/schemas/ApplicationSecurityPolicyCreateRequest" + description: The new WAF policy. + required: true + responses: + "201": + content: + "application/json": + examples: + default: + value: + data: + attributes: + description: Policy applied to internal web applications. + isDefault: false + name: Internal Network Policy + protectionPresets: + - attack-tools + rules: + - blocking: false + enabled: true + id: rasp-001-002 + rulesets: [] + scope: + - env: prod + service: billing-service + version: 0 + id: 841d53b4-4d73-4585-99cc-39dd10883f7c + meta: + added_at: "2026-04-16T10:25:18Z" + added_by: 9919ec9b-ebc7-49ee-8dc8-03626e717cca + added_by_name: CI Account + type: policy + schema: + $ref: "#/components/schemas/ApplicationSecurityPolicyResponse" + description: Created + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "409": + $ref: "#/components/responses/ConcurrentModificationResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create a WAF Policy + tags: + - "Application Security" + x-codegen-request-body-name: body + /api/v2/remote_config/products/asm/waf/policies/{policy_id}: + delete: + description: Delete a specific WAF policy. + operationId: DeleteApplicationSecurityWafPolicy + parameters: + - $ref: "#/components/parameters/ApplicationSecurityPolicyIDParam" + responses: + "204": + description: No Content + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "409": + $ref: "#/components/responses/ConcurrentModificationResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Delete a WAF Policy + tags: + - "Application Security" + x-terraform-resource: appsec_waf_policy + get: + description: Retrieve a WAF policy by ID. + operationId: GetApplicationSecurityWafPolicy + parameters: + - $ref: "#/components/parameters/ApplicationSecurityPolicyIDParam" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + description: This is a test policy. + isDefault: false + name: Test policy + rules: [] + rulesets: [] + scope: [] + version: -1 + id: cc3e574d-9b5a-4310-b7f4-5560483f84b1 + meta: + added_at: "2026-04-16T10:25:20Z" + added_by: 9919ec9b-ebc7-49ee-8dc8-03626e717cca + added_by_name: CI Account + type: policy + schema: + $ref: "#/components/schemas/ApplicationSecurityPolicyResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get a WAF Policy + tags: + - "Application Security" + x-terraform-resource: appsec_waf_policy + put: + description: |- + Update a specific WAF policy. + Returns the policy object when the request is successful. + operationId: UpdateApplicationSecurityWafPolicy + parameters: + - $ref: "#/components/parameters/ApplicationSecurityPolicyIDParam" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + description: Policy applied to internal web applications. + isDefault: false + name: Internal Network Policy + protectionPresets: + - attack-tools + rules: + - blocking: false + enabled: true + id: rasp-001-002 + scope: + - env: prod + service: billing-service + version: 0 + type: policy + schema: + $ref: "#/components/schemas/ApplicationSecurityPolicyUpdateRequest" + description: New WAF policy. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + description: Policy applied to internal web applications. + isDefault: false + name: Internal Network Policy + protectionPresets: + - attack-tools + rules: + - blocking: false + enabled: true + id: rasp-001-002 + rulesets: [] + scope: + - env: prod + service: billing-service + version: 0 + id: 841d53b4-4d73-4585-99cc-39dd10883f7c + meta: + added_at: "2026-04-16T10:25:18Z" + added_by: 9919ec9b-ebc7-49ee-8dc8-03626e717cca + added_by_name: CI Account + type: policy + schema: + $ref: "#/components/schemas/ApplicationSecurityPolicyResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "409": + $ref: "#/components/responses/ConcurrentModificationResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update a WAF Policy + tags: + - "Application Security" + x-codegen-request-body-name: body + x-terraform-resource: appsec_waf_policy /api/v2/remote_config/products/cws/agent_rules: get: description: |- @@ -152934,6 +154815,1162 @@ paths: tags: - Static Analysis x-unstable: "**Note**: This endpoint may be subject to changes." + /api/v2/static-analysis/ai/memory: + get: + description: Get all AI memory violation results for the authenticated organization. + operationId: ListAiMemoryViolationResults + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + created_at: "2024-01-01T00:00:00+00:00" + created_by: example-handle + line: 10 + message: This is a false positive. + name: src/main.py + repository_id: my-repo + rule: my-ai-ruleset/my-ai-rule + sha: abc123def456789012345678901234567890abcd + type: FP + id: "42" + type: ai_memory_violation_result + schema: + $ref: "#/components/schemas/AiMemoryViolationResultsResponse" + 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 + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + summary: List AI memory violation results + tags: + - Static Analysis + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: Add a new AI memory violation result for the authenticated organization. + operationId: CreateAiMemoryViolationResult + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + line: 10 + message: This is a false positive. + name: src/main.py + repository_id: my-repo + rule: my-ai-ruleset/my-ai-rule + sha: abc123def456789012345678901234567890abcd + type: FP + id: violation-abc + type: ai_memory_violation_result + schema: + $ref: "#/components/schemas/AiMemoryViolationResultRequest" + 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 + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + summary: Create an AI memory violation result + tags: + - Static Analysis + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/static-analysis/ai/memory/{id}: + delete: + description: Delete an AI memory violation result by its numeric identifier. + operationId: DeleteAiMemoryViolationResult + parameters: + - description: The numeric identifier of the memory violation result. + in: path + name: id + required: true + schema: + example: "42" + 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 + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Memory violation result not found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + summary: Delete an AI memory violation result + tags: + - Static Analysis + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/static-analysis/ai/prompts: + get: + description: Get all AI prompts, including default prompts and custom AI rule prompts for the authenticated organization. + operationId: ListAiPrompts + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + category: SECURITY + checksum: abc123 + content: Ruleset content + cwe: "79" + description: Ruleset description + directories: [] + execution_mode: auto + file_search_keywords: [] + globs: + - "**/*.py" + is_default: false + is_testing: false + language: PYTHON + result_keywords_exclude: [] + rule_version: "1" + severity: ERROR + short_description: Ruleset short description + id: my-ai-ruleset/my-ai-rule + type: ai_prompt + schema: + $ref: "#/components/schemas/AiPromptsResponse" + 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 + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + summary: List AI prompts + tags: + - Static Analysis + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/static-analysis/ai/rulesets: + get: + description: Get all AI custom rulesets for the authenticated organization. + operationId: ListAiCustomRulesets + parameters: + - description: The offset for pagination. + in: query + name: page[offset] + required: false + schema: + default: 0 + format: int64 + type: integer + - description: The maximum number of rulesets to return. + in: query + name: page[limit] + required: false + schema: + default: 100 + format: int64 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + created_at: "2024-01-01T00:00:00+00:00" + created_by: example-handle + description: Ruleset description + name: my-ai-ruleset + rules: [] + short_description: Ruleset short description + id: my-ai-ruleset + type: ai_ruleset + schema: + $ref: "#/components/schemas/AiCustomRulesetsResponse" + description: Successful response + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + summary: List AI custom rulesets + tags: + - Static Analysis + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: Create a new AI custom ruleset for the authenticated organization. + operationId: CreateAiCustomRuleset + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + description: Ruleset description + name: my-ai-ruleset + short_description: Ruleset short description + id: my-ai-ruleset + type: ai_ruleset + schema: + $ref: "#/components/schemas/AiCustomRulesetRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00+00:00" + created_by: example-handle + description: Ruleset description + name: my-ai-ruleset + rules: [] + short_description: Ruleset short description + id: my-ai-ruleset + type: ai_ruleset + schema: + $ref: "#/components/schemas/AiCustomRulesetResponse" + 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 + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Conflict - ruleset already exists + "412": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Precondition Failed - validation error + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + summary: Create an AI custom ruleset + tags: + - Static Analysis + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/static-analysis/ai/rulesets/{ruleset_name}: + delete: + description: Delete an AI custom ruleset by name. + operationId: DeleteAiCustomRuleset + parameters: + - description: The ruleset name. + in: path + name: ruleset_name + required: true + schema: + example: my-ai-ruleset + 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 + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Ruleset not found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + summary: Delete an AI custom ruleset + tags: + - Static Analysis + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + get: + description: Get an AI custom ruleset by name. + operationId: GetAiCustomRuleset + parameters: + - description: The ruleset name. + in: path + name: ruleset_name + required: true + schema: + example: my-ai-ruleset + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00+00:00" + created_by: example-handle + description: Ruleset description + name: my-ai-ruleset + rules: [] + short_description: Ruleset short description + id: my-ai-ruleset + type: ai_ruleset + schema: + $ref: "#/components/schemas/AiCustomRulesetResponse" + 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 + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Ruleset not found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + summary: Get an AI custom ruleset + tags: + - Static Analysis + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + patch: + description: Update the description of an existing AI custom ruleset. + operationId: UpdateAiCustomRuleset + parameters: + - description: The ruleset name. + in: path + name: ruleset_name + required: true + schema: + example: my-ai-ruleset + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + description: Ruleset description + name: my-ai-ruleset + short_description: Ruleset short description + id: my-ai-ruleset + type: ai_ruleset + schema: + $ref: "#/components/schemas/AiCustomRulesetUpdateRequest" + required: true + responses: + "200": + 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 + "412": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Precondition Failed - validation error or ruleset not found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + summary: Update an AI custom ruleset + tags: + - Static Analysis + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/static-analysis/ai/rulesets/{ruleset_name}/rules: + post: + description: Create a new AI custom rule within a ruleset. + operationId: CreateAiCustomRule + parameters: + - description: The ruleset name. + in: path + name: ruleset_name + required: true + schema: + example: my-ai-ruleset + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + name: my-ai-rule + type: ai_rule + schema: + $ref: "#/components/schemas/AiCustomRuleRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00+00:00" + created_by: example-handle + last_revision: + name: my-ai-rule + id: my-ai-rule + type: ai_rule + schema: + $ref: "#/components/schemas/AiCustomRuleResponse" + 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 + "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" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + summary: Create an AI custom rule + tags: + - Static Analysis + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/static-analysis/ai/rulesets/{ruleset_name}/rules/{rule_name}: + delete: + description: Delete an AI custom rule by name within a ruleset. + operationId: DeleteAiCustomRule + parameters: + - description: The ruleset name. + in: path + name: ruleset_name + required: true + schema: + example: my-ai-ruleset + type: string + - description: The rule name. + in: path + name: rule_name + required: true + schema: + example: my-ai-rule + 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 + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Rule not found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + summary: Delete an AI custom rule + tags: + - Static Analysis + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + get: + description: Get an AI custom rule by name within a ruleset. + operationId: GetAiCustomRule + parameters: + - description: The ruleset name. + in: path + name: ruleset_name + required: true + schema: + example: my-ai-ruleset + type: string + - description: The rule name. + in: path + name: rule_name + required: true + schema: + example: my-ai-rule + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00+00:00" + created_by: example-handle + last_revision: + name: my-ai-rule + id: my-ai-rule + type: ai_rule + schema: + $ref: "#/components/schemas/AiCustomRuleResponse" + 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 + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Rule not found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + summary: Get an AI custom rule + tags: + - Static Analysis + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/static-analysis/ai/rulesets/{ruleset_name}/rules/{rule_name}/revisions: + get: + description: Get all revisions for an AI custom rule. + operationId: ListAiCustomRuleRevisions + parameters: + - description: The ruleset name. + in: path + name: ruleset_name + required: true + schema: + example: my-ai-ruleset + type: string + - description: The rule name. + in: path + name: rule_name + required: true + schema: + example: my-ai-rule + type: string + - description: The offset for pagination. + in: query + name: page[offset] + required: false + schema: + default: 0 + format: int64 + type: integer + - description: The maximum number of revisions to return. + in: query + name: page[limit] + required: false + schema: + default: 100 + format: int64 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + category: SECURITY + checksum: abc123 + content: Content + created_at: "2024-01-01T00:00:00+00:00" + created_by: example-handle + cwe: + description: Ruleset description + directories: [] + execution_mode: auto + globs: + - "**/*.py" + is_default: false + is_published: false + is_testing: false + severity: ERROR + short_description: Ruleset short description + version_id: 1 + id: revision-abc-123 + type: ai_rule_revision + schema: + $ref: "#/components/schemas/AiCustomRuleRevisionsResponse" + 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 + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Rule not found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + summary: List AI custom rule revisions + tags: + - Static Analysis + x-pagination: + limitParam: page[limit] + pageOffsetParam: page[offset] + resultsPath: data + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: Create a new revision for an AI custom rule. + operationId: CreateAiCustomRuleRevision + parameters: + - description: The ruleset name. + in: path + name: ruleset_name + required: true + schema: + example: my-ai-ruleset + type: string + - description: The rule name. + in: path + name: rule_name + required: true + schema: + example: my-ai-rule + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + category: SECURITY + content: Content + description: Ruleset description + directories: [] + execution_mode: auto + globs: + - "**/*.py" + is_published: false + is_testing: false + severity: ERROR + short_description: Ruleset short description + version_id: 1 + id: revision-abc-123 + type: ai_rule_revision + schema: + $ref: "#/components/schemas/AiCustomRuleRevisionRequest" + 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 + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Rule not found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + summary: Create an AI custom rule revision + tags: + - Static Analysis + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/static-analysis/ai/rulesets/{ruleset_name}/rules/{rule_name}/revisions/{id}: + get: + description: Get a specific revision of an AI custom rule. + operationId: GetAiCustomRuleRevision + parameters: + - description: The ruleset name. + in: path + name: ruleset_name + required: true + schema: + example: my-ai-ruleset + type: string + - description: The rule name. + in: path + name: rule_name + required: true + schema: + example: my-ai-rule + type: string + - description: The revision identifier. + in: path + name: id + required: true + schema: + example: revision-abc-123 + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + category: SECURITY + checksum: abc123 + content: Content + created_at: "2024-01-01T00:00:00+00:00" + created_by: example-handle + cwe: + description: Ruleset description + directories: [] + execution_mode: auto + globs: + - "**/*.py" + is_default: false + is_published: false + is_testing: false + severity: ERROR + short_description: Ruleset short description + version_id: 1 + id: revision-abc-123 + type: ai_rule_revision + schema: + $ref: "#/components/schemas/AiCustomRuleRevisionResponse" + 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 + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Revision not found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + summary: Get an AI custom rule revision + tags: + - Static Analysis + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/static-analysis/codegen/rulesets: + get: + description: Get the rulesets relevant for code generation for the authenticated user. + operationId: ListStaticAnalysisCodegenRulesets + responses: + "200": + content: + application/json: + examples: + default: + value: + data: [] + schema: + $ref: "#/components/schemas/SastRulesetsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - code_analysis_read + summary: List codegen rulesets + tags: + - "Security Monitoring" + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/static-analysis/custom/rulesets: + get: + description: Get all custom rulesets for the authenticated organization. + operationId: ListCustomRulesets + responses: + "200": + content: + application/json: + examples: + default: + value: + data: [] + schema: + $ref: "#/components/schemas/CustomRulesetListResponse" + description: OK + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - code_analysis_read + summary: List Custom Rulesets + tags: + - Static Analysis + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + put: + description: Create a new custom ruleset for the authenticated organization. + operationId: CreateCustomRuleset + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + description: My custom ruleset. + name: my-custom-ruleset + type: custom_ruleset + schema: + $ref: "#/components/schemas/CustomRulesetRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + name: my-custom-ruleset + id: my-custom-ruleset + type: custom_ruleset + schema: + $ref: "#/components/schemas/CustomRulesetResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Conflict + "412": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Precondition Failed + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - code_analysis_read + summary: Create Custom Ruleset + tags: + - Static Analysis + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/static-analysis/custom/rulesets/{ruleset_name}: delete: description: Delete a custom ruleset @@ -153582,6 +156619,53 @@ paths: tags: - Static Analysis x-unstable: "This endpoint is in Preview and may introduce breaking changes.\nIf you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/)." + /api/v2/static-analysis/default-rulesets/{language}: + get: + description: Get the default SAST ruleset names for a given programming language. + operationId: GetStaticAnalysisDefaultRulesets + parameters: + - description: The programming language for which to retrieve the default rulesets. + in: path + name: language + required: true + schema: + example: python + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + rulesets: + - python-best-practices + id: python + type: defaultRulesetsPerLanguage + schema: + $ref: "#/components/schemas/DefaultRulesetsPerLanguageResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - code_analysis_read + summary: Get default rulesets for a language + tags: + - "Security Monitoring" + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/static-analysis/rulesets: post: description: Get rules for multiple rulesets in batch. @@ -153623,6 +156707,73 @@ paths: tags: - "Security Monitoring" x-unstable: "**Note**: This endpoint may be subject to changes." + /api/v2/static-analysis/rulesets/{ruleset_name}: + get: + description: Get a SAST ruleset by name, including all its rules. + operationId: GetStaticAnalysisRuleset + parameters: + - description: The name of the ruleset to retrieve. + in: path + name: ruleset_name + required: true + schema: + example: python-best-practices + type: string + - description: When true, test cases for each rule are included in the response. + in: query + name: include_tests + required: false + schema: + type: boolean + - description: When true, rules that are in testing mode are included in the response. + in: query + name: include_testing_rules + required: false + schema: + type: boolean + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + description: A collection of Python best practice rules. + name: python-best-practices + rules: [] + short_description: Python best practices. + id: python-best-practices + type: rulesets + schema: + $ref: "#/components/schemas/SastRulesetResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - code_analysis_read + summary: Get a SAST ruleset + tags: + - "Security Monitoring" + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/static-analysis/secrets/rules: get: description: |- @@ -153657,6 +156808,226 @@ paths: tags: - "Security Monitoring" x-unstable: "**Note**: This endpoint may be subject to changes." + /api/v2/static-analysis/static-analysis-server/analyze: + post: + description: Run static analysis rules against a source code file and return violations found. + operationId: CreateStaticAnalysisServerAnalysis + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + code: aW1wb3J0IHN5cw== + file_encoding: utf-8 + filename: test.py + language: python + rules: [] + type: analysis_request + schema: + $ref: "#/components/schemas/AnalysisRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + errors: [] + rule_responses: [] + id: abc-123 + type: server_request + schema: + $ref: "#/components/schemas/AnalysisResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - code_analysis_read + summary: Analyze code + tags: + - Security Monitoring + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/static-analysis/static-analysis-server/get-ast: + post: + description: Parse source code into an abstract syntax tree (AST) for the specified language. + operationId: CreateStaticAnalysisAst + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + code: aW1wb3J0IHN5cw== + file_encoding: utf-8 + language: python + type: get_ast_request + schema: + $ref: "#/components/schemas/GetAstRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + ast: {} + type: get_ast_response + schema: + $ref: "#/components/schemas/GetAstResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - code_analysis_read + summary: Get AST for source code + tags: + - Security Monitoring + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/static-analysis/static-analysis-server/node-types/{language}: + get: + description: Retrieve tree-sitter node type definitions for a given programming language. + operationId: GetStaticAnalysisNodeTypes + parameters: + - description: The programming language for which to retrieve node type definitions. + in: path + name: language + required: true + schema: + example: python + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + node_types: [] + id: python + type: get_node_types_response + schema: + $ref: "#/components/schemas/NodeTypesResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - code_analysis_read + summary: Get node types for a language + tags: + - Security Monitoring + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/static-analysis/static-analysis-server/tree-sitter-wasm/{file}: + get: + description: Download the WebAssembly binary for a tree-sitter grammar by file name. + operationId: GetStaticAnalysisTreeSitterWasm + parameters: + - description: The name of the WASM file to download. + in: path + name: file + required: true + schema: + example: tree-sitter-python.wasm + type: string + responses: + "200": + content: + application/octet-stream: + examples: + default: + value: "" + schema: + format: binary + type: string + description: BLOB with the content of the WASM file + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - code_analysis_read + summary: Get tree-sitter WASM file + tags: + - Security Monitoring + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/statuspages: get: description: Lists all status pages for the organization. diff --git a/cassettes/features/v2/application_security/Create-a-WAF-Policy-returns-Created-response.frozen b/cassettes/features/v2/application_security/Create-a-WAF-Policy-returns-Created-response.frozen new file mode 100644 index 000000000000..2a1cf7a5c197 --- /dev/null +++ b/cassettes/features/v2/application_security/Create-a-WAF-Policy-returns-Created-response.frozen @@ -0,0 +1 @@ +2026-04-16T10:25:18.392Z \ No newline at end of file diff --git a/cassettes/features/v2/application_security/Create-a-WAF-Policy-returns-Created-response.yml b/cassettes/features/v2/application_security/Create-a-WAF-Policy-returns-Created-response.yml new file mode 100644 index 000000000000..2d504cb382aa --- /dev/null +++ b/cassettes/features/v2/application_security/Create-a-WAF-Policy-returns-Created-response.yml @@ -0,0 +1,47 @@ +http_interactions: +- recorded_at: Thu, 16 Apr 2026 10:25:18 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"basedOn":"recommended","description":"Policy + applied to internal web applications.","isDefault":false,"name":"Internal + Network Policy","protectionPresets":["attack-tools"],"rules":[{"blocking":false,"enabled":true,"id":"rasp-001-002"}],"scope":[{"env":"prod","service":"billing-service"}],"version":0},"type":"policy"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/remote_config/products/asm/waf/policies + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"841d53b4-4d73-4585-99cc-39dd10883f7c","type":"policy","attributes":{"description":"Policy + applied to internal web applications.","isDefault":false,"name":"Internal + Network Policy","protectionPresets":["attack-tools"],"rules":[{"id":"rasp-001-002","blocking":false,"enabled":true}],"rulesets":[],"scope":[{"env":"prod","service":"billing-service"}],"version":0},"meta":{"added_at":"2026-04-16T10:25:18Z","added_by":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","added_by_name":"CI + Account"}}}' + headers: + Content-Type: + - application/json + status: + code: 201 + message: Created +- recorded_at: Thu, 16 Apr 2026 10:25:18 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/remote_config/products/asm/waf/policies/841d53b4-4d73-4585-99cc-39dd10883f7c + response: + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/application_security/Get-a-WAF-Policy-returns-OK-response.frozen b/cassettes/features/v2/application_security/Get-a-WAF-Policy-returns-OK-response.frozen new file mode 100644 index 000000000000..7f284d10f999 --- /dev/null +++ b/cassettes/features/v2/application_security/Get-a-WAF-Policy-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-04-16T10:25:20.216Z \ No newline at end of file diff --git a/cassettes/features/v2/application_security/Get-a-WAF-Policy-returns-OK-response.yml b/cassettes/features/v2/application_security/Get-a-WAF-Policy-returns-OK-response.yml new file mode 100644 index 000000000000..852bed22dcfa --- /dev/null +++ b/cassettes/features/v2/application_security/Get-a-WAF-Policy-returns-OK-response.yml @@ -0,0 +1,65 @@ +http_interactions: +- recorded_at: Thu, 16 Apr 2026 10:25:20 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"basedOn":"recommended","description":"This + is a test policy.","name":"Test policy"},"type":"policy"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/remote_config/products/asm/waf/policies + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"cc3e574d-9b5a-4310-b7f4-5560483f84b1","type":"policy","attributes":{"description":"This + is a test policy.","isDefault":false,"name":"Test policy","rules":[],"rulesets":[],"scope":[],"version":-1},"meta":{"added_at":"2026-04-16T10:25:20Z","added_by":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","added_by_name":"CI + Account"}}}' + headers: + Content-Type: + - application/json + status: + code: 201 + message: Created +- recorded_at: Thu, 16 Apr 2026 10:25:20 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/remote_config/products/asm/waf/policies/cc3e574d-9b5a-4310-b7f4-5560483f84b1 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"cc3e574d-9b5a-4310-b7f4-5560483f84b1","type":"policy","attributes":{"description":"This + is a test policy.","isDefault":false,"name":"Test policy","rules":[],"rulesets":[],"scope":[],"version":-1},"meta":{"added_at":"2026-04-16T10:25:20Z","added_by":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","added_by_name":"CI + Account"}}}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Thu, 16 Apr 2026 10:25:20 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/remote_config/products/asm/waf/policies/cc3e574d-9b5a-4310-b7f4-5560483f84b1 + response: + body: + encoding: UTF-8 + string: '' + headers: + Content-Type: + - application/json + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/application_security/List-all-WAF-policies-returns-OK-response.frozen b/cassettes/features/v2/application_security/List-all-WAF-policies-returns-OK-response.frozen new file mode 100644 index 000000000000..fa15b0e7e322 --- /dev/null +++ b/cassettes/features/v2/application_security/List-all-WAF-policies-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-04-16T12:51:11.613Z \ No newline at end of file diff --git a/cassettes/features/v2/application_security/List-all-WAF-policies-returns-OK-response.yml b/cassettes/features/v2/application_security/List-all-WAF-policies-returns-OK-response.yml new file mode 100644 index 000000000000..7b62b7d2a820 --- /dev/null +++ b/cassettes/features/v2/application_security/List-all-WAF-policies-returns-OK-response.yml @@ -0,0 +1,32 @@ +http_interactions: +- recorded_at: Thu, 16 Apr 2026 12:51:11 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/remote_config/products/asm/waf/policies + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"recommended","type":"policy","attributes":{"description":"Monitor + security scanners and application attacks such as Server-Side-Request-Forgery + (SSRF), SQL Injection, Log4Shell, and Cross-Site-Scripting (XSS).","isDefault":true,"name":"Managed + - Monitoring-only","rules":[],"rulesets":[],"scope":[],"version":0},"meta":{}},{"id":"recommended-blocking","type":"policy","attributes":{"description":"Block + known attack tools without impacting legitimate security scans.\nBlock application + attacks such as Server-Side-Request-Forgery (SSRF), SQL Injection, Log4Shell, + and Cross-Site-Scripting (XSS). Rules are curated to reduce the risk of blocking + legitimate traffic. Previously known as \"Datadog Recommended\".","isDefault":false,"name":"Managed + - Block attack tools \u0026 application attacks","protectionPresets":["all-confidence-one"],"rules":[],"rulesets":[],"scope":[],"version":0},"meta":{}},{"id":"recommended-attack-tools","type":"policy","attributes":{"description":"Block + known attack tools without impacting legitimate security scans.\nMonitor application + attacks such as Server-Side-Request-Forgery (SSRF), SQL Injection, Log4Shell, + and Cross-Site-Scripting (XSS).","isDefault":false,"name":"Managed - Block + attack tools","protectionPresets":["attack-tools"],"rules":[],"rulesets":[],"scope":[],"version":0},"meta":{}}]}' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/examples/v2/application-security/CreateApplicationSecurityWafPolicy.rb b/examples/v2/application-security/CreateApplicationSecurityWafPolicy.rb new file mode 100644 index 000000000000..16936b128631 --- /dev/null +++ b/examples/v2/application-security/CreateApplicationSecurityWafPolicy.rb @@ -0,0 +1,34 @@ +# Create a WAF Policy returns "Created" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ApplicationSecurityAPI.new + +body = DatadogAPIClient::V2::ApplicationSecurityPolicyCreateRequest.new({ + data: DatadogAPIClient::V2::ApplicationSecurityPolicyCreateData.new({ + attributes: DatadogAPIClient::V2::ApplicationSecurityPolicyCreateAttributes.new({ + based_on: "recommended", + description: "Policy applied to internal web applications.", + is_default: false, + name: "Internal Network Policy", + protection_presets: [ + "attack-tools", + ], + rules: [ + DatadogAPIClient::V2::ApplicationSecurityPolicyRuleOverride.new({ + blocking: false, + enabled: true, + id: "rasp-001-002", + }), + ], + scope: [ + DatadogAPIClient::V2::ApplicationSecurityPolicyScope.new({ + env: "prod", + service: "billing-service", + }), + ], + version: 0, + }), + type: DatadogAPIClient::V2::ApplicationSecurityPolicyType::POLICY, + }), +}) +p api_instance.create_application_security_waf_policy(body) diff --git a/examples/v2/application-security/DeleteApplicationSecurityWafPolicy.rb b/examples/v2/application-security/DeleteApplicationSecurityWafPolicy.rb new file mode 100644 index 000000000000..51f98cf0cc62 --- /dev/null +++ b/examples/v2/application-security/DeleteApplicationSecurityWafPolicy.rb @@ -0,0 +1,5 @@ +# Delete a WAF Policy returns "No Content" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ApplicationSecurityAPI.new +api_instance.delete_application_security_waf_policy("policy_id") diff --git a/examples/v2/application-security/GetApplicationSecurityWafPolicy.rb b/examples/v2/application-security/GetApplicationSecurityWafPolicy.rb new file mode 100644 index 000000000000..1ff69c425fca --- /dev/null +++ b/examples/v2/application-security/GetApplicationSecurityWafPolicy.rb @@ -0,0 +1,8 @@ +# Get a WAF Policy returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ApplicationSecurityAPI.new + +# there is a valid "policy" in the system +POLICY_DATA_ID = ENV["POLICY_DATA_ID"] +p api_instance.get_application_security_waf_policy(POLICY_DATA_ID) diff --git a/examples/v2/application-security/ListApplicationSecurityWAFPolicies.rb b/examples/v2/application-security/ListApplicationSecurityWAFPolicies.rb new file mode 100644 index 000000000000..ceca5b01b3e1 --- /dev/null +++ b/examples/v2/application-security/ListApplicationSecurityWAFPolicies.rb @@ -0,0 +1,5 @@ +# List all WAF policies returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ApplicationSecurityAPI.new +p api_instance.list_application_security_waf_policies() diff --git a/examples/v2/application-security/UpdateApplicationSecurityWafPolicy.rb b/examples/v2/application-security/UpdateApplicationSecurityWafPolicy.rb new file mode 100644 index 000000000000..02903ced74d2 --- /dev/null +++ b/examples/v2/application-security/UpdateApplicationSecurityWafPolicy.rb @@ -0,0 +1,41 @@ +# Update a WAF Policy returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ApplicationSecurityAPI.new + +body = DatadogAPIClient::V2::ApplicationSecurityPolicyUpdateRequest.new({ + data: DatadogAPIClient::V2::ApplicationSecurityPolicyUpdateData.new({ + attributes: DatadogAPIClient::V2::ApplicationSecurityPolicyUpdateAttributes.new({ + description: "Policy applied to internal web applications.", + is_default: false, + name: "Internal Network Policy", + protection_presets: [ + "attack-tools", + ], + rules: [ + DatadogAPIClient::V2::ApplicationSecurityPolicyRuleOverride.new({ + blocking: false, + enabled: true, + extended_data_collection: false, + id: "rasp-001-002", + }), + ], + rulesets: [ + DatadogAPIClient::V2::ApplicationSecurityPolicyRulesetOverride.new({ + blocking: false, + enabled: true, + id: "attack_tool", + }), + ], + scope: [ + DatadogAPIClient::V2::ApplicationSecurityPolicyScope.new({ + env: "prod", + service: "billing-service", + }), + ], + version: 0, + }), + type: DatadogAPIClient::V2::ApplicationSecurityPolicyType::POLICY, + }), +}) +p api_instance.update_application_security_waf_policy("policy_id", body) diff --git a/examples/v2/security-monitoring/CreateStaticAnalysisAst.rb b/examples/v2/security-monitoring/CreateStaticAnalysisAst.rb new file mode 100644 index 000000000000..c3a0c3ed46d5 --- /dev/null +++ b/examples/v2/security-monitoring/CreateStaticAnalysisAst.rb @@ -0,0 +1,19 @@ +# Get AST for source code returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_static_analysis_ast".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::GetAstRequest.new({ + data: DatadogAPIClient::V2::GetAstRequestData.new({ + attributes: DatadogAPIClient::V2::GetAstRequestDataAttributes.new({ + code: "aW1wb3J0IHN5cw==", + file_encoding: "utf-8", + language: "python", + }), + type: DatadogAPIClient::V2::GetAstRequestDataType::GET_AST_REQUEST, + }), +}) +p api_instance.create_static_analysis_ast(body) diff --git a/examples/v2/security-monitoring/CreateStaticAnalysisServerAnalysis.rb b/examples/v2/security-monitoring/CreateStaticAnalysisServerAnalysis.rb new file mode 100644 index 000000000000..93795156b56e --- /dev/null +++ b/examples/v2/security-monitoring/CreateStaticAnalysisServerAnalysis.rb @@ -0,0 +1,34 @@ +# Analyze code returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_static_analysis_server_analysis".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::AnalysisRequest.new({ + data: DatadogAPIClient::V2::AnalysisRequestData.new({ + attributes: DatadogAPIClient::V2::AnalysisRequestDataAttributes.new({ + code: "aW1wb3J0IHN5cw==", + file_encoding: "utf-8", + filename: "test.py", + language: "python", + rules: [ + DatadogAPIClient::V2::AnalysisRequestRule.new({ + category: "BEST_PRACTICES", + checksum: "abc123def456", + code: "ZnVuY3Rpb24gdmlzaXQobm9kZSkge30=", + entity_checked: nil, + id: "python-best-practices/no-exit", + language: "python", + regex: nil, + severity: "WARNING", + tree_sitter_query: "KGNhbGwgbmFtZTogKGF0dHJpYnV0ZSkpQHZhbA==", + type: "TREE_SITTER_QUERY", + }), + ], + }), + type: DatadogAPIClient::V2::AnalysisRequestDataType::ANALYSIS_REQUEST, + }), +}) +p api_instance.create_static_analysis_server_analysis(body) diff --git a/examples/v2/security-monitoring/GetStaticAnalysisDefaultRulesets.rb b/examples/v2/security-monitoring/GetStaticAnalysisDefaultRulesets.rb new file mode 100644 index 000000000000..cfe954b5177f --- /dev/null +++ b/examples/v2/security-monitoring/GetStaticAnalysisDefaultRulesets.rb @@ -0,0 +1,8 @@ +# Get default rulesets for a language returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_static_analysis_default_rulesets".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new +p api_instance.get_static_analysis_default_rulesets("python") diff --git a/examples/v2/security-monitoring/GetStaticAnalysisNodeTypes.rb b/examples/v2/security-monitoring/GetStaticAnalysisNodeTypes.rb new file mode 100644 index 000000000000..85a048a1bc02 --- /dev/null +++ b/examples/v2/security-monitoring/GetStaticAnalysisNodeTypes.rb @@ -0,0 +1,8 @@ +# Get node types for a language returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_static_analysis_node_types".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new +p api_instance.get_static_analysis_node_types("python") diff --git a/examples/v2/security-monitoring/GetStaticAnalysisRuleset.rb b/examples/v2/security-monitoring/GetStaticAnalysisRuleset.rb new file mode 100644 index 000000000000..05e235e4dbd4 --- /dev/null +++ b/examples/v2/security-monitoring/GetStaticAnalysisRuleset.rb @@ -0,0 +1,8 @@ +# Get a SAST ruleset returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_static_analysis_ruleset".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new +p api_instance.get_static_analysis_ruleset("python-best-practices") diff --git a/examples/v2/security-monitoring/GetStaticAnalysisTreeSitterWasm.rb b/examples/v2/security-monitoring/GetStaticAnalysisTreeSitterWasm.rb new file mode 100644 index 000000000000..6ad0ee97d62b --- /dev/null +++ b/examples/v2/security-monitoring/GetStaticAnalysisTreeSitterWasm.rb @@ -0,0 +1,8 @@ +# Get tree-sitter WASM file returns "BLOB with the content of the WASM file" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_static_analysis_tree_sitter_wasm".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new +p api_instance.get_static_analysis_tree_sitter_wasm("tree-sitter-python.wasm") diff --git a/examples/v2/security-monitoring/ListStaticAnalysisCodegenRulesets.rb b/examples/v2/security-monitoring/ListStaticAnalysisCodegenRulesets.rb new file mode 100644 index 000000000000..d5615d42aa9c --- /dev/null +++ b/examples/v2/security-monitoring/ListStaticAnalysisCodegenRulesets.rb @@ -0,0 +1,8 @@ +# List codegen rulesets returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_static_analysis_codegen_rulesets".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new +p api_instance.list_static_analysis_codegen_rulesets() diff --git a/examples/v2/static-analysis/CreateAiCustomRule.rb b/examples/v2/static-analysis/CreateAiCustomRule.rb new file mode 100644 index 000000000000..59ab70ae1178 --- /dev/null +++ b/examples/v2/static-analysis/CreateAiCustomRule.rb @@ -0,0 +1,18 @@ +# Create an AI custom rule returns "Successfully created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_ai_custom_rule".to_sym] = true +end +api_instance = DatadogAPIClient::V2::StaticAnalysisAPI.new + +body = DatadogAPIClient::V2::AiCustomRuleRequest.new({ + data: DatadogAPIClient::V2::AiCustomRuleRequestData.new({ + attributes: DatadogAPIClient::V2::AiCustomRuleRequestAttributes.new({ + name: "my-ai-rule", + }), + id: "my-ai-rule", + type: DatadogAPIClient::V2::AiCustomRuleDataType::AI_RULE, + }), +}) +p api_instance.create_ai_custom_rule("my-ai-ruleset", body) diff --git a/examples/v2/static-analysis/CreateAiCustomRuleRevision.rb b/examples/v2/static-analysis/CreateAiCustomRuleRevision.rb new file mode 100644 index 000000000000..27e796a381e5 --- /dev/null +++ b/examples/v2/static-analysis/CreateAiCustomRuleRevision.rb @@ -0,0 +1,31 @@ +# Create an AI custom rule revision returns "Successfully created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_ai_custom_rule_revision".to_sym] = true +end +api_instance = DatadogAPIClient::V2::StaticAnalysisAPI.new + +body = DatadogAPIClient::V2::AiCustomRuleRevisionRequest.new({ + data: DatadogAPIClient::V2::AiCustomRuleRevisionRequestData.new({ + attributes: DatadogAPIClient::V2::AiCustomRuleRevisionRequestAttributes.new({ + category: DatadogAPIClient::V2::CustomRuleRevisionAttributesCategory::SECURITY, + content: "Content", + cwe: "79", + description: "Ruleset description", + directories: [], + execution_mode: DatadogAPIClient::V2::AiCustomRuleRevisionExecutionMode::AUTO, + globs: [ + "**/*.py", + ], + is_published: false, + is_testing: false, + severity: DatadogAPIClient::V2::CustomRuleRevisionAttributesSeverity::ERROR, + short_description: "Ruleset short description", + version_id: 1, + }), + id: "revision-abc-123", + type: DatadogAPIClient::V2::AiCustomRuleRevisionDataType::AI_RULE_REVISION, + }), +}) +p api_instance.create_ai_custom_rule_revision("my-ai-ruleset", "my-ai-rule", body) diff --git a/examples/v2/static-analysis/CreateAiCustomRuleset.rb b/examples/v2/static-analysis/CreateAiCustomRuleset.rb new file mode 100644 index 000000000000..5aea3432e8a3 --- /dev/null +++ b/examples/v2/static-analysis/CreateAiCustomRuleset.rb @@ -0,0 +1,20 @@ +# Create an AI custom ruleset returns "Successfully created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_ai_custom_ruleset".to_sym] = true +end +api_instance = DatadogAPIClient::V2::StaticAnalysisAPI.new + +body = DatadogAPIClient::V2::AiCustomRulesetRequest.new({ + data: DatadogAPIClient::V2::AiCustomRulesetRequestData.new({ + attributes: DatadogAPIClient::V2::AiCustomRulesetRequestAttributes.new({ + description: "Ruleset description", + name: "my-ai-ruleset", + short_description: "Ruleset short description", + }), + id: "my-ai-ruleset", + type: DatadogAPIClient::V2::AiCustomRulesetDataType::AI_RULESET, + }), +}) +p api_instance.create_ai_custom_ruleset(body) diff --git a/examples/v2/static-analysis/CreateAiMemoryViolationResult.rb b/examples/v2/static-analysis/CreateAiMemoryViolationResult.rb new file mode 100644 index 000000000000..cf000e557a60 --- /dev/null +++ b/examples/v2/static-analysis/CreateAiMemoryViolationResult.rb @@ -0,0 +1,24 @@ +# Create an AI memory violation result returns "Successfully created" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_ai_memory_violation_result".to_sym] = true +end +api_instance = DatadogAPIClient::V2::StaticAnalysisAPI.new + +body = DatadogAPIClient::V2::AiMemoryViolationResultRequest.new({ + data: DatadogAPIClient::V2::AiMemoryViolationResultRequestData.new({ + attributes: DatadogAPIClient::V2::AiMemoryViolationResultRequestAttributes.new({ + line: 10, + message: "This is a false positive because the input is sanitized.", + name: "src/main.py", + repository_id: "my-repo", + rule: "my-ai-ruleset/my-ai-rule", + sha: "abc123def456789012345678901234567890abcd", + type: DatadogAPIClient::V2::AiMemoryViolationType::FP, + }), + id: "violation-abc", + type: DatadogAPIClient::V2::AiMemoryViolationResultDataType::AI_MEMORY_VIOLATION_RESULT, + }), +}) +p api_instance.create_ai_memory_violation_result(body) diff --git a/examples/v2/static-analysis/CreateCustomRuleset.rb b/examples/v2/static-analysis/CreateCustomRuleset.rb new file mode 100644 index 000000000000..f171fd0c9ab2 --- /dev/null +++ b/examples/v2/static-analysis/CreateCustomRuleset.rb @@ -0,0 +1,63 @@ +# Create Custom Ruleset returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_custom_ruleset".to_sym] = true +end +api_instance = DatadogAPIClient::V2::StaticAnalysisAPI.new + +body = DatadogAPIClient::V2::CustomRulesetRequest.new({ + data: DatadogAPIClient::V2::CustomRulesetRequestData.new({ + attributes: DatadogAPIClient::V2::CustomRulesetRequestDataAttributes.new({ + rules: [ + DatadogAPIClient::V2::CustomRule.new({ + created_at: "2026-01-09T13:00:57.473141Z", + created_by: "foobarbaz", + last_revision: DatadogAPIClient::V2::CustomRuleRevision.new({ + attributes: DatadogAPIClient::V2::CustomRuleRevisionAttributes.new({ + arguments: [ + DatadogAPIClient::V2::Argument.new({ + description: "YXJndW1lbnQgZGVzY3JpcHRpb24=", + name: "YXJndW1lbnRfbmFtZQ==", + }), + ], + category: DatadogAPIClient::V2::CustomRuleRevisionAttributesCategory::SECURITY, + checksum: "8a66c4e4e631099ad71be3c1ea3ea8fc2d57193e56db2c296e2dd8a508b26b99", + code: "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==", + created_at: "2026-01-09T13:00:57.473141Z", + created_by: "foobarbaz", + creation_message: "Initial revision", + cve: "CVE-2024-1234", + cwe: "CWE-79", + description: "bG9uZyBkZXNjcmlwdGlvbg==", + documentation_url: "https://docs.example.com/rules/my-rule", + is_published: false, + is_testing: false, + language: DatadogAPIClient::V2::Language::PYTHON, + severity: DatadogAPIClient::V2::CustomRuleRevisionAttributesSeverity::ERROR, + short_description: "c2hvcnQgZGVzY3JpcHRpb24=", + should_use_ai_fix: false, + tags: [ + "security", + "custom", + ], + tests: [ + DatadogAPIClient::V2::CustomRuleRevisionTest.new({ + annotation_count: 1, + code: "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==", + filename: "test.yaml", + }), + ], + tree_sitter_query: "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==", + }), + id: "revision-123", + type: DatadogAPIClient::V2::CustomRuleRevisionDataType::CUSTOM_RULE_REVISION, + }), + name: "my-rule", + }), + ], + }), + type: DatadogAPIClient::V2::CustomRulesetDataType::CUSTOM_RULESET, + }), +}) +p api_instance.create_custom_ruleset(body) diff --git a/examples/v2/static-analysis/DeleteAiCustomRule.rb b/examples/v2/static-analysis/DeleteAiCustomRule.rb new file mode 100644 index 000000000000..8f47a100631f --- /dev/null +++ b/examples/v2/static-analysis/DeleteAiCustomRule.rb @@ -0,0 +1,8 @@ +# Delete an AI custom rule returns "Successfully deleted" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_ai_custom_rule".to_sym] = true +end +api_instance = DatadogAPIClient::V2::StaticAnalysisAPI.new +p api_instance.delete_ai_custom_rule("my-ai-ruleset", "my-ai-rule") diff --git a/examples/v2/static-analysis/DeleteAiCustomRuleset.rb b/examples/v2/static-analysis/DeleteAiCustomRuleset.rb new file mode 100644 index 000000000000..67c094813756 --- /dev/null +++ b/examples/v2/static-analysis/DeleteAiCustomRuleset.rb @@ -0,0 +1,8 @@ +# Delete an AI custom ruleset returns "Successfully deleted" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_ai_custom_ruleset".to_sym] = true +end +api_instance = DatadogAPIClient::V2::StaticAnalysisAPI.new +p api_instance.delete_ai_custom_ruleset("my-ai-ruleset") diff --git a/examples/v2/static-analysis/DeleteAiMemoryViolationResult.rb b/examples/v2/static-analysis/DeleteAiMemoryViolationResult.rb new file mode 100644 index 000000000000..96a6184dff0d --- /dev/null +++ b/examples/v2/static-analysis/DeleteAiMemoryViolationResult.rb @@ -0,0 +1,8 @@ +# Delete an AI memory violation result returns "Successfully deleted" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_ai_memory_violation_result".to_sym] = true +end +api_instance = DatadogAPIClient::V2::StaticAnalysisAPI.new +p api_instance.delete_ai_memory_violation_result("42") diff --git a/examples/v2/static-analysis/GetAiCustomRule.rb b/examples/v2/static-analysis/GetAiCustomRule.rb new file mode 100644 index 000000000000..7e60310a02f5 --- /dev/null +++ b/examples/v2/static-analysis/GetAiCustomRule.rb @@ -0,0 +1,8 @@ +# Get an AI custom rule returns "Successful response" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_ai_custom_rule".to_sym] = true +end +api_instance = DatadogAPIClient::V2::StaticAnalysisAPI.new +p api_instance.get_ai_custom_rule("my-ai-ruleset", "my-ai-rule") diff --git a/examples/v2/static-analysis/GetAiCustomRuleRevision.rb b/examples/v2/static-analysis/GetAiCustomRuleRevision.rb new file mode 100644 index 000000000000..36c61cb7c4a8 --- /dev/null +++ b/examples/v2/static-analysis/GetAiCustomRuleRevision.rb @@ -0,0 +1,8 @@ +# Get an AI custom rule revision returns "Successful response" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_ai_custom_rule_revision".to_sym] = true +end +api_instance = DatadogAPIClient::V2::StaticAnalysisAPI.new +p api_instance.get_ai_custom_rule_revision("my-ai-ruleset", "my-ai-rule", "revision-abc-123") diff --git a/examples/v2/static-analysis/GetAiCustomRuleset.rb b/examples/v2/static-analysis/GetAiCustomRuleset.rb new file mode 100644 index 000000000000..34cac69121a5 --- /dev/null +++ b/examples/v2/static-analysis/GetAiCustomRuleset.rb @@ -0,0 +1,8 @@ +# Get an AI custom ruleset returns "Successful response" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_ai_custom_ruleset".to_sym] = true +end +api_instance = DatadogAPIClient::V2::StaticAnalysisAPI.new +p api_instance.get_ai_custom_ruleset("my-ai-ruleset") diff --git a/examples/v2/static-analysis/ListAiCustomRuleRevisions.rb b/examples/v2/static-analysis/ListAiCustomRuleRevisions.rb new file mode 100644 index 000000000000..f1656f8ec657 --- /dev/null +++ b/examples/v2/static-analysis/ListAiCustomRuleRevisions.rb @@ -0,0 +1,8 @@ +# List AI custom rule revisions returns "Successful response" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_ai_custom_rule_revisions".to_sym] = true +end +api_instance = DatadogAPIClient::V2::StaticAnalysisAPI.new +p api_instance.list_ai_custom_rule_revisions("my-ai-ruleset", "my-ai-rule") diff --git a/examples/v2/static-analysis/ListAiCustomRuleRevisions_842014679.rb b/examples/v2/static-analysis/ListAiCustomRuleRevisions_842014679.rb new file mode 100644 index 000000000000..d6eb46589c90 --- /dev/null +++ b/examples/v2/static-analysis/ListAiCustomRuleRevisions_842014679.rb @@ -0,0 +1,8 @@ +# List AI custom rule revisions returns "Successful response" response with pagination + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_ai_custom_rule_revisions".to_sym] = true +end +api_instance = DatadogAPIClient::V2::StaticAnalysisAPI.new +api_instance.list_ai_custom_rule_revisions_with_pagination("my-ai-ruleset", "my-ai-rule") { |item| puts item } diff --git a/examples/v2/static-analysis/ListAiCustomRulesets.rb b/examples/v2/static-analysis/ListAiCustomRulesets.rb new file mode 100644 index 000000000000..c587a0b9c6e1 --- /dev/null +++ b/examples/v2/static-analysis/ListAiCustomRulesets.rb @@ -0,0 +1,8 @@ +# List AI custom rulesets returns "Successful response" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_ai_custom_rulesets".to_sym] = true +end +api_instance = DatadogAPIClient::V2::StaticAnalysisAPI.new +p api_instance.list_ai_custom_rulesets() diff --git a/examples/v2/static-analysis/ListAiMemoryViolationResults.rb b/examples/v2/static-analysis/ListAiMemoryViolationResults.rb new file mode 100644 index 000000000000..065d671d29d2 --- /dev/null +++ b/examples/v2/static-analysis/ListAiMemoryViolationResults.rb @@ -0,0 +1,8 @@ +# List AI memory violation results returns "Successful response" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_ai_memory_violation_results".to_sym] = true +end +api_instance = DatadogAPIClient::V2::StaticAnalysisAPI.new +p api_instance.list_ai_memory_violation_results() diff --git a/examples/v2/static-analysis/ListAiPrompts.rb b/examples/v2/static-analysis/ListAiPrompts.rb new file mode 100644 index 000000000000..e3c23a63bd75 --- /dev/null +++ b/examples/v2/static-analysis/ListAiPrompts.rb @@ -0,0 +1,8 @@ +# List AI prompts returns "Successful response" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_ai_prompts".to_sym] = true +end +api_instance = DatadogAPIClient::V2::StaticAnalysisAPI.new +p api_instance.list_ai_prompts() diff --git a/examples/v2/static-analysis/ListCustomRulesets.rb b/examples/v2/static-analysis/ListCustomRulesets.rb new file mode 100644 index 000000000000..56e2cca25f10 --- /dev/null +++ b/examples/v2/static-analysis/ListCustomRulesets.rb @@ -0,0 +1,8 @@ +# List Custom Rulesets returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_custom_rulesets".to_sym] = true +end +api_instance = DatadogAPIClient::V2::StaticAnalysisAPI.new +p api_instance.list_custom_rulesets() diff --git a/examples/v2/static-analysis/UpdateAiCustomRuleset.rb b/examples/v2/static-analysis/UpdateAiCustomRuleset.rb new file mode 100644 index 000000000000..0f86ed6a1c9e --- /dev/null +++ b/examples/v2/static-analysis/UpdateAiCustomRuleset.rb @@ -0,0 +1,20 @@ +# Update an AI custom ruleset returns "Successfully updated" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_ai_custom_ruleset".to_sym] = true +end +api_instance = DatadogAPIClient::V2::StaticAnalysisAPI.new + +body = DatadogAPIClient::V2::AiCustomRulesetUpdateRequest.new({ + data: DatadogAPIClient::V2::AiCustomRulesetUpdateData.new({ + attributes: DatadogAPIClient::V2::AiCustomRulesetUpdateAttributes.new({ + description: "Ruleset description", + name: "my-ai-ruleset", + short_description: "Ruleset short description", + }), + id: "my-ai-ruleset", + type: DatadogAPIClient::V2::AiCustomRulesetDataType::AI_RULESET, + }), +}) +p api_instance.update_ai_custom_ruleset("my-ai-ruleset", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 027e14e188a3..aa666f33aa07 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2366,9 +2366,29 @@ "page_cursor" => "String", "page_limit" => "Integer", }, + "v2.GetStaticAnalysisDefaultRulesets" => { + "language" => "String", + }, "v2.ListMultipleRulesets" => { "body" => "GetMultipleRulesetsRequest", }, + "v2.GetStaticAnalysisRuleset" => { + "ruleset_name" => "String", + "include_tests" => "Boolean", + "include_testing_rules" => "Boolean", + }, + "v2.CreateStaticAnalysisServerAnalysis" => { + "body" => "AnalysisRequest", + }, + "v2.CreateStaticAnalysisAst" => { + "body" => "GetAstRequest", + }, + "v2.GetStaticAnalysisNodeTypes" => { + "language" => "String", + }, + "v2.GetStaticAnalysisTreeSitterWasm" => { + "file" => "String", + }, "v2.UpsertSyncConfig" => { "body" => "UpsertCloudInventorySyncConfigRequest", }, @@ -4230,6 +4250,19 @@ "exclusion_filter_id" => "String", "body" => "ApplicationSecurityWafExclusionFilterUpdateRequest", }, + "v2.CreateApplicationSecurityWafPolicy" => { + "body" => "ApplicationSecurityPolicyCreateRequest", + }, + "v2.DeleteApplicationSecurityWafPolicy" => { + "policy_id" => "String", + }, + "v2.GetApplicationSecurityWafPolicy" => { + "policy_id" => "String", + }, + "v2.UpdateApplicationSecurityWafPolicy" => { + "policy_id" => "String", + "body" => "ApplicationSecurityPolicyUpdateRequest", + }, "v2.ListCSMThreatsAgentRules" => { "policy_id" => "String", }, @@ -4692,6 +4725,60 @@ "v2.CreateSCAResolveVulnerableSymbols" => { "body" => "ResolveVulnerableSymbolsRequest", }, + "v2.CreateAiMemoryViolationResult" => { + "body" => "AiMemoryViolationResultRequest", + }, + "v2.DeleteAiMemoryViolationResult" => { + "id" => "String", + }, + "v2.ListAiCustomRulesets" => { + "page_offset" => "Integer", + "page_limit" => "Integer", + }, + "v2.CreateAiCustomRuleset" => { + "body" => "AiCustomRulesetRequest", + }, + "v2.DeleteAiCustomRuleset" => { + "ruleset_name" => "String", + }, + "v2.GetAiCustomRuleset" => { + "ruleset_name" => "String", + }, + "v2.UpdateAiCustomRuleset" => { + "ruleset_name" => "String", + "body" => "AiCustomRulesetUpdateRequest", + }, + "v2.CreateAiCustomRule" => { + "ruleset_name" => "String", + "body" => "AiCustomRuleRequest", + }, + "v2.DeleteAiCustomRule" => { + "ruleset_name" => "String", + "rule_name" => "String", + }, + "v2.GetAiCustomRule" => { + "ruleset_name" => "String", + "rule_name" => "String", + }, + "v2.ListAiCustomRuleRevisions" => { + "ruleset_name" => "String", + "rule_name" => "String", + "page_offset" => "Integer", + "page_limit" => "Integer", + }, + "v2.CreateAiCustomRuleRevision" => { + "ruleset_name" => "String", + "rule_name" => "String", + "body" => "AiCustomRuleRevisionRequest", + }, + "v2.GetAiCustomRuleRevision" => { + "ruleset_name" => "String", + "rule_name" => "String", + "id" => "String", + }, + "v2.CreateCustomRuleset" => { + "body" => "CustomRulesetRequest", + }, "v2.DeleteCustomRuleset" => { "ruleset_name" => "String", }, diff --git a/features/v2/application_security.feature b/features/v2/application_security.feature index aad0642b718a..4dbda1c46942 100644 --- a/features/v2/application_security.feature +++ b/features/v2/application_security.feature @@ -13,6 +13,27 @@ Feature: Application Security And a valid "appKeyAuth" key in the system And an instance of "ApplicationSecurity" API + @generated @skip @team:DataDog/asm-backend + Scenario: Create a WAF Policy returns "Bad Request" response + Given new "CreateApplicationSecurityWafPolicy" request + And body with value {"data": {"attributes": {"basedOn": "recommended", "description": "Policy applied to internal web applications.", "isDefault": false, "name": "Internal Network Policy", "protectionPresets": ["attack-tools"], "rules": [{"blocking": false, "enabled": true, "extended_data_collection": false, "id": "rasp-001-002"}], "rulesets": [{"blocking": false, "enabled": true, "id": "attack_tool"}], "scope": [{"env": "prod", "service": "billing-service"}], "version": 0}, "type": "policy"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/asm-backend + Scenario: Create a WAF Policy returns "Concurrent Modification" response + Given new "CreateApplicationSecurityWafPolicy" request + And body with value {"data": {"attributes": {"basedOn": "recommended", "description": "Policy applied to internal web applications.", "isDefault": false, "name": "Internal Network Policy", "protectionPresets": ["attack-tools"], "rules": [{"blocking": false, "enabled": true, "extended_data_collection": false, "id": "rasp-001-002"}], "rulesets": [{"blocking": false, "enabled": true, "id": "attack_tool"}], "scope": [{"env": "prod", "service": "billing-service"}], "version": 0}, "type": "policy"}} + When the request is sent + Then the response status is 409 Concurrent Modification + + @team:DataDog/asm-backend + Scenario: Create a WAF Policy returns "Created" response + Given new "CreateApplicationSecurityWafPolicy" request + And body with value {"data": {"attributes": {"basedOn": "recommended", "description": "Policy applied to internal web applications.", "isDefault": false, "name": "Internal Network Policy", "protectionPresets": ["attack-tools"], "rules": [{"blocking": false, "enabled": true, "id": "rasp-001-002"}], "scope": [{"env": "prod", "service": "billing-service"}], "version": 0}, "type": "policy"}} + When the request is sent + Then the response status is 201 Created + @generated @skip @team:DataDog/asm-backend Scenario: Create a WAF custom rule returns "Bad Request" response Given new "CreateApplicationSecurityWafCustomRule" request @@ -84,6 +105,27 @@ Feature: Application Security When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/asm-backend + Scenario: Delete a WAF Policy returns "Concurrent Modification" response + Given new "DeleteApplicationSecurityWafPolicy" request + And request contains "policy_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 409 Concurrent Modification + + @generated @skip @team:DataDog/asm-backend + Scenario: Delete a WAF Policy returns "No Content" response + Given new "DeleteApplicationSecurityWafPolicy" request + And request contains "policy_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/asm-backend + Scenario: Delete a WAF Policy returns "Not Found" response + Given new "DeleteApplicationSecurityWafPolicy" request + And request contains "policy_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/asm-backend Scenario: Delete a WAF exclusion filter returns "Concurrent Modification" response Given new "DeleteApplicationSecurityWafExclusionFilter" request @@ -106,6 +148,14 @@ Feature: Application Security When the request is sent Then the response status is 204 OK + @team:DataDog/asm-backend + Scenario: Get a WAF Policy returns "OK" response + Given there is a valid "policy" in the system + And new "GetApplicationSecurityWafPolicy" request + And request contains "policy_id" parameter from "policy.data.id" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/asm-backend Scenario: Get a WAF custom rule returns "OK" response Given new "GetApplicationSecurityWafCustomRule" request @@ -140,6 +190,12 @@ Feature: Application Security When the request is sent Then the response status is 200 OK + @team:DataDog/asm-backend + Scenario: List all WAF policies returns "OK" response + Given new "ListApplicationSecurityWAFPolicies" request + When the request is sent + Then the response status is 200 OK + @team:DataDog/asm-backend Scenario: Update a WAF Custom Rule returns "Bad Request" response Given there is a valid "custom_rule" in the system @@ -174,6 +230,38 @@ Feature: Application Security When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/asm-backend + Scenario: Update a WAF Policy returns "Bad Request" response + Given new "UpdateApplicationSecurityWafPolicy" request + And request contains "policy_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Policy applied to internal web applications.", "isDefault": false, "name": "Internal Network Policy", "protectionPresets": ["attack-tools"], "rules": [{"blocking": false, "enabled": true, "extended_data_collection": false, "id": "rasp-001-002"}], "rulesets": [{"blocking": false, "enabled": true, "id": "attack_tool"}], "scope": [{"env": "prod", "service": "billing-service"}], "version": 0}, "type": "policy"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/asm-backend + Scenario: Update a WAF Policy returns "Concurrent Modification" response + Given new "UpdateApplicationSecurityWafPolicy" request + And request contains "policy_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Policy applied to internal web applications.", "isDefault": false, "name": "Internal Network Policy", "protectionPresets": ["attack-tools"], "rules": [{"blocking": false, "enabled": true, "extended_data_collection": false, "id": "rasp-001-002"}], "rulesets": [{"blocking": false, "enabled": true, "id": "attack_tool"}], "scope": [{"env": "prod", "service": "billing-service"}], "version": 0}, "type": "policy"}} + When the request is sent + Then the response status is 409 Concurrent Modification + + @generated @skip @team:DataDog/asm-backend + Scenario: Update a WAF Policy returns "Not Found" response + Given new "UpdateApplicationSecurityWafPolicy" request + And request contains "policy_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Policy applied to internal web applications.", "isDefault": false, "name": "Internal Network Policy", "protectionPresets": ["attack-tools"], "rules": [{"blocking": false, "enabled": true, "extended_data_collection": false, "id": "rasp-001-002"}], "rulesets": [{"blocking": false, "enabled": true, "id": "attack_tool"}], "scope": [{"env": "prod", "service": "billing-service"}], "version": 0}, "type": "policy"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/asm-backend + Scenario: Update a WAF Policy returns "OK" response + Given new "UpdateApplicationSecurityWafPolicy" request + And request contains "policy_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Policy applied to internal web applications.", "isDefault": false, "name": "Internal Network Policy", "protectionPresets": ["attack-tools"], "rules": [{"blocking": false, "enabled": true, "extended_data_collection": false, "id": "rasp-001-002"}], "rulesets": [{"blocking": false, "enabled": true, "id": "attack_tool"}], "scope": [{"env": "prod", "service": "billing-service"}], "version": 0}, "type": "policy"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/asm-backend Scenario: Update a WAF exclusion filter returns "Bad Request" response Given there is a valid "custom_rule" in the system diff --git a/features/v2/given.json b/features/v2/given.json index 377255ff82d1..c3388d681ec8 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -1034,6 +1034,18 @@ "tag": "Application Security", "operationId": "CreateApplicationSecurityWafExclusionFilter" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"policy\",\n \"attributes\": {\n \"name\": \"Test policy\",\n \"description\": \"This is a test policy.\",\n \"basedOn\": \"recommended\"\n }\n }\n}" + } + ], + "step": "there is a valid \"policy\" in the system", + "key": "policy", + "tag": "Application Security", + "operationId": "CreateApplicationSecurityWafPolicy" + }, { "parameters": [ { diff --git a/features/v2/security_monitoring.feature b/features/v2/security_monitoring.feature index 485a947631d8..5e6f325a43ad 100644 --- a/features/v2/security_monitoring.feature +++ b/features/v2/security_monitoring.feature @@ -25,6 +25,22 @@ Feature: Security Monitoring When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Analyze code returns "Bad Request" response + Given operation "CreateStaticAnalysisServerAnalysis" enabled + And new "CreateStaticAnalysisServerAnalysis" request + And body with value {"data": {"attributes": {"code": "aW1wb3J0IHN5cw==", "file_encoding": "utf-8", "filename": "test.py", "language": "python", "rules": [{"category": "BEST_PRACTICES", "checksum": "abc123def456", "code": "ZnVuY3Rpb24gdmlzaXQobm9kZSkge30=", "entity_checked": null, "id": "python-best-practices/no-exit", "language": "python", "regex": null, "severity": "WARNING", "tree_sitter_query": "KGNhbGwgbmFtZTogKGF0dHJpYnV0ZSkpQHZhbA==", "type": "TREE_SITTER_QUERY"}]}, "type": "analysis_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Analyze code returns "OK" response + Given operation "CreateStaticAnalysisServerAnalysis" enabled + And new "CreateStaticAnalysisServerAnalysis" request + And body with value {"data": {"attributes": {"code": "aW1wb3J0IHN5cw==", "file_encoding": "utf-8", "filename": "test.py", "language": "python", "rules": [{"category": "BEST_PRACTICES", "checksum": "abc123def456", "code": "ZnVuY3Rpb24gdmlzaXQobm9kZSkge30=", "entity_checked": null, "id": "python-best-practices/no-exit", "language": "python", "regex": null, "severity": "WARNING", "tree_sitter_query": "KGNhbGwgbmFtZTogKGF0dHJpYnV0ZSkpQHZhbA==", "type": "TREE_SITTER_QUERY"}]}, "type": "analysis_request"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/k9-investigation Scenario: Attach security finding to a Jira issue returns "OK" response Given new "AttachJiraIssue" request @@ -1076,6 +1092,22 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Get AST for source code returns "Bad Request" response + Given operation "CreateStaticAnalysisAst" enabled + And new "CreateStaticAnalysisAst" request + And body with value {"data": {"attributes": {"code": "aW1wb3J0IHN5cw==", "file_encoding": "utf-8", "language": "python"}, "type": "get_ast_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Get AST for source code returns "OK" response + Given operation "CreateStaticAnalysisAst" enabled + And new "CreateStaticAnalysisAst" request + And body with value {"data": {"attributes": {"code": "aW1wb3J0IHN5cw==", "file_encoding": "utf-8", "language": "python"}, "type": "get_ast_request"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/k9-cloud-vm Scenario: Get SBOM returns "Bad request: The server cannot process the request due to invalid syntax in the request." response Given new "GetSBOM" request @@ -1100,6 +1132,30 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Get a SAST ruleset returns "Bad Request" response + Given operation "GetStaticAnalysisRuleset" enabled + And new "GetStaticAnalysisRuleset" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Get a SAST ruleset returns "Not Found" response + Given operation "GetStaticAnalysisRuleset" enabled + And new "GetStaticAnalysisRuleset" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Get a SAST ruleset returns "OK" response + Given operation "GetStaticAnalysisRuleset" enabled + And new "GetStaticAnalysisRuleset" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @skip-validation @team:DataDog/k9-cloud-siem Scenario: Get a cloud configuration rule's details returns "OK" response Given there is a valid "cloud_configuration_rule" in the system @@ -1515,6 +1571,22 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Get default rulesets for a language returns "Bad Request" response + Given operation "GetStaticAnalysisDefaultRulesets" enabled + And new "GetStaticAnalysisDefaultRulesets" request + And request contains "language" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Get default rulesets for a language returns "OK" response + Given operation "GetStaticAnalysisDefaultRulesets" enabled + And new "GetStaticAnalysisDefaultRulesets" request + And request contains "language" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/cloud-security-posture-management Scenario: Get details of a signal-based notification rule returns "Bad Request" response Given new "GetSignalNotificationRule" request @@ -1616,6 +1688,22 @@ Feature: Security Monitoring And the response "data[0].attributes" has field "query_filter" And the response "data[0].attributes" has field "url" + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Get node types for a language returns "Bad Request" response + Given operation "GetStaticAnalysisNodeTypes" enabled + And new "GetStaticAnalysisNodeTypes" request + And request contains "language" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Get node types for a language returns "OK" response + Given operation "GetStaticAnalysisNodeTypes" enabled + And new "GetStaticAnalysisNodeTypes" request + And request contains "language" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @skip-go @skip-java @skip-ruby @team:DataDog/k9-cloud-siem Scenario: Get rule version history returns "OK" response Given operation "GetRuleVersionHistory" enabled @@ -1715,6 +1803,22 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Get tree-sitter WASM file returns "BLOB with the content of the WASM file" response + Given operation "GetStaticAnalysisTreeSitterWasm" enabled + And new "GetStaticAnalysisTreeSitterWasm" request + And request contains "file" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 BLOB with the content of the WASM file + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Get tree-sitter WASM file returns "Bad Request" response + Given operation "GetStaticAnalysisTreeSitterWasm" enabled + And new "GetStaticAnalysisTreeSitterWasm" request + And request contains "file" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + @generated @skip @team:DataDog/k9-cloud-vm Scenario: List assets SBOMs returns "Bad request: The server cannot process the request due to invalid syntax in the request." response Given new "ListAssetsSBOMs" request @@ -1743,6 +1847,20 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/k9-vm-ast + Scenario: List codegen rulesets returns "Bad Request" response + Given operation "ListStaticAnalysisCodegenRulesets" enabled + And new "ListStaticAnalysisCodegenRulesets" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: List codegen rulesets returns "OK" response + Given operation "ListStaticAnalysisCodegenRulesets" enabled + And new "ListStaticAnalysisCodegenRulesets" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/k9-cloud-siem Scenario: List entity context sync configurations returns "OK" response Given operation "ListSecurityMonitoringIntegrationConfigs" enabled diff --git a/features/v2/static_analysis.feature b/features/v2/static_analysis.feature index 879e8dca94ff..3d690035c187 100644 --- a/features/v2/static_analysis.feature +++ b/features/v2/static_analysis.feature @@ -73,6 +73,160 @@ Feature: Static Analysis When the request is sent Then the response status is 200 Successfully created + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Create Custom Ruleset returns "Bad Request" response + Given operation "CreateCustomRuleset" enabled + And new "CreateCustomRuleset" request + And body with value {"data": {"attributes": {"rules": [{"created_at": "2026-01-09T13:00:57.473141Z", "created_by": "foobarbaz", "last_revision": {"attributes": {"arguments": [{"description": "YXJndW1lbnQgZGVzY3JpcHRpb24=", "name": "YXJndW1lbnRfbmFtZQ=="}], "category": "SECURITY", "checksum": "8a66c4e4e631099ad71be3c1ea3ea8fc2d57193e56db2c296e2dd8a508b26b99", "code": "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==", "created_at": "2026-01-09T13:00:57.473141Z", "created_by": "foobarbaz", "creation_message": "Initial revision", "cve": "CVE-2024-1234", "cwe": "CWE-79", "description": "bG9uZyBkZXNjcmlwdGlvbg==", "documentation_url": "https://docs.example.com/rules/my-rule", "is_published": false, "is_testing": false, "language": "PYTHON", "severity": "ERROR", "short_description": "c2hvcnQgZGVzY3JpcHRpb24=", "should_use_ai_fix": false, "tags": ["security", "custom"], "tests": [{"annotation_count": 1, "code": "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==", "filename": "test.yaml"}], "tree_sitter_query": "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ=="}, "id": "revision-123", "type": "custom_rule_revision"}, "name": "my-rule"}]}, "type": "custom_ruleset"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Create Custom Ruleset returns "Conflict" response + Given operation "CreateCustomRuleset" enabled + And new "CreateCustomRuleset" request + And body with value {"data": {"attributes": {"rules": [{"created_at": "2026-01-09T13:00:57.473141Z", "created_by": "foobarbaz", "last_revision": {"attributes": {"arguments": [{"description": "YXJndW1lbnQgZGVzY3JpcHRpb24=", "name": "YXJndW1lbnRfbmFtZQ=="}], "category": "SECURITY", "checksum": "8a66c4e4e631099ad71be3c1ea3ea8fc2d57193e56db2c296e2dd8a508b26b99", "code": "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==", "created_at": "2026-01-09T13:00:57.473141Z", "created_by": "foobarbaz", "creation_message": "Initial revision", "cve": "CVE-2024-1234", "cwe": "CWE-79", "description": "bG9uZyBkZXNjcmlwdGlvbg==", "documentation_url": "https://docs.example.com/rules/my-rule", "is_published": false, "is_testing": false, "language": "PYTHON", "severity": "ERROR", "short_description": "c2hvcnQgZGVzY3JpcHRpb24=", "should_use_ai_fix": false, "tags": ["security", "custom"], "tests": [{"annotation_count": 1, "code": "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==", "filename": "test.yaml"}], "tree_sitter_query": "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ=="}, "id": "revision-123", "type": "custom_rule_revision"}, "name": "my-rule"}]}, "type": "custom_ruleset"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Create Custom Ruleset returns "OK" response + Given operation "CreateCustomRuleset" enabled + And new "CreateCustomRuleset" request + And body with value {"data": {"attributes": {"rules": [{"created_at": "2026-01-09T13:00:57.473141Z", "created_by": "foobarbaz", "last_revision": {"attributes": {"arguments": [{"description": "YXJndW1lbnQgZGVzY3JpcHRpb24=", "name": "YXJndW1lbnRfbmFtZQ=="}], "category": "SECURITY", "checksum": "8a66c4e4e631099ad71be3c1ea3ea8fc2d57193e56db2c296e2dd8a508b26b99", "code": "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==", "created_at": "2026-01-09T13:00:57.473141Z", "created_by": "foobarbaz", "creation_message": "Initial revision", "cve": "CVE-2024-1234", "cwe": "CWE-79", "description": "bG9uZyBkZXNjcmlwdGlvbg==", "documentation_url": "https://docs.example.com/rules/my-rule", "is_published": false, "is_testing": false, "language": "PYTHON", "severity": "ERROR", "short_description": "c2hvcnQgZGVzY3JpcHRpb24=", "should_use_ai_fix": false, "tags": ["security", "custom"], "tests": [{"annotation_count": 1, "code": "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==", "filename": "test.yaml"}], "tree_sitter_query": "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ=="}, "id": "revision-123", "type": "custom_rule_revision"}, "name": "my-rule"}]}, "type": "custom_ruleset"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Create Custom Ruleset returns "Precondition Failed" response + Given operation "CreateCustomRuleset" enabled + And new "CreateCustomRuleset" request + And body with value {"data": {"attributes": {"rules": [{"created_at": "2026-01-09T13:00:57.473141Z", "created_by": "foobarbaz", "last_revision": {"attributes": {"arguments": [{"description": "YXJndW1lbnQgZGVzY3JpcHRpb24=", "name": "YXJndW1lbnRfbmFtZQ=="}], "category": "SECURITY", "checksum": "8a66c4e4e631099ad71be3c1ea3ea8fc2d57193e56db2c296e2dd8a508b26b99", "code": "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==", "created_at": "2026-01-09T13:00:57.473141Z", "created_by": "foobarbaz", "creation_message": "Initial revision", "cve": "CVE-2024-1234", "cwe": "CWE-79", "description": "bG9uZyBkZXNjcmlwdGlvbg==", "documentation_url": "https://docs.example.com/rules/my-rule", "is_published": false, "is_testing": false, "language": "PYTHON", "severity": "ERROR", "short_description": "c2hvcnQgZGVzY3JpcHRpb24=", "should_use_ai_fix": false, "tags": ["security", "custom"], "tests": [{"annotation_count": 1, "code": "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==", "filename": "test.yaml"}], "tree_sitter_query": "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ=="}, "id": "revision-123", "type": "custom_rule_revision"}, "name": "my-rule"}]}, "type": "custom_ruleset"}} + When the request is sent + Then the response status is 412 Precondition Failed + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Create an AI custom rule returns "Bad Request" response + Given operation "CreateAiCustomRule" enabled + And new "CreateAiCustomRule" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "my-ai-rule"}, "id": "my-ai-rule", "type": "ai_rule"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Create an AI custom rule returns "Conflict - rule already exists" response + Given operation "CreateAiCustomRule" enabled + And new "CreateAiCustomRule" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "my-ai-rule"}, "id": "my-ai-rule", "type": "ai_rule"}} + When the request is sent + Then the response status is 409 Conflict - rule already exists + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Create an AI custom rule returns "Precondition Failed - validation error or ruleset not found" response + Given operation "CreateAiCustomRule" enabled + And new "CreateAiCustomRule" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "my-ai-rule"}, "id": "my-ai-rule", "type": "ai_rule"}} + When the request is sent + Then the response status is 412 Precondition Failed - validation error or ruleset not found + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Create an AI custom rule returns "Successfully created" response + Given operation "CreateAiCustomRule" enabled + And new "CreateAiCustomRule" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"name": "my-ai-rule"}, "id": "my-ai-rule", "type": "ai_rule"}} + When the request is sent + Then the response status is 200 Successfully created + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Create an AI custom rule revision returns "Bad Request" response + Given operation "CreateAiCustomRuleRevision" enabled + And new "CreateAiCustomRuleRevision" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And request contains "rule_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"category": "SECURITY", "content": "Content", "cwe": "79", "description": "Ruleset description", "directories": [], "execution_mode": "auto", "globs": ["**/*.py"], "is_published": false, "is_testing": false, "severity": "ERROR", "short_description": "Ruleset short description", "version_id": 1}, "id": "revision-abc-123", "type": "ai_rule_revision"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Create an AI custom rule revision returns "Rule not found" response + Given operation "CreateAiCustomRuleRevision" enabled + And new "CreateAiCustomRuleRevision" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And request contains "rule_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"category": "SECURITY", "content": "Content", "cwe": "79", "description": "Ruleset description", "directories": [], "execution_mode": "auto", "globs": ["**/*.py"], "is_published": false, "is_testing": false, "severity": "ERROR", "short_description": "Ruleset short description", "version_id": 1}, "id": "revision-abc-123", "type": "ai_rule_revision"}} + When the request is sent + Then the response status is 404 Rule not found + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Create an AI custom rule revision returns "Successfully created" response + Given operation "CreateAiCustomRuleRevision" enabled + And new "CreateAiCustomRuleRevision" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And request contains "rule_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"category": "SECURITY", "content": "Content", "cwe": "79", "description": "Ruleset description", "directories": [], "execution_mode": "auto", "globs": ["**/*.py"], "is_published": false, "is_testing": false, "severity": "ERROR", "short_description": "Ruleset short description", "version_id": 1}, "id": "revision-abc-123", "type": "ai_rule_revision"}} + When the request is sent + Then the response status is 200 Successfully created + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Create an AI custom ruleset returns "Bad Request" response + Given operation "CreateAiCustomRuleset" enabled + And new "CreateAiCustomRuleset" request + And body with value {"data": {"attributes": {"description": "Ruleset description", "name": "my-ai-ruleset", "short_description": "Ruleset short description"}, "id": "my-ai-ruleset", "type": "ai_ruleset"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Create an AI custom ruleset returns "Conflict - ruleset already exists" response + Given operation "CreateAiCustomRuleset" enabled + And new "CreateAiCustomRuleset" request + And body with value {"data": {"attributes": {"description": "Ruleset description", "name": "my-ai-ruleset", "short_description": "Ruleset short description"}, "id": "my-ai-ruleset", "type": "ai_ruleset"}} + When the request is sent + Then the response status is 409 Conflict - ruleset already exists + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Create an AI custom ruleset returns "Precondition Failed - validation error" response + Given operation "CreateAiCustomRuleset" enabled + And new "CreateAiCustomRuleset" request + And body with value {"data": {"attributes": {"description": "Ruleset description", "name": "my-ai-ruleset", "short_description": "Ruleset short description"}, "id": "my-ai-ruleset", "type": "ai_ruleset"}} + When the request is sent + Then the response status is 412 Precondition Failed - validation error + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Create an AI custom ruleset returns "Successfully created" response + Given operation "CreateAiCustomRuleset" enabled + And new "CreateAiCustomRuleset" request + And body with value {"data": {"attributes": {"description": "Ruleset description", "name": "my-ai-ruleset", "short_description": "Ruleset short description"}, "id": "my-ai-ruleset", "type": "ai_ruleset"}} + When the request is sent + Then the response status is 200 Successfully created + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Create an AI memory violation result returns "Bad Request" response + Given operation "CreateAiMemoryViolationResult" enabled + And new "CreateAiMemoryViolationResult" request + And body with value {"data": {"attributes": {"line": 10, "message": "This is a false positive because the input is sanitized.", "name": "src/main.py", "repository_id": "my-repo", "rule": "my-ai-ruleset/my-ai-rule", "sha": "abc123def456789012345678901234567890abcd", "type": "FP"}, "id": "violation-abc", "type": "ai_memory_violation_result"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Create an AI memory violation result returns "Not Found" response + Given operation "CreateAiMemoryViolationResult" enabled + And new "CreateAiMemoryViolationResult" request + And body with value {"data": {"attributes": {"line": 10, "message": "This is a false positive because the input is sanitized.", "name": "src/main.py", "repository_id": "my-repo", "rule": "my-ai-ruleset/my-ai-rule", "sha": "abc123def456789012345678901234567890abcd", "type": "FP"}, "id": "violation-abc", "type": "ai_memory_violation_result"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Create an AI memory violation result returns "Successfully created" response + Given operation "CreateAiMemoryViolationResult" enabled + And new "CreateAiMemoryViolationResult" request + And body with value {"data": {"attributes": {"line": 10, "message": "This is a false positive because the input is sanitized.", "name": "src/main.py", "repository_id": "my-repo", "rule": "my-ai-ruleset/my-ai-rule", "sha": "abc123def456789012345678901234567890abcd", "type": "FP"}, "id": "violation-abc", "type": "ai_memory_violation_result"}} + When the request is sent + Then the response status is 200 Successfully created + @generated @skip @team:DataDog/k9-vm-ast Scenario: Delete Custom Rule returns "Bad request" response Given operation "DeleteCustomRule" enabled @@ -124,6 +278,247 @@ Feature: Static Analysis When the request is sent Then the response status is 200 Successfully deleted + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Delete an AI custom rule returns "Bad Request" response + Given operation "DeleteAiCustomRule" enabled + And new "DeleteAiCustomRule" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And request contains "rule_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Delete an AI custom rule returns "Rule not found" response + Given operation "DeleteAiCustomRule" enabled + And new "DeleteAiCustomRule" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And request contains "rule_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Rule not found + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Delete an AI custom rule returns "Successfully deleted" response + Given operation "DeleteAiCustomRule" enabled + And new "DeleteAiCustomRule" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And request contains "rule_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 Successfully deleted + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Delete an AI custom ruleset returns "Bad Request" response + Given operation "DeleteAiCustomRuleset" enabled + And new "DeleteAiCustomRuleset" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Delete an AI custom ruleset returns "Ruleset not found" response + Given operation "DeleteAiCustomRuleset" enabled + And new "DeleteAiCustomRuleset" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Ruleset not found + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Delete an AI custom ruleset returns "Successfully deleted" response + Given operation "DeleteAiCustomRuleset" enabled + And new "DeleteAiCustomRuleset" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 Successfully deleted + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Delete an AI memory violation result returns "Bad Request" response + Given operation "DeleteAiMemoryViolationResult" enabled + And new "DeleteAiMemoryViolationResult" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Delete an AI memory violation result returns "Memory violation result not found" response + Given operation "DeleteAiMemoryViolationResult" enabled + And new "DeleteAiMemoryViolationResult" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Memory violation result not found + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Delete an AI memory violation result returns "Successfully deleted" response + Given operation "DeleteAiMemoryViolationResult" enabled + And new "DeleteAiMemoryViolationResult" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 Successfully deleted + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Get an AI custom rule returns "Bad Request" response + Given operation "GetAiCustomRule" enabled + And new "GetAiCustomRule" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And request contains "rule_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Get an AI custom rule returns "Rule not found" response + Given operation "GetAiCustomRule" enabled + And new "GetAiCustomRule" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And request contains "rule_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Rule not found + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Get an AI custom rule returns "Successful response" response + Given operation "GetAiCustomRule" enabled + And new "GetAiCustomRule" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And request contains "rule_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 Successful response + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Get an AI custom rule revision returns "Bad Request" response + Given operation "GetAiCustomRuleRevision" enabled + And new "GetAiCustomRuleRevision" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And request contains "rule_name" parameter from "REPLACE.ME" + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Get an AI custom rule revision returns "Revision not found" response + Given operation "GetAiCustomRuleRevision" enabled + And new "GetAiCustomRuleRevision" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And request contains "rule_name" parameter from "REPLACE.ME" + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Revision not found + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Get an AI custom rule revision returns "Successful response" response + Given operation "GetAiCustomRuleRevision" enabled + And new "GetAiCustomRuleRevision" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And request contains "rule_name" parameter from "REPLACE.ME" + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 Successful response + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Get an AI custom ruleset returns "Bad Request" response + Given operation "GetAiCustomRuleset" enabled + And new "GetAiCustomRuleset" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Get an AI custom ruleset returns "Ruleset not found" response + Given operation "GetAiCustomRuleset" enabled + And new "GetAiCustomRuleset" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Ruleset not found + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Get an AI custom ruleset returns "Successful response" response + Given operation "GetAiCustomRuleset" enabled + And new "GetAiCustomRuleset" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 Successful response + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: List AI custom rule revisions returns "Bad Request" response + Given operation "ListAiCustomRuleRevisions" enabled + And new "ListAiCustomRuleRevisions" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And request contains "rule_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: List AI custom rule revisions returns "Rule not found" response + Given operation "ListAiCustomRuleRevisions" enabled + And new "ListAiCustomRuleRevisions" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And request contains "rule_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Rule not found + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: List AI custom rule revisions returns "Successful response" response + Given operation "ListAiCustomRuleRevisions" enabled + And new "ListAiCustomRuleRevisions" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And request contains "rule_name" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 Successful response + + @generated @skip @team:DataDog/k9-vm-ast @with-pagination + Scenario: List AI custom rule revisions returns "Successful response" response with pagination + Given operation "ListAiCustomRuleRevisions" enabled + And new "ListAiCustomRuleRevisions" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And request contains "rule_name" parameter from "REPLACE.ME" + When the request with pagination is sent + Then the response status is 200 Successful response + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: List AI custom rulesets returns "Successful response" response + Given operation "ListAiCustomRulesets" enabled + And new "ListAiCustomRulesets" request + When the request is sent + Then the response status is 200 Successful response + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: List AI memory violation results returns "Bad Request" response + Given operation "ListAiMemoryViolationResults" enabled + And new "ListAiMemoryViolationResults" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: List AI memory violation results returns "Not Found" response + Given operation "ListAiMemoryViolationResults" enabled + And new "ListAiMemoryViolationResults" request + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: List AI memory violation results returns "Successful response" response + Given operation "ListAiMemoryViolationResults" enabled + And new "ListAiMemoryViolationResults" request + When the request is sent + Then the response status is 200 Successful response + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: List AI prompts returns "Bad Request" response + Given operation "ListAiPrompts" enabled + And new "ListAiPrompts" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: List AI prompts returns "Not Found" response + Given operation "ListAiPrompts" enabled + And new "ListAiPrompts" request + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: List AI prompts returns "Successful response" response + Given operation "ListAiPrompts" enabled + And new "ListAiPrompts" request + When the request is sent + Then the response status is 200 Successful response + @generated @skip @team:DataDog/k9-vm-ast Scenario: List Custom Rule Revisions returns "Bad request" response Given operation "ListCustomRuleRevisions" enabled @@ -160,6 +555,13 @@ Feature: Static Analysis When the request with pagination is sent Then the response status is 200 Successful response + @generated @skip @team:DataDog/k9-vm-ast + Scenario: List Custom Rulesets returns "OK" response + Given operation "ListCustomRulesets" enabled + And new "ListCustomRulesets" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/k9-vm-sca Scenario: POST request to resolve vulnerable symbols returns "OK" response Given operation "CreateSCAResolveVulnerableSymbols" enabled @@ -303,3 +705,30 @@ Feature: Static Analysis And body with value {"data": {"attributes": {"rules": [{"created_at": "2026-01-09T13:00:57.473141Z", "created_by": "foobarbaz", "last_revision": {"attributes": {"arguments": [{"description": "YXJndW1lbnQgZGVzY3JpcHRpb24=", "name": "YXJndW1lbnRfbmFtZQ=="}], "category": "SECURITY", "checksum": "8a66c4e4e631099ad71be3c1ea3ea8fc2d57193e56db2c296e2dd8a508b26b99", "code": "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==", "created_at": "2026-01-09T13:00:57.473141Z", "created_by": "foobarbaz", "creation_message": "Initial revision", "cve": "CVE-2024-1234", "cwe": "CWE-79", "description": "bG9uZyBkZXNjcmlwdGlvbg==", "documentation_url": "https://docs.example.com/rules/my-rule", "is_published": false, "is_testing": false, "language": "PYTHON", "severity": "ERROR", "short_description": "c2hvcnQgZGVzY3JpcHRpb24=", "should_use_ai_fix": false, "tags": ["security", "custom"], "tests": [{"annotation_count": 1, "code": "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ==", "filename": "test.yaml"}], "tree_sitter_query": "Y29uZHVjdG9yOgogICAgLSBkZXBsb3lfb25seTogdHJ1ZQ=="}, "id": "revision-123", "type": "custom_rule_revision"}, "name": "my-rule"}]}, "type": "custom_ruleset"}} When the request is sent Then the response status is 200 Successfully updated + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Update an AI custom ruleset returns "Bad Request" response + Given operation "UpdateAiCustomRuleset" enabled + And new "UpdateAiCustomRuleset" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Ruleset description", "name": "my-ai-ruleset", "short_description": "Ruleset short description"}, "id": "my-ai-ruleset", "type": "ai_ruleset"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Update an AI custom ruleset returns "Precondition Failed - validation error or ruleset not found" response + Given operation "UpdateAiCustomRuleset" enabled + And new "UpdateAiCustomRuleset" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Ruleset description", "name": "my-ai-ruleset", "short_description": "Ruleset short description"}, "id": "my-ai-ruleset", "type": "ai_ruleset"}} + When the request is sent + Then the response status is 412 Precondition Failed - validation error or ruleset not found + + @generated @skip @team:DataDog/k9-vm-ast + Scenario: Update an AI custom ruleset returns "Successfully updated" response + Given operation "UpdateAiCustomRuleset" enabled + And new "UpdateAiCustomRuleset" request + And request contains "ruleset_name" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Ruleset description", "name": "my-ai-ruleset", "short_description": "Ruleset short description"}, "id": "my-ai-ruleset", "type": "ai_ruleset"}} + When the request is sent + Then the response status is 200 Successfully updated diff --git a/features/v2/undo.json b/features/v2/undo.json index c22b14729810..a359fccfe1e1 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -5439,6 +5439,43 @@ "type": "idempotent" } }, + "ListApplicationSecurityWAFPolicies": { + "tag": "Application Security", + "undo": { + "type": "safe" + } + }, + "CreateApplicationSecurityWafPolicy": { + "tag": "Application Security", + "undo": { + "operationId": "DeleteApplicationSecurityWafPolicy", + "parameters": [ + { + "name": "policy_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteApplicationSecurityWafPolicy": { + "tag": "Application Security", + "undo": { + "type": "idempotent" + } + }, + "GetApplicationSecurityWafPolicy": { + "tag": "Application Security", + "undo": { + "type": "safe" + } + }, + "UpdateApplicationSecurityWafPolicy": { + "tag": "Application Security", + "undo": { + "type": "idempotent" + } + }, "ListCSMThreatsAgentRules": { "tag": "CSM Threats", "undo": { @@ -7040,6 +7077,121 @@ "type": "safe" } }, + "ListAiMemoryViolationResults": { + "tag": "Static Analysis", + "undo": { + "type": "safe" + } + }, + "CreateAiMemoryViolationResult": { + "tag": "Static Analysis", + "undo": { + "type": "idempotent" + } + }, + "DeleteAiMemoryViolationResult": { + "tag": "Static Analysis", + "undo": { + "type": "idempotent" + } + }, + "ListAiPrompts": { + "tag": "Static Analysis", + "undo": { + "type": "safe" + } + }, + "ListAiCustomRulesets": { + "tag": "Static Analysis", + "undo": { + "type": "safe" + } + }, + "CreateAiCustomRuleset": { + "tag": "Static Analysis", + "undo": { + "type": "idempotent" + } + }, + "DeleteAiCustomRuleset": { + "tag": "Static Analysis", + "undo": { + "type": "idempotent" + } + }, + "GetAiCustomRuleset": { + "tag": "Static Analysis", + "undo": { + "type": "safe" + } + }, + "UpdateAiCustomRuleset": { + "tag": "Static Analysis", + "undo": { + "type": "idempotent" + } + }, + "CreateAiCustomRule": { + "tag": "Static Analysis", + "undo": { + "type": "idempotent" + } + }, + "DeleteAiCustomRule": { + "tag": "Static Analysis", + "undo": { + "type": "idempotent" + } + }, + "GetAiCustomRule": { + "tag": "Static Analysis", + "undo": { + "type": "safe" + } + }, + "ListAiCustomRuleRevisions": { + "tag": "Static Analysis", + "undo": { + "type": "safe" + } + }, + "CreateAiCustomRuleRevision": { + "tag": "Static Analysis", + "undo": { + "type": "idempotent" + } + }, + "GetAiCustomRuleRevision": { + "tag": "Static Analysis", + "undo": { + "type": "safe" + } + }, + "ListStaticAnalysisCodegenRulesets": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "ListCustomRulesets": { + "tag": "Static Analysis", + "undo": { + "type": "safe" + } + }, + "CreateCustomRuleset": { + "tag": "Static Analysis", + "undo": { + "operationId": "DeleteCustomRuleset", + "parameters": [ + { + "name": "ruleset_name", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, "DeleteCustomRuleset": { "tag": "Static Analysis", "undo": { @@ -7102,6 +7254,12 @@ "type": "safe" } }, + "GetStaticAnalysisDefaultRulesets": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, "ListMultipleRulesets": { "tag": "Security Monitoring", "undo": { @@ -7110,12 +7268,42 @@ "type": "unsafe" } }, + "GetStaticAnalysisRuleset": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, "GetSecretsRules": { "tag": "Security Monitoring", "undo": { "type": "safe" } }, + "CreateStaticAnalysisServerAnalysis": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "CreateStaticAnalysisAst": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "GetStaticAnalysisNodeTypes": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "GetStaticAnalysisTreeSitterWasm": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, "ListStatusPages": { "tag": "Status Pages", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 36612d69b27a..5a03723136cb 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -322,6 +322,8 @@ def initialize "v2.convert_security_monitoring_terraform_resource": false, "v2.create_sample_log_generation_subscription": false, "v2.create_security_monitoring_integration_config": false, + "v2.create_static_analysis_ast": false, + "v2.create_static_analysis_server_analysis": false, "v2.deactivate_content_pack": false, "v2.delete_historical_job": false, "v2.delete_sample_log_generation_subscription": false, @@ -338,6 +340,10 @@ def initialize "v2.get_security_monitoring_histsignals_by_job_id": false, "v2.get_security_monitoring_integration_config": false, "v2.get_signal_entities": false, + "v2.get_static_analysis_default_rulesets": false, + "v2.get_static_analysis_node_types": false, + "v2.get_static_analysis_ruleset": false, + "v2.get_static_analysis_tree_sitter_wasm": false, "v2.list_findings": false, "v2.list_historical_jobs": false, "v2.list_indicators_of_compromise": false, @@ -346,6 +352,7 @@ def initialize "v2.list_scanned_assets_metadata": false, "v2.list_security_monitoring_histsignals": false, "v2.list_security_monitoring_integration_configs": false, + "v2.list_static_analysis_codegen_rulesets": false, "v2.list_vulnerabilities": false, "v2.list_vulnerable_assets": false, "v2.mute_findings": false, @@ -549,17 +556,34 @@ def initialize "v2.get_slo_status": false, "v2.get_spa_recommendations": false, "v2.get_spa_recommendations_with_shard": false, + "v2.create_ai_custom_rule": false, + "v2.create_ai_custom_rule_revision": false, + "v2.create_ai_custom_ruleset": false, + "v2.create_ai_memory_violation_result": false, "v2.create_custom_rule": false, "v2.create_custom_rule_revision": false, + "v2.create_custom_ruleset": false, "v2.create_sca_resolve_vulnerable_symbols": false, "v2.create_sca_result": false, + "v2.delete_ai_custom_rule": false, + "v2.delete_ai_custom_ruleset": false, + "v2.delete_ai_memory_violation_result": false, "v2.delete_custom_rule": false, "v2.delete_custom_ruleset": false, + "v2.get_ai_custom_rule": false, + "v2.get_ai_custom_rule_revision": false, + "v2.get_ai_custom_ruleset": false, "v2.get_custom_rule": false, "v2.get_custom_rule_revision": false, "v2.get_custom_ruleset": false, + "v2.list_ai_custom_rule_revisions": false, + "v2.list_ai_custom_rulesets": false, + "v2.list_ai_memory_violation_results": false, + "v2.list_ai_prompts": false, "v2.list_custom_rule_revisions": false, + "v2.list_custom_rulesets": false, "v2.revert_custom_rule_revision": false, + "v2.update_ai_custom_ruleset": false, "v2.update_custom_ruleset": false, "v2.add_member_team": false, "v2.list_member_teams": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index c18b7bd45b71..339c8adea522 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1146,6 +1146,45 @@ def overrides "v2.active_billing_dimensions_type" => "ActiveBillingDimensionsType", "v2.add_member_team_request" => "AddMemberTeamRequest", "v2.advisory" => "Advisory", + "v2.ai_custom_rule_data_type" => "AiCustomRuleDataType", + "v2.ai_custom_rule_item" => "AiCustomRuleItem", + "v2.ai_custom_rule_request" => "AiCustomRuleRequest", + "v2.ai_custom_rule_request_attributes" => "AiCustomRuleRequestAttributes", + "v2.ai_custom_rule_request_data" => "AiCustomRuleRequestData", + "v2.ai_custom_rule_response" => "AiCustomRuleResponse", + "v2.ai_custom_rule_response_data" => "AiCustomRuleResponseData", + "v2.ai_custom_rule_revision_data_type" => "AiCustomRuleRevisionDataType", + "v2.ai_custom_rule_revision_execution_mode" => "AiCustomRuleRevisionExecutionMode", + "v2.ai_custom_rule_revision_request" => "AiCustomRuleRevisionRequest", + "v2.ai_custom_rule_revision_request_attributes" => "AiCustomRuleRevisionRequestAttributes", + "v2.ai_custom_rule_revision_request_data" => "AiCustomRuleRevisionRequestData", + "v2.ai_custom_rule_revision_response" => "AiCustomRuleRevisionResponse", + "v2.ai_custom_rule_revision_response_attributes" => "AiCustomRuleRevisionResponseAttributes", + "v2.ai_custom_rule_revision_response_data" => "AiCustomRuleRevisionResponseData", + "v2.ai_custom_rule_revisions_response" => "AiCustomRuleRevisionsResponse", + "v2.ai_custom_ruleset_data_type" => "AiCustomRulesetDataType", + "v2.ai_custom_ruleset_request" => "AiCustomRulesetRequest", + "v2.ai_custom_ruleset_request_attributes" => "AiCustomRulesetRequestAttributes", + "v2.ai_custom_ruleset_request_data" => "AiCustomRulesetRequestData", + "v2.ai_custom_ruleset_response" => "AiCustomRulesetResponse", + "v2.ai_custom_ruleset_response_attributes" => "AiCustomRulesetResponseAttributes", + "v2.ai_custom_ruleset_response_data" => "AiCustomRulesetResponseData", + "v2.ai_custom_rulesets_response" => "AiCustomRulesetsResponse", + "v2.ai_custom_ruleset_update_attributes" => "AiCustomRulesetUpdateAttributes", + "v2.ai_custom_ruleset_update_data" => "AiCustomRulesetUpdateData", + "v2.ai_custom_ruleset_update_request" => "AiCustomRulesetUpdateRequest", + "v2.ai_memory_violation_result_data_type" => "AiMemoryViolationResultDataType", + "v2.ai_memory_violation_result_request" => "AiMemoryViolationResultRequest", + "v2.ai_memory_violation_result_request_attributes" => "AiMemoryViolationResultRequestAttributes", + "v2.ai_memory_violation_result_request_data" => "AiMemoryViolationResultRequestData", + "v2.ai_memory_violation_result_response_attributes" => "AiMemoryViolationResultResponseAttributes", + "v2.ai_memory_violation_result_response_data" => "AiMemoryViolationResultResponseData", + "v2.ai_memory_violation_results_response" => "AiMemoryViolationResultsResponse", + "v2.ai_memory_violation_type" => "AiMemoryViolationType", + "v2.ai_prompt_data_type" => "AiPromptDataType", + "v2.ai_prompt_response_attributes" => "AiPromptResponseAttributes", + "v2.ai_prompt_response_data" => "AiPromptResponseData", + "v2.ai_prompts_response" => "AiPromptsResponse", "v2.alert_event_attributes" => "AlertEventAttributes", "v2.alert_event_attributes_links_item" => "AlertEventAttributesLinksItem", "v2.alert_event_attributes_links_item_category" => "AlertEventAttributesLinksItemCategory", @@ -1168,6 +1207,21 @@ def overrides "v2.allocation_exposure_schedule_response" => "AllocationExposureScheduleResponse", "v2.allocation_response" => "AllocationResponse", "v2.allocation_type" => "AllocationType", + "v2.analysis_edit" => "AnalysisEdit", + "v2.analysis_edit_type" => "AnalysisEditType", + "v2.analysis_fix" => "AnalysisFix", + "v2.analysis_position" => "AnalysisPosition", + "v2.analysis_request" => "AnalysisRequest", + "v2.analysis_request_data" => "AnalysisRequestData", + "v2.analysis_request_data_attributes" => "AnalysisRequestDataAttributes", + "v2.analysis_request_data_type" => "AnalysisRequestDataType", + "v2.analysis_request_rule" => "AnalysisRequestRule", + "v2.analysis_response" => "AnalysisResponse", + "v2.analysis_response_data" => "AnalysisResponseData", + "v2.analysis_response_data_attributes" => "AnalysisResponseDataAttributes", + "v2.analysis_response_data_type" => "AnalysisResponseDataType", + "v2.analysis_rule_response" => "AnalysisRuleResponse", + "v2.analysis_violation" => "AnalysisViolation", "v2.annotation" => "Annotation", "v2.annotation_display" => "AnnotationDisplay", "v2.annotation_display_bounds" => "AnnotationDisplayBounds", @@ -1241,6 +1295,21 @@ def overrides "v2.application_key_update_attributes" => "ApplicationKeyUpdateAttributes", "v2.application_key_update_data" => "ApplicationKeyUpdateData", "v2.application_key_update_request" => "ApplicationKeyUpdateRequest", + "v2.application_security_policy_attributes" => "ApplicationSecurityPolicyAttributes", + "v2.application_security_policy_create_attributes" => "ApplicationSecurityPolicyCreateAttributes", + "v2.application_security_policy_create_data" => "ApplicationSecurityPolicyCreateData", + "v2.application_security_policy_create_request" => "ApplicationSecurityPolicyCreateRequest", + "v2.application_security_policy_data" => "ApplicationSecurityPolicyData", + "v2.application_security_policy_list_response" => "ApplicationSecurityPolicyListResponse", + "v2.application_security_policy_metadata" => "ApplicationSecurityPolicyMetadata", + "v2.application_security_policy_response" => "ApplicationSecurityPolicyResponse", + "v2.application_security_policy_rule_override" => "ApplicationSecurityPolicyRuleOverride", + "v2.application_security_policy_ruleset_override" => "ApplicationSecurityPolicyRulesetOverride", + "v2.application_security_policy_scope" => "ApplicationSecurityPolicyScope", + "v2.application_security_policy_type" => "ApplicationSecurityPolicyType", + "v2.application_security_policy_update_attributes" => "ApplicationSecurityPolicyUpdateAttributes", + "v2.application_security_policy_update_data" => "ApplicationSecurityPolicyUpdateData", + "v2.application_security_policy_update_request" => "ApplicationSecurityPolicyUpdateRequest", "v2.application_security_waf_custom_rule_action" => "ApplicationSecurityWafCustomRuleAction", "v2.application_security_waf_custom_rule_action_action" => "ApplicationSecurityWafCustomRuleActionAction", "v2.application_security_waf_custom_rule_action_parameters" => "ApplicationSecurityWafCustomRuleActionParameters", @@ -2448,6 +2517,7 @@ def overrides "v2.custom_ruleset" => "CustomRuleset", "v2.custom_ruleset_attributes" => "CustomRulesetAttributes", "v2.custom_ruleset_data_type" => "CustomRulesetDataType", + "v2.custom_ruleset_list_response" => "CustomRulesetListResponse", "v2.custom_ruleset_request" => "CustomRulesetRequest", "v2.custom_ruleset_request_data" => "CustomRulesetRequestData", "v2.custom_ruleset_request_data_attributes" => "CustomRulesetRequestDataAttributes", @@ -2511,6 +2581,10 @@ def overrides "v2.data_transform" => "DataTransform", "v2.data_transform_properties" => "DataTransformProperties", "v2.data_transform_type" => "DataTransformType", + "v2.default_rulesets_per_language_data" => "DefaultRulesetsPerLanguageData", + "v2.default_rulesets_per_language_data_attributes" => "DefaultRulesetsPerLanguageDataAttributes", + "v2.default_rulesets_per_language_data_type" => "DefaultRulesetsPerLanguageDataType", + "v2.default_rulesets_per_language_response" => "DefaultRulesetsPerLanguageResponse", "v2.degradation" => "Degradation", "v2.degradation_array" => "DegradationArray", "v2.degradation_data" => "DegradationData", @@ -3117,6 +3191,14 @@ def overrides "v2.get_app_response" => "GetAppResponse", "v2.get_app_response_data" => "GetAppResponseData", "v2.get_app_response_data_attributes" => "GetAppResponseDataAttributes", + "v2.get_ast_request" => "GetAstRequest", + "v2.get_ast_request_data" => "GetAstRequestData", + "v2.get_ast_request_data_attributes" => "GetAstRequestDataAttributes", + "v2.get_ast_request_data_type" => "GetAstRequestDataType", + "v2.get_ast_response" => "GetAstResponse", + "v2.get_ast_response_data" => "GetAstResponseData", + "v2.get_ast_response_data_attributes" => "GetAstResponseDataAttributes", + "v2.get_ast_response_data_type" => "GetAstResponseDataType", "v2.get_blueprint_response" => "GetBlueprintResponse", "v2.get_blueprints_response" => "GetBlueprintsResponse", "v2.get_custom_framework_response" => "GetCustomFrameworkResponse", @@ -4315,6 +4397,10 @@ def overrides "v2.mute_findings_request_data_relationships" => "MuteFindingsRequestDataRelationships", "v2.mute_findings_response" => "MuteFindingsResponse", "v2.mute_findings_response_data" => "MuteFindingsResponseData", + "v2.node_types_response" => "NodeTypesResponse", + "v2.node_types_response_data" => "NodeTypesResponseData", + "v2.node_types_response_data_attributes" => "NodeTypesResponseDataAttributes", + "v2.node_types_response_data_type" => "NodeTypesResponseDataType", "v2.notebook_create_data" => "NotebookCreateData", "v2.notebook_create_request" => "NotebookCreateRequest", "v2.notebook_resource_type" => "NotebookResourceType", @@ -5412,6 +5498,10 @@ def overrides "v2.sample_log_generation_subscriptions_response_meta" => "SampleLogGenerationSubscriptionsResponseMeta", "v2.sample_log_generation_subscriptions_status_filter" => "SampleLogGenerationSubscriptionsStatusFilter", "v2.sample_log_generation_subscription_status" => "SampleLogGenerationSubscriptionStatus", + "v2.sast_ruleset_data" => "SastRulesetData", + "v2.sast_ruleset_data_attributes" => "SastRulesetDataAttributes", + "v2.sast_ruleset_response" => "SastRulesetResponse", + "v2.sast_rulesets_response" => "SastRulesetsResponse", "v2.sbom" => "SBOM", "v2.sbom_attributes" => "SBOMAttributes", "v2.sbom_component" => "SBOMComponent", diff --git a/lib/datadog_api_client/v1/api/usage_metering_api.rb b/lib/datadog_api_client/v1/api/usage_metering_api.rb index 9fda8308687a..23a21c93b047 100644 --- a/lib/datadog_api_client/v1/api/usage_metering_api.rb +++ b/lib/datadog_api_client/v1/api/usage_metering_api.rb @@ -152,7 +152,7 @@ def get_hourly_usage_attribution_with_http_info(start_hr, usage_type, opts = {}) fail ArgumentError, "Missing the required parameter 'usage_type' when calling UsageMeteringAPI.get_hourly_usage_attribution" end # verify enum value - allowable_values = ['api_usage', 'apm_fargate_usage', 'apm_host_usage', 'apm_usm_usage', 'appsec_fargate_usage', 'appsec_usage', 'asm_serverless_traced_invocations_usage', 'asm_serverless_traced_invocations_percentage', 'bits_ai_investigations_usage', 'browser_usage', 'ci_code_coverage_committers_percentage', 'ci_code_coverage_committers_usage', 'ci_pipeline_indexed_spans_usage', 'ci_test_indexed_spans_usage', 'ci_visibility_itr_usage', 'cloud_siem_usage', 'code_security_host_usage', 'container_excl_agent_usage', 'container_usage', 'cspm_containers_usage', 'cspm_hosts_usage', 'custom_event_usage', 'custom_ingested_timeseries_usage', 'custom_timeseries_usage', 'cws_containers_usage', 'cws_fargate_task_usage', 'cws_hosts_usage', 'data_jobs_monitoring_usage', 'data_stream_monitoring_usage', 'dbm_hosts_usage', 'dbm_queries_usage', 'error_tracking_usage', 'error_tracking_percentage', 'estimated_indexed_spans_usage', 'estimated_ingested_spans_usage', 'fargate_usage', 'flex_logs_starter', 'flex_stored_logs', 'functions_usage', 'incident_management_monthly_active_users_usage', 'indexed_spans_usage', 'infra_host_usage', 'infra_host_basic_usage', 'ingested_logs_bytes_usage', 'ingested_spans_bytes_usage', 'invocations_usage', 'lambda_traced_invocations_usage', 'llm_observability_usage', 'llm_spans_usage', 'logs_indexed_15day_usage', 'logs_indexed_180day_usage', 'logs_indexed_1day_usage', 'logs_indexed_30day_usage', 'logs_indexed_360day_usage', 'logs_indexed_3day_usage', 'logs_indexed_45day_usage', 'logs_indexed_60day_usage', 'logs_indexed_7day_usage', 'logs_indexed_90day_usage', 'logs_indexed_custom_retention_usage', 'mobile_app_testing_usage', 'ndm_netflow_usage', 'npm_host_usage', 'network_device_wireless_usage', 'obs_pipeline_bytes_usage', 'obs_pipelines_vcpu_usage', 'online_archive_usage', 'product_analytics_session_usage', 'profiled_container_usage', 'profiled_fargate_usage', 'profiled_host_usage', 'published_app', 'rum_browser_mobile_sessions_usage', 'rum_ingested_usage', 'rum_investigate_usage', 'rum_replay_sessions_usage', 'rum_session_replay_add_on_usage', 'sca_fargate_usage', 'sds_scanned_bytes_usage', 'serverless_apps_usage', 'serverless_apps_apm_usage', 'siem_analyzed_logs_add_on_usage', 'siem_ingested_bytes_usage', 'snmp_usage', 'universal_service_monitoring_usage', 'vuln_management_hosts_usage', 'workflow_executions_usage'] + allowable_values = ['api_usage', 'apm_fargate_usage', 'apm_host_usage', 'apm_usm_usage', 'appsec_fargate_usage', 'appsec_usage', 'asm_serverless_traced_invocations_usage', 'asm_serverless_traced_invocations_percentage', 'bits_ai_investigations_usage', 'browser_usage', 'ci_code_coverage_committers_percentage', 'ci_code_coverage_committers_usage', 'ci_pipeline_indexed_spans_usage', 'ci_test_indexed_spans_usage', 'ci_visibility_itr_usage', 'cloud_siem_usage', 'code_security_host_usage', 'container_excl_agent_usage', 'container_usage', 'cspm_containers_usage', 'cspm_hosts_usage', 'custom_event_usage', 'custom_ingested_timeseries_usage', 'custom_timeseries_usage', 'cws_containers_usage', 'cws_fargate_task_usage', 'cws_hosts_usage', 'data_jobs_monitoring_usage', 'data_stream_monitoring_usage', 'dbm_hosts_usage', 'dbm_queries_usage', 'error_tracking_usage', 'error_tracking_percentage', 'estimated_indexed_spans_usage', 'estimated_ingested_spans_usage', 'fargate_usage', 'flex_logs_starter', 'flex_stored_logs', 'functions_usage', 'incident_management_monthly_active_users_usage', 'indexed_spans_usage', 'infra_host_usage', 'infra_host_basic_usage', 'ingested_logs_bytes_usage', 'ingested_spans_bytes_usage', 'invocations_usage', 'lambda_traced_invocations_usage', 'llm_observability_usage', 'llm_spans_usage', 'logs_indexed_15day_usage', 'logs_indexed_180day_usage', 'logs_indexed_1day_usage', 'logs_indexed_30day_usage', 'logs_indexed_360day_usage', 'logs_indexed_3day_usage', 'logs_indexed_45day_usage', 'logs_indexed_60day_usage', 'logs_indexed_7day_usage', 'logs_indexed_90day_usage', 'logs_indexed_custom_retention_usage', 'mobile_app_testing_usage', 'ndm_netflow_usage', 'npm_host_usage', 'network_device_wireless_usage', 'obs_pipeline_bytes_usage', 'obs_pipelines_vcpu_usage', 'online_archive_usage', 'product_analytics_session_usage', 'profiled_container_usage', 'profiled_fargate_usage', 'profiled_host_usage', 'published_app', 'rum_browser_mobile_sessions_usage', 'rum_ingested_usage', 'rum_investigate_usage', 'rum_replay_sessions_usage', 'rum_session_replay_add_on_usage', 'sca_fargate_usage', 'sds_scanned_bytes_usage', 'serverless_apps_usage', 'serverless_apps_apm_usage', 'siem_12mo_retention_usage', 'siem_6mo_retention_usage', 'siem_analyzed_logs_add_on_usage', 'siem_ingested_bytes_usage', 'snmp_usage', 'universal_service_monitoring_usage', 'vuln_management_hosts_usage', 'workflow_executions_usage'] if @api_client.config.client_side_validation && !allowable_values.include?(usage_type) fail ArgumentError, "invalid value for \"usage_type\", must be one of #{allowable_values}" end @@ -478,7 +478,7 @@ def get_monthly_usage_attribution_with_http_info(start_month, fields, opts = {}) fail ArgumentError, "Missing the required parameter 'fields' when calling UsageMeteringAPI.get_monthly_usage_attribution" end # verify enum value - allowable_values = ['api_usage', 'api_percentage', 'apm_fargate_usage', 'apm_fargate_percentage', 'appsec_fargate_usage', 'appsec_fargate_percentage', 'apm_host_usage', 'apm_host_percentage', 'apm_usm_usage', 'apm_usm_percentage', 'appsec_usage', 'appsec_percentage', 'asm_serverless_traced_invocations_usage', 'asm_serverless_traced_invocations_percentage', 'bits_ai_investigations_usage', 'bits_ai_investigations_percentage', 'browser_usage', 'browser_percentage', 'ci_visibility_itr_usage', 'ci_visibility_itr_percentage', 'cloud_siem_usage', 'cloud_siem_percentage', 'code_security_host_usage', 'code_security_host_percentage', 'container_excl_agent_usage', 'container_excl_agent_percentage', 'container_usage', 'container_percentage', 'cspm_containers_percentage', 'cspm_containers_usage', 'cspm_hosts_percentage', 'cspm_hosts_usage', 'custom_timeseries_usage', 'custom_timeseries_percentage', 'custom_ingested_timeseries_usage', 'custom_ingested_timeseries_percentage', 'cws_containers_percentage', 'cws_containers_usage', 'cws_fargate_task_percentage', 'cws_fargate_task_usage', 'cws_hosts_percentage', 'cws_hosts_usage', 'data_jobs_monitoring_usage', 'data_jobs_monitoring_percentage', 'data_stream_monitoring_usage', 'data_stream_monitoring_percentage', 'dbm_hosts_percentage', 'dbm_hosts_usage', 'dbm_queries_percentage', 'dbm_queries_usage', 'error_tracking_usage', 'error_tracking_percentage', 'estimated_indexed_spans_usage', 'estimated_indexed_spans_percentage', 'estimated_ingested_spans_usage', 'estimated_ingested_spans_percentage', 'fargate_usage', 'fargate_percentage', 'flex_logs_starter_usage', 'flex_logs_starter_percentage', 'flex_stored_logs_usage', 'flex_stored_logs_percentage', 'functions_usage', 'functions_percentage', 'incident_management_monthly_active_users_usage', 'incident_management_monthly_active_users_percentage', 'infra_host_usage', 'infra_host_percentage', 'infra_host_basic_usage', 'infra_host_basic_percentage', 'invocations_usage', 'invocations_percentage', 'lambda_traced_invocations_usage', 'lambda_traced_invocations_percentage', 'llm_observability_usage', 'llm_observability_percentage', 'llm_spans_usage', 'llm_spans_percentage', 'mobile_app_testing_percentage', 'mobile_app_testing_usage', 'ndm_netflow_usage', 'ndm_netflow_percentage', 'network_device_wireless_usage', 'network_device_wireless_percentage', 'npm_host_usage', 'npm_host_percentage', 'obs_pipeline_bytes_usage', 'obs_pipeline_bytes_percentage', 'obs_pipelines_vcpu_usage', 'obs_pipelines_vcpu_percentage', 'online_archive_usage', 'online_archive_percentage', 'product_analytics_session_usage', 'product_analytics_session_percentage', 'profiled_container_usage', 'profiled_container_percentage', 'profiled_fargate_usage', 'profiled_fargate_percentage', 'profiled_host_usage', 'profiled_host_percentage', 'published_app_usage', 'published_app_percentage', 'serverless_apps_usage', 'serverless_apps_percentage', 'serverless_apps_apm_usage', 'serverless_apps_apm_percentage', 'snmp_usage', 'snmp_percentage', 'universal_service_monitoring_usage', 'universal_service_monitoring_percentage', 'vuln_management_hosts_usage', 'vuln_management_hosts_percentage', 'sds_scanned_bytes_usage', 'sds_scanned_bytes_percentage', 'ci_test_indexed_spans_usage', 'ci_test_indexed_spans_percentage', 'ingested_logs_bytes_usage', 'ingested_logs_bytes_percentage', 'ci_pipeline_indexed_spans_usage', 'ci_pipeline_indexed_spans_percentage', 'indexed_spans_usage', 'indexed_spans_percentage', 'custom_event_usage', 'custom_event_percentage', 'logs_indexed_custom_retention_usage', 'logs_indexed_custom_retention_percentage', 'logs_indexed_360day_usage', 'logs_indexed_360day_percentage', 'logs_indexed_180day_usage', 'logs_indexed_180day_percentage', 'logs_indexed_90day_usage', 'logs_indexed_90day_percentage', 'logs_indexed_60day_usage', 'logs_indexed_60day_percentage', 'logs_indexed_45day_usage', 'logs_indexed_45day_percentage', 'logs_indexed_30day_usage', 'logs_indexed_30day_percentage', 'logs_indexed_15day_usage', 'logs_indexed_15day_percentage', 'logs_indexed_7day_usage', 'logs_indexed_7day_percentage', 'logs_indexed_3day_usage', 'logs_indexed_3day_percentage', 'logs_indexed_1day_usage', 'logs_indexed_1day_percentage', 'rum_ingested_usage', 'rum_ingested_percentage', 'rum_investigate_usage', 'rum_investigate_percentage', 'rum_replay_sessions_usage', 'rum_replay_sessions_percentage', 'rum_session_replay_add_on_usage', 'rum_session_replay_add_on_percentage', 'rum_browser_mobile_sessions_usage', 'rum_browser_mobile_sessions_percentage', 'ingested_spans_bytes_usage', 'ingested_spans_bytes_percentage', 'siem_analyzed_logs_add_on_usage', 'siem_analyzed_logs_add_on_percentage', 'siem_ingested_bytes_usage', 'siem_ingested_bytes_percentage', 'workflow_executions_usage', 'workflow_executions_percentage', 'sca_fargate_usage', 'sca_fargate_percentage', '*'] + allowable_values = ['api_usage', 'api_percentage', 'apm_fargate_usage', 'apm_fargate_percentage', 'appsec_fargate_usage', 'appsec_fargate_percentage', 'apm_host_usage', 'apm_host_percentage', 'apm_usm_usage', 'apm_usm_percentage', 'appsec_usage', 'appsec_percentage', 'asm_serverless_traced_invocations_usage', 'asm_serverless_traced_invocations_percentage', 'bits_ai_investigations_usage', 'bits_ai_investigations_percentage', 'browser_usage', 'browser_percentage', 'ci_visibility_itr_usage', 'ci_visibility_itr_percentage', 'cloud_siem_usage', 'cloud_siem_percentage', 'code_security_host_usage', 'code_security_host_percentage', 'container_excl_agent_usage', 'container_excl_agent_percentage', 'container_usage', 'container_percentage', 'cspm_containers_percentage', 'cspm_containers_usage', 'cspm_hosts_percentage', 'cspm_hosts_usage', 'custom_timeseries_usage', 'custom_timeseries_percentage', 'custom_ingested_timeseries_usage', 'custom_ingested_timeseries_percentage', 'cws_containers_percentage', 'cws_containers_usage', 'cws_fargate_task_percentage', 'cws_fargate_task_usage', 'cws_hosts_percentage', 'cws_hosts_usage', 'data_jobs_monitoring_usage', 'data_jobs_monitoring_percentage', 'data_stream_monitoring_usage', 'data_stream_monitoring_percentage', 'dbm_hosts_percentage', 'dbm_hosts_usage', 'dbm_queries_percentage', 'dbm_queries_usage', 'error_tracking_usage', 'error_tracking_percentage', 'estimated_indexed_spans_usage', 'estimated_indexed_spans_percentage', 'estimated_ingested_spans_usage', 'estimated_ingested_spans_percentage', 'fargate_usage', 'fargate_percentage', 'flex_logs_starter_usage', 'flex_logs_starter_percentage', 'flex_stored_logs_usage', 'flex_stored_logs_percentage', 'functions_usage', 'functions_percentage', 'incident_management_monthly_active_users_usage', 'incident_management_monthly_active_users_percentage', 'infra_host_usage', 'infra_host_percentage', 'infra_host_basic_usage', 'infra_host_basic_percentage', 'invocations_usage', 'invocations_percentage', 'lambda_traced_invocations_usage', 'lambda_traced_invocations_percentage', 'llm_observability_usage', 'llm_observability_percentage', 'llm_spans_usage', 'llm_spans_percentage', 'mobile_app_testing_percentage', 'mobile_app_testing_usage', 'ndm_netflow_usage', 'ndm_netflow_percentage', 'network_device_wireless_usage', 'network_device_wireless_percentage', 'npm_host_usage', 'npm_host_percentage', 'obs_pipeline_bytes_usage', 'obs_pipeline_bytes_percentage', 'obs_pipelines_vcpu_usage', 'obs_pipelines_vcpu_percentage', 'online_archive_usage', 'online_archive_percentage', 'product_analytics_session_usage', 'product_analytics_session_percentage', 'profiled_container_usage', 'profiled_container_percentage', 'profiled_fargate_usage', 'profiled_fargate_percentage', 'profiled_host_usage', 'profiled_host_percentage', 'published_app_usage', 'published_app_percentage', 'serverless_apps_usage', 'serverless_apps_percentage', 'serverless_apps_apm_usage', 'serverless_apps_apm_percentage', 'snmp_usage', 'snmp_percentage', 'universal_service_monitoring_usage', 'universal_service_monitoring_percentage', 'vuln_management_hosts_usage', 'vuln_management_hosts_percentage', 'sds_scanned_bytes_usage', 'sds_scanned_bytes_percentage', 'ci_test_indexed_spans_usage', 'ci_test_indexed_spans_percentage', 'ingested_logs_bytes_usage', 'ingested_logs_bytes_percentage', 'ci_pipeline_indexed_spans_usage', 'ci_pipeline_indexed_spans_percentage', 'indexed_spans_usage', 'indexed_spans_percentage', 'custom_event_usage', 'custom_event_percentage', 'logs_indexed_custom_retention_usage', 'logs_indexed_custom_retention_percentage', 'logs_indexed_360day_usage', 'logs_indexed_360day_percentage', 'logs_indexed_180day_usage', 'logs_indexed_180day_percentage', 'logs_indexed_90day_usage', 'logs_indexed_90day_percentage', 'logs_indexed_60day_usage', 'logs_indexed_60day_percentage', 'logs_indexed_45day_usage', 'logs_indexed_45day_percentage', 'logs_indexed_30day_usage', 'logs_indexed_30day_percentage', 'logs_indexed_15day_usage', 'logs_indexed_15day_percentage', 'logs_indexed_7day_usage', 'logs_indexed_7day_percentage', 'logs_indexed_3day_usage', 'logs_indexed_3day_percentage', 'logs_indexed_1day_usage', 'logs_indexed_1day_percentage', 'rum_ingested_usage', 'rum_ingested_percentage', 'rum_investigate_usage', 'rum_investigate_percentage', 'rum_replay_sessions_usage', 'rum_replay_sessions_percentage', 'rum_session_replay_add_on_usage', 'rum_session_replay_add_on_percentage', 'rum_browser_mobile_sessions_usage', 'rum_browser_mobile_sessions_percentage', 'ingested_spans_bytes_usage', 'ingested_spans_bytes_percentage', 'siem_12mo_retention_usage', 'siem_12mo_retention_percentage', 'siem_6mo_retention_usage', 'siem_6mo_retention_percentage', 'siem_analyzed_logs_add_on_usage', 'siem_analyzed_logs_add_on_percentage', 'siem_ingested_bytes_usage', 'siem_ingested_bytes_percentage', 'workflow_executions_usage', 'workflow_executions_percentage', 'sca_fargate_usage', 'sca_fargate_percentage', '*'] if @api_client.config.client_side_validation && !allowable_values.include?(fields) fail ArgumentError, "invalid value for \"fields\", must be one of #{allowable_values}" end @@ -486,7 +486,7 @@ def get_monthly_usage_attribution_with_http_info(start_month, fields, opts = {}) if @api_client.config.client_side_validation && opts[:'sort_direction'] && !allowable_values.include?(opts[:'sort_direction']) fail ArgumentError, "invalid value for \"sort_direction\", must be one of #{allowable_values}" end - allowable_values = ['api_usage', 'api_percentage', 'apm_fargate_usage', 'apm_fargate_percentage', 'appsec_fargate_usage', 'appsec_fargate_percentage', 'apm_host_usage', 'apm_host_percentage', 'apm_usm_usage', 'apm_usm_percentage', 'appsec_usage', 'appsec_percentage', 'asm_serverless_traced_invocations_usage', 'asm_serverless_traced_invocations_percentage', 'bits_ai_investigations_usage', 'bits_ai_investigations_percentage', 'browser_usage', 'browser_percentage', 'ci_visibility_itr_usage', 'ci_visibility_itr_percentage', 'cloud_siem_usage', 'cloud_siem_percentage', 'code_security_host_usage', 'code_security_host_percentage', 'container_excl_agent_usage', 'container_excl_agent_percentage', 'container_usage', 'container_percentage', 'cspm_containers_percentage', 'cspm_containers_usage', 'cspm_hosts_percentage', 'cspm_hosts_usage', 'custom_timeseries_usage', 'custom_timeseries_percentage', 'custom_ingested_timeseries_usage', 'custom_ingested_timeseries_percentage', 'cws_containers_percentage', 'cws_containers_usage', 'cws_fargate_task_percentage', 'cws_fargate_task_usage', 'cws_hosts_percentage', 'cws_hosts_usage', 'data_jobs_monitoring_usage', 'data_jobs_monitoring_percentage', 'data_stream_monitoring_usage', 'data_stream_monitoring_percentage', 'dbm_hosts_percentage', 'dbm_hosts_usage', 'dbm_queries_percentage', 'dbm_queries_usage', 'error_tracking_usage', 'error_tracking_percentage', 'estimated_indexed_spans_usage', 'estimated_indexed_spans_percentage', 'estimated_ingested_spans_usage', 'estimated_ingested_spans_percentage', 'fargate_usage', 'fargate_percentage', 'flex_logs_starter_usage', 'flex_logs_starter_percentage', 'flex_stored_logs_usage', 'flex_stored_logs_percentage', 'functions_usage', 'functions_percentage', 'incident_management_monthly_active_users_usage', 'incident_management_monthly_active_users_percentage', 'infra_host_usage', 'infra_host_percentage', 'infra_host_basic_usage', 'infra_host_basic_percentage', 'invocations_usage', 'invocations_percentage', 'lambda_traced_invocations_usage', 'lambda_traced_invocations_percentage', 'llm_observability_usage', 'llm_observability_percentage', 'llm_spans_usage', 'llm_spans_percentage', 'mobile_app_testing_percentage', 'mobile_app_testing_usage', 'ndm_netflow_usage', 'ndm_netflow_percentage', 'network_device_wireless_usage', 'network_device_wireless_percentage', 'npm_host_usage', 'npm_host_percentage', 'obs_pipeline_bytes_usage', 'obs_pipeline_bytes_percentage', 'obs_pipelines_vcpu_usage', 'obs_pipelines_vcpu_percentage', 'online_archive_usage', 'online_archive_percentage', 'product_analytics_session_usage', 'product_analytics_session_percentage', 'profiled_container_usage', 'profiled_container_percentage', 'profiled_fargate_usage', 'profiled_fargate_percentage', 'profiled_host_usage', 'profiled_host_percentage', 'published_app_usage', 'published_app_percentage', 'serverless_apps_usage', 'serverless_apps_percentage', 'serverless_apps_apm_usage', 'serverless_apps_apm_percentage', 'snmp_usage', 'snmp_percentage', 'universal_service_monitoring_usage', 'universal_service_monitoring_percentage', 'vuln_management_hosts_usage', 'vuln_management_hosts_percentage', 'sds_scanned_bytes_usage', 'sds_scanned_bytes_percentage', 'ci_test_indexed_spans_usage', 'ci_test_indexed_spans_percentage', 'ingested_logs_bytes_usage', 'ingested_logs_bytes_percentage', 'ci_pipeline_indexed_spans_usage', 'ci_pipeline_indexed_spans_percentage', 'indexed_spans_usage', 'indexed_spans_percentage', 'custom_event_usage', 'custom_event_percentage', 'logs_indexed_custom_retention_usage', 'logs_indexed_custom_retention_percentage', 'logs_indexed_360day_usage', 'logs_indexed_360day_percentage', 'logs_indexed_180day_usage', 'logs_indexed_180day_percentage', 'logs_indexed_90day_usage', 'logs_indexed_90day_percentage', 'logs_indexed_60day_usage', 'logs_indexed_60day_percentage', 'logs_indexed_45day_usage', 'logs_indexed_45day_percentage', 'logs_indexed_30day_usage', 'logs_indexed_30day_percentage', 'logs_indexed_15day_usage', 'logs_indexed_15day_percentage', 'logs_indexed_7day_usage', 'logs_indexed_7day_percentage', 'logs_indexed_3day_usage', 'logs_indexed_3day_percentage', 'logs_indexed_1day_usage', 'logs_indexed_1day_percentage', 'rum_ingested_usage', 'rum_ingested_percentage', 'rum_investigate_usage', 'rum_investigate_percentage', 'rum_replay_sessions_usage', 'rum_replay_sessions_percentage', 'rum_session_replay_add_on_usage', 'rum_session_replay_add_on_percentage', 'rum_browser_mobile_sessions_usage', 'rum_browser_mobile_sessions_percentage', 'ingested_spans_bytes_usage', 'ingested_spans_bytes_percentage', 'siem_analyzed_logs_add_on_usage', 'siem_analyzed_logs_add_on_percentage', 'siem_ingested_bytes_usage', 'siem_ingested_bytes_percentage', 'workflow_executions_usage', 'workflow_executions_percentage', 'sca_fargate_usage', 'sca_fargate_percentage', '*'] + allowable_values = ['api_usage', 'api_percentage', 'apm_fargate_usage', 'apm_fargate_percentage', 'appsec_fargate_usage', 'appsec_fargate_percentage', 'apm_host_usage', 'apm_host_percentage', 'apm_usm_usage', 'apm_usm_percentage', 'appsec_usage', 'appsec_percentage', 'asm_serverless_traced_invocations_usage', 'asm_serverless_traced_invocations_percentage', 'bits_ai_investigations_usage', 'bits_ai_investigations_percentage', 'browser_usage', 'browser_percentage', 'ci_visibility_itr_usage', 'ci_visibility_itr_percentage', 'cloud_siem_usage', 'cloud_siem_percentage', 'code_security_host_usage', 'code_security_host_percentage', 'container_excl_agent_usage', 'container_excl_agent_percentage', 'container_usage', 'container_percentage', 'cspm_containers_percentage', 'cspm_containers_usage', 'cspm_hosts_percentage', 'cspm_hosts_usage', 'custom_timeseries_usage', 'custom_timeseries_percentage', 'custom_ingested_timeseries_usage', 'custom_ingested_timeseries_percentage', 'cws_containers_percentage', 'cws_containers_usage', 'cws_fargate_task_percentage', 'cws_fargate_task_usage', 'cws_hosts_percentage', 'cws_hosts_usage', 'data_jobs_monitoring_usage', 'data_jobs_monitoring_percentage', 'data_stream_monitoring_usage', 'data_stream_monitoring_percentage', 'dbm_hosts_percentage', 'dbm_hosts_usage', 'dbm_queries_percentage', 'dbm_queries_usage', 'error_tracking_usage', 'error_tracking_percentage', 'estimated_indexed_spans_usage', 'estimated_indexed_spans_percentage', 'estimated_ingested_spans_usage', 'estimated_ingested_spans_percentage', 'fargate_usage', 'fargate_percentage', 'flex_logs_starter_usage', 'flex_logs_starter_percentage', 'flex_stored_logs_usage', 'flex_stored_logs_percentage', 'functions_usage', 'functions_percentage', 'incident_management_monthly_active_users_usage', 'incident_management_monthly_active_users_percentage', 'infra_host_usage', 'infra_host_percentage', 'infra_host_basic_usage', 'infra_host_basic_percentage', 'invocations_usage', 'invocations_percentage', 'lambda_traced_invocations_usage', 'lambda_traced_invocations_percentage', 'llm_observability_usage', 'llm_observability_percentage', 'llm_spans_usage', 'llm_spans_percentage', 'mobile_app_testing_percentage', 'mobile_app_testing_usage', 'ndm_netflow_usage', 'ndm_netflow_percentage', 'network_device_wireless_usage', 'network_device_wireless_percentage', 'npm_host_usage', 'npm_host_percentage', 'obs_pipeline_bytes_usage', 'obs_pipeline_bytes_percentage', 'obs_pipelines_vcpu_usage', 'obs_pipelines_vcpu_percentage', 'online_archive_usage', 'online_archive_percentage', 'product_analytics_session_usage', 'product_analytics_session_percentage', 'profiled_container_usage', 'profiled_container_percentage', 'profiled_fargate_usage', 'profiled_fargate_percentage', 'profiled_host_usage', 'profiled_host_percentage', 'published_app_usage', 'published_app_percentage', 'serverless_apps_usage', 'serverless_apps_percentage', 'serverless_apps_apm_usage', 'serverless_apps_apm_percentage', 'snmp_usage', 'snmp_percentage', 'universal_service_monitoring_usage', 'universal_service_monitoring_percentage', 'vuln_management_hosts_usage', 'vuln_management_hosts_percentage', 'sds_scanned_bytes_usage', 'sds_scanned_bytes_percentage', 'ci_test_indexed_spans_usage', 'ci_test_indexed_spans_percentage', 'ingested_logs_bytes_usage', 'ingested_logs_bytes_percentage', 'ci_pipeline_indexed_spans_usage', 'ci_pipeline_indexed_spans_percentage', 'indexed_spans_usage', 'indexed_spans_percentage', 'custom_event_usage', 'custom_event_percentage', 'logs_indexed_custom_retention_usage', 'logs_indexed_custom_retention_percentage', 'logs_indexed_360day_usage', 'logs_indexed_360day_percentage', 'logs_indexed_180day_usage', 'logs_indexed_180day_percentage', 'logs_indexed_90day_usage', 'logs_indexed_90day_percentage', 'logs_indexed_60day_usage', 'logs_indexed_60day_percentage', 'logs_indexed_45day_usage', 'logs_indexed_45day_percentage', 'logs_indexed_30day_usage', 'logs_indexed_30day_percentage', 'logs_indexed_15day_usage', 'logs_indexed_15day_percentage', 'logs_indexed_7day_usage', 'logs_indexed_7day_percentage', 'logs_indexed_3day_usage', 'logs_indexed_3day_percentage', 'logs_indexed_1day_usage', 'logs_indexed_1day_percentage', 'rum_ingested_usage', 'rum_ingested_percentage', 'rum_investigate_usage', 'rum_investigate_percentage', 'rum_replay_sessions_usage', 'rum_replay_sessions_percentage', 'rum_session_replay_add_on_usage', 'rum_session_replay_add_on_percentage', 'rum_browser_mobile_sessions_usage', 'rum_browser_mobile_sessions_percentage', 'ingested_spans_bytes_usage', 'ingested_spans_bytes_percentage', 'siem_12mo_retention_usage', 'siem_12mo_retention_percentage', 'siem_6mo_retention_usage', 'siem_6mo_retention_percentage', 'siem_analyzed_logs_add_on_usage', 'siem_analyzed_logs_add_on_percentage', 'siem_ingested_bytes_usage', 'siem_ingested_bytes_percentage', 'workflow_executions_usage', 'workflow_executions_percentage', 'sca_fargate_usage', 'sca_fargate_percentage', '*'] if @api_client.config.client_side_validation && opts[:'sort_name'] && !allowable_values.include?(opts[:'sort_name']) fail ArgumentError, "invalid value for \"sort_name\", must be one of #{allowable_values}" end diff --git a/lib/datadog_api_client/v1/models/hourly_usage_attribution_usage_type.rb b/lib/datadog_api_client/v1/models/hourly_usage_attribution_usage_type.rb index 59186efcc0b6..6800f07d978e 100644 --- a/lib/datadog_api_client/v1/models/hourly_usage_attribution_usage_type.rb +++ b/lib/datadog_api_client/v1/models/hourly_usage_attribution_usage_type.rb @@ -103,6 +103,8 @@ class HourlyUsageAttributionUsageType SDS_SCANNED_BYTES_USAGE = "sds_scanned_bytes_usage".freeze SERVERLESS_APPS_USAGE = "serverless_apps_usage".freeze SERVERLESS_APPS_APM_USAGE = "serverless_apps_apm_usage".freeze + SIEM_12MO_RETENTION_USAGE = "siem_12mo_retention_usage".freeze + SIEM_6MO_RETENTION_USAGE = "siem_6mo_retention_usage".freeze SIEM_ANALYZED_LOGS_ADD_ON_USAGE = "siem_analyzed_logs_add_on_usage".freeze SIEM_INGESTED_BYTES_USAGE = "siem_ingested_bytes_usage".freeze SNMP_USAGE = "snmp_usage".freeze diff --git a/lib/datadog_api_client/v1/models/monthly_usage_attribution_supported_metrics.rb b/lib/datadog_api_client/v1/models/monthly_usage_attribution_supported_metrics.rb index 3125422e0d77..6888aeb7ee5a 100644 --- a/lib/datadog_api_client/v1/models/monthly_usage_attribution_supported_metrics.rb +++ b/lib/datadog_api_client/v1/models/monthly_usage_attribution_supported_metrics.rb @@ -180,6 +180,10 @@ class MonthlyUsageAttributionSupportedMetrics RUM_BROWSER_MOBILE_SESSIONS_PERCENTAGE = "rum_browser_mobile_sessions_percentage".freeze INGESTED_SPANS_BYTES_USAGE = "ingested_spans_bytes_usage".freeze INGESTED_SPANS_BYTES_PERCENTAGE = "ingested_spans_bytes_percentage".freeze + SIEM_12MO_RETENTION_USAGE = "siem_12mo_retention_usage".freeze + SIEM_12MO_RETENTION_PERCENTAGE = "siem_12mo_retention_percentage".freeze + SIEM_6MO_RETENTION_USAGE = "siem_6mo_retention_usage".freeze + SIEM_6MO_RETENTION_PERCENTAGE = "siem_6mo_retention_percentage".freeze SIEM_ANALYZED_LOGS_ADD_ON_USAGE = "siem_analyzed_logs_add_on_usage".freeze SIEM_ANALYZED_LOGS_ADD_ON_PERCENTAGE = "siem_analyzed_logs_add_on_percentage".freeze SIEM_INGESTED_BYTES_USAGE = "siem_ingested_bytes_usage".freeze diff --git a/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb b/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb index 5f55f0354788..2cce85c1c26b 100644 --- a/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb +++ b/lib/datadog_api_client/v1/models/monthly_usage_attribution_values.rb @@ -483,6 +483,18 @@ class MonthlyUsageAttributionValues # The total Serverless Apps usage by tag(s). attr_accessor :serverless_apps_usage + # The percentage of Cloud SIEM Indexed Logs (12-month retention) usage by tag(s). + attr_accessor :siem_12mo_retention_percentage + + # The Cloud SIEM Indexed Logs (12-month retention) usage by tag(s). + attr_accessor :siem_12mo_retention_usage + + # The percentage of Cloud SIEM Indexed Logs (6-month retention) usage by tag(s). + attr_accessor :siem_6mo_retention_percentage + + # The Cloud SIEM Indexed Logs (6-month retention) usage by tag(s). + attr_accessor :siem_6mo_retention_usage + # The percentage of log events analyzed by Cloud SIEM usage by tag(s). attr_accessor :siem_analyzed_logs_add_on_percentage @@ -679,6 +691,10 @@ def self.attribute_map :'serverless_apps_apm_usage' => :'serverless_apps_apm_usage', :'serverless_apps_percentage' => :'serverless_apps_percentage', :'serverless_apps_usage' => :'serverless_apps_usage', + :'siem_12mo_retention_percentage' => :'siem_12mo_retention_percentage', + :'siem_12mo_retention_usage' => :'siem_12mo_retention_usage', + :'siem_6mo_retention_percentage' => :'siem_6mo_retention_percentage', + :'siem_6mo_retention_usage' => :'siem_6mo_retention_usage', :'siem_analyzed_logs_add_on_percentage' => :'siem_analyzed_logs_add_on_percentage', :'siem_analyzed_logs_add_on_usage' => :'siem_analyzed_logs_add_on_usage', :'siem_ingested_bytes_percentage' => :'siem_ingested_bytes_percentage', @@ -852,6 +868,10 @@ def self.openapi_types :'serverless_apps_apm_usage' => :'Float', :'serverless_apps_percentage' => :'Float', :'serverless_apps_usage' => :'Float', + :'siem_12mo_retention_percentage' => :'Float', + :'siem_12mo_retention_usage' => :'Float', + :'siem_6mo_retention_percentage' => :'Float', + :'siem_6mo_retention_usage' => :'Float', :'siem_analyzed_logs_add_on_percentage' => :'Float', :'siem_analyzed_logs_add_on_usage' => :'Float', :'siem_ingested_bytes_percentage' => :'Float', @@ -1501,6 +1521,22 @@ def initialize(attributes = {}) self.serverless_apps_usage = attributes[:'serverless_apps_usage'] end + if attributes.key?(:'siem_12mo_retention_percentage') + self.siem_12mo_retention_percentage = attributes[:'siem_12mo_retention_percentage'] + end + + if attributes.key?(:'siem_12mo_retention_usage') + self.siem_12mo_retention_usage = attributes[:'siem_12mo_retention_usage'] + end + + if attributes.key?(:'siem_6mo_retention_percentage') + self.siem_6mo_retention_percentage = attributes[:'siem_6mo_retention_percentage'] + end + + if attributes.key?(:'siem_6mo_retention_usage') + self.siem_6mo_retention_usage = attributes[:'siem_6mo_retention_usage'] + end + if attributes.key?(:'siem_analyzed_logs_add_on_percentage') self.siem_analyzed_logs_add_on_percentage = attributes[:'siem_analyzed_logs_add_on_percentage'] end @@ -1730,6 +1766,10 @@ def ==(o) serverless_apps_apm_usage == o.serverless_apps_apm_usage && serverless_apps_percentage == o.serverless_apps_percentage && serverless_apps_usage == o.serverless_apps_usage && + siem_12mo_retention_percentage == o.siem_12mo_retention_percentage && + siem_12mo_retention_usage == o.siem_12mo_retention_usage && + siem_6mo_retention_percentage == o.siem_6mo_retention_percentage && + siem_6mo_retention_usage == o.siem_6mo_retention_usage && siem_analyzed_logs_add_on_percentage == o.siem_analyzed_logs_add_on_percentage && siem_analyzed_logs_add_on_usage == o.siem_analyzed_logs_add_on_usage && siem_ingested_bytes_percentage == o.siem_ingested_bytes_percentage && @@ -1749,7 +1789,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [api_percentage, api_usage, apm_fargate_percentage, apm_fargate_usage, apm_host_percentage, apm_host_usage, apm_usm_percentage, apm_usm_usage, appsec_fargate_percentage, appsec_fargate_usage, appsec_percentage, appsec_usage, asm_serverless_traced_invocations_percentage, asm_serverless_traced_invocations_usage, bits_ai_investigations_percentage, bits_ai_investigations_usage, browser_percentage, browser_usage, ci_code_coverage_committers_percentage, ci_code_coverage_committers_usage, ci_pipeline_indexed_spans_percentage, ci_pipeline_indexed_spans_usage, ci_test_indexed_spans_percentage, ci_test_indexed_spans_usage, ci_visibility_itr_percentage, ci_visibility_itr_usage, cloud_siem_percentage, cloud_siem_usage, code_security_host_percentage, code_security_host_usage, container_excl_agent_percentage, container_excl_agent_usage, container_percentage, container_usage, cspm_containers_percentage, cspm_containers_usage, cspm_hosts_percentage, cspm_hosts_usage, custom_event_percentage, custom_event_usage, custom_ingested_timeseries_percentage, custom_ingested_timeseries_usage, custom_timeseries_percentage, custom_timeseries_usage, cws_containers_percentage, cws_containers_usage, cws_fargate_task_percentage, cws_fargate_task_usage, cws_hosts_percentage, cws_hosts_usage, data_jobs_monitoring_usage, data_stream_monitoring_usage, dbm_hosts_percentage, dbm_hosts_usage, dbm_queries_percentage, dbm_queries_usage, error_tracking_percentage, error_tracking_usage, estimated_indexed_spans_percentage, estimated_indexed_spans_usage, estimated_ingested_spans_percentage, estimated_ingested_spans_usage, fargate_percentage, fargate_usage, flex_logs_starter_percentage, flex_logs_starter_usage, flex_stored_logs_percentage, flex_stored_logs_usage, functions_percentage, functions_usage, incident_management_monthly_active_users_percentage, incident_management_monthly_active_users_usage, indexed_spans_percentage, indexed_spans_usage, infra_host_basic_percentage, infra_host_basic_usage, infra_host_percentage, infra_host_usage, ingested_logs_bytes_percentage, ingested_logs_bytes_usage, ingested_spans_bytes_percentage, ingested_spans_bytes_usage, invocations_percentage, invocations_usage, lambda_traced_invocations_percentage, lambda_traced_invocations_usage, llm_observability_percentage, llm_observability_usage, llm_spans_percentage, llm_spans_usage, logs_indexed_15day_percentage, logs_indexed_15day_usage, logs_indexed_180day_percentage, logs_indexed_180day_usage, logs_indexed_1day_percentage, logs_indexed_1day_usage, logs_indexed_30day_percentage, logs_indexed_30day_usage, logs_indexed_360day_percentage, logs_indexed_360day_usage, logs_indexed_3day_percentage, logs_indexed_3day_usage, logs_indexed_45day_percentage, logs_indexed_45day_usage, logs_indexed_60day_percentage, logs_indexed_60day_usage, logs_indexed_7day_percentage, logs_indexed_7day_usage, logs_indexed_90day_percentage, logs_indexed_90day_usage, logs_indexed_custom_retention_percentage, logs_indexed_custom_retention_usage, mobile_app_testing_percentage, mobile_app_testing_usage, ndm_netflow_percentage, ndm_netflow_usage, network_device_wireless_percentage, network_device_wireless_usage, npm_host_percentage, npm_host_usage, obs_pipeline_bytes_percentage, obs_pipeline_bytes_usage, obs_pipelines_vcpu_percentage, obs_pipelines_vcpu_usage, online_archive_percentage, online_archive_usage, product_analytics_session_percentage, product_analytics_session_usage, profiled_container_percentage, profiled_container_usage, profiled_fargate_percentage, profiled_fargate_usage, profiled_host_percentage, profiled_host_usage, published_app_percentage, published_app_usage, rum_browser_mobile_sessions_percentage, rum_browser_mobile_sessions_usage, rum_ingested_percentage, rum_ingested_usage, rum_investigate_percentage, rum_investigate_usage, rum_replay_sessions_percentage, rum_replay_sessions_usage, rum_session_replay_add_on_percentage, rum_session_replay_add_on_usage, sca_fargate_percentage, sca_fargate_usage, sds_scanned_bytes_percentage, sds_scanned_bytes_usage, serverless_apps_apm_percentage, serverless_apps_apm_usage, serverless_apps_percentage, serverless_apps_usage, siem_analyzed_logs_add_on_percentage, siem_analyzed_logs_add_on_usage, siem_ingested_bytes_percentage, siem_ingested_bytes_usage, snmp_percentage, snmp_usage, universal_service_monitoring_percentage, universal_service_monitoring_usage, vuln_management_hosts_percentage, vuln_management_hosts_usage, workflow_executions_percentage, workflow_executions_usage, additional_properties].hash + [api_percentage, api_usage, apm_fargate_percentage, apm_fargate_usage, apm_host_percentage, apm_host_usage, apm_usm_percentage, apm_usm_usage, appsec_fargate_percentage, appsec_fargate_usage, appsec_percentage, appsec_usage, asm_serverless_traced_invocations_percentage, asm_serverless_traced_invocations_usage, bits_ai_investigations_percentage, bits_ai_investigations_usage, browser_percentage, browser_usage, ci_code_coverage_committers_percentage, ci_code_coverage_committers_usage, ci_pipeline_indexed_spans_percentage, ci_pipeline_indexed_spans_usage, ci_test_indexed_spans_percentage, ci_test_indexed_spans_usage, ci_visibility_itr_percentage, ci_visibility_itr_usage, cloud_siem_percentage, cloud_siem_usage, code_security_host_percentage, code_security_host_usage, container_excl_agent_percentage, container_excl_agent_usage, container_percentage, container_usage, cspm_containers_percentage, cspm_containers_usage, cspm_hosts_percentage, cspm_hosts_usage, custom_event_percentage, custom_event_usage, custom_ingested_timeseries_percentage, custom_ingested_timeseries_usage, custom_timeseries_percentage, custom_timeseries_usage, cws_containers_percentage, cws_containers_usage, cws_fargate_task_percentage, cws_fargate_task_usage, cws_hosts_percentage, cws_hosts_usage, data_jobs_monitoring_usage, data_stream_monitoring_usage, dbm_hosts_percentage, dbm_hosts_usage, dbm_queries_percentage, dbm_queries_usage, error_tracking_percentage, error_tracking_usage, estimated_indexed_spans_percentage, estimated_indexed_spans_usage, estimated_ingested_spans_percentage, estimated_ingested_spans_usage, fargate_percentage, fargate_usage, flex_logs_starter_percentage, flex_logs_starter_usage, flex_stored_logs_percentage, flex_stored_logs_usage, functions_percentage, functions_usage, incident_management_monthly_active_users_percentage, incident_management_monthly_active_users_usage, indexed_spans_percentage, indexed_spans_usage, infra_host_basic_percentage, infra_host_basic_usage, infra_host_percentage, infra_host_usage, ingested_logs_bytes_percentage, ingested_logs_bytes_usage, ingested_spans_bytes_percentage, ingested_spans_bytes_usage, invocations_percentage, invocations_usage, lambda_traced_invocations_percentage, lambda_traced_invocations_usage, llm_observability_percentage, llm_observability_usage, llm_spans_percentage, llm_spans_usage, logs_indexed_15day_percentage, logs_indexed_15day_usage, logs_indexed_180day_percentage, logs_indexed_180day_usage, logs_indexed_1day_percentage, logs_indexed_1day_usage, logs_indexed_30day_percentage, logs_indexed_30day_usage, logs_indexed_360day_percentage, logs_indexed_360day_usage, logs_indexed_3day_percentage, logs_indexed_3day_usage, logs_indexed_45day_percentage, logs_indexed_45day_usage, logs_indexed_60day_percentage, logs_indexed_60day_usage, logs_indexed_7day_percentage, logs_indexed_7day_usage, logs_indexed_90day_percentage, logs_indexed_90day_usage, logs_indexed_custom_retention_percentage, logs_indexed_custom_retention_usage, mobile_app_testing_percentage, mobile_app_testing_usage, ndm_netflow_percentage, ndm_netflow_usage, network_device_wireless_percentage, network_device_wireless_usage, npm_host_percentage, npm_host_usage, obs_pipeline_bytes_percentage, obs_pipeline_bytes_usage, obs_pipelines_vcpu_percentage, obs_pipelines_vcpu_usage, online_archive_percentage, online_archive_usage, product_analytics_session_percentage, product_analytics_session_usage, profiled_container_percentage, profiled_container_usage, profiled_fargate_percentage, profiled_fargate_usage, profiled_host_percentage, profiled_host_usage, published_app_percentage, published_app_usage, rum_browser_mobile_sessions_percentage, rum_browser_mobile_sessions_usage, rum_ingested_percentage, rum_ingested_usage, rum_investigate_percentage, rum_investigate_usage, rum_replay_sessions_percentage, rum_replay_sessions_usage, rum_session_replay_add_on_percentage, rum_session_replay_add_on_usage, sca_fargate_percentage, sca_fargate_usage, sds_scanned_bytes_percentage, sds_scanned_bytes_usage, serverless_apps_apm_percentage, serverless_apps_apm_usage, serverless_apps_percentage, serverless_apps_usage, siem_12mo_retention_percentage, siem_12mo_retention_usage, siem_6mo_retention_percentage, siem_6mo_retention_usage, siem_analyzed_logs_add_on_percentage, siem_analyzed_logs_add_on_usage, siem_ingested_bytes_percentage, siem_ingested_bytes_usage, snmp_percentage, snmp_usage, universal_service_monitoring_percentage, universal_service_monitoring_usage, vuln_management_hosts_percentage, vuln_management_hosts_usage, workflow_executions_percentage, workflow_executions_usage, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v1/models/usage_summary_date.rb b/lib/datadog_api_client/v1/models/usage_summary_date.rb index 95b06237e5ce..41afa00896cf 100644 --- a/lib/datadog_api_client/v1/models/usage_summary_date.rb +++ b/lib/datadog_api_client/v1/models/usage_summary_date.rb @@ -165,6 +165,9 @@ class UsageSummaryDate # Shows the sum of all Cloud Security Information and Event Management events over all hours in the current date for the given org. attr_accessor :cloud_siem_events_sum + # Shows the sum of all Cloud SIEM Indexed Logs over all hours in the current date for the given org. + attr_accessor :cloud_siem_indexed_logs_sum + # Shows the high-water mark of all Static Analysis committers over all hours in the current date for the given org. attr_accessor :code_analysis_sa_committers_hwm @@ -729,6 +732,12 @@ class UsageSummaryDate # Shows the average number of Serverless Apps for Azure and Google Cloud for the given date and given org. attr_accessor :serverless_apps_total_count_avg + # Shows the sum of Cloud SIEM Indexed Logs (12-month retention) over all hours in the current date for the given org. + attr_accessor :siem_12mo_retention_sum + + # Shows the sum of Cloud SIEM Indexed Logs (6-month retention) over all hours in the current date for the given org. + attr_accessor :siem_6mo_retention_sum + # Shows the sum of all log events analyzed by Cloud SIEM over all hours in the current date for the given org. attr_accessor :siem_analyzed_logs_add_on_count_sum @@ -816,6 +825,7 @@ def self.attribute_map :'cloud_cost_management_host_count_avg' => :'cloud_cost_management_host_count_avg', :'cloud_cost_management_oci_host_count_avg' => :'cloud_cost_management_oci_host_count_avg', :'cloud_siem_events_sum' => :'cloud_siem_events_sum', + :'cloud_siem_indexed_logs_sum' => :'cloud_siem_indexed_logs_sum', :'code_analysis_sa_committers_hwm' => :'code_analysis_sa_committers_hwm', :'code_analysis_sca_committers_hwm' => :'code_analysis_sca_committers_hwm', :'code_security_host_top99p' => :'code_security_host_top99p', @@ -1004,6 +1014,8 @@ def self.attribute_map :'serverless_apps_google_count_avg' => :'serverless_apps_google_count_avg', :'serverless_apps_infra_gcp_gke_autopilot_pods_avg' => :'serverless_apps_infra_gcp_gke_autopilot_pods_avg', :'serverless_apps_total_count_avg' => :'serverless_apps_total_count_avg', + :'siem_12mo_retention_sum' => :'siem_12mo_retention_sum', + :'siem_6mo_retention_sum' => :'siem_6mo_retention_sum', :'siem_analyzed_logs_add_on_count_sum' => :'siem_analyzed_logs_add_on_count_sum', :'synthetics_browser_check_calls_count_sum' => :'synthetics_browser_check_calls_count_sum', :'synthetics_check_calls_count_sum' => :'synthetics_check_calls_count_sum', @@ -1070,6 +1082,7 @@ def self.openapi_types :'cloud_cost_management_host_count_avg' => :'Integer', :'cloud_cost_management_oci_host_count_avg' => :'Integer', :'cloud_siem_events_sum' => :'Integer', + :'cloud_siem_indexed_logs_sum' => :'Integer', :'code_analysis_sa_committers_hwm' => :'Integer', :'code_analysis_sca_committers_hwm' => :'Integer', :'code_security_host_top99p' => :'Integer', @@ -1258,6 +1271,8 @@ def self.openapi_types :'serverless_apps_google_count_avg' => :'Integer', :'serverless_apps_infra_gcp_gke_autopilot_pods_avg' => :'Integer', :'serverless_apps_total_count_avg' => :'Integer', + :'siem_12mo_retention_sum' => :'Integer', + :'siem_6mo_retention_sum' => :'Integer', :'siem_analyzed_logs_add_on_count_sum' => :'Integer', :'synthetics_browser_check_calls_count_sum' => :'Integer', :'synthetics_check_calls_count_sum' => :'Integer', @@ -1482,6 +1497,10 @@ def initialize(attributes = {}) self.cloud_siem_events_sum = attributes[:'cloud_siem_events_sum'] end + if attributes.key?(:'cloud_siem_indexed_logs_sum') + self.cloud_siem_indexed_logs_sum = attributes[:'cloud_siem_indexed_logs_sum'] + end + if attributes.key?(:'code_analysis_sa_committers_hwm') self.code_analysis_sa_committers_hwm = attributes[:'code_analysis_sa_committers_hwm'] end @@ -2236,6 +2255,14 @@ def initialize(attributes = {}) self.serverless_apps_total_count_avg = attributes[:'serverless_apps_total_count_avg'] end + if attributes.key?(:'siem_12mo_retention_sum') + self.siem_12mo_retention_sum = attributes[:'siem_12mo_retention_sum'] + end + + if attributes.key?(:'siem_6mo_retention_sum') + self.siem_6mo_retention_sum = attributes[:'siem_6mo_retention_sum'] + end + if attributes.key?(:'siem_analyzed_logs_add_on_count_sum') self.siem_analyzed_logs_add_on_count_sum = attributes[:'siem_analyzed_logs_add_on_count_sum'] end @@ -2355,6 +2382,7 @@ def ==(o) cloud_cost_management_host_count_avg == o.cloud_cost_management_host_count_avg && cloud_cost_management_oci_host_count_avg == o.cloud_cost_management_oci_host_count_avg && cloud_siem_events_sum == o.cloud_siem_events_sum && + cloud_siem_indexed_logs_sum == o.cloud_siem_indexed_logs_sum && code_analysis_sa_committers_hwm == o.code_analysis_sa_committers_hwm && code_analysis_sca_committers_hwm == o.code_analysis_sca_committers_hwm && code_security_host_top99p == o.code_security_host_top99p && @@ -2543,6 +2571,8 @@ def ==(o) serverless_apps_google_count_avg == o.serverless_apps_google_count_avg && serverless_apps_infra_gcp_gke_autopilot_pods_avg == o.serverless_apps_infra_gcp_gke_autopilot_pods_avg && serverless_apps_total_count_avg == o.serverless_apps_total_count_avg && + siem_12mo_retention_sum == o.siem_12mo_retention_sum && + siem_6mo_retention_sum == o.siem_6mo_retention_sum && siem_analyzed_logs_add_on_count_sum == o.siem_analyzed_logs_add_on_count_sum && synthetics_browser_check_calls_count_sum == o.synthetics_browser_check_calls_count_sum && synthetics_check_calls_count_sum == o.synthetics_check_calls_count_sum && @@ -2561,7 +2591,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [agent_host_top99p, apm_azure_app_service_host_top99p, apm_devsecops_host_top99p, apm_enterprise_standalone_hosts_top99p, apm_fargate_count_avg, apm_host_top99p, apm_pro_standalone_hosts_top99p, appsec_fargate_count_avg, asm_serverless_sum, audit_logs_lines_indexed_sum, audit_trail_enabled_hwm, avg_profiled_fargate_tasks, aws_host_top99p, aws_lambda_func_count, aws_lambda_invocations_sum, azure_app_service_top99p, billable_ingested_bytes_sum, bits_ai_investigations_sum, browser_rum_lite_session_count_sum, browser_rum_replay_session_count_sum, browser_rum_units_sum, ccm_anthropic_spend_last, ccm_aws_spend_last, ccm_azure_spend_last, ccm_confluent_spend_last, ccm_databricks_spend_last, ccm_elastic_spend_last, ccm_fastly_spend_last, ccm_gcp_spend_last, ccm_github_spend_last, ccm_mongodb_spend_last, ccm_oci_spend_last, ccm_openai_spend_last, ccm_snowflake_spend_last, ccm_spend_monitored_ent_last, ccm_spend_monitored_pro_last, ccm_twilio_spend_last, ci_pipeline_indexed_spans_sum, ci_test_indexed_spans_sum, ci_visibility_itr_committers_hwm, ci_visibility_pipeline_committers_hwm, ci_visibility_test_committers_hwm, cloud_cost_management_aws_host_count_avg, cloud_cost_management_azure_host_count_avg, cloud_cost_management_gcp_host_count_avg, cloud_cost_management_host_count_avg, cloud_cost_management_oci_host_count_avg, cloud_siem_events_sum, code_analysis_sa_committers_hwm, code_analysis_sca_committers_hwm, code_security_host_top99p, container_avg, container_excl_agent_avg, container_hwm, csm_container_enterprise_compliance_count_sum, csm_container_enterprise_cws_count_sum, csm_container_enterprise_total_count_sum, csm_host_enterprise_aas_host_count_top99p, csm_host_enterprise_aws_host_count_top99p, csm_host_enterprise_azure_host_count_top99p, csm_host_enterprise_compliance_host_count_top99p, csm_host_enterprise_cws_host_count_top99p, csm_host_enterprise_gcp_host_count_top99p, csm_host_enterprise_oci_host_count_top99p, csm_host_enterprise_total_host_count_top99p, csm_host_pro_hosts_agentless_scanners_sum, csm_host_pro_hosts_agentless_scanners_top99p, csm_host_pro_oci_host_count_top99p, cspm_aas_host_top99p, cspm_aws_host_top99p, cspm_azure_host_top99p, cspm_container_avg, cspm_container_hwm, cspm_gcp_host_top99p, cspm_host_top99p, cspm_hosts_agentless_scanners_sum, cspm_hosts_agentless_scanners_top99p, custom_ts_avg, cws_container_count_avg, cws_fargate_task_avg, cws_host_top99p, data_jobs_monitoring_host_hr_sum, date, dbm_host_top99p, dbm_queries_count_avg, do_jobs_monitoring_orchestrators_job_hours_sum, eph_infra_host_agent_sum, eph_infra_host_alibaba_sum, eph_infra_host_aws_sum, eph_infra_host_azure_sum, eph_infra_host_basic_infra_basic_agent_sum, eph_infra_host_basic_infra_basic_vsphere_sum, eph_infra_host_basic_sum, eph_infra_host_ent_sum, eph_infra_host_gcp_sum, eph_infra_host_heroku_sum, eph_infra_host_only_aas_sum, eph_infra_host_only_vsphere_sum, eph_infra_host_opentelemetry_apm_sum, eph_infra_host_opentelemetry_sum, eph_infra_host_pro_sum, eph_infra_host_proplus_sum, eph_infra_host_proxmox_sum, error_tracking_apm_error_events_sum, error_tracking_error_events_sum, error_tracking_events_sum, error_tracking_rum_error_events_sum, event_management_correlation_correlated_events_sum, event_management_correlation_correlated_related_events_sum, event_management_correlation_sum, fargate_container_profiler_profiling_fargate_avg, fargate_container_profiler_profiling_fargate_eks_avg, fargate_tasks_count_avg, fargate_tasks_count_hwm, feature_flags_config_requests_sum, flex_logs_compute_large_avg, flex_logs_compute_medium_avg, flex_logs_compute_small_avg, flex_logs_compute_xlarge_avg, flex_logs_compute_xsmall_avg, flex_logs_starter_avg, flex_logs_starter_storage_index_avg, flex_logs_starter_storage_retention_adjustment_avg, flex_stored_logs_avg, forwarding_events_bytes_sum, gcp_host_top99p, heroku_host_top99p, incident_management_monthly_active_users_hwm, incident_management_seats_hwm, indexed_events_count_sum, infra_edge_monitoring_devices_top99p, infra_host_basic_infra_basic_agent_top99p, infra_host_basic_infra_basic_vsphere_top99p, infra_host_basic_top99p, infra_host_top99p, infra_storage_mgmt_objects_count_avg, ingested_events_bytes_sum, iot_device_sum, iot_device_top99p, llm_observability_min_spend_sum, llm_observability_sum, mobile_rum_lite_session_count_sum, mobile_rum_session_count_android_sum, mobile_rum_session_count_flutter_sum, mobile_rum_session_count_ios_sum, mobile_rum_session_count_reactnative_sum, mobile_rum_session_count_roku_sum, mobile_rum_session_count_sum, mobile_rum_units_sum, ndm_netflow_events_sum, netflow_indexed_events_count_sum, network_device_wireless_top99p, network_path_sum, npm_host_top99p, observability_pipelines_bytes_processed_sum, oci_host_sum, oci_host_top99p, on_call_seat_hwm, online_archive_events_count_sum, opentelemetry_apm_host_top99p, opentelemetry_host_top99p, orgs, product_analytics_sum, profiling_aas_count_top99p, profiling_host_top99p, proxmox_host_sum, proxmox_host_top99p, published_app_hwm, rum_browser_and_mobile_session_count, rum_browser_legacy_session_count_sum, rum_browser_lite_session_count_sum, rum_browser_replay_session_count_sum, rum_indexed_sessions_sum, rum_ingested_sessions_sum, rum_lite_session_count_sum, rum_mobile_legacy_session_count_android_sum, rum_mobile_legacy_session_count_flutter_sum, rum_mobile_legacy_session_count_ios_sum, rum_mobile_legacy_session_count_reactnative_sum, rum_mobile_legacy_session_count_roku_sum, rum_mobile_lite_session_count_android_sum, rum_mobile_lite_session_count_flutter_sum, rum_mobile_lite_session_count_ios_sum, rum_mobile_lite_session_count_kotlinmultiplatform_sum, rum_mobile_lite_session_count_reactnative_sum, rum_mobile_lite_session_count_roku_sum, rum_mobile_lite_session_count_unity_sum, rum_mobile_replay_session_count_android_sum, rum_mobile_replay_session_count_ios_sum, rum_mobile_replay_session_count_kotlinmultiplatform_sum, rum_mobile_replay_session_count_reactnative_sum, rum_replay_session_count_sum, rum_session_count_sum, rum_session_replay_add_on_sum, rum_total_session_count_sum, rum_units_sum, sca_fargate_count_avg, sca_fargate_count_hwm, sds_apm_scanned_bytes_sum, sds_events_scanned_bytes_sum, sds_logs_scanned_bytes_sum, sds_rum_scanned_bytes_sum, sds_total_scanned_bytes_sum, serverless_apps_apm_apm_azure_appservice_instances_avg, serverless_apps_apm_apm_azure_azurefunction_instances_avg, serverless_apps_apm_apm_azure_containerapp_instances_avg, serverless_apps_apm_apm_fargate_ecs_tasks_avg, serverless_apps_apm_apm_gcp_cloudfunction_instances_avg, serverless_apps_apm_apm_gcp_cloudrun_instances_avg, serverless_apps_apm_apm_gcp_gke_autopilot_pods_avg, serverless_apps_apm_avg, serverless_apps_apm_excl_fargate_apm_azure_appservice_instances_avg, serverless_apps_apm_excl_fargate_apm_azure_azurefunction_instances_avg, serverless_apps_apm_excl_fargate_apm_azure_containerapp_instances_avg, serverless_apps_apm_excl_fargate_apm_gcp_cloudfunction_instances_avg, serverless_apps_apm_excl_fargate_apm_gcp_cloudrun_instances_avg, serverless_apps_apm_excl_fargate_apm_gcp_gke_autopilot_pods_avg, serverless_apps_apm_excl_fargate_avg, serverless_apps_azure_container_app_instances_avg, serverless_apps_azure_count_avg, serverless_apps_azure_function_app_instances_avg, serverless_apps_azure_web_app_instances_avg, serverless_apps_ecs_avg, serverless_apps_eks_avg, serverless_apps_excl_fargate_avg, serverless_apps_excl_fargate_azure_container_app_instances_avg, serverless_apps_excl_fargate_azure_function_app_instances_avg, serverless_apps_excl_fargate_azure_web_app_instances_avg, serverless_apps_excl_fargate_google_cloud_functions_instances_avg, serverless_apps_excl_fargate_google_cloud_run_instances_avg, serverless_apps_excl_fargate_infra_gcp_gke_autopilot_pods_avg, serverless_apps_google_cloud_functions_instances_avg, serverless_apps_google_cloud_run_instances_avg, serverless_apps_google_count_avg, serverless_apps_infra_gcp_gke_autopilot_pods_avg, serverless_apps_total_count_avg, siem_analyzed_logs_add_on_count_sum, synthetics_browser_check_calls_count_sum, synthetics_check_calls_count_sum, synthetics_mobile_test_runs_sum, synthetics_parallel_testing_max_slots_hwm, trace_search_indexed_events_count_sum, twol_ingested_events_bytes_sum, universal_service_monitoring_host_top99p, vsphere_host_top99p, vuln_management_host_count_top99p, workflow_executions_usage_sum, additional_properties].hash + [agent_host_top99p, apm_azure_app_service_host_top99p, apm_devsecops_host_top99p, apm_enterprise_standalone_hosts_top99p, apm_fargate_count_avg, apm_host_top99p, apm_pro_standalone_hosts_top99p, appsec_fargate_count_avg, asm_serverless_sum, audit_logs_lines_indexed_sum, audit_trail_enabled_hwm, avg_profiled_fargate_tasks, aws_host_top99p, aws_lambda_func_count, aws_lambda_invocations_sum, azure_app_service_top99p, billable_ingested_bytes_sum, bits_ai_investigations_sum, browser_rum_lite_session_count_sum, browser_rum_replay_session_count_sum, browser_rum_units_sum, ccm_anthropic_spend_last, ccm_aws_spend_last, ccm_azure_spend_last, ccm_confluent_spend_last, ccm_databricks_spend_last, ccm_elastic_spend_last, ccm_fastly_spend_last, ccm_gcp_spend_last, ccm_github_spend_last, ccm_mongodb_spend_last, ccm_oci_spend_last, ccm_openai_spend_last, ccm_snowflake_spend_last, ccm_spend_monitored_ent_last, ccm_spend_monitored_pro_last, ccm_twilio_spend_last, ci_pipeline_indexed_spans_sum, ci_test_indexed_spans_sum, ci_visibility_itr_committers_hwm, ci_visibility_pipeline_committers_hwm, ci_visibility_test_committers_hwm, cloud_cost_management_aws_host_count_avg, cloud_cost_management_azure_host_count_avg, cloud_cost_management_gcp_host_count_avg, cloud_cost_management_host_count_avg, cloud_cost_management_oci_host_count_avg, cloud_siem_events_sum, cloud_siem_indexed_logs_sum, code_analysis_sa_committers_hwm, code_analysis_sca_committers_hwm, code_security_host_top99p, container_avg, container_excl_agent_avg, container_hwm, csm_container_enterprise_compliance_count_sum, csm_container_enterprise_cws_count_sum, csm_container_enterprise_total_count_sum, csm_host_enterprise_aas_host_count_top99p, csm_host_enterprise_aws_host_count_top99p, csm_host_enterprise_azure_host_count_top99p, csm_host_enterprise_compliance_host_count_top99p, csm_host_enterprise_cws_host_count_top99p, csm_host_enterprise_gcp_host_count_top99p, csm_host_enterprise_oci_host_count_top99p, csm_host_enterprise_total_host_count_top99p, csm_host_pro_hosts_agentless_scanners_sum, csm_host_pro_hosts_agentless_scanners_top99p, csm_host_pro_oci_host_count_top99p, cspm_aas_host_top99p, cspm_aws_host_top99p, cspm_azure_host_top99p, cspm_container_avg, cspm_container_hwm, cspm_gcp_host_top99p, cspm_host_top99p, cspm_hosts_agentless_scanners_sum, cspm_hosts_agentless_scanners_top99p, custom_ts_avg, cws_container_count_avg, cws_fargate_task_avg, cws_host_top99p, data_jobs_monitoring_host_hr_sum, date, dbm_host_top99p, dbm_queries_count_avg, do_jobs_monitoring_orchestrators_job_hours_sum, eph_infra_host_agent_sum, eph_infra_host_alibaba_sum, eph_infra_host_aws_sum, eph_infra_host_azure_sum, eph_infra_host_basic_infra_basic_agent_sum, eph_infra_host_basic_infra_basic_vsphere_sum, eph_infra_host_basic_sum, eph_infra_host_ent_sum, eph_infra_host_gcp_sum, eph_infra_host_heroku_sum, eph_infra_host_only_aas_sum, eph_infra_host_only_vsphere_sum, eph_infra_host_opentelemetry_apm_sum, eph_infra_host_opentelemetry_sum, eph_infra_host_pro_sum, eph_infra_host_proplus_sum, eph_infra_host_proxmox_sum, error_tracking_apm_error_events_sum, error_tracking_error_events_sum, error_tracking_events_sum, error_tracking_rum_error_events_sum, event_management_correlation_correlated_events_sum, event_management_correlation_correlated_related_events_sum, event_management_correlation_sum, fargate_container_profiler_profiling_fargate_avg, fargate_container_profiler_profiling_fargate_eks_avg, fargate_tasks_count_avg, fargate_tasks_count_hwm, feature_flags_config_requests_sum, flex_logs_compute_large_avg, flex_logs_compute_medium_avg, flex_logs_compute_small_avg, flex_logs_compute_xlarge_avg, flex_logs_compute_xsmall_avg, flex_logs_starter_avg, flex_logs_starter_storage_index_avg, flex_logs_starter_storage_retention_adjustment_avg, flex_stored_logs_avg, forwarding_events_bytes_sum, gcp_host_top99p, heroku_host_top99p, incident_management_monthly_active_users_hwm, incident_management_seats_hwm, indexed_events_count_sum, infra_edge_monitoring_devices_top99p, infra_host_basic_infra_basic_agent_top99p, infra_host_basic_infra_basic_vsphere_top99p, infra_host_basic_top99p, infra_host_top99p, infra_storage_mgmt_objects_count_avg, ingested_events_bytes_sum, iot_device_sum, iot_device_top99p, llm_observability_min_spend_sum, llm_observability_sum, mobile_rum_lite_session_count_sum, mobile_rum_session_count_android_sum, mobile_rum_session_count_flutter_sum, mobile_rum_session_count_ios_sum, mobile_rum_session_count_reactnative_sum, mobile_rum_session_count_roku_sum, mobile_rum_session_count_sum, mobile_rum_units_sum, ndm_netflow_events_sum, netflow_indexed_events_count_sum, network_device_wireless_top99p, network_path_sum, npm_host_top99p, observability_pipelines_bytes_processed_sum, oci_host_sum, oci_host_top99p, on_call_seat_hwm, online_archive_events_count_sum, opentelemetry_apm_host_top99p, opentelemetry_host_top99p, orgs, product_analytics_sum, profiling_aas_count_top99p, profiling_host_top99p, proxmox_host_sum, proxmox_host_top99p, published_app_hwm, rum_browser_and_mobile_session_count, rum_browser_legacy_session_count_sum, rum_browser_lite_session_count_sum, rum_browser_replay_session_count_sum, rum_indexed_sessions_sum, rum_ingested_sessions_sum, rum_lite_session_count_sum, rum_mobile_legacy_session_count_android_sum, rum_mobile_legacy_session_count_flutter_sum, rum_mobile_legacy_session_count_ios_sum, rum_mobile_legacy_session_count_reactnative_sum, rum_mobile_legacy_session_count_roku_sum, rum_mobile_lite_session_count_android_sum, rum_mobile_lite_session_count_flutter_sum, rum_mobile_lite_session_count_ios_sum, rum_mobile_lite_session_count_kotlinmultiplatform_sum, rum_mobile_lite_session_count_reactnative_sum, rum_mobile_lite_session_count_roku_sum, rum_mobile_lite_session_count_unity_sum, rum_mobile_replay_session_count_android_sum, rum_mobile_replay_session_count_ios_sum, rum_mobile_replay_session_count_kotlinmultiplatform_sum, rum_mobile_replay_session_count_reactnative_sum, rum_replay_session_count_sum, rum_session_count_sum, rum_session_replay_add_on_sum, rum_total_session_count_sum, rum_units_sum, sca_fargate_count_avg, sca_fargate_count_hwm, sds_apm_scanned_bytes_sum, sds_events_scanned_bytes_sum, sds_logs_scanned_bytes_sum, sds_rum_scanned_bytes_sum, sds_total_scanned_bytes_sum, serverless_apps_apm_apm_azure_appservice_instances_avg, serverless_apps_apm_apm_azure_azurefunction_instances_avg, serverless_apps_apm_apm_azure_containerapp_instances_avg, serverless_apps_apm_apm_fargate_ecs_tasks_avg, serverless_apps_apm_apm_gcp_cloudfunction_instances_avg, serverless_apps_apm_apm_gcp_cloudrun_instances_avg, serverless_apps_apm_apm_gcp_gke_autopilot_pods_avg, serverless_apps_apm_avg, serverless_apps_apm_excl_fargate_apm_azure_appservice_instances_avg, serverless_apps_apm_excl_fargate_apm_azure_azurefunction_instances_avg, serverless_apps_apm_excl_fargate_apm_azure_containerapp_instances_avg, serverless_apps_apm_excl_fargate_apm_gcp_cloudfunction_instances_avg, serverless_apps_apm_excl_fargate_apm_gcp_cloudrun_instances_avg, serverless_apps_apm_excl_fargate_apm_gcp_gke_autopilot_pods_avg, serverless_apps_apm_excl_fargate_avg, serverless_apps_azure_container_app_instances_avg, serverless_apps_azure_count_avg, serverless_apps_azure_function_app_instances_avg, serverless_apps_azure_web_app_instances_avg, serverless_apps_ecs_avg, serverless_apps_eks_avg, serverless_apps_excl_fargate_avg, serverless_apps_excl_fargate_azure_container_app_instances_avg, serverless_apps_excl_fargate_azure_function_app_instances_avg, serverless_apps_excl_fargate_azure_web_app_instances_avg, serverless_apps_excl_fargate_google_cloud_functions_instances_avg, serverless_apps_excl_fargate_google_cloud_run_instances_avg, serverless_apps_excl_fargate_infra_gcp_gke_autopilot_pods_avg, serverless_apps_google_cloud_functions_instances_avg, serverless_apps_google_cloud_run_instances_avg, serverless_apps_google_count_avg, serverless_apps_infra_gcp_gke_autopilot_pods_avg, serverless_apps_total_count_avg, siem_12mo_retention_sum, siem_6mo_retention_sum, siem_analyzed_logs_add_on_count_sum, synthetics_browser_check_calls_count_sum, synthetics_check_calls_count_sum, synthetics_mobile_test_runs_sum, synthetics_parallel_testing_max_slots_hwm, trace_search_indexed_events_count_sum, twol_ingested_events_bytes_sum, universal_service_monitoring_host_top99p, vsphere_host_top99p, vuln_management_host_count_top99p, workflow_executions_usage_sum, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v1/models/usage_summary_date_org.rb b/lib/datadog_api_client/v1/models/usage_summary_date_org.rb index 61e2cffc0fa0..d96d5286e98b 100644 --- a/lib/datadog_api_client/v1/models/usage_summary_date_org.rb +++ b/lib/datadog_api_client/v1/models/usage_summary_date_org.rb @@ -171,6 +171,9 @@ class UsageSummaryDateOrg # Shows the sum of all Cloud Security Information and Event Management events over all hours in the current date for the given org. attr_accessor :cloud_siem_events_sum + # Shows the sum of all Cloud SIEM Indexed Logs over all hours in the current date for the given org. + attr_accessor :cloud_siem_indexed_logs_sum + # Shows the high-water mark of all Static Analysis committers over all hours in the current date for the given org. attr_accessor :code_analysis_sa_committers_hwm @@ -747,6 +750,12 @@ class UsageSummaryDateOrg # Shows the average number of Serverless Apps for Azure and Google Cloud for the given date and given org. attr_accessor :serverless_apps_total_count_avg + # Shows the sum of Cloud SIEM Indexed Logs (12-month retention) over all hours in the current date for the given org. + attr_accessor :siem_12mo_retention_sum + + # Shows the sum of Cloud SIEM Indexed Logs (6-month retention) over all hours in the current date for the given org. + attr_accessor :siem_6mo_retention_sum + # Shows the sum of all log events analyzed by Cloud SIEM over all hours in the current date for the given org. attr_accessor :siem_analyzed_logs_add_on_count_sum @@ -836,6 +845,7 @@ def self.attribute_map :'cloud_cost_management_host_count_avg' => :'cloud_cost_management_host_count_avg', :'cloud_cost_management_oci_host_count_avg' => :'cloud_cost_management_oci_host_count_avg', :'cloud_siem_events_sum' => :'cloud_siem_events_sum', + :'cloud_siem_indexed_logs_sum' => :'cloud_siem_indexed_logs_sum', :'code_analysis_sa_committers_hwm' => :'code_analysis_sa_committers_hwm', :'code_analysis_sca_committers_hwm' => :'code_analysis_sca_committers_hwm', :'code_security_host_top99p' => :'code_security_host_top99p', @@ -1028,6 +1038,8 @@ def self.attribute_map :'serverless_apps_google_count_avg' => :'serverless_apps_google_count_avg', :'serverless_apps_infra_gcp_gke_autopilot_pods_avg' => :'serverless_apps_infra_gcp_gke_autopilot_pods_avg', :'serverless_apps_total_count_avg' => :'serverless_apps_total_count_avg', + :'siem_12mo_retention_sum' => :'siem_12mo_retention_sum', + :'siem_6mo_retention_sum' => :'siem_6mo_retention_sum', :'siem_analyzed_logs_add_on_count_sum' => :'siem_analyzed_logs_add_on_count_sum', :'synthetics_browser_check_calls_count_sum' => :'synthetics_browser_check_calls_count_sum', :'synthetics_check_calls_count_sum' => :'synthetics_check_calls_count_sum', @@ -1096,6 +1108,7 @@ def self.openapi_types :'cloud_cost_management_host_count_avg' => :'Integer', :'cloud_cost_management_oci_host_count_avg' => :'Integer', :'cloud_siem_events_sum' => :'Integer', + :'cloud_siem_indexed_logs_sum' => :'Integer', :'code_analysis_sa_committers_hwm' => :'Integer', :'code_analysis_sca_committers_hwm' => :'Integer', :'code_security_host_top99p' => :'Integer', @@ -1288,6 +1301,8 @@ def self.openapi_types :'serverless_apps_google_count_avg' => :'Integer', :'serverless_apps_infra_gcp_gke_autopilot_pods_avg' => :'Integer', :'serverless_apps_total_count_avg' => :'Integer', + :'siem_12mo_retention_sum' => :'Integer', + :'siem_6mo_retention_sum' => :'Integer', :'siem_analyzed_logs_add_on_count_sum' => :'Integer', :'synthetics_browser_check_calls_count_sum' => :'Integer', :'synthetics_check_calls_count_sum' => :'Integer', @@ -1520,6 +1535,10 @@ def initialize(attributes = {}) self.cloud_siem_events_sum = attributes[:'cloud_siem_events_sum'] end + if attributes.key?(:'cloud_siem_indexed_logs_sum') + self.cloud_siem_indexed_logs_sum = attributes[:'cloud_siem_indexed_logs_sum'] + end + if attributes.key?(:'code_analysis_sa_committers_hwm') self.code_analysis_sa_committers_hwm = attributes[:'code_analysis_sa_committers_hwm'] end @@ -2288,6 +2307,14 @@ def initialize(attributes = {}) self.serverless_apps_total_count_avg = attributes[:'serverless_apps_total_count_avg'] end + if attributes.key?(:'siem_12mo_retention_sum') + self.siem_12mo_retention_sum = attributes[:'siem_12mo_retention_sum'] + end + + if attributes.key?(:'siem_6mo_retention_sum') + self.siem_6mo_retention_sum = attributes[:'siem_6mo_retention_sum'] + end + if attributes.key?(:'siem_analyzed_logs_add_on_count_sum') self.siem_analyzed_logs_add_on_count_sum = attributes[:'siem_analyzed_logs_add_on_count_sum'] end @@ -2409,6 +2436,7 @@ def ==(o) cloud_cost_management_host_count_avg == o.cloud_cost_management_host_count_avg && cloud_cost_management_oci_host_count_avg == o.cloud_cost_management_oci_host_count_avg && cloud_siem_events_sum == o.cloud_siem_events_sum && + cloud_siem_indexed_logs_sum == o.cloud_siem_indexed_logs_sum && code_analysis_sa_committers_hwm == o.code_analysis_sa_committers_hwm && code_analysis_sca_committers_hwm == o.code_analysis_sca_committers_hwm && code_security_host_top99p == o.code_security_host_top99p && @@ -2601,6 +2629,8 @@ def ==(o) serverless_apps_google_count_avg == o.serverless_apps_google_count_avg && serverless_apps_infra_gcp_gke_autopilot_pods_avg == o.serverless_apps_infra_gcp_gke_autopilot_pods_avg && serverless_apps_total_count_avg == o.serverless_apps_total_count_avg && + siem_12mo_retention_sum == o.siem_12mo_retention_sum && + siem_6mo_retention_sum == o.siem_6mo_retention_sum && siem_analyzed_logs_add_on_count_sum == o.siem_analyzed_logs_add_on_count_sum && synthetics_browser_check_calls_count_sum == o.synthetics_browser_check_calls_count_sum && synthetics_check_calls_count_sum == o.synthetics_check_calls_count_sum && @@ -2619,7 +2649,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [account_name, account_public_id, agent_host_top99p, apm_azure_app_service_host_top99p, apm_devsecops_host_top99p, apm_enterprise_standalone_hosts_top99p, apm_fargate_count_avg, apm_host_top99p, apm_pro_standalone_hosts_top99p, appsec_fargate_count_avg, asm_serverless_sum, audit_logs_lines_indexed_sum, audit_trail_enabled_hwm, avg_profiled_fargate_tasks, aws_host_top99p, aws_lambda_func_count, aws_lambda_invocations_sum, azure_app_service_top99p, billable_ingested_bytes_sum, bits_ai_investigations_sum, browser_rum_lite_session_count_sum, browser_rum_replay_session_count_sum, browser_rum_units_sum, ccm_anthropic_spend_last, ccm_aws_spend_last, ccm_azure_spend_last, ccm_confluent_spend_last, ccm_databricks_spend_last, ccm_elastic_spend_last, ccm_fastly_spend_last, ccm_gcp_spend_last, ccm_github_spend_last, ccm_mongodb_spend_last, ccm_oci_spend_last, ccm_openai_spend_last, ccm_snowflake_spend_last, ccm_spend_monitored_ent_last, ccm_spend_monitored_pro_last, ccm_twilio_spend_last, ci_pipeline_indexed_spans_sum, ci_test_indexed_spans_sum, ci_visibility_itr_committers_hwm, ci_visibility_pipeline_committers_hwm, ci_visibility_test_committers_hwm, cloud_cost_management_aws_host_count_avg, cloud_cost_management_azure_host_count_avg, cloud_cost_management_gcp_host_count_avg, cloud_cost_management_host_count_avg, cloud_cost_management_oci_host_count_avg, cloud_siem_events_sum, code_analysis_sa_committers_hwm, code_analysis_sca_committers_hwm, code_security_host_top99p, container_avg, container_excl_agent_avg, container_hwm, csm_container_enterprise_compliance_count_sum, csm_container_enterprise_cws_count_sum, csm_container_enterprise_total_count_sum, csm_host_enterprise_aas_host_count_top99p, csm_host_enterprise_aws_host_count_top99p, csm_host_enterprise_azure_host_count_top99p, csm_host_enterprise_compliance_host_count_top99p, csm_host_enterprise_cws_host_count_top99p, csm_host_enterprise_gcp_host_count_top99p, csm_host_enterprise_oci_host_count_top99p, csm_host_enterprise_total_host_count_top99p, csm_host_pro_hosts_agentless_scanners_sum, csm_host_pro_hosts_agentless_scanners_top99p, csm_host_pro_oci_host_count_top99p, cspm_aas_host_top99p, cspm_aws_host_top99p, cspm_azure_host_top99p, cspm_container_avg, cspm_container_hwm, cspm_gcp_host_top99p, cspm_host_top99p, cspm_hosts_agentless_scanners_sum, cspm_hosts_agentless_scanners_top99p, custom_historical_ts_avg, custom_live_ts_avg, custom_ts_avg, cws_container_count_avg, cws_fargate_task_avg, cws_host_top99p, data_jobs_monitoring_host_hr_sum, dbm_host_top99p_sum, dbm_queries_avg_sum, do_jobs_monitoring_orchestrators_job_hours_sum, eph_infra_host_agent_sum, eph_infra_host_alibaba_sum, eph_infra_host_aws_sum, eph_infra_host_azure_sum, eph_infra_host_basic_infra_basic_agent_sum, eph_infra_host_basic_infra_basic_vsphere_sum, eph_infra_host_basic_sum, eph_infra_host_ent_sum, eph_infra_host_gcp_sum, eph_infra_host_heroku_sum, eph_infra_host_only_aas_sum, eph_infra_host_only_vsphere_sum, eph_infra_host_opentelemetry_apm_sum, eph_infra_host_opentelemetry_sum, eph_infra_host_pro_sum, eph_infra_host_proplus_sum, eph_infra_host_proxmox_sum, error_tracking_apm_error_events_sum, error_tracking_error_events_sum, error_tracking_events_sum, error_tracking_rum_error_events_sum, event_management_correlation_correlated_events_sum, event_management_correlation_correlated_related_events_sum, event_management_correlation_sum, fargate_container_profiler_profiling_fargate_avg, fargate_container_profiler_profiling_fargate_eks_avg, fargate_tasks_count_avg, fargate_tasks_count_hwm, feature_flags_config_requests_sum, flex_logs_compute_large_avg, flex_logs_compute_medium_avg, flex_logs_compute_small_avg, flex_logs_compute_xlarge_avg, flex_logs_compute_xsmall_avg, flex_logs_starter_avg, flex_logs_starter_storage_index_avg, flex_logs_starter_storage_retention_adjustment_avg, flex_stored_logs_avg, forwarding_events_bytes_sum, gcp_host_top99p, heroku_host_top99p, id, incident_management_monthly_active_users_hwm, incident_management_seats_hwm, indexed_events_count_sum, infra_edge_monitoring_devices_top99p, infra_host_basic_infra_basic_agent_top99p, infra_host_basic_infra_basic_vsphere_top99p, infra_host_basic_top99p, infra_host_top99p, infra_storage_mgmt_objects_count_avg, ingested_events_bytes_sum, iot_device_agg_sum, iot_device_top99p_sum, llm_observability_min_spend_sum, llm_observability_sum, mobile_rum_lite_session_count_sum, mobile_rum_session_count_android_sum, mobile_rum_session_count_flutter_sum, mobile_rum_session_count_ios_sum, mobile_rum_session_count_reactnative_sum, mobile_rum_session_count_roku_sum, mobile_rum_session_count_sum, mobile_rum_units_sum, name, ndm_netflow_events_sum, netflow_indexed_events_count_sum, network_device_wireless_top99p, network_path_sum, npm_host_top99p, observability_pipelines_bytes_processed_sum, oci_host_sum, oci_host_top99p, on_call_seat_hwm, online_archive_events_count_sum, opentelemetry_apm_host_top99p, opentelemetry_host_top99p, product_analytics_sum, profiling_aas_count_top99p, profiling_host_top99p, proxmox_host_sum, proxmox_host_top99p, public_id, published_app_hwm, region, rum_browser_and_mobile_session_count, rum_browser_legacy_session_count_sum, rum_browser_lite_session_count_sum, rum_browser_replay_session_count_sum, rum_indexed_sessions_sum, rum_ingested_sessions_sum, rum_lite_session_count_sum, rum_mobile_legacy_session_count_android_sum, rum_mobile_legacy_session_count_flutter_sum, rum_mobile_legacy_session_count_ios_sum, rum_mobile_legacy_session_count_reactnative_sum, rum_mobile_legacy_session_count_roku_sum, rum_mobile_lite_session_count_android_sum, rum_mobile_lite_session_count_flutter_sum, rum_mobile_lite_session_count_ios_sum, rum_mobile_lite_session_count_kotlinmultiplatform_sum, rum_mobile_lite_session_count_reactnative_sum, rum_mobile_lite_session_count_roku_sum, rum_mobile_lite_session_count_unity_sum, rum_mobile_replay_session_count_android_sum, rum_mobile_replay_session_count_ios_sum, rum_mobile_replay_session_count_kotlinmultiplatform_sum, rum_mobile_replay_session_count_reactnative_sum, rum_replay_session_count_sum, rum_session_count_sum, rum_session_replay_add_on_sum, rum_total_session_count_sum, rum_units_sum, sca_fargate_count_avg, sca_fargate_count_hwm, sds_apm_scanned_bytes_sum, sds_events_scanned_bytes_sum, sds_logs_scanned_bytes_sum, sds_rum_scanned_bytes_sum, sds_total_scanned_bytes_sum, serverless_apps_apm_apm_azure_appservice_instances_avg, serverless_apps_apm_apm_azure_azurefunction_instances_avg, serverless_apps_apm_apm_azure_containerapp_instances_avg, serverless_apps_apm_apm_fargate_ecs_tasks_avg, serverless_apps_apm_apm_gcp_cloudfunction_instances_avg, serverless_apps_apm_apm_gcp_cloudrun_instances_avg, serverless_apps_apm_apm_gcp_gke_autopilot_pods_avg, serverless_apps_apm_avg, serverless_apps_apm_excl_fargate_apm_azure_appservice_instances_avg, serverless_apps_apm_excl_fargate_apm_azure_azurefunction_instances_avg, serverless_apps_apm_excl_fargate_apm_azure_containerapp_instances_avg, serverless_apps_apm_excl_fargate_apm_gcp_cloudfunction_instances_avg, serverless_apps_apm_excl_fargate_apm_gcp_cloudrun_instances_avg, serverless_apps_apm_excl_fargate_apm_gcp_gke_autopilot_pods_avg, serverless_apps_apm_excl_fargate_avg, serverless_apps_azure_container_app_instances_avg, serverless_apps_azure_count_avg, serverless_apps_azure_function_app_instances_avg, serverless_apps_azure_web_app_instances_avg, serverless_apps_ecs_avg, serverless_apps_eks_avg, serverless_apps_excl_fargate_avg, serverless_apps_excl_fargate_azure_container_app_instances_avg, serverless_apps_excl_fargate_azure_function_app_instances_avg, serverless_apps_excl_fargate_azure_web_app_instances_avg, serverless_apps_excl_fargate_google_cloud_functions_instances_avg, serverless_apps_excl_fargate_google_cloud_run_instances_avg, serverless_apps_excl_fargate_infra_gcp_gke_autopilot_pods_avg, serverless_apps_google_cloud_functions_instances_avg, serverless_apps_google_cloud_run_instances_avg, serverless_apps_google_count_avg, serverless_apps_infra_gcp_gke_autopilot_pods_avg, serverless_apps_total_count_avg, siem_analyzed_logs_add_on_count_sum, synthetics_browser_check_calls_count_sum, synthetics_check_calls_count_sum, synthetics_mobile_test_runs_sum, synthetics_parallel_testing_max_slots_hwm, trace_search_indexed_events_count_sum, twol_ingested_events_bytes_sum, universal_service_monitoring_host_top99p, vsphere_host_top99p, vuln_management_host_count_top99p, workflow_executions_usage_sum, additional_properties].hash + [account_name, account_public_id, agent_host_top99p, apm_azure_app_service_host_top99p, apm_devsecops_host_top99p, apm_enterprise_standalone_hosts_top99p, apm_fargate_count_avg, apm_host_top99p, apm_pro_standalone_hosts_top99p, appsec_fargate_count_avg, asm_serverless_sum, audit_logs_lines_indexed_sum, audit_trail_enabled_hwm, avg_profiled_fargate_tasks, aws_host_top99p, aws_lambda_func_count, aws_lambda_invocations_sum, azure_app_service_top99p, billable_ingested_bytes_sum, bits_ai_investigations_sum, browser_rum_lite_session_count_sum, browser_rum_replay_session_count_sum, browser_rum_units_sum, ccm_anthropic_spend_last, ccm_aws_spend_last, ccm_azure_spend_last, ccm_confluent_spend_last, ccm_databricks_spend_last, ccm_elastic_spend_last, ccm_fastly_spend_last, ccm_gcp_spend_last, ccm_github_spend_last, ccm_mongodb_spend_last, ccm_oci_spend_last, ccm_openai_spend_last, ccm_snowflake_spend_last, ccm_spend_monitored_ent_last, ccm_spend_monitored_pro_last, ccm_twilio_spend_last, ci_pipeline_indexed_spans_sum, ci_test_indexed_spans_sum, ci_visibility_itr_committers_hwm, ci_visibility_pipeline_committers_hwm, ci_visibility_test_committers_hwm, cloud_cost_management_aws_host_count_avg, cloud_cost_management_azure_host_count_avg, cloud_cost_management_gcp_host_count_avg, cloud_cost_management_host_count_avg, cloud_cost_management_oci_host_count_avg, cloud_siem_events_sum, cloud_siem_indexed_logs_sum, code_analysis_sa_committers_hwm, code_analysis_sca_committers_hwm, code_security_host_top99p, container_avg, container_excl_agent_avg, container_hwm, csm_container_enterprise_compliance_count_sum, csm_container_enterprise_cws_count_sum, csm_container_enterprise_total_count_sum, csm_host_enterprise_aas_host_count_top99p, csm_host_enterprise_aws_host_count_top99p, csm_host_enterprise_azure_host_count_top99p, csm_host_enterprise_compliance_host_count_top99p, csm_host_enterprise_cws_host_count_top99p, csm_host_enterprise_gcp_host_count_top99p, csm_host_enterprise_oci_host_count_top99p, csm_host_enterprise_total_host_count_top99p, csm_host_pro_hosts_agentless_scanners_sum, csm_host_pro_hosts_agentless_scanners_top99p, csm_host_pro_oci_host_count_top99p, cspm_aas_host_top99p, cspm_aws_host_top99p, cspm_azure_host_top99p, cspm_container_avg, cspm_container_hwm, cspm_gcp_host_top99p, cspm_host_top99p, cspm_hosts_agentless_scanners_sum, cspm_hosts_agentless_scanners_top99p, custom_historical_ts_avg, custom_live_ts_avg, custom_ts_avg, cws_container_count_avg, cws_fargate_task_avg, cws_host_top99p, data_jobs_monitoring_host_hr_sum, dbm_host_top99p_sum, dbm_queries_avg_sum, do_jobs_monitoring_orchestrators_job_hours_sum, eph_infra_host_agent_sum, eph_infra_host_alibaba_sum, eph_infra_host_aws_sum, eph_infra_host_azure_sum, eph_infra_host_basic_infra_basic_agent_sum, eph_infra_host_basic_infra_basic_vsphere_sum, eph_infra_host_basic_sum, eph_infra_host_ent_sum, eph_infra_host_gcp_sum, eph_infra_host_heroku_sum, eph_infra_host_only_aas_sum, eph_infra_host_only_vsphere_sum, eph_infra_host_opentelemetry_apm_sum, eph_infra_host_opentelemetry_sum, eph_infra_host_pro_sum, eph_infra_host_proplus_sum, eph_infra_host_proxmox_sum, error_tracking_apm_error_events_sum, error_tracking_error_events_sum, error_tracking_events_sum, error_tracking_rum_error_events_sum, event_management_correlation_correlated_events_sum, event_management_correlation_correlated_related_events_sum, event_management_correlation_sum, fargate_container_profiler_profiling_fargate_avg, fargate_container_profiler_profiling_fargate_eks_avg, fargate_tasks_count_avg, fargate_tasks_count_hwm, feature_flags_config_requests_sum, flex_logs_compute_large_avg, flex_logs_compute_medium_avg, flex_logs_compute_small_avg, flex_logs_compute_xlarge_avg, flex_logs_compute_xsmall_avg, flex_logs_starter_avg, flex_logs_starter_storage_index_avg, flex_logs_starter_storage_retention_adjustment_avg, flex_stored_logs_avg, forwarding_events_bytes_sum, gcp_host_top99p, heroku_host_top99p, id, incident_management_monthly_active_users_hwm, incident_management_seats_hwm, indexed_events_count_sum, infra_edge_monitoring_devices_top99p, infra_host_basic_infra_basic_agent_top99p, infra_host_basic_infra_basic_vsphere_top99p, infra_host_basic_top99p, infra_host_top99p, infra_storage_mgmt_objects_count_avg, ingested_events_bytes_sum, iot_device_agg_sum, iot_device_top99p_sum, llm_observability_min_spend_sum, llm_observability_sum, mobile_rum_lite_session_count_sum, mobile_rum_session_count_android_sum, mobile_rum_session_count_flutter_sum, mobile_rum_session_count_ios_sum, mobile_rum_session_count_reactnative_sum, mobile_rum_session_count_roku_sum, mobile_rum_session_count_sum, mobile_rum_units_sum, name, ndm_netflow_events_sum, netflow_indexed_events_count_sum, network_device_wireless_top99p, network_path_sum, npm_host_top99p, observability_pipelines_bytes_processed_sum, oci_host_sum, oci_host_top99p, on_call_seat_hwm, online_archive_events_count_sum, opentelemetry_apm_host_top99p, opentelemetry_host_top99p, product_analytics_sum, profiling_aas_count_top99p, profiling_host_top99p, proxmox_host_sum, proxmox_host_top99p, public_id, published_app_hwm, region, rum_browser_and_mobile_session_count, rum_browser_legacy_session_count_sum, rum_browser_lite_session_count_sum, rum_browser_replay_session_count_sum, rum_indexed_sessions_sum, rum_ingested_sessions_sum, rum_lite_session_count_sum, rum_mobile_legacy_session_count_android_sum, rum_mobile_legacy_session_count_flutter_sum, rum_mobile_legacy_session_count_ios_sum, rum_mobile_legacy_session_count_reactnative_sum, rum_mobile_legacy_session_count_roku_sum, rum_mobile_lite_session_count_android_sum, rum_mobile_lite_session_count_flutter_sum, rum_mobile_lite_session_count_ios_sum, rum_mobile_lite_session_count_kotlinmultiplatform_sum, rum_mobile_lite_session_count_reactnative_sum, rum_mobile_lite_session_count_roku_sum, rum_mobile_lite_session_count_unity_sum, rum_mobile_replay_session_count_android_sum, rum_mobile_replay_session_count_ios_sum, rum_mobile_replay_session_count_kotlinmultiplatform_sum, rum_mobile_replay_session_count_reactnative_sum, rum_replay_session_count_sum, rum_session_count_sum, rum_session_replay_add_on_sum, rum_total_session_count_sum, rum_units_sum, sca_fargate_count_avg, sca_fargate_count_hwm, sds_apm_scanned_bytes_sum, sds_events_scanned_bytes_sum, sds_logs_scanned_bytes_sum, sds_rum_scanned_bytes_sum, sds_total_scanned_bytes_sum, serverless_apps_apm_apm_azure_appservice_instances_avg, serverless_apps_apm_apm_azure_azurefunction_instances_avg, serverless_apps_apm_apm_azure_containerapp_instances_avg, serverless_apps_apm_apm_fargate_ecs_tasks_avg, serverless_apps_apm_apm_gcp_cloudfunction_instances_avg, serverless_apps_apm_apm_gcp_cloudrun_instances_avg, serverless_apps_apm_apm_gcp_gke_autopilot_pods_avg, serverless_apps_apm_avg, serverless_apps_apm_excl_fargate_apm_azure_appservice_instances_avg, serverless_apps_apm_excl_fargate_apm_azure_azurefunction_instances_avg, serverless_apps_apm_excl_fargate_apm_azure_containerapp_instances_avg, serverless_apps_apm_excl_fargate_apm_gcp_cloudfunction_instances_avg, serverless_apps_apm_excl_fargate_apm_gcp_cloudrun_instances_avg, serverless_apps_apm_excl_fargate_apm_gcp_gke_autopilot_pods_avg, serverless_apps_apm_excl_fargate_avg, serverless_apps_azure_container_app_instances_avg, serverless_apps_azure_count_avg, serverless_apps_azure_function_app_instances_avg, serverless_apps_azure_web_app_instances_avg, serverless_apps_ecs_avg, serverless_apps_eks_avg, serverless_apps_excl_fargate_avg, serverless_apps_excl_fargate_azure_container_app_instances_avg, serverless_apps_excl_fargate_azure_function_app_instances_avg, serverless_apps_excl_fargate_azure_web_app_instances_avg, serverless_apps_excl_fargate_google_cloud_functions_instances_avg, serverless_apps_excl_fargate_google_cloud_run_instances_avg, serverless_apps_excl_fargate_infra_gcp_gke_autopilot_pods_avg, serverless_apps_google_cloud_functions_instances_avg, serverless_apps_google_cloud_run_instances_avg, serverless_apps_google_count_avg, serverless_apps_infra_gcp_gke_autopilot_pods_avg, serverless_apps_total_count_avg, siem_12mo_retention_sum, siem_6mo_retention_sum, siem_analyzed_logs_add_on_count_sum, synthetics_browser_check_calls_count_sum, synthetics_check_calls_count_sum, synthetics_mobile_test_runs_sum, synthetics_parallel_testing_max_slots_hwm, trace_search_indexed_events_count_sum, twol_ingested_events_bytes_sum, universal_service_monitoring_host_top99p, vsphere_host_top99p, vuln_management_host_count_top99p, workflow_executions_usage_sum, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v1/models/usage_summary_response.rb b/lib/datadog_api_client/v1/models/usage_summary_response.rb index cdafee3578d6..6dfc4551755e 100644 --- a/lib/datadog_api_client/v1/models/usage_summary_response.rb +++ b/lib/datadog_api_client/v1/models/usage_summary_response.rb @@ -168,6 +168,9 @@ class UsageSummaryResponse # Shows the sum of all Cloud Security Information and Event Management events over all hours in the current month for all organizations. attr_accessor :cloud_siem_events_agg_sum + # Shows the sum of all Cloud SIEM Indexed Logs over all hours in the current month for all organizations. + attr_accessor :cloud_siem_indexed_logs_agg_sum + # Shows the high-water mark of all Static Analysis committers over all hours in the current month for all organizations. attr_accessor :code_analysis_sa_committers_hwm_sum @@ -756,6 +759,12 @@ class UsageSummaryResponse # Sum of the average number of Serverless Apps for Azure and Google Cloud in the current month for all organizations. attr_accessor :serverless_apps_total_count_avg_sum + # Shows the sum of Cloud SIEM Indexed Logs (12-month retention) over all hours in the current month for all organizations. + attr_accessor :siem_12mo_retention_agg_sum + + # Shows the sum of Cloud SIEM Indexed Logs (6-month retention) over all hours in the current month for all organizations. + attr_accessor :siem_6mo_retention_agg_sum + # Shows the sum of all log events analyzed by Cloud SIEM over all hours in the current month for all organizations. attr_accessor :siem_analyzed_logs_add_on_count_agg_sum @@ -850,6 +859,7 @@ def self.attribute_map :'cloud_cost_management_host_count_avg_sum' => :'cloud_cost_management_host_count_avg_sum', :'cloud_cost_management_oci_host_count_avg_sum' => :'cloud_cost_management_oci_host_count_avg_sum', :'cloud_siem_events_agg_sum' => :'cloud_siem_events_agg_sum', + :'cloud_siem_indexed_logs_agg_sum' => :'cloud_siem_indexed_logs_agg_sum', :'code_analysis_sa_committers_hwm_sum' => :'code_analysis_sa_committers_hwm_sum', :'code_analysis_sca_committers_hwm_sum' => :'code_analysis_sca_committers_hwm_sum', :'code_security_host_top99p_sum' => :'code_security_host_top99p_sum', @@ -1046,6 +1056,8 @@ def self.attribute_map :'serverless_apps_google_count_avg_sum' => :'serverless_apps_google_count_avg_sum', :'serverless_apps_infra_gcp_gke_autopilot_pods_avg_sum' => :'serverless_apps_infra_gcp_gke_autopilot_pods_avg_sum', :'serverless_apps_total_count_avg_sum' => :'serverless_apps_total_count_avg_sum', + :'siem_12mo_retention_agg_sum' => :'siem_12mo_retention_agg_sum', + :'siem_6mo_retention_agg_sum' => :'siem_6mo_retention_agg_sum', :'siem_analyzed_logs_add_on_count_agg_sum' => :'siem_analyzed_logs_add_on_count_agg_sum', :'start_date' => :'start_date', :'synthetics_browser_check_calls_count_agg_sum' => :'synthetics_browser_check_calls_count_agg_sum', @@ -1115,6 +1127,7 @@ def self.openapi_types :'cloud_cost_management_host_count_avg_sum' => :'Integer', :'cloud_cost_management_oci_host_count_avg_sum' => :'Integer', :'cloud_siem_events_agg_sum' => :'Integer', + :'cloud_siem_indexed_logs_agg_sum' => :'Integer', :'code_analysis_sa_committers_hwm_sum' => :'Integer', :'code_analysis_sca_committers_hwm_sum' => :'Integer', :'code_security_host_top99p_sum' => :'Integer', @@ -1311,6 +1324,8 @@ def self.openapi_types :'serverless_apps_google_count_avg_sum' => :'Integer', :'serverless_apps_infra_gcp_gke_autopilot_pods_avg_sum' => :'Integer', :'serverless_apps_total_count_avg_sum' => :'Integer', + :'siem_12mo_retention_agg_sum' => :'Integer', + :'siem_6mo_retention_agg_sum' => :'Integer', :'siem_analyzed_logs_add_on_count_agg_sum' => :'Integer', :'start_date' => :'Time', :'synthetics_browser_check_calls_count_agg_sum' => :'Integer', @@ -1541,6 +1556,10 @@ def initialize(attributes = {}) self.cloud_siem_events_agg_sum = attributes[:'cloud_siem_events_agg_sum'] end + if attributes.key?(:'cloud_siem_indexed_logs_agg_sum') + self.cloud_siem_indexed_logs_agg_sum = attributes[:'cloud_siem_indexed_logs_agg_sum'] + end + if attributes.key?(:'code_analysis_sa_committers_hwm_sum') self.code_analysis_sa_committers_hwm_sum = attributes[:'code_analysis_sa_committers_hwm_sum'] end @@ -2325,6 +2344,14 @@ def initialize(attributes = {}) self.serverless_apps_total_count_avg_sum = attributes[:'serverless_apps_total_count_avg_sum'] end + if attributes.key?(:'siem_12mo_retention_agg_sum') + self.siem_12mo_retention_agg_sum = attributes[:'siem_12mo_retention_agg_sum'] + end + + if attributes.key?(:'siem_6mo_retention_agg_sum') + self.siem_6mo_retention_agg_sum = attributes[:'siem_6mo_retention_agg_sum'] + end + if attributes.key?(:'siem_analyzed_logs_add_on_count_agg_sum') self.siem_analyzed_logs_add_on_count_agg_sum = attributes[:'siem_analyzed_logs_add_on_count_agg_sum'] end @@ -2455,6 +2482,7 @@ def ==(o) cloud_cost_management_host_count_avg_sum == o.cloud_cost_management_host_count_avg_sum && cloud_cost_management_oci_host_count_avg_sum == o.cloud_cost_management_oci_host_count_avg_sum && cloud_siem_events_agg_sum == o.cloud_siem_events_agg_sum && + cloud_siem_indexed_logs_agg_sum == o.cloud_siem_indexed_logs_agg_sum && code_analysis_sa_committers_hwm_sum == o.code_analysis_sa_committers_hwm_sum && code_analysis_sca_committers_hwm_sum == o.code_analysis_sca_committers_hwm_sum && code_security_host_top99p_sum == o.code_security_host_top99p_sum && @@ -2651,6 +2679,8 @@ def ==(o) serverless_apps_google_count_avg_sum == o.serverless_apps_google_count_avg_sum && serverless_apps_infra_gcp_gke_autopilot_pods_avg_sum == o.serverless_apps_infra_gcp_gke_autopilot_pods_avg_sum && serverless_apps_total_count_avg_sum == o.serverless_apps_total_count_avg_sum && + siem_12mo_retention_agg_sum == o.siem_12mo_retention_agg_sum && + siem_6mo_retention_agg_sum == o.siem_6mo_retention_agg_sum && siem_analyzed_logs_add_on_count_agg_sum == o.siem_analyzed_logs_add_on_count_agg_sum && start_date == o.start_date && synthetics_browser_check_calls_count_agg_sum == o.synthetics_browser_check_calls_count_agg_sum && @@ -2671,7 +2701,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [agent_host_top99p_sum, apm_azure_app_service_host_top99p_sum, apm_devsecops_host_top99p_sum, apm_enterprise_standalone_hosts_top99p_sum, apm_fargate_count_avg_sum, apm_host_top99p_sum, apm_pro_standalone_hosts_top99p_sum, appsec_fargate_count_avg_sum, asm_serverless_agg_sum, audit_logs_lines_indexed_agg_sum, audit_trail_enabled_hwm_sum, avg_profiled_fargate_tasks_sum, aws_host_top99p_sum, aws_lambda_func_count, aws_lambda_invocations_sum, azure_app_service_top99p_sum, azure_host_top99p_sum, billable_ingested_bytes_agg_sum, bits_ai_investigations_agg_sum, browser_rum_lite_session_count_agg_sum, browser_rum_replay_session_count_agg_sum, browser_rum_units_agg_sum, ccm_anthropic_spend_last_sum, ccm_aws_spend_last_sum, ccm_azure_spend_last_sum, ccm_confluent_spend_last_sum, ccm_databricks_spend_last_sum, ccm_elastic_spend_last_sum, ccm_fastly_spend_last_sum, ccm_gcp_spend_last_sum, ccm_github_spend_last_sum, ccm_mongodb_spend_last_sum, ccm_oci_spend_last_sum, ccm_openai_spend_last_sum, ccm_snowflake_spend_last_sum, ccm_spend_monitored_ent_last_sum, ccm_spend_monitored_pro_last_sum, ccm_twilio_spend_last_sum, ci_pipeline_indexed_spans_agg_sum, ci_test_indexed_spans_agg_sum, ci_visibility_itr_committers_hwm_sum, ci_visibility_pipeline_committers_hwm_sum, ci_visibility_test_committers_hwm_sum, cloud_cost_management_aws_host_count_avg_sum, cloud_cost_management_azure_host_count_avg_sum, cloud_cost_management_gcp_host_count_avg_sum, cloud_cost_management_host_count_avg_sum, cloud_cost_management_oci_host_count_avg_sum, cloud_siem_events_agg_sum, code_analysis_sa_committers_hwm_sum, code_analysis_sca_committers_hwm_sum, code_security_host_top99p_sum, container_avg_sum, container_excl_agent_avg_sum, container_hwm_sum, csm_container_enterprise_compliance_count_agg_sum, csm_container_enterprise_cws_count_agg_sum, csm_container_enterprise_total_count_agg_sum, csm_host_enterprise_aas_host_count_top99p_sum, csm_host_enterprise_aws_host_count_top99p_sum, csm_host_enterprise_azure_host_count_top99p_sum, csm_host_enterprise_compliance_host_count_top99p_sum, csm_host_enterprise_cws_host_count_top99p_sum, csm_host_enterprise_gcp_host_count_top99p_sum, csm_host_enterprise_oci_host_count_top99p_sum, csm_host_enterprise_total_host_count_top99p_sum, csm_host_pro_hosts_agentless_scanners_agg_sum, csm_host_pro_hosts_agentless_scanners_top99p_sum, csm_host_pro_oci_host_count_top99p_sum, cspm_aas_host_top99p_sum, cspm_aws_host_top99p_sum, cspm_azure_host_top99p_sum, cspm_container_avg_sum, cspm_container_hwm_sum, cspm_gcp_host_top99p_sum, cspm_host_top99p_sum, cspm_hosts_agentless_scanners_agg_sum, cspm_hosts_agentless_scanners_top99p_sum, custom_historical_ts_sum, custom_live_ts_sum, custom_ts_sum, cws_container_avg_sum, cws_fargate_task_avg_sum, cws_host_top99p_sum, data_jobs_monitoring_host_hr_agg_sum, dbm_host_top99p_sum, dbm_queries_avg_sum, do_jobs_monitoring_orchestrators_job_hours_agg_sum, end_date, eph_infra_host_agent_agg_sum, eph_infra_host_alibaba_agg_sum, eph_infra_host_aws_agg_sum, eph_infra_host_azure_agg_sum, eph_infra_host_basic_agg_sum, eph_infra_host_basic_infra_basic_agent_agg_sum, eph_infra_host_basic_infra_basic_vsphere_agg_sum, eph_infra_host_ent_agg_sum, eph_infra_host_gcp_agg_sum, eph_infra_host_heroku_agg_sum, eph_infra_host_only_aas_agg_sum, eph_infra_host_only_vsphere_agg_sum, eph_infra_host_opentelemetry_agg_sum, eph_infra_host_opentelemetry_apm_agg_sum, eph_infra_host_pro_agg_sum, eph_infra_host_proplus_agg_sum, eph_infra_host_proxmox_agg_sum, error_tracking_apm_error_events_agg_sum, error_tracking_error_events_agg_sum, error_tracking_events_agg_sum, error_tracking_rum_error_events_agg_sum, event_management_correlation_agg_sum, event_management_correlation_correlated_events_agg_sum, event_management_correlation_correlated_related_events_agg_sum, fargate_container_profiler_profiling_fargate_avg_sum, fargate_container_profiler_profiling_fargate_eks_avg_sum, fargate_tasks_count_avg_sum, fargate_tasks_count_hwm_sum, feature_flags_config_requests_agg_sum, flex_logs_compute_large_avg_sum, flex_logs_compute_medium_avg_sum, flex_logs_compute_small_avg_sum, flex_logs_compute_xlarge_avg_sum, flex_logs_compute_xsmall_avg_sum, flex_logs_starter_avg_sum, flex_logs_starter_storage_index_avg_sum, flex_logs_starter_storage_retention_adjustment_avg_sum, flex_stored_logs_avg_sum, forwarding_events_bytes_agg_sum, gcp_host_top99p_sum, heroku_host_top99p_sum, incident_management_monthly_active_users_hwm_sum, incident_management_seats_hwm_sum, indexed_events_count_agg_sum, infra_edge_monitoring_devices_top99p_sum, infra_host_basic_infra_basic_agent_top99p_sum, infra_host_basic_infra_basic_vsphere_top99p_sum, infra_host_basic_top99p_sum, infra_host_top99p_sum, infra_storage_mgmt_objects_count_avg_sum, ingested_events_bytes_agg_sum, iot_device_agg_sum, iot_device_top99p_sum, last_updated, live_indexed_events_agg_sum, live_ingested_bytes_agg_sum, llm_observability_agg_sum, llm_observability_min_spend_agg_sum, logs_by_retention, mobile_rum_lite_session_count_agg_sum, mobile_rum_session_count_agg_sum, mobile_rum_session_count_android_agg_sum, mobile_rum_session_count_flutter_agg_sum, mobile_rum_session_count_ios_agg_sum, mobile_rum_session_count_reactnative_agg_sum, mobile_rum_session_count_roku_agg_sum, mobile_rum_units_agg_sum, ndm_netflow_events_agg_sum, netflow_indexed_events_count_agg_sum, network_device_wireless_top99p_sum, network_path_agg_sum, npm_host_top99p_sum, observability_pipelines_bytes_processed_agg_sum, oci_host_agg_sum, oci_host_top99p_sum, on_call_seat_hwm_sum, online_archive_events_count_agg_sum, opentelemetry_apm_host_top99p_sum, opentelemetry_host_top99p_sum, product_analytics_agg_sum, profiling_aas_count_top99p_sum, profiling_container_agent_count_avg, profiling_host_count_top99p_sum, proxmox_host_agg_sum, proxmox_host_top99p_sum, published_app_hwm_sum, rehydrated_indexed_events_agg_sum, rehydrated_ingested_bytes_agg_sum, rum_browser_and_mobile_session_count, rum_browser_legacy_session_count_agg_sum, rum_browser_lite_session_count_agg_sum, rum_browser_replay_session_count_agg_sum, rum_indexed_sessions_agg_sum, rum_ingested_sessions_agg_sum, rum_lite_session_count_agg_sum, rum_mobile_legacy_session_count_android_agg_sum, rum_mobile_legacy_session_count_flutter_agg_sum, rum_mobile_legacy_session_count_ios_agg_sum, rum_mobile_legacy_session_count_reactnative_agg_sum, rum_mobile_legacy_session_count_roku_agg_sum, rum_mobile_lite_session_count_android_agg_sum, rum_mobile_lite_session_count_flutter_agg_sum, rum_mobile_lite_session_count_ios_agg_sum, rum_mobile_lite_session_count_kotlinmultiplatform_agg_sum, rum_mobile_lite_session_count_reactnative_agg_sum, rum_mobile_lite_session_count_roku_agg_sum, rum_mobile_lite_session_count_unity_agg_sum, rum_mobile_replay_session_count_android_agg_sum, rum_mobile_replay_session_count_ios_agg_sum, rum_mobile_replay_session_count_kotlinmultiplatform_agg_sum, rum_mobile_replay_session_count_reactnative_agg_sum, rum_replay_session_count_agg_sum, rum_session_count_agg_sum, rum_session_replay_add_on_agg_sum, rum_total_session_count_agg_sum, rum_units_agg_sum, sca_fargate_count_avg_sum, sca_fargate_count_hwm_sum, sds_apm_scanned_bytes_sum, sds_events_scanned_bytes_sum, sds_logs_scanned_bytes_sum, sds_rum_scanned_bytes_sum, sds_total_scanned_bytes_sum, serverless_apps_apm_apm_azure_appservice_instances_avg_sum, serverless_apps_apm_apm_azure_azurefunction_instances_avg_sum, serverless_apps_apm_apm_azure_containerapp_instances_avg_sum, serverless_apps_apm_apm_fargate_ecs_tasks_avg_sum, serverless_apps_apm_apm_gcp_cloudfunction_instances_avg_sum, serverless_apps_apm_apm_gcp_cloudrun_instances_avg_sum, serverless_apps_apm_apm_gcp_gke_autopilot_pods_avg_sum, serverless_apps_apm_avg_sum, serverless_apps_apm_excl_fargate_apm_azure_appservice_instances_avg_sum, serverless_apps_apm_excl_fargate_apm_azure_azurefunction_instances_avg_sum, serverless_apps_apm_excl_fargate_apm_azure_containerapp_instances_avg_sum, serverless_apps_apm_excl_fargate_apm_gcp_cloudfunction_instances_avg_sum, serverless_apps_apm_excl_fargate_apm_gcp_cloudrun_instances_avg_sum, serverless_apps_apm_excl_fargate_apm_gcp_gke_autopilot_pods_avg_sum, serverless_apps_apm_excl_fargate_avg_sum, serverless_apps_azure_container_app_instances_avg_sum, serverless_apps_azure_count_avg_sum, serverless_apps_azure_function_app_instances_avg_sum, serverless_apps_azure_web_app_instances_avg_sum, serverless_apps_ecs_avg_sum, serverless_apps_eks_avg_sum, serverless_apps_excl_fargate_avg_sum, serverless_apps_excl_fargate_azure_container_app_instances_avg_sum, serverless_apps_excl_fargate_azure_function_app_instances_avg_sum, serverless_apps_excl_fargate_azure_web_app_instances_avg_sum, serverless_apps_excl_fargate_google_cloud_functions_instances_avg_sum, serverless_apps_excl_fargate_google_cloud_run_instances_avg_sum, serverless_apps_excl_fargate_infra_gcp_gke_autopilot_pods_avg_sum, serverless_apps_google_cloud_functions_instances_avg_sum, serverless_apps_google_cloud_run_instances_avg_sum, serverless_apps_google_count_avg_sum, serverless_apps_infra_gcp_gke_autopilot_pods_avg_sum, serverless_apps_total_count_avg_sum, siem_analyzed_logs_add_on_count_agg_sum, start_date, synthetics_browser_check_calls_count_agg_sum, synthetics_check_calls_count_agg_sum, synthetics_mobile_test_runs_agg_sum, synthetics_parallel_testing_max_slots_hwm_sum, trace_search_indexed_events_count_agg_sum, twol_ingested_events_bytes_agg_sum, universal_service_monitoring_host_top99p_sum, usage, vsphere_host_top99p_sum, vuln_management_host_count_top99p_sum, workflow_executions_usage_agg_sum, additional_properties].hash + [agent_host_top99p_sum, apm_azure_app_service_host_top99p_sum, apm_devsecops_host_top99p_sum, apm_enterprise_standalone_hosts_top99p_sum, apm_fargate_count_avg_sum, apm_host_top99p_sum, apm_pro_standalone_hosts_top99p_sum, appsec_fargate_count_avg_sum, asm_serverless_agg_sum, audit_logs_lines_indexed_agg_sum, audit_trail_enabled_hwm_sum, avg_profiled_fargate_tasks_sum, aws_host_top99p_sum, aws_lambda_func_count, aws_lambda_invocations_sum, azure_app_service_top99p_sum, azure_host_top99p_sum, billable_ingested_bytes_agg_sum, bits_ai_investigations_agg_sum, browser_rum_lite_session_count_agg_sum, browser_rum_replay_session_count_agg_sum, browser_rum_units_agg_sum, ccm_anthropic_spend_last_sum, ccm_aws_spend_last_sum, ccm_azure_spend_last_sum, ccm_confluent_spend_last_sum, ccm_databricks_spend_last_sum, ccm_elastic_spend_last_sum, ccm_fastly_spend_last_sum, ccm_gcp_spend_last_sum, ccm_github_spend_last_sum, ccm_mongodb_spend_last_sum, ccm_oci_spend_last_sum, ccm_openai_spend_last_sum, ccm_snowflake_spend_last_sum, ccm_spend_monitored_ent_last_sum, ccm_spend_monitored_pro_last_sum, ccm_twilio_spend_last_sum, ci_pipeline_indexed_spans_agg_sum, ci_test_indexed_spans_agg_sum, ci_visibility_itr_committers_hwm_sum, ci_visibility_pipeline_committers_hwm_sum, ci_visibility_test_committers_hwm_sum, cloud_cost_management_aws_host_count_avg_sum, cloud_cost_management_azure_host_count_avg_sum, cloud_cost_management_gcp_host_count_avg_sum, cloud_cost_management_host_count_avg_sum, cloud_cost_management_oci_host_count_avg_sum, cloud_siem_events_agg_sum, cloud_siem_indexed_logs_agg_sum, code_analysis_sa_committers_hwm_sum, code_analysis_sca_committers_hwm_sum, code_security_host_top99p_sum, container_avg_sum, container_excl_agent_avg_sum, container_hwm_sum, csm_container_enterprise_compliance_count_agg_sum, csm_container_enterprise_cws_count_agg_sum, csm_container_enterprise_total_count_agg_sum, csm_host_enterprise_aas_host_count_top99p_sum, csm_host_enterprise_aws_host_count_top99p_sum, csm_host_enterprise_azure_host_count_top99p_sum, csm_host_enterprise_compliance_host_count_top99p_sum, csm_host_enterprise_cws_host_count_top99p_sum, csm_host_enterprise_gcp_host_count_top99p_sum, csm_host_enterprise_oci_host_count_top99p_sum, csm_host_enterprise_total_host_count_top99p_sum, csm_host_pro_hosts_agentless_scanners_agg_sum, csm_host_pro_hosts_agentless_scanners_top99p_sum, csm_host_pro_oci_host_count_top99p_sum, cspm_aas_host_top99p_sum, cspm_aws_host_top99p_sum, cspm_azure_host_top99p_sum, cspm_container_avg_sum, cspm_container_hwm_sum, cspm_gcp_host_top99p_sum, cspm_host_top99p_sum, cspm_hosts_agentless_scanners_agg_sum, cspm_hosts_agentless_scanners_top99p_sum, custom_historical_ts_sum, custom_live_ts_sum, custom_ts_sum, cws_container_avg_sum, cws_fargate_task_avg_sum, cws_host_top99p_sum, data_jobs_monitoring_host_hr_agg_sum, dbm_host_top99p_sum, dbm_queries_avg_sum, do_jobs_monitoring_orchestrators_job_hours_agg_sum, end_date, eph_infra_host_agent_agg_sum, eph_infra_host_alibaba_agg_sum, eph_infra_host_aws_agg_sum, eph_infra_host_azure_agg_sum, eph_infra_host_basic_agg_sum, eph_infra_host_basic_infra_basic_agent_agg_sum, eph_infra_host_basic_infra_basic_vsphere_agg_sum, eph_infra_host_ent_agg_sum, eph_infra_host_gcp_agg_sum, eph_infra_host_heroku_agg_sum, eph_infra_host_only_aas_agg_sum, eph_infra_host_only_vsphere_agg_sum, eph_infra_host_opentelemetry_agg_sum, eph_infra_host_opentelemetry_apm_agg_sum, eph_infra_host_pro_agg_sum, eph_infra_host_proplus_agg_sum, eph_infra_host_proxmox_agg_sum, error_tracking_apm_error_events_agg_sum, error_tracking_error_events_agg_sum, error_tracking_events_agg_sum, error_tracking_rum_error_events_agg_sum, event_management_correlation_agg_sum, event_management_correlation_correlated_events_agg_sum, event_management_correlation_correlated_related_events_agg_sum, fargate_container_profiler_profiling_fargate_avg_sum, fargate_container_profiler_profiling_fargate_eks_avg_sum, fargate_tasks_count_avg_sum, fargate_tasks_count_hwm_sum, feature_flags_config_requests_agg_sum, flex_logs_compute_large_avg_sum, flex_logs_compute_medium_avg_sum, flex_logs_compute_small_avg_sum, flex_logs_compute_xlarge_avg_sum, flex_logs_compute_xsmall_avg_sum, flex_logs_starter_avg_sum, flex_logs_starter_storage_index_avg_sum, flex_logs_starter_storage_retention_adjustment_avg_sum, flex_stored_logs_avg_sum, forwarding_events_bytes_agg_sum, gcp_host_top99p_sum, heroku_host_top99p_sum, incident_management_monthly_active_users_hwm_sum, incident_management_seats_hwm_sum, indexed_events_count_agg_sum, infra_edge_monitoring_devices_top99p_sum, infra_host_basic_infra_basic_agent_top99p_sum, infra_host_basic_infra_basic_vsphere_top99p_sum, infra_host_basic_top99p_sum, infra_host_top99p_sum, infra_storage_mgmt_objects_count_avg_sum, ingested_events_bytes_agg_sum, iot_device_agg_sum, iot_device_top99p_sum, last_updated, live_indexed_events_agg_sum, live_ingested_bytes_agg_sum, llm_observability_agg_sum, llm_observability_min_spend_agg_sum, logs_by_retention, mobile_rum_lite_session_count_agg_sum, mobile_rum_session_count_agg_sum, mobile_rum_session_count_android_agg_sum, mobile_rum_session_count_flutter_agg_sum, mobile_rum_session_count_ios_agg_sum, mobile_rum_session_count_reactnative_agg_sum, mobile_rum_session_count_roku_agg_sum, mobile_rum_units_agg_sum, ndm_netflow_events_agg_sum, netflow_indexed_events_count_agg_sum, network_device_wireless_top99p_sum, network_path_agg_sum, npm_host_top99p_sum, observability_pipelines_bytes_processed_agg_sum, oci_host_agg_sum, oci_host_top99p_sum, on_call_seat_hwm_sum, online_archive_events_count_agg_sum, opentelemetry_apm_host_top99p_sum, opentelemetry_host_top99p_sum, product_analytics_agg_sum, profiling_aas_count_top99p_sum, profiling_container_agent_count_avg, profiling_host_count_top99p_sum, proxmox_host_agg_sum, proxmox_host_top99p_sum, published_app_hwm_sum, rehydrated_indexed_events_agg_sum, rehydrated_ingested_bytes_agg_sum, rum_browser_and_mobile_session_count, rum_browser_legacy_session_count_agg_sum, rum_browser_lite_session_count_agg_sum, rum_browser_replay_session_count_agg_sum, rum_indexed_sessions_agg_sum, rum_ingested_sessions_agg_sum, rum_lite_session_count_agg_sum, rum_mobile_legacy_session_count_android_agg_sum, rum_mobile_legacy_session_count_flutter_agg_sum, rum_mobile_legacy_session_count_ios_agg_sum, rum_mobile_legacy_session_count_reactnative_agg_sum, rum_mobile_legacy_session_count_roku_agg_sum, rum_mobile_lite_session_count_android_agg_sum, rum_mobile_lite_session_count_flutter_agg_sum, rum_mobile_lite_session_count_ios_agg_sum, rum_mobile_lite_session_count_kotlinmultiplatform_agg_sum, rum_mobile_lite_session_count_reactnative_agg_sum, rum_mobile_lite_session_count_roku_agg_sum, rum_mobile_lite_session_count_unity_agg_sum, rum_mobile_replay_session_count_android_agg_sum, rum_mobile_replay_session_count_ios_agg_sum, rum_mobile_replay_session_count_kotlinmultiplatform_agg_sum, rum_mobile_replay_session_count_reactnative_agg_sum, rum_replay_session_count_agg_sum, rum_session_count_agg_sum, rum_session_replay_add_on_agg_sum, rum_total_session_count_agg_sum, rum_units_agg_sum, sca_fargate_count_avg_sum, sca_fargate_count_hwm_sum, sds_apm_scanned_bytes_sum, sds_events_scanned_bytes_sum, sds_logs_scanned_bytes_sum, sds_rum_scanned_bytes_sum, sds_total_scanned_bytes_sum, serverless_apps_apm_apm_azure_appservice_instances_avg_sum, serverless_apps_apm_apm_azure_azurefunction_instances_avg_sum, serverless_apps_apm_apm_azure_containerapp_instances_avg_sum, serverless_apps_apm_apm_fargate_ecs_tasks_avg_sum, serverless_apps_apm_apm_gcp_cloudfunction_instances_avg_sum, serverless_apps_apm_apm_gcp_cloudrun_instances_avg_sum, serverless_apps_apm_apm_gcp_gke_autopilot_pods_avg_sum, serverless_apps_apm_avg_sum, serverless_apps_apm_excl_fargate_apm_azure_appservice_instances_avg_sum, serverless_apps_apm_excl_fargate_apm_azure_azurefunction_instances_avg_sum, serverless_apps_apm_excl_fargate_apm_azure_containerapp_instances_avg_sum, serverless_apps_apm_excl_fargate_apm_gcp_cloudfunction_instances_avg_sum, serverless_apps_apm_excl_fargate_apm_gcp_cloudrun_instances_avg_sum, serverless_apps_apm_excl_fargate_apm_gcp_gke_autopilot_pods_avg_sum, serverless_apps_apm_excl_fargate_avg_sum, serverless_apps_azure_container_app_instances_avg_sum, serverless_apps_azure_count_avg_sum, serverless_apps_azure_function_app_instances_avg_sum, serverless_apps_azure_web_app_instances_avg_sum, serverless_apps_ecs_avg_sum, serverless_apps_eks_avg_sum, serverless_apps_excl_fargate_avg_sum, serverless_apps_excl_fargate_azure_container_app_instances_avg_sum, serverless_apps_excl_fargate_azure_function_app_instances_avg_sum, serverless_apps_excl_fargate_azure_web_app_instances_avg_sum, serverless_apps_excl_fargate_google_cloud_functions_instances_avg_sum, serverless_apps_excl_fargate_google_cloud_run_instances_avg_sum, serverless_apps_excl_fargate_infra_gcp_gke_autopilot_pods_avg_sum, serverless_apps_google_cloud_functions_instances_avg_sum, serverless_apps_google_cloud_run_instances_avg_sum, serverless_apps_google_count_avg_sum, serverless_apps_infra_gcp_gke_autopilot_pods_avg_sum, serverless_apps_total_count_avg_sum, siem_12mo_retention_agg_sum, siem_6mo_retention_agg_sum, siem_analyzed_logs_add_on_count_agg_sum, start_date, synthetics_browser_check_calls_count_agg_sum, synthetics_check_calls_count_agg_sum, synthetics_mobile_test_runs_agg_sum, synthetics_parallel_testing_max_slots_hwm_sum, trace_search_indexed_events_count_agg_sum, twol_ingested_events_bytes_agg_sum, universal_service_monitoring_host_top99p_sum, usage, vsphere_host_top99p_sum, vuln_management_host_count_top99p_sum, workflow_executions_usage_agg_sum, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/api/application_security_api.rb b/lib/datadog_api_client/v2/api/application_security_api.rb index 386170e4f96f..43572bca6b7c 100644 --- a/lib/datadog_api_client/v2/api/application_security_api.rb +++ b/lib/datadog_api_client/v2/api/application_security_api.rb @@ -160,6 +160,73 @@ def create_application_security_waf_exclusion_filter_with_http_info(body, opts = return data, status_code, headers end + # Create a WAF Policy. + # + # @see #create_application_security_waf_policy_with_http_info + def create_application_security_waf_policy(body, opts = {}) + data, _status_code, _headers = create_application_security_waf_policy_with_http_info(body, opts) + data + end + + # Create a WAF Policy. + # + # Create a new WAF policy. + # + # @param body [ApplicationSecurityPolicyCreateRequest] The new WAF policy. + # @param opts [Hash] the optional parameters + # @return [Array<(ApplicationSecurityPolicyResponse, Integer, Hash)>] ApplicationSecurityPolicyResponse data, response status code and response headers + def create_application_security_waf_policy_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ApplicationSecurityAPI.create_application_security_waf_policy ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling ApplicationSecurityAPI.create_application_security_waf_policy" + end + # resource path + local_var_path = '/api/v2/remote_config/products/asm/waf/policies' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'ApplicationSecurityPolicyResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_application_security_waf_policy, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ApplicationSecurityAPI#create_application_security_waf_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Delete a WAF Custom Rule. # # @see #delete_application_security_waf_custom_rule_with_http_info @@ -290,6 +357,71 @@ def delete_application_security_waf_exclusion_filter_with_http_info(exclusion_fi return data, status_code, headers end + # Delete a WAF Policy. + # + # @see #delete_application_security_waf_policy_with_http_info + def delete_application_security_waf_policy(policy_id, opts = {}) + delete_application_security_waf_policy_with_http_info(policy_id, opts) + nil + end + + # Delete a WAF Policy. + # + # Delete a specific WAF policy. + # + # @param policy_id [String] The ID of the policy. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_application_security_waf_policy_with_http_info(policy_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ApplicationSecurityAPI.delete_application_security_waf_policy ...' + end + # verify the required parameter 'policy_id' is set + if @api_client.config.client_side_validation && policy_id.nil? + fail ArgumentError, "Missing the required parameter 'policy_id' when calling ApplicationSecurityAPI.delete_application_security_waf_policy" + end + # resource path + local_var_path = '/api/v2/remote_config/products/asm/waf/policies/{policy_id}'.sub('{policy_id}', CGI.escape(policy_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :delete_application_security_waf_policy, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ApplicationSecurityAPI#delete_application_security_waf_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get a WAF custom rule. # # @see #get_application_security_waf_custom_rule_with_http_info @@ -420,6 +552,71 @@ def get_application_security_waf_exclusion_filter_with_http_info(exclusion_filte return data, status_code, headers end + # Get a WAF Policy. + # + # @see #get_application_security_waf_policy_with_http_info + def get_application_security_waf_policy(policy_id, opts = {}) + data, _status_code, _headers = get_application_security_waf_policy_with_http_info(policy_id, opts) + data + end + + # Get a WAF Policy. + # + # Retrieve a WAF policy by ID. + # + # @param policy_id [String] The ID of the policy. + # @param opts [Hash] the optional parameters + # @return [Array<(ApplicationSecurityPolicyResponse, Integer, Hash)>] ApplicationSecurityPolicyResponse data, response status code and response headers + def get_application_security_waf_policy_with_http_info(policy_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ApplicationSecurityAPI.get_application_security_waf_policy ...' + end + # verify the required parameter 'policy_id' is set + if @api_client.config.client_side_validation && policy_id.nil? + fail ArgumentError, "Missing the required parameter 'policy_id' when calling ApplicationSecurityAPI.get_application_security_waf_policy" + end + # resource path + local_var_path = '/api/v2/remote_config/products/asm/waf/policies/{policy_id}'.sub('{policy_id}', CGI.escape(policy_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ApplicationSecurityPolicyResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_application_security_waf_policy, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ApplicationSecurityAPI#get_application_security_waf_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # List all WAF custom rules. # # @see #list_application_security_waf_custom_rules_with_http_info @@ -540,6 +737,66 @@ def list_application_security_waf_exclusion_filters_with_http_info(opts = {}) return data, status_code, headers end + # List all WAF policies. + # + # @see #list_application_security_waf_policies_with_http_info + def list_application_security_waf_policies(opts = {}) + data, _status_code, _headers = list_application_security_waf_policies_with_http_info(opts) + data + end + + # List all WAF policies. + # + # Retrieve a list of WAF policies. + # + # @param opts [Hash] the optional parameters + # @return [Array<(ApplicationSecurityPolicyListResponse, Integer, Hash)>] ApplicationSecurityPolicyListResponse data, response status code and response headers + def list_application_security_waf_policies_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ApplicationSecurityAPI.list_application_security_waf_policies ...' + end + # resource path + local_var_path = '/api/v2/remote_config/products/asm/waf/policies' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'ApplicationSecurityPolicyListResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_application_security_waf_policies, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ApplicationSecurityAPI#list_application_security_waf_policies\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Update a WAF Custom Rule. # # @see #update_application_security_waf_custom_rule_with_http_info @@ -685,5 +942,78 @@ def update_application_security_waf_exclusion_filter_with_http_info(exclusion_fi end return data, status_code, headers end + + # Update a WAF Policy. + # + # @see #update_application_security_waf_policy_with_http_info + def update_application_security_waf_policy(policy_id, body, opts = {}) + data, _status_code, _headers = update_application_security_waf_policy_with_http_info(policy_id, body, opts) + data + end + + # Update a WAF Policy. + # + # Update a specific WAF policy. + # Returns the policy object when the request is successful. + # + # @param policy_id [String] The ID of the policy. + # @param body [ApplicationSecurityPolicyUpdateRequest] New WAF policy. + # @param opts [Hash] the optional parameters + # @return [Array<(ApplicationSecurityPolicyResponse, Integer, Hash)>] ApplicationSecurityPolicyResponse data, response status code and response headers + def update_application_security_waf_policy_with_http_info(policy_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ApplicationSecurityAPI.update_application_security_waf_policy ...' + end + # verify the required parameter 'policy_id' is set + if @api_client.config.client_side_validation && policy_id.nil? + fail ArgumentError, "Missing the required parameter 'policy_id' when calling ApplicationSecurityAPI.update_application_security_waf_policy" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling ApplicationSecurityAPI.update_application_security_waf_policy" + end + # resource path + local_var_path = '/api/v2/remote_config/products/asm/waf/policies/{policy_id}'.sub('{policy_id}', CGI.escape(policy_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'ApplicationSecurityPolicyResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_application_security_waf_policy, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ApplicationSecurityAPI#update_application_security_waf_policy\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/lib/datadog_api_client/v2/api/security_monitoring_api.rb b/lib/datadog_api_client/v2/api/security_monitoring_api.rb index 11dba03541e8..ffdabf0f2b09 100644 --- a/lib/datadog_api_client/v2/api/security_monitoring_api.rb +++ b/lib/datadog_api_client/v2/api/security_monitoring_api.rb @@ -1810,6 +1810,152 @@ def create_signal_notification_rule_with_http_info(body, opts = {}) return data, status_code, headers end + # Get AST for source code. + # + # @see #create_static_analysis_ast_with_http_info + def create_static_analysis_ast(body, opts = {}) + data, _status_code, _headers = create_static_analysis_ast_with_http_info(body, opts) + data + end + + # Get AST for source code. + # + # Parse source code into an abstract syntax tree (AST) for the specified language. + # + # @param body [GetAstRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(GetAstResponse, Integer, Hash)>] GetAstResponse data, response status code and response headers + def create_static_analysis_ast_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_static_analysis_ast".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_static_analysis_ast") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_static_analysis_ast")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.create_static_analysis_ast ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.create_static_analysis_ast" + end + # resource path + local_var_path = '/api/v2/static-analysis/static-analysis-server/get-ast' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'GetAstResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_static_analysis_ast, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#create_static_analysis_ast\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Analyze code. + # + # @see #create_static_analysis_server_analysis_with_http_info + def create_static_analysis_server_analysis(body, opts = {}) + data, _status_code, _headers = create_static_analysis_server_analysis_with_http_info(body, opts) + data + end + + # Analyze code. + # + # Run static analysis rules against a source code file and return violations found. + # + # @param body [AnalysisRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(AnalysisResponse, Integer, Hash)>] AnalysisResponse data, response status code and response headers + def create_static_analysis_server_analysis_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_static_analysis_server_analysis".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_static_analysis_server_analysis") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_static_analysis_server_analysis")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.create_static_analysis_server_analysis ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.create_static_analysis_server_analysis" + end + # resource path + local_var_path = '/api/v2/static-analysis/static-analysis-server/analyze' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'AnalysisResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_static_analysis_server_analysis, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#create_static_analysis_server_analysis\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create a new vulnerability-based notification rule. # # @see #create_vulnerability_notification_rule_with_http_info @@ -4686,6 +4832,294 @@ def get_signal_notification_rules_with_http_info(opts = {}) return data, status_code, headers end + # Get default rulesets for a language. + # + # @see #get_static_analysis_default_rulesets_with_http_info + def get_static_analysis_default_rulesets(language, opts = {}) + data, _status_code, _headers = get_static_analysis_default_rulesets_with_http_info(language, opts) + data + end + + # Get default rulesets for a language. + # + # Get the default SAST ruleset names for a given programming language. + # + # @param language [String] The programming language for which to retrieve the default rulesets. + # @param opts [Hash] the optional parameters + # @return [Array<(DefaultRulesetsPerLanguageResponse, Integer, Hash)>] DefaultRulesetsPerLanguageResponse data, response status code and response headers + def get_static_analysis_default_rulesets_with_http_info(language, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_static_analysis_default_rulesets".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_static_analysis_default_rulesets") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_static_analysis_default_rulesets")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_static_analysis_default_rulesets ...' + end + # verify the required parameter 'language' is set + if @api_client.config.client_side_validation && language.nil? + fail ArgumentError, "Missing the required parameter 'language' when calling SecurityMonitoringAPI.get_static_analysis_default_rulesets" + end + # resource path + local_var_path = '/api/v2/static-analysis/default-rulesets/{language}'.sub('{language}', CGI.escape(language.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'DefaultRulesetsPerLanguageResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_static_analysis_default_rulesets, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#get_static_analysis_default_rulesets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get node types for a language. + # + # @see #get_static_analysis_node_types_with_http_info + def get_static_analysis_node_types(language, opts = {}) + data, _status_code, _headers = get_static_analysis_node_types_with_http_info(language, opts) + data + end + + # Get node types for a language. + # + # Retrieve tree-sitter node type definitions for a given programming language. + # + # @param language [String] The programming language for which to retrieve node type definitions. + # @param opts [Hash] the optional parameters + # @return [Array<(NodeTypesResponse, Integer, Hash)>] NodeTypesResponse data, response status code and response headers + def get_static_analysis_node_types_with_http_info(language, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_static_analysis_node_types".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_static_analysis_node_types") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_static_analysis_node_types")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_static_analysis_node_types ...' + end + # verify the required parameter 'language' is set + if @api_client.config.client_side_validation && language.nil? + fail ArgumentError, "Missing the required parameter 'language' when calling SecurityMonitoringAPI.get_static_analysis_node_types" + end + # resource path + local_var_path = '/api/v2/static-analysis/static-analysis-server/node-types/{language}'.sub('{language}', CGI.escape(language.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'NodeTypesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_static_analysis_node_types, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#get_static_analysis_node_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get a SAST ruleset. + # + # @see #get_static_analysis_ruleset_with_http_info + def get_static_analysis_ruleset(ruleset_name, opts = {}) + data, _status_code, _headers = get_static_analysis_ruleset_with_http_info(ruleset_name, opts) + data + end + + # Get a SAST ruleset. + # + # Get a SAST ruleset by name, including all its rules. + # + # @param ruleset_name [String] The name of the ruleset to retrieve. + # @param opts [Hash] the optional parameters + # @option opts [Boolean] :include_tests When true, test cases for each rule are included in the response. + # @option opts [Boolean] :include_testing_rules When true, rules that are in testing mode are included in the response. + # @return [Array<(SastRulesetResponse, Integer, Hash)>] SastRulesetResponse data, response status code and response headers + def get_static_analysis_ruleset_with_http_info(ruleset_name, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_static_analysis_ruleset".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_static_analysis_ruleset") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_static_analysis_ruleset")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_static_analysis_ruleset ...' + end + # verify the required parameter 'ruleset_name' is set + if @api_client.config.client_side_validation && ruleset_name.nil? + fail ArgumentError, "Missing the required parameter 'ruleset_name' when calling SecurityMonitoringAPI.get_static_analysis_ruleset" + end + # resource path + local_var_path = '/api/v2/static-analysis/rulesets/{ruleset_name}'.sub('{ruleset_name}', CGI.escape(ruleset_name.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'include_tests'] = opts[:'include_tests'] if !opts[:'include_tests'].nil? + query_params[:'include_testing_rules'] = opts[:'include_testing_rules'] if !opts[:'include_testing_rules'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'SastRulesetResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_static_analysis_ruleset, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#get_static_analysis_ruleset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get tree-sitter WASM file. + # + # @see #get_static_analysis_tree_sitter_wasm_with_http_info + def get_static_analysis_tree_sitter_wasm(file, opts = {}) + data, _status_code, _headers = get_static_analysis_tree_sitter_wasm_with_http_info(file, opts) + data + end + + # Get tree-sitter WASM file. + # + # Download the WebAssembly binary for a tree-sitter grammar by file name. + # + # @param file [String] The name of the WASM file to download. + # @param opts [Hash] the optional parameters + # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers + def get_static_analysis_tree_sitter_wasm_with_http_info(file, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_static_analysis_tree_sitter_wasm".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_static_analysis_tree_sitter_wasm") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_static_analysis_tree_sitter_wasm")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_static_analysis_tree_sitter_wasm ...' + end + # verify the required parameter 'file' is set + if @api_client.config.client_side_validation && file.nil? + fail ArgumentError, "Missing the required parameter 'file' when calling SecurityMonitoringAPI.get_static_analysis_tree_sitter_wasm" + end + # resource path + local_var_path = '/api/v2/static-analysis/static-analysis-server/tree-sitter-wasm/{file}'.sub('{file}', CGI.escape(file.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream', 'application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'File' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_static_analysis_tree_sitter_wasm, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#get_static_analysis_tree_sitter_wasm\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get suggested actions for a signal. # # @see #get_suggested_actions_matching_signal_with_http_info @@ -6485,6 +6919,72 @@ def list_security_monitoring_suppressions_with_http_info(opts = {}) return data, status_code, headers end + # List codegen rulesets. + # + # @see #list_static_analysis_codegen_rulesets_with_http_info + def list_static_analysis_codegen_rulesets(opts = {}) + data, _status_code, _headers = list_static_analysis_codegen_rulesets_with_http_info(opts) + data + end + + # List codegen rulesets. + # + # Get the rulesets relevant for code generation for the authenticated user. + # + # @param opts [Hash] the optional parameters + # @return [Array<(SastRulesetsResponse, Integer, Hash)>] SastRulesetsResponse data, response status code and response headers + def list_static_analysis_codegen_rulesets_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_static_analysis_codegen_rulesets".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_static_analysis_codegen_rulesets") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_static_analysis_codegen_rulesets")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_static_analysis_codegen_rulesets ...' + end + # resource path + local_var_path = '/api/v2/static-analysis/codegen/rulesets' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'SastRulesetsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_static_analysis_codegen_rulesets, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#list_static_analysis_codegen_rulesets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # List vulnerabilities. # # @see #list_vulnerabilities_with_http_info diff --git a/lib/datadog_api_client/v2/api/static_analysis_api.rb b/lib/datadog_api_client/v2/api/static_analysis_api.rb index d778dce9101d..2be51c047146 100644 --- a/lib/datadog_api_client/v2/api/static_analysis_api.rb +++ b/lib/datadog_api_client/v2/api/static_analysis_api.rb @@ -23,43 +23,43 @@ def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end - # Create Custom Rule. + # Create an AI custom rule. # - # @see #create_custom_rule_with_http_info - def create_custom_rule(ruleset_name, body, opts = {}) - data, _status_code, _headers = create_custom_rule_with_http_info(ruleset_name, body, opts) + # @see #create_ai_custom_rule_with_http_info + def create_ai_custom_rule(ruleset_name, body, opts = {}) + data, _status_code, _headers = create_ai_custom_rule_with_http_info(ruleset_name, body, opts) data end - # Create Custom Rule. + # Create an AI custom rule. # - # Create a new custom rule within a ruleset + # Create a new AI custom rule within a ruleset. # - # @param ruleset_name [String] The ruleset name - # @param body [CustomRuleRequest] + # @param ruleset_name [String] The ruleset name. + # @param body [AiCustomRuleRequest] # @param opts [Hash] the optional parameters - # @return [Array<(CustomRuleResponse, Integer, Hash)>] CustomRuleResponse data, response status code and response headers - def create_custom_rule_with_http_info(ruleset_name, body, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.create_custom_rule".to_sym] + # @return [Array<(AiCustomRuleResponse, Integer, Hash)>] AiCustomRuleResponse data, response status code and response headers + def create_ai_custom_rule_with_http_info(ruleset_name, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_ai_custom_rule".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_custom_rule") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_ai_custom_rule") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_custom_rule")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_ai_custom_rule")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.create_custom_rule ...' + @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.create_ai_custom_rule ...' end # verify the required parameter 'ruleset_name' is set if @api_client.config.client_side_validation && ruleset_name.nil? - fail ArgumentError, "Missing the required parameter 'ruleset_name' when calling StaticAnalysisAPI.create_custom_rule" + fail ArgumentError, "Missing the required parameter 'ruleset_name' when calling StaticAnalysisAPI.create_ai_custom_rule" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling StaticAnalysisAPI.create_custom_rule" + fail ArgumentError, "Missing the required parameter 'body' when calling StaticAnalysisAPI.create_ai_custom_rule" end # resource path - local_var_path = '/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules'.sub('{ruleset_name}', CGI.escape(ruleset_name.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/static-analysis/ai/rulesets/{ruleset_name}/rules'.sub('{ruleset_name}', CGI.escape(ruleset_name.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -78,13 +78,13 @@ def create_custom_rule_with_http_info(ruleset_name, body, opts = {}) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type - return_type = opts[:debug_return_type] || 'CustomRuleResponse' + return_type = opts[:debug_return_type] || 'AiCustomRuleResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :create_custom_rule, + :operation => :create_ai_custom_rule, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -94,55 +94,55 @@ def create_custom_rule_with_http_info(ruleset_name, body, opts = {}) :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: StaticAnalysisAPI#create_custom_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: StaticAnalysisAPI#create_ai_custom_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Create Custom Rule Revision. + # Create an AI custom rule revision. # - # @see #create_custom_rule_revision_with_http_info - def create_custom_rule_revision(ruleset_name, rule_name, body, opts = {}) - create_custom_rule_revision_with_http_info(ruleset_name, rule_name, body, opts) + # @see #create_ai_custom_rule_revision_with_http_info + def create_ai_custom_rule_revision(ruleset_name, rule_name, body, opts = {}) + create_ai_custom_rule_revision_with_http_info(ruleset_name, rule_name, body, opts) nil end - # Create Custom Rule Revision. + # Create an AI custom rule revision. # - # Create a new revision for a custom rule + # Create a new revision for an AI custom rule. # - # @param ruleset_name [String] The ruleset name - # @param rule_name [String] The rule name - # @param body [CustomRuleRevisionRequest] + # @param ruleset_name [String] The ruleset name. + # @param rule_name [String] The rule name. + # @param body [AiCustomRuleRevisionRequest] # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def create_custom_rule_revision_with_http_info(ruleset_name, rule_name, body, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.create_custom_rule_revision".to_sym] + def create_ai_custom_rule_revision_with_http_info(ruleset_name, rule_name, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_ai_custom_rule_revision".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_custom_rule_revision") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_ai_custom_rule_revision") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_custom_rule_revision")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_ai_custom_rule_revision")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.create_custom_rule_revision ...' + @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.create_ai_custom_rule_revision ...' end # verify the required parameter 'ruleset_name' is set if @api_client.config.client_side_validation && ruleset_name.nil? - fail ArgumentError, "Missing the required parameter 'ruleset_name' when calling StaticAnalysisAPI.create_custom_rule_revision" + fail ArgumentError, "Missing the required parameter 'ruleset_name' when calling StaticAnalysisAPI.create_ai_custom_rule_revision" end # verify the required parameter 'rule_name' is set if @api_client.config.client_side_validation && rule_name.nil? - fail ArgumentError, "Missing the required parameter 'rule_name' when calling StaticAnalysisAPI.create_custom_rule_revision" + fail ArgumentError, "Missing the required parameter 'rule_name' when calling StaticAnalysisAPI.create_ai_custom_rule_revision" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling StaticAnalysisAPI.create_custom_rule_revision" + fail ArgumentError, "Missing the required parameter 'body' when calling StaticAnalysisAPI.create_ai_custom_rule_revision" end # resource path - local_var_path = '/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}/revisions'.sub('{ruleset_name}', CGI.escape(ruleset_name.to_s).gsub('%2F', '/')).sub('{rule_name}', CGI.escape(rule_name.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/static-analysis/ai/rulesets/{ruleset_name}/rules/{rule_name}/revisions'.sub('{ruleset_name}', CGI.escape(ruleset_name.to_s).gsub('%2F', '/')).sub('{rule_name}', CGI.escape(rule_name.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -167,7 +167,7 @@ def create_custom_rule_revision_with_http_info(ruleset_name, rule_name, body, op auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :create_custom_rule_revision, + :operation => :create_ai_custom_rule_revision, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -177,42 +177,45 @@ def create_custom_rule_revision_with_http_info(ruleset_name, rule_name, body, op :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: StaticAnalysisAPI#create_custom_rule_revision\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: StaticAnalysisAPI#create_ai_custom_rule_revision\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # POST request to resolve vulnerable symbols. + # Create an AI custom ruleset. # - # @see #create_sca_resolve_vulnerable_symbols_with_http_info - def create_sca_resolve_vulnerable_symbols(body, opts = {}) - data, _status_code, _headers = create_sca_resolve_vulnerable_symbols_with_http_info(body, opts) + # @see #create_ai_custom_ruleset_with_http_info + def create_ai_custom_ruleset(body, opts = {}) + data, _status_code, _headers = create_ai_custom_ruleset_with_http_info(body, opts) data end - # POST request to resolve vulnerable symbols. - # @param body [ResolveVulnerableSymbolsRequest] + # Create an AI custom ruleset. + # + # Create a new AI custom ruleset for the authenticated organization. + # + # @param body [AiCustomRulesetRequest] # @param opts [Hash] the optional parameters - # @return [Array<(ResolveVulnerableSymbolsResponse, Integer, Hash)>] ResolveVulnerableSymbolsResponse data, response status code and response headers - def create_sca_resolve_vulnerable_symbols_with_http_info(body, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.create_sca_resolve_vulnerable_symbols".to_sym] + # @return [Array<(AiCustomRulesetResponse, Integer, Hash)>] AiCustomRulesetResponse data, response status code and response headers + def create_ai_custom_ruleset_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_ai_custom_ruleset".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_sca_resolve_vulnerable_symbols") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_ai_custom_ruleset") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_sca_resolve_vulnerable_symbols")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_ai_custom_ruleset")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.create_sca_resolve_vulnerable_symbols ...' + @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.create_ai_custom_ruleset ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling StaticAnalysisAPI.create_sca_resolve_vulnerable_symbols" + fail ArgumentError, "Missing the required parameter 'body' when calling StaticAnalysisAPI.create_ai_custom_ruleset" end # resource path - local_var_path = '/api/v2/static-analysis-sca/vulnerabilities/resolve-vulnerable-symbols' + local_var_path = '/api/v2/static-analysis/ai/rulesets' # query parameters query_params = opts[:query_params] || {} @@ -231,13 +234,13 @@ def create_sca_resolve_vulnerable_symbols_with_http_info(body, opts = {}) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type - return_type = opts[:debug_return_type] || 'ResolveVulnerableSymbolsResponse' + return_type = opts[:debug_return_type] || 'AiCustomRulesetResponse' # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :create_sca_resolve_vulnerable_symbols, + :operation => :create_ai_custom_ruleset, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -249,40 +252,43 @@ def create_sca_resolve_vulnerable_symbols_with_http_info(body, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: StaticAnalysisAPI#create_sca_resolve_vulnerable_symbols\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: StaticAnalysisAPI#create_ai_custom_ruleset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Post dependencies for analysis. + # Create an AI memory violation result. # - # @see #create_sca_result_with_http_info - def create_sca_result(body, opts = {}) - create_sca_result_with_http_info(body, opts) + # @see #create_ai_memory_violation_result_with_http_info + def create_ai_memory_violation_result(body, opts = {}) + create_ai_memory_violation_result_with_http_info(body, opts) nil end - # Post dependencies for analysis. - # @param body [ScaRequest] + # Create an AI memory violation result. + # + # Add a new AI memory violation result for the authenticated organization. + # + # @param body [AiMemoryViolationResultRequest] # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def create_sca_result_with_http_info(body, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.create_sca_result".to_sym] + def create_ai_memory_violation_result_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_ai_memory_violation_result".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_sca_result") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_ai_memory_violation_result") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_sca_result")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_ai_memory_violation_result")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.create_sca_result ...' + @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.create_ai_memory_violation_result ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling StaticAnalysisAPI.create_sca_result" + fail ArgumentError, "Missing the required parameter 'body' when calling StaticAnalysisAPI.create_ai_memory_violation_result" end # resource path - local_var_path = '/api/v2/static-analysis-sca/dependencies' + local_var_path = '/api/v2/static-analysis/ai/memory' # query parameters query_params = opts[:query_params] || {} @@ -304,10 +310,10 @@ def create_sca_result_with_http_info(body, opts = {}) return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :create_sca_result, + :operation => :create_ai_memory_violation_result, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -319,48 +325,1167 @@ def create_sca_result_with_http_info(body, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: StaticAnalysisAPI#create_sca_result\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: StaticAnalysisAPI#create_ai_memory_violation_result\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Delete Custom Rule. + # Create Custom Rule. # - # @see #delete_custom_rule_with_http_info - def delete_custom_rule(ruleset_name, rule_name, opts = {}) - delete_custom_rule_with_http_info(ruleset_name, rule_name, opts) + # @see #create_custom_rule_with_http_info + def create_custom_rule(ruleset_name, body, opts = {}) + data, _status_code, _headers = create_custom_rule_with_http_info(ruleset_name, body, opts) + data + end + + # Create Custom Rule. + # + # Create a new custom rule within a ruleset + # + # @param ruleset_name [String] The ruleset name + # @param body [CustomRuleRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(CustomRuleResponse, Integer, Hash)>] CustomRuleResponse data, response status code and response headers + def create_custom_rule_with_http_info(ruleset_name, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_custom_rule".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_custom_rule") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_custom_rule")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.create_custom_rule ...' + end + # verify the required parameter 'ruleset_name' is set + if @api_client.config.client_side_validation && ruleset_name.nil? + fail ArgumentError, "Missing the required parameter 'ruleset_name' when calling StaticAnalysisAPI.create_custom_rule" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling StaticAnalysisAPI.create_custom_rule" + end + # resource path + local_var_path = '/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules'.sub('{ruleset_name}', CGI.escape(ruleset_name.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'CustomRuleResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_custom_rule, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: StaticAnalysisAPI#create_custom_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Create Custom Rule Revision. + # + # @see #create_custom_rule_revision_with_http_info + def create_custom_rule_revision(ruleset_name, rule_name, body, opts = {}) + create_custom_rule_revision_with_http_info(ruleset_name, rule_name, body, opts) nil end - # Delete Custom Rule. + # Create Custom Rule Revision. # - # Delete a custom rule + # Create a new revision for a custom rule # # @param ruleset_name [String] The ruleset name # @param rule_name [String] The rule name + # @param body [CustomRuleRevisionRequest] # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_custom_rule_with_http_info(ruleset_name, rule_name, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.delete_custom_rule".to_sym] + def create_custom_rule_revision_with_http_info(ruleset_name, rule_name, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_custom_rule_revision".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_custom_rule") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_custom_rule_revision") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_custom_rule_revision")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.create_custom_rule_revision ...' + end + # verify the required parameter 'ruleset_name' is set + if @api_client.config.client_side_validation && ruleset_name.nil? + fail ArgumentError, "Missing the required parameter 'ruleset_name' when calling StaticAnalysisAPI.create_custom_rule_revision" + end + # verify the required parameter 'rule_name' is set + if @api_client.config.client_side_validation && rule_name.nil? + fail ArgumentError, "Missing the required parameter 'rule_name' when calling StaticAnalysisAPI.create_custom_rule_revision" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling StaticAnalysisAPI.create_custom_rule_revision" + end + # resource path + local_var_path = '/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}/revisions'.sub('{ruleset_name}', CGI.escape(ruleset_name.to_s).gsub('%2F', '/')).sub('{rule_name}', CGI.escape(rule_name.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_custom_rule_revision, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: StaticAnalysisAPI#create_custom_rule_revision\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Create Custom Ruleset. + # + # @see #create_custom_ruleset_with_http_info + def create_custom_ruleset(body, opts = {}) + data, _status_code, _headers = create_custom_ruleset_with_http_info(body, opts) + data + end + + # Create Custom Ruleset. + # + # Create a new custom ruleset for the authenticated organization. + # + # @param body [CustomRulesetRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(CustomRulesetResponse, Integer, Hash)>] CustomRulesetResponse data, response status code and response headers + def create_custom_ruleset_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_custom_ruleset".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_custom_ruleset") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_custom_ruleset")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.create_custom_ruleset ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling StaticAnalysisAPI.create_custom_ruleset" + end + # resource path + local_var_path = '/api/v2/static-analysis/custom/rulesets' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'CustomRulesetResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_custom_ruleset, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: StaticAnalysisAPI#create_custom_ruleset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # POST request to resolve vulnerable symbols. + # + # @see #create_sca_resolve_vulnerable_symbols_with_http_info + def create_sca_resolve_vulnerable_symbols(body, opts = {}) + data, _status_code, _headers = create_sca_resolve_vulnerable_symbols_with_http_info(body, opts) + data + end + + # POST request to resolve vulnerable symbols. + # @param body [ResolveVulnerableSymbolsRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(ResolveVulnerableSymbolsResponse, Integer, Hash)>] ResolveVulnerableSymbolsResponse data, response status code and response headers + def create_sca_resolve_vulnerable_symbols_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_sca_resolve_vulnerable_symbols".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_sca_resolve_vulnerable_symbols") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_sca_resolve_vulnerable_symbols")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.create_sca_resolve_vulnerable_symbols ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling StaticAnalysisAPI.create_sca_resolve_vulnerable_symbols" + end + # resource path + local_var_path = '/api/v2/static-analysis-sca/vulnerabilities/resolve-vulnerable-symbols' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'ResolveVulnerableSymbolsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_sca_resolve_vulnerable_symbols, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: StaticAnalysisAPI#create_sca_resolve_vulnerable_symbols\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Post dependencies for analysis. + # + # @see #create_sca_result_with_http_info + def create_sca_result(body, opts = {}) + create_sca_result_with_http_info(body, opts) + nil + end + + # Post dependencies for analysis. + # @param body [ScaRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def create_sca_result_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_sca_result".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_sca_result") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_sca_result")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.create_sca_result ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling StaticAnalysisAPI.create_sca_result" + end + # resource path + local_var_path = '/api/v2/static-analysis-sca/dependencies' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_sca_result, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: StaticAnalysisAPI#create_sca_result\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete an AI custom rule. + # + # @see #delete_ai_custom_rule_with_http_info + def delete_ai_custom_rule(ruleset_name, rule_name, opts = {}) + delete_ai_custom_rule_with_http_info(ruleset_name, rule_name, opts) + nil + end + + # Delete an AI custom rule. + # + # Delete an AI custom rule by name within a ruleset. + # + # @param ruleset_name [String] The ruleset name. + # @param rule_name [String] The rule name. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_ai_custom_rule_with_http_info(ruleset_name, rule_name, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_ai_custom_rule".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_ai_custom_rule") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_ai_custom_rule")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.delete_ai_custom_rule ...' + end + # verify the required parameter 'ruleset_name' is set + if @api_client.config.client_side_validation && ruleset_name.nil? + fail ArgumentError, "Missing the required parameter 'ruleset_name' when calling StaticAnalysisAPI.delete_ai_custom_rule" + end + # verify the required parameter 'rule_name' is set + if @api_client.config.client_side_validation && rule_name.nil? + fail ArgumentError, "Missing the required parameter 'rule_name' when calling StaticAnalysisAPI.delete_ai_custom_rule" + end + # resource path + local_var_path = '/api/v2/static-analysis/ai/rulesets/{ruleset_name}/rules/{rule_name}'.sub('{ruleset_name}', CGI.escape(ruleset_name.to_s).gsub('%2F', '/')).sub('{rule_name}', CGI.escape(rule_name.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :delete_ai_custom_rule, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: StaticAnalysisAPI#delete_ai_custom_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete an AI custom ruleset. + # + # @see #delete_ai_custom_ruleset_with_http_info + def delete_ai_custom_ruleset(ruleset_name, opts = {}) + delete_ai_custom_ruleset_with_http_info(ruleset_name, opts) + nil + end + + # Delete an AI custom ruleset. + # + # Delete an AI custom ruleset by name. + # + # @param ruleset_name [String] The ruleset name. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_ai_custom_ruleset_with_http_info(ruleset_name, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_ai_custom_ruleset".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_ai_custom_ruleset") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_ai_custom_ruleset")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.delete_ai_custom_ruleset ...' + end + # verify the required parameter 'ruleset_name' is set + if @api_client.config.client_side_validation && ruleset_name.nil? + fail ArgumentError, "Missing the required parameter 'ruleset_name' when calling StaticAnalysisAPI.delete_ai_custom_ruleset" + end + # resource path + local_var_path = '/api/v2/static-analysis/ai/rulesets/{ruleset_name}'.sub('{ruleset_name}', CGI.escape(ruleset_name.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :delete_ai_custom_ruleset, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: StaticAnalysisAPI#delete_ai_custom_ruleset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete an AI memory violation result. + # + # @see #delete_ai_memory_violation_result_with_http_info + def delete_ai_memory_violation_result(id, opts = {}) + delete_ai_memory_violation_result_with_http_info(id, opts) + nil + end + + # Delete an AI memory violation result. + # + # Delete an AI memory violation result by its numeric identifier. + # + # @param id [String] The numeric identifier of the memory violation result. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_ai_memory_violation_result_with_http_info(id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_ai_memory_violation_result".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_ai_memory_violation_result") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_ai_memory_violation_result")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.delete_ai_memory_violation_result ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling StaticAnalysisAPI.delete_ai_memory_violation_result" + end + # resource path + local_var_path = '/api/v2/static-analysis/ai/memory/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :delete_ai_memory_violation_result, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: StaticAnalysisAPI#delete_ai_memory_violation_result\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete Custom Rule. + # + # @see #delete_custom_rule_with_http_info + def delete_custom_rule(ruleset_name, rule_name, opts = {}) + delete_custom_rule_with_http_info(ruleset_name, rule_name, opts) + nil + end + + # Delete Custom Rule. + # + # Delete a custom rule + # + # @param ruleset_name [String] The ruleset name + # @param rule_name [String] The rule name + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_custom_rule_with_http_info(ruleset_name, rule_name, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_custom_rule".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_custom_rule") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_custom_rule")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.delete_custom_rule ...' + end + # verify the required parameter 'ruleset_name' is set + if @api_client.config.client_side_validation && ruleset_name.nil? + fail ArgumentError, "Missing the required parameter 'ruleset_name' when calling StaticAnalysisAPI.delete_custom_rule" + end + # verify the required parameter 'rule_name' is set + if @api_client.config.client_side_validation && rule_name.nil? + fail ArgumentError, "Missing the required parameter 'rule_name' when calling StaticAnalysisAPI.delete_custom_rule" + end + # resource path + local_var_path = '/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}'.sub('{ruleset_name}', CGI.escape(ruleset_name.to_s).gsub('%2F', '/')).sub('{rule_name}', CGI.escape(rule_name.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :delete_custom_rule, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: StaticAnalysisAPI#delete_custom_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete Custom Ruleset. + # + # @see #delete_custom_ruleset_with_http_info + def delete_custom_ruleset(ruleset_name, opts = {}) + delete_custom_ruleset_with_http_info(ruleset_name, opts) + nil + end + + # Delete Custom Ruleset. + # + # Delete a custom ruleset + # + # @param ruleset_name [String] The ruleset name + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_custom_ruleset_with_http_info(ruleset_name, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_custom_ruleset".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_custom_ruleset") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_custom_ruleset")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.delete_custom_ruleset ...' + end + # verify the required parameter 'ruleset_name' is set + if @api_client.config.client_side_validation && ruleset_name.nil? + fail ArgumentError, "Missing the required parameter 'ruleset_name' when calling StaticAnalysisAPI.delete_custom_ruleset" + end + # resource path + local_var_path = '/api/v2/static-analysis/custom/rulesets/{ruleset_name}'.sub('{ruleset_name}', CGI.escape(ruleset_name.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :delete_custom_ruleset, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: StaticAnalysisAPI#delete_custom_ruleset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get an AI custom rule. + # + # @see #get_ai_custom_rule_with_http_info + def get_ai_custom_rule(ruleset_name, rule_name, opts = {}) + data, _status_code, _headers = get_ai_custom_rule_with_http_info(ruleset_name, rule_name, opts) + data + end + + # Get an AI custom rule. + # + # Get an AI custom rule by name within a ruleset. + # + # @param ruleset_name [String] The ruleset name. + # @param rule_name [String] The rule name. + # @param opts [Hash] the optional parameters + # @return [Array<(AiCustomRuleResponse, Integer, Hash)>] AiCustomRuleResponse data, response status code and response headers + def get_ai_custom_rule_with_http_info(ruleset_name, rule_name, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_ai_custom_rule".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_ai_custom_rule") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_ai_custom_rule")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.get_ai_custom_rule ...' + end + # verify the required parameter 'ruleset_name' is set + if @api_client.config.client_side_validation && ruleset_name.nil? + fail ArgumentError, "Missing the required parameter 'ruleset_name' when calling StaticAnalysisAPI.get_ai_custom_rule" + end + # verify the required parameter 'rule_name' is set + if @api_client.config.client_side_validation && rule_name.nil? + fail ArgumentError, "Missing the required parameter 'rule_name' when calling StaticAnalysisAPI.get_ai_custom_rule" + end + # resource path + local_var_path = '/api/v2/static-analysis/ai/rulesets/{ruleset_name}/rules/{rule_name}'.sub('{ruleset_name}', CGI.escape(ruleset_name.to_s).gsub('%2F', '/')).sub('{rule_name}', CGI.escape(rule_name.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'AiCustomRuleResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_ai_custom_rule, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: StaticAnalysisAPI#get_ai_custom_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get an AI custom rule revision. + # + # @see #get_ai_custom_rule_revision_with_http_info + def get_ai_custom_rule_revision(ruleset_name, rule_name, id, opts = {}) + data, _status_code, _headers = get_ai_custom_rule_revision_with_http_info(ruleset_name, rule_name, id, opts) + data + end + + # Get an AI custom rule revision. + # + # Get a specific revision of an AI custom rule. + # + # @param ruleset_name [String] The ruleset name. + # @param rule_name [String] The rule name. + # @param id [String] The revision identifier. + # @param opts [Hash] the optional parameters + # @return [Array<(AiCustomRuleRevisionResponse, Integer, Hash)>] AiCustomRuleRevisionResponse data, response status code and response headers + def get_ai_custom_rule_revision_with_http_info(ruleset_name, rule_name, id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_ai_custom_rule_revision".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_ai_custom_rule_revision") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_ai_custom_rule_revision")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.get_ai_custom_rule_revision ...' + end + # verify the required parameter 'ruleset_name' is set + if @api_client.config.client_side_validation && ruleset_name.nil? + fail ArgumentError, "Missing the required parameter 'ruleset_name' when calling StaticAnalysisAPI.get_ai_custom_rule_revision" + end + # verify the required parameter 'rule_name' is set + if @api_client.config.client_side_validation && rule_name.nil? + fail ArgumentError, "Missing the required parameter 'rule_name' when calling StaticAnalysisAPI.get_ai_custom_rule_revision" + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling StaticAnalysisAPI.get_ai_custom_rule_revision" + end + # resource path + local_var_path = '/api/v2/static-analysis/ai/rulesets/{ruleset_name}/rules/{rule_name}/revisions/{id}'.sub('{ruleset_name}', CGI.escape(ruleset_name.to_s).gsub('%2F', '/')).sub('{rule_name}', CGI.escape(rule_name.to_s).gsub('%2F', '/')).sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'AiCustomRuleRevisionResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_ai_custom_rule_revision, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: StaticAnalysisAPI#get_ai_custom_rule_revision\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get an AI custom ruleset. + # + # @see #get_ai_custom_ruleset_with_http_info + def get_ai_custom_ruleset(ruleset_name, opts = {}) + data, _status_code, _headers = get_ai_custom_ruleset_with_http_info(ruleset_name, opts) + data + end + + # Get an AI custom ruleset. + # + # Get an AI custom ruleset by name. + # + # @param ruleset_name [String] The ruleset name. + # @param opts [Hash] the optional parameters + # @return [Array<(AiCustomRulesetResponse, Integer, Hash)>] AiCustomRulesetResponse data, response status code and response headers + def get_ai_custom_ruleset_with_http_info(ruleset_name, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_ai_custom_ruleset".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_ai_custom_ruleset") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_ai_custom_ruleset")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.get_ai_custom_ruleset ...' + end + # verify the required parameter 'ruleset_name' is set + if @api_client.config.client_side_validation && ruleset_name.nil? + fail ArgumentError, "Missing the required parameter 'ruleset_name' when calling StaticAnalysisAPI.get_ai_custom_ruleset" + end + # resource path + local_var_path = '/api/v2/static-analysis/ai/rulesets/{ruleset_name}'.sub('{ruleset_name}', CGI.escape(ruleset_name.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'AiCustomRulesetResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_ai_custom_ruleset, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: StaticAnalysisAPI#get_ai_custom_ruleset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Show Custom Rule. + # + # @see #get_custom_rule_with_http_info + def get_custom_rule(ruleset_name, rule_name, opts = {}) + data, _status_code, _headers = get_custom_rule_with_http_info(ruleset_name, rule_name, opts) + data + end + + # Show Custom Rule. + # + # Get a custom rule by name + # + # @param ruleset_name [String] The ruleset name + # @param rule_name [String] The rule name + # @param opts [Hash] the optional parameters + # @return [Array<(CustomRuleResponse, Integer, Hash)>] CustomRuleResponse data, response status code and response headers + def get_custom_rule_with_http_info(ruleset_name, rule_name, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_custom_rule".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_custom_rule") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_custom_rule")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.get_custom_rule ...' + end + # verify the required parameter 'ruleset_name' is set + if @api_client.config.client_side_validation && ruleset_name.nil? + fail ArgumentError, "Missing the required parameter 'ruleset_name' when calling StaticAnalysisAPI.get_custom_rule" + end + # verify the required parameter 'rule_name' is set + if @api_client.config.client_side_validation && rule_name.nil? + fail ArgumentError, "Missing the required parameter 'rule_name' when calling StaticAnalysisAPI.get_custom_rule" + end + # resource path + local_var_path = '/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}'.sub('{ruleset_name}', CGI.escape(ruleset_name.to_s).gsub('%2F', '/')).sub('{rule_name}', CGI.escape(rule_name.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'CustomRuleResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_custom_rule, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: StaticAnalysisAPI#get_custom_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Show Custom Rule Revision. + # + # @see #get_custom_rule_revision_with_http_info + def get_custom_rule_revision(ruleset_name, rule_name, id, opts = {}) + data, _status_code, _headers = get_custom_rule_revision_with_http_info(ruleset_name, rule_name, id, opts) + data + end + + # Show Custom Rule Revision. + # + # Get a specific revision of a custom rule + # + # @param ruleset_name [String] The ruleset name + # @param rule_name [String] The rule name + # @param id [String] The revision ID + # @param opts [Hash] the optional parameters + # @return [Array<(CustomRuleRevisionResponse, Integer, Hash)>] CustomRuleRevisionResponse data, response status code and response headers + def get_custom_rule_revision_with_http_info(ruleset_name, rule_name, id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_custom_rule_revision".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_custom_rule_revision") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_custom_rule_revision")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.get_custom_rule_revision ...' + end + # verify the required parameter 'ruleset_name' is set + if @api_client.config.client_side_validation && ruleset_name.nil? + fail ArgumentError, "Missing the required parameter 'ruleset_name' when calling StaticAnalysisAPI.get_custom_rule_revision" + end + # verify the required parameter 'rule_name' is set + if @api_client.config.client_side_validation && rule_name.nil? + fail ArgumentError, "Missing the required parameter 'rule_name' when calling StaticAnalysisAPI.get_custom_rule_revision" + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling StaticAnalysisAPI.get_custom_rule_revision" + end + # resource path + local_var_path = '/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}/revisions/{id}'.sub('{ruleset_name}', CGI.escape(ruleset_name.to_s).gsub('%2F', '/')).sub('{rule_name}', CGI.escape(rule_name.to_s).gsub('%2F', '/')).sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'CustomRuleRevisionResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_custom_rule_revision, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: StaticAnalysisAPI#get_custom_rule_revision\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Show Custom Ruleset. + # + # @see #get_custom_ruleset_with_http_info + def get_custom_ruleset(ruleset_name, opts = {}) + data, _status_code, _headers = get_custom_ruleset_with_http_info(ruleset_name, opts) + data + end + + # Show Custom Ruleset. + # + # Get a custom ruleset by name + # + # @param ruleset_name [String] The ruleset name + # @param opts [Hash] the optional parameters + # @return [Array<(CustomRulesetResponse, Integer, Hash)>] CustomRulesetResponse data, response status code and response headers + def get_custom_ruleset_with_http_info(ruleset_name, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_custom_ruleset".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_custom_ruleset") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_custom_rule")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_custom_ruleset")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.delete_custom_rule ...' + @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.get_custom_ruleset ...' end # verify the required parameter 'ruleset_name' is set if @api_client.config.client_side_validation && ruleset_name.nil? - fail ArgumentError, "Missing the required parameter 'ruleset_name' when calling StaticAnalysisAPI.delete_custom_rule" - end - # verify the required parameter 'rule_name' is set - if @api_client.config.client_side_validation && rule_name.nil? - fail ArgumentError, "Missing the required parameter 'rule_name' when calling StaticAnalysisAPI.delete_custom_rule" + fail ArgumentError, "Missing the required parameter 'ruleset_name' when calling StaticAnalysisAPI.get_custom_ruleset" end # resource path - local_var_path = '/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}'.sub('{ruleset_name}', CGI.escape(ruleset_name.to_s).gsub('%2F', '/')).sub('{rule_name}', CGI.escape(rule_name.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/static-analysis/custom/rulesets/{ruleset_name}'.sub('{ruleset_name}', CGI.escape(ruleset_name.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -368,7 +1493,7 @@ def delete_custom_rule_with_http_info(ruleset_name, rule_name, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} @@ -377,13 +1502,13 @@ def delete_custom_rule_with_http_info(ruleset_name, rule_name, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'CustomRulesetResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :delete_custom_rule, + :operation => :get_custom_ruleset, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -393,53 +1518,62 @@ def delete_custom_rule_with_http_info(ruleset_name, rule_name, opts = {}) :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: StaticAnalysisAPI#delete_custom_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: StaticAnalysisAPI#get_custom_ruleset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Delete Custom Ruleset. + # List AI custom rule revisions. # - # @see #delete_custom_ruleset_with_http_info - def delete_custom_ruleset(ruleset_name, opts = {}) - delete_custom_ruleset_with_http_info(ruleset_name, opts) - nil + # @see #list_ai_custom_rule_revisions_with_http_info + def list_ai_custom_rule_revisions(ruleset_name, rule_name, opts = {}) + data, _status_code, _headers = list_ai_custom_rule_revisions_with_http_info(ruleset_name, rule_name, opts) + data end - # Delete Custom Ruleset. + # List AI custom rule revisions. # - # Delete a custom ruleset + # Get all revisions for an AI custom rule. # - # @param ruleset_name [String] The ruleset name + # @param ruleset_name [String] The ruleset name. + # @param rule_name [String] The rule name. # @param opts [Hash] the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_custom_ruleset_with_http_info(ruleset_name, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.delete_custom_ruleset".to_sym] + # @option opts [Integer] :page_offset The offset for pagination. + # @option opts [Integer] :page_limit The maximum number of revisions to return. + # @return [Array<(AiCustomRuleRevisionsResponse, Integer, Hash)>] AiCustomRuleRevisionsResponse data, response status code and response headers + def list_ai_custom_rule_revisions_with_http_info(ruleset_name, rule_name, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_ai_custom_rule_revisions".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_custom_ruleset") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_ai_custom_rule_revisions") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_custom_ruleset")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_ai_custom_rule_revisions")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.delete_custom_ruleset ...' + @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.list_ai_custom_rule_revisions ...' end # verify the required parameter 'ruleset_name' is set if @api_client.config.client_side_validation && ruleset_name.nil? - fail ArgumentError, "Missing the required parameter 'ruleset_name' when calling StaticAnalysisAPI.delete_custom_ruleset" + fail ArgumentError, "Missing the required parameter 'ruleset_name' when calling StaticAnalysisAPI.list_ai_custom_rule_revisions" + end + # verify the required parameter 'rule_name' is set + if @api_client.config.client_side_validation && rule_name.nil? + fail ArgumentError, "Missing the required parameter 'rule_name' when calling StaticAnalysisAPI.list_ai_custom_rule_revisions" end # resource path - local_var_path = '/api/v2/static-analysis/custom/rulesets/{ruleset_name}'.sub('{ruleset_name}', CGI.escape(ruleset_name.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/static-analysis/ai/rulesets/{ruleset_name}/rules/{rule_name}/revisions'.sub('{ruleset_name}', CGI.escape(ruleset_name.to_s).gsub('%2F', '/')).sub('{rule_name}', CGI.escape(rule_name.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} + query_params[:'page[offset]'] = opts[:'page_offset'] if !opts[:'page_offset'].nil? + query_params[:'page[limit]'] = opts[:'page_limit'] if !opts[:'page_limit'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} @@ -448,13 +1582,13 @@ def delete_custom_ruleset_with_http_info(ruleset_name, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'AiCustomRuleRevisionsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :delete_custom_ruleset, + :operation => :list_ai_custom_rule_revisions, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -464,53 +1598,68 @@ def delete_custom_ruleset_with_http_info(ruleset_name, opts = {}) :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: StaticAnalysisAPI#delete_custom_ruleset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: StaticAnalysisAPI#list_ai_custom_rule_revisions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Show Custom Rule. + # List AI custom rule revisions. # - # @see #get_custom_rule_with_http_info - def get_custom_rule(ruleset_name, rule_name, opts = {}) - data, _status_code, _headers = get_custom_rule_with_http_info(ruleset_name, rule_name, opts) + # Provide a paginated version of {#list_ai_custom_rule_revisions}, returning all items. + # + # To use it you need to use a block: list_ai_custom_rule_revisions_with_pagination { |item| p item } + # + # @yield [AiCustomRuleRevisionResponseData] Paginated items + def list_ai_custom_rule_revisions_with_pagination(ruleset_name, rule_name, opts = {}) + api_version = "V2" + page_size = @api_client.get_attribute_from_path(opts, "page_limit", 100) + @api_client.set_attribute_from_path(api_version, opts, "page_limit", Integer, page_size) + while true do + response = list_ai_custom_rule_revisions(ruleset_name, rule_name, opts) + @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } + if @api_client.get_attribute_from_path(response, "data").length < page_size + break + end + @api_client.set_attribute_from_path(api_version, opts, "page_offset", Integer, @api_client.get_attribute_from_path(opts, "page_offset", 0) + page_size) + end + end + + # List AI custom rulesets. + # + # @see #list_ai_custom_rulesets_with_http_info + def list_ai_custom_rulesets(opts = {}) + data, _status_code, _headers = list_ai_custom_rulesets_with_http_info(opts) data end - # Show Custom Rule. + # List AI custom rulesets. # - # Get a custom rule by name + # Get all AI custom rulesets for the authenticated organization. # - # @param ruleset_name [String] The ruleset name - # @param rule_name [String] The rule name # @param opts [Hash] the optional parameters - # @return [Array<(CustomRuleResponse, Integer, Hash)>] CustomRuleResponse data, response status code and response headers - def get_custom_rule_with_http_info(ruleset_name, rule_name, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.get_custom_rule".to_sym] + # @option opts [Integer] :page_offset The offset for pagination. + # @option opts [Integer] :page_limit The maximum number of rulesets to return. + # @return [Array<(AiCustomRulesetsResponse, Integer, Hash)>] AiCustomRulesetsResponse data, response status code and response headers + def list_ai_custom_rulesets_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_ai_custom_rulesets".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_custom_rule") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_ai_custom_rulesets") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_custom_rule")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_ai_custom_rulesets")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.get_custom_rule ...' - end - # verify the required parameter 'ruleset_name' is set - if @api_client.config.client_side_validation && ruleset_name.nil? - fail ArgumentError, "Missing the required parameter 'ruleset_name' when calling StaticAnalysisAPI.get_custom_rule" - end - # verify the required parameter 'rule_name' is set - if @api_client.config.client_side_validation && rule_name.nil? - fail ArgumentError, "Missing the required parameter 'rule_name' when calling StaticAnalysisAPI.get_custom_rule" + @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.list_ai_custom_rulesets ...' end # resource path - local_var_path = '/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}'.sub('{ruleset_name}', CGI.escape(ruleset_name.to_s).gsub('%2F', '/')).sub('{rule_name}', CGI.escape(rule_name.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/static-analysis/ai/rulesets' # query parameters query_params = opts[:query_params] || {} + query_params[:'page[offset]'] = opts[:'page_offset'] if !opts[:'page_offset'].nil? + query_params[:'page[limit]'] = opts[:'page_limit'] if !opts[:'page_limit'].nil? # header parameters header_params = opts[:header_params] || {} @@ -524,13 +1673,13 @@ def get_custom_rule_with_http_info(ruleset_name, rule_name, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'CustomRuleResponse' + return_type = opts[:debug_return_type] || 'AiCustomRulesetsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :get_custom_rule, + :operation => :list_ai_custom_rulesets, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -542,53 +1691,38 @@ def get_custom_rule_with_http_info(ruleset_name, rule_name, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: StaticAnalysisAPI#get_custom_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: StaticAnalysisAPI#list_ai_custom_rulesets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Show Custom Rule Revision. + # List AI memory violation results. # - # @see #get_custom_rule_revision_with_http_info - def get_custom_rule_revision(ruleset_name, rule_name, id, opts = {}) - data, _status_code, _headers = get_custom_rule_revision_with_http_info(ruleset_name, rule_name, id, opts) + # @see #list_ai_memory_violation_results_with_http_info + def list_ai_memory_violation_results(opts = {}) + data, _status_code, _headers = list_ai_memory_violation_results_with_http_info(opts) data end - # Show Custom Rule Revision. + # List AI memory violation results. # - # Get a specific revision of a custom rule + # Get all AI memory violation results for the authenticated organization. # - # @param ruleset_name [String] The ruleset name - # @param rule_name [String] The rule name - # @param id [String] The revision ID # @param opts [Hash] the optional parameters - # @return [Array<(CustomRuleRevisionResponse, Integer, Hash)>] CustomRuleRevisionResponse data, response status code and response headers - def get_custom_rule_revision_with_http_info(ruleset_name, rule_name, id, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.get_custom_rule_revision".to_sym] + # @return [Array<(AiMemoryViolationResultsResponse, Integer, Hash)>] AiMemoryViolationResultsResponse data, response status code and response headers + def list_ai_memory_violation_results_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_ai_memory_violation_results".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_custom_rule_revision") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_ai_memory_violation_results") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_custom_rule_revision")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_ai_memory_violation_results")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.get_custom_rule_revision ...' - end - # verify the required parameter 'ruleset_name' is set - if @api_client.config.client_side_validation && ruleset_name.nil? - fail ArgumentError, "Missing the required parameter 'ruleset_name' when calling StaticAnalysisAPI.get_custom_rule_revision" - end - # verify the required parameter 'rule_name' is set - if @api_client.config.client_side_validation && rule_name.nil? - fail ArgumentError, "Missing the required parameter 'rule_name' when calling StaticAnalysisAPI.get_custom_rule_revision" - end - # verify the required parameter 'id' is set - if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling StaticAnalysisAPI.get_custom_rule_revision" + @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.list_ai_memory_violation_results ...' end # resource path - local_var_path = '/api/v2/static-analysis/custom/rulesets/{ruleset_name}/rules/{rule_name}/revisions/{id}'.sub('{ruleset_name}', CGI.escape(ruleset_name.to_s).gsub('%2F', '/')).sub('{rule_name}', CGI.escape(rule_name.to_s).gsub('%2F', '/')).sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/static-analysis/ai/memory' # query parameters query_params = opts[:query_params] || {} @@ -605,13 +1739,13 @@ def get_custom_rule_revision_with_http_info(ruleset_name, rule_name, id, opts = post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'CustomRuleRevisionResponse' + return_type = opts[:debug_return_type] || 'AiMemoryViolationResultsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :get_custom_rule_revision, + :operation => :list_ai_memory_violation_results, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -623,43 +1757,38 @@ def get_custom_rule_revision_with_http_info(ruleset_name, rule_name, id, opts = data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: StaticAnalysisAPI#get_custom_rule_revision\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: StaticAnalysisAPI#list_ai_memory_violation_results\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Show Custom Ruleset. + # List AI prompts. # - # @see #get_custom_ruleset_with_http_info - def get_custom_ruleset(ruleset_name, opts = {}) - data, _status_code, _headers = get_custom_ruleset_with_http_info(ruleset_name, opts) + # @see #list_ai_prompts_with_http_info + def list_ai_prompts(opts = {}) + data, _status_code, _headers = list_ai_prompts_with_http_info(opts) data end - # Show Custom Ruleset. + # List AI prompts. # - # Get a custom ruleset by name + # Get all AI prompts, including default prompts and custom AI rule prompts for the authenticated organization. # - # @param ruleset_name [String] The ruleset name # @param opts [Hash] the optional parameters - # @return [Array<(CustomRulesetResponse, Integer, Hash)>] CustomRulesetResponse data, response status code and response headers - def get_custom_ruleset_with_http_info(ruleset_name, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.get_custom_ruleset".to_sym] + # @return [Array<(AiPromptsResponse, Integer, Hash)>] AiPromptsResponse data, response status code and response headers + def list_ai_prompts_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_ai_prompts".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_custom_ruleset") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_ai_prompts") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_custom_ruleset")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_ai_prompts")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.get_custom_ruleset ...' - end - # verify the required parameter 'ruleset_name' is set - if @api_client.config.client_side_validation && ruleset_name.nil? - fail ArgumentError, "Missing the required parameter 'ruleset_name' when calling StaticAnalysisAPI.get_custom_ruleset" + @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.list_ai_prompts ...' end # resource path - local_var_path = '/api/v2/static-analysis/custom/rulesets/{ruleset_name}'.sub('{ruleset_name}', CGI.escape(ruleset_name.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/static-analysis/ai/prompts' # query parameters query_params = opts[:query_params] || {} @@ -676,13 +1805,13 @@ def get_custom_ruleset_with_http_info(ruleset_name, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'CustomRulesetResponse' + return_type = opts[:debug_return_type] || 'AiPromptsResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :get_custom_ruleset, + :operation => :list_ai_prompts, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -694,7 +1823,7 @@ def get_custom_ruleset_with_http_info(ruleset_name, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: StaticAnalysisAPI#get_custom_ruleset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: StaticAnalysisAPI#list_ai_prompts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end @@ -800,6 +1929,72 @@ def list_custom_rule_revisions_with_pagination(ruleset_name, rule_name, opts = { end end + # List Custom Rulesets. + # + # @see #list_custom_rulesets_with_http_info + def list_custom_rulesets(opts = {}) + data, _status_code, _headers = list_custom_rulesets_with_http_info(opts) + data + end + + # List Custom Rulesets. + # + # Get all custom rulesets for the authenticated organization. + # + # @param opts [Hash] the optional parameters + # @return [Array<(CustomRulesetListResponse, Integer, Hash)>] CustomRulesetListResponse data, response status code and response headers + def list_custom_rulesets_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_custom_rulesets".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_custom_rulesets") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_custom_rulesets")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.list_custom_rulesets ...' + end + # resource path + local_var_path = '/api/v2/static-analysis/custom/rulesets' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'CustomRulesetListResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_custom_rulesets, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: StaticAnalysisAPI#list_custom_rulesets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Revert Custom Rule Revision. # # @see #revert_custom_rule_revision_with_http_info @@ -883,6 +2078,84 @@ def revert_custom_rule_revision_with_http_info(ruleset_name, rule_name, body, op return data, status_code, headers end + # Update an AI custom ruleset. + # + # @see #update_ai_custom_ruleset_with_http_info + def update_ai_custom_ruleset(ruleset_name, body, opts = {}) + update_ai_custom_ruleset_with_http_info(ruleset_name, body, opts) + nil + end + + # Update an AI custom ruleset. + # + # Update the description of an existing AI custom ruleset. + # + # @param ruleset_name [String] The ruleset name. + # @param body [AiCustomRulesetUpdateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_ai_custom_ruleset_with_http_info(ruleset_name, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_ai_custom_ruleset".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_ai_custom_ruleset") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_ai_custom_ruleset")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: StaticAnalysisAPI.update_ai_custom_ruleset ...' + end + # verify the required parameter 'ruleset_name' is set + if @api_client.config.client_side_validation && ruleset_name.nil? + fail ArgumentError, "Missing the required parameter 'ruleset_name' when calling StaticAnalysisAPI.update_ai_custom_ruleset" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling StaticAnalysisAPI.update_ai_custom_ruleset" + end + # resource path + local_var_path = '/api/v2/static-analysis/ai/rulesets/{ruleset_name}'.sub('{ruleset_name}', CGI.escape(ruleset_name.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_ai_custom_ruleset, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: StaticAnalysisAPI#update_ai_custom_ruleset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Update Custom Ruleset. # # @see #update_custom_ruleset_with_http_info diff --git a/lib/datadog_api_client/v2/models/ai_custom_rule_data_type.rb b/lib/datadog_api_client/v2/models/ai_custom_rule_data_type.rb new file mode 100644 index 000000000000..bcc21517e10e --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_custom_rule_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AI custom rule resource type. + class AiCustomRuleDataType + include BaseEnumModel + + AI_RULE = "ai_rule".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/ai_custom_rule_item.rb b/lib/datadog_api_client/v2/models/ai_custom_rule_item.rb new file mode 100644 index 000000000000..c184bef3e21f --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_custom_rule_item.rb @@ -0,0 +1,186 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # An AI custom rule embedded within a ruleset response. + class AiCustomRuleItem + include BaseGenericModel + + # The creation timestamp. + attr_reader :created_at + + # The identifier of the user who created the rule. + attr_reader :created_by + + # Response attributes of an AI custom rule revision. + attr_reader :last_revision + + # The rule name. + attr_reader :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_at' => :'created_at', + :'created_by' => :'created_by', + :'last_revision' => :'last_revision', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Time', + :'created_by' => :'String', + :'last_revision' => :'AiCustomRuleRevisionResponseAttributes', + :'name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AiCustomRuleItem` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'created_by') + self.created_by = attributes[:'created_by'] + end + + if attributes.key?(:'last_revision') + self.last_revision = attributes[:'last_revision'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @created_at.nil? + return false if @created_by.nil? + return false if @last_revision.nil? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param created_by [Object] Object to be assigned + # @!visibility private + def created_by=(created_by) + if created_by.nil? + fail ArgumentError, 'invalid value for "created_by", created_by cannot be nil.' + end + @created_by = created_by + end + + # Custom attribute writer method with validation + # @param last_revision [Object] Object to be assigned + # @!visibility private + def last_revision=(last_revision) + if last_revision.nil? + fail ArgumentError, 'invalid value for "last_revision", last_revision cannot be nil.' + end + @last_revision = last_revision + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_at == o.created_at && + created_by == o.created_by && + last_revision == o.last_revision && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, created_by, last_revision, name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ai_custom_rule_request.rb b/lib/datadog_api_client/v2/models/ai_custom_rule_request.rb new file mode 100644 index 000000000000..b7d97ca104ca --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_custom_rule_request.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request body for creating an AI custom rule. + class AiCustomRuleRequest + include BaseGenericModel + + # Request data for creating an AI custom rule. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'AiCustomRuleRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AiCustomRuleRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ai_custom_rule_request_attributes.rb b/lib/datadog_api_client/v2/models/ai_custom_rule_request_attributes.rb new file mode 100644 index 000000000000..99c9f98c4d08 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_custom_rule_request_attributes.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for creating an AI custom rule. + class AiCustomRuleRequestAttributes + include BaseGenericModel + + # The rule name. + attr_accessor :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AiCustomRuleRequestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ai_custom_rule_request_data.rb b/lib/datadog_api_client/v2/models/ai_custom_rule_request_data.rb new file mode 100644 index 000000000000..8740a55e1a07 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_custom_rule_request_data.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request data for creating an AI custom rule. + class AiCustomRuleRequestData + include BaseGenericModel + + # Attributes for creating an AI custom rule. + attr_accessor :attributes + + # The rule identifier, which must match the name. + attr_accessor :id + + # AI custom rule resource type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AiCustomRuleRequestAttributes', + :'id' => :'String', + :'type' => :'AiCustomRuleDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AiCustomRuleRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ai_custom_rule_response.rb b/lib/datadog_api_client/v2/models/ai_custom_rule_response.rb new file mode 100644 index 000000000000..dc5ae710e6d7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_custom_rule_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a single AI custom rule. + class AiCustomRuleResponse + include BaseGenericModel + + # Response data for an AI custom rule. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'AiCustomRuleResponseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AiCustomRuleResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ai_custom_rule_response_data.rb b/lib/datadog_api_client/v2/models/ai_custom_rule_response_data.rb new file mode 100644 index 000000000000..b072876f3577 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_custom_rule_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response data for an AI custom rule. + class AiCustomRuleResponseData + include BaseGenericModel + + # An AI custom rule embedded within a ruleset response. + attr_reader :attributes + + # The rule identifier. + attr_reader :id + + # AI custom rule resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AiCustomRuleItem', + :'id' => :'String', + :'type' => :'AiCustomRuleDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AiCustomRuleResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ai_custom_rule_revision_data_type.rb b/lib/datadog_api_client/v2/models/ai_custom_rule_revision_data_type.rb new file mode 100644 index 000000000000..ea2c23377b90 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_custom_rule_revision_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AI custom rule revision resource type. + class AiCustomRuleRevisionDataType + include BaseEnumModel + + AI_RULE_REVISION = "ai_rule_revision".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/ai_custom_rule_revision_execution_mode.rb b/lib/datadog_api_client/v2/models/ai_custom_rule_revision_execution_mode.rb new file mode 100644 index 000000000000..03143f2fe4da --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_custom_rule_revision_execution_mode.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The execution mode for an AI rule revision. + class AiCustomRuleRevisionExecutionMode + include BaseEnumModel + + AUTO = "auto".freeze + MANUAL = "manual".freeze + ALWAYS = "always".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/ai_custom_rule_revision_request.rb b/lib/datadog_api_client/v2/models/ai_custom_rule_revision_request.rb new file mode 100644 index 000000000000..7ff93be3c114 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_custom_rule_revision_request.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request body for creating an AI custom rule revision. + class AiCustomRuleRevisionRequest + include BaseGenericModel + + # Request data for creating an AI custom rule revision. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'AiCustomRuleRevisionRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AiCustomRuleRevisionRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ai_custom_rule_revision_request_attributes.rb b/lib/datadog_api_client/v2/models/ai_custom_rule_revision_request_attributes.rb new file mode 100644 index 000000000000..280c1f8158c9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_custom_rule_revision_request_attributes.rb @@ -0,0 +1,344 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for creating an AI custom rule revision. + class AiCustomRuleRevisionRequestAttributes + include BaseGenericModel + + # Rule category + attr_reader :category + + # Base64-encoded AI model content for this revision. + attr_reader :content + + # The associated CWE identifier. + attr_accessor :cwe + + # Base64-encoded full description. + attr_reader :description + + # Directory patterns this rule applies to. + attr_reader :directories + + # The execution mode for an AI rule revision. + attr_reader :execution_mode + + # File glob patterns this rule applies to. + attr_reader :globs + + # Whether this revision is published. + attr_reader :is_published + + # Whether this revision is for testing only. + attr_reader :is_testing + + # Rule severity + attr_reader :severity + + # Base64-encoded short description. + attr_reader :short_description + + # The version identifier for this revision. + attr_accessor :version_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'category' => :'category', + :'content' => :'content', + :'cwe' => :'cwe', + :'description' => :'description', + :'directories' => :'directories', + :'execution_mode' => :'execution_mode', + :'globs' => :'globs', + :'is_published' => :'is_published', + :'is_testing' => :'is_testing', + :'severity' => :'severity', + :'short_description' => :'short_description', + :'version_id' => :'version_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'category' => :'CustomRuleRevisionAttributesCategory', + :'content' => :'String', + :'cwe' => :'String', + :'description' => :'String', + :'directories' => :'Array', + :'execution_mode' => :'AiCustomRuleRevisionExecutionMode', + :'globs' => :'Array', + :'is_published' => :'Boolean', + :'is_testing' => :'Boolean', + :'severity' => :'CustomRuleRevisionAttributesSeverity', + :'short_description' => :'String', + :'version_id' => :'Integer' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'cwe', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AiCustomRuleRevisionRequestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'category') + self.category = attributes[:'category'] + end + + if attributes.key?(:'content') + self.content = attributes[:'content'] + end + + if attributes.key?(:'cwe') + self.cwe = attributes[:'cwe'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'directories') + if (value = attributes[:'directories']).is_a?(Array) + self.directories = value + end + end + + if attributes.key?(:'execution_mode') + self.execution_mode = attributes[:'execution_mode'] + end + + if attributes.key?(:'globs') + if (value = attributes[:'globs']).is_a?(Array) + self.globs = value + end + end + + if attributes.key?(:'is_published') + self.is_published = attributes[:'is_published'] + end + + if attributes.key?(:'is_testing') + self.is_testing = attributes[:'is_testing'] + end + + if attributes.key?(:'severity') + self.severity = attributes[:'severity'] + end + + if attributes.key?(:'short_description') + self.short_description = attributes[:'short_description'] + end + + if attributes.key?(:'version_id') + self.version_id = attributes[:'version_id'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @category.nil? + return false if @content.nil? + return false if @description.nil? + return false if @directories.nil? + return false if @execution_mode.nil? + return false if @globs.nil? + return false if @is_published.nil? + return false if @is_testing.nil? + return false if @severity.nil? + return false if @short_description.nil? + true + end + + # Custom attribute writer method with validation + # @param category [Object] Object to be assigned + # @!visibility private + def category=(category) + if category.nil? + fail ArgumentError, 'invalid value for "category", category cannot be nil.' + end + @category = category + end + + # Custom attribute writer method with validation + # @param content [Object] Object to be assigned + # @!visibility private + def content=(content) + if content.nil? + fail ArgumentError, 'invalid value for "content", content cannot be nil.' + end + @content = content + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if description.nil? + fail ArgumentError, 'invalid value for "description", description cannot be nil.' + end + @description = description + end + + # Custom attribute writer method with validation + # @param directories [Object] Object to be assigned + # @!visibility private + def directories=(directories) + if directories.nil? + fail ArgumentError, 'invalid value for "directories", directories cannot be nil.' + end + @directories = directories + end + + # Custom attribute writer method with validation + # @param execution_mode [Object] Object to be assigned + # @!visibility private + def execution_mode=(execution_mode) + if execution_mode.nil? + fail ArgumentError, 'invalid value for "execution_mode", execution_mode cannot be nil.' + end + @execution_mode = execution_mode + end + + # Custom attribute writer method with validation + # @param globs [Object] Object to be assigned + # @!visibility private + def globs=(globs) + if globs.nil? + fail ArgumentError, 'invalid value for "globs", globs cannot be nil.' + end + @globs = globs + end + + # Custom attribute writer method with validation + # @param is_published [Object] Object to be assigned + # @!visibility private + def is_published=(is_published) + if is_published.nil? + fail ArgumentError, 'invalid value for "is_published", is_published cannot be nil.' + end + @is_published = is_published + end + + # Custom attribute writer method with validation + # @param is_testing [Object] Object to be assigned + # @!visibility private + def is_testing=(is_testing) + if is_testing.nil? + fail ArgumentError, 'invalid value for "is_testing", is_testing cannot be nil.' + end + @is_testing = is_testing + end + + # Custom attribute writer method with validation + # @param severity [Object] Object to be assigned + # @!visibility private + def severity=(severity) + if severity.nil? + fail ArgumentError, 'invalid value for "severity", severity cannot be nil.' + end + @severity = severity + end + + # Custom attribute writer method with validation + # @param short_description [Object] Object to be assigned + # @!visibility private + def short_description=(short_description) + if short_description.nil? + fail ArgumentError, 'invalid value for "short_description", short_description cannot be nil.' + end + @short_description = short_description + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + category == o.category && + content == o.content && + cwe == o.cwe && + description == o.description && + directories == o.directories && + execution_mode == o.execution_mode && + globs == o.globs && + is_published == o.is_published && + is_testing == o.is_testing && + severity == o.severity && + short_description == o.short_description && + version_id == o.version_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [category, content, cwe, description, directories, execution_mode, globs, is_published, is_testing, severity, short_description, version_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ai_custom_rule_revision_request_data.rb b/lib/datadog_api_client/v2/models/ai_custom_rule_revision_request_data.rb new file mode 100644 index 000000000000..7cf6667cb737 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_custom_rule_revision_request_data.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request data for creating an AI custom rule revision. + class AiCustomRuleRevisionRequestData + include BaseGenericModel + + # Attributes for creating an AI custom rule revision. + attr_accessor :attributes + + # The revision identifier. + attr_accessor :id + + # AI custom rule revision resource type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AiCustomRuleRevisionRequestAttributes', + :'id' => :'String', + :'type' => :'AiCustomRuleRevisionDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AiCustomRuleRevisionRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ai_custom_rule_revision_response.rb b/lib/datadog_api_client/v2/models/ai_custom_rule_revision_response.rb new file mode 100644 index 000000000000..1eeeef205dbf --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_custom_rule_revision_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a single AI custom rule revision. + class AiCustomRuleRevisionResponse + include BaseGenericModel + + # Response data for an AI custom rule revision. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'AiCustomRuleRevisionResponseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AiCustomRuleRevisionResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ai_custom_rule_revision_response_attributes.rb b/lib/datadog_api_client/v2/models/ai_custom_rule_revision_response_attributes.rb new file mode 100644 index 000000000000..5b074e91ea48 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_custom_rule_revision_response_attributes.rb @@ -0,0 +1,439 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response attributes of an AI custom rule revision. + class AiCustomRuleRevisionResponseAttributes + include BaseGenericModel + + # Rule category + attr_reader :category + + # Checksum of the revision content. + attr_reader :checksum + + # Base64-encoded AI model content for this revision. + attr_reader :content + + # The creation timestamp. + attr_reader :created_at + + # The identifier of the user who created the revision. + attr_reader :created_by + + # The associated CWE identifier. + attr_accessor :cwe + + # Base64-encoded full description. + attr_reader :description + + # Directory patterns this rule applies to. + attr_reader :directories + + # The execution mode for an AI rule revision. + attr_reader :execution_mode + + # File glob patterns this rule applies to. + attr_reader :globs + + # Whether this is a default Datadog rule. + attr_reader :is_default + + # Whether this revision is published. + attr_reader :is_published + + # Whether this revision is for testing only. + attr_reader :is_testing + + # Rule severity + attr_reader :severity + + # Base64-encoded short description. + attr_reader :short_description + + # The version identifier for this revision. + attr_reader :version_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'category' => :'category', + :'checksum' => :'checksum', + :'content' => :'content', + :'created_at' => :'created_at', + :'created_by' => :'created_by', + :'cwe' => :'cwe', + :'description' => :'description', + :'directories' => :'directories', + :'execution_mode' => :'execution_mode', + :'globs' => :'globs', + :'is_default' => :'is_default', + :'is_published' => :'is_published', + :'is_testing' => :'is_testing', + :'severity' => :'severity', + :'short_description' => :'short_description', + :'version_id' => :'version_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'category' => :'CustomRuleRevisionAttributesCategory', + :'checksum' => :'String', + :'content' => :'String', + :'created_at' => :'Time', + :'created_by' => :'String', + :'cwe' => :'String', + :'description' => :'String', + :'directories' => :'Array', + :'execution_mode' => :'AiCustomRuleRevisionExecutionMode', + :'globs' => :'Array', + :'is_default' => :'Boolean', + :'is_published' => :'Boolean', + :'is_testing' => :'Boolean', + :'severity' => :'CustomRuleRevisionAttributesSeverity', + :'short_description' => :'String', + :'version_id' => :'Integer' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'cwe', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AiCustomRuleRevisionResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'category') + self.category = attributes[:'category'] + end + + if attributes.key?(:'checksum') + self.checksum = attributes[:'checksum'] + end + + if attributes.key?(:'content') + self.content = attributes[:'content'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'created_by') + self.created_by = attributes[:'created_by'] + end + + if attributes.key?(:'cwe') + self.cwe = attributes[:'cwe'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'directories') + if (value = attributes[:'directories']).is_a?(Array) + self.directories = value + end + end + + if attributes.key?(:'execution_mode') + self.execution_mode = attributes[:'execution_mode'] + end + + if attributes.key?(:'globs') + if (value = attributes[:'globs']).is_a?(Array) + self.globs = value + end + end + + if attributes.key?(:'is_default') + self.is_default = attributes[:'is_default'] + end + + if attributes.key?(:'is_published') + self.is_published = attributes[:'is_published'] + end + + if attributes.key?(:'is_testing') + self.is_testing = attributes[:'is_testing'] + end + + if attributes.key?(:'severity') + self.severity = attributes[:'severity'] + end + + if attributes.key?(:'short_description') + self.short_description = attributes[:'short_description'] + end + + if attributes.key?(:'version_id') + self.version_id = attributes[:'version_id'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @category.nil? + return false if @checksum.nil? + return false if @content.nil? + return false if @created_at.nil? + return false if @created_by.nil? + return false if @description.nil? + return false if @directories.nil? + return false if @execution_mode.nil? + return false if @globs.nil? + return false if @is_default.nil? + return false if @is_published.nil? + return false if @is_testing.nil? + return false if @severity.nil? + return false if @short_description.nil? + return false if @version_id.nil? + true + end + + # Custom attribute writer method with validation + # @param category [Object] Object to be assigned + # @!visibility private + def category=(category) + if category.nil? + fail ArgumentError, 'invalid value for "category", category cannot be nil.' + end + @category = category + end + + # Custom attribute writer method with validation + # @param checksum [Object] Object to be assigned + # @!visibility private + def checksum=(checksum) + if checksum.nil? + fail ArgumentError, 'invalid value for "checksum", checksum cannot be nil.' + end + @checksum = checksum + end + + # Custom attribute writer method with validation + # @param content [Object] Object to be assigned + # @!visibility private + def content=(content) + if content.nil? + fail ArgumentError, 'invalid value for "content", content cannot be nil.' + end + @content = content + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param created_by [Object] Object to be assigned + # @!visibility private + def created_by=(created_by) + if created_by.nil? + fail ArgumentError, 'invalid value for "created_by", created_by cannot be nil.' + end + @created_by = created_by + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if description.nil? + fail ArgumentError, 'invalid value for "description", description cannot be nil.' + end + @description = description + end + + # Custom attribute writer method with validation + # @param directories [Object] Object to be assigned + # @!visibility private + def directories=(directories) + if directories.nil? + fail ArgumentError, 'invalid value for "directories", directories cannot be nil.' + end + @directories = directories + end + + # Custom attribute writer method with validation + # @param execution_mode [Object] Object to be assigned + # @!visibility private + def execution_mode=(execution_mode) + if execution_mode.nil? + fail ArgumentError, 'invalid value for "execution_mode", execution_mode cannot be nil.' + end + @execution_mode = execution_mode + end + + # Custom attribute writer method with validation + # @param globs [Object] Object to be assigned + # @!visibility private + def globs=(globs) + if globs.nil? + fail ArgumentError, 'invalid value for "globs", globs cannot be nil.' + end + @globs = globs + end + + # Custom attribute writer method with validation + # @param is_default [Object] Object to be assigned + # @!visibility private + def is_default=(is_default) + if is_default.nil? + fail ArgumentError, 'invalid value for "is_default", is_default cannot be nil.' + end + @is_default = is_default + end + + # Custom attribute writer method with validation + # @param is_published [Object] Object to be assigned + # @!visibility private + def is_published=(is_published) + if is_published.nil? + fail ArgumentError, 'invalid value for "is_published", is_published cannot be nil.' + end + @is_published = is_published + end + + # Custom attribute writer method with validation + # @param is_testing [Object] Object to be assigned + # @!visibility private + def is_testing=(is_testing) + if is_testing.nil? + fail ArgumentError, 'invalid value for "is_testing", is_testing cannot be nil.' + end + @is_testing = is_testing + end + + # Custom attribute writer method with validation + # @param severity [Object] Object to be assigned + # @!visibility private + def severity=(severity) + if severity.nil? + fail ArgumentError, 'invalid value for "severity", severity cannot be nil.' + end + @severity = severity + end + + # Custom attribute writer method with validation + # @param short_description [Object] Object to be assigned + # @!visibility private + def short_description=(short_description) + if short_description.nil? + fail ArgumentError, 'invalid value for "short_description", short_description cannot be nil.' + end + @short_description = short_description + end + + # Custom attribute writer method with validation + # @param version_id [Object] Object to be assigned + # @!visibility private + def version_id=(version_id) + if version_id.nil? + fail ArgumentError, 'invalid value for "version_id", version_id cannot be nil.' + end + @version_id = version_id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + category == o.category && + checksum == o.checksum && + content == o.content && + created_at == o.created_at && + created_by == o.created_by && + cwe == o.cwe && + description == o.description && + directories == o.directories && + execution_mode == o.execution_mode && + globs == o.globs && + is_default == o.is_default && + is_published == o.is_published && + is_testing == o.is_testing && + severity == o.severity && + short_description == o.short_description && + version_id == o.version_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [category, checksum, content, created_at, created_by, cwe, description, directories, execution_mode, globs, is_default, is_published, is_testing, severity, short_description, version_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ai_custom_rule_revision_response_data.rb b/lib/datadog_api_client/v2/models/ai_custom_rule_revision_response_data.rb new file mode 100644 index 000000000000..399e86d73229 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_custom_rule_revision_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response data for an AI custom rule revision. + class AiCustomRuleRevisionResponseData + include BaseGenericModel + + # Response attributes of an AI custom rule revision. + attr_reader :attributes + + # The revision identifier. + attr_reader :id + + # AI custom rule revision resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AiCustomRuleRevisionResponseAttributes', + :'id' => :'String', + :'type' => :'AiCustomRuleRevisionDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AiCustomRuleRevisionResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ai_custom_rule_revisions_response.rb b/lib/datadog_api_client/v2/models/ai_custom_rule_revisions_response.rb new file mode 100644 index 000000000000..dd592a235412 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_custom_rule_revisions_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a list of AI custom rule revisions. + class AiCustomRuleRevisionsResponse + include BaseGenericModel + + # The list of AI custom rule revisions. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AiCustomRuleRevisionsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ai_custom_ruleset_data_type.rb b/lib/datadog_api_client/v2/models/ai_custom_ruleset_data_type.rb new file mode 100644 index 000000000000..3d7878c6105e --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_custom_ruleset_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AI custom ruleset resource type. + class AiCustomRulesetDataType + include BaseEnumModel + + AI_RULESET = "ai_ruleset".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/ai_custom_ruleset_request.rb b/lib/datadog_api_client/v2/models/ai_custom_ruleset_request.rb new file mode 100644 index 000000000000..b7bdc0bb733a --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_custom_ruleset_request.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request body for creating an AI custom ruleset. + class AiCustomRulesetRequest + include BaseGenericModel + + # Request data for creating an AI custom ruleset. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'AiCustomRulesetRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AiCustomRulesetRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ai_custom_ruleset_request_attributes.rb b/lib/datadog_api_client/v2/models/ai_custom_ruleset_request_attributes.rb new file mode 100644 index 000000000000..7798d426d1a6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_custom_ruleset_request_attributes.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for creating an AI custom ruleset. + class AiCustomRulesetRequestAttributes + include BaseGenericModel + + # Base64-encoded full description of the ruleset. + attr_reader :description + + # The ruleset name. + attr_reader :name + + # Base64-encoded short description of the ruleset. + attr_reader :short_description + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'name' => :'name', + :'short_description' => :'short_description' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'name' => :'String', + :'short_description' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AiCustomRulesetRequestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'short_description') + self.short_description = attributes[:'short_description'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @description.nil? + return false if @name.nil? + return false if @short_description.nil? + true + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if description.nil? + fail ArgumentError, 'invalid value for "description", description cannot be nil.' + end + @description = description + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param short_description [Object] Object to be assigned + # @!visibility private + def short_description=(short_description) + if short_description.nil? + fail ArgumentError, 'invalid value for "short_description", short_description cannot be nil.' + end + @short_description = short_description + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + name == o.name && + short_description == o.short_description && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, name, short_description, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ai_custom_ruleset_request_data.rb b/lib/datadog_api_client/v2/models/ai_custom_ruleset_request_data.rb new file mode 100644 index 000000000000..28b922869c76 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_custom_ruleset_request_data.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request data for creating an AI custom ruleset. + class AiCustomRulesetRequestData + include BaseGenericModel + + # Attributes for creating an AI custom ruleset. + attr_accessor :attributes + + # The ruleset identifier, which must match the name. + attr_accessor :id + + # AI custom ruleset resource type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AiCustomRulesetRequestAttributes', + :'id' => :'String', + :'type' => :'AiCustomRulesetDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AiCustomRulesetRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ai_custom_ruleset_response.rb b/lib/datadog_api_client/v2/models/ai_custom_ruleset_response.rb new file mode 100644 index 000000000000..03bbb831cf45 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_custom_ruleset_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a single AI custom ruleset. + class AiCustomRulesetResponse + include BaseGenericModel + + # Response data for an AI custom ruleset. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'AiCustomRulesetResponseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AiCustomRulesetResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ai_custom_ruleset_response_attributes.rb b/lib/datadog_api_client/v2/models/ai_custom_ruleset_response_attributes.rb new file mode 100644 index 000000000000..bdb319d371ef --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_custom_ruleset_response_attributes.rb @@ -0,0 +1,227 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response attributes of an AI custom ruleset. + class AiCustomRulesetResponseAttributes + include BaseGenericModel + + # The creation timestamp. + attr_reader :created_at + + # The identifier of the user who created the ruleset. + attr_reader :created_by + + # Base64-encoded full description of the ruleset. + attr_reader :description + + # The ruleset name. + attr_reader :name + + # The rules contained in the ruleset. + attr_accessor :rules + + # Base64-encoded short description of the ruleset. + attr_reader :short_description + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_at' => :'created_at', + :'created_by' => :'created_by', + :'description' => :'description', + :'name' => :'name', + :'rules' => :'rules', + :'short_description' => :'short_description' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Time', + :'created_by' => :'String', + :'description' => :'String', + :'name' => :'String', + :'rules' => :'Array', + :'short_description' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'rules', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AiCustomRulesetResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'created_by') + self.created_by = attributes[:'created_by'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'rules') + if (value = attributes[:'rules']).is_a?(Array) + self.rules = value + end + end + + if attributes.key?(:'short_description') + self.short_description = attributes[:'short_description'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @created_at.nil? + return false if @created_by.nil? + return false if @description.nil? + return false if @name.nil? + return false if @short_description.nil? + true + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param created_by [Object] Object to be assigned + # @!visibility private + def created_by=(created_by) + if created_by.nil? + fail ArgumentError, 'invalid value for "created_by", created_by cannot be nil.' + end + @created_by = created_by + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if description.nil? + fail ArgumentError, 'invalid value for "description", description cannot be nil.' + end + @description = description + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param short_description [Object] Object to be assigned + # @!visibility private + def short_description=(short_description) + if short_description.nil? + fail ArgumentError, 'invalid value for "short_description", short_description cannot be nil.' + end + @short_description = short_description + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_at == o.created_at && + created_by == o.created_by && + description == o.description && + name == o.name && + rules == o.rules && + short_description == o.short_description && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, created_by, description, name, rules, short_description, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ai_custom_ruleset_response_data.rb b/lib/datadog_api_client/v2/models/ai_custom_ruleset_response_data.rb new file mode 100644 index 000000000000..42581e4f807e --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_custom_ruleset_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response data for an AI custom ruleset. + class AiCustomRulesetResponseData + include BaseGenericModel + + # Response attributes of an AI custom ruleset. + attr_reader :attributes + + # The ruleset identifier. + attr_reader :id + + # AI custom ruleset resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AiCustomRulesetResponseAttributes', + :'id' => :'String', + :'type' => :'AiCustomRulesetDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AiCustomRulesetResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ai_custom_ruleset_update_attributes.rb b/lib/datadog_api_client/v2/models/ai_custom_ruleset_update_attributes.rb new file mode 100644 index 000000000000..c4dcc008bd90 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_custom_ruleset_update_attributes.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for updating an AI custom ruleset. + class AiCustomRulesetUpdateAttributes + include BaseGenericModel + + # Base64-encoded full description of the ruleset. + attr_accessor :description + + # The ruleset name. + attr_accessor :name + + # Base64-encoded short description of the ruleset. + attr_accessor :short_description + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'name' => :'name', + :'short_description' => :'short_description' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'name' => :'String', + :'short_description' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AiCustomRulesetUpdateAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'short_description') + self.short_description = attributes[:'short_description'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + name == o.name && + short_description == o.short_description && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, name, short_description, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ai_custom_ruleset_update_data.rb b/lib/datadog_api_client/v2/models/ai_custom_ruleset_update_data.rb new file mode 100644 index 000000000000..d3d84607a66e --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_custom_ruleset_update_data.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request data for updating an AI custom ruleset. + class AiCustomRulesetUpdateData + include BaseGenericModel + + # Attributes for updating an AI custom ruleset. + attr_accessor :attributes + + # The ruleset identifier. + attr_accessor :id + + # AI custom ruleset resource type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AiCustomRulesetUpdateAttributes', + :'id' => :'String', + :'type' => :'AiCustomRulesetDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AiCustomRulesetUpdateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ai_custom_ruleset_update_request.rb b/lib/datadog_api_client/v2/models/ai_custom_ruleset_update_request.rb new file mode 100644 index 000000000000..b130950149dd --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_custom_ruleset_update_request.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request body for updating an AI custom ruleset. + class AiCustomRulesetUpdateRequest + include BaseGenericModel + + # Request data for updating an AI custom ruleset. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'AiCustomRulesetUpdateData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AiCustomRulesetUpdateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ai_custom_rulesets_response.rb b/lib/datadog_api_client/v2/models/ai_custom_rulesets_response.rb new file mode 100644 index 000000000000..2b65376a2e17 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_custom_rulesets_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a list of AI custom rulesets. + class AiCustomRulesetsResponse + include BaseGenericModel + + # The list of AI custom rulesets. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AiCustomRulesetsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ai_memory_violation_result_data_type.rb b/lib/datadog_api_client/v2/models/ai_memory_violation_result_data_type.rb new file mode 100644 index 000000000000..85c3bec788e5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_memory_violation_result_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AI memory violation result resource type. + class AiMemoryViolationResultDataType + include BaseEnumModel + + AI_MEMORY_VIOLATION_RESULT = "ai_memory_violation_result".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/ai_memory_violation_result_request.rb b/lib/datadog_api_client/v2/models/ai_memory_violation_result_request.rb new file mode 100644 index 000000000000..013e9d574e36 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_memory_violation_result_request.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request body for creating an AI memory violation result. + class AiMemoryViolationResultRequest + include BaseGenericModel + + # Request data for creating an AI memory violation result. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'AiMemoryViolationResultRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AiMemoryViolationResultRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ai_memory_violation_result_request_attributes.rb b/lib/datadog_api_client/v2/models/ai_memory_violation_result_request_attributes.rb new file mode 100644 index 000000000000..3880f5f3d3c0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_memory_violation_result_request_attributes.rb @@ -0,0 +1,249 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for creating an AI memory violation result. + class AiMemoryViolationResultRequestAttributes + include BaseGenericModel + + # The line number where the violation was found. + attr_reader :line + + # A message explaining the violation result. + attr_reader :message + + # The file path where the violation was found. + attr_reader :name + + # The repository identifier. + attr_reader :repository_id + + # The rule identifier in the format ruleset/rule. + attr_reader :rule + + # The git commit SHA where the violation was found. + attr_reader :sha + + # The type of AI memory violation result indicating whether it is a true positive or false positive. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'line' => :'line', + :'message' => :'message', + :'name' => :'name', + :'repository_id' => :'repository_id', + :'rule' => :'rule', + :'sha' => :'sha', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'line' => :'Integer', + :'message' => :'String', + :'name' => :'String', + :'repository_id' => :'String', + :'rule' => :'String', + :'sha' => :'String', + :'type' => :'AiMemoryViolationType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AiMemoryViolationResultRequestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'line') + self.line = attributes[:'line'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'repository_id') + self.repository_id = attributes[:'repository_id'] + end + + if attributes.key?(:'rule') + self.rule = attributes[:'rule'] + end + + if attributes.key?(:'sha') + self.sha = attributes[:'sha'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @line.nil? + return false if @message.nil? + return false if @name.nil? + return false if @repository_id.nil? + return false if @rule.nil? + return false if @sha.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param line [Object] Object to be assigned + # @!visibility private + def line=(line) + if line.nil? + fail ArgumentError, 'invalid value for "line", line cannot be nil.' + end + @line = line + end + + # Custom attribute writer method with validation + # @param message [Object] Object to be assigned + # @!visibility private + def message=(message) + if message.nil? + fail ArgumentError, 'invalid value for "message", message cannot be nil.' + end + @message = message + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param repository_id [Object] Object to be assigned + # @!visibility private + def repository_id=(repository_id) + if repository_id.nil? + fail ArgumentError, 'invalid value for "repository_id", repository_id cannot be nil.' + end + @repository_id = repository_id + end + + # Custom attribute writer method with validation + # @param rule [Object] Object to be assigned + # @!visibility private + def rule=(rule) + if rule.nil? + fail ArgumentError, 'invalid value for "rule", rule cannot be nil.' + end + @rule = rule + end + + # Custom attribute writer method with validation + # @param sha [Object] Object to be assigned + # @!visibility private + def sha=(sha) + if sha.nil? + fail ArgumentError, 'invalid value for "sha", sha cannot be nil.' + end + @sha = sha + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + line == o.line && + message == o.message && + name == o.name && + repository_id == o.repository_id && + rule == o.rule && + sha == o.sha && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [line, message, name, repository_id, rule, sha, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ai_memory_violation_result_request_data.rb b/lib/datadog_api_client/v2/models/ai_memory_violation_result_request_data.rb new file mode 100644 index 000000000000..40525e7cc728 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_memory_violation_result_request_data.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request data for creating an AI memory violation result. + class AiMemoryViolationResultRequestData + include BaseGenericModel + + # Attributes for creating an AI memory violation result. + attr_accessor :attributes + + # The violation result identifier. + attr_accessor :id + + # AI memory violation result resource type. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AiMemoryViolationResultRequestAttributes', + :'id' => :'String', + :'type' => :'AiMemoryViolationResultDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AiMemoryViolationResultRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ai_memory_violation_result_response_attributes.rb b/lib/datadog_api_client/v2/models/ai_memory_violation_result_response_attributes.rb new file mode 100644 index 000000000000..77c693db10fe --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_memory_violation_result_response_attributes.rb @@ -0,0 +1,291 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response attributes of an AI memory violation result. + class AiMemoryViolationResultResponseAttributes + include BaseGenericModel + + # The creation timestamp. + attr_reader :created_at + + # The identifier of the user who created the result. + attr_reader :created_by + + # The line number where the violation was found. + attr_reader :line + + # A message explaining the violation result. + attr_reader :message + + # The file path where the violation was found. + attr_reader :name + + # The repository identifier. + attr_reader :repository_id + + # The rule identifier in the format ruleset/rule. + attr_reader :rule + + # The git commit SHA where the violation was found. + attr_reader :sha + + # The type of AI memory violation result indicating whether it is a true positive or false positive. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_at' => :'created_at', + :'created_by' => :'created_by', + :'line' => :'line', + :'message' => :'message', + :'name' => :'name', + :'repository_id' => :'repository_id', + :'rule' => :'rule', + :'sha' => :'sha', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Time', + :'created_by' => :'String', + :'line' => :'Integer', + :'message' => :'String', + :'name' => :'String', + :'repository_id' => :'String', + :'rule' => :'String', + :'sha' => :'String', + :'type' => :'AiMemoryViolationType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AiMemoryViolationResultResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'created_by') + self.created_by = attributes[:'created_by'] + end + + if attributes.key?(:'line') + self.line = attributes[:'line'] + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'repository_id') + self.repository_id = attributes[:'repository_id'] + end + + if attributes.key?(:'rule') + self.rule = attributes[:'rule'] + end + + if attributes.key?(:'sha') + self.sha = attributes[:'sha'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @created_at.nil? + return false if @created_by.nil? + return false if @line.nil? + return false if @message.nil? + return false if @name.nil? + return false if @repository_id.nil? + return false if @rule.nil? + return false if @sha.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param created_by [Object] Object to be assigned + # @!visibility private + def created_by=(created_by) + if created_by.nil? + fail ArgumentError, 'invalid value for "created_by", created_by cannot be nil.' + end + @created_by = created_by + end + + # Custom attribute writer method with validation + # @param line [Object] Object to be assigned + # @!visibility private + def line=(line) + if line.nil? + fail ArgumentError, 'invalid value for "line", line cannot be nil.' + end + @line = line + end + + # Custom attribute writer method with validation + # @param message [Object] Object to be assigned + # @!visibility private + def message=(message) + if message.nil? + fail ArgumentError, 'invalid value for "message", message cannot be nil.' + end + @message = message + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param repository_id [Object] Object to be assigned + # @!visibility private + def repository_id=(repository_id) + if repository_id.nil? + fail ArgumentError, 'invalid value for "repository_id", repository_id cannot be nil.' + end + @repository_id = repository_id + end + + # Custom attribute writer method with validation + # @param rule [Object] Object to be assigned + # @!visibility private + def rule=(rule) + if rule.nil? + fail ArgumentError, 'invalid value for "rule", rule cannot be nil.' + end + @rule = rule + end + + # Custom attribute writer method with validation + # @param sha [Object] Object to be assigned + # @!visibility private + def sha=(sha) + if sha.nil? + fail ArgumentError, 'invalid value for "sha", sha cannot be nil.' + end + @sha = sha + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_at == o.created_at && + created_by == o.created_by && + line == o.line && + message == o.message && + name == o.name && + repository_id == o.repository_id && + rule == o.rule && + sha == o.sha && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, created_by, line, message, name, repository_id, rule, sha, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ai_memory_violation_result_response_data.rb b/lib/datadog_api_client/v2/models/ai_memory_violation_result_response_data.rb new file mode 100644 index 000000000000..cd0ff8998a8e --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_memory_violation_result_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response data for an AI memory violation result. + class AiMemoryViolationResultResponseData + include BaseGenericModel + + # Response attributes of an AI memory violation result. + attr_reader :attributes + + # The numeric identifier of the violation result. + attr_reader :id + + # AI memory violation result resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AiMemoryViolationResultResponseAttributes', + :'id' => :'String', + :'type' => :'AiMemoryViolationResultDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AiMemoryViolationResultResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ai_memory_violation_results_response.rb b/lib/datadog_api_client/v2/models/ai_memory_violation_results_response.rb new file mode 100644 index 000000000000..462e87cab155 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_memory_violation_results_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a list of AI memory violation results. + class AiMemoryViolationResultsResponse + include BaseGenericModel + + # The list of AI memory violation results. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AiMemoryViolationResultsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ai_memory_violation_type.rb b/lib/datadog_api_client/v2/models/ai_memory_violation_type.rb new file mode 100644 index 000000000000..0537e7df664d --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_memory_violation_type.rb @@ -0,0 +1,27 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of AI memory violation result indicating whether it is a true positive or false positive. + class AiMemoryViolationType + include BaseEnumModel + + TP = "TP".freeze + FP = "FP".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/ai_prompt_data_type.rb b/lib/datadog_api_client/v2/models/ai_prompt_data_type.rb new file mode 100644 index 000000000000..bd861e3d8d58 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_prompt_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AI prompt resource type. + class AiPromptDataType + include BaseEnumModel + + AI_PROMPT = "ai_prompt".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/ai_prompt_response_attributes.rb b/lib/datadog_api_client/v2/models/ai_prompt_response_attributes.rb new file mode 100644 index 000000000000..c4b4f9edee15 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_prompt_response_attributes.rb @@ -0,0 +1,424 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response attributes of an AI prompt. + class AiPromptResponseAttributes + include BaseGenericModel + + # Rule category + attr_reader :category + + # Checksum of the prompt content. + attr_reader :checksum + + # Base64-encoded AI prompt content. + attr_reader :content + + # The CWE identifier associated with this prompt. + attr_accessor :cwe + + # Base64-encoded full description. + attr_reader :description + + # Directory patterns this prompt applies to. + attr_reader :directories + + # The execution mode for an AI rule revision. + attr_reader :execution_mode + + # Keywords used to search for relevant files. + attr_reader :file_search_keywords + + # File glob patterns this prompt applies to. + attr_reader :globs + + # Whether this is a default Datadog prompt. + attr_reader :is_default + + # Whether this prompt is for testing only. + attr_reader :is_testing + + # Programming language + attr_accessor :language + + # Keywords to exclude from results. + attr_reader :result_keywords_exclude + + # The version of the rule this prompt is associated with. + attr_reader :rule_version + + # Rule severity + attr_reader :severity + + # Base64-encoded short description. + attr_reader :short_description + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'category' => :'category', + :'checksum' => :'checksum', + :'content' => :'content', + :'cwe' => :'cwe', + :'description' => :'description', + :'directories' => :'directories', + :'execution_mode' => :'execution_mode', + :'file_search_keywords' => :'file_search_keywords', + :'globs' => :'globs', + :'is_default' => :'is_default', + :'is_testing' => :'is_testing', + :'language' => :'language', + :'result_keywords_exclude' => :'result_keywords_exclude', + :'rule_version' => :'rule_version', + :'severity' => :'severity', + :'short_description' => :'short_description' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'category' => :'CustomRuleRevisionAttributesCategory', + :'checksum' => :'String', + :'content' => :'String', + :'cwe' => :'String', + :'description' => :'String', + :'directories' => :'Array', + :'execution_mode' => :'AiCustomRuleRevisionExecutionMode', + :'file_search_keywords' => :'Array', + :'globs' => :'Array', + :'is_default' => :'Boolean', + :'is_testing' => :'Boolean', + :'language' => :'Language', + :'result_keywords_exclude' => :'Array', + :'rule_version' => :'String', + :'severity' => :'CustomRuleRevisionAttributesSeverity', + :'short_description' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AiPromptResponseAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'category') + self.category = attributes[:'category'] + end + + if attributes.key?(:'checksum') + self.checksum = attributes[:'checksum'] + end + + if attributes.key?(:'content') + self.content = attributes[:'content'] + end + + if attributes.key?(:'cwe') + self.cwe = attributes[:'cwe'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'directories') + if (value = attributes[:'directories']).is_a?(Array) + self.directories = value + end + end + + if attributes.key?(:'execution_mode') + self.execution_mode = attributes[:'execution_mode'] + end + + if attributes.key?(:'file_search_keywords') + if (value = attributes[:'file_search_keywords']).is_a?(Array) + self.file_search_keywords = value + end + end + + if attributes.key?(:'globs') + if (value = attributes[:'globs']).is_a?(Array) + self.globs = value + end + end + + if attributes.key?(:'is_default') + self.is_default = attributes[:'is_default'] + end + + if attributes.key?(:'is_testing') + self.is_testing = attributes[:'is_testing'] + end + + if attributes.key?(:'language') + self.language = attributes[:'language'] + end + + if attributes.key?(:'result_keywords_exclude') + if (value = attributes[:'result_keywords_exclude']).is_a?(Array) + self.result_keywords_exclude = value + end + end + + if attributes.key?(:'rule_version') + self.rule_version = attributes[:'rule_version'] + end + + if attributes.key?(:'severity') + self.severity = attributes[:'severity'] + end + + if attributes.key?(:'short_description') + self.short_description = attributes[:'short_description'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @category.nil? + return false if @checksum.nil? + return false if @content.nil? + return false if @description.nil? + return false if @directories.nil? + return false if @execution_mode.nil? + return false if @file_search_keywords.nil? + return false if @globs.nil? + return false if @is_default.nil? + return false if @is_testing.nil? + return false if @result_keywords_exclude.nil? + return false if @rule_version.nil? + return false if @severity.nil? + return false if @short_description.nil? + true + end + + # Custom attribute writer method with validation + # @param category [Object] Object to be assigned + # @!visibility private + def category=(category) + if category.nil? + fail ArgumentError, 'invalid value for "category", category cannot be nil.' + end + @category = category + end + + # Custom attribute writer method with validation + # @param checksum [Object] Object to be assigned + # @!visibility private + def checksum=(checksum) + if checksum.nil? + fail ArgumentError, 'invalid value for "checksum", checksum cannot be nil.' + end + @checksum = checksum + end + + # Custom attribute writer method with validation + # @param content [Object] Object to be assigned + # @!visibility private + def content=(content) + if content.nil? + fail ArgumentError, 'invalid value for "content", content cannot be nil.' + end + @content = content + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if description.nil? + fail ArgumentError, 'invalid value for "description", description cannot be nil.' + end + @description = description + end + + # Custom attribute writer method with validation + # @param directories [Object] Object to be assigned + # @!visibility private + def directories=(directories) + if directories.nil? + fail ArgumentError, 'invalid value for "directories", directories cannot be nil.' + end + @directories = directories + end + + # Custom attribute writer method with validation + # @param execution_mode [Object] Object to be assigned + # @!visibility private + def execution_mode=(execution_mode) + if execution_mode.nil? + fail ArgumentError, 'invalid value for "execution_mode", execution_mode cannot be nil.' + end + @execution_mode = execution_mode + end + + # Custom attribute writer method with validation + # @param file_search_keywords [Object] Object to be assigned + # @!visibility private + def file_search_keywords=(file_search_keywords) + if file_search_keywords.nil? + fail ArgumentError, 'invalid value for "file_search_keywords", file_search_keywords cannot be nil.' + end + @file_search_keywords = file_search_keywords + end + + # Custom attribute writer method with validation + # @param globs [Object] Object to be assigned + # @!visibility private + def globs=(globs) + if globs.nil? + fail ArgumentError, 'invalid value for "globs", globs cannot be nil.' + end + @globs = globs + end + + # Custom attribute writer method with validation + # @param is_default [Object] Object to be assigned + # @!visibility private + def is_default=(is_default) + if is_default.nil? + fail ArgumentError, 'invalid value for "is_default", is_default cannot be nil.' + end + @is_default = is_default + end + + # Custom attribute writer method with validation + # @param is_testing [Object] Object to be assigned + # @!visibility private + def is_testing=(is_testing) + if is_testing.nil? + fail ArgumentError, 'invalid value for "is_testing", is_testing cannot be nil.' + end + @is_testing = is_testing + end + + # Custom attribute writer method with validation + # @param result_keywords_exclude [Object] Object to be assigned + # @!visibility private + def result_keywords_exclude=(result_keywords_exclude) + if result_keywords_exclude.nil? + fail ArgumentError, 'invalid value for "result_keywords_exclude", result_keywords_exclude cannot be nil.' + end + @result_keywords_exclude = result_keywords_exclude + end + + # Custom attribute writer method with validation + # @param rule_version [Object] Object to be assigned + # @!visibility private + def rule_version=(rule_version) + if rule_version.nil? + fail ArgumentError, 'invalid value for "rule_version", rule_version cannot be nil.' + end + @rule_version = rule_version + end + + # Custom attribute writer method with validation + # @param severity [Object] Object to be assigned + # @!visibility private + def severity=(severity) + if severity.nil? + fail ArgumentError, 'invalid value for "severity", severity cannot be nil.' + end + @severity = severity + end + + # Custom attribute writer method with validation + # @param short_description [Object] Object to be assigned + # @!visibility private + def short_description=(short_description) + if short_description.nil? + fail ArgumentError, 'invalid value for "short_description", short_description cannot be nil.' + end + @short_description = short_description + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + category == o.category && + checksum == o.checksum && + content == o.content && + cwe == o.cwe && + description == o.description && + directories == o.directories && + execution_mode == o.execution_mode && + file_search_keywords == o.file_search_keywords && + globs == o.globs && + is_default == o.is_default && + is_testing == o.is_testing && + language == o.language && + result_keywords_exclude == o.result_keywords_exclude && + rule_version == o.rule_version && + severity == o.severity && + short_description == o.short_description && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [category, checksum, content, cwe, description, directories, execution_mode, file_search_keywords, globs, is_default, is_testing, language, result_keywords_exclude, rule_version, severity, short_description, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ai_prompt_response_data.rb b/lib/datadog_api_client/v2/models/ai_prompt_response_data.rb new file mode 100644 index 000000000000..4f71d6eb2ad7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_prompt_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response data for an AI prompt. + class AiPromptResponseData + include BaseGenericModel + + # Response attributes of an AI prompt. + attr_reader :attributes + + # The prompt identifier. + attr_reader :id + + # AI prompt resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AiPromptResponseAttributes', + :'id' => :'String', + :'type' => :'AiPromptDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AiPromptResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ai_prompts_response.rb b/lib/datadog_api_client/v2/models/ai_prompts_response.rb new file mode 100644 index 000000000000..c47e2ebcae08 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ai_prompts_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a list of AI prompts. + class AiPromptsResponse + include BaseGenericModel + + # The list of AI prompts. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AiPromptsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/analysis_edit.rb b/lib/datadog_api_client/v2/models/analysis_edit.rb new file mode 100644 index 000000000000..265a604e569b --- /dev/null +++ b/lib/datadog_api_client/v2/models/analysis_edit.rb @@ -0,0 +1,183 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A single edit operation within a fix suggestion for a rule violation. + class AnalysisEdit + include BaseGenericModel + + # The content to insert or replace at the specified position, if applicable. + attr_accessor :content + + # The type of code edit to apply when fixing a violation. + attr_reader :edit_type + + # A position in source code, identified by line and column numbers. + attr_reader :_end + + # A position in source code, identified by line and column numbers. + attr_reader :start + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'content' => :'content', + :'edit_type' => :'edit_type', + :'_end' => :'end', + :'start' => :'start' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'content' => :'String', + :'edit_type' => :'AnalysisEditType', + :'_end' => :'AnalysisPosition', + :'start' => :'AnalysisPosition' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'content', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AnalysisEdit` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'content') + self.content = attributes[:'content'] + end + + if attributes.key?(:'edit_type') + self.edit_type = attributes[:'edit_type'] + end + + if attributes.key?(:'_end') + self._end = attributes[:'_end'] + end + + if attributes.key?(:'start') + self.start = attributes[:'start'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @edit_type.nil? + return false if @_end.nil? + return false if @start.nil? + true + end + + # Custom attribute writer method with validation + # @param edit_type [Object] Object to be assigned + # @!visibility private + def edit_type=(edit_type) + if edit_type.nil? + fail ArgumentError, 'invalid value for "edit_type", edit_type cannot be nil.' + end + @edit_type = edit_type + end + + # Custom attribute writer method with validation + # @param _end [Object] Object to be assigned + # @!visibility private + def _end=(_end) + if _end.nil? + fail ArgumentError, 'invalid value for "_end", _end cannot be nil.' + end + @_end = _end + end + + # Custom attribute writer method with validation + # @param start [Object] Object to be assigned + # @!visibility private + def start=(start) + if start.nil? + fail ArgumentError, 'invalid value for "start", start cannot be nil.' + end + @start = start + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + content == o.content && + edit_type == o.edit_type && + _end == o._end && + start == o.start && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [content, edit_type, _end, start, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/analysis_edit_type.rb b/lib/datadog_api_client/v2/models/analysis_edit_type.rb new file mode 100644 index 000000000000..b63a89edd410 --- /dev/null +++ b/lib/datadog_api_client/v2/models/analysis_edit_type.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of code edit to apply when fixing a violation. + class AnalysisEditType + include BaseEnumModel + + ADD = "ADD".freeze + UPDATE = "UPDATE".freeze + REMOVE = "REMOVE".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/analysis_fix.rb b/lib/datadog_api_client/v2/models/analysis_fix.rb new file mode 100644 index 000000000000..b5d40dc455db --- /dev/null +++ b/lib/datadog_api_client/v2/models/analysis_fix.rb @@ -0,0 +1,146 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A fix suggestion for a rule violation, consisting of one or more edit operations. + class AnalysisFix + include BaseGenericModel + + # A human-readable description of what the fix does. + attr_reader :description + + # The list of edit operations that constitute the fix. + attr_reader :edits + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'edits' => :'edits' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'edits' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AnalysisFix` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'edits') + if (value = attributes[:'edits']).is_a?(Array) + self.edits = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @description.nil? + return false if @edits.nil? + true + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if description.nil? + fail ArgumentError, 'invalid value for "description", description cannot be nil.' + end + @description = description + end + + # Custom attribute writer method with validation + # @param edits [Object] Object to be assigned + # @!visibility private + def edits=(edits) + if edits.nil? + fail ArgumentError, 'invalid value for "edits", edits cannot be nil.' + end + @edits = edits + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + edits == o.edits && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, edits, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/analysis_position.rb b/lib/datadog_api_client/v2/models/analysis_position.rb new file mode 100644 index 000000000000..d692524d4dcb --- /dev/null +++ b/lib/datadog_api_client/v2/models/analysis_position.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A position in source code, identified by line and column numbers. + class AnalysisPosition + include BaseGenericModel + + # The column number in the source file (1-based). + attr_reader :col + + # The line number in the source file (1-based). + attr_reader :line + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'col' => :'col', + :'line' => :'line' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'col' => :'Integer', + :'line' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AnalysisPosition` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'col') + self.col = attributes[:'col'] + end + + if attributes.key?(:'line') + self.line = attributes[:'line'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @col.nil? + return false if @line.nil? + true + end + + # Custom attribute writer method with validation + # @param col [Object] Object to be assigned + # @!visibility private + def col=(col) + if col.nil? + fail ArgumentError, 'invalid value for "col", col cannot be nil.' + end + @col = col + end + + # Custom attribute writer method with validation + # @param line [Object] Object to be assigned + # @!visibility private + def line=(line) + if line.nil? + fail ArgumentError, 'invalid value for "line", line cannot be nil.' + end + @line = line + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + col == o.col && + line == o.line && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [col, line, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/analysis_request.rb b/lib/datadog_api_client/v2/models/analysis_request.rb new file mode 100644 index 000000000000..7833a3c2090e --- /dev/null +++ b/lib/datadog_api_client/v2/models/analysis_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The request payload for running static analysis on source code. + class AnalysisRequest + include BaseGenericModel + + # The primary data object in the analysis request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'AnalysisRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AnalysisRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/analysis_request_data.rb b/lib/datadog_api_client/v2/models/analysis_request_data.rb new file mode 100644 index 000000000000..1d21163d9bfa --- /dev/null +++ b/lib/datadog_api_client/v2/models/analysis_request_data.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The primary data object in the analysis request. + class AnalysisRequestData + include BaseGenericModel + + # The attributes of the analysis request, containing the source code and rules to apply. + attr_reader :attributes + + # An optional identifier for the analysis request resource. + attr_accessor :id + + # Analysis request resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AnalysisRequestDataAttributes', + :'id' => :'String', + :'type' => :'AnalysisRequestDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AnalysisRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/analysis_request_data_attributes.rb b/lib/datadog_api_client/v2/models/analysis_request_data_attributes.rb new file mode 100644 index 000000000000..024f5e958e0a --- /dev/null +++ b/lib/datadog_api_client/v2/models/analysis_request_data_attributes.rb @@ -0,0 +1,209 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes of the analysis request, containing the source code and rules to apply. + class AnalysisRequestDataAttributes + include BaseGenericModel + + # The base64-encoded source code to analyze. + attr_reader :code + + # The encoding of the source code file (must be `utf-8`). + attr_reader :file_encoding + + # The name of the file being analyzed. + attr_reader :filename + + # The programming language of the source code. + attr_reader :language + + # The list of static analysis rules to apply during analysis. + attr_reader :rules + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'code' => :'code', + :'file_encoding' => :'file_encoding', + :'filename' => :'filename', + :'language' => :'language', + :'rules' => :'rules' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'code' => :'String', + :'file_encoding' => :'String', + :'filename' => :'String', + :'language' => :'String', + :'rules' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AnalysisRequestDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'file_encoding') + self.file_encoding = attributes[:'file_encoding'] + end + + if attributes.key?(:'filename') + self.filename = attributes[:'filename'] + end + + if attributes.key?(:'language') + self.language = attributes[:'language'] + end + + if attributes.key?(:'rules') + if (value = attributes[:'rules']).is_a?(Array) + self.rules = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @code.nil? + return false if @file_encoding.nil? + return false if @filename.nil? + return false if @language.nil? + return false if @rules.nil? + true + end + + # Custom attribute writer method with validation + # @param code [Object] Object to be assigned + # @!visibility private + def code=(code) + if code.nil? + fail ArgumentError, 'invalid value for "code", code cannot be nil.' + end + @code = code + end + + # Custom attribute writer method with validation + # @param file_encoding [Object] Object to be assigned + # @!visibility private + def file_encoding=(file_encoding) + if file_encoding.nil? + fail ArgumentError, 'invalid value for "file_encoding", file_encoding cannot be nil.' + end + @file_encoding = file_encoding + end + + # Custom attribute writer method with validation + # @param filename [Object] Object to be assigned + # @!visibility private + def filename=(filename) + if filename.nil? + fail ArgumentError, 'invalid value for "filename", filename cannot be nil.' + end + @filename = filename + end + + # Custom attribute writer method with validation + # @param language [Object] Object to be assigned + # @!visibility private + def language=(language) + if language.nil? + fail ArgumentError, 'invalid value for "language", language cannot be nil.' + end + @language = language + end + + # Custom attribute writer method with validation + # @param rules [Object] Object to be assigned + # @!visibility private + def rules=(rules) + if rules.nil? + fail ArgumentError, 'invalid value for "rules", rules cannot be nil.' + end + @rules = rules + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + code == o.code && + file_encoding == o.file_encoding && + filename == o.filename && + language == o.language && + rules == o.rules && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [code, file_encoding, filename, language, rules, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/analysis_request_data_type.rb b/lib/datadog_api_client/v2/models/analysis_request_data_type.rb new file mode 100644 index 000000000000..ee76cc823978 --- /dev/null +++ b/lib/datadog_api_client/v2/models/analysis_request_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Analysis request resource type. + class AnalysisRequestDataType + include BaseEnumModel + + ANALYSIS_REQUEST = "analysis_request".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/analysis_request_rule.rb b/lib/datadog_api_client/v2/models/analysis_request_rule.rb new file mode 100644 index 000000000000..31ad13ef0c3b --- /dev/null +++ b/lib/datadog_api_client/v2/models/analysis_request_rule.rb @@ -0,0 +1,299 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A static analysis rule to apply during code analysis. + class AnalysisRequestRule + include BaseGenericModel + + # The category of the rule (for example, `BEST_PRACTICES`, `SECURITY`). + attr_reader :category + + # A checksum of the rule definition. + attr_reader :checksum + + # The base64-encoded rule implementation code. + attr_reader :code + + # The code entity type checked by the rule, applicable when rule type is `AST_CHECK`. + attr_accessor :entity_checked + + # The unique identifier of the rule. + attr_reader :id + + # The programming language this rule targets. + attr_reader :language + + # A base64-encoded regex pattern used by the rule, applicable when rule type is `REGEX`. + attr_accessor :regex + + # The severity of findings from this rule (for example, `ERROR`, `WARNING`). + attr_reader :severity + + # The base64-encoded tree-sitter query used by the rule. + attr_reader :tree_sitter_query + + # The rule type indicating the detection mechanism (for example, `TREE_SITTER_QUERY`). + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'category' => :'category', + :'checksum' => :'checksum', + :'code' => :'code', + :'entity_checked' => :'entity_checked', + :'id' => :'id', + :'language' => :'language', + :'regex' => :'regex', + :'severity' => :'severity', + :'tree_sitter_query' => :'tree_sitter_query', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'category' => :'String', + :'checksum' => :'String', + :'code' => :'String', + :'entity_checked' => :'String', + :'id' => :'String', + :'language' => :'String', + :'regex' => :'String', + :'severity' => :'String', + :'tree_sitter_query' => :'String', + :'type' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'entity_checked', + :'regex', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AnalysisRequestRule` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'category') + self.category = attributes[:'category'] + end + + if attributes.key?(:'checksum') + self.checksum = attributes[:'checksum'] + end + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'entity_checked') + self.entity_checked = attributes[:'entity_checked'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'language') + self.language = attributes[:'language'] + end + + if attributes.key?(:'regex') + self.regex = attributes[:'regex'] + end + + if attributes.key?(:'severity') + self.severity = attributes[:'severity'] + end + + if attributes.key?(:'tree_sitter_query') + self.tree_sitter_query = attributes[:'tree_sitter_query'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @category.nil? + return false if @checksum.nil? + return false if @code.nil? + return false if @id.nil? + return false if @language.nil? + return false if @severity.nil? + return false if @tree_sitter_query.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param category [Object] Object to be assigned + # @!visibility private + def category=(category) + if category.nil? + fail ArgumentError, 'invalid value for "category", category cannot be nil.' + end + @category = category + end + + # Custom attribute writer method with validation + # @param checksum [Object] Object to be assigned + # @!visibility private + def checksum=(checksum) + if checksum.nil? + fail ArgumentError, 'invalid value for "checksum", checksum cannot be nil.' + end + @checksum = checksum + end + + # Custom attribute writer method with validation + # @param code [Object] Object to be assigned + # @!visibility private + def code=(code) + if code.nil? + fail ArgumentError, 'invalid value for "code", code cannot be nil.' + end + @code = code + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param language [Object] Object to be assigned + # @!visibility private + def language=(language) + if language.nil? + fail ArgumentError, 'invalid value for "language", language cannot be nil.' + end + @language = language + end + + # Custom attribute writer method with validation + # @param severity [Object] Object to be assigned + # @!visibility private + def severity=(severity) + if severity.nil? + fail ArgumentError, 'invalid value for "severity", severity cannot be nil.' + end + @severity = severity + end + + # Custom attribute writer method with validation + # @param tree_sitter_query [Object] Object to be assigned + # @!visibility private + def tree_sitter_query=(tree_sitter_query) + if tree_sitter_query.nil? + fail ArgumentError, 'invalid value for "tree_sitter_query", tree_sitter_query cannot be nil.' + end + @tree_sitter_query = tree_sitter_query + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + category == o.category && + checksum == o.checksum && + code == o.code && + entity_checked == o.entity_checked && + id == o.id && + language == o.language && + regex == o.regex && + severity == o.severity && + tree_sitter_query == o.tree_sitter_query && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [category, checksum, code, entity_checked, id, language, regex, severity, tree_sitter_query, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/analysis_response.rb b/lib/datadog_api_client/v2/models/analysis_response.rb new file mode 100644 index 000000000000..9ba6f9a97804 --- /dev/null +++ b/lib/datadog_api_client/v2/models/analysis_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The response payload from running static analysis on source code. + class AnalysisResponse + include BaseGenericModel + + # The primary data object in the analysis response. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'AnalysisResponseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AnalysisResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/analysis_response_data.rb b/lib/datadog_api_client/v2/models/analysis_response_data.rb new file mode 100644 index 000000000000..eb1b54ea3027 --- /dev/null +++ b/lib/datadog_api_client/v2/models/analysis_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The primary data object in the analysis response. + class AnalysisResponseData + include BaseGenericModel + + # The attributes of the analysis response, containing rule results and any top-level errors. + attr_reader :attributes + + # The unique identifier of the analysis response resource. + attr_reader :id + + # Analysis response resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'AnalysisResponseDataAttributes', + :'id' => :'String', + :'type' => :'AnalysisResponseDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AnalysisResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/analysis_response_data_attributes.rb b/lib/datadog_api_client/v2/models/analysis_response_data_attributes.rb new file mode 100644 index 000000000000..db4df7c4e963 --- /dev/null +++ b/lib/datadog_api_client/v2/models/analysis_response_data_attributes.rb @@ -0,0 +1,148 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes of the analysis response, containing rule results and any top-level errors. + class AnalysisResponseDataAttributes + include BaseGenericModel + + # Top-level error messages encountered during the analysis operation. + attr_reader :errors + + # The list of results for each static analysis rule applied during analysis. + attr_reader :rule_responses + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'errors' => :'errors', + :'rule_responses' => :'rule_responses' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'errors' => :'Array', + :'rule_responses' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AnalysisResponseDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'errors') + if (value = attributes[:'errors']).is_a?(Array) + self.errors = value + end + end + + if attributes.key?(:'rule_responses') + if (value = attributes[:'rule_responses']).is_a?(Array) + self.rule_responses = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @errors.nil? + return false if @rule_responses.nil? + true + end + + # Custom attribute writer method with validation + # @param errors [Object] Object to be assigned + # @!visibility private + def errors=(errors) + if errors.nil? + fail ArgumentError, 'invalid value for "errors", errors cannot be nil.' + end + @errors = errors + end + + # Custom attribute writer method with validation + # @param rule_responses [Object] Object to be assigned + # @!visibility private + def rule_responses=(rule_responses) + if rule_responses.nil? + fail ArgumentError, 'invalid value for "rule_responses", rule_responses cannot be nil.' + end + @rule_responses = rule_responses + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + errors == o.errors && + rule_responses == o.rule_responses && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [errors, rule_responses, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/analysis_response_data_type.rb b/lib/datadog_api_client/v2/models/analysis_response_data_type.rb new file mode 100644 index 000000000000..199d36d7654a --- /dev/null +++ b/lib/datadog_api_client/v2/models/analysis_response_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Analysis response resource type. + class AnalysisResponseDataType + include BaseEnumModel + + SERVER_REQUEST = "server_request".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/analysis_rule_response.rb b/lib/datadog_api_client/v2/models/analysis_rule_response.rb new file mode 100644 index 000000000000..ec29b65ea736 --- /dev/null +++ b/lib/datadog_api_client/v2/models/analysis_rule_response.rb @@ -0,0 +1,229 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The result of applying a single static analysis rule to the analyzed source code. + class AnalysisRuleResponse + include BaseGenericModel + + # A list of error messages encountered while executing the rule. + attr_reader :errors + + # An error message if the rule execution failed, or null if execution succeeded. + attr_accessor :execution_error + + # The time taken to execute the rule, in milliseconds. + attr_reader :execution_time_ms + + # The identifier of the rule that produced this response. + attr_reader :identifier + + # The raw output produced by the rule engine during execution. + attr_reader :output + + # The list of violations found by this rule. + attr_reader :violations + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'errors' => :'errors', + :'execution_error' => :'execution_error', + :'execution_time_ms' => :'execution_time_ms', + :'identifier' => :'identifier', + :'output' => :'output', + :'violations' => :'violations' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'errors' => :'Array', + :'execution_error' => :'String', + :'execution_time_ms' => :'Integer', + :'identifier' => :'String', + :'output' => :'String', + :'violations' => :'Array' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'execution_error', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AnalysisRuleResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'errors') + if (value = attributes[:'errors']).is_a?(Array) + self.errors = value + end + end + + if attributes.key?(:'execution_error') + self.execution_error = attributes[:'execution_error'] + end + + if attributes.key?(:'execution_time_ms') + self.execution_time_ms = attributes[:'execution_time_ms'] + end + + if attributes.key?(:'identifier') + self.identifier = attributes[:'identifier'] + end + + if attributes.key?(:'output') + self.output = attributes[:'output'] + end + + if attributes.key?(:'violations') + if (value = attributes[:'violations']).is_a?(Array) + self.violations = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @errors.nil? + return false if @execution_time_ms.nil? + return false if @identifier.nil? + return false if @output.nil? + return false if @violations.nil? + true + end + + # Custom attribute writer method with validation + # @param errors [Object] Object to be assigned + # @!visibility private + def errors=(errors) + if errors.nil? + fail ArgumentError, 'invalid value for "errors", errors cannot be nil.' + end + @errors = errors + end + + # Custom attribute writer method with validation + # @param execution_time_ms [Object] Object to be assigned + # @!visibility private + def execution_time_ms=(execution_time_ms) + if execution_time_ms.nil? + fail ArgumentError, 'invalid value for "execution_time_ms", execution_time_ms cannot be nil.' + end + @execution_time_ms = execution_time_ms + end + + # Custom attribute writer method with validation + # @param identifier [Object] Object to be assigned + # @!visibility private + def identifier=(identifier) + if identifier.nil? + fail ArgumentError, 'invalid value for "identifier", identifier cannot be nil.' + end + @identifier = identifier + end + + # Custom attribute writer method with validation + # @param output [Object] Object to be assigned + # @!visibility private + def output=(output) + if output.nil? + fail ArgumentError, 'invalid value for "output", output cannot be nil.' + end + @output = output + end + + # Custom attribute writer method with validation + # @param violations [Object] Object to be assigned + # @!visibility private + def violations=(violations) + if violations.nil? + fail ArgumentError, 'invalid value for "violations", violations cannot be nil.' + end + @violations = violations + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + errors == o.errors && + execution_error == o.execution_error && + execution_time_ms == o.execution_time_ms && + identifier == o.identifier && + output == o.output && + violations == o.violations && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [errors, execution_error, execution_time_ms, identifier, output, violations, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/analysis_violation.rb b/lib/datadog_api_client/v2/models/analysis_violation.rb new file mode 100644 index 000000000000..dab4e648d16f --- /dev/null +++ b/lib/datadog_api_client/v2/models/analysis_violation.rb @@ -0,0 +1,230 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A rule violation found in the analyzed source code. + class AnalysisViolation + include BaseGenericModel + + # The category of the violation. + attr_reader :category + + # A position in source code, identified by line and column numbers. + attr_reader :_end + + # The list of suggested fixes for this violation. + attr_reader :fixes + + # A human-readable description of the violation. + attr_reader :message + + # The severity level of the violation. + attr_reader :severity + + # A position in source code, identified by line and column numbers. + attr_reader :start + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'category' => :'category', + :'_end' => :'end', + :'fixes' => :'fixes', + :'message' => :'message', + :'severity' => :'severity', + :'start' => :'start' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'category' => :'String', + :'_end' => :'AnalysisPosition', + :'fixes' => :'Array', + :'message' => :'String', + :'severity' => :'String', + :'start' => :'AnalysisPosition' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::AnalysisViolation` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'category') + self.category = attributes[:'category'] + end + + if attributes.key?(:'_end') + self._end = attributes[:'_end'] + end + + if attributes.key?(:'fixes') + if (value = attributes[:'fixes']).is_a?(Array) + self.fixes = value + end + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'severity') + self.severity = attributes[:'severity'] + end + + if attributes.key?(:'start') + self.start = attributes[:'start'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @category.nil? + return false if @_end.nil? + return false if @fixes.nil? + return false if @message.nil? + return false if @severity.nil? + return false if @start.nil? + true + end + + # Custom attribute writer method with validation + # @param category [Object] Object to be assigned + # @!visibility private + def category=(category) + if category.nil? + fail ArgumentError, 'invalid value for "category", category cannot be nil.' + end + @category = category + end + + # Custom attribute writer method with validation + # @param _end [Object] Object to be assigned + # @!visibility private + def _end=(_end) + if _end.nil? + fail ArgumentError, 'invalid value for "_end", _end cannot be nil.' + end + @_end = _end + end + + # Custom attribute writer method with validation + # @param fixes [Object] Object to be assigned + # @!visibility private + def fixes=(fixes) + if fixes.nil? + fail ArgumentError, 'invalid value for "fixes", fixes cannot be nil.' + end + @fixes = fixes + end + + # Custom attribute writer method with validation + # @param message [Object] Object to be assigned + # @!visibility private + def message=(message) + if message.nil? + fail ArgumentError, 'invalid value for "message", message cannot be nil.' + end + @message = message + end + + # Custom attribute writer method with validation + # @param severity [Object] Object to be assigned + # @!visibility private + def severity=(severity) + if severity.nil? + fail ArgumentError, 'invalid value for "severity", severity cannot be nil.' + end + @severity = severity + end + + # Custom attribute writer method with validation + # @param start [Object] Object to be assigned + # @!visibility private + def start=(start) + if start.nil? + fail ArgumentError, 'invalid value for "start", start cannot be nil.' + end + @start = start + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + category == o.category && + _end == o._end && + fixes == o.fixes && + message == o.message && + severity == o.severity && + start == o.start && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [category, _end, fixes, message, severity, start, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/application_security_policy_attributes.rb b/lib/datadog_api_client/v2/models/application_security_policy_attributes.rb new file mode 100644 index 000000000000..4eaa14363103 --- /dev/null +++ b/lib/datadog_api_client/v2/models/application_security_policy_attributes.rb @@ -0,0 +1,213 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A WAF policy. + class ApplicationSecurityPolicyAttributes + include BaseGenericModel + + # Description of the WAF policy. + attr_reader :description + + # Make this policy the default policy. The default policy is applied to + # every service not specifically assigned to another policy. + attr_accessor :is_default + + # The name of the WAF policy. + attr_reader :name + + # Presets enabled on this policy. + attr_accessor :protection_presets + + # Rule overrides applied by the policy. + attr_accessor :rules + + # Deprecated: Ruleset overrides. Use `protectionPresets` instead. + attr_accessor :rulesets + + # The scope of the WAF policy. + attr_accessor :scope + + # Version of the WAF ruleset maintained by Datadog used by this policy. 0 is the default value. + attr_accessor :version + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'is_default' => :'isDefault', + :'name' => :'name', + :'protection_presets' => :'protectionPresets', + :'rules' => :'rules', + :'rulesets' => :'rulesets', + :'scope' => :'scope', + :'version' => :'version' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'is_default' => :'Boolean', + :'name' => :'String', + :'protection_presets' => :'Array', + :'rules' => :'Array', + :'rulesets' => :'Array', + :'scope' => :'Array', + :'version' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ApplicationSecurityPolicyAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'is_default') + self.is_default = attributes[:'is_default'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'protection_presets') + if (value = attributes[:'protection_presets']).is_a?(Array) + self.protection_presets = value + end + end + + if attributes.key?(:'rules') + if (value = attributes[:'rules']).is_a?(Array) + self.rules = value + end + end + + if attributes.key?(:'rulesets') + if (value = attributes[:'rulesets']).is_a?(Array) + self.rulesets = value + end + end + + if attributes.key?(:'scope') + if (value = attributes[:'scope']).is_a?(Array) + self.scope = value + end + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @description.nil? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if description.nil? + fail ArgumentError, 'invalid value for "description", description cannot be nil.' + end + @description = description + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + is_default == o.is_default && + name == o.name && + protection_presets == o.protection_presets && + rules == o.rules && + rulesets == o.rulesets && + scope == o.scope && + version == o.version && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, is_default, name, protection_presets, rules, rulesets, scope, version, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/application_security_policy_create_attributes.rb b/lib/datadog_api_client/v2/models/application_security_policy_create_attributes.rb new file mode 100644 index 000000000000..a1fd89abd8ff --- /dev/null +++ b/lib/datadog_api_client/v2/models/application_security_policy_create_attributes.rb @@ -0,0 +1,234 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Create a new WAF policy. + class ApplicationSecurityPolicyCreateAttributes + include BaseGenericModel + + # When creating a new policy, clone the policy indicated by this identifier. + attr_reader :based_on + + # Description of the WAF policy. + attr_reader :description + + # Make this policy the default policy. The default policy is applied to + # every service not specifically assigned to another policy. + attr_accessor :is_default + + # The name of the WAF policy. + attr_reader :name + + # Presets enabled on this policy. + attr_accessor :protection_presets + + # Rule overrides applied by the policy. + attr_accessor :rules + + # Deprecated: Ruleset overrides. Use `protectionPresets` instead. + attr_accessor :rulesets + + # The scope of the WAF policy. + attr_accessor :scope + + # Version of the WAF ruleset maintained by Datadog used by this policy. 0 is the default value. + attr_accessor :version + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'based_on' => :'basedOn', + :'description' => :'description', + :'is_default' => :'isDefault', + :'name' => :'name', + :'protection_presets' => :'protectionPresets', + :'rules' => :'rules', + :'rulesets' => :'rulesets', + :'scope' => :'scope', + :'version' => :'version' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'based_on' => :'String', + :'description' => :'String', + :'is_default' => :'Boolean', + :'name' => :'String', + :'protection_presets' => :'Array', + :'rules' => :'Array', + :'rulesets' => :'Array', + :'scope' => :'Array', + :'version' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ApplicationSecurityPolicyCreateAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'based_on') + self.based_on = attributes[:'based_on'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'is_default') + self.is_default = attributes[:'is_default'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'protection_presets') + if (value = attributes[:'protection_presets']).is_a?(Array) + self.protection_presets = value + end + end + + if attributes.key?(:'rules') + if (value = attributes[:'rules']).is_a?(Array) + self.rules = value + end + end + + if attributes.key?(:'rulesets') + if (value = attributes[:'rulesets']).is_a?(Array) + self.rulesets = value + end + end + + if attributes.key?(:'scope') + if (value = attributes[:'scope']).is_a?(Array) + self.scope = value + end + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @based_on.nil? + return false if @description.nil? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param based_on [Object] Object to be assigned + # @!visibility private + def based_on=(based_on) + if based_on.nil? + fail ArgumentError, 'invalid value for "based_on", based_on cannot be nil.' + end + @based_on = based_on + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if description.nil? + fail ArgumentError, 'invalid value for "description", description cannot be nil.' + end + @description = description + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + based_on == o.based_on && + description == o.description && + is_default == o.is_default && + name == o.name && + protection_presets == o.protection_presets && + rules == o.rules && + rulesets == o.rulesets && + scope == o.scope && + version == o.version && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [based_on, description, is_default, name, protection_presets, rules, rulesets, scope, version, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/application_security_policy_create_data.rb b/lib/datadog_api_client/v2/models/application_security_policy_create_data.rb new file mode 100644 index 000000000000..2fd9f673c38a --- /dev/null +++ b/lib/datadog_api_client/v2/models/application_security_policy_create_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Object for a single WAF policy. + class ApplicationSecurityPolicyCreateData + include BaseGenericModel + + # Create a new WAF policy. + attr_reader :attributes + + # The type of the resource. The value should always be `policy`. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'ApplicationSecurityPolicyCreateAttributes', + :'type' => :'ApplicationSecurityPolicyType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ApplicationSecurityPolicyCreateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/application_security_policy_create_request.rb b/lib/datadog_api_client/v2/models/application_security_policy_create_request.rb new file mode 100644 index 000000000000..e1d35fdb9be0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/application_security_policy_create_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request object that includes the policy to create. + class ApplicationSecurityPolicyCreateRequest + include BaseGenericModel + + # Object for a single WAF policy. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'ApplicationSecurityPolicyCreateData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ApplicationSecurityPolicyCreateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/application_security_policy_data.rb b/lib/datadog_api_client/v2/models/application_security_policy_data.rb new file mode 100644 index 000000000000..98d819c7435a --- /dev/null +++ b/lib/datadog_api_client/v2/models/application_security_policy_data.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Object for a single WAF policy. + class ApplicationSecurityPolicyData + include BaseGenericModel + + # A WAF policy. + attr_accessor :attributes + + # The ID of the policy. + attr_accessor :id + + # Metadata associated with the WAF policy. + attr_accessor :meta + + # The type of the resource. The value should always be `policy`. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'meta' => :'meta', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'ApplicationSecurityPolicyAttributes', + :'id' => :'String', + :'meta' => :'ApplicationSecurityPolicyMetadata', + :'type' => :'ApplicationSecurityPolicyType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ApplicationSecurityPolicyData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + meta == o.meta && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, meta, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/application_security_policy_list_response.rb b/lib/datadog_api_client/v2/models/application_security_policy_list_response.rb new file mode 100644 index 000000000000..becd25c199a4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/application_security_policy_list_response.rb @@ -0,0 +1,107 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response object that includes a list of WAF policies. + class ApplicationSecurityPolicyListResponse + include BaseGenericModel + + # The WAF policy data. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ApplicationSecurityPolicyListResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/application_security_policy_metadata.rb b/lib/datadog_api_client/v2/models/application_security_policy_metadata.rb new file mode 100644 index 000000000000..d6f70397274e --- /dev/null +++ b/lib/datadog_api_client/v2/models/application_security_policy_metadata.rb @@ -0,0 +1,155 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Metadata associated with the WAF policy. + class ApplicationSecurityPolicyMetadata + include BaseGenericModel + + # The date and time the WAF policy was created. + attr_accessor :added_at + + # The handle of the user who created the WAF policy. + attr_accessor :added_by + + # The name of the user who created the WAF policy. + attr_accessor :added_by_name + + # The date and time the WAF policy was last updated. + attr_accessor :modified_at + + # The handle of the user who last updated the WAF policy. + attr_accessor :modified_by + + # The name of the user who last updated the WAF policy. + attr_accessor :modified_by_name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'added_at' => :'added_at', + :'added_by' => :'added_by', + :'added_by_name' => :'added_by_name', + :'modified_at' => :'modified_at', + :'modified_by' => :'modified_by', + :'modified_by_name' => :'modified_by_name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'added_at' => :'Time', + :'added_by' => :'String', + :'added_by_name' => :'String', + :'modified_at' => :'Time', + :'modified_by' => :'String', + :'modified_by_name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ApplicationSecurityPolicyMetadata` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'added_at') + self.added_at = attributes[:'added_at'] + end + + if attributes.key?(:'added_by') + self.added_by = attributes[:'added_by'] + end + + if attributes.key?(:'added_by_name') + self.added_by_name = attributes[:'added_by_name'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'modified_by') + self.modified_by = attributes[:'modified_by'] + end + + if attributes.key?(:'modified_by_name') + self.modified_by_name = attributes[:'modified_by_name'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + added_at == o.added_at && + added_by == o.added_by && + added_by_name == o.added_by_name && + modified_at == o.modified_at && + modified_by == o.modified_by && + modified_by_name == o.modified_by_name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [added_at, added_by, added_by_name, modified_at, modified_by, modified_by_name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/application_security_policy_response.rb b/lib/datadog_api_client/v2/models/application_security_policy_response.rb new file mode 100644 index 000000000000..210dc46eba89 --- /dev/null +++ b/lib/datadog_api_client/v2/models/application_security_policy_response.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response object that includes a single WAF policy. + class ApplicationSecurityPolicyResponse + include BaseGenericModel + + # Object for a single WAF policy. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'ApplicationSecurityPolicyData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ApplicationSecurityPolicyResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/application_security_policy_rule_override.rb b/lib/datadog_api_client/v2/models/application_security_policy_rule_override.rb new file mode 100644 index 000000000000..ff7b99c9f332 --- /dev/null +++ b/lib/datadog_api_client/v2/models/application_security_policy_rule_override.rb @@ -0,0 +1,175 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Override WAF rule parameters for services in a policy. + class ApplicationSecurityPolicyRuleOverride + include BaseGenericModel + + # When blocking is enabled, the rule will block the traffic matched by this rule. + attr_reader :blocking + + # When false, this rule will not match any traffic. + attr_reader :enabled + + # When true, collects additional data from the WAF for this rule. + attr_accessor :extended_data_collection + + # Override the parameters for this WAF rule identifier. + attr_reader :id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'blocking' => :'blocking', + :'enabled' => :'enabled', + :'extended_data_collection' => :'extended_data_collection', + :'id' => :'id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'blocking' => :'Boolean', + :'enabled' => :'Boolean', + :'extended_data_collection' => :'Boolean', + :'id' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ApplicationSecurityPolicyRuleOverride` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'blocking') + self.blocking = attributes[:'blocking'] + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'extended_data_collection') + self.extended_data_collection = attributes[:'extended_data_collection'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @blocking.nil? + return false if @enabled.nil? + return false if @id.nil? + true + end + + # Custom attribute writer method with validation + # @param blocking [Object] Object to be assigned + # @!visibility private + def blocking=(blocking) + if blocking.nil? + fail ArgumentError, 'invalid value for "blocking", blocking cannot be nil.' + end + @blocking = blocking + end + + # Custom attribute writer method with validation + # @param enabled [Object] Object to be assigned + # @!visibility private + def enabled=(enabled) + if enabled.nil? + fail ArgumentError, 'invalid value for "enabled", enabled cannot be nil.' + end + @enabled = enabled + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + blocking == o.blocking && + enabled == o.enabled && + extended_data_collection == o.extended_data_collection && + id == o.id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [blocking, enabled, extended_data_collection, id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/application_security_policy_ruleset_override.rb b/lib/datadog_api_client/v2/models/application_security_policy_ruleset_override.rb new file mode 100644 index 000000000000..a1fc1a76bac3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/application_security_policy_ruleset_override.rb @@ -0,0 +1,168 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Deprecated: Override WAF ruleset parameters. Use `protectionPresets` instead. + # + # @deprecated This model is deprecated. + class ApplicationSecurityPolicyRulesetOverride + include BaseGenericModel + + # When blocking is enabled, the ruleset will block the traffic it matches. + attr_reader :blocking + + # When false, this ruleset will not match any traffic. + attr_reader :enabled + + # The identifier of the ruleset to override. + attr_reader :id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'blocking' => :'blocking', + :'enabled' => :'enabled', + :'id' => :'id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'blocking' => :'Boolean', + :'enabled' => :'Boolean', + :'id' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + warn "[DEPRECATION] `ApplicationSecurityPolicyRulesetOverride` is deprecated." + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ApplicationSecurityPolicyRulesetOverride` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'blocking') + self.blocking = attributes[:'blocking'] + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @blocking.nil? + return false if @enabled.nil? + return false if @id.nil? + true + end + + # Custom attribute writer method with validation + # @param blocking [Object] Object to be assigned + # @!visibility private + def blocking=(blocking) + if blocking.nil? + fail ArgumentError, 'invalid value for "blocking", blocking cannot be nil.' + end + @blocking = blocking + end + + # Custom attribute writer method with validation + # @param enabled [Object] Object to be assigned + # @!visibility private + def enabled=(enabled) + if enabled.nil? + fail ArgumentError, 'invalid value for "enabled", enabled cannot be nil.' + end + @enabled = enabled + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + blocking == o.blocking && + enabled == o.enabled && + id == o.id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [blocking, enabled, id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/application_security_policy_scope.rb b/lib/datadog_api_client/v2/models/application_security_policy_scope.rb new file mode 100644 index 000000000000..9c522b0d99d6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/application_security_policy_scope.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The scope of the WAF policy. + class ApplicationSecurityPolicyScope + include BaseGenericModel + + # The environment scope for the WAF policy. + attr_reader :env + + # The service scope for the WAF policy. + attr_reader :service + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'env' => :'env', + :'service' => :'service' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'env' => :'String', + :'service' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ApplicationSecurityPolicyScope` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'env') + self.env = attributes[:'env'] + end + + if attributes.key?(:'service') + self.service = attributes[:'service'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @env.nil? + return false if @service.nil? + true + end + + # Custom attribute writer method with validation + # @param env [Object] Object to be assigned + # @!visibility private + def env=(env) + if env.nil? + fail ArgumentError, 'invalid value for "env", env cannot be nil.' + end + @env = env + end + + # Custom attribute writer method with validation + # @param service [Object] Object to be assigned + # @!visibility private + def service=(service) + if service.nil? + fail ArgumentError, 'invalid value for "service", service cannot be nil.' + end + @service = service + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + env == o.env && + service == o.service && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [env, service, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/application_security_policy_type.rb b/lib/datadog_api_client/v2/models/application_security_policy_type.rb new file mode 100644 index 000000000000..d0ada53e1fd5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/application_security_policy_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of the resource. The value should always be `policy`. + class ApplicationSecurityPolicyType + include BaseEnumModel + + POLICY = "policy".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/application_security_policy_update_attributes.rb b/lib/datadog_api_client/v2/models/application_security_policy_update_attributes.rb new file mode 100644 index 000000000000..38b3f56849b7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/application_security_policy_update_attributes.rb @@ -0,0 +1,268 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Update a WAF policy. + class ApplicationSecurityPolicyUpdateAttributes + include BaseGenericModel + + # Description of the WAF policy. + attr_reader :description + + # Make this policy the default policy. The default policy is applied to + # every service not specifically assigned to another policy. + attr_reader :is_default + + # The name of the WAF policy. + attr_reader :name + + # Presets enabled on this policy. + attr_reader :protection_presets + + # Rule overrides applied by the policy. + attr_reader :rules + + # Deprecated: Ruleset overrides. Use `protectionPresets` instead. + attr_accessor :rulesets + + # The scope of the WAF policy. + attr_reader :scope + + # Version of the WAF ruleset maintained by Datadog used by this policy. 0 is the default value. + attr_reader :version + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'is_default' => :'isDefault', + :'name' => :'name', + :'protection_presets' => :'protectionPresets', + :'rules' => :'rules', + :'rulesets' => :'rulesets', + :'scope' => :'scope', + :'version' => :'version' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'is_default' => :'Boolean', + :'name' => :'String', + :'protection_presets' => :'Array', + :'rules' => :'Array', + :'rulesets' => :'Array', + :'scope' => :'Array', + :'version' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ApplicationSecurityPolicyUpdateAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'is_default') + self.is_default = attributes[:'is_default'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'protection_presets') + if (value = attributes[:'protection_presets']).is_a?(Array) + self.protection_presets = value + end + end + + if attributes.key?(:'rules') + if (value = attributes[:'rules']).is_a?(Array) + self.rules = value + end + end + + if attributes.key?(:'rulesets') + if (value = attributes[:'rulesets']).is_a?(Array) + self.rulesets = value + end + end + + if attributes.key?(:'scope') + if (value = attributes[:'scope']).is_a?(Array) + self.scope = value + end + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @description.nil? + return false if @is_default.nil? + return false if @name.nil? + return false if @protection_presets.nil? + return false if @rules.nil? + return false if @scope.nil? + return false if @version.nil? + true + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if description.nil? + fail ArgumentError, 'invalid value for "description", description cannot be nil.' + end + @description = description + end + + # Custom attribute writer method with validation + # @param is_default [Object] Object to be assigned + # @!visibility private + def is_default=(is_default) + if is_default.nil? + fail ArgumentError, 'invalid value for "is_default", is_default cannot be nil.' + end + @is_default = is_default + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param protection_presets [Object] Object to be assigned + # @!visibility private + def protection_presets=(protection_presets) + if protection_presets.nil? + fail ArgumentError, 'invalid value for "protection_presets", protection_presets cannot be nil.' + end + @protection_presets = protection_presets + end + + # Custom attribute writer method with validation + # @param rules [Object] Object to be assigned + # @!visibility private + def rules=(rules) + if rules.nil? + fail ArgumentError, 'invalid value for "rules", rules cannot be nil.' + end + @rules = rules + end + + # Custom attribute writer method with validation + # @param scope [Object] Object to be assigned + # @!visibility private + def scope=(scope) + if scope.nil? + fail ArgumentError, 'invalid value for "scope", scope cannot be nil.' + end + @scope = scope + end + + # Custom attribute writer method with validation + # @param version [Object] Object to be assigned + # @!visibility private + def version=(version) + if version.nil? + fail ArgumentError, 'invalid value for "version", version cannot be nil.' + end + @version = version + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + is_default == o.is_default && + name == o.name && + protection_presets == o.protection_presets && + rules == o.rules && + rulesets == o.rulesets && + scope == o.scope && + version == o.version && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, is_default, name, protection_presets, rules, rulesets, scope, version, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/application_security_policy_update_data.rb b/lib/datadog_api_client/v2/models/application_security_policy_update_data.rb new file mode 100644 index 000000000000..ffd02bc371b9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/application_security_policy_update_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Object for a single WAF policy. + class ApplicationSecurityPolicyUpdateData + include BaseGenericModel + + # Update a WAF policy. + attr_reader :attributes + + # The type of the resource. The value should always be `policy`. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'ApplicationSecurityPolicyUpdateAttributes', + :'type' => :'ApplicationSecurityPolicyType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ApplicationSecurityPolicyUpdateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/application_security_policy_update_request.rb b/lib/datadog_api_client/v2/models/application_security_policy_update_request.rb new file mode 100644 index 000000000000..c1d82242eeff --- /dev/null +++ b/lib/datadog_api_client/v2/models/application_security_policy_update_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request object that includes the policy to update. + class ApplicationSecurityPolicyUpdateRequest + include BaseGenericModel + + # Object for a single WAF policy. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'ApplicationSecurityPolicyUpdateData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ApplicationSecurityPolicyUpdateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/application_security_waf_custom_rule_attributes.rb b/lib/datadog_api_client/v2/models/application_security_waf_custom_rule_attributes.rb index 453366eef86b..39d17257f9ad 100644 --- a/lib/datadog_api_client/v2/models/application_security_waf_custom_rule_attributes.rb +++ b/lib/datadog_api_client/v2/models/application_security_waf_custom_rule_attributes.rb @@ -37,7 +37,7 @@ class ApplicationSecurityWafCustomRuleAttributes # Metadata associated with the WAF Custom Rule. attr_accessor :metadata - # The Name of the WAF custom rule. + # The name of the WAF custom rule. attr_reader :name # The path glob for the WAF custom rule. diff --git a/lib/datadog_api_client/v2/models/application_security_waf_custom_rule_create_attributes.rb b/lib/datadog_api_client/v2/models/application_security_waf_custom_rule_create_attributes.rb index dd1ec180f9ff..c9b92e9b79d3 100644 --- a/lib/datadog_api_client/v2/models/application_security_waf_custom_rule_create_attributes.rb +++ b/lib/datadog_api_client/v2/models/application_security_waf_custom_rule_create_attributes.rb @@ -34,7 +34,7 @@ class ApplicationSecurityWafCustomRuleCreateAttributes # Indicates whether the WAF custom rule is enabled. attr_reader :enabled - # The Name of the WAF custom rule. + # The name of the WAF custom rule. attr_reader :name # The path glob for the WAF custom rule. diff --git a/lib/datadog_api_client/v2/models/application_security_waf_custom_rule_update_attributes.rb b/lib/datadog_api_client/v2/models/application_security_waf_custom_rule_update_attributes.rb index d2ea12117143..b4cf5bdf699c 100644 --- a/lib/datadog_api_client/v2/models/application_security_waf_custom_rule_update_attributes.rb +++ b/lib/datadog_api_client/v2/models/application_security_waf_custom_rule_update_attributes.rb @@ -34,7 +34,7 @@ class ApplicationSecurityWafCustomRuleUpdateAttributes # Indicates whether the WAF custom rule is enabled. attr_reader :enabled - # The Name of the WAF custom rule. + # The name of the WAF custom rule. attr_reader :name # The path glob for the WAF custom rule. diff --git a/lib/datadog_api_client/v2/models/custom_ruleset_list_response.rb b/lib/datadog_api_client/v2/models/custom_ruleset_list_response.rb new file mode 100644 index 000000000000..f4cdffdf8712 --- /dev/null +++ b/lib/datadog_api_client/v2/models/custom_ruleset_list_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing a list of custom rulesets for the authenticated organization. + class CustomRulesetListResponse + include BaseGenericModel + + # The list of custom rulesets. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::CustomRulesetListResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/default_rulesets_per_language_data.rb b/lib/datadog_api_client/v2/models/default_rulesets_per_language_data.rb new file mode 100644 index 000000000000..edd2d4840c04 --- /dev/null +++ b/lib/datadog_api_client/v2/models/default_rulesets_per_language_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The primary data object in the default rulesets per language response. + class DefaultRulesetsPerLanguageData + include BaseGenericModel + + # The attributes of the default rulesets per language response, containing the list of default ruleset names. + attr_reader :attributes + + # The language identifier used as the resource identifier. + attr_reader :id + + # Default rulesets per language resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'DefaultRulesetsPerLanguageDataAttributes', + :'id' => :'String', + :'type' => :'DefaultRulesetsPerLanguageDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DefaultRulesetsPerLanguageData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/default_rulesets_per_language_data_attributes.rb b/lib/datadog_api_client/v2/models/default_rulesets_per_language_data_attributes.rb new file mode 100644 index 000000000000..26a406946854 --- /dev/null +++ b/lib/datadog_api_client/v2/models/default_rulesets_per_language_data_attributes.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes of the default rulesets per language response, containing the list of default ruleset names. + class DefaultRulesetsPerLanguageDataAttributes + include BaseGenericModel + + # The list of default ruleset names for the specified programming language. + attr_reader :rulesets + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'rulesets' => :'rulesets' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'rulesets' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DefaultRulesetsPerLanguageDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'rulesets') + if (value = attributes[:'rulesets']).is_a?(Array) + self.rulesets = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @rulesets.nil? + true + end + + # Custom attribute writer method with validation + # @param rulesets [Object] Object to be assigned + # @!visibility private + def rulesets=(rulesets) + if rulesets.nil? + fail ArgumentError, 'invalid value for "rulesets", rulesets cannot be nil.' + end + @rulesets = rulesets + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + rulesets == o.rulesets && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [rulesets, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/default_rulesets_per_language_data_type.rb b/lib/datadog_api_client/v2/models/default_rulesets_per_language_data_type.rb new file mode 100644 index 000000000000..da5d3a358df1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/default_rulesets_per_language_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Default rulesets per language resource type. + class DefaultRulesetsPerLanguageDataType + include BaseEnumModel + + DEFAULT_RULESETS_PER_LANGUAGE = "defaultRulesetsPerLanguage".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/default_rulesets_per_language_response.rb b/lib/datadog_api_client/v2/models/default_rulesets_per_language_response.rb new file mode 100644 index 000000000000..6de6b238395e --- /dev/null +++ b/lib/datadog_api_client/v2/models/default_rulesets_per_language_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The response payload containing the default ruleset names for a programming language. + class DefaultRulesetsPerLanguageResponse + include BaseGenericModel + + # The primary data object in the default rulesets per language response. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'DefaultRulesetsPerLanguageData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DefaultRulesetsPerLanguageResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/get_ast_request.rb b/lib/datadog_api_client/v2/models/get_ast_request.rb new file mode 100644 index 000000000000..946f52312078 --- /dev/null +++ b/lib/datadog_api_client/v2/models/get_ast_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The request payload for parsing source code into an abstract syntax tree. + class GetAstRequest + include BaseGenericModel + + # The primary data object in the get-AST request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'GetAstRequestData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GetAstRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/get_ast_request_data.rb b/lib/datadog_api_client/v2/models/get_ast_request_data.rb new file mode 100644 index 000000000000..729f271e9bd7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/get_ast_request_data.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The primary data object in the get-AST request. + class GetAstRequestData + include BaseGenericModel + + # The attributes of the get-AST request, containing the source code to parse. + attr_reader :attributes + + # An optional identifier for the get-AST request resource. + attr_accessor :id + + # Get AST request resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'GetAstRequestDataAttributes', + :'id' => :'String', + :'type' => :'GetAstRequestDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GetAstRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/get_ast_request_data_attributes.rb b/lib/datadog_api_client/v2/models/get_ast_request_data_attributes.rb new file mode 100644 index 000000000000..4bc8a2e88d20 --- /dev/null +++ b/lib/datadog_api_client/v2/models/get_ast_request_data_attributes.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes of the get-AST request, containing the source code to parse. + class GetAstRequestDataAttributes + include BaseGenericModel + + # The base64-encoded source code to parse into an abstract syntax tree. + attr_reader :code + + # The encoding of the source code file (must be utf-8). + attr_reader :file_encoding + + # The programming language of the source code to parse. + attr_reader :language + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'code' => :'code', + :'file_encoding' => :'file_encoding', + :'language' => :'language' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'code' => :'String', + :'file_encoding' => :'String', + :'language' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GetAstRequestDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'code') + self.code = attributes[:'code'] + end + + if attributes.key?(:'file_encoding') + self.file_encoding = attributes[:'file_encoding'] + end + + if attributes.key?(:'language') + self.language = attributes[:'language'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @code.nil? + return false if @file_encoding.nil? + return false if @language.nil? + true + end + + # Custom attribute writer method with validation + # @param code [Object] Object to be assigned + # @!visibility private + def code=(code) + if code.nil? + fail ArgumentError, 'invalid value for "code", code cannot be nil.' + end + @code = code + end + + # Custom attribute writer method with validation + # @param file_encoding [Object] Object to be assigned + # @!visibility private + def file_encoding=(file_encoding) + if file_encoding.nil? + fail ArgumentError, 'invalid value for "file_encoding", file_encoding cannot be nil.' + end + @file_encoding = file_encoding + end + + # Custom attribute writer method with validation + # @param language [Object] Object to be assigned + # @!visibility private + def language=(language) + if language.nil? + fail ArgumentError, 'invalid value for "language", language cannot be nil.' + end + @language = language + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + code == o.code && + file_encoding == o.file_encoding && + language == o.language && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [code, file_encoding, language, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/get_ast_request_data_type.rb b/lib/datadog_api_client/v2/models/get_ast_request_data_type.rb new file mode 100644 index 000000000000..bdf672352eca --- /dev/null +++ b/lib/datadog_api_client/v2/models/get_ast_request_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Get AST request resource type. + class GetAstRequestDataType + include BaseEnumModel + + GET_AST_REQUEST = "get_ast_request".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/get_ast_response.rb b/lib/datadog_api_client/v2/models/get_ast_response.rb new file mode 100644 index 000000000000..8689b9661a8a --- /dev/null +++ b/lib/datadog_api_client/v2/models/get_ast_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The response payload containing the parsed abstract syntax tree. + class GetAstResponse + include BaseGenericModel + + # The primary data object in the get-AST response. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'GetAstResponseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GetAstResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/get_ast_response_data.rb b/lib/datadog_api_client/v2/models/get_ast_response_data.rb new file mode 100644 index 000000000000..130fc983e388 --- /dev/null +++ b/lib/datadog_api_client/v2/models/get_ast_response_data.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The primary data object in the get-AST response. + class GetAstResponseData + include BaseGenericModel + + # The attributes of the get-AST response, containing the parsed abstract syntax tree. + attr_reader :attributes + + # The identifier of the get-AST response resource. + attr_accessor :id + + # Get AST response resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'GetAstResponseDataAttributes', + :'id' => :'String', + :'type' => :'GetAstResponseDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GetAstResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/get_ast_response_data_attributes.rb b/lib/datadog_api_client/v2/models/get_ast_response_data_attributes.rb new file mode 100644 index 000000000000..606a2f728cab --- /dev/null +++ b/lib/datadog_api_client/v2/models/get_ast_response_data_attributes.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes of the get-AST response, containing the parsed abstract syntax tree. + class GetAstResponseDataAttributes + include BaseGenericModel + + # The parsed abstract syntax tree as a JSON object. + attr_reader :ast + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'ast' => :'ast' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'ast' => :'Hash' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GetAstResponseDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'ast') + self.ast = attributes[:'ast'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @ast.nil? + true + end + + # Custom attribute writer method with validation + # @param ast [Object] Object to be assigned + # @!visibility private + def ast=(ast) + if ast.nil? + fail ArgumentError, 'invalid value for "ast", ast cannot be nil.' + end + @ast = ast + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + ast == o.ast && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [ast, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/get_ast_response_data_type.rb b/lib/datadog_api_client/v2/models/get_ast_response_data_type.rb new file mode 100644 index 000000000000..52a777bc0b95 --- /dev/null +++ b/lib/datadog_api_client/v2/models/get_ast_response_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Get AST response resource type. + class GetAstResponseDataType + include BaseEnumModel + + GET_AST_RESPONSE = "get_ast_response".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/node_types_response.rb b/lib/datadog_api_client/v2/models/node_types_response.rb new file mode 100644 index 000000000000..b49c5d877811 --- /dev/null +++ b/lib/datadog_api_client/v2/models/node_types_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The response payload containing tree-sitter node type definitions for a programming language. + class NodeTypesResponse + include BaseGenericModel + + # The primary data object in the node types response. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'NodeTypesResponseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::NodeTypesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/node_types_response_data.rb b/lib/datadog_api_client/v2/models/node_types_response_data.rb new file mode 100644 index 000000000000..1e370e567163 --- /dev/null +++ b/lib/datadog_api_client/v2/models/node_types_response_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The primary data object in the node types response. + class NodeTypesResponseData + include BaseGenericModel + + # The attributes of the node types response, containing the list of node type definitions for the requested language. + attr_reader :attributes + + # The unique identifier of the node types response resource. + attr_reader :id + + # Get node types response resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'NodeTypesResponseDataAttributes', + :'id' => :'String', + :'type' => :'NodeTypesResponseDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::NodeTypesResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/node_types_response_data_attributes.rb b/lib/datadog_api_client/v2/models/node_types_response_data_attributes.rb new file mode 100644 index 000000000000..d74da5988cd8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/node_types_response_data_attributes.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes of the node types response, containing the list of node type definitions for the requested language. + class NodeTypesResponseDataAttributes + include BaseGenericModel + + # The list of tree-sitter node type definitions for the language. + attr_reader :node_types + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'node_types' => :'node_types' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'node_types' => :'Array>' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::NodeTypesResponseDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'node_types') + if (value = attributes[:'node_types']).is_a?(Array) + self.node_types = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @node_types.nil? + true + end + + # Custom attribute writer method with validation + # @param node_types [Object] Object to be assigned + # @!visibility private + def node_types=(node_types) + if node_types.nil? + fail ArgumentError, 'invalid value for "node_types", node_types cannot be nil.' + end + @node_types = node_types + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + node_types == o.node_types && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [node_types, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/node_types_response_data_type.rb b/lib/datadog_api_client/v2/models/node_types_response_data_type.rb new file mode 100644 index 000000000000..32eb488d36d3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/node_types_response_data_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Get node types response resource type. + class NodeTypesResponseDataType + include BaseEnumModel + + GET_NODE_TYPES_RESPONSE = "get_node_types_response".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/sast_ruleset_data.rb b/lib/datadog_api_client/v2/models/sast_ruleset_data.rb new file mode 100644 index 000000000000..85db8aeb1c0c --- /dev/null +++ b/lib/datadog_api_client/v2/models/sast_ruleset_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The primary data object representing a SAST ruleset. + class SastRulesetData + include BaseGenericModel + + # The attributes of a SAST ruleset, including its name, description, and rules. + attr_reader :attributes + + # The unique identifier of the ruleset resource. + attr_reader :id + + # Rulesets resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SastRulesetDataAttributes', + :'id' => :'String', + :'type' => :'GetMultipleRulesetsResponseDataAttributesRulesetsItemsDataType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SastRulesetData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/sast_ruleset_data_attributes.rb b/lib/datadog_api_client/v2/models/sast_ruleset_data_attributes.rb new file mode 100644 index 000000000000..11058c66c1d9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/sast_ruleset_data_attributes.rb @@ -0,0 +1,188 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The attributes of a SAST ruleset, including its name, description, and rules. + class SastRulesetDataAttributes + include BaseGenericModel + + # A detailed description of the ruleset's purpose and the types of issues it targets. + attr_reader :description + + # The unique name of the ruleset. + attr_reader :name + + # The list of static analysis rules included in this ruleset. + attr_reader :rules + + # A brief summary of the ruleset, suitable for display in listings. + attr_reader :short_description + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'name' => :'name', + :'rules' => :'rules', + :'short_description' => :'short_description' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'name' => :'String', + :'rules' => :'Array', + :'short_description' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SastRulesetDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'rules') + if (value = attributes[:'rules']).is_a?(Array) + self.rules = value + end + end + + if attributes.key?(:'short_description') + self.short_description = attributes[:'short_description'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @description.nil? + return false if @name.nil? + return false if @rules.nil? + return false if @short_description.nil? + true + end + + # Custom attribute writer method with validation + # @param description [Object] Object to be assigned + # @!visibility private + def description=(description) + if description.nil? + fail ArgumentError, 'invalid value for "description", description cannot be nil.' + end + @description = description + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param rules [Object] Object to be assigned + # @!visibility private + def rules=(rules) + if rules.nil? + fail ArgumentError, 'invalid value for "rules", rules cannot be nil.' + end + @rules = rules + end + + # Custom attribute writer method with validation + # @param short_description [Object] Object to be assigned + # @!visibility private + def short_description=(short_description) + if short_description.nil? + fail ArgumentError, 'invalid value for "short_description", short_description cannot be nil.' + end + @short_description = short_description + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + name == o.name && + rules == o.rules && + short_description == o.short_description && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, name, rules, short_description, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/sast_ruleset_response.rb b/lib/datadog_api_client/v2/models/sast_ruleset_response.rb new file mode 100644 index 000000000000..26c51180c76b --- /dev/null +++ b/lib/datadog_api_client/v2/models/sast_ruleset_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The response payload containing a single SAST ruleset and its rules. + class SastRulesetResponse + include BaseGenericModel + + # The primary data object representing a SAST ruleset. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'SastRulesetData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SastRulesetResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/sast_rulesets_response.rb b/lib/datadog_api_client/v2/models/sast_rulesets_response.rb new file mode 100644 index 000000000000..90f8c307ce9e --- /dev/null +++ b/lib/datadog_api_client/v2/models/sast_rulesets_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The response payload containing a list of SAST rulesets and their rules. + class SastRulesetsResponse + include BaseGenericModel + + # The list of SAST rulesets returned in the response. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SastRulesetsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end