diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index b17c8433bd55..51127c3aea27 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -11426,6 +11426,16 @@ components: x-enum-varnames: - EXECUTE_WORKFLOW - ASSIGN_AGENT + AutomationRuleActorType: + description: Whether the actor is a user or the Datadog system. + enum: + - user + - system + example: user + type: string + x-enum-varnames: + - USER + - SYSTEM AutomationRuleAttributes: description: Core attributes of an automation rule, including its name, trigger condition, action to execute, and current state. properties: @@ -11494,6 +11504,42 @@ components: required: - data type: object + AutomationRuleCreatedBy: + description: The user or Datadog system who created the rule. + properties: + id: + description: The actor's identifier (a user UUID or a system identifier). + example: "00000000-0000-0000-0000-000000000000" + type: string + name: + description: The name of the actor. + example: "Jane Doe" + type: string + type: + $ref: "#/components/schemas/AutomationRuleActorType" + required: + - type + - id + - name + type: object + AutomationRuleModifiedBy: + description: The user or Datadog system who last modified the rule. + properties: + id: + description: The actor's identifier (a user UUID or a system identifier). + example: "00000000-0000-0000-0000-000000000000" + type: string + name: + description: The name of the actor. + example: "Jane Doe" + type: string + type: + $ref: "#/components/schemas/AutomationRuleActorType" + required: + - type + - id + - name + type: object AutomationRuleRelationships: description: Related resources for the automation rule, including the users who created and last modified it. properties: @@ -11510,6 +11556,19 @@ components: required: - data type: object + AutomationRuleScope: + description: Defines the scope of findings to which the automation rule applies. + properties: + finding_types: + $ref: "#/components/schemas/SecurityFindingTypes" + query: + description: A search query to further filter the findings matched by this rule. The `@workflow.*` namespace and `@status` fields are not permitted. For a reference of available fields, see the [Security Findings schema documentation](https://docs.datadoghq.com/security/guide/findings-schema/). + example: "env:prod team:platform" + maxLength: 30000 + type: string + required: + - finding_types + type: object AutomationRuleTrigger: description: Defines when the rule activates. Combines a trigger type (the case event to listen for) with optional trigger data (conditions that narrow when the trigger fires). properties: @@ -31697,6 +31756,242 @@ components: - type - attributes type: object + DueDateFrom: + description: The reference point from which the due date is calculated. When `fix_available` is selected but not applicable to the finding type, `first_seen` is used instead. + enum: + - first_seen + - fix_available + example: first_seen + type: string + x-enum-varnames: + - FIRST_SEEN + - FIX_AVAILABLE + DueDatePerSeverityItem: + description: A mapping of a severity level to the number of days until a finding is due. + properties: + due_in_days: + description: The number of days from the reference point until the finding is due. + example: 7 + format: int64 + maximum: 365 + minimum: 1 + type: integer + severity: + $ref: "#/components/schemas/DueDateSeverity" + required: + - severity + - due_in_days + type: object + DueDatePerSeverityList: + description: A list of severity-to-due-date mappings. Each severity may appear at most once. + items: + $ref: "#/components/schemas/DueDatePerSeverityItem" + type: array + DueDateRuleAction: + description: The action to take when the due date rule matches a finding. + properties: + due_days_per_severity: + $ref: "#/components/schemas/DueDatePerSeverityList" + due_from: + $ref: "#/components/schemas/DueDateFrom" + reason_description: + description: An optional description providing more context for the due date assignment. + example: "Applied for production findings only" + maxLength: 20000 + type: string + required: + - due_days_per_severity + - due_from + type: object + DueDateRuleAttributesCreate: + description: Attributes for creating or updating a due date rule. + properties: + action: + $ref: "#/components/schemas/DueDateRuleAction" + enabled: + description: Whether the due date rule is enabled. + example: true + type: boolean + name: + description: The name of the due date rule. + example: "Critical findings due in 7 days" + maxLength: 255 + minLength: 1 + type: string + rule: + $ref: "#/components/schemas/AutomationRuleScope" + required: + - name + - rule + - action + type: object + DueDateRuleAttributesResponse: + description: Attributes of a due date rule returned by the API. + properties: + action: + $ref: "#/components/schemas/DueDateRuleAction" + created_at: + description: The Unix timestamp in milliseconds when the rule was created. + example: 1722439510282 + format: int64 + type: integer + created_by: + $ref: "#/components/schemas/AutomationRuleCreatedBy" + enabled: + description: Whether the due date rule is enabled. + example: true + type: boolean + modified_at: + description: The Unix timestamp in milliseconds when the rule was last modified. + example: 1722439510282 + format: int64 + type: integer + modified_by: + $ref: "#/components/schemas/AutomationRuleModifiedBy" + name: + description: The name of the due date rule. + example: "Critical findings due in 7 days" + maxLength: 255 + minLength: 1 + type: string + rule: + $ref: "#/components/schemas/AutomationRuleScope" + required: + - name + - enabled + - rule + - action + - created_at + - created_by + - modified_at + - modified_by + type: object + DueDateRuleCreateRequest: + description: The body of a due date rule create request. + properties: + data: + $ref: "#/components/schemas/DueDateRuleDataCreate" + required: + - data + type: object + DueDateRuleDataCreate: + description: The data object for a due date rule create or update request. + properties: + attributes: + $ref: "#/components/schemas/DueDateRuleAttributesCreate" + type: + $ref: "#/components/schemas/DueDateRuleType" + required: + - type + - attributes + type: object + DueDateRuleDataResponse: + description: The data object for a due date rule returned by the API. + properties: + attributes: + $ref: "#/components/schemas/DueDateRuleAttributesResponse" + id: + description: The ID of the due date rule. + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + type: + $ref: "#/components/schemas/DueDateRuleType" + required: + - id + - type + - attributes + type: object + DueDateRuleReorderData: + description: The ordered list of all due date rules; every rule must be included. + items: + $ref: "#/components/schemas/DueDateRuleReorderItem" + type: array + DueDateRuleReorderItem: + description: A reference to a due date rule used for reordering. + properties: + id: + description: The ID of the automation rule. + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + type: + $ref: "#/components/schemas/DueDateRuleType" + required: + - type + - id + type: object + DueDateRuleReorderRequest: + description: The body of the due date rule reorder request. + properties: + data: + $ref: "#/components/schemas/DueDateRuleReorderData" + required: + - data + type: object + DueDateRuleResponse: + description: A single due date rule response. + properties: + data: + $ref: "#/components/schemas/DueDateRuleDataResponse" + required: + - data + type: object + DueDateRuleType: + description: The JSON:API type for due date rules. + enum: + - due_date_rules + example: due_date_rules + type: string + x-enum-varnames: + - DUE_DATE_RULES + DueDateRuleUpdateRequest: + description: The body of a due date rule update request. + properties: + data: + $ref: "#/components/schemas/DueDateRuleDataCreate" + required: + - data + type: object + DueDateRulesDataList: + description: A list of due date rule data objects. + items: + $ref: "#/components/schemas/DueDateRuleDataResponse" + type: array + DueDateRulesResponse: + description: A list of due date rules with pagination metadata. + properties: + data: + $ref: "#/components/schemas/DueDateRulesDataList" + links: + $ref: "#/components/schemas/SecurityAutomationRulesLinks" + meta: + $ref: "#/components/schemas/SecurityAutomationRulesMeta" + required: + - data + - meta + - links + type: object + DueDateSeverity: + description: A severity level used to configure due date thresholds. + enum: + - critical + - high + - medium + - low + - info + - none + - unknown + example: critical + type: string + x-enum-varnames: + - CRITICAL + - HIGH + - MEDIUM + - LOW + - INFO + - NONE + - UNKNOWN ELFSourcemapAttributes: description: Attributes of an ELF symbol file. properties: @@ -61121,6 +61416,211 @@ components: - type - id type: object + MuteReason: + description: The reason for muting a security finding. + enum: + - duplicate + - false_positive + - no_fix + - other + - pending_fix + - risk_accepted + example: risk_accepted + type: string + x-enum-varnames: + - DUPLICATE + - FALSE_POSITIVE + - NO_FIX + - OTHER + - PENDING_FIX + - RISK_ACCEPTED + MuteRuleAction: + description: The action to take when the mute rule matches a finding. + properties: + expire_at: + description: The Unix timestamp in milliseconds at which the mute expires. If omitted, the mute does not expire. + example: 4070908800000 + format: int64 + type: integer + reason: + $ref: "#/components/schemas/MuteReason" + reason_description: + description: An optional description providing more context for the mute reason. + example: "Accepted for dev environments only" + maxLength: 20000 + type: string + required: + - reason + type: object + MuteRuleAttributesCreate: + description: Attributes for creating or updating a mute rule. + properties: + action: + $ref: "#/components/schemas/MuteRuleAction" + enabled: + description: Whether the mute rule is enabled. + example: true + type: boolean + name: + description: The name of the mute rule. + example: "Mute accepted risks in dev" + maxLength: 255 + minLength: 1 + type: string + rule: + $ref: "#/components/schemas/AutomationRuleScope" + required: + - name + - rule + - action + type: object + MuteRuleAttributesResponse: + description: Attributes of a mute rule returned by the API. + properties: + action: + $ref: "#/components/schemas/MuteRuleAction" + created_at: + description: The Unix timestamp in milliseconds when the rule was created. + example: 1722439510282 + format: int64 + type: integer + created_by: + $ref: "#/components/schemas/AutomationRuleCreatedBy" + enabled: + description: Whether the mute rule is enabled. + example: true + type: boolean + modified_at: + description: The Unix timestamp in milliseconds when the rule was last modified. + example: 1722439510282 + format: int64 + type: integer + modified_by: + $ref: "#/components/schemas/AutomationRuleModifiedBy" + name: + description: The name of the mute rule. + example: "Mute accepted risks in dev" + maxLength: 255 + minLength: 1 + type: string + rule: + $ref: "#/components/schemas/AutomationRuleScope" + required: + - name + - enabled + - rule + - action + - created_at + - created_by + - modified_at + - modified_by + type: object + MuteRuleCreateRequest: + description: The body of a mute rule create request. + properties: + data: + $ref: "#/components/schemas/MuteRuleDataCreate" + required: + - data + type: object + MuteRuleDataCreate: + description: The data object for a mute rule create or update request. + properties: + attributes: + $ref: "#/components/schemas/MuteRuleAttributesCreate" + type: + $ref: "#/components/schemas/MuteRuleType" + required: + - type + - attributes + type: object + MuteRuleDataResponse: + description: The data object for a mute rule returned by the API. + properties: + attributes: + $ref: "#/components/schemas/MuteRuleAttributesResponse" + id: + description: The ID of the mute rule. + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + type: + $ref: "#/components/schemas/MuteRuleType" + required: + - id + - type + - attributes + type: object + MuteRuleReorderData: + description: The ordered list of all mute rules; every rule must be included. + items: + $ref: "#/components/schemas/MuteRuleReorderItem" + type: array + MuteRuleReorderItem: + description: A reference to a mute rule used for reordering. + properties: + id: + description: The ID of the automation rule. + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + type: + $ref: "#/components/schemas/MuteRuleType" + required: + - type + - id + type: object + MuteRuleReorderRequest: + description: The body of the mute rule reorder request. + properties: + data: + $ref: "#/components/schemas/MuteRuleReorderData" + required: + - data + type: object + MuteRuleResponse: + description: A single mute rule response. + properties: + data: + $ref: "#/components/schemas/MuteRuleDataResponse" + required: + - data + type: object + MuteRuleType: + description: The JSON:API type for mute rules. + enum: + - mute_rules + example: mute_rules + type: string + x-enum-varnames: + - MUTE_RULES + MuteRuleUpdateRequest: + description: The body of a mute rule update request. + properties: + data: + $ref: "#/components/schemas/MuteRuleDataCreate" + required: + - data + type: object + MuteRulesDataList: + description: A list of mute rule data objects. + items: + $ref: "#/components/schemas/MuteRuleDataResponse" + type: array + MuteRulesResponse: + description: A list of mute rules with pagination metadata. + properties: + data: + $ref: "#/components/schemas/MuteRulesDataList" + links: + $ref: "#/components/schemas/SecurityAutomationRulesLinks" + meta: + $ref: "#/components/schemas/SecurityAutomationRulesMeta" + required: + - data + - meta + - links + type: object NDKSourcemapAttributes: description: Attributes of an Android NDK symbol file. properties: @@ -74595,6 +75095,10 @@ components: type: integer product_scales: $ref: "#/components/schemas/RUMProductScales" + remote_config_id: + description: ID of the RUM SDK remote configuration for the application, if one exists. + example: abc12345-1234-5678-abcd-ef1234567890 + type: string type: description: "Type of the RUM application. Supported values are `browser`, `ios`, `android`, `react-native`, `flutter`, `roku`, `electron`, `unity`, `kotlin-multiplatform`." example: browser @@ -79669,6 +80173,380 @@ components: $ref: "#/components/schemas/RumRetentionFilterData" type: array type: object + RumSdkConfigAllowedTracingUrlList: + description: A list of URL configurations for distributed tracing. + items: + $ref: "#/components/schemas/RumSdkConfigTracingUrlConfig" + type: array + RumSdkConfigAllowedTrackingOriginList: + description: A list of origin patterns allowed for cross-origin session tracking. + items: + $ref: "#/components/schemas/RumSdkConfigMatchOption" + type: array + RumSdkConfigAttributes: + description: Attributes of the RUM SDK configuration. + properties: + rum: + $ref: "#/components/schemas/RumSdkConfigRumAttributes" + required: + - rum + type: object + RumSdkConfigData: + description: The RUM SDK configuration data object. + properties: + attributes: + $ref: "#/components/schemas/RumSdkConfigAttributes" + id: + description: The unique identifier of the RUM SDK configuration. + example: "abc12345-1234-5678-abcd-ef1234567890" + type: string + meta: + $ref: "#/components/schemas/RumSdkConfigMeta" + type: + $ref: "#/components/schemas/RumSdkConfigType" + required: + - id + - type + - attributes + type: object + RumSdkConfigDynamicOption: + description: A dynamic configuration option that extracts a value at runtime using a specified strategy. + properties: + attribute: + description: The element attribute to read. Used when `strategy` is `dom`. + example: "data-version" + type: string + extractor: + $ref: "#/components/schemas/RumSdkConfigSerializedRegex" + key: + description: The `localStorage` key to read. Required when `strategy` is `localStorage`. + example: "app.version" + type: string + name: + description: The cookie name to read. Required when `strategy` is `cookie`. + example: "app_version" + type: string + path: + description: The JavaScript path used to extract the value. Required when `strategy` is `js`. + example: "application.version" + type: string + rc_serialized_type: + $ref: "#/components/schemas/RumSdkConfigDynamicOptionSerializedType" + selector: + description: The CSS selector to read from the page. Required when `strategy` is `dom`. + example: "#app-version" + type: string + strategy: + $ref: "#/components/schemas/RumSdkConfigDynamicOptionStrategy" + required: + - rc_serialized_type + - strategy + type: object + RumSdkConfigDynamicOptionPair: + description: A key-value pair where the value is a dynamic configuration option. + properties: + key: + description: The key name for this dynamic configuration pair. + example: "id" + type: string + value: + $ref: "#/components/schemas/RumSdkConfigDynamicOption" + required: + - key + - value + type: object + RumSdkConfigDynamicOptionPairList: + description: A list of dynamic option key-value pairs. + items: + $ref: "#/components/schemas/RumSdkConfigDynamicOptionPair" + type: array + RumSdkConfigDynamicOptionSerializedType: + description: The type identifier for a dynamic option. Always `dynamic`. + enum: + - dynamic + example: dynamic + type: string + x-enum-varnames: + - DYNAMIC + RumSdkConfigDynamicOptionStrategy: + description: The strategy used to extract the dynamic value. + enum: + - js + - cookie + - dom + - localStorage + example: js + type: string + x-enum-varnames: + - JS + - COOKIE + - DOM + - LOCAL_STORAGE + RumSdkConfigMatchOption: + description: A match option used for URL or origin pattern matching. + properties: + rc_serialized_type: + $ref: "#/components/schemas/RumSdkConfigMatchOptionSerializedType" + value: + description: The value to match against. + example: "https://app.datadoghq.com" + type: string + required: + - rc_serialized_type + - value + type: object + RumSdkConfigMatchOptionSerializedType: + description: The type of match pattern, either a literal string or a regex. + enum: + - string + - regex + example: string + type: string + x-enum-varnames: + - STRING + - REGEX + RumSdkConfigMeta: + description: Metadata associated with a RUM SDK configuration. + properties: + updated_at: + description: The timestamp of the last update to this configuration. + example: "2024-01-15T09:30:00.000Z" + format: date-time + type: string + updated_by: + description: The handle of the user who last updated this configuration. + example: "user@datadoghq.com" + type: string + required: + - updated_at + - updated_by + type: object + RumSdkConfigResponse: + description: Response containing a RUM SDK configuration. + properties: + data: + $ref: "#/components/schemas/RumSdkConfigData" + required: + - data + type: object + RumSdkConfigRumAttributes: + description: The RUM SDK settings for a configuration. + properties: + allowed_tracing_urls: + $ref: "#/components/schemas/RumSdkConfigAllowedTracingUrlList" + allowed_tracking_origins: + $ref: "#/components/schemas/RumSdkConfigAllowedTrackingOriginList" + application_id: + description: The ID of the RUM application this configuration belongs to. + example: "f80e917c-3cd0-4048-ade7-1c4c207baa99" + type: string + context: + $ref: "#/components/schemas/RumSdkConfigDynamicOptionPairList" + default_privacy_level: + description: The default privacy masking level applied to all RUM data. + example: "mask-user-input" + type: string + enable_privacy_for_action_name: + description: Whether to mask user-interaction action names for privacy. + example: false + type: boolean + env: + description: The environment tag for the RUM application. + example: "production" + type: string + service: + description: The service name tag for the RUM application. + example: "my-service" + type: string + session_replay_sample_rate: + description: The percentage of collected sessions for which a replay is captured (0–100). + example: 10 + format: int64 + maximum: 100 + minimum: 0 + type: integer + session_sample_rate: + description: The percentage of user sessions to collect (0–100). + example: 50 + format: int64 + maximum: 100 + minimum: 0 + type: integer + trace_sample_rate: + description: The percentage of requests to forward as APM traces (0–100). + example: 100 + format: int64 + maximum: 100 + minimum: 0 + type: integer + track_session_across_subdomains: + description: Whether to share a session across subdomains of the same site. + example: false + type: boolean + user: + $ref: "#/components/schemas/RumSdkConfigDynamicOptionPairList" + version: + $ref: "#/components/schemas/RumSdkConfigDynamicOption" + required: + - application_id + - session_sample_rate + - session_replay_sample_rate + - default_privacy_level + - enable_privacy_for_action_name + type: object + RumSdkConfigRumUpdateAttributes: + description: The RUM SDK settings to apply when updating a configuration. + properties: + allowed_tracing_urls: + $ref: "#/components/schemas/RumSdkConfigAllowedTracingUrlList" + allowed_tracking_origins: + $ref: "#/components/schemas/RumSdkConfigAllowedTrackingOriginList" + context: + $ref: "#/components/schemas/RumSdkConfigDynamicOptionPairList" + default_privacy_level: + description: The default privacy masking level applied to all RUM data. + example: "mask" + type: string + enable_privacy_for_action_name: + description: Whether to mask user-interaction action names for privacy. + example: true + type: boolean + env: + description: The environment tag for the RUM application. + example: "production" + type: string + service: + description: The service name tag for the RUM application. + example: "my-service" + type: string + session_replay_sample_rate: + description: The percentage of collected sessions for which a replay is captured (0–100). + example: 20 + format: int64 + maximum: 100 + minimum: 0 + type: integer + session_sample_rate: + description: The percentage of user sessions to collect (0–100). + example: 75 + format: int64 + maximum: 100 + minimum: 0 + type: integer + trace_sample_rate: + description: The percentage of requests to forward as APM traces (0–100). + example: 100 + format: int64 + maximum: 100 + minimum: 0 + type: integer + track_session_across_subdomains: + description: Whether to share a session across subdomains of the same site. + example: false + type: boolean + user: + $ref: "#/components/schemas/RumSdkConfigDynamicOptionPairList" + version: + $ref: "#/components/schemas/RumSdkConfigDynamicOption" + required: + - session_sample_rate + - session_replay_sample_rate + - default_privacy_level + - enable_privacy_for_action_name + type: object + RumSdkConfigSerializedRegex: + description: A serialized regex used as an extractor in dynamic options. + properties: + rc_serialized_type: + $ref: "#/components/schemas/RumSdkConfigSerializedRegexType" + value: + description: The regex pattern used for extraction. + example: "^https://app-.*.datadoghq.com" + type: string + required: + - rc_serialized_type + - value + type: object + RumSdkConfigSerializedRegexType: + description: The type identifier for a serialized regex. Always `regex`. + enum: + - regex + example: regex + type: string + x-enum-varnames: + - REGEX + RumSdkConfigTracingUrlConfig: + description: Configuration for a URL that should have distributed tracing enabled. + properties: + match: + $ref: "#/components/schemas/RumSdkConfigMatchOption" + propagator_types: + description: The list of trace propagator types to use for this URL. + example: + - datadog + - tracecontext + items: + $ref: "#/components/schemas/RumSdkConfigTracingUrlPropagatorType" + type: array + required: + - match + - propagator_types + type: object + RumSdkConfigTracingUrlPropagatorType: + description: A trace propagator type. + enum: + - datadog + - b3 + - b3multi + - tracecontext + example: datadog + type: string + x-enum-varnames: + - DATADOG + - B3 + - B3MULTI + - TRACECONTEXT + RumSdkConfigType: + default: rum_sdk_config + description: The type of the resource. The value should always be `rum_sdk_config`. + enum: + - rum_sdk_config + example: rum_sdk_config + type: string + x-enum-varnames: + - RUM_SDK_CONFIG + RumSdkConfigUpdateAttributes: + description: Attributes of the RUM SDK configuration to update. + properties: + rum: + $ref: "#/components/schemas/RumSdkConfigRumUpdateAttributes" + required: + - rum + type: object + RumSdkConfigUpdateData: + description: The data object for updating a RUM SDK configuration. + properties: + attributes: + $ref: "#/components/schemas/RumSdkConfigUpdateAttributes" + id: + description: The ID of the RUM SDK configuration to update. + example: "abc12345-1234-5678-abcd-ef1234567890" + type: string + type: + $ref: "#/components/schemas/RumSdkConfigType" + required: + - id + - type + - attributes + type: object + RumSdkConfigUpdateRequest: + description: Request body for updating a RUM SDK configuration. + properties: + data: + $ref: "#/components/schemas/RumSdkConfigUpdateData" + required: + - data + type: object RunDataObservabilityMonitorResponse: description: The response returned when a data observability monitor run is triggered. properties: @@ -82773,6 +83651,48 @@ components: - SYSTEM - LIGHT - DARK + SecurityAutomationRulesLinks: + description: Pagination links for the list of automation rules. + properties: + first: + description: Link to the first page of results. + example: "/api/v2/security/findings/automation/mute_rules?page[size]=10&page[number]=0" + type: string + last: + description: Link to the last page of results. + example: "/api/v2/security/findings/automation/mute_rules?page[size]=10&page[number]=5" + type: string + next: + description: Link to the next page of results. + example: "/api/v2/security/findings/automation/mute_rules?page[size]=10&page[number]=2" + type: string + prev: + description: Link to the previous page of results. + example: "/api/v2/security/findings/automation/mute_rules?page[size]=10&page[number]=0" + type: string + required: + - first + - last + type: object + SecurityAutomationRulesMeta: + description: Metadata for the list of automation rules. + properties: + page: + $ref: "#/components/schemas/SecurityAutomationRulesPageInfo" + required: + - page + type: object + SecurityAutomationRulesPageInfo: + description: Pagination information for the list of automation rules. + properties: + total_filtered_count: + description: The total number of rules matching the current filter. + example: 42 + format: int64 + type: integer + required: + - total_filtered_count + type: object SecurityEntityConfigRisks: description: Configuration risks associated with the entity properties: @@ -83377,6 +84297,42 @@ components: meta: $ref: "#/components/schemas/SecurityFilterMeta" type: object + SecurityFindingType: + description: The type of security finding that the automation rule applies to. + enum: + - api_security + - attack_path + - host_and_container_vulnerability + - iac_misconfiguration + - identity_risk + - library_vulnerability + - misconfiguration + - runtime_code_vulnerability + - secret + - static_code_vulnerability + - workload_activity + example: misconfiguration + type: string + x-enum-varnames: + - API_SECURITY + - ATTACK_PATH + - HOST_AND_CONTAINER_VULNERABILITY + - IAC_MISCONFIGURATION + - IDENTITY_RISK + - LIBRARY_VULNERABILITY + - MISCONFIGURATION + - RUNTIME_CODE_VULNERABILITY + - SECRET + - STATIC_CODE_VULNERABILITY + - WORKLOAD_ACTIVITY + SecurityFindingTypes: + description: The list of security finding types that the automation rule applies to. + example: + - misconfiguration + items: + $ref: "#/components/schemas/SecurityFindingType" + minItems: 1 + type: array SecurityFindingsAttributes: description: The JSON object containing all attributes of the security finding. properties: @@ -101859,6 +102815,255 @@ components: type: string x-enum-varnames: - TEST_OPTIMIZATION_UPDATE_SERVICE_SETTINGS_REQUEST + TicketCreationRuleAction: + description: The action to take when the ticket creation rule matches a finding. + properties: + assignee_id: + description: The UUID of the default assignee for created tickets. + example: "22222222-2222-2222-2222-222222222222" + format: uuid + type: string + fields: + description: Custom fields of the Jira issue to create. For the list of available fields, see [Jira documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-createmeta-projectidorkey-issuetypes-issuetypeid-get). + example: + labels: + - security + type: object + max_tickets_per_day: + description: The maximum number of tickets the rule may create per day. If exceeded, one final ticket will be created, explaining the limit was hit and link back to the responsible rule. + example: 100 + format: int64 + maximum: 500 + minimum: 1 + type: integer + project_id: + description: The UUID of the case management project. + example: "11111111-1111-1111-1111-111111111111" + format: uuid + type: string + target: + $ref: "#/components/schemas/TicketCreationTarget" + required: + - project_id + - target + - max_tickets_per_day + type: object + TicketCreationRuleActionResponse: + description: The action to take when the ticket creation rule matches a finding. + properties: + assignee_id: + description: The UUID of the default assignee for created tickets. + example: "22222222-2222-2222-2222-222222222222" + format: uuid + type: string + auto_disabled_reason: + description: The reason the rule was automatically disabled by the system due to a ticketing integration error. + example: "Daily ticket creation limit exceeded" + type: string + fields: + description: Custom fields of the Jira issue to create. For the list of available fields, see [Jira documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-createmeta-projectidorkey-issuetypes-issuetypeid-get). + example: + labels: + - security + type: object + max_tickets_per_day: + description: The maximum number of tickets the rule may create per day. If exceeded, one final ticket will be created, explaining the limit was hit and link back to the responsible rule. + example: 100 + format: int64 + maximum: 500 + minimum: 1 + type: integer + project_id: + description: The UUID of the case management project. + example: "11111111-1111-1111-1111-111111111111" + format: uuid + type: string + target: + $ref: "#/components/schemas/TicketCreationTarget" + required: + - project_id + - target + - max_tickets_per_day + type: object + TicketCreationRuleAttributesCreate: + description: Attributes for creating or updating a ticket creation rule. + properties: + action: + $ref: "#/components/schemas/TicketCreationRuleAction" + enabled: + description: Whether the ticket creation rule is enabled. + example: true + type: boolean + name: + description: The name of the ticket creation rule. + example: "Auto-create Jira tickets for critical findings" + maxLength: 255 + minLength: 1 + type: string + rule: + $ref: "#/components/schemas/AutomationRuleScope" + required: + - name + - rule + - action + type: object + TicketCreationRuleAttributesResponse: + description: Attributes of a ticket creation rule returned by the API. + properties: + action: + $ref: "#/components/schemas/TicketCreationRuleActionResponse" + created_at: + description: The Unix timestamp in milliseconds when the rule was created. + example: 1722439510282 + format: int64 + type: integer + created_by: + $ref: "#/components/schemas/AutomationRuleCreatedBy" + enabled: + description: Whether the ticket creation rule is enabled. + example: true + type: boolean + modified_at: + description: The Unix timestamp in milliseconds when the rule was last modified. + example: 1722439510282 + format: int64 + type: integer + modified_by: + $ref: "#/components/schemas/AutomationRuleModifiedBy" + name: + description: The name of the ticket creation rule. + example: "Auto-create Jira tickets for critical findings" + maxLength: 255 + minLength: 1 + type: string + rule: + $ref: "#/components/schemas/AutomationRuleScope" + required: + - name + - enabled + - rule + - action + - created_at + - created_by + - modified_at + - modified_by + type: object + TicketCreationRuleCreateRequest: + description: The body of a ticket creation rule create request. + properties: + data: + $ref: "#/components/schemas/TicketCreationRuleDataCreate" + required: + - data + type: object + TicketCreationRuleDataCreate: + description: The data object for a ticket creation rule create or update request. + properties: + attributes: + $ref: "#/components/schemas/TicketCreationRuleAttributesCreate" + type: + $ref: "#/components/schemas/TicketCreationRuleType" + required: + - type + - attributes + type: object + TicketCreationRuleDataResponse: + description: The data object for a ticket creation rule returned by the API. + properties: + attributes: + $ref: "#/components/schemas/TicketCreationRuleAttributesResponse" + id: + description: The ID of the ticket creation rule. + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + type: + $ref: "#/components/schemas/TicketCreationRuleType" + required: + - id + - type + - attributes + type: object + TicketCreationRuleReorderData: + description: The ordered list of all ticket creation rules; every rule must be included. + items: + $ref: "#/components/schemas/TicketCreationRuleReorderItem" + type: array + TicketCreationRuleReorderItem: + description: A reference to a ticket creation rule used for reordering. + properties: + id: + description: The ID of the automation rule. + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + type: + $ref: "#/components/schemas/TicketCreationRuleType" + required: + - type + - id + type: object + TicketCreationRuleReorderRequest: + description: The body of the ticket creation rule reorder request. + properties: + data: + $ref: "#/components/schemas/TicketCreationRuleReorderData" + required: + - data + type: object + TicketCreationRuleResponse: + description: A single ticket creation rule response. + properties: + data: + $ref: "#/components/schemas/TicketCreationRuleDataResponse" + required: + - data + type: object + TicketCreationRuleType: + description: The JSON:API type for ticket creation rules. + enum: + - ticket_creation_rules + example: ticket_creation_rules + type: string + x-enum-varnames: + - TICKET_CREATION_RULES + TicketCreationRuleUpdateRequest: + description: The body of a ticket creation rule update request. + properties: + data: + $ref: "#/components/schemas/TicketCreationRuleDataCreate" + required: + - data + type: object + TicketCreationRulesDataList: + description: A list of ticket creation rule data objects. + items: + $ref: "#/components/schemas/TicketCreationRuleDataResponse" + type: array + TicketCreationRulesResponse: + description: A list of ticket creation rules with pagination metadata. + properties: + data: + $ref: "#/components/schemas/TicketCreationRulesDataList" + links: + $ref: "#/components/schemas/SecurityAutomationRulesLinks" + meta: + $ref: "#/components/schemas/SecurityAutomationRulesMeta" + required: + - data + - meta + - links + type: object + TicketCreationTarget: + description: The ticketing system to create tickets in. + enum: + - jira + - case_management + example: jira + type: string + x-enum-varnames: + - JIRA + - CASE_MANAGEMENT TimeAggregation: description: |- Time aggregation period (in seconds) is used to aggregate the results of the notification rule evaluation. @@ -161510,6 +162715,136 @@ paths: summary: Update a Workload Protection policy tags: ["CSM Threats"] x-codegen-request-body-name: body + /api/v2/remote_config/products/rum/configs/{config_id}: + get: + description: Retrieve a RUM SDK configuration by its identifier. + operationId: GetRumSdkConfig + parameters: + - description: The ID of the RUM SDK configuration. + example: "abc12345-1234-5678-abcd-ef1234567890" + in: path + name: config_id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + rum: + application_id: "f80e917c-3cd0-4048-ade7-1c4c207baa99" + default_privacy_level: "mask-user-input" + enable_privacy_for_action_name: false + env: "production" + service: "my-service" + session_replay_sample_rate: 10 + session_sample_rate: 50 + trace_sample_rate: 100 + track_session_across_subdomains: false + id: "abc12345-1234-5678-abcd-ef1234567890" + meta: + updated_at: "2024-01-15T09:30:00.000Z" + updated_by: "user@datadoghq.com" + type: rum_sdk_config + schema: + $ref: "#/components/schemas/RumSdkConfigResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get a RUM SDK configuration + tags: + - RUM Remote Config + 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: |- + Update an existing RUM SDK configuration by its identifier. + Returns the updated configuration when successful. + operationId: UpdateRumSdkConfig + parameters: + - description: The ID of the RUM SDK configuration. + example: "abc12345-1234-5678-abcd-ef1234567890" + in: path + name: config_id + required: true + schema: + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + rum: + default_privacy_level: "mask" + enable_privacy_for_action_name: true + session_replay_sample_rate: 20 + session_sample_rate: 75 + id: "abc12345-1234-5678-abcd-ef1234567890" + type: rum_sdk_config + schema: + $ref: "#/components/schemas/RumSdkConfigUpdateRequest" + description: The RUM SDK configuration update. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + rum: + application_id: "f80e917c-3cd0-4048-ade7-1c4c207baa99" + default_privacy_level: "mask" + enable_privacy_for_action_name: true + session_replay_sample_rate: 20 + session_sample_rate: 75 + id: "abc12345-1234-5678-abcd-ef1234567890" + type: rum_sdk_config + schema: + $ref: "#/components/schemas/RumSdkConfigResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update a RUM SDK configuration + tags: + - RUM Remote Config + x-codegen-request-body-name: body + 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/replay/heatmap/snapshots: get: description: List heatmap snapshots. @@ -167038,6 +168373,1329 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security/findings/automation/due_date_rules: + get: + description: Get all due date rules for the current organization. + operationId: ListSecurityFindingsAutomationDueDateRules + parameters: + - description: The number of rules per page. Maximum is 1000. + in: query + name: page[size] + required: false + schema: + default: 1000 + example: 10 + format: int64 + maximum: 1000 + minimum: 1 + type: integer + - description: The page number to return. + in: query + name: page[number] + required: false + schema: + default: 0 + example: 0 + format: int64 + minimum: 0 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + action: + due_days_per_severity: + - due_in_days: 7 + severity: critical + - due_in_days: 30 + severity: high + due_from: first_seen + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: true + modified_at: 1722439510282 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Critical findings due in 7 days" + rule: + finding_types: + - misconfiguration + query: "env:prod" + id: "00000000-0000-0000-0000-000000000000" + type: due_date_rules + links: + first: "/api/v2/security/findings/automation/due_date_rules?page[size]=1000&page[number]=0" + last: "/api/v2/security/findings/automation/due_date_rules?page[size]=1000&page[number]=0" + meta: + page: + total_filtered_count: 1 + schema: + $ref: "#/components/schemas/DueDateRulesResponse" + description: Successfully retrieved the list of due date rules + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get all due date rules + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_read + 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 due date rule for the current organization. + operationId: CreateSecurityFindingsAutomationDueDateRule + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + due_days_per_severity: + - due_in_days: 7 + severity: critical + - due_in_days: 30 + severity: high + due_from: first_seen + enabled: true + name: "Critical findings due in 7 days" + rule: + finding_types: + - misconfiguration + query: "env:prod" + type: due_date_rules + schema: + $ref: "#/components/schemas/DueDateRuleCreateRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + due_days_per_severity: + - due_in_days: 7 + severity: critical + - due_in_days: 30 + severity: high + due_from: first_seen + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: true + modified_at: 1722439510282 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Critical findings due in 7 days" + rule: + finding_types: + - misconfiguration + query: "env:prod" + id: "00000000-0000-0000-0000-000000000000" + type: due_date_rules + schema: + $ref: "#/components/schemas/DueDateRuleResponse" + description: Successfully created the due date rule + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/ForbiddenResponse" + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unprocessable Entity + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create a due date rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security/findings/automation/due_date_rules/reorder: + post: + description: Reorder the list of due date rules for the current organization. + operationId: ReorderSecurityFindingsAutomationDueDateRules + requestBody: + content: + application/json: + examples: + default: + value: + data: + - id: "00000000-0000-0000-0000-000000000000" + type: due_date_rules + - id: "11111111-1111-1111-1111-111111111111" + type: due_date_rules + schema: + $ref: "#/components/schemas/DueDateRuleReorderRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - id: "00000000-0000-0000-0000-000000000000" + type: due_date_rules + - id: "11111111-1111-1111-1111-111111111111" + type: due_date_rules + schema: + $ref: "#/components/schemas/DueDateRuleReorderRequest" + description: Successfully reordered the due date rules + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/ForbiddenResponse" + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unprocessable Entity + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Reorder due date rules + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security/findings/automation/due_date_rules/{rule_id}: + delete: + description: Delete an existing due date rule by ID. + operationId: DeleteSecurityFindingsAutomationDueDateRule + parameters: + - description: The ID of the due date rule. + in: path + name: rule_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + responses: + "204": + description: "Rule successfully deleted." + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Delete a due date rule + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_write + 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 the details of a due date rule by ID. + operationId: GetSecurityFindingsAutomationDueDateRule + parameters: + - description: The ID of the due date rule. + in: path + name: rule_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + due_days_per_severity: + - due_in_days: 7 + severity: critical + - due_in_days: 30 + severity: high + due_from: first_seen + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: true + modified_at: 1722439510282 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Critical findings due in 7 days" + rule: + finding_types: + - misconfiguration + query: "env:prod" + id: "00000000-0000-0000-0000-000000000000" + type: due_date_rules + schema: + $ref: "#/components/schemas/DueDateRuleResponse" + description: Successfully retrieved the due date rule + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get a due date rule + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_read + 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: Update an existing due date rule by ID. + operationId: UpdateSecurityFindingsAutomationDueDateRule + parameters: + - description: The ID of the due date rule. + in: path + name: rule_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + due_days_per_severity: + - due_in_days: 7 + severity: critical + - due_in_days: 30 + severity: high + - due_in_days: 90 + severity: medium + due_from: fix_available + enabled: true + name: "Critical findings due in 7 days" + rule: + finding_types: + - misconfiguration + query: "env:prod" + type: due_date_rules + schema: + $ref: "#/components/schemas/DueDateRuleUpdateRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + due_days_per_severity: + - due_in_days: 7 + severity: critical + - due_in_days: 30 + severity: high + - due_in_days: 90 + severity: medium + due_from: fix_available + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: true + modified_at: 1722439510999 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Critical findings due in 7 days" + rule: + finding_types: + - misconfiguration + query: "env:prod" + id: "00000000-0000-0000-0000-000000000000" + type: due_date_rules + schema: + $ref: "#/components/schemas/DueDateRuleResponse" + description: Successfully updated the due date rule + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unprocessable Entity + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Update a due date rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security/findings/automation/mute_rules: + get: + description: Get all mute rules for the current organization. + operationId: ListSecurityFindingsAutomationMuteRules + parameters: + - description: The number of rules per page. Maximum is 1000. + in: query + name: page[size] + required: false + schema: + default: 1000 + example: 10 + format: int64 + maximum: 1000 + minimum: 1 + type: integer + - description: The page number to return. + in: query + name: page[number] + required: false + schema: + default: 0 + example: 0 + format: int64 + minimum: 0 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + action: + expire_at: 4070908800000 + reason: risk_accepted + reason_description: "Accepted for dev environments only" + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: true + modified_at: 1722439510282 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Mute accepted risks in dev" + rule: + finding_types: + - misconfiguration + query: "env:dev team:platform @severity:low" + id: "00000000-0000-0000-0000-000000000000" + type: mute_rules + links: + first: "/api/v2/security/findings/automation/mute_rules?page[size]=1000&page[number]=0" + last: "/api/v2/security/findings/automation/mute_rules?page[size]=1000&page[number]=0" + meta: + page: + total_filtered_count: 1 + schema: + $ref: "#/components/schemas/MuteRulesResponse" + description: Successfully retrieved the list of mute rules + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get all mute rules + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_read + 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 mute rule for the current organization. + operationId: CreateSecurityFindingsAutomationMuteRule + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + expire_at: 4070908800000 + reason: risk_accepted + reason_description: "Accepted for dev environments only" + enabled: true + name: "Mute accepted risks in dev" + rule: + finding_types: + - misconfiguration + query: "env:dev team:platform @severity:low" + type: mute_rules + schema: + $ref: "#/components/schemas/MuteRuleCreateRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + expire_at: 4070908800000 + reason: risk_accepted + reason_description: "Accepted for dev environments only" + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: true + modified_at: 1722439510282 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Mute accepted risks in dev" + rule: + finding_types: + - misconfiguration + query: "env:dev team:platform @severity:low" + id: "00000000-0000-0000-0000-000000000000" + type: mute_rules + schema: + $ref: "#/components/schemas/MuteRuleResponse" + description: Successfully created the mute rule + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/ForbiddenResponse" + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unprocessable Entity + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create a mute rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security/findings/automation/mute_rules/reorder: + post: + description: Reorder the list of mute rules for the current organization. + operationId: ReorderSecurityFindingsAutomationMuteRules + requestBody: + content: + application/json: + examples: + default: + value: + data: + - id: "00000000-0000-0000-0000-000000000000" + type: mute_rules + - id: "11111111-1111-1111-1111-111111111111" + type: mute_rules + schema: + $ref: "#/components/schemas/MuteRuleReorderRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - id: "00000000-0000-0000-0000-000000000000" + type: mute_rules + - id: "11111111-1111-1111-1111-111111111111" + type: mute_rules + schema: + $ref: "#/components/schemas/MuteRuleReorderRequest" + description: Successfully reordered the mute rules + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/ForbiddenResponse" + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unprocessable Entity + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Reorder mute rules + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security/findings/automation/mute_rules/{rule_id}: + delete: + description: Delete an existing mute rule by ID. + operationId: DeleteSecurityFindingsAutomationMuteRule + parameters: + - description: The ID of the mute rule. + in: path + name: rule_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + responses: + "204": + description: "Rule successfully deleted." + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Delete a mute rule + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_write + 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 the details of a mute rule by ID. + operationId: GetSecurityFindingsAutomationMuteRule + parameters: + - description: The ID of the mute rule. + in: path + name: rule_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + expire_at: 4070908800000 + reason: risk_accepted + reason_description: "Accepted for dev environments only" + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: true + modified_at: 1722439510282 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Mute accepted risks in dev" + rule: + finding_types: + - misconfiguration + query: "env:dev team:platform @severity:low" + id: "00000000-0000-0000-0000-000000000000" + type: mute_rules + schema: + $ref: "#/components/schemas/MuteRuleResponse" + description: Successfully retrieved the mute rule + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get a mute rule + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_read + 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: Update an existing mute rule by ID. + operationId: UpdateSecurityFindingsAutomationMuteRule + parameters: + - description: The ID of the mute rule. + in: path + name: rule_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + reason: risk_accepted + enabled: false + name: "Mute accepted risks in dev" + rule: + finding_types: + - misconfiguration + query: "env:dev" + type: mute_rules + schema: + $ref: "#/components/schemas/MuteRuleUpdateRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + reason: risk_accepted + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: false + modified_at: 1722439510999 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Mute accepted risks in dev" + rule: + finding_types: + - misconfiguration + query: "env:dev" + id: "00000000-0000-0000-0000-000000000000" + type: mute_rules + schema: + $ref: "#/components/schemas/MuteRuleResponse" + description: Successfully updated the mute rule + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unprocessable Entity + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Update a mute rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security/findings/automation/ticket_creation_rules: + get: + description: Get all ticket creation rules for the current organization. + operationId: ListSecurityFindingsAutomationTicketCreationRules + parameters: + - description: The number of rules per page. Maximum is 1000. + in: query + name: page[size] + required: false + schema: + default: 1000 + example: 10 + format: int64 + maximum: 1000 + minimum: 1 + type: integer + - description: The page number to return. + in: query + name: page[number] + required: false + schema: + default: 0 + example: 0 + format: int64 + minimum: 0 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + action: + max_tickets_per_day: 100 + project_id: "11111111-1111-1111-1111-111111111111" + target: jira + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: true + modified_at: 1722439510282 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Auto-create Jira tickets for critical findings" + rule: + finding_types: + - misconfiguration + query: "env:prod" + id: "00000000-0000-0000-0000-000000000000" + type: ticket_creation_rules + links: + first: "/api/v2/security/findings/automation/ticket_creation_rules?page[size]=1000&page[number]=0" + last: "/api/v2/security/findings/automation/ticket_creation_rules?page[size]=1000&page[number]=0" + meta: + page: + total_filtered_count: 1 + schema: + $ref: "#/components/schemas/TicketCreationRulesResponse" + description: Successfully retrieved the list of ticket creation rules + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get all ticket creation rules + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_read + 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 ticket creation rule for the current organization. + operationId: CreateSecurityFindingsAutomationTicketCreationRule + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + max_tickets_per_day: 100 + project_id: "11111111-1111-1111-1111-111111111111" + target: jira + enabled: true + name: "Auto-create Jira tickets for critical findings" + rule: + finding_types: + - misconfiguration + query: "env:prod" + type: ticket_creation_rules + schema: + $ref: "#/components/schemas/TicketCreationRuleCreateRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + max_tickets_per_day: 100 + project_id: "11111111-1111-1111-1111-111111111111" + target: jira + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: true + modified_at: 1722439510282 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Auto-create Jira tickets for critical findings" + rule: + finding_types: + - misconfiguration + query: "env:prod" + id: "00000000-0000-0000-0000-000000000000" + type: ticket_creation_rules + schema: + $ref: "#/components/schemas/TicketCreationRuleResponse" + description: Successfully created the ticket creation rule + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/ForbiddenResponse" + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unprocessable Entity + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create a ticket creation rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security/findings/automation/ticket_creation_rules/reorder: + post: + description: Reorder the list of ticket creation rules for the current organization. + operationId: ReorderSecurityFindingsAutomationTicketCreationRules + requestBody: + content: + application/json: + examples: + default: + value: + data: + - id: "00000000-0000-0000-0000-000000000000" + type: ticket_creation_rules + - id: "11111111-1111-1111-1111-111111111111" + type: ticket_creation_rules + schema: + $ref: "#/components/schemas/TicketCreationRuleReorderRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - id: "00000000-0000-0000-0000-000000000000" + type: ticket_creation_rules + - id: "11111111-1111-1111-1111-111111111111" + type: ticket_creation_rules + schema: + $ref: "#/components/schemas/TicketCreationRuleReorderRequest" + description: Successfully reordered the ticket creation rules + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/ForbiddenResponse" + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unprocessable Entity + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Reorder ticket creation rules + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security/findings/automation/ticket_creation_rules/{rule_id}: + delete: + description: Delete an existing ticket creation rule by ID. + operationId: DeleteSecurityFindingsAutomationTicketCreationRule + parameters: + - description: The ID of the ticket creation rule. + in: path + name: rule_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + responses: + "204": + description: "Rule successfully deleted." + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Delete a ticket creation rule + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_write + 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 the details of a ticket creation rule by ID. + operationId: GetSecurityFindingsAutomationTicketCreationRule + parameters: + - description: The ID of the ticket creation rule. + in: path + name: rule_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + max_tickets_per_day: 100 + project_id: "11111111-1111-1111-1111-111111111111" + target: jira + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: true + modified_at: 1722439510282 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Auto-create Jira tickets for critical findings" + rule: + finding_types: + - misconfiguration + query: "env:prod" + id: "00000000-0000-0000-0000-000000000000" + type: ticket_creation_rules + schema: + $ref: "#/components/schemas/TicketCreationRuleResponse" + description: Successfully retrieved the ticket creation rule + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get a ticket creation rule + tags: + - Security Monitoring + x-permission: + operator: OR + permissions: + - security_pipelines_read + 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: Update an existing ticket creation rule by ID. + operationId: UpdateSecurityFindingsAutomationTicketCreationRule + parameters: + - description: The ID of the ticket creation rule. + in: path + name: rule_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000000" + format: uuid + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + max_tickets_per_day: 50 + project_id: "11111111-1111-1111-1111-111111111111" + target: jira + enabled: true + name: "Auto-create Jira tickets for critical findings" + rule: + finding_types: + - misconfiguration + query: "env:prod" + type: ticket_creation_rules + schema: + $ref: "#/components/schemas/TicketCreationRuleUpdateRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + action: + max_tickets_per_day: 50 + project_id: "11111111-1111-1111-1111-111111111111" + target: jira + created_at: 1722439510282 + created_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + enabled: true + modified_at: 1722439510999 + modified_by: + id: "00000000-0000-0000-0000-000000000000" + name: "Jane Doe" + type: user + name: "Auto-create Jira tickets for critical findings" + rule: + finding_types: + - misconfiguration + query: "env:prod" + id: "00000000-0000-0000-0000-000000000000" + type: ticket_creation_rules + schema: + $ref: "#/components/schemas/TicketCreationRuleResponse" + description: Successfully updated the ticket creation rule + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unprocessable Entity + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Update a ticket creation rule + tags: + - Security Monitoring + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - security_pipelines_write + x-unstable: |- + **Note**: This endpoint is in Preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/security/findings/cases: delete: description: >- @@ -190732,6 +193390,12 @@ tags: - description: |- Get insights into the performance of your Real User Monitoring (RUM) applications over HTTP. See the [RUM & Session Replay page](https://docs.datadoghq.com/real_user_monitoring/) for more information name: RUM Insights + - description: |- + Manage [RUM SDK configurations](https://docs.datadoghq.com/real_user_monitoring/) delivered to RUM applications via Remote Configuration. + externalDocs: + description: Find out more at + url: https://docs.datadoghq.com/real_user_monitoring/ + name: RUM Remote Config - description: View and manage Reference Tables in your organization. name: Reference Tables - description: |- diff --git a/cassettes/features/v2/rum_remote_config/Get-a-RUM-SDK-configuration-returns-Forbidden-response.frozen b/cassettes/features/v2/rum_remote_config/Get-a-RUM-SDK-configuration-returns-Forbidden-response.frozen new file mode 100644 index 000000000000..cbb7fdd824a1 --- /dev/null +++ b/cassettes/features/v2/rum_remote_config/Get-a-RUM-SDK-configuration-returns-Forbidden-response.frozen @@ -0,0 +1 @@ +2026-06-17T12:36:53.338Z \ No newline at end of file diff --git a/cassettes/features/v2/rum_remote_config/Get-a-RUM-SDK-configuration-returns-Forbidden-response.yml b/cassettes/features/v2/rum_remote_config/Get-a-RUM-SDK-configuration-returns-Forbidden-response.yml new file mode 100644 index 000000000000..09e67b3fc58c --- /dev/null +++ b/cassettes/features/v2/rum_remote_config/Get-a-RUM-SDK-configuration-returns-Forbidden-response.yml @@ -0,0 +1,22 @@ +http_interactions: +- recorded_at: Wed, 17 Jun 2026 12:36:53 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/remote_config/products/rum/configs/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa + response: + body: + encoding: UTF-8 + string: '{"errors":[{"title":"Forbidden"}]} + + ' + headers: + Content-Type: + - text/plain; charset=utf-8 + status: + code: 403 + message: Forbidden +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/rum_remote_config/Update-a-RUM-SDK-configuration-returns-Forbidden-response.frozen b/cassettes/features/v2/rum_remote_config/Update-a-RUM-SDK-configuration-returns-Forbidden-response.frozen new file mode 100644 index 000000000000..9f95eabe3eb1 --- /dev/null +++ b/cassettes/features/v2/rum_remote_config/Update-a-RUM-SDK-configuration-returns-Forbidden-response.frozen @@ -0,0 +1 @@ +2026-06-17T12:36:53.745Z \ No newline at end of file diff --git a/cassettes/features/v2/rum_remote_config/Update-a-RUM-SDK-configuration-returns-Forbidden-response.yml b/cassettes/features/v2/rum_remote_config/Update-a-RUM-SDK-configuration-returns-Forbidden-response.yml new file mode 100644 index 000000000000..08660de51504 --- /dev/null +++ b/cassettes/features/v2/rum_remote_config/Update-a-RUM-SDK-configuration-returns-Forbidden-response.yml @@ -0,0 +1,26 @@ +http_interactions: +- recorded_at: Wed, 17 Jun 2026 12:36:53 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"rum":{"default_privacy_level":"mask","enable_privacy_for_action_name":true,"session_replay_sample_rate":20,"session_sample_rate":75}},"id":"aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa","type":"rum_sdk_config"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/remote_config/products/rum/configs/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa + response: + body: + encoding: UTF-8 + string: '{"errors":[{"title":"Forbidden"}]} + + ' + headers: + Content-Type: + - text/plain; charset=utf-8 + status: + code: 403 + message: Forbidden +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Create-a-due-date-rule-returns-Successfully-created-the-due-date-rule-response.frozen b/cassettes/features/v2/security_monitoring/Create-a-due-date-rule-returns-Successfully-created-the-due-date-rule-response.frozen new file mode 100644 index 000000000000..f80d953763de --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-a-due-date-rule-returns-Successfully-created-the-due-date-rule-response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:00.178Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Create-a-due-date-rule-returns-Successfully-created-the-due-date-rule-response.yml b/cassettes/features/v2/security_monitoring/Create-a-due-date-rule-returns-Successfully-created-the-due-date-rule-response.yml new file mode 100644 index 000000000000..a8e77704dfc8 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-a-due-date-rule-returns-Successfully-created-the-due-date-rule-response.yml @@ -0,0 +1,42 @@ +http_interactions: +- recorded_at: Tue, 16 Jun 2026 15:41:00 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"due_days_per_severity":[{"due_in_days":7,"severity":"critical"}],"due_from":"first_seen"},"enabled":true,"name":"Test-Create_a_due_date_rule_returns_Successfully_created_the_due_date_rule_response-1781624460","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"due_date_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/due_date_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"51eb64b5-a519-408a-961a-137e4fe31d3c","type":"due_date_rules","attributes":{"action":{"due_days_per_severity":[{"severity":"critical","due_in_days":7}],"due_from":"first_seen"},"created_at":1781624462372,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624462372,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Create_a_due_date_rule_returns_Successfully_created_the_due_date_rule_response-1781624460","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Tue, 16 Jun 2026 15:41:00 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/due_date_rules/51eb64b5-a519-408a-961a-137e4fe31d3c + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Create-a-mute-rule-returns-Successfully-created-the-mute-rule-response.frozen b/cassettes/features/v2/security_monitoring/Create-a-mute-rule-returns-Successfully-created-the-mute-rule-response.frozen new file mode 100644 index 000000000000..43ceab11038d --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-a-mute-rule-returns-Successfully-created-the-mute-rule-response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:02.989Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Create-a-mute-rule-returns-Successfully-created-the-mute-rule-response.yml b/cassettes/features/v2/security_monitoring/Create-a-mute-rule-returns-Successfully-created-the-mute-rule-response.yml new file mode 100644 index 000000000000..05cbab1629e9 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-a-mute-rule-returns-Successfully-created-the-mute-rule-response.yml @@ -0,0 +1,42 @@ +http_interactions: +- recorded_at: Tue, 16 Jun 2026 15:41:02 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"reason":"risk_accepted"},"enabled":true,"name":"Test-Create_a_mute_rule_returns_Successfully_created_the_mute_rule_response-1781624462","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"mute_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/mute_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"a23423e0-da14-4698-9c01-7897eb56b76c","type":"mute_rules","attributes":{"action":{"reason":"risk_accepted"},"created_at":1781624463227,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624463227,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Create_a_mute_rule_returns_Successfully_created_the_mute_rule_response-1781624462","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Tue, 16 Jun 2026 15:41:02 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/mute_rules/a23423e0-da14-4698-9c01-7897eb56b76c + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Create-a-ticket-creation-rule-returns-Successfully-created-the-ticket-creation-rule-response.frozen b/cassettes/features/v2/security_monitoring/Create-a-ticket-creation-rule-returns-Successfully-created-the-ticket-creation-rule-response.frozen new file mode 100644 index 000000000000..65bc80d9bdd3 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-a-ticket-creation-rule-returns-Successfully-created-the-ticket-creation-rule-response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:03.837Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Create-a-ticket-creation-rule-returns-Successfully-created-the-ticket-creation-rule-response.yml b/cassettes/features/v2/security_monitoring/Create-a-ticket-creation-rule-returns-Successfully-created-the-ticket-creation-rule-response.yml new file mode 100644 index 000000000000..8eb001f2fa58 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Create-a-ticket-creation-rule-returns-Successfully-created-the-ticket-creation-rule-response.yml @@ -0,0 +1,42 @@ +http_interactions: +- recorded_at: Tue, 16 Jun 2026 15:41:03 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"max_tickets_per_day":10,"project_id":"11111111-1111-1111-1111-111111111111","target":"jira"},"enabled":true,"name":"Test-Create_a_ticket_creation_rule_returns_Successfully_created_the_ticket_creation_rule_response-1781624463","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"ticket_creation_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/ticket_creation_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"c24fb7cb-e877-491e-ae6e-2e8676b20dcb","type":"ticket_creation_rules","attributes":{"action":{"project_id":"11111111-1111-1111-1111-111111111111","target":"jira","max_tickets_per_day":10},"created_at":1781624464096,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624464096,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Create_a_ticket_creation_rule_returns_Successfully_created_the_ticket_creation_rule_response-1781624463","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Tue, 16 Jun 2026 15:41:03 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/ticket_creation_rules/c24fb7cb-e877-491e-ae6e-2e8676b20dcb + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Delete-a-due-date-rule-returns-Rule-successfully-deleted-response.frozen b/cassettes/features/v2/security_monitoring/Delete-a-due-date-rule-returns-Rule-successfully-deleted-response.frozen new file mode 100644 index 000000000000..a1ce40185985 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Delete-a-due-date-rule-returns-Rule-successfully-deleted-response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:04.669Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Delete-a-due-date-rule-returns-Rule-successfully-deleted-response.yml b/cassettes/features/v2/security_monitoring/Delete-a-due-date-rule-returns-Rule-successfully-deleted-response.yml new file mode 100644 index 000000000000..b622e24ce921 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Delete-a-due-date-rule-returns-Rule-successfully-deleted-response.yml @@ -0,0 +1,61 @@ +http_interactions: +- recorded_at: Tue, 16 Jun 2026 15:41:04 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"due_days_per_severity":[{"due_in_days":7,"severity":"critical"}],"due_from":"first_seen"},"enabled":true,"name":"Test-Delete_a_due_date_rule_returns_Rule_successfully_deleted_response-1781624464","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"due_date_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/due_date_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"139c64ad-97f6-4b26-8579-05a2e2792b6c","type":"due_date_rules","attributes":{"action":{"due_days_per_severity":[{"severity":"critical","due_in_days":7}],"due_from":"first_seen"},"created_at":1781624464907,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624464907,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Delete_a_due_date_rule_returns_Rule_successfully_deleted_response-1781624464","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Tue, 16 Jun 2026 15:41:04 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/due_date_rules/139c64ad-97f6-4b26-8579-05a2e2792b6c + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Tue, 16 Jun 2026 15:41:04 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/due_date_rules/139c64ad-97f6-4b26-8579-05a2e2792b6c + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"rule does + not exist"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Delete-a-mute-rule-returns-Rule-successfully-deleted-response.frozen b/cassettes/features/v2/security_monitoring/Delete-a-mute-rule-returns-Rule-successfully-deleted-response.frozen new file mode 100644 index 000000000000..09f9f0ac5198 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Delete-a-mute-rule-returns-Rule-successfully-deleted-response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:05.734Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Delete-a-mute-rule-returns-Rule-successfully-deleted-response.yml b/cassettes/features/v2/security_monitoring/Delete-a-mute-rule-returns-Rule-successfully-deleted-response.yml new file mode 100644 index 000000000000..076a10ce6b3b --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Delete-a-mute-rule-returns-Rule-successfully-deleted-response.yml @@ -0,0 +1,61 @@ +http_interactions: +- recorded_at: Tue, 16 Jun 2026 15:41:05 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"reason":"risk_accepted"},"enabled":true,"name":"Test-Delete_a_mute_rule_returns_Rule_successfully_deleted_response-1781624465","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"mute_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/mute_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"03c9e010-5a46-40b2-af26-5ff613828897","type":"mute_rules","attributes":{"action":{"reason":"risk_accepted"},"created_at":1781624465962,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624465962,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Delete_a_mute_rule_returns_Rule_successfully_deleted_response-1781624465","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Tue, 16 Jun 2026 15:41:05 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/mute_rules/03c9e010-5a46-40b2-af26-5ff613828897 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Tue, 16 Jun 2026 15:41:05 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/mute_rules/03c9e010-5a46-40b2-af26-5ff613828897 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"rule does + not exist"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Delete-a-ticket-creation-rule-returns-Rule-successfully-deleted-response.frozen b/cassettes/features/v2/security_monitoring/Delete-a-ticket-creation-rule-returns-Rule-successfully-deleted-response.frozen new file mode 100644 index 000000000000..6ce75cad4ac4 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Delete-a-ticket-creation-rule-returns-Rule-successfully-deleted-response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:06.806Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Delete-a-ticket-creation-rule-returns-Rule-successfully-deleted-response.yml b/cassettes/features/v2/security_monitoring/Delete-a-ticket-creation-rule-returns-Rule-successfully-deleted-response.yml new file mode 100644 index 000000000000..d8f15ca46675 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Delete-a-ticket-creation-rule-returns-Rule-successfully-deleted-response.yml @@ -0,0 +1,61 @@ +http_interactions: +- recorded_at: Tue, 16 Jun 2026 15:41:06 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"max_tickets_per_day":10,"project_id":"11111111-1111-1111-1111-111111111111","target":"jira"},"enabled":true,"name":"Test-Delete_a_ticket_creation_rule_returns_Rule_successfully_deleted_response-1781624466","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"ticket_creation_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/ticket_creation_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"6b2c813c-cd92-4531-b4aa-f79e1194bcb2","type":"ticket_creation_rules","attributes":{"action":{"project_id":"11111111-1111-1111-1111-111111111111","target":"jira","max_tickets_per_day":10},"created_at":1781624467064,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624467064,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Delete_a_ticket_creation_rule_returns_Rule_successfully_deleted_response-1781624466","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Tue, 16 Jun 2026 15:41:06 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/ticket_creation_rules/6b2c813c-cd92-4531-b4aa-f79e1194bcb2 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +- recorded_at: Tue, 16 Jun 2026 15:41:06 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/ticket_creation_rules/6b2c813c-cd92-4531-b4aa-f79e1194bcb2 + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found","detail":"rule does + not exist"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Get-a-due-date-rule-returns-Successfully-retrieved-the-due-date-rule-response.frozen b/cassettes/features/v2/security_monitoring/Get-a-due-date-rule-returns-Successfully-retrieved-the-due-date-rule-response.frozen new file mode 100644 index 000000000000..55413b6c7b7e --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-a-due-date-rule-returns-Successfully-retrieved-the-due-date-rule-response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:07.946Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Get-a-due-date-rule-returns-Successfully-retrieved-the-due-date-rule-response.yml b/cassettes/features/v2/security_monitoring/Get-a-due-date-rule-returns-Successfully-retrieved-the-due-date-rule-response.yml new file mode 100644 index 000000000000..14804b08e4f2 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-a-due-date-rule-returns-Successfully-retrieved-the-due-date-rule-response.yml @@ -0,0 +1,62 @@ +http_interactions: +- recorded_at: Tue, 16 Jun 2026 15:41:07 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"due_days_per_severity":[{"due_in_days":7,"severity":"critical"}],"due_from":"first_seen"},"enabled":true,"name":"Test-Get_a_due_date_rule_returns_Successfully_retrieved_the_due_date_rule_response-1781624467","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"due_date_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/due_date_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"7842abcf-795f-47cd-b6ba-6e05790668d5","type":"due_date_rules","attributes":{"action":{"due_days_per_severity":[{"severity":"critical","due_in_days":7}],"due_from":"first_seen"},"created_at":1781624468200,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624468200,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Get_a_due_date_rule_returns_Successfully_retrieved_the_due_date_rule_response-1781624467","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Tue, 16 Jun 2026 15:41:07 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/security/findings/automation/due_date_rules/7842abcf-795f-47cd-b6ba-6e05790668d5 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"7842abcf-795f-47cd-b6ba-6e05790668d5","type":"due_date_rules","attributes":{"action":{"due_days_per_severity":[{"severity":"critical","due_in_days":7}],"due_from":"first_seen"},"created_at":1781624468200,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624468200,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Get_a_due_date_rule_returns_Successfully_retrieved_the_due_date_rule_response-1781624467","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Tue, 16 Jun 2026 15:41:07 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/due_date_rules/7842abcf-795f-47cd-b6ba-6e05790668d5 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Get-a-mute-rule-returns-Successfully-retrieved-the-mute-rule-response.frozen b/cassettes/features/v2/security_monitoring/Get-a-mute-rule-returns-Successfully-retrieved-the-mute-rule-response.frozen new file mode 100644 index 000000000000..865b604abfc3 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-a-mute-rule-returns-Successfully-retrieved-the-mute-rule-response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:09.039Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Get-a-mute-rule-returns-Successfully-retrieved-the-mute-rule-response.yml b/cassettes/features/v2/security_monitoring/Get-a-mute-rule-returns-Successfully-retrieved-the-mute-rule-response.yml new file mode 100644 index 000000000000..339c4b84177c --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-a-mute-rule-returns-Successfully-retrieved-the-mute-rule-response.yml @@ -0,0 +1,62 @@ +http_interactions: +- recorded_at: Tue, 16 Jun 2026 15:41:09 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"reason":"risk_accepted"},"enabled":true,"name":"Test-Get_a_mute_rule_returns_Successfully_retrieved_the_mute_rule_response-1781624469","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"mute_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/mute_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"66330741-04f8-43cc-8cd0-a4840a593658","type":"mute_rules","attributes":{"action":{"reason":"risk_accepted"},"created_at":1781624469277,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624469277,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Get_a_mute_rule_returns_Successfully_retrieved_the_mute_rule_response-1781624469","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Tue, 16 Jun 2026 15:41:09 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/security/findings/automation/mute_rules/66330741-04f8-43cc-8cd0-a4840a593658 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"66330741-04f8-43cc-8cd0-a4840a593658","type":"mute_rules","attributes":{"action":{"reason":"risk_accepted"},"created_at":1781624469277,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624469277,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Get_a_mute_rule_returns_Successfully_retrieved_the_mute_rule_response-1781624469","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Tue, 16 Jun 2026 15:41:09 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/mute_rules/66330741-04f8-43cc-8cd0-a4840a593658 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Get-a-ticket-creation-rule-returns-Successfully-retrieved-the-ticket-creation-rule-response.frozen b/cassettes/features/v2/security_monitoring/Get-a-ticket-creation-rule-returns-Successfully-retrieved-the-ticket-creation-rule-response.frozen new file mode 100644 index 000000000000..392abe6d03de --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-a-ticket-creation-rule-returns-Successfully-retrieved-the-ticket-creation-rule-response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:10.163Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Get-a-ticket-creation-rule-returns-Successfully-retrieved-the-ticket-creation-rule-response.yml b/cassettes/features/v2/security_monitoring/Get-a-ticket-creation-rule-returns-Successfully-retrieved-the-ticket-creation-rule-response.yml new file mode 100644 index 000000000000..feb306c1234a --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-a-ticket-creation-rule-returns-Successfully-retrieved-the-ticket-creation-rule-response.yml @@ -0,0 +1,62 @@ +http_interactions: +- recorded_at: Tue, 16 Jun 2026 15:41:10 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"max_tickets_per_day":10,"project_id":"11111111-1111-1111-1111-111111111111","target":"jira"},"enabled":true,"name":"Test-Get_a_ticket_creation_rule_returns_Successfully_retrieved_the_ticket_creation_rule_response-1781624470","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"ticket_creation_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/ticket_creation_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"065f00af-171c-4ecc-853d-ddb4c8e30c7b","type":"ticket_creation_rules","attributes":{"action":{"project_id":"11111111-1111-1111-1111-111111111111","target":"jira","max_tickets_per_day":10},"created_at":1781624470412,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624470412,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Get_a_ticket_creation_rule_returns_Successfully_retrieved_the_ticket_creation_rule_response-1781624470","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Tue, 16 Jun 2026 15:41:10 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/security/findings/automation/ticket_creation_rules/065f00af-171c-4ecc-853d-ddb4c8e30c7b + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"065f00af-171c-4ecc-853d-ddb4c8e30c7b","type":"ticket_creation_rules","attributes":{"action":{"project_id":"11111111-1111-1111-1111-111111111111","target":"jira","max_tickets_per_day":10},"created_at":1781624470412,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624470412,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Get_a_ticket_creation_rule_returns_Successfully_retrieved_the_ticket_creation_rule_response-1781624470","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Tue, 16 Jun 2026 15:41:10 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/ticket_creation_rules/065f00af-171c-4ecc-853d-ddb4c8e30c7b + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Get-all-due-date-rules-returns-Successfully-retrieved-the-list-of-due-date-rules-response.frozen b/cassettes/features/v2/security_monitoring/Get-all-due-date-rules-returns-Successfully-retrieved-the-list-of-due-date-rules-response.frozen new file mode 100644 index 000000000000..2f74959337e7 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-all-due-date-rules-returns-Successfully-retrieved-the-list-of-due-date-rules-response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:11.482Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Get-all-due-date-rules-returns-Successfully-retrieved-the-list-of-due-date-rules-response.yml b/cassettes/features/v2/security_monitoring/Get-all-due-date-rules-returns-Successfully-retrieved-the-list-of-due-date-rules-response.yml new file mode 100644 index 000000000000..4f8348c8a433 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-all-due-date-rules-returns-Successfully-retrieved-the-list-of-due-date-rules-response.yml @@ -0,0 +1,62 @@ +http_interactions: +- recorded_at: Tue, 16 Jun 2026 15:41:11 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"due_days_per_severity":[{"due_in_days":7,"severity":"critical"}],"due_from":"first_seen"},"enabled":true,"name":"Test-Get_all_due_date_rules_returns_Successfully_retrieved_the_list_of_due_date_rules_response-1781624471","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"due_date_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/due_date_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"1c8622b9-591f-472c-97ff-cac4c5a7cfe5","type":"due_date_rules","attributes":{"action":{"due_days_per_severity":[{"severity":"critical","due_in_days":7}],"due_from":"first_seen"},"created_at":1781624471720,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624471720,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Get_all_due_date_rules_returns_Successfully_retrieved_the_list_of_due_date_rules_response-1781624471","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Tue, 16 Jun 2026 15:41:11 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/security/findings/automation/due_date_rules + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"1c8622b9-591f-472c-97ff-cac4c5a7cfe5","type":"due_date_rules","attributes":{"action":{"due_days_per_severity":[{"severity":"critical","due_in_days":7}],"due_from":"first_seen"},"created_at":1781624471720,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624471720,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Get_all_due_date_rules_returns_Successfully_retrieved_the_list_of_due_date_rules_response-1781624471","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}],"meta":{"page":{"total_filtered_count":1}},"links":{"first":"/api/v2/security/findings/automation/due_date_rules?page[size]=1000\u0026page[number]=0","last":"/api/v2/security/findings/automation/due_date_rules?page[size]=1000\u0026page[number]=0"}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Tue, 16 Jun 2026 15:41:11 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/due_date_rules/1c8622b9-591f-472c-97ff-cac4c5a7cfe5 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Get-all-mute-rules-returns-Successfully-retrieved-the-list-of-mute-rules-response.frozen b/cassettes/features/v2/security_monitoring/Get-all-mute-rules-returns-Successfully-retrieved-the-list-of-mute-rules-response.frozen new file mode 100644 index 000000000000..89c620816ba6 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-all-mute-rules-returns-Successfully-retrieved-the-list-of-mute-rules-response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:12.599Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Get-all-mute-rules-returns-Successfully-retrieved-the-list-of-mute-rules-response.yml b/cassettes/features/v2/security_monitoring/Get-all-mute-rules-returns-Successfully-retrieved-the-list-of-mute-rules-response.yml new file mode 100644 index 000000000000..7923f99aba80 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-all-mute-rules-returns-Successfully-retrieved-the-list-of-mute-rules-response.yml @@ -0,0 +1,62 @@ +http_interactions: +- recorded_at: Tue, 16 Jun 2026 15:41:12 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"reason":"risk_accepted"},"enabled":true,"name":"Test-Get_all_mute_rules_returns_Successfully_retrieved_the_list_of_mute_rules_response-1781624472","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"mute_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/mute_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"4c72a302-c7c8-42bc-986a-f196580240c3","type":"mute_rules","attributes":{"action":{"reason":"risk_accepted"},"created_at":1781624472865,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624472865,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Get_all_mute_rules_returns_Successfully_retrieved_the_list_of_mute_rules_response-1781624472","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Tue, 16 Jun 2026 15:41:12 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/security/findings/automation/mute_rules + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"4c72a302-c7c8-42bc-986a-f196580240c3","type":"mute_rules","attributes":{"action":{"reason":"risk_accepted"},"created_at":1781624472865,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624472865,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Get_all_mute_rules_returns_Successfully_retrieved_the_list_of_mute_rules_response-1781624472","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}],"meta":{"page":{"total_filtered_count":1}},"links":{"first":"/api/v2/security/findings/automation/mute_rules?page[size]=1000\u0026page[number]=0","last":"/api/v2/security/findings/automation/mute_rules?page[size]=1000\u0026page[number]=0"}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Tue, 16 Jun 2026 15:41:12 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/mute_rules/4c72a302-c7c8-42bc-986a-f196580240c3 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Get-all-ticket-creation-rules-returns-Successfully-retrieved-the-list-of-ticket-creation-rules-response.frozen b/cassettes/features/v2/security_monitoring/Get-all-ticket-creation-rules-returns-Successfully-retrieved-the-list-of-ticket-creation-rules-response.frozen new file mode 100644 index 000000000000..f3b009f91091 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-all-ticket-creation-rules-returns-Successfully-retrieved-the-list-of-ticket-creation-rules-response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:13.714Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Get-all-ticket-creation-rules-returns-Successfully-retrieved-the-list-of-ticket-creation-rules-response.yml b/cassettes/features/v2/security_monitoring/Get-all-ticket-creation-rules-returns-Successfully-retrieved-the-list-of-ticket-creation-rules-response.yml new file mode 100644 index 000000000000..48fb12764796 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Get-all-ticket-creation-rules-returns-Successfully-retrieved-the-list-of-ticket-creation-rules-response.yml @@ -0,0 +1,62 @@ +http_interactions: +- recorded_at: Tue, 16 Jun 2026 15:41:13 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"max_tickets_per_day":10,"project_id":"11111111-1111-1111-1111-111111111111","target":"jira"},"enabled":true,"name":"Test-Get_all_ticket_creation_rules_returns_Successfully_retrieved_the_list_of_ticket_creation_rules_respo-1781624473","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"ticket_creation_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/ticket_creation_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"399d69c3-6fcd-4538-b0cc-05e6db5aac38","type":"ticket_creation_rules","attributes":{"action":{"project_id":"11111111-1111-1111-1111-111111111111","target":"jira","max_tickets_per_day":10},"created_at":1781624473944,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624473944,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Get_all_ticket_creation_rules_returns_Successfully_retrieved_the_list_of_ticket_creation_rules_respo-1781624473","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Tue, 16 Jun 2026 15:41:13 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/security/findings/automation/ticket_creation_rules + response: + body: + encoding: UTF-8 + string: '{"data":[{"id":"399d69c3-6fcd-4538-b0cc-05e6db5aac38","type":"ticket_creation_rules","attributes":{"action":{"project_id":"11111111-1111-1111-1111-111111111111","target":"jira","max_tickets_per_day":10},"created_at":1781624473944,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624473944,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Get_all_ticket_creation_rules_returns_Successfully_retrieved_the_list_of_ticket_creation_rules_respo-1781624473","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}],"meta":{"page":{"total_filtered_count":1}},"links":{"first":"/api/v2/security/findings/automation/ticket_creation_rules?page[size]=1000\u0026page[number]=0","last":"/api/v2/security/findings/automation/ticket_creation_rules?page[size]=1000\u0026page[number]=0"}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Tue, 16 Jun 2026 15:41:13 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/ticket_creation_rules/399d69c3-6fcd-4538-b0cc-05e6db5aac38 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Reorder-due-date-rules-returns-Successfully-reordered-the-due-date-rules-response.frozen b/cassettes/features/v2/security_monitoring/Reorder-due-date-rules-returns-Successfully-reordered-the-due-date-rules-response.frozen new file mode 100644 index 000000000000..c7ce8f75a462 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Reorder-due-date-rules-returns-Successfully-reordered-the-due-date-rules-response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:14.824Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Reorder-due-date-rules-returns-Successfully-reordered-the-due-date-rules-response.yml b/cassettes/features/v2/security_monitoring/Reorder-due-date-rules-returns-Successfully-reordered-the-due-date-rules-response.yml new file mode 100644 index 000000000000..ec4bf7e0fd29 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Reorder-due-date-rules-returns-Successfully-reordered-the-due-date-rules-response.yml @@ -0,0 +1,64 @@ +http_interactions: +- recorded_at: Tue, 16 Jun 2026 15:41:14 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"due_days_per_severity":[{"due_in_days":7,"severity":"critical"}],"due_from":"first_seen"},"enabled":true,"name":"Test-Reorder_due_date_rules_returns_Successfully_reordered_the_due_date_rules_response-1781624474","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"due_date_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/due_date_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"64e53941-8eba-42f9-946b-6422bead1eea","type":"due_date_rules","attributes":{"action":{"due_days_per_severity":[{"severity":"critical","due_in_days":7}],"due_from":"first_seen"},"created_at":1781624475039,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624475039,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Reorder_due_date_rules_returns_Successfully_reordered_the_due_date_rules_response-1781624474","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Tue, 16 Jun 2026 15:41:14 GMT + request: + body: + encoding: UTF-8 + string: '{"data":[{"id":"64e53941-8eba-42f9-946b-6422bead1eea","type":"due_date_rules"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/due_date_rules/reorder + response: + body: + encoding: UTF-8 + string: '{"data":[{"type":"due_date_rules","id":"64e53941-8eba-42f9-946b-6422bead1eea"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Tue, 16 Jun 2026 15:41:14 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/due_date_rules/64e53941-8eba-42f9-946b-6422bead1eea + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Reorder-mute-rules-returns-Successfully-reordered-the-mute-rules-response.frozen b/cassettes/features/v2/security_monitoring/Reorder-mute-rules-returns-Successfully-reordered-the-mute-rules-response.frozen new file mode 100644 index 000000000000..a7c62ff9756e --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Reorder-mute-rules-returns-Successfully-reordered-the-mute-rules-response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:16.028Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Reorder-mute-rules-returns-Successfully-reordered-the-mute-rules-response.yml b/cassettes/features/v2/security_monitoring/Reorder-mute-rules-returns-Successfully-reordered-the-mute-rules-response.yml new file mode 100644 index 000000000000..358621c72e3d --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Reorder-mute-rules-returns-Successfully-reordered-the-mute-rules-response.yml @@ -0,0 +1,64 @@ +http_interactions: +- recorded_at: Tue, 16 Jun 2026 15:41:16 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"reason":"risk_accepted"},"enabled":true,"name":"Test-Reorder_mute_rules_returns_Successfully_reordered_the_mute_rules_response-1781624476","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"mute_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/mute_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"707a25e7-57ae-4d8f-9ce8-4840b52c7349","type":"mute_rules","attributes":{"action":{"reason":"risk_accepted"},"created_at":1781624476249,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624476249,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Reorder_mute_rules_returns_Successfully_reordered_the_mute_rules_response-1781624476","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Tue, 16 Jun 2026 15:41:16 GMT + request: + body: + encoding: UTF-8 + string: '{"data":[{"id":"707a25e7-57ae-4d8f-9ce8-4840b52c7349","type":"mute_rules"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/mute_rules/reorder + response: + body: + encoding: UTF-8 + string: '{"data":[{"type":"mute_rules","id":"707a25e7-57ae-4d8f-9ce8-4840b52c7349"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Tue, 16 Jun 2026 15:41:16 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/mute_rules/707a25e7-57ae-4d8f-9ce8-4840b52c7349 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Reorder-ticket-creation-rules-returns-Successfully-reordered-the-ticket-creation-rules-response.frozen b/cassettes/features/v2/security_monitoring/Reorder-ticket-creation-rules-returns-Successfully-reordered-the-ticket-creation-rules-response.frozen new file mode 100644 index 000000000000..f5acdf623f2f --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Reorder-ticket-creation-rules-returns-Successfully-reordered-the-ticket-creation-rules-response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:17.183Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Reorder-ticket-creation-rules-returns-Successfully-reordered-the-ticket-creation-rules-response.yml b/cassettes/features/v2/security_monitoring/Reorder-ticket-creation-rules-returns-Successfully-reordered-the-ticket-creation-rules-response.yml new file mode 100644 index 000000000000..7834a05e61d0 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Reorder-ticket-creation-rules-returns-Successfully-reordered-the-ticket-creation-rules-response.yml @@ -0,0 +1,64 @@ +http_interactions: +- recorded_at: Tue, 16 Jun 2026 15:41:17 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"max_tickets_per_day":10,"project_id":"11111111-1111-1111-1111-111111111111","target":"jira"},"enabled":true,"name":"Test-Reorder_ticket_creation_rules_returns_Successfully_reordered_the_ticket_creation_rules_response-1781624477","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"ticket_creation_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/ticket_creation_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"b34dcd68-976a-49af-915b-83488a3d9f74","type":"ticket_creation_rules","attributes":{"action":{"project_id":"11111111-1111-1111-1111-111111111111","target":"jira","max_tickets_per_day":10},"created_at":1781624477424,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624477424,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Reorder_ticket_creation_rules_returns_Successfully_reordered_the_ticket_creation_rules_response-1781624477","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Tue, 16 Jun 2026 15:41:17 GMT + request: + body: + encoding: UTF-8 + string: '{"data":[{"id":"b34dcd68-976a-49af-915b-83488a3d9f74","type":"ticket_creation_rules"}]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/ticket_creation_rules/reorder + response: + body: + encoding: UTF-8 + string: '{"data":[{"type":"ticket_creation_rules","id":"b34dcd68-976a-49af-915b-83488a3d9f74"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Tue, 16 Jun 2026 15:41:17 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/ticket_creation_rules/b34dcd68-976a-49af-915b-83488a3d9f74 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Update-a-due-date-rule-returns-Successfully-updated-the-due-date-rule-response.frozen b/cassettes/features/v2/security_monitoring/Update-a-due-date-rule-returns-Successfully-updated-the-due-date-rule-response.frozen new file mode 100644 index 000000000000..c0e1f30ef56a --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Update-a-due-date-rule-returns-Successfully-updated-the-due-date-rule-response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:18.417Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Update-a-due-date-rule-returns-Successfully-updated-the-due-date-rule-response.yml b/cassettes/features/v2/security_monitoring/Update-a-due-date-rule-returns-Successfully-updated-the-due-date-rule-response.yml new file mode 100644 index 000000000000..f8567f309656 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Update-a-due-date-rule-returns-Successfully-updated-the-due-date-rule-response.yml @@ -0,0 +1,66 @@ +http_interactions: +- recorded_at: Tue, 16 Jun 2026 15:41:18 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"due_days_per_severity":[{"due_in_days":7,"severity":"critical"}],"due_from":"first_seen"},"enabled":true,"name":"Test-Update_a_due_date_rule_returns_Successfully_updated_the_due_date_rule_response-1781624478","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"due_date_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/due_date_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"22df6980-9710-496d-bf46-85e0ac181dc0","type":"due_date_rules","attributes":{"action":{"due_days_per_severity":[{"severity":"critical","due_in_days":7}],"due_from":"first_seen"},"created_at":1781624478629,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624478629,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Update_a_due_date_rule_returns_Successfully_updated_the_due_date_rule_response-1781624478","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Tue, 16 Jun 2026 15:41:18 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"due_days_per_severity":[{"due_in_days":14,"severity":"critical"}],"due_from":"first_seen"},"enabled":false,"name":"Test-Update_a_due_date_rule_returns_Successfully_updated_the_due_date_rule_response-1781624478","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"due_date_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/security/findings/automation/due_date_rules/22df6980-9710-496d-bf46-85e0ac181dc0 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"22df6980-9710-496d-bf46-85e0ac181dc0","type":"due_date_rules","attributes":{"action":{"due_days_per_severity":[{"severity":"critical","due_in_days":14}],"due_from":"first_seen"},"created_at":1781624478629,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":false,"modified_at":1781624479036,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Update_a_due_date_rule_returns_Successfully_updated_the_due_date_rule_response-1781624478","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Tue, 16 Jun 2026 15:41:18 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/due_date_rules/22df6980-9710-496d-bf46-85e0ac181dc0 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Update-a-mute-rule-returns-Successfully-updated-the-mute-rule-response.frozen b/cassettes/features/v2/security_monitoring/Update-a-mute-rule-returns-Successfully-updated-the-mute-rule-response.frozen new file mode 100644 index 000000000000..9c2202dcbffc --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Update-a-mute-rule-returns-Successfully-updated-the-mute-rule-response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:19.612Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Update-a-mute-rule-returns-Successfully-updated-the-mute-rule-response.yml b/cassettes/features/v2/security_monitoring/Update-a-mute-rule-returns-Successfully-updated-the-mute-rule-response.yml new file mode 100644 index 000000000000..23f2763062a7 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Update-a-mute-rule-returns-Successfully-updated-the-mute-rule-response.yml @@ -0,0 +1,66 @@ +http_interactions: +- recorded_at: Tue, 16 Jun 2026 15:41:19 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"reason":"risk_accepted"},"enabled":true,"name":"Test-Update_a_mute_rule_returns_Successfully_updated_the_mute_rule_response-1781624479","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"mute_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/mute_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"9a1d22ad-558c-4c4e-bdf5-72cd264cf7a9","type":"mute_rules","attributes":{"action":{"reason":"risk_accepted"},"created_at":1781624479894,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624479894,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Update_a_mute_rule_returns_Successfully_updated_the_mute_rule_response-1781624479","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Tue, 16 Jun 2026 15:41:19 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"reason":"false_positive"},"enabled":false,"name":"Test-Update_a_mute_rule_returns_Successfully_updated_the_mute_rule_response-1781624479","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"mute_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/security/findings/automation/mute_rules/9a1d22ad-558c-4c4e-bdf5-72cd264cf7a9 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"9a1d22ad-558c-4c4e-bdf5-72cd264cf7a9","type":"mute_rules","attributes":{"action":{"reason":"false_positive"},"created_at":1781624479894,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":false,"modified_at":1781624480318,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Update_a_mute_rule_returns_Successfully_updated_the_mute_rule_response-1781624479","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Tue, 16 Jun 2026 15:41:19 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/mute_rules/9a1d22ad-558c-4c4e-bdf5-72cd264cf7a9 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/security_monitoring/Update-a-ticket-creation-rule-returns-Successfully-updated-the-ticket-creation-rule-response.frozen b/cassettes/features/v2/security_monitoring/Update-a-ticket-creation-rule-returns-Successfully-updated-the-ticket-creation-rule-response.frozen new file mode 100644 index 000000000000..1bf1e4fadbe9 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Update-a-ticket-creation-rule-returns-Successfully-updated-the-ticket-creation-rule-response.frozen @@ -0,0 +1 @@ +2026-06-16T15:41:20.880Z \ No newline at end of file diff --git a/cassettes/features/v2/security_monitoring/Update-a-ticket-creation-rule-returns-Successfully-updated-the-ticket-creation-rule-response.yml b/cassettes/features/v2/security_monitoring/Update-a-ticket-creation-rule-returns-Successfully-updated-the-ticket-creation-rule-response.yml new file mode 100644 index 000000000000..36e2c5e39151 --- /dev/null +++ b/cassettes/features/v2/security_monitoring/Update-a-ticket-creation-rule-returns-Successfully-updated-the-ticket-creation-rule-response.yml @@ -0,0 +1,66 @@ +http_interactions: +- recorded_at: Tue, 16 Jun 2026 15:41:20 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"max_tickets_per_day":10,"project_id":"11111111-1111-1111-1111-111111111111","target":"jira"},"enabled":true,"name":"Test-Update_a_ticket_creation_rule_returns_Successfully_updated_the_ticket_creation_rule_response-1781624480","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"ticket_creation_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/security/findings/automation/ticket_creation_rules + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"d3fcec39-567f-4450-967e-ca83bb29dbe4","type":"ticket_creation_rules","attributes":{"action":{"project_id":"11111111-1111-1111-1111-111111111111","target":"jira","max_tickets_per_day":10},"created_at":1781624481109,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":true,"modified_at":1781624481109,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Update_a_ticket_creation_rule_returns_Successfully_updated_the_ticket_creation_rule_response-1781624480","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 201 + message: Created +- recorded_at: Tue, 16 Jun 2026 15:41:20 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"action":{"max_tickets_per_day":5,"project_id":"11111111-1111-1111-1111-111111111111","target":"jira"},"enabled":false,"name":"Test-Update_a_ticket_creation_rule_returns_Successfully_updated_the_ticket_creation_rule_response-1781624480","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}},"type":"ticket_creation_rules"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PUT + uri: https://api.datadoghq.com/api/v2/security/findings/automation/ticket_creation_rules/d3fcec39-567f-4450-967e-ca83bb29dbe4 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"d3fcec39-567f-4450-967e-ca83bb29dbe4","type":"ticket_creation_rules","attributes":{"action":{"project_id":"11111111-1111-1111-1111-111111111111","target":"jira","max_tickets_per_day":5},"created_at":1781624481109,"created_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"enabled":false,"modified_at":1781624481511,"modified_by":{"type":"user","id":"9919ec9b-ebc7-49ee-8dc8-03626e717cca","name":"CI + Account"},"name":"Test-Update_a_ticket_creation_rule_returns_Successfully_updated_the_ticket_creation_rule_response-1781624480","rule":{"finding_types":["misconfiguration"],"query":"env:staging"}}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +- recorded_at: Tue, 16 Jun 2026 15:41:20 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v2/security/findings/automation/ticket_creation_rules/d3fcec39-567f-4450-967e-ca83bb29dbe4 + response: + body: + encoding: UTF-8 + string: '' + headers: {} + status: + code: 204 + message: No Content +recorded_with: VCR 6.0.0 diff --git a/examples/v2/rum-remote-config/GetRumSdkConfig.rb b/examples/v2/rum-remote-config/GetRumSdkConfig.rb new file mode 100644 index 000000000000..70cfb135bbed --- /dev/null +++ b/examples/v2/rum-remote-config/GetRumSdkConfig.rb @@ -0,0 +1,8 @@ +# Get a RUM SDK configuration returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_rum_sdk_config".to_sym] = true +end +api_instance = DatadogAPIClient::V2::RUMRemoteConfigAPI.new +p api_instance.get_rum_sdk_config("config_id") diff --git a/examples/v2/rum-remote-config/UpdateRumSdkConfig.rb b/examples/v2/rum-remote-config/UpdateRumSdkConfig.rb new file mode 100644 index 000000000000..da6e0afe42b8 --- /dev/null +++ b/examples/v2/rum-remote-config/UpdateRumSdkConfig.rb @@ -0,0 +1,94 @@ +# Update a RUM SDK configuration returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_rum_sdk_config".to_sym] = true +end +api_instance = DatadogAPIClient::V2::RUMRemoteConfigAPI.new + +body = DatadogAPIClient::V2::RumSdkConfigUpdateRequest.new({ + data: DatadogAPIClient::V2::RumSdkConfigUpdateData.new({ + attributes: DatadogAPIClient::V2::RumSdkConfigUpdateAttributes.new({ + rum: DatadogAPIClient::V2::RumSdkConfigRumUpdateAttributes.new({ + allowed_tracing_urls: [ + DatadogAPIClient::V2::RumSdkConfigTracingUrlConfig.new({ + match: DatadogAPIClient::V2::RumSdkConfigMatchOption.new({ + rc_serialized_type: DatadogAPIClient::V2::RumSdkConfigMatchOptionSerializedType::STRING, + value: "https://app.datadoghq.com", + }), + propagator_types: [ + DatadogAPIClient::V2::RumSdkConfigTracingUrlPropagatorType::DATADOG, + DatadogAPIClient::V2::RumSdkConfigTracingUrlPropagatorType::TRACECONTEXT, + ], + }), + ], + allowed_tracking_origins: [ + DatadogAPIClient::V2::RumSdkConfigMatchOption.new({ + rc_serialized_type: DatadogAPIClient::V2::RumSdkConfigMatchOptionSerializedType::STRING, + value: "https://app.datadoghq.com", + }), + ], + context: [ + DatadogAPIClient::V2::RumSdkConfigDynamicOptionPair.new({ + key: "id", + value: DatadogAPIClient::V2::RumSdkConfigDynamicOption.new({ + attribute: "data-version", + extractor: DatadogAPIClient::V2::RumSdkConfigSerializedRegex.new({ + rc_serialized_type: DatadogAPIClient::V2::RumSdkConfigSerializedRegexType::REGEX, + value: "^https://app-.*.datadoghq.com", + }), + key: "app.version", + name: "app_version", + path: "application.version", + rc_serialized_type: DatadogAPIClient::V2::RumSdkConfigDynamicOptionSerializedType::DYNAMIC, + selector: "#app-version", + strategy: DatadogAPIClient::V2::RumSdkConfigDynamicOptionStrategy::JS, + }), + }), + ], + default_privacy_level: "mask", + enable_privacy_for_action_name: true, + env: "production", + service: "my-service", + session_replay_sample_rate: 20, + session_sample_rate: 75, + trace_sample_rate: 100, + track_session_across_subdomains: false, + user: [ + DatadogAPIClient::V2::RumSdkConfigDynamicOptionPair.new({ + key: "id", + value: DatadogAPIClient::V2::RumSdkConfigDynamicOption.new({ + attribute: "data-version", + extractor: DatadogAPIClient::V2::RumSdkConfigSerializedRegex.new({ + rc_serialized_type: DatadogAPIClient::V2::RumSdkConfigSerializedRegexType::REGEX, + value: "^https://app-.*.datadoghq.com", + }), + key: "app.version", + name: "app_version", + path: "application.version", + rc_serialized_type: DatadogAPIClient::V2::RumSdkConfigDynamicOptionSerializedType::DYNAMIC, + selector: "#app-version", + strategy: DatadogAPIClient::V2::RumSdkConfigDynamicOptionStrategy::JS, + }), + }), + ], + version: DatadogAPIClient::V2::RumSdkConfigDynamicOption.new({ + attribute: "data-version", + extractor: DatadogAPIClient::V2::RumSdkConfigSerializedRegex.new({ + rc_serialized_type: DatadogAPIClient::V2::RumSdkConfigSerializedRegexType::REGEX, + value: "^https://app-.*.datadoghq.com", + }), + key: "app.version", + name: "app_version", + path: "application.version", + rc_serialized_type: DatadogAPIClient::V2::RumSdkConfigDynamicOptionSerializedType::DYNAMIC, + selector: "#app-version", + strategy: DatadogAPIClient::V2::RumSdkConfigDynamicOptionStrategy::JS, + }), + }), + }), + id: "abc12345-1234-5678-abcd-ef1234567890", + type: DatadogAPIClient::V2::RumSdkConfigType::RUM_SDK_CONFIG, + }), +}) +p api_instance.update_rum_sdk_config("config_id", body) diff --git a/examples/v2/security-monitoring/CreateSecurityFindingsAutomationDueDateRule.rb b/examples/v2/security-monitoring/CreateSecurityFindingsAutomationDueDateRule.rb new file mode 100644 index 000000000000..33f1bd15d476 --- /dev/null +++ b/examples/v2/security-monitoring/CreateSecurityFindingsAutomationDueDateRule.rb @@ -0,0 +1,33 @@ +# Create a due date rule returns "Successfully created the due date rule" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_security_findings_automation_due_date_rule".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::DueDateRuleCreateRequest.new({ + data: DatadogAPIClient::V2::DueDateRuleDataCreate.new({ + attributes: DatadogAPIClient::V2::DueDateRuleAttributesCreate.new({ + action: DatadogAPIClient::V2::DueDateRuleAction.new({ + due_days_per_severity: [ + DatadogAPIClient::V2::DueDatePerSeverityItem.new({ + due_in_days: 7, + severity: DatadogAPIClient::V2::DueDateSeverity::CRITICAL, + }), + ], + due_from: DatadogAPIClient::V2::DueDateFrom::FIRST_SEEN, + }), + enabled: true, + name: "Example-Security-Monitoring", + rule: DatadogAPIClient::V2::AutomationRuleScope.new({ + finding_types: [ + DatadogAPIClient::V2::SecurityFindingType::MISCONFIGURATION, + ], + query: "env:staging", + }), + }), + type: DatadogAPIClient::V2::DueDateRuleType::DUE_DATE_RULES, + }), +}) +p api_instance.create_security_findings_automation_due_date_rule(body) diff --git a/examples/v2/security-monitoring/CreateSecurityFindingsAutomationMuteRule.rb b/examples/v2/security-monitoring/CreateSecurityFindingsAutomationMuteRule.rb new file mode 100644 index 000000000000..de5f7e3a6022 --- /dev/null +++ b/examples/v2/security-monitoring/CreateSecurityFindingsAutomationMuteRule.rb @@ -0,0 +1,27 @@ +# Create a mute rule returns "Successfully created the mute rule" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_security_findings_automation_mute_rule".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::MuteRuleCreateRequest.new({ + data: DatadogAPIClient::V2::MuteRuleDataCreate.new({ + attributes: DatadogAPIClient::V2::MuteRuleAttributesCreate.new({ + action: DatadogAPIClient::V2::MuteRuleAction.new({ + reason: DatadogAPIClient::V2::MuteReason::RISK_ACCEPTED, + }), + enabled: true, + name: "Example-Security-Monitoring", + rule: DatadogAPIClient::V2::AutomationRuleScope.new({ + finding_types: [ + DatadogAPIClient::V2::SecurityFindingType::MISCONFIGURATION, + ], + query: "env:staging", + }), + }), + type: DatadogAPIClient::V2::MuteRuleType::MUTE_RULES, + }), +}) +p api_instance.create_security_findings_automation_mute_rule(body) diff --git a/examples/v2/security-monitoring/CreateSecurityFindingsAutomationTicketCreationRule.rb b/examples/v2/security-monitoring/CreateSecurityFindingsAutomationTicketCreationRule.rb new file mode 100644 index 000000000000..6d0895a11201 --- /dev/null +++ b/examples/v2/security-monitoring/CreateSecurityFindingsAutomationTicketCreationRule.rb @@ -0,0 +1,29 @@ +# Create a ticket creation rule returns "Successfully created the ticket creation rule" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.create_security_findings_automation_ticket_creation_rule".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +body = DatadogAPIClient::V2::TicketCreationRuleCreateRequest.new({ + data: DatadogAPIClient::V2::TicketCreationRuleDataCreate.new({ + attributes: DatadogAPIClient::V2::TicketCreationRuleAttributesCreate.new({ + action: DatadogAPIClient::V2::TicketCreationRuleAction.new({ + max_tickets_per_day: 10, + project_id: "11111111-1111-1111-1111-111111111111", + target: DatadogAPIClient::V2::TicketCreationTarget::JIRA, + }), + enabled: true, + name: "Example-Security-Monitoring", + rule: DatadogAPIClient::V2::AutomationRuleScope.new({ + finding_types: [ + DatadogAPIClient::V2::SecurityFindingType::MISCONFIGURATION, + ], + query: "env:staging", + }), + }), + type: DatadogAPIClient::V2::TicketCreationRuleType::TICKET_CREATION_RULES, + }), +}) +p api_instance.create_security_findings_automation_ticket_creation_rule(body) diff --git a/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationDueDateRule.rb b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationDueDateRule.rb new file mode 100644 index 000000000000..b49f3c747f4f --- /dev/null +++ b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationDueDateRule.rb @@ -0,0 +1,11 @@ +# Delete a due date rule returns "Rule successfully deleted." response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_security_findings_automation_due_date_rule".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +# there is a valid "valid_due_date_rule" in the system +VALID_DUE_DATE_RULE_DATA_ID = ENV["VALID_DUE_DATE_RULE_DATA_ID"] +api_instance.delete_security_findings_automation_due_date_rule(VALID_DUE_DATE_RULE_DATA_ID) diff --git a/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationMuteRule.rb b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationMuteRule.rb new file mode 100644 index 000000000000..24ab4ed668d7 --- /dev/null +++ b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationMuteRule.rb @@ -0,0 +1,11 @@ +# Delete a mute rule returns "Rule successfully deleted." response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_security_findings_automation_mute_rule".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +# there is a valid "valid_mute_rule" in the system +VALID_MUTE_RULE_DATA_ID = ENV["VALID_MUTE_RULE_DATA_ID"] +api_instance.delete_security_findings_automation_mute_rule(VALID_MUTE_RULE_DATA_ID) diff --git a/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationTicketCreationRule.rb b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationTicketCreationRule.rb new file mode 100644 index 000000000000..3a11642530f5 --- /dev/null +++ b/examples/v2/security-monitoring/DeleteSecurityFindingsAutomationTicketCreationRule.rb @@ -0,0 +1,11 @@ +# Delete a ticket creation rule returns "Rule successfully deleted." response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_security_findings_automation_ticket_creation_rule".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +# there is a valid "valid_ticket_creation_rule" in the system +VALID_TICKET_CREATION_RULE_DATA_ID = ENV["VALID_TICKET_CREATION_RULE_DATA_ID"] +api_instance.delete_security_findings_automation_ticket_creation_rule(VALID_TICKET_CREATION_RULE_DATA_ID) diff --git a/examples/v2/security-monitoring/GetSecurityFindingsAutomationDueDateRule.rb b/examples/v2/security-monitoring/GetSecurityFindingsAutomationDueDateRule.rb new file mode 100644 index 000000000000..56782e9a8d8b --- /dev/null +++ b/examples/v2/security-monitoring/GetSecurityFindingsAutomationDueDateRule.rb @@ -0,0 +1,11 @@ +# Get a due date rule returns "Successfully retrieved the due date rule" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_security_findings_automation_due_date_rule".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +# there is a valid "valid_due_date_rule" in the system +VALID_DUE_DATE_RULE_DATA_ID = ENV["VALID_DUE_DATE_RULE_DATA_ID"] +p api_instance.get_security_findings_automation_due_date_rule(VALID_DUE_DATE_RULE_DATA_ID) diff --git a/examples/v2/security-monitoring/GetSecurityFindingsAutomationMuteRule.rb b/examples/v2/security-monitoring/GetSecurityFindingsAutomationMuteRule.rb new file mode 100644 index 000000000000..5e826293f6f5 --- /dev/null +++ b/examples/v2/security-monitoring/GetSecurityFindingsAutomationMuteRule.rb @@ -0,0 +1,11 @@ +# Get a mute rule returns "Successfully retrieved the mute rule" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_security_findings_automation_mute_rule".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +# there is a valid "valid_mute_rule" in the system +VALID_MUTE_RULE_DATA_ID = ENV["VALID_MUTE_RULE_DATA_ID"] +p api_instance.get_security_findings_automation_mute_rule(VALID_MUTE_RULE_DATA_ID) diff --git a/examples/v2/security-monitoring/GetSecurityFindingsAutomationTicketCreationRule.rb b/examples/v2/security-monitoring/GetSecurityFindingsAutomationTicketCreationRule.rb new file mode 100644 index 000000000000..394d9dfc380b --- /dev/null +++ b/examples/v2/security-monitoring/GetSecurityFindingsAutomationTicketCreationRule.rb @@ -0,0 +1,11 @@ +# Get a ticket creation rule returns "Successfully retrieved the ticket creation rule" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_security_findings_automation_ticket_creation_rule".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +# there is a valid "valid_ticket_creation_rule" in the system +VALID_TICKET_CREATION_RULE_DATA_ID = ENV["VALID_TICKET_CREATION_RULE_DATA_ID"] +p api_instance.get_security_findings_automation_ticket_creation_rule(VALID_TICKET_CREATION_RULE_DATA_ID) diff --git a/examples/v2/security-monitoring/ListSecurityFindingsAutomationDueDateRules.rb b/examples/v2/security-monitoring/ListSecurityFindingsAutomationDueDateRules.rb new file mode 100644 index 000000000000..ca32aa3e13d6 --- /dev/null +++ b/examples/v2/security-monitoring/ListSecurityFindingsAutomationDueDateRules.rb @@ -0,0 +1,8 @@ +# Get all due date rules returns "Successfully retrieved the list of due date rules" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_security_findings_automation_due_date_rules".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new +p api_instance.list_security_findings_automation_due_date_rules() diff --git a/examples/v2/security-monitoring/ListSecurityFindingsAutomationMuteRules.rb b/examples/v2/security-monitoring/ListSecurityFindingsAutomationMuteRules.rb new file mode 100644 index 000000000000..9078d3c56daa --- /dev/null +++ b/examples/v2/security-monitoring/ListSecurityFindingsAutomationMuteRules.rb @@ -0,0 +1,8 @@ +# Get all mute rules returns "Successfully retrieved the list of mute rules" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_security_findings_automation_mute_rules".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new +p api_instance.list_security_findings_automation_mute_rules() diff --git a/examples/v2/security-monitoring/ListSecurityFindingsAutomationTicketCreationRules.rb b/examples/v2/security-monitoring/ListSecurityFindingsAutomationTicketCreationRules.rb new file mode 100644 index 000000000000..f27fde8a2840 --- /dev/null +++ b/examples/v2/security-monitoring/ListSecurityFindingsAutomationTicketCreationRules.rb @@ -0,0 +1,8 @@ +# Get all ticket creation rules returns "Successfully retrieved the list of ticket creation rules" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_security_findings_automation_ticket_creation_rules".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new +p api_instance.list_security_findings_automation_ticket_creation_rules() diff --git a/examples/v2/security-monitoring/ReorderSecurityFindingsAutomationDueDateRules.rb b/examples/v2/security-monitoring/ReorderSecurityFindingsAutomationDueDateRules.rb new file mode 100644 index 000000000000..7c58dfa43dcc --- /dev/null +++ b/examples/v2/security-monitoring/ReorderSecurityFindingsAutomationDueDateRules.rb @@ -0,0 +1,20 @@ +# Reorder due date rules returns "Successfully reordered the due date rules" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.reorder_security_findings_automation_due_date_rules".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +# there is a valid "valid_due_date_rule" in the system +VALID_DUE_DATE_RULE_DATA_ID = ENV["VALID_DUE_DATE_RULE_DATA_ID"] + +body = DatadogAPIClient::V2::DueDateRuleReorderRequest.new({ + data: [ + DatadogAPIClient::V2::DueDateRuleReorderItem.new({ + id: VALID_DUE_DATE_RULE_DATA_ID, + type: DatadogAPIClient::V2::DueDateRuleType::DUE_DATE_RULES, + }), + ], +}) +p api_instance.reorder_security_findings_automation_due_date_rules(body) diff --git a/examples/v2/security-monitoring/ReorderSecurityFindingsAutomationMuteRules.rb b/examples/v2/security-monitoring/ReorderSecurityFindingsAutomationMuteRules.rb new file mode 100644 index 000000000000..96e799841e52 --- /dev/null +++ b/examples/v2/security-monitoring/ReorderSecurityFindingsAutomationMuteRules.rb @@ -0,0 +1,20 @@ +# Reorder mute rules returns "Successfully reordered the mute rules" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.reorder_security_findings_automation_mute_rules".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +# there is a valid "valid_mute_rule" in the system +VALID_MUTE_RULE_DATA_ID = ENV["VALID_MUTE_RULE_DATA_ID"] + +body = DatadogAPIClient::V2::MuteRuleReorderRequest.new({ + data: [ + DatadogAPIClient::V2::MuteRuleReorderItem.new({ + id: VALID_MUTE_RULE_DATA_ID, + type: DatadogAPIClient::V2::MuteRuleType::MUTE_RULES, + }), + ], +}) +p api_instance.reorder_security_findings_automation_mute_rules(body) diff --git a/examples/v2/security-monitoring/ReorderSecurityFindingsAutomationTicketCreationRules.rb b/examples/v2/security-monitoring/ReorderSecurityFindingsAutomationTicketCreationRules.rb new file mode 100644 index 000000000000..4a5b46f4a0ef --- /dev/null +++ b/examples/v2/security-monitoring/ReorderSecurityFindingsAutomationTicketCreationRules.rb @@ -0,0 +1,20 @@ +# Reorder ticket creation rules returns "Successfully reordered the ticket creation rules" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.reorder_security_findings_automation_ticket_creation_rules".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +# there is a valid "valid_ticket_creation_rule" in the system +VALID_TICKET_CREATION_RULE_DATA_ID = ENV["VALID_TICKET_CREATION_RULE_DATA_ID"] + +body = DatadogAPIClient::V2::TicketCreationRuleReorderRequest.new({ + data: [ + DatadogAPIClient::V2::TicketCreationRuleReorderItem.new({ + id: VALID_TICKET_CREATION_RULE_DATA_ID, + type: DatadogAPIClient::V2::TicketCreationRuleType::TICKET_CREATION_RULES, + }), + ], +}) +p api_instance.reorder_security_findings_automation_ticket_creation_rules(body) diff --git a/examples/v2/security-monitoring/UpdateSecurityFindingsAutomationDueDateRule.rb b/examples/v2/security-monitoring/UpdateSecurityFindingsAutomationDueDateRule.rb new file mode 100644 index 000000000000..d72968d432d4 --- /dev/null +++ b/examples/v2/security-monitoring/UpdateSecurityFindingsAutomationDueDateRule.rb @@ -0,0 +1,36 @@ +# Update a due date rule returns "Successfully updated the due date rule" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_security_findings_automation_due_date_rule".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +# there is a valid "valid_due_date_rule" in the system +VALID_DUE_DATE_RULE_DATA_ID = ENV["VALID_DUE_DATE_RULE_DATA_ID"] + +body = DatadogAPIClient::V2::DueDateRuleUpdateRequest.new({ + data: DatadogAPIClient::V2::DueDateRuleDataCreate.new({ + attributes: DatadogAPIClient::V2::DueDateRuleAttributesCreate.new({ + action: DatadogAPIClient::V2::DueDateRuleAction.new({ + due_days_per_severity: [ + DatadogAPIClient::V2::DueDatePerSeverityItem.new({ + due_in_days: 14, + severity: DatadogAPIClient::V2::DueDateSeverity::CRITICAL, + }), + ], + due_from: DatadogAPIClient::V2::DueDateFrom::FIRST_SEEN, + }), + enabled: false, + name: "Example-Security-Monitoring", + rule: DatadogAPIClient::V2::AutomationRuleScope.new({ + finding_types: [ + DatadogAPIClient::V2::SecurityFindingType::MISCONFIGURATION, + ], + query: "env:staging", + }), + }), + type: DatadogAPIClient::V2::DueDateRuleType::DUE_DATE_RULES, + }), +}) +p api_instance.update_security_findings_automation_due_date_rule(VALID_DUE_DATE_RULE_DATA_ID, body) diff --git a/examples/v2/security-monitoring/UpdateSecurityFindingsAutomationMuteRule.rb b/examples/v2/security-monitoring/UpdateSecurityFindingsAutomationMuteRule.rb new file mode 100644 index 000000000000..44329f1281d0 --- /dev/null +++ b/examples/v2/security-monitoring/UpdateSecurityFindingsAutomationMuteRule.rb @@ -0,0 +1,30 @@ +# Update a mute rule returns "Successfully updated the mute rule" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_security_findings_automation_mute_rule".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +# there is a valid "valid_mute_rule" in the system +VALID_MUTE_RULE_DATA_ID = ENV["VALID_MUTE_RULE_DATA_ID"] + +body = DatadogAPIClient::V2::MuteRuleUpdateRequest.new({ + data: DatadogAPIClient::V2::MuteRuleDataCreate.new({ + attributes: DatadogAPIClient::V2::MuteRuleAttributesCreate.new({ + action: DatadogAPIClient::V2::MuteRuleAction.new({ + reason: DatadogAPIClient::V2::MuteReason::FALSE_POSITIVE, + }), + enabled: false, + name: "Example-Security-Monitoring", + rule: DatadogAPIClient::V2::AutomationRuleScope.new({ + finding_types: [ + DatadogAPIClient::V2::SecurityFindingType::MISCONFIGURATION, + ], + query: "env:staging", + }), + }), + type: DatadogAPIClient::V2::MuteRuleType::MUTE_RULES, + }), +}) +p api_instance.update_security_findings_automation_mute_rule(VALID_MUTE_RULE_DATA_ID, body) diff --git a/examples/v2/security-monitoring/UpdateSecurityFindingsAutomationTicketCreationRule.rb b/examples/v2/security-monitoring/UpdateSecurityFindingsAutomationTicketCreationRule.rb new file mode 100644 index 000000000000..562e0545035d --- /dev/null +++ b/examples/v2/security-monitoring/UpdateSecurityFindingsAutomationTicketCreationRule.rb @@ -0,0 +1,32 @@ +# Update a ticket creation rule returns "Successfully updated the ticket creation rule" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_security_findings_automation_ticket_creation_rule".to_sym] = true +end +api_instance = DatadogAPIClient::V2::SecurityMonitoringAPI.new + +# there is a valid "valid_ticket_creation_rule" in the system +VALID_TICKET_CREATION_RULE_DATA_ID = ENV["VALID_TICKET_CREATION_RULE_DATA_ID"] + +body = DatadogAPIClient::V2::TicketCreationRuleUpdateRequest.new({ + data: DatadogAPIClient::V2::TicketCreationRuleDataCreate.new({ + attributes: DatadogAPIClient::V2::TicketCreationRuleAttributesCreate.new({ + action: DatadogAPIClient::V2::TicketCreationRuleAction.new({ + max_tickets_per_day: 5, + project_id: "11111111-1111-1111-1111-111111111111", + target: DatadogAPIClient::V2::TicketCreationTarget::JIRA, + }), + enabled: false, + name: "Example-Security-Monitoring", + rule: DatadogAPIClient::V2::AutomationRuleScope.new({ + finding_types: [ + DatadogAPIClient::V2::SecurityFindingType::MISCONFIGURATION, + ], + query: "env:staging", + }), + }), + type: DatadogAPIClient::V2::TicketCreationRuleType::TICKET_CREATION_RULES, + }), +}) +p api_instance.update_security_findings_automation_ticket_creation_rule(VALID_TICKET_CREATION_RULE_DATA_ID, body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 1642b73b84bb..08740408c57b 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2048,6 +2048,66 @@ "v2.UpdateFindingsAssignee" => { "body" => "AssigneeRequest", }, + "v2.ListSecurityFindingsAutomationDueDateRules" => { + "page_size" => "Integer", + "page_number" => "Integer", + }, + "v2.CreateSecurityFindingsAutomationDueDateRule" => { + "body" => "DueDateRuleCreateRequest", + }, + "v2.ReorderSecurityFindingsAutomationDueDateRules" => { + "body" => "DueDateRuleReorderRequest", + }, + "v2.DeleteSecurityFindingsAutomationDueDateRule" => { + "rule_id" => "UUID", + }, + "v2.GetSecurityFindingsAutomationDueDateRule" => { + "rule_id" => "UUID", + }, + "v2.UpdateSecurityFindingsAutomationDueDateRule" => { + "rule_id" => "UUID", + "body" => "DueDateRuleUpdateRequest", + }, + "v2.ListSecurityFindingsAutomationMuteRules" => { + "page_size" => "Integer", + "page_number" => "Integer", + }, + "v2.CreateSecurityFindingsAutomationMuteRule" => { + "body" => "MuteRuleCreateRequest", + }, + "v2.ReorderSecurityFindingsAutomationMuteRules" => { + "body" => "MuteRuleReorderRequest", + }, + "v2.DeleteSecurityFindingsAutomationMuteRule" => { + "rule_id" => "UUID", + }, + "v2.GetSecurityFindingsAutomationMuteRule" => { + "rule_id" => "UUID", + }, + "v2.UpdateSecurityFindingsAutomationMuteRule" => { + "rule_id" => "UUID", + "body" => "MuteRuleUpdateRequest", + }, + "v2.ListSecurityFindingsAutomationTicketCreationRules" => { + "page_size" => "Integer", + "page_number" => "Integer", + }, + "v2.CreateSecurityFindingsAutomationTicketCreationRule" => { + "body" => "TicketCreationRuleCreateRequest", + }, + "v2.ReorderSecurityFindingsAutomationTicketCreationRules" => { + "body" => "TicketCreationRuleReorderRequest", + }, + "v2.DeleteSecurityFindingsAutomationTicketCreationRule" => { + "rule_id" => "UUID", + }, + "v2.GetSecurityFindingsAutomationTicketCreationRule" => { + "rule_id" => "UUID", + }, + "v2.UpdateSecurityFindingsAutomationTicketCreationRule" => { + "rule_id" => "UUID", + "body" => "TicketCreationRuleUpdateRequest", + }, "v2.DetachCase" => { "body" => "DetachCaseRequest", }, @@ -4774,6 +4834,13 @@ "agent_rule_id" => "String", "body" => "CloudWorkloadSecurityAgentRuleUpdateRequest", }, + "v2.GetRumSdkConfig" => { + "config_id" => "String", + }, + "v2.UpdateRumSdkConfig" => { + "config_id" => "String", + "body" => "RumSdkConfigUpdateRequest", + }, "v2.ListReplayHeatmapSnapshots" => { "filter_device_type" => "String", "filter_view_name" => "String", diff --git a/features/v2/given.json b/features/v2/given.json index f5ce3365dabd..0f9de6d48a2f 100644 --- a/features/v2/given.json +++ b/features/v2/given.json @@ -1290,6 +1290,42 @@ "tag": "Scorecards", "operationId": "CreateScorecardRule" }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"due_date_rules\",\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"enabled\": true,\n \"rule\": {\n \"finding_types\": [\"misconfiguration\"],\n \"query\": \"env:staging\"\n },\n \"action\": {\n \"due_days_per_severity\": [\n {\"severity\": \"critical\", \"due_in_days\": 7}\n ],\n \"due_from\": \"first_seen\"\n }\n }\n }\n}" + } + ], + "step": "there is a valid \"valid_due_date_rule\" in the system", + "key": "valid_due_date_rule", + "tag": "Security Monitoring", + "operationId": "CreateSecurityFindingsAutomationDueDateRule" + }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"mute_rules\",\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"enabled\": true,\n \"rule\": {\n \"finding_types\": [\"misconfiguration\"],\n \"query\": \"env:staging\"\n },\n \"action\": {\n \"reason\": \"risk_accepted\"\n }\n }\n }\n}" + } + ], + "step": "there is a valid \"valid_mute_rule\" in the system", + "key": "valid_mute_rule", + "tag": "Security Monitoring", + "operationId": "CreateSecurityFindingsAutomationMuteRule" + }, + { + "parameters": [ + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"ticket_creation_rules\",\n \"attributes\": {\n \"name\": \"{{ unique }}\",\n \"enabled\": true,\n \"rule\": {\n \"finding_types\": [\"misconfiguration\"],\n \"query\": \"env:staging\"\n },\n \"action\": {\n \"project_id\": \"11111111-1111-1111-1111-111111111111\",\n \"target\": \"jira\",\n \"max_tickets_per_day\": 10\n }\n }\n }\n}" + } + ], + "step": "there is a valid \"valid_ticket_creation_rule\" in the system", + "key": "valid_ticket_creation_rule", + "tag": "Security Monitoring", + "operationId": "CreateSecurityFindingsAutomationTicketCreationRule" + }, { "parameters": [ { diff --git a/features/v2/rum_remote_config.feature b/features/v2/rum_remote_config.feature new file mode 100644 index 000000000000..363d3f0ac324 --- /dev/null +++ b/features/v2/rum_remote_config.feature @@ -0,0 +1,70 @@ +@endpoint(rum-remote-config) @endpoint(rum-remote-config-v2) +Feature: RUM Remote Config + Manage [RUM SDK + configurations](https://docs.datadoghq.com/real_user_monitoring/) + delivered to RUM applications via Remote Configuration. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "RUMRemoteConfig" API + + @team:DataDog/rum-backend + Scenario: Get a RUM SDK configuration returns "Forbidden" response + Given operation "GetRumSdkConfig" enabled + And new "GetRumSdkConfig" request + And request contains "config_id" parameter with value "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + When the request is sent + Then the response status is 403 Forbidden + + @generated @skip @team:DataDog/rum-backend + Scenario: Get a RUM SDK configuration returns "Not Found" response + Given operation "GetRumSdkConfig" enabled + And new "GetRumSdkConfig" request + And request contains "config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/rum-backend + Scenario: Get a RUM SDK configuration returns "OK" response + Given operation "GetRumSdkConfig" enabled + And new "GetRumSdkConfig" request + And request contains "config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/rum-backend + Scenario: Update a RUM SDK configuration returns "Bad Request" response + Given operation "UpdateRumSdkConfig" enabled + And new "UpdateRumSdkConfig" request + And request contains "config_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"rum": {"allowed_tracing_urls": [{"match": {"rc_serialized_type": "string", "value": "https://app.datadoghq.com"}, "propagator_types": ["datadog", "tracecontext"]}], "allowed_tracking_origins": [{"rc_serialized_type": "string", "value": "https://app.datadoghq.com"}], "context": [{"key": "id", "value": {"attribute": "data-version", "extractor": {"rc_serialized_type": "regex", "value": "^https://app-.*.datadoghq.com"}, "key": "app.version", "name": "app_version", "path": "application.version", "rc_serialized_type": "dynamic", "selector": "#app-version", "strategy": "js"}}], "default_privacy_level": "mask", "enable_privacy_for_action_name": true, "env": "production", "service": "my-service", "session_replay_sample_rate": 20, "session_sample_rate": 75, "trace_sample_rate": 100, "track_session_across_subdomains": false, "user": [{"key": "id", "value": {"attribute": "data-version", "extractor": {"rc_serialized_type": "regex", "value": "^https://app-.*.datadoghq.com"}, "key": "app.version", "name": "app_version", "path": "application.version", "rc_serialized_type": "dynamic", "selector": "#app-version", "strategy": "js"}}], "version": {"attribute": "data-version", "extractor": {"rc_serialized_type": "regex", "value": "^https://app-.*.datadoghq.com"}, "key": "app.version", "name": "app_version", "path": "application.version", "rc_serialized_type": "dynamic", "selector": "#app-version", "strategy": "js"}}}, "id": "abc12345-1234-5678-abcd-ef1234567890", "type": "rum_sdk_config"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/rum-backend + Scenario: Update a RUM SDK configuration returns "Forbidden" response + Given operation "UpdateRumSdkConfig" enabled + And new "UpdateRumSdkConfig" request + And request contains "config_id" parameter with value "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa" + And body with value {"data": {"id": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "type": "rum_sdk_config", "attributes": {"rum": {"session_sample_rate": 75, "session_replay_sample_rate": 20, "default_privacy_level": "mask", "enable_privacy_for_action_name": true}}}} + When the request is sent + Then the response status is 403 Forbidden + + @generated @skip @team:DataDog/rum-backend + Scenario: Update a RUM SDK configuration returns "Not Found" response + Given operation "UpdateRumSdkConfig" enabled + And new "UpdateRumSdkConfig" request + And request contains "config_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"rum": {"allowed_tracing_urls": [{"match": {"rc_serialized_type": "string", "value": "https://app.datadoghq.com"}, "propagator_types": ["datadog", "tracecontext"]}], "allowed_tracking_origins": [{"rc_serialized_type": "string", "value": "https://app.datadoghq.com"}], "context": [{"key": "id", "value": {"attribute": "data-version", "extractor": {"rc_serialized_type": "regex", "value": "^https://app-.*.datadoghq.com"}, "key": "app.version", "name": "app_version", "path": "application.version", "rc_serialized_type": "dynamic", "selector": "#app-version", "strategy": "js"}}], "default_privacy_level": "mask", "enable_privacy_for_action_name": true, "env": "production", "service": "my-service", "session_replay_sample_rate": 20, "session_sample_rate": 75, "trace_sample_rate": 100, "track_session_across_subdomains": false, "user": [{"key": "id", "value": {"attribute": "data-version", "extractor": {"rc_serialized_type": "regex", "value": "^https://app-.*.datadoghq.com"}, "key": "app.version", "name": "app_version", "path": "application.version", "rc_serialized_type": "dynamic", "selector": "#app-version", "strategy": "js"}}], "version": {"attribute": "data-version", "extractor": {"rc_serialized_type": "regex", "value": "^https://app-.*.datadoghq.com"}, "key": "app.version", "name": "app_version", "path": "application.version", "rc_serialized_type": "dynamic", "selector": "#app-version", "strategy": "js"}}}, "id": "abc12345-1234-5678-abcd-ef1234567890", "type": "rum_sdk_config"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/rum-backend + Scenario: Update a RUM SDK configuration returns "OK" response + Given operation "UpdateRumSdkConfig" enabled + And new "UpdateRumSdkConfig" request + And request contains "config_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"rum": {"allowed_tracing_urls": [{"match": {"rc_serialized_type": "string", "value": "https://app.datadoghq.com"}, "propagator_types": ["datadog", "tracecontext"]}], "allowed_tracking_origins": [{"rc_serialized_type": "string", "value": "https://app.datadoghq.com"}], "context": [{"key": "id", "value": {"attribute": "data-version", "extractor": {"rc_serialized_type": "regex", "value": "^https://app-.*.datadoghq.com"}, "key": "app.version", "name": "app_version", "path": "application.version", "rc_serialized_type": "dynamic", "selector": "#app-version", "strategy": "js"}}], "default_privacy_level": "mask", "enable_privacy_for_action_name": true, "env": "production", "service": "my-service", "session_replay_sample_rate": 20, "session_sample_rate": 75, "trace_sample_rate": 100, "track_session_across_subdomains": false, "user": [{"key": "id", "value": {"attribute": "data-version", "extractor": {"rc_serialized_type": "regex", "value": "^https://app-.*.datadoghq.com"}, "key": "app.version", "name": "app_version", "path": "application.version", "rc_serialized_type": "dynamic", "selector": "#app-version", "strategy": "js"}}], "version": {"attribute": "data-version", "extractor": {"rc_serialized_type": "regex", "value": "^https://app-.*.datadoghq.com"}, "key": "app.version", "name": "app_version", "path": "application.version", "rc_serialized_type": "dynamic", "selector": "#app-version", "strategy": "js"}}}, "id": "abc12345-1234-5678-abcd-ef1234567890", "type": "rum_sdk_config"}} + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/security_monitoring.feature b/features/v2/security_monitoring.feature index dd064c2a4a6e..0c14124aaecc 100644 --- a/features/v2/security_monitoring.feature +++ b/features/v2/security_monitoring.feature @@ -756,6 +756,60 @@ Feature: Security Monitoring And the response "message" is equal to "Test rule" And the response "isEnabled" is equal to true + @generated @skip @team:DataDog/k9-automation + Scenario: Create a due date rule returns "Bad Request" response + Given operation "CreateSecurityFindingsAutomationDueDateRule" enabled + And new "CreateSecurityFindingsAutomationDueDateRule" request + And body with value {"data": {"attributes": {"action": {"due_days_per_severity": [{"due_in_days": 7, "severity": "critical"}], "due_from": "first_seen", "reason_description": "Applied for production findings only"}, "enabled": true, "name": "Critical findings due in 7 days", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "due_date_rules"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-automation + Scenario: Create a due date rule returns "Successfully created the due date rule" response + Given operation "CreateSecurityFindingsAutomationDueDateRule" enabled + And new "CreateSecurityFindingsAutomationDueDateRule" request + And body with value {"data": {"attributes": {"action": {"due_days_per_severity": [{"due_in_days": 7, "severity": "critical"}], "due_from": "first_seen"}, "enabled": true, "name": "{{ unique }}", "rule": {"finding_types": ["misconfiguration"], "query": "env:staging"}}, "type": "due_date_rules"}} + When the request is sent + Then the response status is 201 Successfully created the due date rule + And the response "data.type" is equal to "due_date_rules" + And the response "data.attributes.name" is equal to "{{ unique }}" + And the response "data.attributes.enabled" is equal to true + + @generated @skip @team:DataDog/k9-automation + Scenario: Create a due date rule returns "Unprocessable Entity" response + Given operation "CreateSecurityFindingsAutomationDueDateRule" enabled + And new "CreateSecurityFindingsAutomationDueDateRule" request + And body with value {"data": {"attributes": {"action": {"due_days_per_severity": [{"due_in_days": 7, "severity": "critical"}], "due_from": "first_seen", "reason_description": "Applied for production findings only"}, "enabled": true, "name": "Critical findings due in 7 days", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "due_date_rules"}} + When the request is sent + Then the response status is 422 Unprocessable Entity + + @generated @skip @team:DataDog/k9-automation + Scenario: Create a mute rule returns "Bad Request" response + Given operation "CreateSecurityFindingsAutomationMuteRule" enabled + And new "CreateSecurityFindingsAutomationMuteRule" request + And body with value {"data": {"attributes": {"action": {"expire_at": 4070908800000, "reason": "risk_accepted", "reason_description": "Accepted for dev environments only"}, "enabled": true, "name": "Mute accepted risks in dev", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "mute_rules"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-automation + Scenario: Create a mute rule returns "Successfully created the mute rule" response + Given operation "CreateSecurityFindingsAutomationMuteRule" enabled + And new "CreateSecurityFindingsAutomationMuteRule" request + And body with value {"data": {"attributes": {"action": {"reason": "risk_accepted"}, "enabled": true, "name": "{{ unique }}", "rule": {"finding_types": ["misconfiguration"], "query": "env:staging"}}, "type": "mute_rules"}} + When the request is sent + Then the response status is 201 Successfully created the mute rule + And the response "data.type" is equal to "mute_rules" + And the response "data.attributes.name" is equal to "{{ unique }}" + And the response "data.attributes.enabled" is equal to true + + @generated @skip @team:DataDog/k9-automation + Scenario: Create a mute rule returns "Unprocessable Entity" response + Given operation "CreateSecurityFindingsAutomationMuteRule" enabled + And new "CreateSecurityFindingsAutomationMuteRule" request + And body with value {"data": {"attributes": {"action": {"expire_at": 4070908800000, "reason": "risk_accepted", "reason_description": "Accepted for dev environments only"}, "enabled": true, "name": "Mute accepted risks in dev", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "mute_rules"}} + When the request is sent + Then the response status is 422 Unprocessable Entity + @generated @skip @team:DataDog/cloud-security-posture-management Scenario: Create a new signal-based notification rule returns "Bad Request" response Given new "CreateSignalNotificationRule" request @@ -870,6 +924,33 @@ Feature: Security Monitoring And the response "data.attributes.rule_query" is equal to "type:log_detection source:cloudtrail" And the response "data.attributes.data_exclusion_query" is equal to "account_id:12345" + @generated @skip @team:DataDog/k9-automation + Scenario: Create a ticket creation rule returns "Bad Request" response + Given operation "CreateSecurityFindingsAutomationTicketCreationRule" enabled + And new "CreateSecurityFindingsAutomationTicketCreationRule" request + And body with value {"data": {"attributes": {"action": {"assignee_id": "22222222-2222-2222-2222-222222222222", "fields": {"labels": ["security"]}, "max_tickets_per_day": 100, "project_id": "11111111-1111-1111-1111-111111111111", "target": "jira"}, "enabled": true, "name": "Auto-create Jira tickets for critical findings", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "ticket_creation_rules"}} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-automation + Scenario: Create a ticket creation rule returns "Successfully created the ticket creation rule" response + Given operation "CreateSecurityFindingsAutomationTicketCreationRule" enabled + And new "CreateSecurityFindingsAutomationTicketCreationRule" request + And body with value {"data": {"attributes": {"action": {"max_tickets_per_day": 10, "project_id": "11111111-1111-1111-1111-111111111111", "target": "jira"}, "enabled": true, "name": "{{ unique }}", "rule": {"finding_types": ["misconfiguration"], "query": "env:staging"}}, "type": "ticket_creation_rules"}} + When the request is sent + Then the response status is 201 Successfully created the ticket creation rule + And the response "data.type" is equal to "ticket_creation_rules" + And the response "data.attributes.name" is equal to "{{ unique }}" + And the response "data.attributes.enabled" is equal to true + + @generated @skip @team:DataDog/k9-automation + Scenario: Create a ticket creation rule returns "Unprocessable Entity" response + Given operation "CreateSecurityFindingsAutomationTicketCreationRule" enabled + And new "CreateSecurityFindingsAutomationTicketCreationRule" request + And body with value {"data": {"attributes": {"action": {"assignee_id": "22222222-2222-2222-2222-222222222222", "fields": {"labels": ["security"]}, "max_tickets_per_day": 100, "project_id": "11111111-1111-1111-1111-111111111111", "target": "jira"}, "enabled": true, "name": "Auto-create Jira tickets for critical findings", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "ticket_creation_rules"}} + When the request is sent + Then the response status is 422 Unprocessable Entity + @generated @skip @team:DataDog/k9-cloud-siem Scenario: Create an entity context sync configuration returns "Bad Request" response Given operation "CreateSecurityMonitoringIntegrationConfig" enabled @@ -1042,6 +1123,40 @@ Feature: Security Monitoring When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/k9-automation + Scenario: Delete a due date rule returns "Not Found" response + Given operation "DeleteSecurityFindingsAutomationDueDateRule" enabled + And new "DeleteSecurityFindingsAutomationDueDateRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-automation + Scenario: Delete a due date rule returns "Rule successfully deleted." response + Given operation "DeleteSecurityFindingsAutomationDueDateRule" enabled + And there is a valid "valid_due_date_rule" in the system + And new "DeleteSecurityFindingsAutomationDueDateRule" request + And request contains "rule_id" parameter from "valid_due_date_rule.data.id" + When the request is sent + Then the response status is 204 Rule successfully deleted. + + @generated @skip @team:DataDog/k9-automation + Scenario: Delete a mute rule returns "Not Found" response + Given operation "DeleteSecurityFindingsAutomationMuteRule" enabled + And new "DeleteSecurityFindingsAutomationMuteRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-automation + Scenario: Delete a mute rule returns "Rule successfully deleted." response + Given operation "DeleteSecurityFindingsAutomationMuteRule" enabled + And there is a valid "valid_mute_rule" in the system + And new "DeleteSecurityFindingsAutomationMuteRule" request + And request contains "rule_id" parameter from "valid_mute_rule.data.id" + When the request is sent + Then the response status is 204 Rule successfully deleted. + @skip @team:DataDog/k9-cloud-siem Scenario: Delete a non existing rule returns "Not Found" response Given new "DeleteSecurityMonitoringRule" request @@ -1101,6 +1216,23 @@ Feature: Security Monitoring When the request is sent Then the response status is 204 OK + @generated @skip @team:DataDog/k9-automation + Scenario: Delete a ticket creation rule returns "Not Found" response + Given operation "DeleteSecurityFindingsAutomationTicketCreationRule" enabled + And new "DeleteSecurityFindingsAutomationTicketCreationRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-automation + Scenario: Delete a ticket creation rule returns "Rule successfully deleted." response + Given operation "DeleteSecurityFindingsAutomationTicketCreationRule" enabled + And there is a valid "valid_ticket_creation_rule" in the system + And new "DeleteSecurityFindingsAutomationTicketCreationRule" request + And request contains "rule_id" parameter from "valid_ticket_creation_rule.data.id" + When the request is sent + Then the response status is 204 Rule successfully deleted. + @team:DataDog/cloud-security-posture-management Scenario: Delete a vulnerability-based notification rule returns "Not Found" response Given new "DeleteVulnerabilityNotificationRule" request @@ -1408,6 +1540,25 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/k9-automation + Scenario: Get a due date rule returns "Not Found" response + Given operation "GetSecurityFindingsAutomationDueDateRule" enabled + And new "GetSecurityFindingsAutomationDueDateRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-automation + Scenario: Get a due date rule returns "Successfully retrieved the due date rule" response + Given operation "GetSecurityFindingsAutomationDueDateRule" enabled + And there is a valid "valid_due_date_rule" in the system + And new "GetSecurityFindingsAutomationDueDateRule" request + And request contains "rule_id" parameter from "valid_due_date_rule.data.id" + When the request is sent + Then the response status is 200 Successfully retrieved the due date rule + And the response "data.id" is equal to "{{ valid_due_date_rule.data.id }}" + And the response "data.type" is equal to "due_date_rules" + @generated @skip @team:DataDog/cloud-security-posture-management Scenario: Get a finding returns "Bad Request: The server cannot process the request due to invalid syntax in the request." response Given operation "GetFinding" enabled @@ -1529,6 +1680,25 @@ Feature: Security Monitoring Then the response status is 200 OK And the response has 3 items + @generated @skip @team:DataDog/k9-automation + Scenario: Get a mute rule returns "Not Found" response + Given operation "GetSecurityFindingsAutomationMuteRule" enabled + And new "GetSecurityFindingsAutomationMuteRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-automation + Scenario: Get a mute rule returns "Successfully retrieved the mute rule" response + Given operation "GetSecurityFindingsAutomationMuteRule" enabled + And there is a valid "valid_mute_rule" in the system + And new "GetSecurityFindingsAutomationMuteRule" request + And request contains "rule_id" parameter from "valid_mute_rule.data.id" + When the request is sent + Then the response status is 200 Successfully retrieved the mute rule + And the response "data.id" is equal to "{{ valid_mute_rule.data.id }}" + And the response "data.type" is equal to "mute_rules" + @generated @skip @team:DataDog/k9-cloud-siem Scenario: Get a quick list of security signals returns "Bad Request" response Given new "ListSecurityMonitoringSignals" request @@ -1680,12 +1850,49 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/k9-automation + Scenario: Get a ticket creation rule returns "Not Found" response + Given operation "GetSecurityFindingsAutomationTicketCreationRule" enabled + And new "GetSecurityFindingsAutomationTicketCreationRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-automation + Scenario: Get a ticket creation rule returns "Successfully retrieved the ticket creation rule" response + Given operation "GetSecurityFindingsAutomationTicketCreationRule" enabled + And there is a valid "valid_ticket_creation_rule" in the system + And new "GetSecurityFindingsAutomationTicketCreationRule" request + And request contains "rule_id" parameter from "valid_ticket_creation_rule.data.id" + When the request is sent + Then the response status is 200 Successfully retrieved the ticket creation rule + And the response "data.id" is equal to "{{ valid_ticket_creation_rule.data.id }}" + And the response "data.type" is equal to "ticket_creation_rules" + @team:DataDog/k9-cloud-siem Scenario: Get all critical assets returns "OK" response Given new "ListSecurityMonitoringCriticalAssets" request When the request is sent Then the response status is 200 OK + @team:DataDog/k9-automation + Scenario: Get all due date rules returns "Successfully retrieved the list of due date rules" response + Given operation "ListSecurityFindingsAutomationDueDateRules" enabled + And there is a valid "valid_due_date_rule" in the system + And new "ListSecurityFindingsAutomationDueDateRules" request + When the request is sent + Then the response status is 200 Successfully retrieved the list of due date rules + And the response "data" has item with field "id" with value "{{ valid_due_date_rule.data.id }}" + + @team:DataDog/k9-automation + Scenario: Get all mute rules returns "Successfully retrieved the list of mute rules" response + Given operation "ListSecurityFindingsAutomationMuteRules" enabled + And there is a valid "valid_mute_rule" in the system + And new "ListSecurityFindingsAutomationMuteRules" request + When the request is sent + Then the response status is 200 Successfully retrieved the list of mute rules + And the response "data" has item with field "id" with value "{{ valid_mute_rule.data.id }}" + @team:DataDog/k9-cloud-siem Scenario: Get all security filters returns "OK" response Given new "ListSecurityFilters" request @@ -1734,6 +1941,15 @@ Feature: Security Monitoring Then the response status is 200 OK And the response "data[0].attributes.name" is equal to "suppression2 {{ unique_hash }}" + @team:DataDog/k9-automation + Scenario: Get all ticket creation rules returns "Successfully retrieved the list of ticket creation rules" response + Given operation "ListSecurityFindingsAutomationTicketCreationRules" enabled + And there is a valid "valid_ticket_creation_rule" in the system + And new "ListSecurityFindingsAutomationTicketCreationRules" request + When the request is sent + Then the response status is 200 Successfully retrieved the list of ticket creation rules + And the response "data" has item with field "id" with value "{{ valid_ticket_creation_rule.data.id }}" + @generated @skip @team:DataDog/k9-cloud-siem Scenario: Get an entity context sync configuration returns "Not Found" response Given operation "GetSecurityMonitoringIntegrationConfig" enabled @@ -2517,6 +2733,81 @@ Feature: Security Monitoring When the request is sent Then the response status is 422 The server cannot process the request because it contains invalid data. + @generated @skip @team:DataDog/k9-automation + Scenario: Reorder due date rules returns "Bad Request" response + Given operation "ReorderSecurityFindingsAutomationDueDateRules" enabled + And new "ReorderSecurityFindingsAutomationDueDateRules" request + And body with value {"data": [{"id": "00000000-0000-0000-0000-000000000000", "type": "due_date_rules"}]} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-automation + Scenario: Reorder due date rules returns "Successfully reordered the due date rules" response + Given operation "ReorderSecurityFindingsAutomationDueDateRules" enabled + And there is a valid "valid_due_date_rule" in the system + And new "ReorderSecurityFindingsAutomationDueDateRules" request + And body with value {"data": [{"id": "{{ valid_due_date_rule.data.id }}", "type": "due_date_rules"}]} + When the request is sent + Then the response status is 200 Successfully reordered the due date rules + + @generated @skip @team:DataDog/k9-automation + Scenario: Reorder due date rules returns "Unprocessable Entity" response + Given operation "ReorderSecurityFindingsAutomationDueDateRules" enabled + And new "ReorderSecurityFindingsAutomationDueDateRules" request + And body with value {"data": [{"id": "00000000-0000-0000-0000-000000000000", "type": "due_date_rules"}]} + When the request is sent + Then the response status is 422 Unprocessable Entity + + @generated @skip @team:DataDog/k9-automation + Scenario: Reorder mute rules returns "Bad Request" response + Given operation "ReorderSecurityFindingsAutomationMuteRules" enabled + And new "ReorderSecurityFindingsAutomationMuteRules" request + And body with value {"data": [{"id": "00000000-0000-0000-0000-000000000000", "type": "mute_rules"}]} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-automation + Scenario: Reorder mute rules returns "Successfully reordered the mute rules" response + Given operation "ReorderSecurityFindingsAutomationMuteRules" enabled + And there is a valid "valid_mute_rule" in the system + And new "ReorderSecurityFindingsAutomationMuteRules" request + And body with value {"data": [{"id": "{{ valid_mute_rule.data.id }}", "type": "mute_rules"}]} + When the request is sent + Then the response status is 200 Successfully reordered the mute rules + + @generated @skip @team:DataDog/k9-automation + Scenario: Reorder mute rules returns "Unprocessable Entity" response + Given operation "ReorderSecurityFindingsAutomationMuteRules" enabled + And new "ReorderSecurityFindingsAutomationMuteRules" request + And body with value {"data": [{"id": "00000000-0000-0000-0000-000000000000", "type": "mute_rules"}]} + When the request is sent + Then the response status is 422 Unprocessable Entity + + @generated @skip @team:DataDog/k9-automation + Scenario: Reorder ticket creation rules returns "Bad Request" response + Given operation "ReorderSecurityFindingsAutomationTicketCreationRules" enabled + And new "ReorderSecurityFindingsAutomationTicketCreationRules" request + And body with value {"data": [{"id": "00000000-0000-0000-0000-000000000000", "type": "ticket_creation_rules"}]} + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-automation + Scenario: Reorder ticket creation rules returns "Successfully reordered the ticket creation rules" response + Given operation "ReorderSecurityFindingsAutomationTicketCreationRules" enabled + And there is a valid "valid_ticket_creation_rule" in the system + And new "ReorderSecurityFindingsAutomationTicketCreationRules" request + And body with value {"data": [{"id": "{{ valid_ticket_creation_rule.data.id }}", "type": "ticket_creation_rules"}]} + When the request is sent + Then the response status is 200 Successfully reordered the ticket creation rules + + @generated @skip @team:DataDog/k9-automation + Scenario: Reorder ticket creation rules returns "Unprocessable Entity" response + Given operation "ReorderSecurityFindingsAutomationTicketCreationRules" enabled + And new "ReorderSecurityFindingsAutomationTicketCreationRules" request + And body with value {"data": [{"id": "00000000-0000-0000-0000-000000000000", "type": "ticket_creation_rules"}]} + When the request is sent + Then the response status is 422 Unprocessable Entity + @generated @skip @team:DataDog/k9-cloud-siem Scenario: Restore a rule to a historical version returns "Bad Request" response Given operation "RestoreSecurityMonitoringRule" enabled @@ -2862,6 +3153,84 @@ Feature: Security Monitoring When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/k9-automation + Scenario: Update a due date rule returns "Bad Request" response + Given operation "UpdateSecurityFindingsAutomationDueDateRule" enabled + And new "UpdateSecurityFindingsAutomationDueDateRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"due_days_per_severity": [{"due_in_days": 7, "severity": "critical"}], "due_from": "first_seen", "reason_description": "Applied for production findings only"}, "enabled": true, "name": "Critical findings due in 7 days", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "due_date_rules"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-automation + Scenario: Update a due date rule returns "Not Found" response + Given operation "UpdateSecurityFindingsAutomationDueDateRule" enabled + And new "UpdateSecurityFindingsAutomationDueDateRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"due_days_per_severity": [{"due_in_days": 7, "severity": "critical"}], "due_from": "first_seen", "reason_description": "Applied for production findings only"}, "enabled": true, "name": "Critical findings due in 7 days", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "due_date_rules"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-automation + Scenario: Update a due date rule returns "Successfully updated the due date rule" response + Given operation "UpdateSecurityFindingsAutomationDueDateRule" enabled + And there is a valid "valid_due_date_rule" in the system + And new "UpdateSecurityFindingsAutomationDueDateRule" request + And request contains "rule_id" parameter from "valid_due_date_rule.data.id" + And body with value {"data": {"attributes": {"action": {"due_days_per_severity": [{"due_in_days": 14, "severity": "critical"}], "due_from": "first_seen"}, "enabled": false, "name": "{{ unique }}", "rule": {"finding_types": ["misconfiguration"], "query": "env:staging"}}, "type": "due_date_rules"}} + When the request is sent + Then the response status is 200 Successfully updated the due date rule + And the response "data.id" is equal to "{{ valid_due_date_rule.data.id }}" + And the response "data.attributes.name" is equal to "{{ unique }}" + + @generated @skip @team:DataDog/k9-automation + Scenario: Update a due date rule returns "Unprocessable Entity" response + Given operation "UpdateSecurityFindingsAutomationDueDateRule" enabled + And new "UpdateSecurityFindingsAutomationDueDateRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"due_days_per_severity": [{"due_in_days": 7, "severity": "critical"}], "due_from": "first_seen", "reason_description": "Applied for production findings only"}, "enabled": true, "name": "Critical findings due in 7 days", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "due_date_rules"}} + When the request is sent + Then the response status is 422 Unprocessable Entity + + @generated @skip @team:DataDog/k9-automation + Scenario: Update a mute rule returns "Bad Request" response + Given operation "UpdateSecurityFindingsAutomationMuteRule" enabled + And new "UpdateSecurityFindingsAutomationMuteRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"expire_at": 4070908800000, "reason": "risk_accepted", "reason_description": "Accepted for dev environments only"}, "enabled": true, "name": "Mute accepted risks in dev", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "mute_rules"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-automation + Scenario: Update a mute rule returns "Not Found" response + Given operation "UpdateSecurityFindingsAutomationMuteRule" enabled + And new "UpdateSecurityFindingsAutomationMuteRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"expire_at": 4070908800000, "reason": "risk_accepted", "reason_description": "Accepted for dev environments only"}, "enabled": true, "name": "Mute accepted risks in dev", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "mute_rules"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-automation + Scenario: Update a mute rule returns "Successfully updated the mute rule" response + Given operation "UpdateSecurityFindingsAutomationMuteRule" enabled + And there is a valid "valid_mute_rule" in the system + And new "UpdateSecurityFindingsAutomationMuteRule" request + And request contains "rule_id" parameter from "valid_mute_rule.data.id" + And body with value {"data": {"attributes": {"action": {"reason": "false_positive"}, "enabled": false, "name": "{{ unique }}", "rule": {"finding_types": ["misconfiguration"], "query": "env:staging"}}, "type": "mute_rules"}} + When the request is sent + Then the response status is 200 Successfully updated the mute rule + And the response "data.id" is equal to "{{ valid_mute_rule.data.id }}" + And the response "data.attributes.name" is equal to "{{ unique }}" + + @generated @skip @team:DataDog/k9-automation + Scenario: Update a mute rule returns "Unprocessable Entity" response + Given operation "UpdateSecurityFindingsAutomationMuteRule" enabled + And new "UpdateSecurityFindingsAutomationMuteRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"expire_at": 4070908800000, "reason": "risk_accepted", "reason_description": "Accepted for dev environments only"}, "enabled": true, "name": "Mute accepted risks in dev", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "mute_rules"}} + When the request is sent + Then the response status is 422 Unprocessable Entity + @generated @skip @team:DataDog/k9-cloud-siem Scenario: Update a security filter returns "Bad Request" response Given new "UpdateSecurityFilter" request @@ -2934,6 +3303,45 @@ Feature: Security Monitoring And the response "data.attributes.suppression_query" is equal to "env:staging status:low" And the response "data.attributes.version" is equal to 2 + @generated @skip @team:DataDog/k9-automation + Scenario: Update a ticket creation rule returns "Bad Request" response + Given operation "UpdateSecurityFindingsAutomationTicketCreationRule" enabled + And new "UpdateSecurityFindingsAutomationTicketCreationRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"assignee_id": "22222222-2222-2222-2222-222222222222", "fields": {"labels": ["security"]}, "max_tickets_per_day": 100, "project_id": "11111111-1111-1111-1111-111111111111", "target": "jira"}, "enabled": true, "name": "Auto-create Jira tickets for critical findings", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "ticket_creation_rules"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/k9-automation + Scenario: Update a ticket creation rule returns "Not Found" response + Given operation "UpdateSecurityFindingsAutomationTicketCreationRule" enabled + And new "UpdateSecurityFindingsAutomationTicketCreationRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"assignee_id": "22222222-2222-2222-2222-222222222222", "fields": {"labels": ["security"]}, "max_tickets_per_day": 100, "project_id": "11111111-1111-1111-1111-111111111111", "target": "jira"}, "enabled": true, "name": "Auto-create Jira tickets for critical findings", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "ticket_creation_rules"}} + When the request is sent + Then the response status is 404 Not Found + + @team:DataDog/k9-automation + Scenario: Update a ticket creation rule returns "Successfully updated the ticket creation rule" response + Given operation "UpdateSecurityFindingsAutomationTicketCreationRule" enabled + And there is a valid "valid_ticket_creation_rule" in the system + And new "UpdateSecurityFindingsAutomationTicketCreationRule" request + And request contains "rule_id" parameter from "valid_ticket_creation_rule.data.id" + And body with value {"data": {"attributes": {"action": {"max_tickets_per_day": 5, "project_id": "11111111-1111-1111-1111-111111111111", "target": "jira"}, "enabled": false, "name": "{{ unique }}", "rule": {"finding_types": ["misconfiguration"], "query": "env:staging"}}, "type": "ticket_creation_rules"}} + When the request is sent + Then the response status is 200 Successfully updated the ticket creation rule + And the response "data.id" is equal to "{{ valid_ticket_creation_rule.data.id }}" + And the response "data.attributes.name" is equal to "{{ unique }}" + + @generated @skip @team:DataDog/k9-automation + Scenario: Update a ticket creation rule returns "Unprocessable Entity" response + Given operation "UpdateSecurityFindingsAutomationTicketCreationRule" enabled + And new "UpdateSecurityFindingsAutomationTicketCreationRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"action": {"assignee_id": "22222222-2222-2222-2222-222222222222", "fields": {"labels": ["security"]}, "max_tickets_per_day": 100, "project_id": "11111111-1111-1111-1111-111111111111", "target": "jira"}, "enabled": true, "name": "Auto-create Jira tickets for critical findings", "rule": {"finding_types": ["misconfiguration"], "query": "env:prod team:platform"}}, "type": "ticket_creation_rules"}} + When the request is sent + Then the response status is 422 Unprocessable Entity + @generated @skip @team:DataDog/k9-cloud-siem Scenario: Update an entity context sync configuration returns "Bad Request" response Given operation "UpdateSecurityMonitoringIntegrationConfig" enabled diff --git a/features/v2/undo.json b/features/v2/undo.json index 049cc1252219..89626bc569e4 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -6302,6 +6302,18 @@ "type": "idempotent" } }, + "GetRumSdkConfig": { + "tag": "RUM Remote Config", + "undo": { + "type": "safe" + } + }, + "UpdateRumSdkConfig": { + "tag": "RUM Remote Config", + "undo": { + "type": "idempotent" + } + }, "ListReplayHeatmapSnapshots": { "tag": "Rum Replay Heatmaps", "undo": { @@ -6913,6 +6925,135 @@ "type": "idempotent" } }, + "ListSecurityFindingsAutomationDueDateRules": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "CreateSecurityFindingsAutomationDueDateRule": { + "tag": "Security Monitoring", + "undo": { + "operationId": "DeleteSecurityFindingsAutomationDueDateRule", + "parameters": [ + { + "name": "rule_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "ReorderSecurityFindingsAutomationDueDateRules": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "DeleteSecurityFindingsAutomationDueDateRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "GetSecurityFindingsAutomationDueDateRule": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "UpdateSecurityFindingsAutomationDueDateRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "ListSecurityFindingsAutomationMuteRules": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "CreateSecurityFindingsAutomationMuteRule": { + "tag": "Security Monitoring", + "undo": { + "operationId": "DeleteSecurityFindingsAutomationMuteRule", + "parameters": [ + { + "name": "rule_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "ReorderSecurityFindingsAutomationMuteRules": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "DeleteSecurityFindingsAutomationMuteRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "GetSecurityFindingsAutomationMuteRule": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "UpdateSecurityFindingsAutomationMuteRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "ListSecurityFindingsAutomationTicketCreationRules": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "CreateSecurityFindingsAutomationTicketCreationRule": { + "tag": "Security Monitoring", + "undo": { + "operationId": "DeleteSecurityFindingsAutomationTicketCreationRule", + "parameters": [ + { + "name": "rule_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "ReorderSecurityFindingsAutomationTicketCreationRules": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "DeleteSecurityFindingsAutomationTicketCreationRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, + "GetSecurityFindingsAutomationTicketCreationRule": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "UpdateSecurityFindingsAutomationTicketCreationRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, "DetachCase": { "tag": "Security Monitoring", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index b76c33e4fa5f..c21dc889eb38 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -346,6 +346,9 @@ def initialize "v2.convert_security_monitoring_terraform_resource": false, "v2.create_io_c_triage_state": false, "v2.create_sample_log_generation_subscription": false, + "v2.create_security_findings_automation_due_date_rule": false, + "v2.create_security_findings_automation_mute_rule": false, + "v2.create_security_findings_automation_ticket_creation_rule": false, "v2.create_security_monitoring_dataset": false, "v2.create_security_monitoring_integration_config": false, "v2.create_service_now_tickets": false, @@ -354,6 +357,9 @@ def initialize "v2.deactivate_content_pack": false, "v2.delete_historical_job": false, "v2.delete_sample_log_generation_subscription": false, + "v2.delete_security_findings_automation_due_date_rule": false, + "v2.delete_security_findings_automation_mute_rule": false, + "v2.delete_security_findings_automation_ticket_creation_rule": false, "v2.delete_security_monitoring_dataset": false, "v2.delete_security_monitoring_integration_config": false, "v2.export_security_monitoring_terraform_resource": false, @@ -364,6 +370,9 @@ def initialize "v2.get_indicator_of_compromise": false, "v2.get_rule_version_history": false, "v2.get_secrets_rules": false, + "v2.get_security_findings_automation_due_date_rule": false, + "v2.get_security_findings_automation_mute_rule": false, + "v2.get_security_findings_automation_ticket_creation_rule": false, "v2.get_security_monitoring_dataset": false, "v2.get_security_monitoring_dataset_by_version": false, "v2.get_security_monitoring_dataset_version_history": false, @@ -382,16 +391,25 @@ def initialize "v2.list_multiple_rulesets": false, "v2.list_sample_log_generation_subscriptions": false, "v2.list_scanned_assets_metadata": false, + "v2.list_security_findings_automation_due_date_rules": false, + "v2.list_security_findings_automation_mute_rules": false, + "v2.list_security_findings_automation_ticket_creation_rules": false, "v2.list_security_monitoring_datasets": 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.reorder_security_findings_automation_due_date_rules": false, + "v2.reorder_security_findings_automation_mute_rules": false, + "v2.reorder_security_findings_automation_ticket_creation_rules": false, "v2.restore_security_monitoring_rule": false, "v2.run_historical_job": false, "v2.search_security_monitoring_histsignals": false, "v2.update_findings_assignee": false, + "v2.update_security_findings_automation_due_date_rule": false, + "v2.update_security_findings_automation_mute_rule": false, + "v2.update_security_findings_automation_ticket_creation_rule": false, "v2.update_security_monitoring_dataset": false, "v2.update_security_monitoring_integration_config": false, "v2.validate_security_monitoring_integration_config": false, @@ -616,6 +634,8 @@ def initialize "v2.get_pruned_trace_by_id": false, "v2.get_trace_by_id": false, "v2.get_asm_service_by_name": false, + "v2.get_rum_sdk_config": false, + "v2.update_rum_sdk_config": false, "v2.create_report_schedule": false, "v2.patch_report_schedule": false, "v2.delete_sourcemaps": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index e4100cdd86e0..d3b40f516952 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1560,12 +1560,16 @@ def overrides "v2.automation_rule_action" => "AutomationRuleAction", "v2.automation_rule_action_data" => "AutomationRuleActionData", "v2.automation_rule_action_type" => "AutomationRuleActionType", + "v2.automation_rule_actor_type" => "AutomationRuleActorType", "v2.automation_rule_attributes" => "AutomationRuleAttributes", "v2.automation_rule_create" => "AutomationRuleCreate", "v2.automation_rule_create_attributes" => "AutomationRuleCreateAttributes", + "v2.automation_rule_created_by" => "AutomationRuleCreatedBy", "v2.automation_rule_create_request" => "AutomationRuleCreateRequest", + "v2.automation_rule_modified_by" => "AutomationRuleModifiedBy", "v2.automation_rule_relationships" => "AutomationRuleRelationships", "v2.automation_rule_response" => "AutomationRuleResponse", + "v2.automation_rule_scope" => "AutomationRuleScope", "v2.automation_rules_response" => "AutomationRulesResponse", "v2.automation_rule_trigger" => "AutomationRuleTrigger", "v2.automation_rule_trigger_data" => "AutomationRuleTriggerData", @@ -2918,6 +2922,21 @@ def overrides "v2.downtime_update_request" => "DowntimeUpdateRequest", "v2.downtime_update_request_attributes" => "DowntimeUpdateRequestAttributes", "v2.downtime_update_request_data" => "DowntimeUpdateRequestData", + "v2.due_date_from" => "DueDateFrom", + "v2.due_date_per_severity_item" => "DueDatePerSeverityItem", + "v2.due_date_rule_action" => "DueDateRuleAction", + "v2.due_date_rule_attributes_create" => "DueDateRuleAttributesCreate", + "v2.due_date_rule_attributes_response" => "DueDateRuleAttributesResponse", + "v2.due_date_rule_create_request" => "DueDateRuleCreateRequest", + "v2.due_date_rule_data_create" => "DueDateRuleDataCreate", + "v2.due_date_rule_data_response" => "DueDateRuleDataResponse", + "v2.due_date_rule_reorder_item" => "DueDateRuleReorderItem", + "v2.due_date_rule_reorder_request" => "DueDateRuleReorderRequest", + "v2.due_date_rule_response" => "DueDateRuleResponse", + "v2.due_date_rules_response" => "DueDateRulesResponse", + "v2.due_date_rule_type" => "DueDateRuleType", + "v2.due_date_rule_update_request" => "DueDateRuleUpdateRequest", + "v2.due_date_severity" => "DueDateSeverity", "v2.elf_sourcemap_attributes" => "ELFSourcemapAttributes", "v2.elf_sourcemap_data" => "ELFSourcemapData", "v2.entity_attributes" => "EntityAttributes", @@ -4748,6 +4767,19 @@ def overrides "v2.mute_findings_request_data_relationships" => "MuteFindingsRequestDataRelationships", "v2.mute_findings_response" => "MuteFindingsResponse", "v2.mute_findings_response_data" => "MuteFindingsResponseData", + "v2.mute_reason" => "MuteReason", + "v2.mute_rule_action" => "MuteRuleAction", + "v2.mute_rule_attributes_create" => "MuteRuleAttributesCreate", + "v2.mute_rule_attributes_response" => "MuteRuleAttributesResponse", + "v2.mute_rule_create_request" => "MuteRuleCreateRequest", + "v2.mute_rule_data_create" => "MuteRuleDataCreate", + "v2.mute_rule_data_response" => "MuteRuleDataResponse", + "v2.mute_rule_reorder_item" => "MuteRuleReorderItem", + "v2.mute_rule_reorder_request" => "MuteRuleReorderRequest", + "v2.mute_rule_response" => "MuteRuleResponse", + "v2.mute_rules_response" => "MuteRulesResponse", + "v2.mute_rule_type" => "MuteRuleType", + "v2.mute_rule_update_request" => "MuteRuleUpdateRequest", "v2.ndk_sourcemap_attributes" => "NDKSourcemapAttributes", "v2.ndk_sourcemap_data" => "NDKSourcemapData", "v2.network_health_insight" => "NetworkHealthInsight", @@ -5963,6 +5995,26 @@ def overrides "v2.rum_retention_filter_update_attributes" => "RumRetentionFilterUpdateAttributes", "v2.rum_retention_filter_update_data" => "RumRetentionFilterUpdateData", "v2.rum_retention_filter_update_request" => "RumRetentionFilterUpdateRequest", + "v2.rum_sdk_config_attributes" => "RumSdkConfigAttributes", + "v2.rum_sdk_config_data" => "RumSdkConfigData", + "v2.rum_sdk_config_dynamic_option" => "RumSdkConfigDynamicOption", + "v2.rum_sdk_config_dynamic_option_pair" => "RumSdkConfigDynamicOptionPair", + "v2.rum_sdk_config_dynamic_option_serialized_type" => "RumSdkConfigDynamicOptionSerializedType", + "v2.rum_sdk_config_dynamic_option_strategy" => "RumSdkConfigDynamicOptionStrategy", + "v2.rum_sdk_config_match_option" => "RumSdkConfigMatchOption", + "v2.rum_sdk_config_match_option_serialized_type" => "RumSdkConfigMatchOptionSerializedType", + "v2.rum_sdk_config_meta" => "RumSdkConfigMeta", + "v2.rum_sdk_config_response" => "RumSdkConfigResponse", + "v2.rum_sdk_config_rum_attributes" => "RumSdkConfigRumAttributes", + "v2.rum_sdk_config_rum_update_attributes" => "RumSdkConfigRumUpdateAttributes", + "v2.rum_sdk_config_serialized_regex" => "RumSdkConfigSerializedRegex", + "v2.rum_sdk_config_serialized_regex_type" => "RumSdkConfigSerializedRegexType", + "v2.rum_sdk_config_tracing_url_config" => "RumSdkConfigTracingUrlConfig", + "v2.rum_sdk_config_tracing_url_propagator_type" => "RumSdkConfigTracingUrlPropagatorType", + "v2.rum_sdk_config_type" => "RumSdkConfigType", + "v2.rum_sdk_config_update_attributes" => "RumSdkConfigUpdateAttributes", + "v2.rum_sdk_config_update_data" => "RumSdkConfigUpdateData", + "v2.rum_sdk_config_update_request" => "RumSdkConfigUpdateRequest", "v2.rum_search_events_request" => "RUMSearchEventsRequest", "v2.rum_sort" => "RUMSort", "v2.rum_sort_order" => "RUMSortOrder", @@ -6163,6 +6215,9 @@ def overrides "v2.secure_embed_update_response_type" => "SecureEmbedUpdateResponseType", "v2.secure_embed_viewing_preferences" => "SecureEmbedViewingPreferences", "v2.secure_embed_viewing_preferences_theme" => "SecureEmbedViewingPreferencesTheme", + "v2.security_automation_rules_links" => "SecurityAutomationRulesLinks", + "v2.security_automation_rules_meta" => "SecurityAutomationRulesMeta", + "v2.security_automation_rules_page_info" => "SecurityAutomationRulesPageInfo", "v2.security_entity_config_risks" => "SecurityEntityConfigRisks", "v2.security_entity_metadata" => "SecurityEntityMetadata", "v2.security_entity_risk_score" => "SecurityEntityRiskScore", @@ -6204,6 +6259,7 @@ def overrides "v2.security_findings_search_request_page" => "SecurityFindingsSearchRequestPage", "v2.security_findings_sort" => "SecurityFindingsSort", "v2.security_findings_status" => "SecurityFindingsStatus", + "v2.security_finding_type" => "SecurityFindingType", "v2.security_monitoring_content_pack_activation" => "SecurityMonitoringContentPackActivation", "v2.security_monitoring_content_pack_integration_status" => "SecurityMonitoringContentPackIntegrationStatus", "v2.security_monitoring_content_pack_state_attributes" => "SecurityMonitoringContentPackStateAttributes", @@ -7319,6 +7375,20 @@ def overrides "v2.test_optimization_update_service_settings_request_attributes" => "TestOptimizationUpdateServiceSettingsRequestAttributes", "v2.test_optimization_update_service_settings_request_data" => "TestOptimizationUpdateServiceSettingsRequestData", "v2.test_optimization_update_service_settings_request_data_type" => "TestOptimizationUpdateServiceSettingsRequestDataType", + "v2.ticket_creation_rule_action" => "TicketCreationRuleAction", + "v2.ticket_creation_rule_action_response" => "TicketCreationRuleActionResponse", + "v2.ticket_creation_rule_attributes_create" => "TicketCreationRuleAttributesCreate", + "v2.ticket_creation_rule_attributes_response" => "TicketCreationRuleAttributesResponse", + "v2.ticket_creation_rule_create_request" => "TicketCreationRuleCreateRequest", + "v2.ticket_creation_rule_data_create" => "TicketCreationRuleDataCreate", + "v2.ticket_creation_rule_data_response" => "TicketCreationRuleDataResponse", + "v2.ticket_creation_rule_reorder_item" => "TicketCreationRuleReorderItem", + "v2.ticket_creation_rule_reorder_request" => "TicketCreationRuleReorderRequest", + "v2.ticket_creation_rule_response" => "TicketCreationRuleResponse", + "v2.ticket_creation_rules_response" => "TicketCreationRulesResponse", + "v2.ticket_creation_rule_type" => "TicketCreationRuleType", + "v2.ticket_creation_rule_update_request" => "TicketCreationRuleUpdateRequest", + "v2.ticket_creation_target" => "TicketCreationTarget", "v2.timeline_cell" => "TimelineCell", "v2.timeline_cell_author" => "TimelineCellAuthor", "v2.timeline_cell_author_user" => "TimelineCellAuthorUser", @@ -7822,6 +7892,7 @@ def overrides "v2.rum_insights_api" => "RUMInsightsAPI", "v2.rum_metrics_api" => "RumMetricsAPI", "v2.rum_rate_limit_api" => "RumRateLimitAPI", + "v2.rum_remote_config_api" => "RUMRemoteConfigAPI", "v2.rum_replay_heatmaps_api" => "RumReplayHeatmapsAPI", "v2.rum_replay_playlists_api" => "RumReplayPlaylistsAPI", "v2.rum_replay_sessions_api" => "RumReplaySessionsAPI", diff --git a/lib/datadog_api_client/v2/api/rum_remote_config_api.rb b/lib/datadog_api_client/v2/api/rum_remote_config_api.rb new file mode 100644 index 000000000000..840d3f0e08c4 --- /dev/null +++ b/lib/datadog_api_client/v2/api/rum_remote_config_api.rb @@ -0,0 +1,176 @@ +=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 'cgi' + +module DatadogAPIClient::V2 + class RUMRemoteConfigAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Get a RUM SDK configuration. + # + # @see #get_rum_sdk_config_with_http_info + def get_rum_sdk_config(config_id, opts = {}) + data, _status_code, _headers = get_rum_sdk_config_with_http_info(config_id, opts) + data + end + + # Get a RUM SDK configuration. + # + # Retrieve a RUM SDK configuration by its identifier. + # + # @param config_id [String] The ID of the RUM SDK configuration. + # @param opts [Hash] the optional parameters + # @return [Array<(RumSdkConfigResponse, Integer, Hash)>] RumSdkConfigResponse data, response status code and response headers + def get_rum_sdk_config_with_http_info(config_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_rum_sdk_config".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_rum_sdk_config") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_rum_sdk_config")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RUMRemoteConfigAPI.get_rum_sdk_config ...' + end + # verify the required parameter 'config_id' is set + if @api_client.config.client_side_validation && config_id.nil? + fail ArgumentError, "Missing the required parameter 'config_id' when calling RUMRemoteConfigAPI.get_rum_sdk_config" + end + # resource path + local_var_path = '/api/v2/remote_config/products/rum/configs/{config_id}'.sub('{config_id}', CGI.escape(config_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] || 'RumSdkConfigResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_rum_sdk_config, + :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: RUMRemoteConfigAPI#get_rum_sdk_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update a RUM SDK configuration. + # + # @see #update_rum_sdk_config_with_http_info + def update_rum_sdk_config(config_id, body, opts = {}) + data, _status_code, _headers = update_rum_sdk_config_with_http_info(config_id, body, opts) + data + end + + # Update a RUM SDK configuration. + # + # Update an existing RUM SDK configuration by its identifier. + # Returns the updated configuration when successful. + # + # @param config_id [String] The ID of the RUM SDK configuration. + # @param body [RumSdkConfigUpdateRequest] The RUM SDK configuration update. + # @param opts [Hash] the optional parameters + # @return [Array<(RumSdkConfigResponse, Integer, Hash)>] RumSdkConfigResponse data, response status code and response headers + def update_rum_sdk_config_with_http_info(config_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_rum_sdk_config".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_rum_sdk_config") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_rum_sdk_config")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: RUMRemoteConfigAPI.update_rum_sdk_config ...' + end + # verify the required parameter 'config_id' is set + if @api_client.config.client_side_validation && config_id.nil? + fail ArgumentError, "Missing the required parameter 'config_id' when calling RUMRemoteConfigAPI.update_rum_sdk_config" + 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 RUMRemoteConfigAPI.update_rum_sdk_config" + end + # resource path + local_var_path = '/api/v2/remote_config/products/rum/configs/{config_id}'.sub('{config_id}', CGI.escape(config_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] || 'RumSdkConfigResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_rum_sdk_config, + :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: RUMRemoteConfigAPI#update_rum_sdk_config\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 afd3f8bd9d4c..87ad9daa5f92 100644 --- a/lib/datadog_api_client/v2/api/security_monitoring_api.rb +++ b/lib/datadog_api_client/v2/api/security_monitoring_api.rb @@ -1761,6 +1761,225 @@ def create_security_filter_with_http_info(body, opts = {}) return data, status_code, headers end + # Create a due date rule. + # + # @see #create_security_findings_automation_due_date_rule_with_http_info + def create_security_findings_automation_due_date_rule(body, opts = {}) + data, _status_code, _headers = create_security_findings_automation_due_date_rule_with_http_info(body, opts) + data + end + + # Create a due date rule. + # + # Create a new due date rule for the current organization. + # + # @param body [DueDateRuleCreateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(DueDateRuleResponse, Integer, Hash)>] DueDateRuleResponse data, response status code and response headers + def create_security_findings_automation_due_date_rule_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_security_findings_automation_due_date_rule".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_security_findings_automation_due_date_rule") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_security_findings_automation_due_date_rule")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.create_security_findings_automation_due_date_rule ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.create_security_findings_automation_due_date_rule" + end + # resource path + local_var_path = '/api/v2/security/findings/automation/due_date_rules' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'DueDateRuleResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_security_findings_automation_due_date_rule, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#create_security_findings_automation_due_date_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Create a mute rule. + # + # @see #create_security_findings_automation_mute_rule_with_http_info + def create_security_findings_automation_mute_rule(body, opts = {}) + data, _status_code, _headers = create_security_findings_automation_mute_rule_with_http_info(body, opts) + data + end + + # Create a mute rule. + # + # Create a new mute rule for the current organization. + # + # @param body [MuteRuleCreateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(MuteRuleResponse, Integer, Hash)>] MuteRuleResponse data, response status code and response headers + def create_security_findings_automation_mute_rule_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_security_findings_automation_mute_rule".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_security_findings_automation_mute_rule") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_security_findings_automation_mute_rule")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.create_security_findings_automation_mute_rule ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.create_security_findings_automation_mute_rule" + end + # resource path + local_var_path = '/api/v2/security/findings/automation/mute_rules' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'MuteRuleResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_security_findings_automation_mute_rule, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#create_security_findings_automation_mute_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Create a ticket creation rule. + # + # @see #create_security_findings_automation_ticket_creation_rule_with_http_info + def create_security_findings_automation_ticket_creation_rule(body, opts = {}) + data, _status_code, _headers = create_security_findings_automation_ticket_creation_rule_with_http_info(body, opts) + data + end + + # Create a ticket creation rule. + # + # Create a new ticket creation rule for the current organization. + # + # @param body [TicketCreationRuleCreateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(TicketCreationRuleResponse, Integer, Hash)>] TicketCreationRuleResponse data, response status code and response headers + def create_security_findings_automation_ticket_creation_rule_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_security_findings_automation_ticket_creation_rule".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_security_findings_automation_ticket_creation_rule") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_security_findings_automation_ticket_creation_rule")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.create_security_findings_automation_ticket_creation_rule ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.create_security_findings_automation_ticket_creation_rule" + end + # resource path + local_var_path = '/api/v2/security/findings/automation/ticket_creation_rules' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'TicketCreationRuleResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :create_security_findings_automation_ticket_creation_rule, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#create_security_findings_automation_ticket_creation_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create a critical asset. # # @see #create_security_monitoring_critical_asset_with_http_info @@ -2819,32 +3038,38 @@ def delete_security_filter_with_http_info(security_filter_id, opts = {}) return data, status_code, headers end - # Delete a critical asset. + # Delete a due date rule. # - # @see #delete_security_monitoring_critical_asset_with_http_info - def delete_security_monitoring_critical_asset(critical_asset_id, opts = {}) - delete_security_monitoring_critical_asset_with_http_info(critical_asset_id, opts) + # @see #delete_security_findings_automation_due_date_rule_with_http_info + def delete_security_findings_automation_due_date_rule(rule_id, opts = {}) + delete_security_findings_automation_due_date_rule_with_http_info(rule_id, opts) nil end - # Delete a critical asset. + # Delete a due date rule. # - # Delete a specific critical asset. + # Delete an existing due date rule by ID. # - # @param critical_asset_id [String] The ID of the critical asset. + # @param rule_id [UUID] The ID of the due date rule. # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_security_monitoring_critical_asset_with_http_info(critical_asset_id, opts = {}) + def delete_security_findings_automation_due_date_rule_with_http_info(rule_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_security_findings_automation_due_date_rule".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_security_findings_automation_due_date_rule") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_security_findings_automation_due_date_rule")) + end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.delete_security_monitoring_critical_asset ...' + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.delete_security_findings_automation_due_date_rule ...' end - # verify the required parameter 'critical_asset_id' is set - if @api_client.config.client_side_validation && critical_asset_id.nil? - fail ArgumentError, "Missing the required parameter 'critical_asset_id' when calling SecurityMonitoringAPI.delete_security_monitoring_critical_asset" + # verify the required parameter 'rule_id' is set + if @api_client.config.client_side_validation && rule_id.nil? + fail ArgumentError, "Missing the required parameter 'rule_id' when calling SecurityMonitoringAPI.delete_security_findings_automation_due_date_rule" end # resource path - local_var_path = '/api/v2/security_monitoring/configuration/critical_assets/{critical_asset_id}'.sub('{critical_asset_id}', CGI.escape(critical_asset_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/security/findings/automation/due_date_rules/{rule_id}'.sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -2864,10 +3089,10 @@ def delete_security_monitoring_critical_asset_with_http_info(critical_asset_id, 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 => :delete_security_monitoring_critical_asset, + :operation => :delete_security_findings_automation_due_date_rule, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2879,44 +3104,43 @@ def delete_security_monitoring_critical_asset_with_http_info(critical_asset_id, data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: SecurityMonitoringAPI#delete_security_monitoring_critical_asset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#delete_security_findings_automation_due_date_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Delete a dataset. + # Delete a mute rule. # - # @see #delete_security_monitoring_dataset_with_http_info - def delete_security_monitoring_dataset(dataset_id, opts = {}) - delete_security_monitoring_dataset_with_http_info(dataset_id, opts) + # @see #delete_security_findings_automation_mute_rule_with_http_info + def delete_security_findings_automation_mute_rule(rule_id, opts = {}) + delete_security_findings_automation_mute_rule_with_http_info(rule_id, opts) nil end - # Delete a dataset. + # Delete a mute rule. # - # Delete a Cloud SIEM dataset. Out-of-the-box datasets cannot be deleted and - # deleting a dataset that is referenced by a detection rule is rejected. + # Delete an existing mute rule by ID. # - # @param dataset_id [String] The UUID of the dataset. + # @param rule_id [UUID] The ID of the mute rule. # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_security_monitoring_dataset_with_http_info(dataset_id, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.delete_security_monitoring_dataset".to_sym] + def delete_security_findings_automation_mute_rule_with_http_info(rule_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_security_findings_automation_mute_rule".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_security_monitoring_dataset") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_security_findings_automation_mute_rule") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_security_monitoring_dataset")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_security_findings_automation_mute_rule")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.delete_security_monitoring_dataset ...' + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.delete_security_findings_automation_mute_rule ...' end - # verify the required parameter 'dataset_id' is set - if @api_client.config.client_side_validation && dataset_id.nil? - fail ArgumentError, "Missing the required parameter 'dataset_id' when calling SecurityMonitoringAPI.delete_security_monitoring_dataset" + # verify the required parameter 'rule_id' is set + if @api_client.config.client_side_validation && rule_id.nil? + fail ArgumentError, "Missing the required parameter 'rule_id' when calling SecurityMonitoringAPI.delete_security_findings_automation_mute_rule" end # resource path - local_var_path = '/api/v2/security_monitoring/datasets/{dataset_id}'.sub('{dataset_id}', CGI.escape(dataset_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/security/findings/automation/mute_rules/{rule_id}'.sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -2936,10 +3160,10 @@ def delete_security_monitoring_dataset_with_http_info(dataset_id, 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 => :delete_security_monitoring_dataset, + :operation => :delete_security_findings_automation_mute_rule, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2951,44 +3175,43 @@ def delete_security_monitoring_dataset_with_http_info(dataset_id, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: SecurityMonitoringAPI#delete_security_monitoring_dataset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#delete_security_findings_automation_mute_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Delete an entity context sync configuration. + # Delete a ticket creation rule. # - # @see #delete_security_monitoring_integration_config_with_http_info - def delete_security_monitoring_integration_config(integration_config_id, opts = {}) - delete_security_monitoring_integration_config_with_http_info(integration_config_id, opts) + # @see #delete_security_findings_automation_ticket_creation_rule_with_http_info + def delete_security_findings_automation_ticket_creation_rule(rule_id, opts = {}) + delete_security_findings_automation_ticket_creation_rule_with_http_info(rule_id, opts) nil end - # Delete an entity context sync configuration. + # Delete a ticket creation rule. # - # Delete an entity context sync configuration. Cloud SIEM stops ingesting entities from this source, - # and the credentials stored for the configuration are removed from the secrets store. + # Delete an existing ticket creation rule by ID. # - # @param integration_config_id [String] The ID of the entity context sync configuration. + # @param rule_id [UUID] The ID of the ticket creation rule. # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_security_monitoring_integration_config_with_http_info(integration_config_id, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.delete_security_monitoring_integration_config".to_sym] + def delete_security_findings_automation_ticket_creation_rule_with_http_info(rule_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_security_findings_automation_ticket_creation_rule".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_security_monitoring_integration_config") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_security_findings_automation_ticket_creation_rule") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_security_monitoring_integration_config")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_security_findings_automation_ticket_creation_rule")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.delete_security_monitoring_integration_config ...' + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.delete_security_findings_automation_ticket_creation_rule ...' end - # verify the required parameter 'integration_config_id' is set - if @api_client.config.client_side_validation && integration_config_id.nil? - fail ArgumentError, "Missing the required parameter 'integration_config_id' when calling SecurityMonitoringAPI.delete_security_monitoring_integration_config" + # verify the required parameter 'rule_id' is set + if @api_client.config.client_side_validation && rule_id.nil? + fail ArgumentError, "Missing the required parameter 'rule_id' when calling SecurityMonitoringAPI.delete_security_findings_automation_ticket_creation_rule" end # resource path - local_var_path = '/api/v2/security_monitoring/configuration/integration_config/{integration_config_id}'.sub('{integration_config_id}', CGI.escape(integration_config_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/security/findings/automation/ticket_creation_rules/{rule_id}'.sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -3008,10 +3231,10 @@ def delete_security_monitoring_integration_config_with_http_info(integration_con 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 => :delete_security_monitoring_integration_config, + :operation => :delete_security_findings_automation_ticket_creation_rule, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -3023,36 +3246,245 @@ def delete_security_monitoring_integration_config_with_http_info(integration_con data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: SecurityMonitoringAPI#delete_security_monitoring_integration_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#delete_security_findings_automation_ticket_creation_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Delete an existing rule. + # Delete a critical asset. # - # @see #delete_security_monitoring_rule_with_http_info - def delete_security_monitoring_rule(rule_id, opts = {}) - delete_security_monitoring_rule_with_http_info(rule_id, opts) + # @see #delete_security_monitoring_critical_asset_with_http_info + def delete_security_monitoring_critical_asset(critical_asset_id, opts = {}) + delete_security_monitoring_critical_asset_with_http_info(critical_asset_id, opts) nil end - # Delete an existing rule. + # Delete a critical asset. # - # Delete an existing rule. Default rules cannot be deleted. + # Delete a specific critical asset. # - # @param rule_id [String] The ID of the rule. + # @param critical_asset_id [String] The ID of the critical asset. # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_security_monitoring_rule_with_http_info(rule_id, opts = {}) + def delete_security_monitoring_critical_asset_with_http_info(critical_asset_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.delete_security_monitoring_rule ...' - end - # verify the required parameter 'rule_id' is set - if @api_client.config.client_side_validation && rule_id.nil? - fail ArgumentError, "Missing the required parameter 'rule_id' when calling SecurityMonitoringAPI.delete_security_monitoring_rule" + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.delete_security_monitoring_critical_asset ...' end - # resource path + # verify the required parameter 'critical_asset_id' is set + if @api_client.config.client_side_validation && critical_asset_id.nil? + fail ArgumentError, "Missing the required parameter 'critical_asset_id' when calling SecurityMonitoringAPI.delete_security_monitoring_critical_asset" + end + # resource path + local_var_path = '/api/v2/security_monitoring/configuration/critical_assets/{critical_asset_id}'.sub('{critical_asset_id}', CGI.escape(critical_asset_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :delete_security_monitoring_critical_asset, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#delete_security_monitoring_critical_asset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete a dataset. + # + # @see #delete_security_monitoring_dataset_with_http_info + def delete_security_monitoring_dataset(dataset_id, opts = {}) + delete_security_monitoring_dataset_with_http_info(dataset_id, opts) + nil + end + + # Delete a dataset. + # + # Delete a Cloud SIEM dataset. Out-of-the-box datasets cannot be deleted and + # deleting a dataset that is referenced by a detection rule is rejected. + # + # @param dataset_id [String] The UUID of the dataset. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_security_monitoring_dataset_with_http_info(dataset_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_security_monitoring_dataset".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_security_monitoring_dataset") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_security_monitoring_dataset")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.delete_security_monitoring_dataset ...' + end + # verify the required parameter 'dataset_id' is set + if @api_client.config.client_side_validation && dataset_id.nil? + fail ArgumentError, "Missing the required parameter 'dataset_id' when calling SecurityMonitoringAPI.delete_security_monitoring_dataset" + end + # resource path + local_var_path = '/api/v2/security_monitoring/datasets/{dataset_id}'.sub('{dataset_id}', CGI.escape(dataset_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :delete_security_monitoring_dataset, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#delete_security_monitoring_dataset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete an entity context sync configuration. + # + # @see #delete_security_monitoring_integration_config_with_http_info + def delete_security_monitoring_integration_config(integration_config_id, opts = {}) + delete_security_monitoring_integration_config_with_http_info(integration_config_id, opts) + nil + end + + # Delete an entity context sync configuration. + # + # Delete an entity context sync configuration. Cloud SIEM stops ingesting entities from this source, + # and the credentials stored for the configuration are removed from the secrets store. + # + # @param integration_config_id [String] The ID of the entity context sync configuration. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_security_monitoring_integration_config_with_http_info(integration_config_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_security_monitoring_integration_config".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_security_monitoring_integration_config") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_security_monitoring_integration_config")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.delete_security_monitoring_integration_config ...' + end + # verify the required parameter 'integration_config_id' is set + if @api_client.config.client_side_validation && integration_config_id.nil? + fail ArgumentError, "Missing the required parameter 'integration_config_id' when calling SecurityMonitoringAPI.delete_security_monitoring_integration_config" + end + # resource path + local_var_path = '/api/v2/security_monitoring/configuration/integration_config/{integration_config_id}'.sub('{integration_config_id}', CGI.escape(integration_config_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :delete_security_monitoring_integration_config, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#delete_security_monitoring_integration_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete an existing rule. + # + # @see #delete_security_monitoring_rule_with_http_info + def delete_security_monitoring_rule(rule_id, opts = {}) + delete_security_monitoring_rule_with_http_info(rule_id, opts) + nil + end + + # Delete an existing rule. + # + # Delete an existing rule. Default rules cannot be deleted. + # + # @param rule_id [String] The ID of the rule. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_security_monitoring_rule_with_http_info(rule_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.delete_security_monitoring_rule ...' + end + # verify the required parameter 'rule_id' is set + if @api_client.config.client_side_validation && rule_id.nil? + fail ArgumentError, "Missing the required parameter 'rule_id' when calling SecurityMonitoringAPI.delete_security_monitoring_rule" + end + # resource path local_var_path = '/api/v2/security_monitoring/rules/{rule_id}'.sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/')) # query parameters @@ -4670,32 +5102,38 @@ def get_security_filter_with_http_info(security_filter_id, opts = {}) return data, status_code, headers end - # Get a critical asset. + # Get a due date rule. # - # @see #get_security_monitoring_critical_asset_with_http_info - def get_security_monitoring_critical_asset(critical_asset_id, opts = {}) - data, _status_code, _headers = get_security_monitoring_critical_asset_with_http_info(critical_asset_id, opts) + # @see #get_security_findings_automation_due_date_rule_with_http_info + def get_security_findings_automation_due_date_rule(rule_id, opts = {}) + data, _status_code, _headers = get_security_findings_automation_due_date_rule_with_http_info(rule_id, opts) data end - # Get a critical asset. + # Get a due date rule. # - # Get the details of a specific critical asset. + # Get the details of a due date rule by ID. # - # @param critical_asset_id [String] The ID of the critical asset. + # @param rule_id [UUID] The ID of the due date rule. # @param opts [Hash] the optional parameters - # @return [Array<(SecurityMonitoringCriticalAssetResponse, Integer, Hash)>] SecurityMonitoringCriticalAssetResponse data, response status code and response headers - def get_security_monitoring_critical_asset_with_http_info(critical_asset_id, opts = {}) + # @return [Array<(DueDateRuleResponse, Integer, Hash)>] DueDateRuleResponse data, response status code and response headers + def get_security_findings_automation_due_date_rule_with_http_info(rule_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_security_findings_automation_due_date_rule".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_security_findings_automation_due_date_rule") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_security_findings_automation_due_date_rule")) + end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_security_monitoring_critical_asset ...' + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_security_findings_automation_due_date_rule ...' end - # verify the required parameter 'critical_asset_id' is set - if @api_client.config.client_side_validation && critical_asset_id.nil? - fail ArgumentError, "Missing the required parameter 'critical_asset_id' when calling SecurityMonitoringAPI.get_security_monitoring_critical_asset" + # verify the required parameter 'rule_id' is set + if @api_client.config.client_side_validation && rule_id.nil? + fail ArgumentError, "Missing the required parameter 'rule_id' when calling SecurityMonitoringAPI.get_security_findings_automation_due_date_rule" end # resource path - local_var_path = '/api/v2/security_monitoring/configuration/critical_assets/{critical_asset_id}'.sub('{critical_asset_id}', CGI.escape(critical_asset_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/security/findings/automation/due_date_rules/{rule_id}'.sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -4712,13 +5150,13 @@ def get_security_monitoring_critical_asset_with_http_info(critical_asset_id, opt post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'SecurityMonitoringCriticalAssetResponse' + return_type = opts[:debug_return_type] || 'DueDateRuleResponse' # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :get_security_monitoring_critical_asset, + :operation => :get_security_findings_automation_due_date_rule, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -4730,40 +5168,247 @@ def get_security_monitoring_critical_asset_with_http_info(critical_asset_id, opt data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: SecurityMonitoringAPI#get_security_monitoring_critical_asset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#get_security_findings_automation_due_date_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get a dataset. + # Get a mute rule. # - # @see #get_security_monitoring_dataset_with_http_info - def get_security_monitoring_dataset(dataset_id, opts = {}) - data, _status_code, _headers = get_security_monitoring_dataset_with_http_info(dataset_id, opts) + # @see #get_security_findings_automation_mute_rule_with_http_info + def get_security_findings_automation_mute_rule(rule_id, opts = {}) + data, _status_code, _headers = get_security_findings_automation_mute_rule_with_http_info(rule_id, opts) data end - # Get a dataset. + # Get a mute rule. # - # Get the current version of a Cloud SIEM dataset by ID. + # Get the details of a mute rule by ID. # - # @param dataset_id [String] The UUID of the dataset. + # @param rule_id [UUID] The ID of the mute rule. # @param opts [Hash] the optional parameters - # @return [Array<(SecurityMonitoringDatasetResponse, Integer, Hash)>] SecurityMonitoringDatasetResponse data, response status code and response headers - def get_security_monitoring_dataset_with_http_info(dataset_id, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.get_security_monitoring_dataset".to_sym] + # @return [Array<(MuteRuleResponse, Integer, Hash)>] MuteRuleResponse data, response status code and response headers + def get_security_findings_automation_mute_rule_with_http_info(rule_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_security_findings_automation_mute_rule".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_security_monitoring_dataset") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_security_findings_automation_mute_rule") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_security_monitoring_dataset")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_security_findings_automation_mute_rule")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_security_monitoring_dataset ...' + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_security_findings_automation_mute_rule ...' end - # verify the required parameter 'dataset_id' is set - if @api_client.config.client_side_validation && dataset_id.nil? - fail ArgumentError, "Missing the required parameter 'dataset_id' when calling SecurityMonitoringAPI.get_security_monitoring_dataset" + # verify the required parameter 'rule_id' is set + if @api_client.config.client_side_validation && rule_id.nil? + fail ArgumentError, "Missing the required parameter 'rule_id' when calling SecurityMonitoringAPI.get_security_findings_automation_mute_rule" + end + # resource path + local_var_path = '/api/v2/security/findings/automation/mute_rules/{rule_id}'.sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'MuteRuleResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_security_findings_automation_mute_rule, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#get_security_findings_automation_mute_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get a ticket creation rule. + # + # @see #get_security_findings_automation_ticket_creation_rule_with_http_info + def get_security_findings_automation_ticket_creation_rule(rule_id, opts = {}) + data, _status_code, _headers = get_security_findings_automation_ticket_creation_rule_with_http_info(rule_id, opts) + data + end + + # Get a ticket creation rule. + # + # Get the details of a ticket creation rule by ID. + # + # @param rule_id [UUID] The ID of the ticket creation rule. + # @param opts [Hash] the optional parameters + # @return [Array<(TicketCreationRuleResponse, Integer, Hash)>] TicketCreationRuleResponse data, response status code and response headers + def get_security_findings_automation_ticket_creation_rule_with_http_info(rule_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_security_findings_automation_ticket_creation_rule".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_security_findings_automation_ticket_creation_rule") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_security_findings_automation_ticket_creation_rule")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_security_findings_automation_ticket_creation_rule ...' + end + # verify the required parameter 'rule_id' is set + if @api_client.config.client_side_validation && rule_id.nil? + fail ArgumentError, "Missing the required parameter 'rule_id' when calling SecurityMonitoringAPI.get_security_findings_automation_ticket_creation_rule" + end + # resource path + local_var_path = '/api/v2/security/findings/automation/ticket_creation_rules/{rule_id}'.sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'TicketCreationRuleResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_security_findings_automation_ticket_creation_rule, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#get_security_findings_automation_ticket_creation_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get a critical asset. + # + # @see #get_security_monitoring_critical_asset_with_http_info + def get_security_monitoring_critical_asset(critical_asset_id, opts = {}) + data, _status_code, _headers = get_security_monitoring_critical_asset_with_http_info(critical_asset_id, opts) + data + end + + # Get a critical asset. + # + # Get the details of a specific critical asset. + # + # @param critical_asset_id [String] The ID of the critical asset. + # @param opts [Hash] the optional parameters + # @return [Array<(SecurityMonitoringCriticalAssetResponse, Integer, Hash)>] SecurityMonitoringCriticalAssetResponse data, response status code and response headers + def get_security_monitoring_critical_asset_with_http_info(critical_asset_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_security_monitoring_critical_asset ...' + end + # verify the required parameter 'critical_asset_id' is set + if @api_client.config.client_side_validation && critical_asset_id.nil? + fail ArgumentError, "Missing the required parameter 'critical_asset_id' when calling SecurityMonitoringAPI.get_security_monitoring_critical_asset" + end + # resource path + local_var_path = '/api/v2/security_monitoring/configuration/critical_assets/{critical_asset_id}'.sub('{critical_asset_id}', CGI.escape(critical_asset_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] || 'SecurityMonitoringCriticalAssetResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_security_monitoring_critical_asset, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#get_security_monitoring_critical_asset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get a dataset. + # + # @see #get_security_monitoring_dataset_with_http_info + def get_security_monitoring_dataset(dataset_id, opts = {}) + data, _status_code, _headers = get_security_monitoring_dataset_with_http_info(dataset_id, opts) + data + end + + # Get a dataset. + # + # Get the current version of a Cloud SIEM dataset by ID. + # + # @param dataset_id [String] The UUID of the dataset. + # @param opts [Hash] the optional parameters + # @return [Array<(SecurityMonitoringDatasetResponse, Integer, Hash)>] SecurityMonitoringDatasetResponse data, response status code and response headers + def get_security_monitoring_dataset_with_http_info(dataset_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_security_monitoring_dataset".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_security_monitoring_dataset") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_security_monitoring_dataset")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.get_security_monitoring_dataset ...' + end + # verify the required parameter 'dataset_id' is set + if @api_client.config.client_side_validation && dataset_id.nil? + fail ArgumentError, "Missing the required parameter 'dataset_id' when calling SecurityMonitoringAPI.get_security_monitoring_dataset" end # resource path local_var_path = '/api/v2/security_monitoring/datasets/{dataset_id}'.sub('{dataset_id}', CGI.escape(dataset_id.to_s).gsub('%2F', '/')) @@ -7297,30 +7942,49 @@ def list_security_findings_with_pagination(opts = {}) end end - # Get all critical assets. + # Get all due date rules. # - # @see #list_security_monitoring_critical_assets_with_http_info - def list_security_monitoring_critical_assets(opts = {}) - data, _status_code, _headers = list_security_monitoring_critical_assets_with_http_info(opts) + # @see #list_security_findings_automation_due_date_rules_with_http_info + def list_security_findings_automation_due_date_rules(opts = {}) + data, _status_code, _headers = list_security_findings_automation_due_date_rules_with_http_info(opts) data end - # Get all critical assets. + # Get all due date rules. # - # Get the list of all critical assets. + # Get all due date rules for the current organization. # # @param opts [Hash] the optional parameters - # @return [Array<(SecurityMonitoringCriticalAssetsResponse, Integer, Hash)>] SecurityMonitoringCriticalAssetsResponse data, response status code and response headers - def list_security_monitoring_critical_assets_with_http_info(opts = {}) + # @option opts [Integer] :page_size The number of rules per page. Maximum is 1000. + # @option opts [Integer] :page_number The page number to return. + # @return [Array<(DueDateRulesResponse, Integer, Hash)>] DueDateRulesResponse data, response status code and response headers + def list_security_findings_automation_due_date_rules_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_security_findings_automation_due_date_rules".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_security_findings_automation_due_date_rules") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_security_findings_automation_due_date_rules")) + end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_security_monitoring_critical_assets ...' + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_security_findings_automation_due_date_rules ...' + end + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling SecurityMonitoringAPI.list_security_findings_automation_due_date_rules, must be smaller than or equal to 1000.' + end + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling SecurityMonitoringAPI.list_security_findings_automation_due_date_rules, must be greater than or equal to 1.' + end + if @api_client.config.client_side_validation && !opts[:'page_number'].nil? && opts[:'page_number'] < 0 + fail ArgumentError, 'invalid value for "opts[:"page_number"]" when calling SecurityMonitoringAPI.list_security_findings_automation_due_date_rules, must be greater than or equal to 0.' end # resource path - local_var_path = '/api/v2/security_monitoring/configuration/critical_assets' + local_var_path = '/api/v2/security/findings/automation/due_date_rules' # query parameters query_params = opts[:query_params] || {} + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? # header parameters header_params = opts[:header_params] || {} @@ -7334,13 +7998,13 @@ def list_security_monitoring_critical_assets_with_http_info(opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'SecurityMonitoringCriticalAssetsResponse' + return_type = opts[:debug_return_type] || 'DueDateRulesResponse' # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :list_security_monitoring_critical_assets, + :operation => :list_security_findings_automation_due_date_rules, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -7352,50 +8016,54 @@ def list_security_monitoring_critical_assets_with_http_info(opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: SecurityMonitoringAPI#list_security_monitoring_critical_assets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#list_security_findings_automation_due_date_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # List datasets. + # Get all mute rules. # - # @see #list_security_monitoring_datasets_with_http_info - def list_security_monitoring_datasets(opts = {}) - data, _status_code, _headers = list_security_monitoring_datasets_with_http_info(opts) + # @see #list_security_findings_automation_mute_rules_with_http_info + def list_security_findings_automation_mute_rules(opts = {}) + data, _status_code, _headers = list_security_findings_automation_mute_rules_with_http_info(opts) data end - # List datasets. + # Get all mute rules. # - # List all Cloud SIEM datasets available to the organization, including both - # customer-defined datasets and Datadog out-of-the-box datasets. + # Get all mute rules for the current organization. # # @param opts [Hash] the optional parameters - # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. - # @option opts [Integer] :page_number Specific page number to return. - # @option opts [String] :sort Attribute used to sort datasets. Prefix with `-` to sort in descending order. - # @option opts [String] :filter_query A search query to filter datasets by name or description. - # @return [Array<(SecurityMonitoringDatasetsListResponse, Integer, Hash)>] SecurityMonitoringDatasetsListResponse data, response status code and response headers - def list_security_monitoring_datasets_with_http_info(opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.list_security_monitoring_datasets".to_sym] + # @option opts [Integer] :page_size The number of rules per page. Maximum is 1000. + # @option opts [Integer] :page_number The page number to return. + # @return [Array<(MuteRulesResponse, Integer, Hash)>] MuteRulesResponse data, response status code and response headers + def list_security_findings_automation_mute_rules_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_security_findings_automation_mute_rules".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_security_monitoring_datasets") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_security_findings_automation_mute_rules") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_security_monitoring_datasets")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_security_findings_automation_mute_rules")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_security_monitoring_datasets ...' + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_security_findings_automation_mute_rules ...' + end + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling SecurityMonitoringAPI.list_security_findings_automation_mute_rules, must be smaller than or equal to 1000.' + end + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling SecurityMonitoringAPI.list_security_findings_automation_mute_rules, must be greater than or equal to 1.' + end + if @api_client.config.client_side_validation && !opts[:'page_number'].nil? && opts[:'page_number'] < 0 + fail ArgumentError, 'invalid value for "opts[:"page_number"]" when calling SecurityMonitoringAPI.list_security_findings_automation_mute_rules, must be greater than or equal to 0.' end # resource path - local_var_path = '/api/v2/security_monitoring/datasets' + local_var_path = '/api/v2/security/findings/automation/mute_rules' # query parameters query_params = opts[:query_params] || {} query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? - query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? - query_params[:'filter[query]'] = opts[:'filter_query'] if !opts[:'filter_query'].nil? # header parameters header_params = opts[:header_params] || {} @@ -7409,13 +8077,13 @@ def list_security_monitoring_datasets_with_http_info(opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'SecurityMonitoringDatasetsListResponse' + return_type = opts[:debug_return_type] || 'MuteRulesResponse' # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :list_security_monitoring_datasets, + :operation => :list_security_findings_automation_mute_rules, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -7427,44 +8095,258 @@ def list_security_monitoring_datasets_with_http_info(opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: SecurityMonitoringAPI#list_security_monitoring_datasets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#list_security_findings_automation_mute_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # List hist signals. + # Get all ticket creation rules. # - # @see #list_security_monitoring_histsignals_with_http_info - def list_security_monitoring_histsignals(opts = {}) - data, _status_code, _headers = list_security_monitoring_histsignals_with_http_info(opts) + # @see #list_security_findings_automation_ticket_creation_rules_with_http_info + def list_security_findings_automation_ticket_creation_rules(opts = {}) + data, _status_code, _headers = list_security_findings_automation_ticket_creation_rules_with_http_info(opts) data end - # List hist signals. + # Get all ticket creation rules. # - # List hist signals. + # Get all ticket creation rules for the current organization. # # @param opts [Hash] the optional parameters - # @option opts [String] :filter_query The search query for security signals. - # @option opts [Time] :filter_from The minimum timestamp for requested security signals. - # @option opts [Time] :filter_to The maximum timestamp for requested security signals. - # @option opts [SecurityMonitoringSignalsSort] :sort The order of the security signals in results. - # @option opts [String] :page_cursor A list of results using the cursor provided in the previous query. - # @option opts [Integer] :page_limit The maximum number of security signals in the response. - # @return [Array<(SecurityMonitoringSignalsListResponse, Integer, Hash)>] SecurityMonitoringSignalsListResponse data, response status code and response headers - def list_security_monitoring_histsignals_with_http_info(opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.list_security_monitoring_histsignals".to_sym] + # @option opts [Integer] :page_size The number of rules per page. Maximum is 1000. + # @option opts [Integer] :page_number The page number to return. + # @return [Array<(TicketCreationRulesResponse, Integer, Hash)>] TicketCreationRulesResponse data, response status code and response headers + def list_security_findings_automation_ticket_creation_rules_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_security_findings_automation_ticket_creation_rules".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_security_monitoring_histsignals") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_security_findings_automation_ticket_creation_rules") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_security_monitoring_histsignals")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_security_findings_automation_ticket_creation_rules")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_security_monitoring_histsignals ...' + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_security_findings_automation_ticket_creation_rules ...' end - allowable_values = ['timestamp', '-timestamp'] - if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling SecurityMonitoringAPI.list_security_findings_automation_ticket_creation_rules, must be smaller than or equal to 1000.' + end + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling SecurityMonitoringAPI.list_security_findings_automation_ticket_creation_rules, must be greater than or equal to 1.' + end + if @api_client.config.client_side_validation && !opts[:'page_number'].nil? && opts[:'page_number'] < 0 + fail ArgumentError, 'invalid value for "opts[:"page_number"]" when calling SecurityMonitoringAPI.list_security_findings_automation_ticket_creation_rules, must be greater than or equal to 0.' + end + # resource path + local_var_path = '/api/v2/security/findings/automation/ticket_creation_rules' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? + + # 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] || 'TicketCreationRulesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_security_findings_automation_ticket_creation_rules, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#list_security_findings_automation_ticket_creation_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get all critical assets. + # + # @see #list_security_monitoring_critical_assets_with_http_info + def list_security_monitoring_critical_assets(opts = {}) + data, _status_code, _headers = list_security_monitoring_critical_assets_with_http_info(opts) + data + end + + # Get all critical assets. + # + # Get the list of all critical assets. + # + # @param opts [Hash] the optional parameters + # @return [Array<(SecurityMonitoringCriticalAssetsResponse, Integer, Hash)>] SecurityMonitoringCriticalAssetsResponse data, response status code and response headers + def list_security_monitoring_critical_assets_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_security_monitoring_critical_assets ...' + end + # resource path + local_var_path = '/api/v2/security_monitoring/configuration/critical_assets' + + # 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] || 'SecurityMonitoringCriticalAssetsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_security_monitoring_critical_assets, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#list_security_monitoring_critical_assets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List datasets. + # + # @see #list_security_monitoring_datasets_with_http_info + def list_security_monitoring_datasets(opts = {}) + data, _status_code, _headers = list_security_monitoring_datasets_with_http_info(opts) + data + end + + # List datasets. + # + # List all Cloud SIEM datasets available to the organization, including both + # customer-defined datasets and Datadog out-of-the-box datasets. + # + # @param opts [Hash] the optional parameters + # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. + # @option opts [Integer] :page_number Specific page number to return. + # @option opts [String] :sort Attribute used to sort datasets. Prefix with `-` to sort in descending order. + # @option opts [String] :filter_query A search query to filter datasets by name or description. + # @return [Array<(SecurityMonitoringDatasetsListResponse, Integer, Hash)>] SecurityMonitoringDatasetsListResponse data, response status code and response headers + def list_security_monitoring_datasets_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_security_monitoring_datasets".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_security_monitoring_datasets") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_security_monitoring_datasets")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_security_monitoring_datasets ...' + end + # resource path + local_var_path = '/api/v2/security_monitoring/datasets' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + query_params[:'filter[query]'] = opts[:'filter_query'] if !opts[:'filter_query'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'SecurityMonitoringDatasetsListResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_security_monitoring_datasets, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#list_security_monitoring_datasets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List hist signals. + # + # @see #list_security_monitoring_histsignals_with_http_info + def list_security_monitoring_histsignals(opts = {}) + data, _status_code, _headers = list_security_monitoring_histsignals_with_http_info(opts) + data + end + + # List hist signals. + # + # List hist signals. + # + # @param opts [Hash] the optional parameters + # @option opts [String] :filter_query The search query for security signals. + # @option opts [Time] :filter_from The minimum timestamp for requested security signals. + # @option opts [Time] :filter_to The maximum timestamp for requested security signals. + # @option opts [SecurityMonitoringSignalsSort] :sort The order of the security signals in results. + # @option opts [String] :page_cursor A list of results using the cursor provided in the previous query. + # @option opts [Integer] :page_limit The maximum number of security signals in the response. + # @return [Array<(SecurityMonitoringSignalsListResponse, Integer, Hash)>] SecurityMonitoringSignalsListResponse data, response status code and response headers + def list_security_monitoring_histsignals_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_security_monitoring_histsignals".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_security_monitoring_histsignals") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_security_monitoring_histsignals")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_security_monitoring_histsignals ...' + end + allowable_values = ['timestamp', '-timestamp'] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end if @api_client.config.client_side_validation && !opts[:'page_limit'].nil? && opts[:'page_limit'] > 1000 @@ -8532,45 +9414,38 @@ def patch_vulnerability_notification_rule_with_http_info(id, body, opts = {}) return data, status_code, headers end - # Restore a rule to a historical version. + # Reorder due date rules. # - # @see #restore_security_monitoring_rule_with_http_info - def restore_security_monitoring_rule(rule_id, version, opts = {}) - data, _status_code, _headers = restore_security_monitoring_rule_with_http_info(rule_id, version, opts) + # @see #reorder_security_findings_automation_due_date_rules_with_http_info + def reorder_security_findings_automation_due_date_rules(body, opts = {}) + data, _status_code, _headers = reorder_security_findings_automation_due_date_rules_with_http_info(body, opts) data end - # Restore a rule to a historical version. + # Reorder due date rules. # - # Restores a custom detection rule to a previously saved historical version. - # Only custom rules can be restored. Default and partner rules return 400. - # The restore creates a new version entry; it does not overwrite history. + # Reorder the list of due date rules for the current organization. # - # @param rule_id [String] The ID of the rule. - # @param version [Integer] The historical version number of the rule. + # @param body [DueDateRuleReorderRequest] # @param opts [Hash] the optional parameters - # @return [Array<(SecurityMonitoringRuleResponse, Integer, Hash)>] SecurityMonitoringRuleResponse data, response status code and response headers - def restore_security_monitoring_rule_with_http_info(rule_id, version, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.restore_security_monitoring_rule".to_sym] + # @return [Array<(DueDateRuleReorderRequest, Integer, Hash)>] DueDateRuleReorderRequest data, response status code and response headers + def reorder_security_findings_automation_due_date_rules_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.reorder_security_findings_automation_due_date_rules".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.restore_security_monitoring_rule") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.reorder_security_findings_automation_due_date_rules") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.restore_security_monitoring_rule")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.reorder_security_findings_automation_due_date_rules")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.restore_security_monitoring_rule ...' - end - # verify the required parameter 'rule_id' is set - if @api_client.config.client_side_validation && rule_id.nil? - fail ArgumentError, "Missing the required parameter 'rule_id' when calling SecurityMonitoringAPI.restore_security_monitoring_rule" + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.reorder_security_findings_automation_due_date_rules ...' end - # verify the required parameter 'version' is set - if @api_client.config.client_side_validation && version.nil? - fail ArgumentError, "Missing the required parameter 'version' when calling SecurityMonitoringAPI.restore_security_monitoring_rule" + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.reorder_security_findings_automation_due_date_rules" end # resource path - local_var_path = '/api/v2/security_monitoring/rules/{rule_id}/restore/{version}'.sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/')).sub('{version}', CGI.escape(version.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/security/findings/automation/due_date_rules/reorder' # query parameters query_params = opts[:query_params] || {} @@ -8579,21 +9454,23 @@ def restore_security_monitoring_rule_with_http_info(rule_id, version, opts = {}) 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] + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type - return_type = opts[:debug_return_type] || 'SecurityMonitoringRuleResponse' + return_type = opts[:debug_return_type] || 'DueDateRuleReorderRequest' # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :restore_security_monitoring_rule, + :operation => :reorder_security_findings_automation_due_date_rules, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -8605,30 +9482,254 @@ def restore_security_monitoring_rule_with_http_info(rule_id, version, 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: SecurityMonitoringAPI#restore_security_monitoring_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#reorder_security_findings_automation_due_date_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Run a historical job. + # Reorder mute rules. # - # @see #run_historical_job_with_http_info - def run_historical_job(body, opts = {}) - data, _status_code, _headers = run_historical_job_with_http_info(body, opts) + # @see #reorder_security_findings_automation_mute_rules_with_http_info + def reorder_security_findings_automation_mute_rules(body, opts = {}) + data, _status_code, _headers = reorder_security_findings_automation_mute_rules_with_http_info(body, opts) data end - # Run a historical job. + # Reorder mute rules. # - # Run a historical job. + # Reorder the list of mute rules for the current organization. # - # @param body [RunHistoricalJobRequest] + # @param body [MuteRuleReorderRequest] # @param opts [Hash] the optional parameters - # @return [Array<(JobCreateResponse, Integer, Hash)>] JobCreateResponse data, response status code and response headers - def run_historical_job_with_http_info(body, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.run_historical_job".to_sym] + # @return [Array<(MuteRuleReorderRequest, Integer, Hash)>] MuteRuleReorderRequest data, response status code and response headers + def reorder_security_findings_automation_mute_rules_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.reorder_security_findings_automation_mute_rules".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.run_historical_job") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.reorder_security_findings_automation_mute_rules") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.reorder_security_findings_automation_mute_rules")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.reorder_security_findings_automation_mute_rules ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.reorder_security_findings_automation_mute_rules" + end + # resource path + local_var_path = '/api/v2/security/findings/automation/mute_rules/reorder' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'MuteRuleReorderRequest' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :reorder_security_findings_automation_mute_rules, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#reorder_security_findings_automation_mute_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Reorder ticket creation rules. + # + # @see #reorder_security_findings_automation_ticket_creation_rules_with_http_info + def reorder_security_findings_automation_ticket_creation_rules(body, opts = {}) + data, _status_code, _headers = reorder_security_findings_automation_ticket_creation_rules_with_http_info(body, opts) + data + end + + # Reorder ticket creation rules. + # + # Reorder the list of ticket creation rules for the current organization. + # + # @param body [TicketCreationRuleReorderRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(TicketCreationRuleReorderRequest, Integer, Hash)>] TicketCreationRuleReorderRequest data, response status code and response headers + def reorder_security_findings_automation_ticket_creation_rules_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.reorder_security_findings_automation_ticket_creation_rules".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.reorder_security_findings_automation_ticket_creation_rules") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.reorder_security_findings_automation_ticket_creation_rules")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.reorder_security_findings_automation_ticket_creation_rules ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.reorder_security_findings_automation_ticket_creation_rules" + end + # resource path + local_var_path = '/api/v2/security/findings/automation/ticket_creation_rules/reorder' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'TicketCreationRuleReorderRequest' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :reorder_security_findings_automation_ticket_creation_rules, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#reorder_security_findings_automation_ticket_creation_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Restore a rule to a historical version. + # + # @see #restore_security_monitoring_rule_with_http_info + def restore_security_monitoring_rule(rule_id, version, opts = {}) + data, _status_code, _headers = restore_security_monitoring_rule_with_http_info(rule_id, version, opts) + data + end + + # Restore a rule to a historical version. + # + # Restores a custom detection rule to a previously saved historical version. + # Only custom rules can be restored. Default and partner rules return 400. + # The restore creates a new version entry; it does not overwrite history. + # + # @param rule_id [String] The ID of the rule. + # @param version [Integer] The historical version number of the rule. + # @param opts [Hash] the optional parameters + # @return [Array<(SecurityMonitoringRuleResponse, Integer, Hash)>] SecurityMonitoringRuleResponse data, response status code and response headers + def restore_security_monitoring_rule_with_http_info(rule_id, version, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.restore_security_monitoring_rule".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.restore_security_monitoring_rule") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.restore_security_monitoring_rule")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.restore_security_monitoring_rule ...' + end + # verify the required parameter 'rule_id' is set + if @api_client.config.client_side_validation && rule_id.nil? + fail ArgumentError, "Missing the required parameter 'rule_id' when calling SecurityMonitoringAPI.restore_security_monitoring_rule" + end + # verify the required parameter 'version' is set + if @api_client.config.client_side_validation && version.nil? + fail ArgumentError, "Missing the required parameter 'version' when calling SecurityMonitoringAPI.restore_security_monitoring_rule" + end + # resource path + local_var_path = '/api/v2/security_monitoring/rules/{rule_id}/restore/{version}'.sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/')).sub('{version}', CGI.escape(version.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'SecurityMonitoringRuleResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :restore_security_monitoring_rule, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#restore_security_monitoring_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Run a historical job. + # + # @see #run_historical_job_with_http_info + def run_historical_job(body, opts = {}) + data, _status_code, _headers = run_historical_job_with_http_info(body, opts) + data + end + + # Run a historical job. + # + # Run a historical job. + # + # @param body [RunHistoricalJobRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(JobCreateResponse, Integer, Hash)>] JobCreateResponse data, response status code and response headers + def run_historical_job_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.run_historical_job".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.run_historical_job") else raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.run_historical_job")) end @@ -9429,6 +10530,240 @@ def update_security_filter_with_http_info(security_filter_id, body, opts = {}) return data, status_code, headers end + # Update a due date rule. + # + # @see #update_security_findings_automation_due_date_rule_with_http_info + def update_security_findings_automation_due_date_rule(rule_id, body, opts = {}) + data, _status_code, _headers = update_security_findings_automation_due_date_rule_with_http_info(rule_id, body, opts) + data + end + + # Update a due date rule. + # + # Update an existing due date rule by ID. + # + # @param rule_id [UUID] The ID of the due date rule. + # @param body [DueDateRuleUpdateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(DueDateRuleResponse, Integer, Hash)>] DueDateRuleResponse data, response status code and response headers + def update_security_findings_automation_due_date_rule_with_http_info(rule_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_security_findings_automation_due_date_rule".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_security_findings_automation_due_date_rule") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_security_findings_automation_due_date_rule")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.update_security_findings_automation_due_date_rule ...' + end + # verify the required parameter 'rule_id' is set + if @api_client.config.client_side_validation && rule_id.nil? + fail ArgumentError, "Missing the required parameter 'rule_id' when calling SecurityMonitoringAPI.update_security_findings_automation_due_date_rule" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.update_security_findings_automation_due_date_rule" + end + # resource path + local_var_path = '/api/v2/security/findings/automation/due_date_rules/{rule_id}'.sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'DueDateRuleResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_security_findings_automation_due_date_rule, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#update_security_findings_automation_due_date_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update a mute rule. + # + # @see #update_security_findings_automation_mute_rule_with_http_info + def update_security_findings_automation_mute_rule(rule_id, body, opts = {}) + data, _status_code, _headers = update_security_findings_automation_mute_rule_with_http_info(rule_id, body, opts) + data + end + + # Update a mute rule. + # + # Update an existing mute rule by ID. + # + # @param rule_id [UUID] The ID of the mute rule. + # @param body [MuteRuleUpdateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(MuteRuleResponse, Integer, Hash)>] MuteRuleResponse data, response status code and response headers + def update_security_findings_automation_mute_rule_with_http_info(rule_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_security_findings_automation_mute_rule".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_security_findings_automation_mute_rule") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_security_findings_automation_mute_rule")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.update_security_findings_automation_mute_rule ...' + end + # verify the required parameter 'rule_id' is set + if @api_client.config.client_side_validation && rule_id.nil? + fail ArgumentError, "Missing the required parameter 'rule_id' when calling SecurityMonitoringAPI.update_security_findings_automation_mute_rule" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.update_security_findings_automation_mute_rule" + end + # resource path + local_var_path = '/api/v2/security/findings/automation/mute_rules/{rule_id}'.sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'MuteRuleResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_security_findings_automation_mute_rule, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#update_security_findings_automation_mute_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update a ticket creation rule. + # + # @see #update_security_findings_automation_ticket_creation_rule_with_http_info + def update_security_findings_automation_ticket_creation_rule(rule_id, body, opts = {}) + data, _status_code, _headers = update_security_findings_automation_ticket_creation_rule_with_http_info(rule_id, body, opts) + data + end + + # Update a ticket creation rule. + # + # Update an existing ticket creation rule by ID. + # + # @param rule_id [UUID] The ID of the ticket creation rule. + # @param body [TicketCreationRuleUpdateRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(TicketCreationRuleResponse, Integer, Hash)>] TicketCreationRuleResponse data, response status code and response headers + def update_security_findings_automation_ticket_creation_rule_with_http_info(rule_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_security_findings_automation_ticket_creation_rule".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_security_findings_automation_ticket_creation_rule") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_security_findings_automation_ticket_creation_rule")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.update_security_findings_automation_ticket_creation_rule ...' + end + # verify the required parameter 'rule_id' is set + if @api_client.config.client_side_validation && rule_id.nil? + fail ArgumentError, "Missing the required parameter 'rule_id' when calling SecurityMonitoringAPI.update_security_findings_automation_ticket_creation_rule" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SecurityMonitoringAPI.update_security_findings_automation_ticket_creation_rule" + end + # resource path + local_var_path = '/api/v2/security/findings/automation/ticket_creation_rules/{rule_id}'.sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'TicketCreationRuleResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_security_findings_automation_ticket_creation_rule, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SecurityMonitoringAPI#update_security_findings_automation_ticket_creation_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Update a critical asset. # # @see #update_security_monitoring_critical_asset_with_http_info diff --git a/lib/datadog_api_client/v2/models/automation_rule_actor_type.rb b/lib/datadog_api_client/v2/models/automation_rule_actor_type.rb new file mode 100644 index 000000000000..62f2926f9897 --- /dev/null +++ b/lib/datadog_api_client/v2/models/automation_rule_actor_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 + # Whether the actor is a user or the Datadog system. + class AutomationRuleActorType + include BaseEnumModel + + USER = "user".freeze + SYSTEM = "system".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/automation_rule_created_by.rb b/lib/datadog_api_client/v2/models/automation_rule_created_by.rb new file mode 100644 index 000000000000..7d5a126d166d --- /dev/null +++ b/lib/datadog_api_client/v2/models/automation_rule_created_by.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 user or Datadog system who created the rule. + class AutomationRuleCreatedBy + include BaseGenericModel + + # The actor's identifier (a user UUID or a system identifier). + attr_reader :id + + # The name of the actor. + attr_reader :name + + # Whether the actor is a user or the Datadog system. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'name' => :'name', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'name' => :'String', + :'type' => :'AutomationRuleActorType' + } + 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::AutomationRuleCreatedBy` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @name.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param 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 type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + name == o.name && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, name, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/automation_rule_modified_by.rb b/lib/datadog_api_client/v2/models/automation_rule_modified_by.rb new file mode 100644 index 000000000000..7c28a11baf54 --- /dev/null +++ b/lib/datadog_api_client/v2/models/automation_rule_modified_by.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 user or Datadog system who last modified the rule. + class AutomationRuleModifiedBy + include BaseGenericModel + + # The actor's identifier (a user UUID or a system identifier). + attr_reader :id + + # The name of the actor. + attr_reader :name + + # Whether the actor is a user or the Datadog system. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'name' => :'name', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'String', + :'name' => :'String', + :'type' => :'AutomationRuleActorType' + } + 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::AutomationRuleModifiedBy` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @name.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param 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 type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + name == o.name && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, name, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/automation_rule_scope.rb b/lib/datadog_api_client/v2/models/automation_rule_scope.rb new file mode 100644 index 000000000000..153474873ba4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/automation_rule_scope.rb @@ -0,0 +1,150 @@ +=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 + # Defines the scope of findings to which the automation rule applies. + class AutomationRuleScope + include BaseGenericModel + + # The list of security finding types that the automation rule applies to. + attr_reader :finding_types + + # A search query to further filter the findings matched by this rule. The `@workflow.*` namespace and `@status` fields are not permitted. For a reference of available fields, see the [Security Findings schema documentation](https://docs.datadoghq.com/security/guide/findings-schema/). + attr_reader :query + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'finding_types' => :'finding_types', + :'query' => :'query' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'finding_types' => :'Array', + :'query' => :'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::AutomationRuleScope` 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?(:'finding_types') + if (value = attributes[:'finding_types']).is_a?(Array) + self.finding_types = value + end + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + 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 @finding_types.nil? + return false if @finding_types.length < 1 + return false if !@query.nil? && @query.to_s.length > 30000 + true + end + + # Custom attribute writer method with validation + # @param finding_types [Object] Object to be assigned + # @!visibility private + def finding_types=(finding_types) + if finding_types.nil? + fail ArgumentError, 'invalid value for "finding_types", finding_types cannot be nil.' + end + if finding_types.length < 1 + fail ArgumentError, 'invalid value for "finding_types", number of items must be greater than or equal to 1.' + end + @finding_types = finding_types + end + + # Custom attribute writer method with validation + # @param query [Object] Object to be assigned + # @!visibility private + def query=(query) + if !query.nil? && query.to_s.length > 30000 + fail ArgumentError, 'invalid value for "query", the character length must be smaller than or equal to 30000.' + end + @query = query + 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 && + finding_types == o.finding_types && + query == o.query && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [finding_types, query, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/due_date_from.rb b/lib/datadog_api_client/v2/models/due_date_from.rb new file mode 100644 index 000000000000..74f673355986 --- /dev/null +++ b/lib/datadog_api_client/v2/models/due_date_from.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 reference point from which the due date is calculated. When `fix_available` is selected but not applicable to the finding type, `first_seen` is used instead. + class DueDateFrom + include BaseEnumModel + + FIRST_SEEN = "first_seen".freeze + FIX_AVAILABLE = "fix_available".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/due_date_per_severity_item.rb b/lib/datadog_api_client/v2/models/due_date_per_severity_item.rb new file mode 100644 index 000000000000..920936739aa8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/due_date_per_severity_item.rb @@ -0,0 +1,152 @@ +=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 mapping of a severity level to the number of days until a finding is due. + class DueDatePerSeverityItem + include BaseGenericModel + + # The number of days from the reference point until the finding is due. + attr_reader :due_in_days + + # A severity level used to configure due date thresholds. + attr_reader :severity + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'due_in_days' => :'due_in_days', + :'severity' => :'severity' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'due_in_days' => :'Integer', + :'severity' => :'DueDateSeverity' + } + 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::DueDatePerSeverityItem` 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?(:'due_in_days') + self.due_in_days = attributes[:'due_in_days'] + end + + if attributes.key?(:'severity') + self.severity = attributes[:'severity'] + 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 @due_in_days.nil? + return false if @due_in_days > 365 + return false if @due_in_days < 1 + return false if @severity.nil? + true + end + + # Custom attribute writer method with validation + # @param due_in_days [Object] Object to be assigned + # @!visibility private + def due_in_days=(due_in_days) + if due_in_days.nil? + fail ArgumentError, 'invalid value for "due_in_days", due_in_days cannot be nil.' + end + if due_in_days > 365 + fail ArgumentError, 'invalid value for "due_in_days", must be smaller than or equal to 365.' + end + if due_in_days < 1 + fail ArgumentError, 'invalid value for "due_in_days", must be greater than or equal to 1.' + end + @due_in_days = due_in_days + 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 + + # 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 && + due_in_days == o.due_in_days && + severity == o.severity && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [due_in_days, severity, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/due_date_rule_action.rb b/lib/datadog_api_client/v2/models/due_date_rule_action.rb new file mode 100644 index 000000000000..ec21f73ed69f --- /dev/null +++ b/lib/datadog_api_client/v2/models/due_date_rule_action.rb @@ -0,0 +1,167 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The action to take when the due date rule matches a finding. + class DueDateRuleAction + include BaseGenericModel + + # A list of severity-to-due-date mappings. Each severity may appear at most once. + attr_reader :due_days_per_severity + + # The reference point from which the due date is calculated. When `fix_available` is selected but not applicable to the finding type, `first_seen` is used instead. + attr_reader :due_from + + # An optional description providing more context for the due date assignment. + attr_reader :reason_description + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'due_days_per_severity' => :'due_days_per_severity', + :'due_from' => :'due_from', + :'reason_description' => :'reason_description' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'due_days_per_severity' => :'Array', + :'due_from' => :'DueDateFrom', + :'reason_description' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DueDateRuleAction` 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?(:'due_days_per_severity') + if (value = attributes[:'due_days_per_severity']).is_a?(Array) + self.due_days_per_severity = value + end + end + + if attributes.key?(:'due_from') + self.due_from = attributes[:'due_from'] + end + + if attributes.key?(:'reason_description') + self.reason_description = attributes[:'reason_description'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @due_days_per_severity.nil? + return false if @due_from.nil? + return false if !@reason_description.nil? && @reason_description.to_s.length > 20000 + true + end + + # Custom attribute writer method with validation + # @param due_days_per_severity [Object] Object to be assigned + # @!visibility private + def due_days_per_severity=(due_days_per_severity) + if due_days_per_severity.nil? + fail ArgumentError, 'invalid value for "due_days_per_severity", due_days_per_severity cannot be nil.' + end + @due_days_per_severity = due_days_per_severity + end + + # Custom attribute writer method with validation + # @param due_from [Object] Object to be assigned + # @!visibility private + def due_from=(due_from) + if due_from.nil? + fail ArgumentError, 'invalid value for "due_from", due_from cannot be nil.' + end + @due_from = due_from + end + + # Custom attribute writer method with validation + # @param reason_description [Object] Object to be assigned + # @!visibility private + def reason_description=(reason_description) + if !reason_description.nil? && reason_description.to_s.length > 20000 + fail ArgumentError, 'invalid value for "reason_description", the character length must be smaller than or equal to 20000.' + end + @reason_description = reason_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 && + due_days_per_severity == o.due_days_per_severity && + due_from == o.due_from && + reason_description == o.reason_description && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [due_days_per_severity, due_from, reason_description, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/due_date_rule_attributes_create.rb b/lib/datadog_api_client/v2/models/due_date_rule_attributes_create.rb new file mode 100644 index 000000000000..8d1ba50d0759 --- /dev/null +++ b/lib/datadog_api_client/v2/models/due_date_rule_attributes_create.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 + # Attributes for creating or updating a due date rule. + class DueDateRuleAttributesCreate + include BaseGenericModel + + # The action to take when the due date rule matches a finding. + attr_reader :action + + # Whether the due date rule is enabled. + attr_accessor :enabled + + # The name of the due date rule. + attr_reader :name + + # Defines the scope of findings to which the automation rule applies. + attr_reader :rule + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'action' => :'action', + :'enabled' => :'enabled', + :'name' => :'name', + :'rule' => :'rule' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'action' => :'DueDateRuleAction', + :'enabled' => :'Boolean', + :'name' => :'String', + :'rule' => :'AutomationRuleScope' + } + 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::DueDateRuleAttributesCreate` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'action') + self.action = attributes[:'action'] + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'rule') + self.rule = attributes[:'rule'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @action.nil? + return false if @name.nil? + return false if @name.to_s.length > 255 + return false if @name.to_s.length < 1 + return false if @rule.nil? + true + end + + # Custom attribute writer method with validation + # @param action [Object] Object to be assigned + # @!visibility private + def action=(action) + if action.nil? + fail ArgumentError, 'invalid value for "action", action cannot be nil.' + end + @action = action + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + if name.to_s.length > 255 + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.' + end + if name.to_s.length < 1 + fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param rule [Object] Object to be assigned + # @!visibility private + def rule=(rule) + if rule.nil? + fail ArgumentError, 'invalid value for "rule", rule cannot be nil.' + end + @rule = rule + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + action == o.action && + enabled == o.enabled && + name == o.name && + rule == o.rule && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [action, enabled, name, rule, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/due_date_rule_attributes_response.rb b/lib/datadog_api_client/v2/models/due_date_rule_attributes_response.rb new file mode 100644 index 000000000000..49e3001f3cd7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/due_date_rule_attributes_response.rb @@ -0,0 +1,278 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a due date rule returned by the API. + class DueDateRuleAttributesResponse + include BaseGenericModel + + # The action to take when the due date rule matches a finding. + attr_reader :action + + # The Unix timestamp in milliseconds when the rule was created. + attr_reader :created_at + + # The user or Datadog system who created the rule. + attr_reader :created_by + + # Whether the due date rule is enabled. + attr_reader :enabled + + # The Unix timestamp in milliseconds when the rule was last modified. + attr_reader :modified_at + + # The user or Datadog system who last modified the rule. + attr_reader :modified_by + + # The name of the due date rule. + attr_reader :name + + # Defines the scope of findings to which the automation rule applies. + attr_reader :rule + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'action' => :'action', + :'created_at' => :'created_at', + :'created_by' => :'created_by', + :'enabled' => :'enabled', + :'modified_at' => :'modified_at', + :'modified_by' => :'modified_by', + :'name' => :'name', + :'rule' => :'rule' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'action' => :'DueDateRuleAction', + :'created_at' => :'Integer', + :'created_by' => :'AutomationRuleCreatedBy', + :'enabled' => :'Boolean', + :'modified_at' => :'Integer', + :'modified_by' => :'AutomationRuleModifiedBy', + :'name' => :'String', + :'rule' => :'AutomationRuleScope' + } + 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::DueDateRuleAttributesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'action') + self.action = attributes[:'action'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'created_by') + self.created_by = attributes[:'created_by'] + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'modified_by') + self.modified_by = attributes[:'modified_by'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'rule') + self.rule = attributes[:'rule'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @action.nil? + return false if @created_at.nil? + return false if @created_by.nil? + return false if @enabled.nil? + return false if @modified_at.nil? + return false if @modified_by.nil? + return false if @name.nil? + return false if @name.to_s.length > 255 + return false if @name.to_s.length < 1 + return false if @rule.nil? + true + end + + # Custom attribute writer method with validation + # @param action [Object] Object to be assigned + # @!visibility private + def action=(action) + if action.nil? + fail ArgumentError, 'invalid value for "action", action cannot be nil.' + end + @action = action + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param created_by [Object] Object to be assigned + # @!visibility private + def created_by=(created_by) + if created_by.nil? + fail ArgumentError, 'invalid value for "created_by", created_by cannot be nil.' + end + @created_by = created_by + end + + # Custom attribute writer method with validation + # @param enabled [Object] Object to be assigned + # @!visibility private + def enabled=(enabled) + if enabled.nil? + fail ArgumentError, 'invalid value for "enabled", enabled cannot be nil.' + end + @enabled = enabled + end + + # Custom attribute writer method with validation + # @param modified_at [Object] Object to be assigned + # @!visibility private + def modified_at=(modified_at) + if modified_at.nil? + fail ArgumentError, 'invalid value for "modified_at", modified_at cannot be nil.' + end + @modified_at = modified_at + end + + # Custom attribute writer method with validation + # @param modified_by [Object] Object to be assigned + # @!visibility private + def modified_by=(modified_by) + if modified_by.nil? + fail ArgumentError, 'invalid value for "modified_by", modified_by cannot be nil.' + end + @modified_by = modified_by + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + if name.to_s.length > 255 + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.' + end + if name.to_s.length < 1 + fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param rule [Object] Object to be assigned + # @!visibility private + def rule=(rule) + if rule.nil? + fail ArgumentError, 'invalid value for "rule", rule cannot be nil.' + end + @rule = rule + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + action == o.action && + created_at == o.created_at && + created_by == o.created_by && + enabled == o.enabled && + modified_at == o.modified_at && + modified_by == o.modified_by && + name == o.name && + rule == o.rule && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [action, created_at, created_by, enabled, modified_at, modified_by, name, rule, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/due_date_rule_create_request.rb b/lib/datadog_api_client/v2/models/due_date_rule_create_request.rb new file mode 100644 index 000000000000..cec96f54cdf7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/due_date_rule_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 + # The body of a due date rule create request. + class DueDateRuleCreateRequest + include BaseGenericModel + + # The data object for a due date rule create or update 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' => :'DueDateRuleDataCreate' + } + 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::DueDateRuleCreateRequest` 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/due_date_rule_data_create.rb b/lib/datadog_api_client/v2/models/due_date_rule_data_create.rb new file mode 100644 index 000000000000..70c55691906a --- /dev/null +++ b/lib/datadog_api_client/v2/models/due_date_rule_data_create.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 data object for a due date rule create or update request. + class DueDateRuleDataCreate + include BaseGenericModel + + # Attributes for creating or updating a due date rule. + attr_reader :attributes + + # The JSON:API type for due date rules. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'DueDateRuleAttributesCreate', + :'type' => :'DueDateRuleType' + } + 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::DueDateRuleDataCreate` 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/due_date_rule_data_response.rb b/lib/datadog_api_client/v2/models/due_date_rule_data_response.rb new file mode 100644 index 000000000000..6d44b53795ed --- /dev/null +++ b/lib/datadog_api_client/v2/models/due_date_rule_data_response.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The data object for a due date rule returned by the API. + class DueDateRuleDataResponse + include BaseGenericModel + + # Attributes of a due date rule returned by the API. + attr_reader :attributes + + # The ID of the due date rule. + attr_reader :id + + # The JSON:API type for due date rules. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'DueDateRuleAttributesResponse', + :'id' => :'UUID', + :'type' => :'DueDateRuleType' + } + 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::DueDateRuleDataResponse` 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/due_date_rule_reorder_item.rb b/lib/datadog_api_client/v2/models/due_date_rule_reorder_item.rb new file mode 100644 index 000000000000..f0388bc444e5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/due_date_rule_reorder_item.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 reference to a due date rule used for reordering. + class DueDateRuleReorderItem + include BaseGenericModel + + # The ID of the automation rule. + attr_reader :id + + # The JSON:API type for due date rules. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'UUID', + :'type' => :'DueDateRuleType' + } + 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::DueDateRuleReorderItem` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/due_date_rule_reorder_request.rb b/lib/datadog_api_client/v2/models/due_date_rule_reorder_request.rb new file mode 100644 index 000000000000..74efc5147fc3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/due_date_rule_reorder_request.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 body of the due date rule reorder request. + class DueDateRuleReorderRequest + include BaseGenericModel + + # The ordered list of all due date rules; every rule must be included. + 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::DueDateRuleReorderRequest` 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/due_date_rule_response.rb b/lib/datadog_api_client/v2/models/due_date_rule_response.rb new file mode 100644 index 000000000000..8935dde7d876 --- /dev/null +++ b/lib/datadog_api_client/v2/models/due_date_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 + # A single due date rule response. + class DueDateRuleResponse + include BaseGenericModel + + # The data object for a due date rule returned by the API. + 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' => :'DueDateRuleDataResponse' + } + 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::DueDateRuleResponse` 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/due_date_rule_type.rb b/lib/datadog_api_client/v2/models/due_date_rule_type.rb new file mode 100644 index 000000000000..71de750d27a5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/due_date_rule_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 JSON:API type for due date rules. + class DueDateRuleType + include BaseEnumModel + + DUE_DATE_RULES = "due_date_rules".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/due_date_rule_update_request.rb b/lib/datadog_api_client/v2/models/due_date_rule_update_request.rb new file mode 100644 index 000000000000..4a2c6dccde06 --- /dev/null +++ b/lib/datadog_api_client/v2/models/due_date_rule_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 + # The body of a due date rule update request. + class DueDateRuleUpdateRequest + include BaseGenericModel + + # The data object for a due date rule create or update 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' => :'DueDateRuleDataCreate' + } + 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::DueDateRuleUpdateRequest` 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/due_date_rules_response.rb b/lib/datadog_api_client/v2/models/due_date_rules_response.rb new file mode 100644 index 000000000000..1602de4e20a5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/due_date_rules_response.rb @@ -0,0 +1,167 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A list of due date rules with pagination metadata. + class DueDateRulesResponse + include BaseGenericModel + + # A list of due date rule data objects. + attr_reader :data + + # Pagination links for the list of automation rules. + attr_reader :links + + # Metadata for the list of automation rules. + attr_reader :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'links' => :'links', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'links' => :'SecurityAutomationRulesLinks', + :'meta' => :'SecurityAutomationRulesMeta' + } + 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::DueDateRulesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'links') + self.links = attributes[:'links'] + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + return false if @links.nil? + return false if @meta.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Custom attribute writer method with validation + # @param links [Object] Object to be assigned + # @!visibility private + def links=(links) + if links.nil? + fail ArgumentError, 'invalid value for "links", links cannot be nil.' + end + @links = links + end + + # Custom attribute writer method with validation + # @param meta [Object] Object to be assigned + # @!visibility private + def meta=(meta) + if meta.nil? + fail ArgumentError, 'invalid value for "meta", meta cannot be nil.' + end + @meta = meta + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + links == o.links && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, links, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/due_date_severity.rb b/lib/datadog_api_client/v2/models/due_date_severity.rb new file mode 100644 index 000000000000..7c41dcf65c7b --- /dev/null +++ b/lib/datadog_api_client/v2/models/due_date_severity.rb @@ -0,0 +1,32 @@ +=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 severity level used to configure due date thresholds. + class DueDateSeverity + include BaseEnumModel + + CRITICAL = "critical".freeze + HIGH = "high".freeze + MEDIUM = "medium".freeze + LOW = "low".freeze + INFO = "info".freeze + NONE = "none".freeze + UNKNOWN = "unknown".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/mute_reason.rb b/lib/datadog_api_client/v2/models/mute_reason.rb new file mode 100644 index 000000000000..1dae32b5083b --- /dev/null +++ b/lib/datadog_api_client/v2/models/mute_reason.rb @@ -0,0 +1,31 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The reason for muting a security finding. + class MuteReason + include BaseEnumModel + + DUPLICATE = "duplicate".freeze + FALSE_POSITIVE = "false_positive".freeze + NO_FIX = "no_fix".freeze + OTHER = "other".freeze + PENDING_FIX = "pending_fix".freeze + RISK_ACCEPTED = "risk_accepted".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/mute_rule_action.rb b/lib/datadog_api_client/v2/models/mute_rule_action.rb new file mode 100644 index 000000000000..310105ff1f27 --- /dev/null +++ b/lib/datadog_api_client/v2/models/mute_rule_action.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 action to take when the mute rule matches a finding. + class MuteRuleAction + include BaseGenericModel + + # The Unix timestamp in milliseconds at which the mute expires. If omitted, the mute does not expire. + attr_accessor :expire_at + + # The reason for muting a security finding. + attr_reader :reason + + # An optional description providing more context for the mute reason. + attr_reader :reason_description + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'expire_at' => :'expire_at', + :'reason' => :'reason', + :'reason_description' => :'reason_description' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'expire_at' => :'Integer', + :'reason' => :'MuteReason', + :'reason_description' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MuteRuleAction` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'expire_at') + self.expire_at = attributes[:'expire_at'] + end + + if attributes.key?(:'reason') + self.reason = attributes[:'reason'] + end + + if attributes.key?(:'reason_description') + self.reason_description = attributes[:'reason_description'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @reason.nil? + return false if !@reason_description.nil? && @reason_description.to_s.length > 20000 + true + end + + # Custom attribute writer method with validation + # @param reason [Object] Object to be assigned + # @!visibility private + def reason=(reason) + if reason.nil? + fail ArgumentError, 'invalid value for "reason", reason cannot be nil.' + end + @reason = reason + end + + # Custom attribute writer method with validation + # @param reason_description [Object] Object to be assigned + # @!visibility private + def reason_description=(reason_description) + if !reason_description.nil? && reason_description.to_s.length > 20000 + fail ArgumentError, 'invalid value for "reason_description", the character length must be smaller than or equal to 20000.' + end + @reason_description = reason_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 && + expire_at == o.expire_at && + reason == o.reason && + reason_description == o.reason_description && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [expire_at, reason, reason_description, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/mute_rule_attributes_create.rb b/lib/datadog_api_client/v2/models/mute_rule_attributes_create.rb new file mode 100644 index 000000000000..b6fb38af22b0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/mute_rule_attributes_create.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 + # Attributes for creating or updating a mute rule. + class MuteRuleAttributesCreate + include BaseGenericModel + + # The action to take when the mute rule matches a finding. + attr_reader :action + + # Whether the mute rule is enabled. + attr_accessor :enabled + + # The name of the mute rule. + attr_reader :name + + # Defines the scope of findings to which the automation rule applies. + attr_reader :rule + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'action' => :'action', + :'enabled' => :'enabled', + :'name' => :'name', + :'rule' => :'rule' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'action' => :'MuteRuleAction', + :'enabled' => :'Boolean', + :'name' => :'String', + :'rule' => :'AutomationRuleScope' + } + 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::MuteRuleAttributesCreate` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'action') + self.action = attributes[:'action'] + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'rule') + self.rule = attributes[:'rule'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @action.nil? + return false if @name.nil? + return false if @name.to_s.length > 255 + return false if @name.to_s.length < 1 + return false if @rule.nil? + true + end + + # Custom attribute writer method with validation + # @param action [Object] Object to be assigned + # @!visibility private + def action=(action) + if action.nil? + fail ArgumentError, 'invalid value for "action", action cannot be nil.' + end + @action = action + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + if name.to_s.length > 255 + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.' + end + if name.to_s.length < 1 + fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param rule [Object] Object to be assigned + # @!visibility private + def rule=(rule) + if rule.nil? + fail ArgumentError, 'invalid value for "rule", rule cannot be nil.' + end + @rule = rule + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + action == o.action && + enabled == o.enabled && + name == o.name && + rule == o.rule && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [action, enabled, name, rule, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/mute_rule_attributes_response.rb b/lib/datadog_api_client/v2/models/mute_rule_attributes_response.rb new file mode 100644 index 000000000000..680d8a681443 --- /dev/null +++ b/lib/datadog_api_client/v2/models/mute_rule_attributes_response.rb @@ -0,0 +1,278 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a mute rule returned by the API. + class MuteRuleAttributesResponse + include BaseGenericModel + + # The action to take when the mute rule matches a finding. + attr_reader :action + + # The Unix timestamp in milliseconds when the rule was created. + attr_reader :created_at + + # The user or Datadog system who created the rule. + attr_reader :created_by + + # Whether the mute rule is enabled. + attr_reader :enabled + + # The Unix timestamp in milliseconds when the rule was last modified. + attr_reader :modified_at + + # The user or Datadog system who last modified the rule. + attr_reader :modified_by + + # The name of the mute rule. + attr_reader :name + + # Defines the scope of findings to which the automation rule applies. + attr_reader :rule + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'action' => :'action', + :'created_at' => :'created_at', + :'created_by' => :'created_by', + :'enabled' => :'enabled', + :'modified_at' => :'modified_at', + :'modified_by' => :'modified_by', + :'name' => :'name', + :'rule' => :'rule' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'action' => :'MuteRuleAction', + :'created_at' => :'Integer', + :'created_by' => :'AutomationRuleCreatedBy', + :'enabled' => :'Boolean', + :'modified_at' => :'Integer', + :'modified_by' => :'AutomationRuleModifiedBy', + :'name' => :'String', + :'rule' => :'AutomationRuleScope' + } + 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::MuteRuleAttributesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'action') + self.action = attributes[:'action'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'created_by') + self.created_by = attributes[:'created_by'] + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'modified_by') + self.modified_by = attributes[:'modified_by'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'rule') + self.rule = attributes[:'rule'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @action.nil? + return false if @created_at.nil? + return false if @created_by.nil? + return false if @enabled.nil? + return false if @modified_at.nil? + return false if @modified_by.nil? + return false if @name.nil? + return false if @name.to_s.length > 255 + return false if @name.to_s.length < 1 + return false if @rule.nil? + true + end + + # Custom attribute writer method with validation + # @param action [Object] Object to be assigned + # @!visibility private + def action=(action) + if action.nil? + fail ArgumentError, 'invalid value for "action", action cannot be nil.' + end + @action = action + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param created_by [Object] Object to be assigned + # @!visibility private + def created_by=(created_by) + if created_by.nil? + fail ArgumentError, 'invalid value for "created_by", created_by cannot be nil.' + end + @created_by = created_by + end + + # Custom attribute writer method with validation + # @param enabled [Object] Object to be assigned + # @!visibility private + def enabled=(enabled) + if enabled.nil? + fail ArgumentError, 'invalid value for "enabled", enabled cannot be nil.' + end + @enabled = enabled + end + + # Custom attribute writer method with validation + # @param modified_at [Object] Object to be assigned + # @!visibility private + def modified_at=(modified_at) + if modified_at.nil? + fail ArgumentError, 'invalid value for "modified_at", modified_at cannot be nil.' + end + @modified_at = modified_at + end + + # Custom attribute writer method with validation + # @param modified_by [Object] Object to be assigned + # @!visibility private + def modified_by=(modified_by) + if modified_by.nil? + fail ArgumentError, 'invalid value for "modified_by", modified_by cannot be nil.' + end + @modified_by = modified_by + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + if name.to_s.length > 255 + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.' + end + if name.to_s.length < 1 + fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param rule [Object] Object to be assigned + # @!visibility private + def rule=(rule) + if rule.nil? + fail ArgumentError, 'invalid value for "rule", rule cannot be nil.' + end + @rule = rule + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + action == o.action && + created_at == o.created_at && + created_by == o.created_by && + enabled == o.enabled && + modified_at == o.modified_at && + modified_by == o.modified_by && + name == o.name && + rule == o.rule && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [action, created_at, created_by, enabled, modified_at, modified_by, name, rule, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/mute_rule_create_request.rb b/lib/datadog_api_client/v2/models/mute_rule_create_request.rb new file mode 100644 index 000000000000..6e564df42c8b --- /dev/null +++ b/lib/datadog_api_client/v2/models/mute_rule_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 + # The body of a mute rule create request. + class MuteRuleCreateRequest + include BaseGenericModel + + # The data object for a mute rule create or update 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' => :'MuteRuleDataCreate' + } + 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::MuteRuleCreateRequest` 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/mute_rule_data_create.rb b/lib/datadog_api_client/v2/models/mute_rule_data_create.rb new file mode 100644 index 000000000000..e2155d86ca11 --- /dev/null +++ b/lib/datadog_api_client/v2/models/mute_rule_data_create.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 data object for a mute rule create or update request. + class MuteRuleDataCreate + include BaseGenericModel + + # Attributes for creating or updating a mute rule. + attr_reader :attributes + + # The JSON:API type for mute rules. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'MuteRuleAttributesCreate', + :'type' => :'MuteRuleType' + } + 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::MuteRuleDataCreate` 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/mute_rule_data_response.rb b/lib/datadog_api_client/v2/models/mute_rule_data_response.rb new file mode 100644 index 000000000000..666099f22658 --- /dev/null +++ b/lib/datadog_api_client/v2/models/mute_rule_data_response.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The data object for a mute rule returned by the API. + class MuteRuleDataResponse + include BaseGenericModel + + # Attributes of a mute rule returned by the API. + attr_reader :attributes + + # The ID of the mute rule. + attr_reader :id + + # The JSON:API type for mute rules. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'MuteRuleAttributesResponse', + :'id' => :'UUID', + :'type' => :'MuteRuleType' + } + 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::MuteRuleDataResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/mute_rule_reorder_item.rb b/lib/datadog_api_client/v2/models/mute_rule_reorder_item.rb new file mode 100644 index 000000000000..077a0abb14b2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/mute_rule_reorder_item.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 reference to a mute rule used for reordering. + class MuteRuleReorderItem + include BaseGenericModel + + # The ID of the automation rule. + attr_reader :id + + # The JSON:API type for mute rules. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'UUID', + :'type' => :'MuteRuleType' + } + 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::MuteRuleReorderItem` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/mute_rule_reorder_request.rb b/lib/datadog_api_client/v2/models/mute_rule_reorder_request.rb new file mode 100644 index 000000000000..40d8c4bb667f --- /dev/null +++ b/lib/datadog_api_client/v2/models/mute_rule_reorder_request.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 body of the mute rule reorder request. + class MuteRuleReorderRequest + include BaseGenericModel + + # The ordered list of all mute rules; every rule must be included. + 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::MuteRuleReorderRequest` 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/mute_rule_response.rb b/lib/datadog_api_client/v2/models/mute_rule_response.rb new file mode 100644 index 000000000000..a268d10e71bc --- /dev/null +++ b/lib/datadog_api_client/v2/models/mute_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 + # A single mute rule response. + class MuteRuleResponse + include BaseGenericModel + + # The data object for a mute rule returned by the API. + 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' => :'MuteRuleDataResponse' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::MuteRuleResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # 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/mute_rule_type.rb b/lib/datadog_api_client/v2/models/mute_rule_type.rb new file mode 100644 index 000000000000..035986f8a70e --- /dev/null +++ b/lib/datadog_api_client/v2/models/mute_rule_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 JSON:API type for mute rules. + class MuteRuleType + include BaseEnumModel + + MUTE_RULES = "mute_rules".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/mute_rule_update_request.rb b/lib/datadog_api_client/v2/models/mute_rule_update_request.rb new file mode 100644 index 000000000000..1e01fe66a125 --- /dev/null +++ b/lib/datadog_api_client/v2/models/mute_rule_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 + # The body of a mute rule update request. + class MuteRuleUpdateRequest + include BaseGenericModel + + # The data object for a mute rule create or update 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' => :'MuteRuleDataCreate' + } + 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::MuteRuleUpdateRequest` 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/mute_rules_response.rb b/lib/datadog_api_client/v2/models/mute_rules_response.rb new file mode 100644 index 000000000000..bc3fbaeefb1d --- /dev/null +++ b/lib/datadog_api_client/v2/models/mute_rules_response.rb @@ -0,0 +1,167 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A list of mute rules with pagination metadata. + class MuteRulesResponse + include BaseGenericModel + + # A list of mute rule data objects. + attr_reader :data + + # Pagination links for the list of automation rules. + attr_reader :links + + # Metadata for the list of automation rules. + attr_reader :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'links' => :'links', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'links' => :'SecurityAutomationRulesLinks', + :'meta' => :'SecurityAutomationRulesMeta' + } + 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::MuteRulesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'links') + self.links = attributes[:'links'] + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + return false if @links.nil? + return false if @meta.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Custom attribute writer method with validation + # @param links [Object] Object to be assigned + # @!visibility private + def links=(links) + if links.nil? + fail ArgumentError, 'invalid value for "links", links cannot be nil.' + end + @links = links + end + + # Custom attribute writer method with validation + # @param meta [Object] Object to be assigned + # @!visibility private + def meta=(meta) + if meta.nil? + fail ArgumentError, 'invalid value for "meta", meta cannot be nil.' + end + @meta = meta + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + links == o.links && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, links, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/rum_application_attributes.rb b/lib/datadog_api_client/v2/models/rum_application_attributes.rb index b5084282caea..2a51a03d6234 100644 --- a/lib/datadog_api_client/v2/models/rum_application_attributes.rb +++ b/lib/datadog_api_client/v2/models/rum_application_attributes.rb @@ -51,6 +51,9 @@ class RUMApplicationAttributes # Product Scales configuration for the RUM application. attr_accessor :product_scales + # ID of the RUM SDK remote configuration for the application, if one exists. + attr_accessor :remote_config_id + # Type of the RUM application. Supported values are `browser`, `ios`, `android`, `react-native`, `flutter`, `roku`, `electron`, `unity`, `kotlin-multiplatform`. attr_reader :type @@ -76,6 +79,7 @@ def self.attribute_map :'name' => :'name', :'org_id' => :'org_id', :'product_scales' => :'product_scales', + :'remote_config_id' => :'remote_config_id', :'type' => :'type', :'updated_at' => :'updated_at', :'updated_by_handle' => :'updated_by_handle' @@ -96,6 +100,7 @@ def self.openapi_types :'name' => :'String', :'org_id' => :'Integer', :'product_scales' => :'RUMProductScales', + :'remote_config_id' => :'String', :'type' => :'String', :'updated_at' => :'Integer', :'updated_by_handle' => :'String' @@ -160,6 +165,10 @@ def initialize(attributes = {}) self.product_scales = attributes[:'product_scales'] end + if attributes.key?(:'remote_config_id') + self.remote_config_id = attributes[:'remote_config_id'] + end + if attributes.key?(:'type') self.type = attributes[:'type'] end @@ -330,6 +339,7 @@ def ==(o) name == o.name && org_id == o.org_id && product_scales == o.product_scales && + remote_config_id == o.remote_config_id && type == o.type && updated_at == o.updated_at && updated_by_handle == o.updated_by_handle && @@ -340,7 +350,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [api_key_id, application_id, client_token, created_at, created_by_handle, _hash, is_active, name, org_id, product_scales, type, updated_at, updated_by_handle, additional_properties].hash + [api_key_id, application_id, client_token, created_at, created_by_handle, _hash, is_active, name, org_id, product_scales, remote_config_id, type, updated_at, updated_by_handle, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/rum_sdk_config_attributes.rb b/lib/datadog_api_client/v2/models/rum_sdk_config_attributes.rb new file mode 100644 index 000000000000..f697a9156e9b --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_sdk_config_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 + # Attributes of the RUM SDK configuration. + class RumSdkConfigAttributes + include BaseGenericModel + + # The RUM SDK settings for a configuration. + attr_reader :rum + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'rum' => :'rum' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'rum' => :'RumSdkConfigRumAttributes' + } + 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::RumSdkConfigAttributes` 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?(:'rum') + self.rum = attributes[:'rum'] + 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 @rum.nil? + true + end + + # Custom attribute writer method with validation + # @param rum [Object] Object to be assigned + # @!visibility private + def rum=(rum) + if rum.nil? + fail ArgumentError, 'invalid value for "rum", rum cannot be nil.' + end + @rum = rum + 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 && + rum == o.rum && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [rum, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/rum_sdk_config_data.rb b/lib/datadog_api_client/v2/models/rum_sdk_config_data.rb new file mode 100644 index 000000000000..208520e1fa5a --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_sdk_config_data.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 + # The RUM SDK configuration data object. + class RumSdkConfigData + include BaseGenericModel + + # Attributes of the RUM SDK configuration. + attr_reader :attributes + + # The unique identifier of the RUM SDK configuration. + attr_reader :id + + # Metadata associated with a RUM SDK configuration. + attr_accessor :meta + + # The type of the resource. The value should always be `rum_sdk_config`. + 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', + :'meta' => :'meta', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'RumSdkConfigAttributes', + :'id' => :'String', + :'meta' => :'RumSdkConfigMeta', + :'type' => :'RumSdkConfigType' + } + 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::RumSdkConfigData` 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 + + # 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 && + 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/rum_sdk_config_dynamic_option.rb b/lib/datadog_api_client/v2/models/rum_sdk_config_dynamic_option.rb new file mode 100644 index 000000000000..a4a424490a71 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_sdk_config_dynamic_option.rb @@ -0,0 +1,204 @@ +=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 dynamic configuration option that extracts a value at runtime using a specified strategy. + class RumSdkConfigDynamicOption + include BaseGenericModel + + # The element attribute to read. Used when `strategy` is `dom`. + attr_accessor :attribute + + # A serialized regex used as an extractor in dynamic options. + attr_accessor :extractor + + # The `localStorage` key to read. Required when `strategy` is `localStorage`. + attr_accessor :key + + # The cookie name to read. Required when `strategy` is `cookie`. + attr_accessor :name + + # The JavaScript path used to extract the value. Required when `strategy` is `js`. + attr_accessor :path + + # The type identifier for a dynamic option. Always `dynamic`. + attr_reader :rc_serialized_type + + # The CSS selector to read from the page. Required when `strategy` is `dom`. + attr_accessor :selector + + # The strategy used to extract the dynamic value. + attr_reader :strategy + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attribute' => :'attribute', + :'extractor' => :'extractor', + :'key' => :'key', + :'name' => :'name', + :'path' => :'path', + :'rc_serialized_type' => :'rc_serialized_type', + :'selector' => :'selector', + :'strategy' => :'strategy' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attribute' => :'String', + :'extractor' => :'RumSdkConfigSerializedRegex', + :'key' => :'String', + :'name' => :'String', + :'path' => :'String', + :'rc_serialized_type' => :'RumSdkConfigDynamicOptionSerializedType', + :'selector' => :'String', + :'strategy' => :'RumSdkConfigDynamicOptionStrategy' + } + 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::RumSdkConfigDynamicOption` 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?(:'attribute') + self.attribute = attributes[:'attribute'] + end + + if attributes.key?(:'extractor') + self.extractor = attributes[:'extractor'] + end + + if attributes.key?(:'key') + self.key = attributes[:'key'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'path') + self.path = attributes[:'path'] + end + + if attributes.key?(:'rc_serialized_type') + self.rc_serialized_type = attributes[:'rc_serialized_type'] + end + + if attributes.key?(:'selector') + self.selector = attributes[:'selector'] + end + + if attributes.key?(:'strategy') + self.strategy = attributes[:'strategy'] + 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 @rc_serialized_type.nil? + return false if @strategy.nil? + true + end + + # Custom attribute writer method with validation + # @param rc_serialized_type [Object] Object to be assigned + # @!visibility private + def rc_serialized_type=(rc_serialized_type) + if rc_serialized_type.nil? + fail ArgumentError, 'invalid value for "rc_serialized_type", rc_serialized_type cannot be nil.' + end + @rc_serialized_type = rc_serialized_type + end + + # Custom attribute writer method with validation + # @param strategy [Object] Object to be assigned + # @!visibility private + def strategy=(strategy) + if strategy.nil? + fail ArgumentError, 'invalid value for "strategy", strategy cannot be nil.' + end + @strategy = strategy + 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 && + attribute == o.attribute && + extractor == o.extractor && + key == o.key && + name == o.name && + path == o.path && + rc_serialized_type == o.rc_serialized_type && + selector == o.selector && + strategy == o.strategy && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attribute, extractor, key, name, path, rc_serialized_type, selector, strategy, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/rum_sdk_config_dynamic_option_pair.rb b/lib/datadog_api_client/v2/models/rum_sdk_config_dynamic_option_pair.rb new file mode 100644 index 000000000000..ca6c1cbf4896 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_sdk_config_dynamic_option_pair.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 key-value pair where the value is a dynamic configuration option. + class RumSdkConfigDynamicOptionPair + include BaseGenericModel + + # The key name for this dynamic configuration pair. + attr_reader :key + + # A dynamic configuration option that extracts a value at runtime using a specified strategy. + attr_reader :value + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'key' => :'key', + :'value' => :'value' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'key' => :'String', + :'value' => :'RumSdkConfigDynamicOption' + } + 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::RumSdkConfigDynamicOptionPair` 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?(:'key') + self.key = attributes[:'key'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + 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 @key.nil? + return false if @value.nil? + true + end + + # Custom attribute writer method with validation + # @param key [Object] Object to be assigned + # @!visibility private + def key=(key) + if key.nil? + fail ArgumentError, 'invalid value for "key", key cannot be nil.' + end + @key = key + end + + # Custom attribute writer method with validation + # @param value [Object] Object to be assigned + # @!visibility private + def value=(value) + if value.nil? + fail ArgumentError, 'invalid value for "value", value cannot be nil.' + end + @value = value + 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 && + key == o.key && + value == o.value && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [key, value, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/rum_sdk_config_dynamic_option_serialized_type.rb b/lib/datadog_api_client/v2/models/rum_sdk_config_dynamic_option_serialized_type.rb new file mode 100644 index 000000000000..bad52b6c3c14 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_sdk_config_dynamic_option_serialized_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 identifier for a dynamic option. Always `dynamic`. + class RumSdkConfigDynamicOptionSerializedType + include BaseEnumModel + + DYNAMIC = "dynamic".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/rum_sdk_config_dynamic_option_strategy.rb b/lib/datadog_api_client/v2/models/rum_sdk_config_dynamic_option_strategy.rb new file mode 100644 index 000000000000..86298ea28241 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_sdk_config_dynamic_option_strategy.rb @@ -0,0 +1,29 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The strategy used to extract the dynamic value. + class RumSdkConfigDynamicOptionStrategy + include BaseEnumModel + + JS = "js".freeze + COOKIE = "cookie".freeze + DOM = "dom".freeze + LOCAL_STORAGE = "localStorage".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/rum_sdk_config_match_option.rb b/lib/datadog_api_client/v2/models/rum_sdk_config_match_option.rb new file mode 100644 index 000000000000..72b911de291e --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_sdk_config_match_option.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 match option used for URL or origin pattern matching. + class RumSdkConfigMatchOption + include BaseGenericModel + + # The type of match pattern, either a literal string or a regex. + attr_reader :rc_serialized_type + + # The value to match against. + attr_reader :value + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'rc_serialized_type' => :'rc_serialized_type', + :'value' => :'value' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'rc_serialized_type' => :'RumSdkConfigMatchOptionSerializedType', + :'value' => :'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::RumSdkConfigMatchOption` 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?(:'rc_serialized_type') + self.rc_serialized_type = attributes[:'rc_serialized_type'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + 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 @rc_serialized_type.nil? + return false if @value.nil? + true + end + + # Custom attribute writer method with validation + # @param rc_serialized_type [Object] Object to be assigned + # @!visibility private + def rc_serialized_type=(rc_serialized_type) + if rc_serialized_type.nil? + fail ArgumentError, 'invalid value for "rc_serialized_type", rc_serialized_type cannot be nil.' + end + @rc_serialized_type = rc_serialized_type + end + + # Custom attribute writer method with validation + # @param value [Object] Object to be assigned + # @!visibility private + def value=(value) + if value.nil? + fail ArgumentError, 'invalid value for "value", value cannot be nil.' + end + @value = value + 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 && + rc_serialized_type == o.rc_serialized_type && + value == o.value && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [rc_serialized_type, value, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/rum_sdk_config_match_option_serialized_type.rb b/lib/datadog_api_client/v2/models/rum_sdk_config_match_option_serialized_type.rb new file mode 100644 index 000000000000..28f7a3183bc6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_sdk_config_match_option_serialized_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 match pattern, either a literal string or a regex. + class RumSdkConfigMatchOptionSerializedType + include BaseEnumModel + + STRING = "string".freeze + REGEX = "regex".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/rum_sdk_config_meta.rb b/lib/datadog_api_client/v2/models/rum_sdk_config_meta.rb new file mode 100644 index 000000000000..13cfdcf61d93 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_sdk_config_meta.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 + # Metadata associated with a RUM SDK configuration. + class RumSdkConfigMeta + include BaseGenericModel + + # The timestamp of the last update to this configuration. + attr_reader :updated_at + + # The handle of the user who last updated this configuration. + attr_reader :updated_by + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'updated_at' => :'updated_at', + :'updated_by' => :'updated_by' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'updated_at' => :'Time', + :'updated_by' => :'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::RumSdkConfigMeta` 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?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + + if attributes.key?(:'updated_by') + self.updated_by = attributes[:'updated_by'] + 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 @updated_at.nil? + return false if @updated_by.nil? + true + end + + # Custom attribute writer method with validation + # @param updated_at [Object] Object to be assigned + # @!visibility private + def updated_at=(updated_at) + if updated_at.nil? + fail ArgumentError, 'invalid value for "updated_at", updated_at cannot be nil.' + end + @updated_at = updated_at + end + + # Custom attribute writer method with validation + # @param updated_by [Object] Object to be assigned + # @!visibility private + def updated_by=(updated_by) + if updated_by.nil? + fail ArgumentError, 'invalid value for "updated_by", updated_by cannot be nil.' + end + @updated_by = updated_by + 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 && + updated_at == o.updated_at && + updated_by == o.updated_by && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [updated_at, updated_by, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/rum_sdk_config_response.rb b/lib/datadog_api_client/v2/models/rum_sdk_config_response.rb new file mode 100644 index 000000000000..bd66246449f0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_sdk_config_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 RUM SDK configuration. + class RumSdkConfigResponse + include BaseGenericModel + + # The RUM SDK configuration data object. + 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' => :'RumSdkConfigData' + } + 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::RumSdkConfigResponse` 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/rum_sdk_config_rum_attributes.rb b/lib/datadog_api_client/v2/models/rum_sdk_config_rum_attributes.rb new file mode 100644 index 000000000000..48b4745c7d04 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_sdk_config_rum_attributes.rb @@ -0,0 +1,336 @@ +=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 RUM SDK settings for a configuration. + class RumSdkConfigRumAttributes + include BaseGenericModel + + # A list of URL configurations for distributed tracing. + attr_accessor :allowed_tracing_urls + + # A list of origin patterns allowed for cross-origin session tracking. + attr_accessor :allowed_tracking_origins + + # The ID of the RUM application this configuration belongs to. + attr_reader :application_id + + # A list of dynamic option key-value pairs. + attr_accessor :context + + # The default privacy masking level applied to all RUM data. + attr_reader :default_privacy_level + + # Whether to mask user-interaction action names for privacy. + attr_reader :enable_privacy_for_action_name + + # The environment tag for the RUM application. + attr_accessor :env + + # The service name tag for the RUM application. + attr_accessor :service + + # The percentage of collected sessions for which a replay is captured (0–100). + attr_reader :session_replay_sample_rate + + # The percentage of user sessions to collect (0–100). + attr_reader :session_sample_rate + + # The percentage of requests to forward as APM traces (0–100). + attr_reader :trace_sample_rate + + # Whether to share a session across subdomains of the same site. + attr_accessor :track_session_across_subdomains + + # A list of dynamic option key-value pairs. + attr_accessor :user + + # A dynamic configuration option that extracts a value at runtime using a specified strategy. + attr_accessor :version + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'allowed_tracing_urls' => :'allowed_tracing_urls', + :'allowed_tracking_origins' => :'allowed_tracking_origins', + :'application_id' => :'application_id', + :'context' => :'context', + :'default_privacy_level' => :'default_privacy_level', + :'enable_privacy_for_action_name' => :'enable_privacy_for_action_name', + :'env' => :'env', + :'service' => :'service', + :'session_replay_sample_rate' => :'session_replay_sample_rate', + :'session_sample_rate' => :'session_sample_rate', + :'trace_sample_rate' => :'trace_sample_rate', + :'track_session_across_subdomains' => :'track_session_across_subdomains', + :'user' => :'user', + :'version' => :'version' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'allowed_tracing_urls' => :'Array', + :'allowed_tracking_origins' => :'Array', + :'application_id' => :'String', + :'context' => :'Array', + :'default_privacy_level' => :'String', + :'enable_privacy_for_action_name' => :'Boolean', + :'env' => :'String', + :'service' => :'String', + :'session_replay_sample_rate' => :'Integer', + :'session_sample_rate' => :'Integer', + :'trace_sample_rate' => :'Integer', + :'track_session_across_subdomains' => :'Boolean', + :'user' => :'Array', + :'version' => :'RumSdkConfigDynamicOption' + } + 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::RumSdkConfigRumAttributes` 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?(:'allowed_tracing_urls') + if (value = attributes[:'allowed_tracing_urls']).is_a?(Array) + self.allowed_tracing_urls = value + end + end + + if attributes.key?(:'allowed_tracking_origins') + if (value = attributes[:'allowed_tracking_origins']).is_a?(Array) + self.allowed_tracking_origins = value + end + end + + if attributes.key?(:'application_id') + self.application_id = attributes[:'application_id'] + end + + if attributes.key?(:'context') + if (value = attributes[:'context']).is_a?(Array) + self.context = value + end + end + + if attributes.key?(:'default_privacy_level') + self.default_privacy_level = attributes[:'default_privacy_level'] + end + + if attributes.key?(:'enable_privacy_for_action_name') + self.enable_privacy_for_action_name = attributes[:'enable_privacy_for_action_name'] + end + + if attributes.key?(:'env') + self.env = attributes[:'env'] + end + + if attributes.key?(:'service') + self.service = attributes[:'service'] + end + + if attributes.key?(:'session_replay_sample_rate') + self.session_replay_sample_rate = attributes[:'session_replay_sample_rate'] + end + + if attributes.key?(:'session_sample_rate') + self.session_sample_rate = attributes[:'session_sample_rate'] + end + + if attributes.key?(:'trace_sample_rate') + self.trace_sample_rate = attributes[:'trace_sample_rate'] + end + + if attributes.key?(:'track_session_across_subdomains') + self.track_session_across_subdomains = attributes[:'track_session_across_subdomains'] + end + + if attributes.key?(:'user') + if (value = attributes[:'user']).is_a?(Array) + self.user = 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 @application_id.nil? + return false if @default_privacy_level.nil? + return false if @enable_privacy_for_action_name.nil? + return false if @session_replay_sample_rate.nil? + return false if @session_replay_sample_rate > 100 + return false if @session_replay_sample_rate < 0 + return false if @session_sample_rate.nil? + return false if @session_sample_rate > 100 + return false if @session_sample_rate < 0 + return false if !@trace_sample_rate.nil? && @trace_sample_rate > 100 + return false if !@trace_sample_rate.nil? && @trace_sample_rate < 0 + true + end + + # Custom attribute writer method with validation + # @param application_id [Object] Object to be assigned + # @!visibility private + def application_id=(application_id) + if application_id.nil? + fail ArgumentError, 'invalid value for "application_id", application_id cannot be nil.' + end + @application_id = application_id + end + + # Custom attribute writer method with validation + # @param default_privacy_level [Object] Object to be assigned + # @!visibility private + def default_privacy_level=(default_privacy_level) + if default_privacy_level.nil? + fail ArgumentError, 'invalid value for "default_privacy_level", default_privacy_level cannot be nil.' + end + @default_privacy_level = default_privacy_level + end + + # Custom attribute writer method with validation + # @param enable_privacy_for_action_name [Object] Object to be assigned + # @!visibility private + def enable_privacy_for_action_name=(enable_privacy_for_action_name) + if enable_privacy_for_action_name.nil? + fail ArgumentError, 'invalid value for "enable_privacy_for_action_name", enable_privacy_for_action_name cannot be nil.' + end + @enable_privacy_for_action_name = enable_privacy_for_action_name + end + + # Custom attribute writer method with validation + # @param session_replay_sample_rate [Object] Object to be assigned + # @!visibility private + def session_replay_sample_rate=(session_replay_sample_rate) + if session_replay_sample_rate.nil? + fail ArgumentError, 'invalid value for "session_replay_sample_rate", session_replay_sample_rate cannot be nil.' + end + if session_replay_sample_rate > 100 + fail ArgumentError, 'invalid value for "session_replay_sample_rate", must be smaller than or equal to 100.' + end + if session_replay_sample_rate < 0 + fail ArgumentError, 'invalid value for "session_replay_sample_rate", must be greater than or equal to 0.' + end + @session_replay_sample_rate = session_replay_sample_rate + end + + # Custom attribute writer method with validation + # @param session_sample_rate [Object] Object to be assigned + # @!visibility private + def session_sample_rate=(session_sample_rate) + if session_sample_rate.nil? + fail ArgumentError, 'invalid value for "session_sample_rate", session_sample_rate cannot be nil.' + end + if session_sample_rate > 100 + fail ArgumentError, 'invalid value for "session_sample_rate", must be smaller than or equal to 100.' + end + if session_sample_rate < 0 + fail ArgumentError, 'invalid value for "session_sample_rate", must be greater than or equal to 0.' + end + @session_sample_rate = session_sample_rate + end + + # Custom attribute writer method with validation + # @param trace_sample_rate [Object] Object to be assigned + # @!visibility private + def trace_sample_rate=(trace_sample_rate) + if !trace_sample_rate.nil? && trace_sample_rate > 100 + fail ArgumentError, 'invalid value for "trace_sample_rate", must be smaller than or equal to 100.' + end + if !trace_sample_rate.nil? && trace_sample_rate < 0 + fail ArgumentError, 'invalid value for "trace_sample_rate", must be greater than or equal to 0.' + end + @trace_sample_rate = trace_sample_rate + 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 && + allowed_tracing_urls == o.allowed_tracing_urls && + allowed_tracking_origins == o.allowed_tracking_origins && + application_id == o.application_id && + context == o.context && + default_privacy_level == o.default_privacy_level && + enable_privacy_for_action_name == o.enable_privacy_for_action_name && + env == o.env && + service == o.service && + session_replay_sample_rate == o.session_replay_sample_rate && + session_sample_rate == o.session_sample_rate && + trace_sample_rate == o.trace_sample_rate && + track_session_across_subdomains == o.track_session_across_subdomains && + user == o.user && + version == o.version && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [allowed_tracing_urls, allowed_tracking_origins, application_id, context, default_privacy_level, enable_privacy_for_action_name, env, service, session_replay_sample_rate, session_sample_rate, trace_sample_rate, track_session_across_subdomains, user, version, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/rum_sdk_config_rum_update_attributes.rb b/lib/datadog_api_client/v2/models/rum_sdk_config_rum_update_attributes.rb new file mode 100644 index 000000000000..bf6dcf33d671 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_sdk_config_rum_update_attributes.rb @@ -0,0 +1,315 @@ +=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 RUM SDK settings to apply when updating a configuration. + class RumSdkConfigRumUpdateAttributes + include BaseGenericModel + + # A list of URL configurations for distributed tracing. + attr_accessor :allowed_tracing_urls + + # A list of origin patterns allowed for cross-origin session tracking. + attr_accessor :allowed_tracking_origins + + # A list of dynamic option key-value pairs. + attr_accessor :context + + # The default privacy masking level applied to all RUM data. + attr_reader :default_privacy_level + + # Whether to mask user-interaction action names for privacy. + attr_reader :enable_privacy_for_action_name + + # The environment tag for the RUM application. + attr_accessor :env + + # The service name tag for the RUM application. + attr_accessor :service + + # The percentage of collected sessions for which a replay is captured (0–100). + attr_reader :session_replay_sample_rate + + # The percentage of user sessions to collect (0–100). + attr_reader :session_sample_rate + + # The percentage of requests to forward as APM traces (0–100). + attr_reader :trace_sample_rate + + # Whether to share a session across subdomains of the same site. + attr_accessor :track_session_across_subdomains + + # A list of dynamic option key-value pairs. + attr_accessor :user + + # A dynamic configuration option that extracts a value at runtime using a specified strategy. + attr_accessor :version + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'allowed_tracing_urls' => :'allowed_tracing_urls', + :'allowed_tracking_origins' => :'allowed_tracking_origins', + :'context' => :'context', + :'default_privacy_level' => :'default_privacy_level', + :'enable_privacy_for_action_name' => :'enable_privacy_for_action_name', + :'env' => :'env', + :'service' => :'service', + :'session_replay_sample_rate' => :'session_replay_sample_rate', + :'session_sample_rate' => :'session_sample_rate', + :'trace_sample_rate' => :'trace_sample_rate', + :'track_session_across_subdomains' => :'track_session_across_subdomains', + :'user' => :'user', + :'version' => :'version' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'allowed_tracing_urls' => :'Array', + :'allowed_tracking_origins' => :'Array', + :'context' => :'Array', + :'default_privacy_level' => :'String', + :'enable_privacy_for_action_name' => :'Boolean', + :'env' => :'String', + :'service' => :'String', + :'session_replay_sample_rate' => :'Integer', + :'session_sample_rate' => :'Integer', + :'trace_sample_rate' => :'Integer', + :'track_session_across_subdomains' => :'Boolean', + :'user' => :'Array', + :'version' => :'RumSdkConfigDynamicOption' + } + 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::RumSdkConfigRumUpdateAttributes` 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?(:'allowed_tracing_urls') + if (value = attributes[:'allowed_tracing_urls']).is_a?(Array) + self.allowed_tracing_urls = value + end + end + + if attributes.key?(:'allowed_tracking_origins') + if (value = attributes[:'allowed_tracking_origins']).is_a?(Array) + self.allowed_tracking_origins = value + end + end + + if attributes.key?(:'context') + if (value = attributes[:'context']).is_a?(Array) + self.context = value + end + end + + if attributes.key?(:'default_privacy_level') + self.default_privacy_level = attributes[:'default_privacy_level'] + end + + if attributes.key?(:'enable_privacy_for_action_name') + self.enable_privacy_for_action_name = attributes[:'enable_privacy_for_action_name'] + end + + if attributes.key?(:'env') + self.env = attributes[:'env'] + end + + if attributes.key?(:'service') + self.service = attributes[:'service'] + end + + if attributes.key?(:'session_replay_sample_rate') + self.session_replay_sample_rate = attributes[:'session_replay_sample_rate'] + end + + if attributes.key?(:'session_sample_rate') + self.session_sample_rate = attributes[:'session_sample_rate'] + end + + if attributes.key?(:'trace_sample_rate') + self.trace_sample_rate = attributes[:'trace_sample_rate'] + end + + if attributes.key?(:'track_session_across_subdomains') + self.track_session_across_subdomains = attributes[:'track_session_across_subdomains'] + end + + if attributes.key?(:'user') + if (value = attributes[:'user']).is_a?(Array) + self.user = 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 @default_privacy_level.nil? + return false if @enable_privacy_for_action_name.nil? + return false if @session_replay_sample_rate.nil? + return false if @session_replay_sample_rate > 100 + return false if @session_replay_sample_rate < 0 + return false if @session_sample_rate.nil? + return false if @session_sample_rate > 100 + return false if @session_sample_rate < 0 + return false if !@trace_sample_rate.nil? && @trace_sample_rate > 100 + return false if !@trace_sample_rate.nil? && @trace_sample_rate < 0 + true + end + + # Custom attribute writer method with validation + # @param default_privacy_level [Object] Object to be assigned + # @!visibility private + def default_privacy_level=(default_privacy_level) + if default_privacy_level.nil? + fail ArgumentError, 'invalid value for "default_privacy_level", default_privacy_level cannot be nil.' + end + @default_privacy_level = default_privacy_level + end + + # Custom attribute writer method with validation + # @param enable_privacy_for_action_name [Object] Object to be assigned + # @!visibility private + def enable_privacy_for_action_name=(enable_privacy_for_action_name) + if enable_privacy_for_action_name.nil? + fail ArgumentError, 'invalid value for "enable_privacy_for_action_name", enable_privacy_for_action_name cannot be nil.' + end + @enable_privacy_for_action_name = enable_privacy_for_action_name + end + + # Custom attribute writer method with validation + # @param session_replay_sample_rate [Object] Object to be assigned + # @!visibility private + def session_replay_sample_rate=(session_replay_sample_rate) + if session_replay_sample_rate.nil? + fail ArgumentError, 'invalid value for "session_replay_sample_rate", session_replay_sample_rate cannot be nil.' + end + if session_replay_sample_rate > 100 + fail ArgumentError, 'invalid value for "session_replay_sample_rate", must be smaller than or equal to 100.' + end + if session_replay_sample_rate < 0 + fail ArgumentError, 'invalid value for "session_replay_sample_rate", must be greater than or equal to 0.' + end + @session_replay_sample_rate = session_replay_sample_rate + end + + # Custom attribute writer method with validation + # @param session_sample_rate [Object] Object to be assigned + # @!visibility private + def session_sample_rate=(session_sample_rate) + if session_sample_rate.nil? + fail ArgumentError, 'invalid value for "session_sample_rate", session_sample_rate cannot be nil.' + end + if session_sample_rate > 100 + fail ArgumentError, 'invalid value for "session_sample_rate", must be smaller than or equal to 100.' + end + if session_sample_rate < 0 + fail ArgumentError, 'invalid value for "session_sample_rate", must be greater than or equal to 0.' + end + @session_sample_rate = session_sample_rate + end + + # Custom attribute writer method with validation + # @param trace_sample_rate [Object] Object to be assigned + # @!visibility private + def trace_sample_rate=(trace_sample_rate) + if !trace_sample_rate.nil? && trace_sample_rate > 100 + fail ArgumentError, 'invalid value for "trace_sample_rate", must be smaller than or equal to 100.' + end + if !trace_sample_rate.nil? && trace_sample_rate < 0 + fail ArgumentError, 'invalid value for "trace_sample_rate", must be greater than or equal to 0.' + end + @trace_sample_rate = trace_sample_rate + 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 && + allowed_tracing_urls == o.allowed_tracing_urls && + allowed_tracking_origins == o.allowed_tracking_origins && + context == o.context && + default_privacy_level == o.default_privacy_level && + enable_privacy_for_action_name == o.enable_privacy_for_action_name && + env == o.env && + service == o.service && + session_replay_sample_rate == o.session_replay_sample_rate && + session_sample_rate == o.session_sample_rate && + trace_sample_rate == o.trace_sample_rate && + track_session_across_subdomains == o.track_session_across_subdomains && + user == o.user && + version == o.version && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [allowed_tracing_urls, allowed_tracking_origins, context, default_privacy_level, enable_privacy_for_action_name, env, service, session_replay_sample_rate, session_sample_rate, trace_sample_rate, track_session_across_subdomains, user, version, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/rum_sdk_config_serialized_regex.rb b/lib/datadog_api_client/v2/models/rum_sdk_config_serialized_regex.rb new file mode 100644 index 000000000000..658e261b3aec --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_sdk_config_serialized_regex.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 serialized regex used as an extractor in dynamic options. + class RumSdkConfigSerializedRegex + include BaseGenericModel + + # The type identifier for a serialized regex. Always `regex`. + attr_reader :rc_serialized_type + + # The regex pattern used for extraction. + attr_reader :value + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'rc_serialized_type' => :'rc_serialized_type', + :'value' => :'value' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'rc_serialized_type' => :'RumSdkConfigSerializedRegexType', + :'value' => :'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::RumSdkConfigSerializedRegex` 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?(:'rc_serialized_type') + self.rc_serialized_type = attributes[:'rc_serialized_type'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + 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 @rc_serialized_type.nil? + return false if @value.nil? + true + end + + # Custom attribute writer method with validation + # @param rc_serialized_type [Object] Object to be assigned + # @!visibility private + def rc_serialized_type=(rc_serialized_type) + if rc_serialized_type.nil? + fail ArgumentError, 'invalid value for "rc_serialized_type", rc_serialized_type cannot be nil.' + end + @rc_serialized_type = rc_serialized_type + end + + # Custom attribute writer method with validation + # @param value [Object] Object to be assigned + # @!visibility private + def value=(value) + if value.nil? + fail ArgumentError, 'invalid value for "value", value cannot be nil.' + end + @value = value + 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 && + rc_serialized_type == o.rc_serialized_type && + value == o.value && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [rc_serialized_type, value, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/rum_sdk_config_serialized_regex_type.rb b/lib/datadog_api_client/v2/models/rum_sdk_config_serialized_regex_type.rb new file mode 100644 index 000000000000..712366f727bf --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_sdk_config_serialized_regex_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 identifier for a serialized regex. Always `regex`. + class RumSdkConfigSerializedRegexType + include BaseEnumModel + + REGEX = "regex".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/rum_sdk_config_tracing_url_config.rb b/lib/datadog_api_client/v2/models/rum_sdk_config_tracing_url_config.rb new file mode 100644 index 000000000000..bfb7b6338367 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_sdk_config_tracing_url_config.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 + # Configuration for a URL that should have distributed tracing enabled. + class RumSdkConfigTracingUrlConfig + include BaseGenericModel + + # A match option used for URL or origin pattern matching. + attr_reader :match + + # The list of trace propagator types to use for this URL. + attr_reader :propagator_types + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'match' => :'match', + :'propagator_types' => :'propagator_types' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'match' => :'RumSdkConfigMatchOption', + :'propagator_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::RumSdkConfigTracingUrlConfig` 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?(:'match') + self.match = attributes[:'match'] + end + + if attributes.key?(:'propagator_types') + if (value = attributes[:'propagator_types']).is_a?(Array) + self.propagator_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 @match.nil? + return false if @propagator_types.nil? + true + end + + # Custom attribute writer method with validation + # @param match [Object] Object to be assigned + # @!visibility private + def match=(match) + if match.nil? + fail ArgumentError, 'invalid value for "match", match cannot be nil.' + end + @match = match + end + + # Custom attribute writer method with validation + # @param propagator_types [Object] Object to be assigned + # @!visibility private + def propagator_types=(propagator_types) + if propagator_types.nil? + fail ArgumentError, 'invalid value for "propagator_types", propagator_types cannot be nil.' + end + @propagator_types = propagator_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 && + match == o.match && + propagator_types == o.propagator_types && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [match, propagator_types, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/rum_sdk_config_tracing_url_propagator_type.rb b/lib/datadog_api_client/v2/models/rum_sdk_config_tracing_url_propagator_type.rb new file mode 100644 index 000000000000..7c9f1a2ab6f9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_sdk_config_tracing_url_propagator_type.rb @@ -0,0 +1,29 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A trace propagator type. + class RumSdkConfigTracingUrlPropagatorType + include BaseEnumModel + + DATADOG = "datadog".freeze + B3 = "b3".freeze + B3MULTI = "b3multi".freeze + TRACECONTEXT = "tracecontext".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/rum_sdk_config_type.rb b/lib/datadog_api_client/v2/models/rum_sdk_config_type.rb new file mode 100644 index 000000000000..b83a77b4084e --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_sdk_config_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 `rum_sdk_config`. + class RumSdkConfigType + include BaseEnumModel + + RUM_SDK_CONFIG = "rum_sdk_config".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/rum_sdk_config_update_attributes.rb b/lib/datadog_api_client/v2/models/rum_sdk_config_update_attributes.rb new file mode 100644 index 000000000000..b90bd785c58e --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_sdk_config_update_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 + # Attributes of the RUM SDK configuration to update. + class RumSdkConfigUpdateAttributes + include BaseGenericModel + + # The RUM SDK settings to apply when updating a configuration. + attr_reader :rum + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'rum' => :'rum' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'rum' => :'RumSdkConfigRumUpdateAttributes' + } + 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::RumSdkConfigUpdateAttributes` 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?(:'rum') + self.rum = attributes[:'rum'] + 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 @rum.nil? + true + end + + # Custom attribute writer method with validation + # @param rum [Object] Object to be assigned + # @!visibility private + def rum=(rum) + if rum.nil? + fail ArgumentError, 'invalid value for "rum", rum cannot be nil.' + end + @rum = rum + 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 && + rum == o.rum && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [rum, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/rum_sdk_config_update_data.rb b/lib/datadog_api_client/v2/models/rum_sdk_config_update_data.rb new file mode 100644 index 000000000000..67560f048058 --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_sdk_config_update_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 data object for updating a RUM SDK configuration. + class RumSdkConfigUpdateData + include BaseGenericModel + + # Attributes of the RUM SDK configuration to update. + attr_reader :attributes + + # The ID of the RUM SDK configuration to update. + attr_reader :id + + # The type of the resource. The value should always be `rum_sdk_config`. + 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' => :'RumSdkConfigUpdateAttributes', + :'id' => :'String', + :'type' => :'RumSdkConfigType' + } + 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::RumSdkConfigUpdateData` 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/rum_sdk_config_update_request.rb b/lib/datadog_api_client/v2/models/rum_sdk_config_update_request.rb new file mode 100644 index 000000000000..0a761403d9fb --- /dev/null +++ b/lib/datadog_api_client/v2/models/rum_sdk_config_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 body for updating a RUM SDK configuration. + class RumSdkConfigUpdateRequest + include BaseGenericModel + + # The data object for updating a RUM SDK configuration. + 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' => :'RumSdkConfigUpdateData' + } + 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::RumSdkConfigUpdateRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_automation_rules_links.rb b/lib/datadog_api_client/v2/models/security_automation_rules_links.rb new file mode 100644 index 000000000000..6e46d8814a9d --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_automation_rules_links.rb @@ -0,0 +1,164 @@ +=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 + # Pagination links for the list of automation rules. + class SecurityAutomationRulesLinks + include BaseGenericModel + + # Link to the first page of results. + attr_reader :first + + # Link to the last page of results. + attr_reader :last + + # Link to the next page of results. + attr_accessor :_next + + # Link to the previous page of results. + attr_accessor :prev + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'first' => :'first', + :'last' => :'last', + :'_next' => :'next', + :'prev' => :'prev' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'first' => :'String', + :'last' => :'String', + :'_next' => :'String', + :'prev' => :'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::SecurityAutomationRulesLinks` 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?(:'first') + self.first = attributes[:'first'] + end + + if attributes.key?(:'last') + self.last = attributes[:'last'] + end + + if attributes.key?(:'_next') + self._next = attributes[:'_next'] + end + + if attributes.key?(:'prev') + self.prev = attributes[:'prev'] + 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 @first.nil? + return false if @last.nil? + true + end + + # Custom attribute writer method with validation + # @param first [Object] Object to be assigned + # @!visibility private + def first=(first) + if first.nil? + fail ArgumentError, 'invalid value for "first", first cannot be nil.' + end + @first = first + end + + # Custom attribute writer method with validation + # @param last [Object] Object to be assigned + # @!visibility private + def last=(last) + if last.nil? + fail ArgumentError, 'invalid value for "last", last cannot be nil.' + end + @last = last + 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 && + first == o.first && + last == o.last && + _next == o._next && + prev == o.prev && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [first, last, _next, prev, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_automation_rules_meta.rb b/lib/datadog_api_client/v2/models/security_automation_rules_meta.rb new file mode 100644 index 000000000000..561aba8f10c7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_automation_rules_meta.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Metadata for the list of automation rules. + class SecurityAutomationRulesMeta + include BaseGenericModel + + # Pagination information for the list of automation rules. + attr_reader :page + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'page' => :'page' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'page' => :'SecurityAutomationRulesPageInfo' + } + 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::SecurityAutomationRulesMeta` 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?(:'page') + self.page = attributes[:'page'] + 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 @page.nil? + true + end + + # Custom attribute writer method with validation + # @param page [Object] Object to be assigned + # @!visibility private + def page=(page) + if page.nil? + fail ArgumentError, 'invalid value for "page", page cannot be nil.' + end + @page = page + 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 && + page == o.page && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [page, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_automation_rules_page_info.rb b/lib/datadog_api_client/v2/models/security_automation_rules_page_info.rb new file mode 100644 index 000000000000..1be73b9cb5f5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_automation_rules_page_info.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 + # Pagination information for the list of automation rules. + class SecurityAutomationRulesPageInfo + include BaseGenericModel + + # The total number of rules matching the current filter. + attr_reader :total_filtered_count + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'total_filtered_count' => :'total_filtered_count' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'total_filtered_count' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SecurityAutomationRulesPageInfo` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'total_filtered_count') + self.total_filtered_count = attributes[:'total_filtered_count'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @total_filtered_count.nil? + true + end + + # Custom attribute writer method with validation + # @param total_filtered_count [Object] Object to be assigned + # @!visibility private + def total_filtered_count=(total_filtered_count) + if total_filtered_count.nil? + fail ArgumentError, 'invalid value for "total_filtered_count", total_filtered_count cannot be nil.' + end + @total_filtered_count = total_filtered_count + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + total_filtered_count == o.total_filtered_count && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [total_filtered_count, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_finding_type.rb b/lib/datadog_api_client/v2/models/security_finding_type.rb new file mode 100644 index 000000000000..fe7ed2779efa --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_finding_type.rb @@ -0,0 +1,36 @@ +=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 security finding that the automation rule applies to. + class SecurityFindingType + include BaseEnumModel + + API_SECURITY = "api_security".freeze + ATTACK_PATH = "attack_path".freeze + HOST_AND_CONTAINER_VULNERABILITY = "host_and_container_vulnerability".freeze + IAC_MISCONFIGURATION = "iac_misconfiguration".freeze + IDENTITY_RISK = "identity_risk".freeze + LIBRARY_VULNERABILITY = "library_vulnerability".freeze + MISCONFIGURATION = "misconfiguration".freeze + RUNTIME_CODE_VULNERABILITY = "runtime_code_vulnerability".freeze + SECRET = "secret".freeze + STATIC_CODE_VULNERABILITY = "static_code_vulnerability".freeze + WORKLOAD_ACTIVITY = "workload_activity".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/ticket_creation_rule_action.rb b/lib/datadog_api_client/v2/models/ticket_creation_rule_action.rb new file mode 100644 index 000000000000..af01f9f91043 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ticket_creation_rule_action.rb @@ -0,0 +1,193 @@ +=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 action to take when the ticket creation rule matches a finding. + class TicketCreationRuleAction + include BaseGenericModel + + # The UUID of the default assignee for created tickets. + attr_accessor :assignee_id + + # Custom fields of the Jira issue to create. For the list of available fields, see [Jira documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-createmeta-projectidorkey-issuetypes-issuetypeid-get). + attr_accessor :fields + + # The maximum number of tickets the rule may create per day. If exceeded, one final ticket will be created, explaining the limit was hit and link back to the responsible rule. + attr_reader :max_tickets_per_day + + # The UUID of the case management project. + attr_reader :project_id + + # The ticketing system to create tickets in. + attr_reader :target + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'assignee_id' => :'assignee_id', + :'fields' => :'fields', + :'max_tickets_per_day' => :'max_tickets_per_day', + :'project_id' => :'project_id', + :'target' => :'target' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'assignee_id' => :'UUID', + :'fields' => :'Object', + :'max_tickets_per_day' => :'Integer', + :'project_id' => :'UUID', + :'target' => :'TicketCreationTarget' + } + 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::TicketCreationRuleAction` 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?(:'assignee_id') + self.assignee_id = attributes[:'assignee_id'] + end + + if attributes.key?(:'fields') + self.fields = attributes[:'fields'] + end + + if attributes.key?(:'max_tickets_per_day') + self.max_tickets_per_day = attributes[:'max_tickets_per_day'] + end + + if attributes.key?(:'project_id') + self.project_id = attributes[:'project_id'] + end + + if attributes.key?(:'target') + self.target = attributes[:'target'] + 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 @max_tickets_per_day.nil? + return false if @max_tickets_per_day > 500 + return false if @max_tickets_per_day < 1 + return false if @project_id.nil? + return false if @target.nil? + true + end + + # Custom attribute writer method with validation + # @param max_tickets_per_day [Object] Object to be assigned + # @!visibility private + def max_tickets_per_day=(max_tickets_per_day) + if max_tickets_per_day.nil? + fail ArgumentError, 'invalid value for "max_tickets_per_day", max_tickets_per_day cannot be nil.' + end + if max_tickets_per_day > 500 + fail ArgumentError, 'invalid value for "max_tickets_per_day", must be smaller than or equal to 500.' + end + if max_tickets_per_day < 1 + fail ArgumentError, 'invalid value for "max_tickets_per_day", must be greater than or equal to 1.' + end + @max_tickets_per_day = max_tickets_per_day + end + + # Custom attribute writer method with validation + # @param project_id [Object] Object to be assigned + # @!visibility private + def project_id=(project_id) + if project_id.nil? + fail ArgumentError, 'invalid value for "project_id", project_id cannot be nil.' + end + @project_id = project_id + end + + # Custom attribute writer method with validation + # @param target [Object] Object to be assigned + # @!visibility private + def target=(target) + if target.nil? + fail ArgumentError, 'invalid value for "target", target cannot be nil.' + end + @target = target + 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 && + assignee_id == o.assignee_id && + fields == o.fields && + max_tickets_per_day == o.max_tickets_per_day && + project_id == o.project_id && + target == o.target && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [assignee_id, fields, max_tickets_per_day, project_id, target, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ticket_creation_rule_action_response.rb b/lib/datadog_api_client/v2/models/ticket_creation_rule_action_response.rb new file mode 100644 index 000000000000..61fb93912cf8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ticket_creation_rule_action_response.rb @@ -0,0 +1,203 @@ +=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 action to take when the ticket creation rule matches a finding. + class TicketCreationRuleActionResponse + include BaseGenericModel + + # The UUID of the default assignee for created tickets. + attr_accessor :assignee_id + + # The reason the rule was automatically disabled by the system due to a ticketing integration error. + attr_accessor :auto_disabled_reason + + # Custom fields of the Jira issue to create. For the list of available fields, see [Jira documentation](https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-issues/#api-rest-api-2-issue-createmeta-projectidorkey-issuetypes-issuetypeid-get). + attr_accessor :fields + + # The maximum number of tickets the rule may create per day. If exceeded, one final ticket will be created, explaining the limit was hit and link back to the responsible rule. + attr_reader :max_tickets_per_day + + # The UUID of the case management project. + attr_reader :project_id + + # The ticketing system to create tickets in. + attr_reader :target + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'assignee_id' => :'assignee_id', + :'auto_disabled_reason' => :'auto_disabled_reason', + :'fields' => :'fields', + :'max_tickets_per_day' => :'max_tickets_per_day', + :'project_id' => :'project_id', + :'target' => :'target' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'assignee_id' => :'UUID', + :'auto_disabled_reason' => :'String', + :'fields' => :'Object', + :'max_tickets_per_day' => :'Integer', + :'project_id' => :'UUID', + :'target' => :'TicketCreationTarget' + } + 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::TicketCreationRuleActionResponse` 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?(:'assignee_id') + self.assignee_id = attributes[:'assignee_id'] + end + + if attributes.key?(:'auto_disabled_reason') + self.auto_disabled_reason = attributes[:'auto_disabled_reason'] + end + + if attributes.key?(:'fields') + self.fields = attributes[:'fields'] + end + + if attributes.key?(:'max_tickets_per_day') + self.max_tickets_per_day = attributes[:'max_tickets_per_day'] + end + + if attributes.key?(:'project_id') + self.project_id = attributes[:'project_id'] + end + + if attributes.key?(:'target') + self.target = attributes[:'target'] + 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 @max_tickets_per_day.nil? + return false if @max_tickets_per_day > 500 + return false if @max_tickets_per_day < 1 + return false if @project_id.nil? + return false if @target.nil? + true + end + + # Custom attribute writer method with validation + # @param max_tickets_per_day [Object] Object to be assigned + # @!visibility private + def max_tickets_per_day=(max_tickets_per_day) + if max_tickets_per_day.nil? + fail ArgumentError, 'invalid value for "max_tickets_per_day", max_tickets_per_day cannot be nil.' + end + if max_tickets_per_day > 500 + fail ArgumentError, 'invalid value for "max_tickets_per_day", must be smaller than or equal to 500.' + end + if max_tickets_per_day < 1 + fail ArgumentError, 'invalid value for "max_tickets_per_day", must be greater than or equal to 1.' + end + @max_tickets_per_day = max_tickets_per_day + end + + # Custom attribute writer method with validation + # @param project_id [Object] Object to be assigned + # @!visibility private + def project_id=(project_id) + if project_id.nil? + fail ArgumentError, 'invalid value for "project_id", project_id cannot be nil.' + end + @project_id = project_id + end + + # Custom attribute writer method with validation + # @param target [Object] Object to be assigned + # @!visibility private + def target=(target) + if target.nil? + fail ArgumentError, 'invalid value for "target", target cannot be nil.' + end + @target = target + 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 && + assignee_id == o.assignee_id && + auto_disabled_reason == o.auto_disabled_reason && + fields == o.fields && + max_tickets_per_day == o.max_tickets_per_day && + project_id == o.project_id && + target == o.target && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [assignee_id, auto_disabled_reason, fields, max_tickets_per_day, project_id, target, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ticket_creation_rule_attributes_create.rb b/lib/datadog_api_client/v2/models/ticket_creation_rule_attributes_create.rb new file mode 100644 index 000000000000..e71167b6a011 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ticket_creation_rule_attributes_create.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 + # Attributes for creating or updating a ticket creation rule. + class TicketCreationRuleAttributesCreate + include BaseGenericModel + + # The action to take when the ticket creation rule matches a finding. + attr_reader :action + + # Whether the ticket creation rule is enabled. + attr_accessor :enabled + + # The name of the ticket creation rule. + attr_reader :name + + # Defines the scope of findings to which the automation rule applies. + attr_reader :rule + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'action' => :'action', + :'enabled' => :'enabled', + :'name' => :'name', + :'rule' => :'rule' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'action' => :'TicketCreationRuleAction', + :'enabled' => :'Boolean', + :'name' => :'String', + :'rule' => :'AutomationRuleScope' + } + 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::TicketCreationRuleAttributesCreate` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'action') + self.action = attributes[:'action'] + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'rule') + self.rule = attributes[:'rule'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @action.nil? + return false if @name.nil? + return false if @name.to_s.length > 255 + return false if @name.to_s.length < 1 + return false if @rule.nil? + true + end + + # Custom attribute writer method with validation + # @param action [Object] Object to be assigned + # @!visibility private + def action=(action) + if action.nil? + fail ArgumentError, 'invalid value for "action", action cannot be nil.' + end + @action = action + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + if name.to_s.length > 255 + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.' + end + if name.to_s.length < 1 + fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param rule [Object] Object to be assigned + # @!visibility private + def rule=(rule) + if rule.nil? + fail ArgumentError, 'invalid value for "rule", rule cannot be nil.' + end + @rule = rule + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + action == o.action && + enabled == o.enabled && + name == o.name && + rule == o.rule && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [action, enabled, name, rule, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ticket_creation_rule_attributes_response.rb b/lib/datadog_api_client/v2/models/ticket_creation_rule_attributes_response.rb new file mode 100644 index 000000000000..dc10c98c9219 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ticket_creation_rule_attributes_response.rb @@ -0,0 +1,278 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a ticket creation rule returned by the API. + class TicketCreationRuleAttributesResponse + include BaseGenericModel + + # The action to take when the ticket creation rule matches a finding. + attr_reader :action + + # The Unix timestamp in milliseconds when the rule was created. + attr_reader :created_at + + # The user or Datadog system who created the rule. + attr_reader :created_by + + # Whether the ticket creation rule is enabled. + attr_reader :enabled + + # The Unix timestamp in milliseconds when the rule was last modified. + attr_reader :modified_at + + # The user or Datadog system who last modified the rule. + attr_reader :modified_by + + # The name of the ticket creation rule. + attr_reader :name + + # Defines the scope of findings to which the automation rule applies. + attr_reader :rule + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'action' => :'action', + :'created_at' => :'created_at', + :'created_by' => :'created_by', + :'enabled' => :'enabled', + :'modified_at' => :'modified_at', + :'modified_by' => :'modified_by', + :'name' => :'name', + :'rule' => :'rule' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'action' => :'TicketCreationRuleActionResponse', + :'created_at' => :'Integer', + :'created_by' => :'AutomationRuleCreatedBy', + :'enabled' => :'Boolean', + :'modified_at' => :'Integer', + :'modified_by' => :'AutomationRuleModifiedBy', + :'name' => :'String', + :'rule' => :'AutomationRuleScope' + } + 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::TicketCreationRuleAttributesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'action') + self.action = attributes[:'action'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'created_by') + self.created_by = attributes[:'created_by'] + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'modified_by') + self.modified_by = attributes[:'modified_by'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'rule') + self.rule = attributes[:'rule'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @action.nil? + return false if @created_at.nil? + return false if @created_by.nil? + return false if @enabled.nil? + return false if @modified_at.nil? + return false if @modified_by.nil? + return false if @name.nil? + return false if @name.to_s.length > 255 + return false if @name.to_s.length < 1 + return false if @rule.nil? + true + end + + # Custom attribute writer method with validation + # @param action [Object] Object to be assigned + # @!visibility private + def action=(action) + if action.nil? + fail ArgumentError, 'invalid value for "action", action cannot be nil.' + end + @action = action + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param created_by [Object] Object to be assigned + # @!visibility private + def created_by=(created_by) + if created_by.nil? + fail ArgumentError, 'invalid value for "created_by", created_by cannot be nil.' + end + @created_by = created_by + end + + # Custom attribute writer method with validation + # @param enabled [Object] Object to be assigned + # @!visibility private + def enabled=(enabled) + if enabled.nil? + fail ArgumentError, 'invalid value for "enabled", enabled cannot be nil.' + end + @enabled = enabled + end + + # Custom attribute writer method with validation + # @param modified_at [Object] Object to be assigned + # @!visibility private + def modified_at=(modified_at) + if modified_at.nil? + fail ArgumentError, 'invalid value for "modified_at", modified_at cannot be nil.' + end + @modified_at = modified_at + end + + # Custom attribute writer method with validation + # @param modified_by [Object] Object to be assigned + # @!visibility private + def modified_by=(modified_by) + if modified_by.nil? + fail ArgumentError, 'invalid value for "modified_by", modified_by cannot be nil.' + end + @modified_by = modified_by + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + if name.to_s.length > 255 + fail ArgumentError, 'invalid value for "name", the character length must be smaller than or equal to 255.' + end + if name.to_s.length < 1 + fail ArgumentError, 'invalid value for "name", the character length must be great than or equal to 1.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param rule [Object] Object to be assigned + # @!visibility private + def rule=(rule) + if rule.nil? + fail ArgumentError, 'invalid value for "rule", rule cannot be nil.' + end + @rule = rule + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + action == o.action && + created_at == o.created_at && + created_by == o.created_by && + enabled == o.enabled && + modified_at == o.modified_at && + modified_by == o.modified_by && + name == o.name && + rule == o.rule && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [action, created_at, created_by, enabled, modified_at, modified_by, name, rule, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ticket_creation_rule_create_request.rb b/lib/datadog_api_client/v2/models/ticket_creation_rule_create_request.rb new file mode 100644 index 000000000000..bfb5dc6ce760 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ticket_creation_rule_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 + # The body of a ticket creation rule create request. + class TicketCreationRuleCreateRequest + include BaseGenericModel + + # The data object for a ticket creation rule create or update 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' => :'TicketCreationRuleDataCreate' + } + 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::TicketCreationRuleCreateRequest` 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/ticket_creation_rule_data_create.rb b/lib/datadog_api_client/v2/models/ticket_creation_rule_data_create.rb new file mode 100644 index 000000000000..2a70b4941416 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ticket_creation_rule_data_create.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 data object for a ticket creation rule create or update request. + class TicketCreationRuleDataCreate + include BaseGenericModel + + # Attributes for creating or updating a ticket creation rule. + attr_reader :attributes + + # The JSON:API type for ticket creation rules. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'TicketCreationRuleAttributesCreate', + :'type' => :'TicketCreationRuleType' + } + 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::TicketCreationRuleDataCreate` 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/ticket_creation_rule_data_response.rb b/lib/datadog_api_client/v2/models/ticket_creation_rule_data_response.rb new file mode 100644 index 000000000000..8c129c02a155 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ticket_creation_rule_data_response.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The data object for a ticket creation rule returned by the API. + class TicketCreationRuleDataResponse + include BaseGenericModel + + # Attributes of a ticket creation rule returned by the API. + attr_reader :attributes + + # The ID of the ticket creation rule. + attr_reader :id + + # The JSON:API type for ticket creation rules. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'TicketCreationRuleAttributesResponse', + :'id' => :'UUID', + :'type' => :'TicketCreationRuleType' + } + 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::TicketCreationRuleDataResponse` 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/ticket_creation_rule_reorder_item.rb b/lib/datadog_api_client/v2/models/ticket_creation_rule_reorder_item.rb new file mode 100644 index 000000000000..7c269edab52e --- /dev/null +++ b/lib/datadog_api_client/v2/models/ticket_creation_rule_reorder_item.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 reference to a ticket creation rule used for reordering. + class TicketCreationRuleReorderItem + include BaseGenericModel + + # The ID of the automation rule. + attr_reader :id + + # The JSON:API type for ticket creation rules. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'UUID', + :'type' => :'TicketCreationRuleType' + } + 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::TicketCreationRuleReorderItem` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ticket_creation_rule_reorder_request.rb b/lib/datadog_api_client/v2/models/ticket_creation_rule_reorder_request.rb new file mode 100644 index 000000000000..fe6abc7a924d --- /dev/null +++ b/lib/datadog_api_client/v2/models/ticket_creation_rule_reorder_request.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 body of the ticket creation rule reorder request. + class TicketCreationRuleReorderRequest + include BaseGenericModel + + # The ordered list of all ticket creation rules; every rule must be included. + 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::TicketCreationRuleReorderRequest` 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/ticket_creation_rule_response.rb b/lib/datadog_api_client/v2/models/ticket_creation_rule_response.rb new file mode 100644 index 000000000000..bba26f5e6b0d --- /dev/null +++ b/lib/datadog_api_client/v2/models/ticket_creation_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 + # A single ticket creation rule response. + class TicketCreationRuleResponse + include BaseGenericModel + + # The data object for a ticket creation rule returned by the API. + 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' => :'TicketCreationRuleDataResponse' + } + 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::TicketCreationRuleResponse` 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/ticket_creation_rule_type.rb b/lib/datadog_api_client/v2/models/ticket_creation_rule_type.rb new file mode 100644 index 000000000000..7cff3bc4ca26 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ticket_creation_rule_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 JSON:API type for ticket creation rules. + class TicketCreationRuleType + include BaseEnumModel + + TICKET_CREATION_RULES = "ticket_creation_rules".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/ticket_creation_rule_update_request.rb b/lib/datadog_api_client/v2/models/ticket_creation_rule_update_request.rb new file mode 100644 index 000000000000..64e10f1a0bd7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ticket_creation_rule_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 + # The body of a ticket creation rule update request. + class TicketCreationRuleUpdateRequest + include BaseGenericModel + + # The data object for a ticket creation rule create or update 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' => :'TicketCreationRuleDataCreate' + } + 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::TicketCreationRuleUpdateRequest` 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/ticket_creation_rules_response.rb b/lib/datadog_api_client/v2/models/ticket_creation_rules_response.rb new file mode 100644 index 000000000000..16baad69a191 --- /dev/null +++ b/lib/datadog_api_client/v2/models/ticket_creation_rules_response.rb @@ -0,0 +1,167 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A list of ticket creation rules with pagination metadata. + class TicketCreationRulesResponse + include BaseGenericModel + + # A list of ticket creation rule data objects. + attr_reader :data + + # Pagination links for the list of automation rules. + attr_reader :links + + # Metadata for the list of automation rules. + attr_reader :meta + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'links' => :'links', + :'meta' => :'meta' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'links' => :'SecurityAutomationRulesLinks', + :'meta' => :'SecurityAutomationRulesMeta' + } + 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::TicketCreationRulesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'links') + self.links = attributes[:'links'] + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + return false if @links.nil? + return false if @meta.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Custom attribute writer method with validation + # @param links [Object] Object to be assigned + # @!visibility private + def links=(links) + if links.nil? + fail ArgumentError, 'invalid value for "links", links cannot be nil.' + end + @links = links + end + + # Custom attribute writer method with validation + # @param meta [Object] Object to be assigned + # @!visibility private + def meta=(meta) + if meta.nil? + fail ArgumentError, 'invalid value for "meta", meta cannot be nil.' + end + @meta = meta + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + links == o.links && + meta == o.meta && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, links, meta, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/ticket_creation_target.rb b/lib/datadog_api_client/v2/models/ticket_creation_target.rb new file mode 100644 index 000000000000..0ea9bc7be2bb --- /dev/null +++ b/lib/datadog_api_client/v2/models/ticket_creation_target.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 ticketing system to create tickets in. + class TicketCreationTarget + include BaseEnumModel + + JIRA = "jira".freeze + CASE_MANAGEMENT = "case_management".freeze + end +end