From 270b7388a0ecaef31cc62f4aacfdac64cc7dad5a Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Fri, 24 Jul 2026 10:35:25 +0000 Subject: [PATCH 1/5] Regenerate client from commit 3adde3e of spec repo (#3595) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 224 ++++++++++++++-- lib/datadog_api_client/inflector.rb | 14 + ...monitoring_content_pack_app_sec_details.rb | 123 +++++++++ ...oring_content_pack_app_sec_details_type.rb | 26 ++ ...y_monitoring_content_pack_audit_details.rb | 123 +++++++++ ...itoring_content_pack_audit_details_type.rb | 26 ++ ..._monitoring_content_pack_entity_details.rb | 144 ++++++++++ ...toring_content_pack_entity_details_type.rb | 26 ++ ...ty_monitoring_content_pack_logs_details.rb | 250 ++++++++++++++++++ ...itoring_content_pack_onboarding_details.rb | 154 +++++++++++ ...ng_content_pack_onboarding_details_type.rb | 26 ++ ...onitoring_content_pack_state_attributes.rb | 150 ++--------- ...rity_monitoring_content_pack_state_data.rb | 2 +- ...y_monitoring_content_pack_state_details.rb | 53 ++++ ...rity_monitoring_content_pack_state_meta.rb | 27 +- ...monitoring_content_pack_states_response.rb | 2 +- ...security_monitoring_content_pack_status.rb | 1 + ...oring_content_pack_threat_intel_details.rb | 186 +++++++++++++ ..._content_pack_threat_intel_details_type.rb | 26 ++ ...ring_content_pack_vulnerability_details.rb | 186 +++++++++++++ ...content_pack_vulnerability_details_type.rb | 26 ++ .../v2/models/security_monitoring_sku.rb | 2 + 22 files changed, 1646 insertions(+), 151 deletions(-) create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_content_pack_app_sec_details.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_content_pack_app_sec_details_type.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_content_pack_audit_details.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_content_pack_audit_details_type.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_content_pack_entity_details.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_content_pack_entity_details_type.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_content_pack_logs_details.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_content_pack_onboarding_details.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_content_pack_onboarding_details_type.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_content_pack_state_details.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_content_pack_threat_intel_details.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_content_pack_threat_intel_details_type.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_content_pack_vulnerability_details.rb create mode 100644 lib/datadog_api_client/v2/models/security_monitoring_content_pack_vulnerability_details_type.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 078ee2411a77..b507264fb29c 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -89626,6 +89626,57 @@ components: - NEVER_ACTIVATED - ACTIVATED - DEACTIVATED + SecurityMonitoringContentPackAppSecDetails: + description: Details for an Application Security content pack. + properties: + type: + $ref: "#/components/schemas/SecurityMonitoringContentPackAppSecDetailsType" + required: + - type + type: object + SecurityMonitoringContentPackAppSecDetailsType: + description: Type for Application Security content pack details. + enum: + - appsec + example: appsec + type: string + x-enum-varnames: + - APPSEC + SecurityMonitoringContentPackAuditDetails: + description: Details for an audit trail content pack. + properties: + type: + $ref: "#/components/schemas/SecurityMonitoringContentPackAuditDetailsType" + required: + - type + type: object + SecurityMonitoringContentPackAuditDetailsType: + description: Type for audit trail content pack details. + enum: + - audit + example: audit + type: string + x-enum-varnames: + - AUDIT + SecurityMonitoringContentPackEntityDetails: + description: Details for an entity or identity content pack. + properties: + cp_activation: + $ref: "#/components/schemas/SecurityMonitoringContentPackActivation" + type: + $ref: "#/components/schemas/SecurityMonitoringContentPackEntityDetailsType" + required: + - type + - cp_activation + type: object + SecurityMonitoringContentPackEntityDetailsType: + description: Type for entity content pack details. + enum: + - entity + example: entity + type: string + x-enum-varnames: + - ENTITY SecurityMonitoringContentPackIntegrationStatus: description: The installation status of the related integration. enum: @@ -89648,16 +89699,14 @@ components: - PARTIALLY_INSTALLED - DETECTED - ERROR - SecurityMonitoringContentPackStateAttributes: - description: Attributes of a content pack state + SecurityMonitoringContentPackLogsDetails: + description: Details for a logs-based content pack. properties: - cloud_siem_index_incorrect: - description: Whether the cloud SIEM index configuration is incorrect (only applies to certain pricing models) - example: false - type: boolean cp_activation: $ref: "#/components/schemas/SecurityMonitoringContentPackActivation" - filters_configured_for_logs: + data_last_seen: + $ref: "#/components/schemas/SecurityMonitoringContentPackTimestampBucket" + filters_configured: description: |- Whether filters (Security Filters or Index Query depending on the pricing model) are present and correctly configured to route logs into Cloud SIEM. @@ -89665,21 +89714,59 @@ components: type: boolean integration_installed_status: $ref: "#/components/schemas/SecurityMonitoringContentPackIntegrationStatus" - logs_last_collected: - $ref: "#/components/schemas/SecurityMonitoringContentPackTimestampBucket" logs_seen_from_any_index: - description: Whether logs for this content pack have been seen in any Datadog index within the last 72 hours. + description: Whether logs for this content pack have been seen in any Datadog index in the last 72 hours. example: true type: boolean - state: - $ref: "#/components/schemas/SecurityMonitoringContentPackStatus" + siem_index_incorrect: + description: Whether the Cloud SIEM index configuration is incorrect (only applies to certain pricing models). + example: false + type: boolean + type: + $ref: "#/components/schemas/SecurityFilterFilteredDataType" required: - - state + - type - cp_activation + - data_last_seen + - integration_installed_status + - filters_configured - logs_seen_from_any_index - - logs_last_collected - - cloud_siem_index_incorrect - - filters_configured_for_logs + - siem_index_incorrect + type: object + SecurityMonitoringContentPackOnboardingDetails: + description: |- + Content pack details returned when Cloud SIEM is inactive for the requesting organization. + properties: + integration_installed_status: + $ref: "#/components/schemas/SecurityMonitoringContentPackIntegrationStatus" + logs_seen_from_any_index: + description: Whether logs for this content pack have been seen in any Datadog index in the last 72 hours. + example: true + type: boolean + type: + $ref: "#/components/schemas/SecurityMonitoringContentPackOnboardingDetailsType" + required: + - type + - logs_seen_from_any_index + type: object + SecurityMonitoringContentPackOnboardingDetailsType: + description: Type for onboarding content pack details. + enum: + - onboarding + example: onboarding + type: string + x-enum-varnames: + - ONBOARDING + SecurityMonitoringContentPackStateAttributes: + description: Attributes of a content pack state. + properties: + details: + $ref: "#/components/schemas/SecurityMonitoringContentPackStateDetails" + status: + $ref: "#/components/schemas/SecurityMonitoringContentPackStatus" + required: + - status + - details type: object SecurityMonitoringContentPackStateData: description: Content pack state data. @@ -89697,13 +89784,42 @@ components: - type - attributes type: object + SecurityMonitoringContentPackStateDetails: + description: |- + Type-specific details for a content pack state. The set of fields present depends + on the content pack's `type`. When Cloud SIEM is inactive for the requesting organization, `onboarding` is returned instead of the content pack's usual type, such as `logs` or `vulnerability`.` + discriminator: + mapping: + appsec: "#/components/schemas/SecurityMonitoringContentPackAppSecDetails" + audit: "#/components/schemas/SecurityMonitoringContentPackAuditDetails" + entity: "#/components/schemas/SecurityMonitoringContentPackEntityDetails" + logs: "#/components/schemas/SecurityMonitoringContentPackLogsDetails" + onboarding: "#/components/schemas/SecurityMonitoringContentPackOnboardingDetails" + threat_intel: "#/components/schemas/SecurityMonitoringContentPackThreatIntelDetails" + vulnerability: "#/components/schemas/SecurityMonitoringContentPackVulnerabilityDetails" + propertyName: type + oneOf: + - $ref: "#/components/schemas/SecurityMonitoringContentPackLogsDetails" + - $ref: "#/components/schemas/SecurityMonitoringContentPackThreatIntelDetails" + - $ref: "#/components/schemas/SecurityMonitoringContentPackEntityDetails" + - $ref: "#/components/schemas/SecurityMonitoringContentPackAuditDetails" + - $ref: "#/components/schemas/SecurityMonitoringContentPackAppSecDetails" + - $ref: "#/components/schemas/SecurityMonitoringContentPackVulnerabilityDetails" + - $ref: "#/components/schemas/SecurityMonitoringContentPackOnboardingDetails" SecurityMonitoringContentPackStateMeta: - description: Metadata for content pack states + description: Metadata for content pack states. properties: cloud_siem_index_incorrect: - description: Whether the cloud SIEM index configuration is incorrect at the organization level + description: Whether the Cloud SIEM index configuration is incorrect for the organization. example: false type: boolean + retention_months: + description: |- + The number of months that standard logs are retained for organizations on the standalone_indexed` pricing model. This field is omitted for other pricing models. + example: 15 + format: int32 + maximum: 60 + type: integer sku: $ref: "#/components/schemas/SecurityMonitoringSKU" required: @@ -89741,6 +89857,7 @@ components: - active - warning - broken + - not_configured example: active type: string x-enum-descriptions: @@ -89750,6 +89867,7 @@ components: - Activated; logs received within the last 24 hours. - Activated; integration not installed or logs last seen 24 to 72 hours ago. - Activated; no logs for over 72 hours, filter missing, or Cloud SIEM index incorrectly ordered. + - Activated, but no credentials are configured (entity content packs only). x-enum-varnames: - INSTALL - ACTIVATE @@ -89757,6 +89875,32 @@ components: - ACTIVE - WARNING - BROKEN + - NOT_CONFIGURED + SecurityMonitoringContentPackThreatIntelDetails: + description: Details for a threat intelligence content pack. + properties: + cp_activation: + $ref: "#/components/schemas/SecurityMonitoringContentPackActivation" + data_last_seen: + $ref: "#/components/schemas/SecurityMonitoringContentPackTimestampBucket" + integration_installed_status: + $ref: "#/components/schemas/SecurityMonitoringContentPackIntegrationStatus" + type: + $ref: "#/components/schemas/SecurityMonitoringContentPackThreatIntelDetailsType" + required: + - type + - cp_activation + - data_last_seen + - integration_installed_status + type: object + SecurityMonitoringContentPackThreatIntelDetailsType: + description: Type for threat intelligence content pack details. + enum: + - threat_intel + example: threat_intel + type: string + x-enum-varnames: + - THREAT_INTEL SecurityMonitoringContentPackTimestampBucket: description: Timestamp bucket indicating when logs were last collected. enum: @@ -89779,6 +89923,31 @@ components: - WITHIN_24_TO_72_HOURS - OVER_72H_TO_30D - OVER_30D + SecurityMonitoringContentPackVulnerabilityDetails: + description: Details for a vulnerability content pack. + properties: + cp_activation: + $ref: "#/components/schemas/SecurityMonitoringContentPackActivation" + data_last_seen: + $ref: "#/components/schemas/SecurityMonitoringContentPackTimestampBucket" + integration_installed_status: + $ref: "#/components/schemas/SecurityMonitoringContentPackIntegrationStatus" + type: + $ref: "#/components/schemas/SecurityMonitoringContentPackVulnerabilityDetailsType" + required: + - type + - cp_activation + - data_last_seen + - integration_installed_status + type: object + SecurityMonitoringContentPackVulnerabilityDetailsType: + description: Type for vulnerability content pack details. + enum: + - vulnerability + example: vulnerability + type: string + x-enum-varnames: + - VULNERABILITY SecurityMonitoringCriticalAsset: description: The critical asset's properties. properties: @@ -92150,12 +92319,16 @@ components: - per_gb_analyzed - per_event_in_siem_index_2023 - add_on_2024 + - standalone_indexed + - unknown example: add_on_2024 type: string x-enum-varnames: - PER_GB_ANALYZED - PER_EVENT_IN_SIEM_INDEX_2023 - ADD_ON_2024 + - STANDALONE_INDEXED + - UNKNOWN SecurityMonitoringSchedulingOptions: description: Options for scheduled rules. When this field is present, the rule runs based on the schedule. When absent, it runs real-time on ingested logs. nullable: true @@ -184119,12 +184292,15 @@ paths: value: data: - attributes: - cloud_siem_index_incorrect: false - cp_activation: activated - filters_configured_for_logs: true - logs_last_collected: within_24_hours - logs_seen_from_any_index: true - state: active + details: + cp_activation: activated + data_last_seen: within_24_hours + filters_configured: true + integration_installed_status: installed + logs_seen_from_any_index: true + siem_index_incorrect: false + type: logs + status: active id: aws-cloudtrail type: content_pack_state meta: diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 5195cb99fe42..c9c6d143b082 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -6584,14 +6584,28 @@ def overrides "v2.security_finding_type" => "SecurityFindingType", "v2.security_monitoring_azure_app_registration" => "SecurityMonitoringAzureAppRegistration", "v2.security_monitoring_content_pack_activation" => "SecurityMonitoringContentPackActivation", + "v2.security_monitoring_content_pack_app_sec_details" => "SecurityMonitoringContentPackAppSecDetails", + "v2.security_monitoring_content_pack_app_sec_details_type" => "SecurityMonitoringContentPackAppSecDetailsType", + "v2.security_monitoring_content_pack_audit_details" => "SecurityMonitoringContentPackAuditDetails", + "v2.security_monitoring_content_pack_audit_details_type" => "SecurityMonitoringContentPackAuditDetailsType", + "v2.security_monitoring_content_pack_entity_details" => "SecurityMonitoringContentPackEntityDetails", + "v2.security_monitoring_content_pack_entity_details_type" => "SecurityMonitoringContentPackEntityDetailsType", "v2.security_monitoring_content_pack_integration_status" => "SecurityMonitoringContentPackIntegrationStatus", + "v2.security_monitoring_content_pack_logs_details" => "SecurityMonitoringContentPackLogsDetails", + "v2.security_monitoring_content_pack_onboarding_details" => "SecurityMonitoringContentPackOnboardingDetails", + "v2.security_monitoring_content_pack_onboarding_details_type" => "SecurityMonitoringContentPackOnboardingDetailsType", "v2.security_monitoring_content_pack_state_attributes" => "SecurityMonitoringContentPackStateAttributes", "v2.security_monitoring_content_pack_state_data" => "SecurityMonitoringContentPackStateData", + "v2.security_monitoring_content_pack_state_details" => "SecurityMonitoringContentPackStateDetails", "v2.security_monitoring_content_pack_state_meta" => "SecurityMonitoringContentPackStateMeta", "v2.security_monitoring_content_pack_states_response" => "SecurityMonitoringContentPackStatesResponse", "v2.security_monitoring_content_pack_state_type" => "SecurityMonitoringContentPackStateType", "v2.security_monitoring_content_pack_status" => "SecurityMonitoringContentPackStatus", + "v2.security_monitoring_content_pack_threat_intel_details" => "SecurityMonitoringContentPackThreatIntelDetails", + "v2.security_monitoring_content_pack_threat_intel_details_type" => "SecurityMonitoringContentPackThreatIntelDetailsType", "v2.security_monitoring_content_pack_timestamp_bucket" => "SecurityMonitoringContentPackTimestampBucket", + "v2.security_monitoring_content_pack_vulnerability_details" => "SecurityMonitoringContentPackVulnerabilityDetails", + "v2.security_monitoring_content_pack_vulnerability_details_type" => "SecurityMonitoringContentPackVulnerabilityDetailsType", "v2.security_monitoring_critical_asset" => "SecurityMonitoringCriticalAsset", "v2.security_monitoring_critical_asset_attributes" => "SecurityMonitoringCriticalAssetAttributes", "v2.security_monitoring_critical_asset_create_attributes" => "SecurityMonitoringCriticalAssetCreateAttributes", diff --git a/lib/datadog_api_client/v2/models/security_monitoring_content_pack_app_sec_details.rb b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_app_sec_details.rb new file mode 100644 index 000000000000..9b2062490d76 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_app_sec_details.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 + # Details for an Application Security content pack. + class SecurityMonitoringContentPackAppSecDetails + include BaseGenericModel + + # Type for Application Security content pack details. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'type' => :'SecurityMonitoringContentPackAppSecDetailsType' + } + 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::SecurityMonitoringContentPackAppSecDetails` 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?(:'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 @type.nil? + true + 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 && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_content_pack_app_sec_details_type.rb b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_app_sec_details_type.rb new file mode 100644 index 000000000000..c85afdf033bb --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_app_sec_details_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 + # Type for Application Security content pack details. + class SecurityMonitoringContentPackAppSecDetailsType + include BaseEnumModel + + APPSEC = "appsec".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_content_pack_audit_details.rb b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_audit_details.rb new file mode 100644 index 000000000000..8be535d1f405 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_audit_details.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 + # Details for an audit trail content pack. + class SecurityMonitoringContentPackAuditDetails + include BaseGenericModel + + # Type for audit trail content pack details. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'type' => :'SecurityMonitoringContentPackAuditDetailsType' + } + 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::SecurityMonitoringContentPackAuditDetails` 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?(:'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 @type.nil? + true + 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 && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_content_pack_audit_details_type.rb b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_audit_details_type.rb new file mode 100644 index 000000000000..a0b663eaaec3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_audit_details_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 + # Type for audit trail content pack details. + class SecurityMonitoringContentPackAuditDetailsType + include BaseEnumModel + + AUDIT = "audit".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_content_pack_entity_details.rb b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_entity_details.rb new file mode 100644 index 000000000000..60908880d6be --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_entity_details.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 + # Details for an entity or identity content pack. + class SecurityMonitoringContentPackEntityDetails + include BaseGenericModel + + # The activation status of a content pack. + attr_reader :cp_activation + + # Type for entity content pack details. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'cp_activation' => :'cp_activation', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'cp_activation' => :'SecurityMonitoringContentPackActivation', + :'type' => :'SecurityMonitoringContentPackEntityDetailsType' + } + 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::SecurityMonitoringContentPackEntityDetails` 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?(:'cp_activation') + self.cp_activation = attributes[:'cp_activation'] + 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 @cp_activation.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param cp_activation [Object] Object to be assigned + # @!visibility private + def cp_activation=(cp_activation) + if cp_activation.nil? + fail ArgumentError, 'invalid value for "cp_activation", cp_activation cannot be nil.' + end + @cp_activation = cp_activation + 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 && + cp_activation == o.cp_activation && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [cp_activation, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_content_pack_entity_details_type.rb b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_entity_details_type.rb new file mode 100644 index 000000000000..6f10f6d512a4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_entity_details_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 + # Type for entity content pack details. + class SecurityMonitoringContentPackEntityDetailsType + include BaseEnumModel + + ENTITY = "entity".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_content_pack_logs_details.rb b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_logs_details.rb new file mode 100644 index 000000000000..ec28b776ff31 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_logs_details.rb @@ -0,0 +1,250 @@ +=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 + # Details for a logs-based content pack. + class SecurityMonitoringContentPackLogsDetails + include BaseGenericModel + + # The activation status of a content pack. + attr_reader :cp_activation + + # Timestamp bucket indicating when logs were last collected. + attr_reader :data_last_seen + + # Whether filters (Security Filters or Index Query depending on the pricing model) are + # present and correctly configured to route logs into Cloud SIEM. + attr_reader :filters_configured + + # The installation status of the related integration. + attr_reader :integration_installed_status + + # Whether logs for this content pack have been seen in any Datadog index in the last 72 hours. + attr_reader :logs_seen_from_any_index + + # Whether the Cloud SIEM index configuration is incorrect (only applies to certain pricing models). + attr_reader :siem_index_incorrect + + # The filtered data type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'cp_activation' => :'cp_activation', + :'data_last_seen' => :'data_last_seen', + :'filters_configured' => :'filters_configured', + :'integration_installed_status' => :'integration_installed_status', + :'logs_seen_from_any_index' => :'logs_seen_from_any_index', + :'siem_index_incorrect' => :'siem_index_incorrect', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'cp_activation' => :'SecurityMonitoringContentPackActivation', + :'data_last_seen' => :'SecurityMonitoringContentPackTimestampBucket', + :'filters_configured' => :'Boolean', + :'integration_installed_status' => :'SecurityMonitoringContentPackIntegrationStatus', + :'logs_seen_from_any_index' => :'Boolean', + :'siem_index_incorrect' => :'Boolean', + :'type' => :'SecurityFilterFilteredDataType' + } + 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::SecurityMonitoringContentPackLogsDetails` 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?(:'cp_activation') + self.cp_activation = attributes[:'cp_activation'] + end + + if attributes.key?(:'data_last_seen') + self.data_last_seen = attributes[:'data_last_seen'] + end + + if attributes.key?(:'filters_configured') + self.filters_configured = attributes[:'filters_configured'] + end + + if attributes.key?(:'integration_installed_status') + self.integration_installed_status = attributes[:'integration_installed_status'] + end + + if attributes.key?(:'logs_seen_from_any_index') + self.logs_seen_from_any_index = attributes[:'logs_seen_from_any_index'] + end + + if attributes.key?(:'siem_index_incorrect') + self.siem_index_incorrect = attributes[:'siem_index_incorrect'] + 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 @cp_activation.nil? + return false if @data_last_seen.nil? + return false if @filters_configured.nil? + return false if @integration_installed_status.nil? + return false if @logs_seen_from_any_index.nil? + return false if @siem_index_incorrect.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param cp_activation [Object] Object to be assigned + # @!visibility private + def cp_activation=(cp_activation) + if cp_activation.nil? + fail ArgumentError, 'invalid value for "cp_activation", cp_activation cannot be nil.' + end + @cp_activation = cp_activation + end + + # Custom attribute writer method with validation + # @param data_last_seen [Object] Object to be assigned + # @!visibility private + def data_last_seen=(data_last_seen) + if data_last_seen.nil? + fail ArgumentError, 'invalid value for "data_last_seen", data_last_seen cannot be nil.' + end + @data_last_seen = data_last_seen + end + + # Custom attribute writer method with validation + # @param filters_configured [Object] Object to be assigned + # @!visibility private + def filters_configured=(filters_configured) + if filters_configured.nil? + fail ArgumentError, 'invalid value for "filters_configured", filters_configured cannot be nil.' + end + @filters_configured = filters_configured + end + + # Custom attribute writer method with validation + # @param integration_installed_status [Object] Object to be assigned + # @!visibility private + def integration_installed_status=(integration_installed_status) + if integration_installed_status.nil? + fail ArgumentError, 'invalid value for "integration_installed_status", integration_installed_status cannot be nil.' + end + @integration_installed_status = integration_installed_status + end + + # Custom attribute writer method with validation + # @param logs_seen_from_any_index [Object] Object to be assigned + # @!visibility private + def logs_seen_from_any_index=(logs_seen_from_any_index) + if logs_seen_from_any_index.nil? + fail ArgumentError, 'invalid value for "logs_seen_from_any_index", logs_seen_from_any_index cannot be nil.' + end + @logs_seen_from_any_index = logs_seen_from_any_index + end + + # Custom attribute writer method with validation + # @param siem_index_incorrect [Object] Object to be assigned + # @!visibility private + def siem_index_incorrect=(siem_index_incorrect) + if siem_index_incorrect.nil? + fail ArgumentError, 'invalid value for "siem_index_incorrect", siem_index_incorrect cannot be nil.' + end + @siem_index_incorrect = siem_index_incorrect + 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 && + cp_activation == o.cp_activation && + data_last_seen == o.data_last_seen && + filters_configured == o.filters_configured && + integration_installed_status == o.integration_installed_status && + logs_seen_from_any_index == o.logs_seen_from_any_index && + siem_index_incorrect == o.siem_index_incorrect && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [cp_activation, data_last_seen, filters_configured, integration_installed_status, logs_seen_from_any_index, siem_index_incorrect, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_content_pack_onboarding_details.rb b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_onboarding_details.rb new file mode 100644 index 000000000000..51350aae54dd --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_onboarding_details.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 + # Content pack details returned when Cloud SIEM is inactive for the requesting organization. + class SecurityMonitoringContentPackOnboardingDetails + include BaseGenericModel + + # The installation status of the related integration. + attr_accessor :integration_installed_status + + # Whether logs for this content pack have been seen in any Datadog index in the last 72 hours. + attr_reader :logs_seen_from_any_index + + # Type for onboarding content pack details. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'integration_installed_status' => :'integration_installed_status', + :'logs_seen_from_any_index' => :'logs_seen_from_any_index', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'integration_installed_status' => :'SecurityMonitoringContentPackIntegrationStatus', + :'logs_seen_from_any_index' => :'Boolean', + :'type' => :'SecurityMonitoringContentPackOnboardingDetailsType' + } + 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::SecurityMonitoringContentPackOnboardingDetails` 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?(:'integration_installed_status') + self.integration_installed_status = attributes[:'integration_installed_status'] + end + + if attributes.key?(:'logs_seen_from_any_index') + self.logs_seen_from_any_index = attributes[:'logs_seen_from_any_index'] + 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 @logs_seen_from_any_index.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param logs_seen_from_any_index [Object] Object to be assigned + # @!visibility private + def logs_seen_from_any_index=(logs_seen_from_any_index) + if logs_seen_from_any_index.nil? + fail ArgumentError, 'invalid value for "logs_seen_from_any_index", logs_seen_from_any_index cannot be nil.' + end + @logs_seen_from_any_index = logs_seen_from_any_index + 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 && + integration_installed_status == o.integration_installed_status && + logs_seen_from_any_index == o.logs_seen_from_any_index && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [integration_installed_status, logs_seen_from_any_index, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_content_pack_onboarding_details_type.rb b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_onboarding_details_type.rb new file mode 100644 index 000000000000..4dc0631c9d31 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_onboarding_details_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 + # Type for onboarding content pack details. + class SecurityMonitoringContentPackOnboardingDetailsType + include BaseEnumModel + + ONBOARDING = "onboarding".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_content_pack_state_attributes.rb b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_state_attributes.rb index 64823c4c400e..cd8156db0dac 100644 --- a/lib/datadog_api_client/v2/models/security_monitoring_content_pack_state_attributes.rb +++ b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_state_attributes.rb @@ -17,31 +17,16 @@ require 'time' module DatadogAPIClient::V2 - # Attributes of a content pack state + # Attributes of a content pack state. class SecurityMonitoringContentPackStateAttributes include BaseGenericModel - # Whether the cloud SIEM index configuration is incorrect (only applies to certain pricing models) - attr_reader :cloud_siem_index_incorrect - - # The activation status of a content pack. - attr_reader :cp_activation - - # Whether filters (Security Filters or Index Query depending on the pricing model) are - # present and correctly configured to route logs into Cloud SIEM. - attr_reader :filters_configured_for_logs - - # The installation status of the related integration. - attr_accessor :integration_installed_status - - # Timestamp bucket indicating when logs were last collected. - attr_reader :logs_last_collected - - # Whether logs for this content pack have been seen in any Datadog index within the last 72 hours. - attr_reader :logs_seen_from_any_index + # Type-specific details for a content pack state. The set of fields present depends + # on the content pack's `type`. When Cloud SIEM is inactive for the requesting organization, `onboarding` is returned instead of the content pack's usual type, such as `logs` or `vulnerability`.` + attr_reader :details # The current operational status of a content pack. - attr_reader :state + attr_reader :status attr_accessor :additional_properties @@ -49,13 +34,8 @@ class SecurityMonitoringContentPackStateAttributes # @!visibility private def self.attribute_map { - :'cloud_siem_index_incorrect' => :'cloud_siem_index_incorrect', - :'cp_activation' => :'cp_activation', - :'filters_configured_for_logs' => :'filters_configured_for_logs', - :'integration_installed_status' => :'integration_installed_status', - :'logs_last_collected' => :'logs_last_collected', - :'logs_seen_from_any_index' => :'logs_seen_from_any_index', - :'state' => :'state' + :'details' => :'details', + :'status' => :'status' } end @@ -63,13 +43,8 @@ def self.attribute_map # @!visibility private def self.openapi_types { - :'cloud_siem_index_incorrect' => :'Boolean', - :'cp_activation' => :'SecurityMonitoringContentPackActivation', - :'filters_configured_for_logs' => :'Boolean', - :'integration_installed_status' => :'SecurityMonitoringContentPackIntegrationStatus', - :'logs_last_collected' => :'SecurityMonitoringContentPackTimestampBucket', - :'logs_seen_from_any_index' => :'Boolean', - :'state' => :'SecurityMonitoringContentPackStatus' + :'details' => :'SecurityMonitoringContentPackStateDetails', + :'status' => :'SecurityMonitoringContentPackStatus' } end @@ -91,32 +66,12 @@ def initialize(attributes = {}) end } - if attributes.key?(:'cloud_siem_index_incorrect') - self.cloud_siem_index_incorrect = attributes[:'cloud_siem_index_incorrect'] - end - - if attributes.key?(:'cp_activation') - self.cp_activation = attributes[:'cp_activation'] - end - - if attributes.key?(:'filters_configured_for_logs') - self.filters_configured_for_logs = attributes[:'filters_configured_for_logs'] + if attributes.key?(:'details') + self.details = attributes[:'details'] end - if attributes.key?(:'integration_installed_status') - self.integration_installed_status = attributes[:'integration_installed_status'] - end - - if attributes.key?(:'logs_last_collected') - self.logs_last_collected = attributes[:'logs_last_collected'] - end - - if attributes.key?(:'logs_seen_from_any_index') - self.logs_seen_from_any_index = attributes[:'logs_seen_from_any_index'] - end - - if attributes.key?(:'state') - self.state = attributes[:'state'] + if attributes.key?(:'status') + self.status = attributes[:'status'] end end @@ -124,73 +79,29 @@ def initialize(attributes = {}) # @return true if the model is valid # @!visibility private def valid? - return false if @cloud_siem_index_incorrect.nil? - return false if @cp_activation.nil? - return false if @filters_configured_for_logs.nil? - return false if @logs_last_collected.nil? - return false if @logs_seen_from_any_index.nil? - return false if @state.nil? + return false if @details.nil? + return false if @status.nil? true end # Custom attribute writer method with validation - # @param cloud_siem_index_incorrect [Object] Object to be assigned - # @!visibility private - def cloud_siem_index_incorrect=(cloud_siem_index_incorrect) - if cloud_siem_index_incorrect.nil? - fail ArgumentError, 'invalid value for "cloud_siem_index_incorrect", cloud_siem_index_incorrect cannot be nil.' - end - @cloud_siem_index_incorrect = cloud_siem_index_incorrect - end - - # Custom attribute writer method with validation - # @param cp_activation [Object] Object to be assigned - # @!visibility private - def cp_activation=(cp_activation) - if cp_activation.nil? - fail ArgumentError, 'invalid value for "cp_activation", cp_activation cannot be nil.' - end - @cp_activation = cp_activation - end - - # Custom attribute writer method with validation - # @param filters_configured_for_logs [Object] Object to be assigned - # @!visibility private - def filters_configured_for_logs=(filters_configured_for_logs) - if filters_configured_for_logs.nil? - fail ArgumentError, 'invalid value for "filters_configured_for_logs", filters_configured_for_logs cannot be nil.' - end - @filters_configured_for_logs = filters_configured_for_logs - end - - # Custom attribute writer method with validation - # @param logs_last_collected [Object] Object to be assigned - # @!visibility private - def logs_last_collected=(logs_last_collected) - if logs_last_collected.nil? - fail ArgumentError, 'invalid value for "logs_last_collected", logs_last_collected cannot be nil.' - end - @logs_last_collected = logs_last_collected - end - - # Custom attribute writer method with validation - # @param logs_seen_from_any_index [Object] Object to be assigned + # @param details [Object] Object to be assigned # @!visibility private - def logs_seen_from_any_index=(logs_seen_from_any_index) - if logs_seen_from_any_index.nil? - fail ArgumentError, 'invalid value for "logs_seen_from_any_index", logs_seen_from_any_index cannot be nil.' + def details=(details) + if details.nil? + fail ArgumentError, 'invalid value for "details", details cannot be nil.' end - @logs_seen_from_any_index = logs_seen_from_any_index + @details = details end # Custom attribute writer method with validation - # @param state [Object] Object to be assigned + # @param status [Object] Object to be assigned # @!visibility private - def state=(state) - if state.nil? - fail ArgumentError, 'invalid value for "state", state cannot be nil.' + def status=(status) + if status.nil? + fail ArgumentError, 'invalid value for "status", status cannot be nil.' end - @state = state + @status = status end # Returns the object in the form of hash, with additionalProperties support. @@ -219,13 +130,8 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && - cloud_siem_index_incorrect == o.cloud_siem_index_incorrect && - cp_activation == o.cp_activation && - filters_configured_for_logs == o.filters_configured_for_logs && - integration_installed_status == o.integration_installed_status && - logs_last_collected == o.logs_last_collected && - logs_seen_from_any_index == o.logs_seen_from_any_index && - state == o.state && + details == o.details && + status == o.status && additional_properties == o.additional_properties end @@ -233,7 +139,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [cloud_siem_index_incorrect, cp_activation, filters_configured_for_logs, integration_installed_status, logs_last_collected, logs_seen_from_any_index, state, additional_properties].hash + [details, status, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_content_pack_state_data.rb b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_state_data.rb index 36bb41a9dae6..e1d65d24e3ab 100644 --- a/lib/datadog_api_client/v2/models/security_monitoring_content_pack_state_data.rb +++ b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_state_data.rb @@ -21,7 +21,7 @@ module DatadogAPIClient::V2 class SecurityMonitoringContentPackStateData include BaseGenericModel - # Attributes of a content pack state + # Attributes of a content pack state. attr_reader :attributes # The content pack identifier. diff --git a/lib/datadog_api_client/v2/models/security_monitoring_content_pack_state_details.rb b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_state_details.rb new file mode 100644 index 000000000000..4a56ccb8fa8e --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_state_details.rb @@ -0,0 +1,53 @@ +=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 + # Type-specific details for a content pack state. The set of fields present depends + # on the content pack's `type`. When Cloud SIEM is inactive for the requesting organization, `onboarding` is returned instead of the content pack's usual type, such as `logs` or `vulnerability`.` + module SecurityMonitoringContentPackStateDetails + class << self + include BaseOneOfModel + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'SecurityMonitoringContentPackLogsDetails', + :'SecurityMonitoringContentPackThreatIntelDetails', + :'SecurityMonitoringContentPackEntityDetails', + :'SecurityMonitoringContentPackAuditDetails', + :'SecurityMonitoringContentPackAppSecDetails', + :'SecurityMonitoringContentPackVulnerabilityDetails', + :'SecurityMonitoringContentPackOnboardingDetails' + ] + end + # Discriminator's property name (OpenAPI v3) + def openapi_discriminator_name + :'type' + end + + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + discriminator_value = data[openapi_discriminator_name] + return nil unless discriminator_value + + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_content_pack_state_meta.rb b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_state_meta.rb index 3226d4abf407..998a2ed7c094 100644 --- a/lib/datadog_api_client/v2/models/security_monitoring_content_pack_state_meta.rb +++ b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_state_meta.rb @@ -17,13 +17,16 @@ require 'time' module DatadogAPIClient::V2 - # Metadata for content pack states + # Metadata for content pack states. class SecurityMonitoringContentPackStateMeta include BaseGenericModel - # Whether the cloud SIEM index configuration is incorrect at the organization level + # Whether the Cloud SIEM index configuration is incorrect for the organization. attr_reader :cloud_siem_index_incorrect + # The number of months that standard logs are retained for organizations on the standalone_indexed` pricing model. This field is omitted for other pricing models. + attr_reader :retention_months + # The Cloud SIEM pricing model (SKU) for the organization. attr_reader :sku @@ -34,6 +37,7 @@ class SecurityMonitoringContentPackStateMeta def self.attribute_map { :'cloud_siem_index_incorrect' => :'cloud_siem_index_incorrect', + :'retention_months' => :'retention_months', :'sku' => :'sku' } end @@ -43,6 +47,7 @@ def self.attribute_map def self.openapi_types { :'cloud_siem_index_incorrect' => :'Boolean', + :'retention_months' => :'Integer', :'sku' => :'SecurityMonitoringSKU' } end @@ -69,6 +74,10 @@ def initialize(attributes = {}) self.cloud_siem_index_incorrect = attributes[:'cloud_siem_index_incorrect'] end + if attributes.key?(:'retention_months') + self.retention_months = attributes[:'retention_months'] + end + if attributes.key?(:'sku') self.sku = attributes[:'sku'] end @@ -79,6 +88,7 @@ def initialize(attributes = {}) # @!visibility private def valid? return false if @cloud_siem_index_incorrect.nil? + return false if !@retention_months.nil? && @retention_months > 60 return false if @sku.nil? true end @@ -93,6 +103,16 @@ def cloud_siem_index_incorrect=(cloud_siem_index_incorrect) @cloud_siem_index_incorrect = cloud_siem_index_incorrect end + # Custom attribute writer method with validation + # @param retention_months [Object] Object to be assigned + # @!visibility private + def retention_months=(retention_months) + if !retention_months.nil? && retention_months > 60 + fail ArgumentError, 'invalid value for "retention_months", must be smaller than or equal to 60.' + end + @retention_months = retention_months + end + # Custom attribute writer method with validation # @param sku [Object] Object to be assigned # @!visibility private @@ -130,6 +150,7 @@ def ==(o) return true if self.equal?(o) self.class == o.class && cloud_siem_index_incorrect == o.cloud_siem_index_incorrect && + retention_months == o.retention_months && sku == o.sku && additional_properties == o.additional_properties end @@ -138,7 +159,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [cloud_siem_index_incorrect, sku, additional_properties].hash + [cloud_siem_index_incorrect, retention_months, sku, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_content_pack_states_response.rb b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_states_response.rb index 574b50fb77eb..dd57c126f143 100644 --- a/lib/datadog_api_client/v2/models/security_monitoring_content_pack_states_response.rb +++ b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_states_response.rb @@ -24,7 +24,7 @@ class SecurityMonitoringContentPackStatesResponse # Array of content pack states. attr_reader :data - # Metadata for content pack states + # Metadata for content pack states. attr_reader :meta attr_accessor :additional_properties diff --git a/lib/datadog_api_client/v2/models/security_monitoring_content_pack_status.rb b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_status.rb index f80eda147e13..7e09eef6477a 100644 --- a/lib/datadog_api_client/v2/models/security_monitoring_content_pack_status.rb +++ b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_status.rb @@ -27,5 +27,6 @@ class SecurityMonitoringContentPackStatus ACTIVE = "active".freeze WARNING = "warning".freeze BROKEN = "broken".freeze + NOT_CONFIGURED = "not_configured".freeze end end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_content_pack_threat_intel_details.rb b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_threat_intel_details.rb new file mode 100644 index 000000000000..9f5eb4d3288b --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_threat_intel_details.rb @@ -0,0 +1,186 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Details for a threat intelligence content pack. + class SecurityMonitoringContentPackThreatIntelDetails + include BaseGenericModel + + # The activation status of a content pack. + attr_reader :cp_activation + + # Timestamp bucket indicating when logs were last collected. + attr_reader :data_last_seen + + # The installation status of the related integration. + attr_reader :integration_installed_status + + # Type for threat intelligence content pack details. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'cp_activation' => :'cp_activation', + :'data_last_seen' => :'data_last_seen', + :'integration_installed_status' => :'integration_installed_status', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'cp_activation' => :'SecurityMonitoringContentPackActivation', + :'data_last_seen' => :'SecurityMonitoringContentPackTimestampBucket', + :'integration_installed_status' => :'SecurityMonitoringContentPackIntegrationStatus', + :'type' => :'SecurityMonitoringContentPackThreatIntelDetailsType' + } + 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::SecurityMonitoringContentPackThreatIntelDetails` 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?(:'cp_activation') + self.cp_activation = attributes[:'cp_activation'] + end + + if attributes.key?(:'data_last_seen') + self.data_last_seen = attributes[:'data_last_seen'] + end + + if attributes.key?(:'integration_installed_status') + self.integration_installed_status = attributes[:'integration_installed_status'] + 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 @cp_activation.nil? + return false if @data_last_seen.nil? + return false if @integration_installed_status.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param cp_activation [Object] Object to be assigned + # @!visibility private + def cp_activation=(cp_activation) + if cp_activation.nil? + fail ArgumentError, 'invalid value for "cp_activation", cp_activation cannot be nil.' + end + @cp_activation = cp_activation + end + + # Custom attribute writer method with validation + # @param data_last_seen [Object] Object to be assigned + # @!visibility private + def data_last_seen=(data_last_seen) + if data_last_seen.nil? + fail ArgumentError, 'invalid value for "data_last_seen", data_last_seen cannot be nil.' + end + @data_last_seen = data_last_seen + end + + # Custom attribute writer method with validation + # @param integration_installed_status [Object] Object to be assigned + # @!visibility private + def integration_installed_status=(integration_installed_status) + if integration_installed_status.nil? + fail ArgumentError, 'invalid value for "integration_installed_status", integration_installed_status cannot be nil.' + end + @integration_installed_status = integration_installed_status + 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 && + cp_activation == o.cp_activation && + data_last_seen == o.data_last_seen && + integration_installed_status == o.integration_installed_status && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [cp_activation, data_last_seen, integration_installed_status, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_content_pack_threat_intel_details_type.rb b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_threat_intel_details_type.rb new file mode 100644 index 000000000000..7babea9ab54d --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_threat_intel_details_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 + # Type for threat intelligence content pack details. + class SecurityMonitoringContentPackThreatIntelDetailsType + include BaseEnumModel + + THREAT_INTEL = "threat_intel".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_content_pack_vulnerability_details.rb b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_vulnerability_details.rb new file mode 100644 index 000000000000..04798df9ec3a --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_vulnerability_details.rb @@ -0,0 +1,186 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Details for a vulnerability content pack. + class SecurityMonitoringContentPackVulnerabilityDetails + include BaseGenericModel + + # The activation status of a content pack. + attr_reader :cp_activation + + # Timestamp bucket indicating when logs were last collected. + attr_reader :data_last_seen + + # The installation status of the related integration. + attr_reader :integration_installed_status + + # Type for vulnerability content pack details. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'cp_activation' => :'cp_activation', + :'data_last_seen' => :'data_last_seen', + :'integration_installed_status' => :'integration_installed_status', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'cp_activation' => :'SecurityMonitoringContentPackActivation', + :'data_last_seen' => :'SecurityMonitoringContentPackTimestampBucket', + :'integration_installed_status' => :'SecurityMonitoringContentPackIntegrationStatus', + :'type' => :'SecurityMonitoringContentPackVulnerabilityDetailsType' + } + 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::SecurityMonitoringContentPackVulnerabilityDetails` 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?(:'cp_activation') + self.cp_activation = attributes[:'cp_activation'] + end + + if attributes.key?(:'data_last_seen') + self.data_last_seen = attributes[:'data_last_seen'] + end + + if attributes.key?(:'integration_installed_status') + self.integration_installed_status = attributes[:'integration_installed_status'] + 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 @cp_activation.nil? + return false if @data_last_seen.nil? + return false if @integration_installed_status.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param cp_activation [Object] Object to be assigned + # @!visibility private + def cp_activation=(cp_activation) + if cp_activation.nil? + fail ArgumentError, 'invalid value for "cp_activation", cp_activation cannot be nil.' + end + @cp_activation = cp_activation + end + + # Custom attribute writer method with validation + # @param data_last_seen [Object] Object to be assigned + # @!visibility private + def data_last_seen=(data_last_seen) + if data_last_seen.nil? + fail ArgumentError, 'invalid value for "data_last_seen", data_last_seen cannot be nil.' + end + @data_last_seen = data_last_seen + end + + # Custom attribute writer method with validation + # @param integration_installed_status [Object] Object to be assigned + # @!visibility private + def integration_installed_status=(integration_installed_status) + if integration_installed_status.nil? + fail ArgumentError, 'invalid value for "integration_installed_status", integration_installed_status cannot be nil.' + end + @integration_installed_status = integration_installed_status + 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 && + cp_activation == o.cp_activation && + data_last_seen == o.data_last_seen && + integration_installed_status == o.integration_installed_status && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [cp_activation, data_last_seen, integration_installed_status, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_content_pack_vulnerability_details_type.rb b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_vulnerability_details_type.rb new file mode 100644 index 000000000000..0c3036cba285 --- /dev/null +++ b/lib/datadog_api_client/v2/models/security_monitoring_content_pack_vulnerability_details_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 + # Type for vulnerability content pack details. + class SecurityMonitoringContentPackVulnerabilityDetailsType + include BaseEnumModel + + VULNERABILITY = "vulnerability".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/security_monitoring_sku.rb b/lib/datadog_api_client/v2/models/security_monitoring_sku.rb index 69cec58f7bf3..24df832516bf 100644 --- a/lib/datadog_api_client/v2/models/security_monitoring_sku.rb +++ b/lib/datadog_api_client/v2/models/security_monitoring_sku.rb @@ -24,5 +24,7 @@ class SecurityMonitoringSKU PER_GB_ANALYZED = "per_gb_analyzed".freeze PER_EVENT_IN_SIEM_INDEX_2023 = "per_event_in_siem_index_2023".freeze ADD_ON_2024 = "add_on_2024".freeze + STANDALONE_INDEXED = "standalone_indexed".freeze + UNKNOWN = "unknown".freeze end end From 724b6d551ea669dd7fb33b145aed08c538513a01 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Fri, 24 Jul 2026 13:35:19 +0000 Subject: [PATCH 2/5] Regenerate client from commit 8b20d0c of spec repo (#3599) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 1 + lib/datadog_api_client/v2/api/metrics_api.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index b507264fb29c..a5a262d73892 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -159382,6 +159382,7 @@ paths: description: |- Atomically re-sequence the tag indexing rules for an org to match the supplied list of rule UUIDs. The server assigns `rule_order` 1, 2, … matching each rule UUID by position in the list. + The UUIDs of all active rules must be provided; omitting any active rule UUID returns a 400 error. Requires the `Manage Tags for Metrics` permission. operationId: ReorderTagIndexingRules requestBody: diff --git a/lib/datadog_api_client/v2/api/metrics_api.rb b/lib/datadog_api_client/v2/api/metrics_api.rb index 66e31fe52616..bfed3be17776 100644 --- a/lib/datadog_api_client/v2/api/metrics_api.rb +++ b/lib/datadog_api_client/v2/api/metrics_api.rb @@ -1692,6 +1692,7 @@ def reorder_tag_indexing_rules(body, opts = {}) # # Atomically re-sequence the tag indexing rules for an org to match the supplied list of rule UUIDs. # The server assigns `rule_order` 1, 2, … matching each rule UUID by position in the list. + # The UUIDs of all active rules must be provided; omitting any active rule UUID returns a 400 error. # Requires the `Manage Tags for Metrics` permission. # # @param body [TagIndexingRuleOrderRequest] From aeccebc37f87a4e5c41fa54fea81c71dec0baea7 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Fri, 24 Jul 2026 14:46:47 +0000 Subject: [PATCH 3/5] Regenerate client from commit 9de14f7 of spec repo (#3598) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 274 +++++++++++++++--- .../CreateIncidentPostmortemTemplate.rb | 23 +- .../DeleteIncidentPostmortemTemplate.rb | 2 +- .../GetIncidentPostmortemTemplate.rb | 2 +- .../UpdateIncidentPostmortemTemplate.rb | 25 +- features/scenarios_model_mapping.rb | 4 + features/v2/incidents.feature | 10 +- features/v2/undo.json | 2 +- lib/datadog_api_client/inflector.rb | 9 + .../v2/api/incidents_api.rb | 10 +- .../models/confluence_postmortem_settings.rb | 162 +++++++++++ .../models/google_docs_postmortem_settings.rb | 144 +++++++++ .../postmortem_template_attributes_request.rb | 62 +++- ...postmortem_template_attributes_response.rb | 88 +++++- ...ostmortem_template_create_relationships.rb | 105 +++++++ .../postmortem_template_data_request.rb | 24 +- .../postmortem_template_data_response.rb | 16 +- ...tem_template_incident_type_relationship.rb | 123 ++++++++ ...emplate_incident_type_relationship_data.rb | 144 +++++++++ .../v2/models/postmortem_template_location.rb | 28 ++ ...tmortem_template_response_relationships.rb | 115 ++++++++ .../v2/models/postmortem_template_type.rb | 3 +- .../postmortem_template_user_relationship.rb | 123 ++++++++ ...tmortem_template_user_relationship_data.rb | 144 +++++++++ 24 files changed, 1581 insertions(+), 61 deletions(-) create mode 100644 lib/datadog_api_client/v2/models/confluence_postmortem_settings.rb create mode 100644 lib/datadog_api_client/v2/models/google_docs_postmortem_settings.rb create mode 100644 lib/datadog_api_client/v2/models/postmortem_template_create_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/postmortem_template_incident_type_relationship.rb create mode 100644 lib/datadog_api_client/v2/models/postmortem_template_incident_type_relationship_data.rb create mode 100644 lib/datadog_api_client/v2/models/postmortem_template_location.rb create mode 100644 lib/datadog_api_client/v2/models/postmortem_template_response_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/postmortem_template_user_relationship.rb create mode 100644 lib/datadog_api_client/v2/models/postmortem_template_user_relationship_data.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index a5a262d73892..203a2ac6cdfc 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1448,6 +1448,31 @@ components: required: false schema: $ref: "#/components/schemas/OrgGroupPolicySortOption" + PostmortemTemplateFilterIncidentTypeParameter: + description: Filter postmortem templates by the associated incident type ID. + in: query + name: filter[incident-type] + required: false + schema: + format: uuid + type: string + PostmortemTemplateIdParameter: + description: The ID of the postmortem template. + example: 00000000-0000-0000-0000-000000000000 + in: path + name: template_id + required: true + schema: + type: string + PostmortemTemplateSortParameter: + description: The attribute to sort results by. Prefix with `-` for descending order. + in: query + name: sort + required: false + schema: + default: created_at + example: "-created_at" + type: string ProductName: description: Name of the product to be deleted, either `logs` or `rum`. in: path @@ -20811,6 +20836,26 @@ components: type: string x-enum-varnames: - SCHEDULE_TARGET + ConfluencePostmortemSettings: + description: Settings for a postmortem template stored in Confluence. Required when `location` is `confluence`. + properties: + account_id: + description: The ID of the Confluence integration account. + example: "123456" + type: string + parent_id: + description: The ID of the parent Confluence page under which postmortems are created. + example: "345678" + nullable: true + type: string + space_id: + description: The ID of the Confluence space where postmortems are created. + example: "789012" + type: string + required: + - account_id + - space_id + type: object ConfluentAccountCreateRequest: description: Payload schema when adding a Confluent account. properties: @@ -43223,6 +43268,21 @@ components: required: - attributes type: object + GoogleDocsPostmortemSettings: + description: Settings for a postmortem template stored in Google Docs. Required when `location` is `google_docs`. + properties: + account_id: + description: The ID of the Google Drive integration account. + example: "123456" + type: string + parent_folder_id: + description: The ID of the Google Drive folder where postmortems are created. + example: "789012" + type: string + required: + - account_id + - parent_folder_id + type: object GoogleMeetConfigurationReference: description: A reference to a Google Meet Configuration resource. nullable: true @@ -77278,8 +77338,24 @@ components: PostmortemTemplateAttributesRequest: description: Attributes for creating or updating a postmortem template. properties: + confluence_postmortem_settings: + $ref: "#/components/schemas/ConfluencePostmortemSettings" + content: + description: The templated content of the postmortem, supporting Markdown and incident template variables. + example: "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items" + type: string + google_docs_postmortem_settings: + $ref: "#/components/schemas/GoogleDocsPostmortemSettings" + is_default: + description: When set, marks this template as a default. The effective default for an incident type is the template with the most recent `is_default` timestamp. Set to `null` to unset. + example: "2024-01-01T00:00:00+00:00" + format: date-time + nullable: true + type: string + location: + $ref: "#/components/schemas/PostmortemTemplateLocation" name: - description: The name of the template + description: The name of the template. example: "Standard Postmortem Template" type: string required: @@ -77288,30 +77364,61 @@ components: PostmortemTemplateAttributesResponse: description: Attributes of a postmortem template returned in a response. properties: + confluence_postmortem_settings: + $ref: "#/components/schemas/ConfluencePostmortemSettings" + content: + description: The templated content of the postmortem, supporting Markdown and incident template variables. + example: "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items" + type: string createdAt: - description: When the template was created + description: When the template was created. example: "2026-01-13T17:15:53.208340Z" format: date-time type: string + google_docs_postmortem_settings: + $ref: "#/components/schemas/GoogleDocsPostmortemSettings" + is_default: + description: When set, marks this template as a default. The effective default for an incident type is the template with the most recent `is_default` timestamp. + example: "2024-01-01T00:00:00+00:00" + format: date-time + nullable: true + type: string + location: + $ref: "#/components/schemas/PostmortemTemplateLocation" modifiedAt: - description: When the template was last modified + description: When the template was last modified. example: "2026-01-13T17:15:53.208340Z" format: date-time type: string name: - description: The name of the template + description: The name of the template. example: "Standard Postmortem Template" type: string required: - name + - content + - is_default + - location - createdAt - modifiedAt type: object + PostmortemTemplateCreateRelationships: + description: Relationships for a postmortem template. `incident_type` is required when creating a template and is immutable afterwards. + properties: + incident_type: + $ref: "#/components/schemas/PostmortemTemplateIncidentTypeRelationship" + type: object PostmortemTemplateDataRequest: description: Data object for creating or updating a postmortem template. properties: attributes: $ref: "#/components/schemas/PostmortemTemplateAttributesRequest" + id: + description: The ID of the template. Required when updating. + example: 00000000-0000-0000-0000-000000000000 + type: string + relationships: + $ref: "#/components/schemas/PostmortemTemplateCreateRelationships" type: $ref: "#/components/schemas/PostmortemTemplateType" required: @@ -77324,9 +77431,11 @@ components: attributes: $ref: "#/components/schemas/PostmortemTemplateAttributesResponse" id: - description: The ID of the template - example: "template-456" + description: The ID of the template. + example: 00000000-0000-0000-0000-000000000000 type: string + relationships: + $ref: "#/components/schemas/PostmortemTemplateResponseRelationships" type: $ref: "#/components/schemas/PostmortemTemplateType" required: @@ -77334,6 +77443,43 @@ components: - type - attributes type: object + PostmortemTemplateIncidentTypeRelationship: + description: Relationship to the incident type this template belongs to. + properties: + data: + $ref: "#/components/schemas/PostmortemTemplateIncidentTypeRelationshipData" + required: + - data + type: object + PostmortemTemplateIncidentTypeRelationshipData: + description: Incident type relationship data. + properties: + id: + description: The incident type identifier. + example: 00000000-0000-0000-0000-000000000009 + format: uuid + type: string + type: + description: The incident type resource type. + example: incident_types + type: string + required: + - id + - type + type: object + PostmortemTemplateLocation: + default: datadog_notebooks + description: The location where the postmortem is created and stored. + enum: + - datadog_notebooks + - confluence + - google_docs + example: datadog_notebooks + type: string + x-enum-varnames: + - DATADOG_NOTEBOOKS + - CONFLUENCE + - GOOGLE_DOCS PostmortemTemplateRequest: description: Request body for creating or updating a postmortem template. properties: @@ -77350,14 +77496,48 @@ components: required: - data type: object + PostmortemTemplateResponseRelationships: + description: Relationships of a postmortem template returned in a response. + properties: + incident_type: + $ref: "#/components/schemas/PostmortemTemplateIncidentTypeRelationship" + last_modified_by_user: + $ref: "#/components/schemas/PostmortemTemplateUserRelationship" + type: object PostmortemTemplateType: - description: Postmortem template resource type + description: Postmortem template resource type. enum: + - postmortem_templates - postmortem_template - example: postmortem_template + example: postmortem_templates type: string x-enum-varnames: + - POSTMORTEM_TEMPLATES - POSTMORTEM_TEMPLATE + PostmortemTemplateUserRelationship: + description: Relationship to a user. + properties: + data: + $ref: "#/components/schemas/PostmortemTemplateUserRelationshipData" + required: + - data + type: object + PostmortemTemplateUserRelationshipData: + description: User relationship data. + properties: + id: + description: The user identifier. + example: 00000000-0000-0000-0000-000000000000 + format: uuid + type: string + type: + description: The user resource type. + example: users + type: string + required: + - id + - type + type: object PostmortemTemplatesResponse: description: Response containing a list of postmortem templates. properties: @@ -142491,6 +142671,9 @@ paths: get: description: Retrieve a list of all postmortem templates for incidents. operationId: ListIncidentPostmortemTemplates + parameters: + - $ref: "#/components/parameters/PostmortemTemplateFilterIncidentTypeParameter" + - $ref: "#/components/parameters/PostmortemTemplateSortParameter" responses: "200": content: @@ -142500,11 +142683,19 @@ paths: value: data: - attributes: + content: "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items" createdAt: "2024-01-01T00:00:00+00:00" + is_default: "2024-01-01T00:00:00+00:00" + location: datadog_notebooks modifiedAt: "2024-01-01T00:00:00+00:00" name: Standard Postmortem Template id: 00000000-0000-0000-0000-000000000001 - type: postmortem_template + relationships: + incident_type: + data: + id: 00000000-0000-0000-0000-000000000009 + type: incident_types + type: postmortem_templates schema: $ref: "#/components/schemas/PostmortemTemplatesResponse" description: OK @@ -142533,8 +142724,14 @@ paths: value: data: attributes: + content: "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items" name: Standard Postmortem Template - type: postmortem_template + relationships: + incident_type: + data: + id: 00000000-0000-0000-0000-000000000009 + type: incident_types + type: postmortem_templates schema: $ref: "#/components/schemas/PostmortemTemplateRequest" required: true @@ -142547,11 +142744,19 @@ paths: value: data: attributes: + content: "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items" createdAt: "2024-01-01T00:00:00+00:00" + is_default: + location: datadog_notebooks modifiedAt: "2024-01-01T00:00:00+00:00" name: Standard Postmortem Template id: 00000000-0000-0000-0000-000000000002 - type: postmortem_template + relationships: + incident_type: + data: + id: 00000000-0000-0000-0000-000000000009 + type: incident_types + type: postmortem_templates schema: $ref: "#/components/schemas/PostmortemTemplateResponse" description: Created @@ -142580,13 +142785,7 @@ paths: description: Delete a postmortem template. operationId: DeleteIncidentPostmortemTemplate parameters: - - description: The ID of the postmortem template - in: path - name: template_id - required: true - schema: - example: "template-456" - type: string + - $ref: "#/components/parameters/PostmortemTemplateIdParameter" responses: "204": description: No Content @@ -142614,13 +142813,7 @@ paths: description: Retrieve details of a specific postmortem template. operationId: GetIncidentPostmortemTemplate parameters: - - description: The ID of the postmortem template - in: path - name: template_id - required: true - schema: - example: "template-456" - type: string + - $ref: "#/components/parameters/PostmortemTemplateIdParameter" responses: "200": content: @@ -142630,11 +142823,19 @@ paths: value: data: attributes: + content: "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items" createdAt: "2024-01-01T00:00:00+00:00" + is_default: + location: datadog_notebooks modifiedAt: "2024-01-01T00:00:00+00:00" name: Standard Postmortem Template id: 00000000-0000-0000-0000-000000000003 - type: postmortem_template + relationships: + incident_type: + data: + id: 00000000-0000-0000-0000-000000000009 + type: incident_types + type: postmortem_templates schema: $ref: "#/components/schemas/PostmortemTemplateResponse" description: OK @@ -142662,13 +142863,7 @@ paths: description: Update an existing postmortem template. operationId: UpdateIncidentPostmortemTemplate parameters: - - description: The ID of the postmortem template - in: path - name: template_id - required: true - schema: - example: "template-456" - type: string + - $ref: "#/components/parameters/PostmortemTemplateIdParameter" requestBody: content: application/json: @@ -142678,7 +142873,8 @@ paths: data: attributes: name: Standard Postmortem Template - type: postmortem_template + id: 00000000-0000-0000-0000-000000000004 + type: postmortem_templates schema: $ref: "#/components/schemas/PostmortemTemplateRequest" required: true @@ -142691,11 +142887,19 @@ paths: value: data: attributes: + content: "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items" createdAt: "2024-01-01T00:00:00+00:00" + is_default: + location: datadog_notebooks modifiedAt: "2024-01-01T00:00:00+00:00" name: Standard Postmortem Template id: 00000000-0000-0000-0000-000000000004 - type: postmortem_template + relationships: + incident_type: + data: + id: 00000000-0000-0000-0000-000000000009 + type: incident_types + type: postmortem_templates schema: $ref: "#/components/schemas/PostmortemTemplateResponse" description: OK diff --git a/examples/v2/incidents/CreateIncidentPostmortemTemplate.rb b/examples/v2/incidents/CreateIncidentPostmortemTemplate.rb index 5f83cd3c7391..78cb71c6a0e1 100644 --- a/examples/v2/incidents/CreateIncidentPostmortemTemplate.rb +++ b/examples/v2/incidents/CreateIncidentPostmortemTemplate.rb @@ -9,9 +9,30 @@ body = DatadogAPIClient::V2::PostmortemTemplateRequest.new({ data: DatadogAPIClient::V2::PostmortemTemplateDataRequest.new({ attributes: DatadogAPIClient::V2::PostmortemTemplateAttributesRequest.new({ + confluence_postmortem_settings: DatadogAPIClient::V2::ConfluencePostmortemSettings.new({ + account_id: "123456", + parent_id: "345678", + space_id: "789012", + }), + content: '# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items', + google_docs_postmortem_settings: DatadogAPIClient::V2::GoogleDocsPostmortemSettings.new({ + account_id: "123456", + parent_folder_id: "789012", + }), + is_default: "2024-01-01T00:00:00+00:00", + location: DatadogAPIClient::V2::PostmortemTemplateLocation::DATADOG_NOTEBOOKS, name: "Standard Postmortem Template", }), - type: DatadogAPIClient::V2::PostmortemTemplateType::POSTMORTEM_TEMPLATE, + id: "00000000-0000-0000-0000-000000000000", + relationships: DatadogAPIClient::V2::PostmortemTemplateCreateRelationships.new({ + incident_type: DatadogAPIClient::V2::PostmortemTemplateIncidentTypeRelationship.new({ + data: DatadogAPIClient::V2::PostmortemTemplateIncidentTypeRelationshipData.new({ + id: "00000000-0000-0000-0000-000000000009", + type: "incident_types", + }), + }), + }), + type: DatadogAPIClient::V2::PostmortemTemplateType::POSTMORTEM_TEMPLATES, }), }) p api_instance.create_incident_postmortem_template(body) diff --git a/examples/v2/incidents/DeleteIncidentPostmortemTemplate.rb b/examples/v2/incidents/DeleteIncidentPostmortemTemplate.rb index f02aba4e5db4..3949583ee70b 100644 --- a/examples/v2/incidents/DeleteIncidentPostmortemTemplate.rb +++ b/examples/v2/incidents/DeleteIncidentPostmortemTemplate.rb @@ -5,4 +5,4 @@ config.unstable_operations["v2.delete_incident_postmortem_template".to_sym] = true end api_instance = DatadogAPIClient::V2::IncidentsAPI.new -api_instance.delete_incident_postmortem_template("template-456") +api_instance.delete_incident_postmortem_template("template_id") diff --git a/examples/v2/incidents/GetIncidentPostmortemTemplate.rb b/examples/v2/incidents/GetIncidentPostmortemTemplate.rb index 502f06f0f691..820f5bfa93ef 100644 --- a/examples/v2/incidents/GetIncidentPostmortemTemplate.rb +++ b/examples/v2/incidents/GetIncidentPostmortemTemplate.rb @@ -5,4 +5,4 @@ config.unstable_operations["v2.get_incident_postmortem_template".to_sym] = true end api_instance = DatadogAPIClient::V2::IncidentsAPI.new -p api_instance.get_incident_postmortem_template("template-456") +p api_instance.get_incident_postmortem_template("template_id") diff --git a/examples/v2/incidents/UpdateIncidentPostmortemTemplate.rb b/examples/v2/incidents/UpdateIncidentPostmortemTemplate.rb index 6a721b937627..95da4c73a54d 100644 --- a/examples/v2/incidents/UpdateIncidentPostmortemTemplate.rb +++ b/examples/v2/incidents/UpdateIncidentPostmortemTemplate.rb @@ -9,9 +9,30 @@ body = DatadogAPIClient::V2::PostmortemTemplateRequest.new({ data: DatadogAPIClient::V2::PostmortemTemplateDataRequest.new({ attributes: DatadogAPIClient::V2::PostmortemTemplateAttributesRequest.new({ + confluence_postmortem_settings: DatadogAPIClient::V2::ConfluencePostmortemSettings.new({ + account_id: "123456", + parent_id: "345678", + space_id: "789012", + }), + content: '# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items', + google_docs_postmortem_settings: DatadogAPIClient::V2::GoogleDocsPostmortemSettings.new({ + account_id: "123456", + parent_folder_id: "789012", + }), + is_default: "2024-01-01T00:00:00+00:00", + location: DatadogAPIClient::V2::PostmortemTemplateLocation::DATADOG_NOTEBOOKS, name: "Standard Postmortem Template", }), - type: DatadogAPIClient::V2::PostmortemTemplateType::POSTMORTEM_TEMPLATE, + id: "00000000-0000-0000-0000-000000000000", + relationships: DatadogAPIClient::V2::PostmortemTemplateCreateRelationships.new({ + incident_type: DatadogAPIClient::V2::PostmortemTemplateIncidentTypeRelationship.new({ + data: DatadogAPIClient::V2::PostmortemTemplateIncidentTypeRelationshipData.new({ + id: "00000000-0000-0000-0000-000000000009", + type: "incident_types", + }), + }), + }), + type: DatadogAPIClient::V2::PostmortemTemplateType::POSTMORTEM_TEMPLATES, }), }) -p api_instance.update_incident_postmortem_template("template-456", body) +p api_instance.update_incident_postmortem_template("template_id", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 2baffea88083..578f92989d3e 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -3551,6 +3551,10 @@ "include" => "String", "body" => "PatchIncidentNotificationTemplateRequest", }, + "v2.ListIncidentPostmortemTemplates" => { + "filter_incident_type" => "UUID", + "sort" => "String", + }, "v2.CreateIncidentPostmortemTemplate" => { "body" => "PostmortemTemplateRequest", }, diff --git a/features/v2/incidents.feature b/features/v2/incidents.feature index 1b993a1ff299..feea0deb36c8 100644 --- a/features/v2/incidents.feature +++ b/features/v2/incidents.feature @@ -334,7 +334,7 @@ Feature: Incidents Scenario: Create postmortem template returns "Bad Request" response Given operation "CreateIncidentPostmortemTemplate" enabled And new "CreateIncidentPostmortemTemplate" request - And body with value {"data": {"attributes": {"name": "Standard Postmortem Template"}, "type": "postmortem_template"}} + And body with value {"data": {"attributes": {"confluence_postmortem_settings": {"account_id": "123456", "parent_id": "345678", "space_id": "789012"}, "content": "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items", "google_docs_postmortem_settings": {"account_id": "123456", "parent_folder_id": "789012"}, "is_default": "2024-01-01T00:00:00+00:00", "location": "datadog_notebooks", "name": "Standard Postmortem Template"}, "id": "00000000-0000-0000-0000-000000000000", "relationships": {"incident_type": {"data": {"id": "00000000-0000-0000-0000-000000000009", "type": "incident_types"}}}, "type": "postmortem_templates"}} When the request is sent Then the response status is 400 Bad Request @@ -342,7 +342,7 @@ Feature: Incidents Scenario: Create postmortem template returns "Created" response Given operation "CreateIncidentPostmortemTemplate" enabled And new "CreateIncidentPostmortemTemplate" request - And body with value {"data": {"attributes": {"name": "Standard Postmortem Template"}, "type": "postmortem_template"}} + And body with value {"data": {"attributes": {"confluence_postmortem_settings": {"account_id": "123456", "parent_id": "345678", "space_id": "789012"}, "content": "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items", "google_docs_postmortem_settings": {"account_id": "123456", "parent_folder_id": "789012"}, "is_default": "2024-01-01T00:00:00+00:00", "location": "datadog_notebooks", "name": "Standard Postmortem Template"}, "id": "00000000-0000-0000-0000-000000000000", "relationships": {"incident_type": {"data": {"id": "00000000-0000-0000-0000-000000000009", "type": "incident_types"}}}, "type": "postmortem_templates"}} When the request is sent Then the response status is 201 Created @@ -1590,7 +1590,7 @@ Feature: Incidents Given operation "UpdateIncidentPostmortemTemplate" enabled And new "UpdateIncidentPostmortemTemplate" request And request contains "template_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"name": "Standard Postmortem Template"}, "type": "postmortem_template"}} + And body with value {"data": {"attributes": {"confluence_postmortem_settings": {"account_id": "123456", "parent_id": "345678", "space_id": "789012"}, "content": "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items", "google_docs_postmortem_settings": {"account_id": "123456", "parent_folder_id": "789012"}, "is_default": "2024-01-01T00:00:00+00:00", "location": "datadog_notebooks", "name": "Standard Postmortem Template"}, "id": "00000000-0000-0000-0000-000000000000", "relationships": {"incident_type": {"data": {"id": "00000000-0000-0000-0000-000000000009", "type": "incident_types"}}}, "type": "postmortem_templates"}} When the request is sent Then the response status is 400 Bad Request @@ -1599,7 +1599,7 @@ Feature: Incidents Given operation "UpdateIncidentPostmortemTemplate" enabled And new "UpdateIncidentPostmortemTemplate" request And request contains "template_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"name": "Standard Postmortem Template"}, "type": "postmortem_template"}} + And body with value {"data": {"attributes": {"confluence_postmortem_settings": {"account_id": "123456", "parent_id": "345678", "space_id": "789012"}, "content": "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items", "google_docs_postmortem_settings": {"account_id": "123456", "parent_folder_id": "789012"}, "is_default": "2024-01-01T00:00:00+00:00", "location": "datadog_notebooks", "name": "Standard Postmortem Template"}, "id": "00000000-0000-0000-0000-000000000000", "relationships": {"incident_type": {"data": {"id": "00000000-0000-0000-0000-000000000009", "type": "incident_types"}}}, "type": "postmortem_templates"}} When the request is sent Then the response status is 404 Not Found @@ -1608,6 +1608,6 @@ Feature: Incidents Given operation "UpdateIncidentPostmortemTemplate" enabled And new "UpdateIncidentPostmortemTemplate" request And request contains "template_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"name": "Standard Postmortem Template"}, "type": "postmortem_template"}} + And body with value {"data": {"attributes": {"confluence_postmortem_settings": {"account_id": "123456", "parent_id": "345678", "space_id": "789012"}, "content": "# Overview\n\n# What Happened\n\n# Timeline\n\n# Action Items", "google_docs_postmortem_settings": {"account_id": "123456", "parent_folder_id": "789012"}, "is_default": "2024-01-01T00:00:00+00:00", "location": "datadog_notebooks", "name": "Standard Postmortem Template"}, "id": "00000000-0000-0000-0000-000000000000", "relationships": {"incident_type": {"data": {"id": "00000000-0000-0000-0000-000000000009", "type": "incident_types"}}}, "type": "postmortem_templates"}} When the request is sent Then the response status is 200 OK diff --git a/features/v2/undo.json b/features/v2/undo.json index 10ae8ac71d43..d93991ac7d73 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -3047,7 +3047,7 @@ "parameters": [ { "name": "template_id", - "source": "" + "source": "data.id" } ], "type": "unsafe" diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index c9c6d143b082..b69f176fec30 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2268,6 +2268,7 @@ def overrides "v2.configured_schedule_target_relationships" => "ConfiguredScheduleTargetRelationships", "v2.configured_schedule_target_relationships_schedule" => "ConfiguredScheduleTargetRelationshipsSchedule", "v2.configured_schedule_target_type" => "ConfiguredScheduleTargetType", + "v2.confluence_postmortem_settings" => "ConfluencePostmortemSettings", "v2.confluent_account_create_request" => "ConfluentAccountCreateRequest", "v2.confluent_account_create_request_attributes" => "ConfluentAccountCreateRequestAttributes", "v2.confluent_account_create_request_data" => "ConfluentAccountCreateRequestData", @@ -3658,6 +3659,7 @@ def overrides "v2.google_chat_update_organization_handle_request" => "GoogleChatUpdateOrganizationHandleRequest", "v2.google_chat_update_organization_handle_request_attributes" => "GoogleChatUpdateOrganizationHandleRequestAttributes", "v2.google_chat_update_organization_handle_request_data" => "GoogleChatUpdateOrganizationHandleRequestData", + "v2.google_docs_postmortem_settings" => "GoogleDocsPostmortemSettings", "v2.google_meet_configuration_reference" => "GoogleMeetConfigurationReference", "v2.google_meet_configuration_reference_data" => "GoogleMeetConfigurationReferenceData", "v2.governance_best_practice_definition" => "GovernanceBestPracticeDefinition", @@ -5775,12 +5777,19 @@ def overrides "v2.postmortem_cell_type" => "PostmortemCellType", "v2.postmortem_template_attributes_request" => "PostmortemTemplateAttributesRequest", "v2.postmortem_template_attributes_response" => "PostmortemTemplateAttributesResponse", + "v2.postmortem_template_create_relationships" => "PostmortemTemplateCreateRelationships", "v2.postmortem_template_data_request" => "PostmortemTemplateDataRequest", "v2.postmortem_template_data_response" => "PostmortemTemplateDataResponse", + "v2.postmortem_template_incident_type_relationship" => "PostmortemTemplateIncidentTypeRelationship", + "v2.postmortem_template_incident_type_relationship_data" => "PostmortemTemplateIncidentTypeRelationshipData", + "v2.postmortem_template_location" => "PostmortemTemplateLocation", "v2.postmortem_template_request" => "PostmortemTemplateRequest", "v2.postmortem_template_response" => "PostmortemTemplateResponse", + "v2.postmortem_template_response_relationships" => "PostmortemTemplateResponseRelationships", "v2.postmortem_templates_response" => "PostmortemTemplatesResponse", "v2.postmortem_template_type" => "PostmortemTemplateType", + "v2.postmortem_template_user_relationship" => "PostmortemTemplateUserRelationship", + "v2.postmortem_template_user_relationship_data" => "PostmortemTemplateUserRelationshipData", "v2.powerpack" => "Powerpack", "v2.powerpack_attributes" => "PowerpackAttributes", "v2.powerpack_data" => "PowerpackData", diff --git a/lib/datadog_api_client/v2/api/incidents_api.rb b/lib/datadog_api_client/v2/api/incidents_api.rb index 3b7917ed154a..a2c8e6dd1773 100644 --- a/lib/datadog_api_client/v2/api/incidents_api.rb +++ b/lib/datadog_api_client/v2/api/incidents_api.rb @@ -1519,7 +1519,7 @@ def delete_incident_postmortem_template(template_id, opts = {}) # # Delete a postmortem template. # - # @param template_id [String] The ID of the postmortem template + # @param template_id [String] The ID of the postmortem template. # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers def delete_incident_postmortem_template_with_http_info(template_id, opts = {}) @@ -2240,7 +2240,7 @@ def get_incident_postmortem_template(template_id, opts = {}) # # Retrieve details of a specific postmortem template. # - # @param template_id [String] The ID of the postmortem template + # @param template_id [String] The ID of the postmortem template. # @param opts [Hash] the optional parameters # @return [Array<(PostmortemTemplateResponse, Integer, Hash)>] PostmortemTemplateResponse data, response status code and response headers def get_incident_postmortem_template_with_http_info(template_id, opts = {}) @@ -3101,6 +3101,8 @@ def list_incident_postmortem_templates(opts = {}) # Retrieve a list of all postmortem templates for incidents. # # @param opts [Hash] the optional parameters + # @option opts [UUID] :filter_incident_type Filter postmortem templates by the associated incident type ID. + # @option opts [String] :sort The attribute to sort results by. Prefix with `-` for descending order. # @return [Array<(PostmortemTemplatesResponse, Integer, Hash)>] PostmortemTemplatesResponse data, response status code and response headers def list_incident_postmortem_templates_with_http_info(opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.list_incident_postmortem_templates".to_sym] @@ -3118,6 +3120,8 @@ def list_incident_postmortem_templates_with_http_info(opts = {}) # query parameters query_params = opts[:query_params] || {} + query_params[:'filter[incident-type]'] = opts[:'filter_incident_type'] if !opts[:'filter_incident_type'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} @@ -4215,7 +4219,7 @@ def update_incident_postmortem_template(template_id, body, opts = {}) # # Update an existing postmortem template. # - # @param template_id [String] The ID of the postmortem template + # @param template_id [String] The ID of the postmortem template. # @param body [PostmortemTemplateRequest] # @param opts [Hash] the optional parameters # @return [Array<(PostmortemTemplateResponse, Integer, Hash)>] PostmortemTemplateResponse data, response status code and response headers diff --git a/lib/datadog_api_client/v2/models/confluence_postmortem_settings.rb b/lib/datadog_api_client/v2/models/confluence_postmortem_settings.rb new file mode 100644 index 000000000000..e41f2f0c9e3f --- /dev/null +++ b/lib/datadog_api_client/v2/models/confluence_postmortem_settings.rb @@ -0,0 +1,162 @@ +=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 + # Settings for a postmortem template stored in Confluence. Required when `location` is `confluence`. + class ConfluencePostmortemSettings + include BaseGenericModel + + # The ID of the Confluence integration account. + attr_reader :account_id + + # The ID of the parent Confluence page under which postmortems are created. + attr_accessor :parent_id + + # The ID of the Confluence space where postmortems are created. + attr_reader :space_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'account_id' => :'account_id', + :'parent_id' => :'parent_id', + :'space_id' => :'space_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'account_id' => :'String', + :'parent_id' => :'String', + :'space_id' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'parent_id', + ]) + 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::ConfluencePostmortemSettings` 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?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'parent_id') + self.parent_id = attributes[:'parent_id'] + end + + if attributes.key?(:'space_id') + self.space_id = attributes[:'space_id'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @account_id.nil? + return false if @space_id.nil? + true + end + + # Custom attribute writer method with validation + # @param account_id [Object] Object to be assigned + # @!visibility private + def account_id=(account_id) + if account_id.nil? + fail ArgumentError, 'invalid value for "account_id", account_id cannot be nil.' + end + @account_id = account_id + end + + # Custom attribute writer method with validation + # @param space_id [Object] Object to be assigned + # @!visibility private + def space_id=(space_id) + if space_id.nil? + fail ArgumentError, 'invalid value for "space_id", space_id cannot be nil.' + end + @space_id = space_id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + account_id == o.account_id && + parent_id == o.parent_id && + space_id == o.space_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [account_id, parent_id, space_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/google_docs_postmortem_settings.rb b/lib/datadog_api_client/v2/models/google_docs_postmortem_settings.rb new file mode 100644 index 000000000000..98a9287d9483 --- /dev/null +++ b/lib/datadog_api_client/v2/models/google_docs_postmortem_settings.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 + # Settings for a postmortem template stored in Google Docs. Required when `location` is `google_docs`. + class GoogleDocsPostmortemSettings + include BaseGenericModel + + # The ID of the Google Drive integration account. + attr_reader :account_id + + # The ID of the Google Drive folder where postmortems are created. + attr_reader :parent_folder_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'account_id' => :'account_id', + :'parent_folder_id' => :'parent_folder_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'account_id' => :'String', + :'parent_folder_id' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::GoogleDocsPostmortemSettings` 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?(:'account_id') + self.account_id = attributes[:'account_id'] + end + + if attributes.key?(:'parent_folder_id') + self.parent_folder_id = attributes[:'parent_folder_id'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @account_id.nil? + return false if @parent_folder_id.nil? + true + end + + # Custom attribute writer method with validation + # @param account_id [Object] Object to be assigned + # @!visibility private + def account_id=(account_id) + if account_id.nil? + fail ArgumentError, 'invalid value for "account_id", account_id cannot be nil.' + end + @account_id = account_id + end + + # Custom attribute writer method with validation + # @param parent_folder_id [Object] Object to be assigned + # @!visibility private + def parent_folder_id=(parent_folder_id) + if parent_folder_id.nil? + fail ArgumentError, 'invalid value for "parent_folder_id", parent_folder_id cannot be nil.' + end + @parent_folder_id = parent_folder_id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + account_id == o.account_id && + parent_folder_id == o.parent_folder_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [account_id, parent_folder_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/postmortem_template_attributes_request.rb b/lib/datadog_api_client/v2/models/postmortem_template_attributes_request.rb index d41acc7685d0..4303739c2568 100644 --- a/lib/datadog_api_client/v2/models/postmortem_template_attributes_request.rb +++ b/lib/datadog_api_client/v2/models/postmortem_template_attributes_request.rb @@ -21,7 +21,22 @@ module DatadogAPIClient::V2 class PostmortemTemplateAttributesRequest include BaseGenericModel - # The name of the template + # Settings for a postmortem template stored in Confluence. Required when `location` is `confluence`. + attr_accessor :confluence_postmortem_settings + + # The templated content of the postmortem, supporting Markdown and incident template variables. + attr_accessor :content + + # Settings for a postmortem template stored in Google Docs. Required when `location` is `google_docs`. + attr_accessor :google_docs_postmortem_settings + + # When set, marks this template as a default. The effective default for an incident type is the template with the most recent `is_default` timestamp. Set to `null` to unset. + attr_accessor :is_default + + # The location where the postmortem is created and stored. + attr_accessor :location + + # The name of the template. attr_reader :name attr_accessor :additional_properties @@ -30,6 +45,11 @@ class PostmortemTemplateAttributesRequest # @!visibility private def self.attribute_map { + :'confluence_postmortem_settings' => :'confluence_postmortem_settings', + :'content' => :'content', + :'google_docs_postmortem_settings' => :'google_docs_postmortem_settings', + :'is_default' => :'is_default', + :'location' => :'location', :'name' => :'name' } end @@ -38,10 +58,23 @@ def self.attribute_map # @!visibility private def self.openapi_types { + :'confluence_postmortem_settings' => :'ConfluencePostmortemSettings', + :'content' => :'String', + :'google_docs_postmortem_settings' => :'GoogleDocsPostmortemSettings', + :'is_default' => :'Time', + :'location' => :'PostmortemTemplateLocation', :'name' => :'String' } end + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'is_default', + ]) + end + # Initializes the object # @param attributes [Hash] Model attributes in the form of hash # @!visibility private @@ -60,6 +93,26 @@ def initialize(attributes = {}) end } + if attributes.key?(:'confluence_postmortem_settings') + self.confluence_postmortem_settings = attributes[:'confluence_postmortem_settings'] + end + + if attributes.key?(:'content') + self.content = attributes[:'content'] + end + + if attributes.key?(:'google_docs_postmortem_settings') + self.google_docs_postmortem_settings = attributes[:'google_docs_postmortem_settings'] + end + + if attributes.key?(:'is_default') + self.is_default = attributes[:'is_default'] + end + + if attributes.key?(:'location') + self.location = attributes[:'location'] + end + if attributes.key?(:'name') self.name = attributes[:'name'] end @@ -109,6 +162,11 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && + confluence_postmortem_settings == o.confluence_postmortem_settings && + content == o.content && + google_docs_postmortem_settings == o.google_docs_postmortem_settings && + is_default == o.is_default && + location == o.location && name == o.name && additional_properties == o.additional_properties end @@ -117,7 +175,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [name, additional_properties].hash + [confluence_postmortem_settings, content, google_docs_postmortem_settings, is_default, location, name, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/postmortem_template_attributes_response.rb b/lib/datadog_api_client/v2/models/postmortem_template_attributes_response.rb index e60a2f072ba7..3d18f813296e 100644 --- a/lib/datadog_api_client/v2/models/postmortem_template_attributes_response.rb +++ b/lib/datadog_api_client/v2/models/postmortem_template_attributes_response.rb @@ -21,13 +21,28 @@ module DatadogAPIClient::V2 class PostmortemTemplateAttributesResponse include BaseGenericModel - # When the template was created + # Settings for a postmortem template stored in Confluence. Required when `location` is `confluence`. + attr_accessor :confluence_postmortem_settings + + # The templated content of the postmortem, supporting Markdown and incident template variables. + attr_reader :content + + # When the template was created. attr_reader :created_at - # When the template was last modified + # Settings for a postmortem template stored in Google Docs. Required when `location` is `google_docs`. + attr_accessor :google_docs_postmortem_settings + + # When set, marks this template as a default. The effective default for an incident type is the template with the most recent `is_default` timestamp. + attr_accessor :is_default + + # The location where the postmortem is created and stored. + attr_reader :location + + # When the template was last modified. attr_reader :modified_at - # The name of the template + # The name of the template. attr_reader :name attr_accessor :additional_properties @@ -36,7 +51,12 @@ class PostmortemTemplateAttributesResponse # @!visibility private def self.attribute_map { + :'confluence_postmortem_settings' => :'confluence_postmortem_settings', + :'content' => :'content', :'created_at' => :'createdAt', + :'google_docs_postmortem_settings' => :'google_docs_postmortem_settings', + :'is_default' => :'is_default', + :'location' => :'location', :'modified_at' => :'modifiedAt', :'name' => :'name' } @@ -46,12 +66,25 @@ def self.attribute_map # @!visibility private def self.openapi_types { + :'confluence_postmortem_settings' => :'ConfluencePostmortemSettings', + :'content' => :'String', :'created_at' => :'Time', + :'google_docs_postmortem_settings' => :'GoogleDocsPostmortemSettings', + :'is_default' => :'Time', + :'location' => :'PostmortemTemplateLocation', :'modified_at' => :'Time', :'name' => :'String' } end + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'is_default', + ]) + end + # Initializes the object # @param attributes [Hash] Model attributes in the form of hash # @!visibility private @@ -70,10 +103,30 @@ def initialize(attributes = {}) end } + if attributes.key?(:'confluence_postmortem_settings') + self.confluence_postmortem_settings = attributes[:'confluence_postmortem_settings'] + end + + if attributes.key?(:'content') + self.content = attributes[:'content'] + end + if attributes.key?(:'created_at') self.created_at = attributes[:'created_at'] end + if attributes.key?(:'google_docs_postmortem_settings') + self.google_docs_postmortem_settings = attributes[:'google_docs_postmortem_settings'] + end + + if attributes.key?(:'is_default') + self.is_default = attributes[:'is_default'] + end + + if attributes.key?(:'location') + self.location = attributes[:'location'] + end + if attributes.key?(:'modified_at') self.modified_at = attributes[:'modified_at'] end @@ -87,12 +140,24 @@ def initialize(attributes = {}) # @return true if the model is valid # @!visibility private def valid? + return false if @content.nil? return false if @created_at.nil? + return false if @location.nil? return false if @modified_at.nil? return false if @name.nil? true end + # Custom attribute writer method with validation + # @param content [Object] Object to be assigned + # @!visibility private + def content=(content) + if content.nil? + fail ArgumentError, 'invalid value for "content", content cannot be nil.' + end + @content = content + end + # Custom attribute writer method with validation # @param created_at [Object] Object to be assigned # @!visibility private @@ -103,6 +168,16 @@ def created_at=(created_at) @created_at = created_at end + # Custom attribute writer method with validation + # @param location [Object] Object to be assigned + # @!visibility private + def location=(location) + if location.nil? + fail ArgumentError, 'invalid value for "location", location cannot be nil.' + end + @location = location + end + # Custom attribute writer method with validation # @param modified_at [Object] Object to be assigned # @!visibility private @@ -149,7 +224,12 @@ def to_hash def ==(o) return true if self.equal?(o) self.class == o.class && + confluence_postmortem_settings == o.confluence_postmortem_settings && + content == o.content && created_at == o.created_at && + google_docs_postmortem_settings == o.google_docs_postmortem_settings && + is_default == o.is_default && + location == o.location && modified_at == o.modified_at && name == o.name && additional_properties == o.additional_properties @@ -159,7 +239,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [created_at, modified_at, name, additional_properties].hash + [confluence_postmortem_settings, content, created_at, google_docs_postmortem_settings, is_default, location, modified_at, name, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/postmortem_template_create_relationships.rb b/lib/datadog_api_client/v2/models/postmortem_template_create_relationships.rb new file mode 100644 index 000000000000..190502bac70b --- /dev/null +++ b/lib/datadog_api_client/v2/models/postmortem_template_create_relationships.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationships for a postmortem template. `incident_type` is required when creating a template and is immutable afterwards. + class PostmortemTemplateCreateRelationships + include BaseGenericModel + + # Relationship to the incident type this template belongs to. + attr_accessor :incident_type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'incident_type' => :'incident_type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'incident_type' => :'PostmortemTemplateIncidentTypeRelationship' + } + 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::PostmortemTemplateCreateRelationships` 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?(:'incident_type') + self.incident_type = attributes[:'incident_type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + incident_type == o.incident_type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [incident_type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/postmortem_template_data_request.rb b/lib/datadog_api_client/v2/models/postmortem_template_data_request.rb index 6c15b4a5d1c9..ffc92459ed48 100644 --- a/lib/datadog_api_client/v2/models/postmortem_template_data_request.rb +++ b/lib/datadog_api_client/v2/models/postmortem_template_data_request.rb @@ -24,7 +24,13 @@ class PostmortemTemplateDataRequest # Attributes for creating or updating a postmortem template. attr_reader :attributes - # Postmortem template resource type + # The ID of the template. Required when updating. + attr_accessor :id + + # Relationships for a postmortem template. `incident_type` is required when creating a template and is immutable afterwards. + attr_accessor :relationships + + # Postmortem template resource type. attr_reader :type attr_accessor :additional_properties @@ -34,6 +40,8 @@ class PostmortemTemplateDataRequest def self.attribute_map { :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', :'type' => :'type' } end @@ -43,6 +51,8 @@ def self.attribute_map def self.openapi_types { :'attributes' => :'PostmortemTemplateAttributesRequest', + :'id' => :'String', + :'relationships' => :'PostmortemTemplateCreateRelationships', :'type' => :'PostmortemTemplateType' } end @@ -69,6 +79,14 @@ def initialize(attributes = {}) self.attributes = attributes[:'attributes'] end + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + if attributes.key?(:'type') self.type = attributes[:'type'] end @@ -130,6 +148,8 @@ def ==(o) return true if self.equal?(o) self.class == o.class && attributes == o.attributes && + id == o.id && + relationships == o.relationships && type == o.type && additional_properties == o.additional_properties end @@ -138,7 +158,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [attributes, type, additional_properties].hash + [attributes, id, relationships, type, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/postmortem_template_data_response.rb b/lib/datadog_api_client/v2/models/postmortem_template_data_response.rb index 5135dae7ac85..44253dbcc127 100644 --- a/lib/datadog_api_client/v2/models/postmortem_template_data_response.rb +++ b/lib/datadog_api_client/v2/models/postmortem_template_data_response.rb @@ -24,10 +24,13 @@ class PostmortemTemplateDataResponse # Attributes of a postmortem template returned in a response. attr_reader :attributes - # The ID of the template + # The ID of the template. attr_reader :id - # Postmortem template resource type + # Relationships of a postmortem template returned in a response. + attr_accessor :relationships + + # Postmortem template resource type. attr_reader :type attr_accessor :additional_properties @@ -38,6 +41,7 @@ def self.attribute_map { :'attributes' => :'attributes', :'id' => :'id', + :'relationships' => :'relationships', :'type' => :'type' } end @@ -48,6 +52,7 @@ def self.openapi_types { :'attributes' => :'PostmortemTemplateAttributesResponse', :'id' => :'String', + :'relationships' => :'PostmortemTemplateResponseRelationships', :'type' => :'PostmortemTemplateType' } end @@ -78,6 +83,10 @@ def initialize(attributes = {}) self.id = attributes[:'id'] end + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + if attributes.key?(:'type') self.type = attributes[:'type'] end @@ -151,6 +160,7 @@ def ==(o) self.class == o.class && attributes == o.attributes && id == o.id && + relationships == o.relationships && type == o.type && additional_properties == o.additional_properties end @@ -159,7 +169,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [attributes, id, type, additional_properties].hash + [attributes, id, relationships, type, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/postmortem_template_incident_type_relationship.rb b/lib/datadog_api_client/v2/models/postmortem_template_incident_type_relationship.rb new file mode 100644 index 000000000000..b132f0507c1b --- /dev/null +++ b/lib/datadog_api_client/v2/models/postmortem_template_incident_type_relationship.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 + # Relationship to the incident type this template belongs to. + class PostmortemTemplateIncidentTypeRelationship + include BaseGenericModel + + # Incident type relationship data. + 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' => :'PostmortemTemplateIncidentTypeRelationshipData' + } + 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::PostmortemTemplateIncidentTypeRelationship` 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/postmortem_template_incident_type_relationship_data.rb b/lib/datadog_api_client/v2/models/postmortem_template_incident_type_relationship_data.rb new file mode 100644 index 000000000000..b119b0bb6322 --- /dev/null +++ b/lib/datadog_api_client/v2/models/postmortem_template_incident_type_relationship_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Incident type relationship data. + class PostmortemTemplateIncidentTypeRelationshipData + include BaseGenericModel + + # The incident type identifier. + attr_reader :id + + # The incident type resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'UUID', + :'type' => :'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::PostmortemTemplateIncidentTypeRelationshipData` 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/postmortem_template_location.rb b/lib/datadog_api_client/v2/models/postmortem_template_location.rb new file mode 100644 index 000000000000..1633141e3e3d --- /dev/null +++ b/lib/datadog_api_client/v2/models/postmortem_template_location.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The location where the postmortem is created and stored. + class PostmortemTemplateLocation + include BaseEnumModel + + DATADOG_NOTEBOOKS = "datadog_notebooks".freeze + CONFLUENCE = "confluence".freeze + GOOGLE_DOCS = "google_docs".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/postmortem_template_response_relationships.rb b/lib/datadog_api_client/v2/models/postmortem_template_response_relationships.rb new file mode 100644 index 000000000000..1f040fc9c4c1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/postmortem_template_response_relationships.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationships of a postmortem template returned in a response. + class PostmortemTemplateResponseRelationships + include BaseGenericModel + + # Relationship to the incident type this template belongs to. + attr_accessor :incident_type + + # Relationship to a user. + attr_accessor :last_modified_by_user + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'incident_type' => :'incident_type', + :'last_modified_by_user' => :'last_modified_by_user' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'incident_type' => :'PostmortemTemplateIncidentTypeRelationship', + :'last_modified_by_user' => :'PostmortemTemplateUserRelationship' + } + 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::PostmortemTemplateResponseRelationships` 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?(:'incident_type') + self.incident_type = attributes[:'incident_type'] + end + + if attributes.key?(:'last_modified_by_user') + self.last_modified_by_user = attributes[:'last_modified_by_user'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + incident_type == o.incident_type && + last_modified_by_user == o.last_modified_by_user && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [incident_type, last_modified_by_user, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/postmortem_template_type.rb b/lib/datadog_api_client/v2/models/postmortem_template_type.rb index 97518204d33f..c5b86a32f9eb 100644 --- a/lib/datadog_api_client/v2/models/postmortem_template_type.rb +++ b/lib/datadog_api_client/v2/models/postmortem_template_type.rb @@ -17,10 +17,11 @@ require 'time' module DatadogAPIClient::V2 - # Postmortem template resource type + # Postmortem template resource type. class PostmortemTemplateType include BaseEnumModel + POSTMORTEM_TEMPLATES = "postmortem_templates".freeze POSTMORTEM_TEMPLATE = "postmortem_template".freeze end end diff --git a/lib/datadog_api_client/v2/models/postmortem_template_user_relationship.rb b/lib/datadog_api_client/v2/models/postmortem_template_user_relationship.rb new file mode 100644 index 000000000000..d414fde845c3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/postmortem_template_user_relationship.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 + # Relationship to a user. + class PostmortemTemplateUserRelationship + include BaseGenericModel + + # User relationship data. + 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' => :'PostmortemTemplateUserRelationshipData' + } + 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::PostmortemTemplateUserRelationship` 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/postmortem_template_user_relationship_data.rb b/lib/datadog_api_client/v2/models/postmortem_template_user_relationship_data.rb new file mode 100644 index 000000000000..9a53f1b9dcb2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/postmortem_template_user_relationship_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # User relationship data. + class PostmortemTemplateUserRelationshipData + include BaseGenericModel + + # The user identifier. + attr_reader :id + + # The user resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'UUID', + :'type' => :'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::PostmortemTemplateUserRelationshipData` 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 From a9dd805252d6d9e522de86bc24b2fe62eb74874a Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Fri, 24 Jul 2026 15:01:17 -0400 Subject: [PATCH 4/5] Regenerate client from commit 534cb46 of spec repo (#3604) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v1/openapi.yaml | 44 +++- ...Value-Operation-returns-OK-response.frozen | 1 + ...ey-Value-Operation-returns-OK-response.yml | 46 ++++ ...ide-on-conflict-returns-OK-response.frozen | 1 + ...erride-on-conflict-returns-OK-response.yml | 46 ++++ .../CreateLogsPipeline_2595757342.rb | 26 +++ .../CreateLogsPipeline_4041812833.rb | 28 +++ features/v1/logs_pipelines.feature | 14 ++ lib/datadog_api_client/inflector.rb | 2 + .../v1/models/logs_array_processor.rb | 1 + .../models/logs_array_processor_operation.rb | 3 +- ...y_processor_operation_extract_key_value.rb | 206 ++++++++++++++++++ ...cessor_operation_extract_key_value_type.rb | 26 +++ .../v1/models/logs_attribute_remapper.rb | 2 +- .../v1/models/logs_schema_remapper.rb | 2 +- 15 files changed, 443 insertions(+), 5 deletions(-) create mode 100644 cassettes/features/v1/logs_pipelines/Create-a-pipeline-with-Array-Processor-Key-Value-Operation-returns-OK-response.frozen create mode 100644 cassettes/features/v1/logs_pipelines/Create-a-pipeline-with-Array-Processor-Key-Value-Operation-returns-OK-response.yml create mode 100644 cassettes/features/v1/logs_pipelines/Create-a-pipeline-with-Array-Processor-Key-Value-Operation-with-target-and-override-on-conflict-returns-OK-response.frozen create mode 100644 cassettes/features/v1/logs_pipelines/Create-a-pipeline-with-Array-Processor-Key-Value-Operation-with-target-and-override-on-conflict-returns-OK-response.yml create mode 100644 examples/v1/logs-pipelines/CreateLogsPipeline_2595757342.rb create mode 100644 examples/v1/logs-pipelines/CreateLogsPipeline_4041812833.rb create mode 100644 lib/datadog_api_client/v1/models/logs_array_processor_operation_extract_key_value.rb create mode 100644 lib/datadog_api_client/v1/models/logs_array_processor_operation_extract_key_value_type.rb diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index b043de0e6483..13b137f25f85 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -6611,6 +6611,7 @@ components: - Select value from matching element - Compute array length - Append a value to an array + - Extract key-value pairs from an array properties: is_enabled: default: false @@ -6633,6 +6634,7 @@ components: - $ref: "#/components/schemas/LogsArrayProcessorOperationAppend" - $ref: "#/components/schemas/LogsArrayProcessorOperationLength" - $ref: "#/components/schemas/LogsArrayProcessorOperationSelect" + - $ref: "#/components/schemas/LogsArrayProcessorOperationExtractKeyValue" LogsArrayProcessorOperationAppend: description: Operation that appends a value to a target array attribute. properties: @@ -6662,6 +6664,44 @@ components: type: string x-enum-varnames: - APPEND + LogsArrayProcessorOperationExtractKeyValue: + description: Operation that extracts key-value pairs from a `source` array and stores the result in the `target` attribute. + properties: + key_to_extract: + description: Key of the attribute in each array element that holds the name to use for the extracted attribute. + example: name + type: string + override_on_conflict: + default: false + description: Whether to override the target element if it's already set. + type: boolean + source: + description: Attribute path of the array to extract key-value pairs from. + example: tags + type: string + target: + description: Attribute that receives the extracted key-value pairs. If not specified, the extracted attributes are added at the root level of the log. + example: extracted + type: string + type: + $ref: "#/components/schemas/LogsArrayProcessorOperationExtractKeyValueType" + value_to_extract: + description: Key of the attribute in each array element that holds the value to use for the extracted attribute. + example: value + type: string + required: + - type + - source + - key_to_extract + - value_to_extract + type: object + LogsArrayProcessorOperationExtractKeyValueType: + description: Operation type. + enum: [key-value] + example: key-value + type: string + x-enum-varnames: + - KEY_VALUE LogsArrayProcessorOperationLength: description: Operation that computes the length of a `source` array and stores the result in the `target` attribute. properties: @@ -6746,7 +6786,7 @@ components: type: string override_on_conflict: default: false - description: Override or not the target element if already set, + description: Whether to override the target element if it's already set. type: boolean preserve_source: default: false @@ -7912,7 +7952,7 @@ components: type: string override_on_conflict: default: false - description: Override or not the target element if already set. + description: Whether to override the target element if it's already set. type: boolean preserve_source: default: false diff --git a/cassettes/features/v1/logs_pipelines/Create-a-pipeline-with-Array-Processor-Key-Value-Operation-returns-OK-response.frozen b/cassettes/features/v1/logs_pipelines/Create-a-pipeline-with-Array-Processor-Key-Value-Operation-returns-OK-response.frozen new file mode 100644 index 000000000000..79a90597f732 --- /dev/null +++ b/cassettes/features/v1/logs_pipelines/Create-a-pipeline-with-Array-Processor-Key-Value-Operation-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-07-22T18:27:14.576Z \ No newline at end of file diff --git a/cassettes/features/v1/logs_pipelines/Create-a-pipeline-with-Array-Processor-Key-Value-Operation-returns-OK-response.yml b/cassettes/features/v1/logs_pipelines/Create-a-pipeline-with-Array-Processor-Key-Value-Operation-returns-OK-response.yml new file mode 100644 index 000000000000..f7bde1249a3c --- /dev/null +++ b/cassettes/features/v1/logs_pipelines/Create-a-pipeline-with-Array-Processor-Key-Value-Operation-returns-OK-response.yml @@ -0,0 +1,46 @@ +http_interactions: +- recorded_at: Wed, 22 Jul 2026 18:27:14 GMT + request: + body: + encoding: UTF-8 + string: '{"filter":{"query":"source:python"},"name":"testPipelineArrayKeyValue","processors":[{"is_enabled":true,"name":"extract_kv","operation":{"key_to_extract":"name","source":"tags","type":"key-value","value_to_extract":"value"},"type":"array-processor"}],"tags":[]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/logs/config/pipelines + response: + body: + encoding: UTF-8 + string: '{"id":"KLmRE95XSCKQcsktzgs9eQ","type":"pipeline","name":"testPipelineArrayKeyValue","is_enabled":false,"is_read_only":false,"filter":{"query":"source:python"},"processors":[{"name":"extract_kv","is_enabled":true,"operation":{"source":"tags","key_to_extract":"name","value_to_extract":"value","override_on_conflict":false,"type":"key-value"},"type":"array-processor"}],"tags":[]} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Wed, 22 Jul 2026 18:27:14 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v1/logs/config/pipelines/KLmRE95XSCKQcsktzgs9eQ + response: + body: + encoding: UTF-8 + string: '{} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v1/logs_pipelines/Create-a-pipeline-with-Array-Processor-Key-Value-Operation-with-target-and-override-on-conflict-returns-OK-response.frozen b/cassettes/features/v1/logs_pipelines/Create-a-pipeline-with-Array-Processor-Key-Value-Operation-with-target-and-override-on-conflict-returns-OK-response.frozen new file mode 100644 index 000000000000..fe1037276abf --- /dev/null +++ b/cassettes/features/v1/logs_pipelines/Create-a-pipeline-with-Array-Processor-Key-Value-Operation-with-target-and-override-on-conflict-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-07-22T18:27:15.202Z \ No newline at end of file diff --git a/cassettes/features/v1/logs_pipelines/Create-a-pipeline-with-Array-Processor-Key-Value-Operation-with-target-and-override-on-conflict-returns-OK-response.yml b/cassettes/features/v1/logs_pipelines/Create-a-pipeline-with-Array-Processor-Key-Value-Operation-with-target-and-override-on-conflict-returns-OK-response.yml new file mode 100644 index 000000000000..8eae222034a5 --- /dev/null +++ b/cassettes/features/v1/logs_pipelines/Create-a-pipeline-with-Array-Processor-Key-Value-Operation-with-target-and-override-on-conflict-returns-OK-response.yml @@ -0,0 +1,46 @@ +http_interactions: +- recorded_at: Wed, 22 Jul 2026 18:27:15 GMT + request: + body: + encoding: UTF-8 + string: '{"filter":{"query":"source:python"},"name":"testPipelineArrayKeyValueTarget","processors":[{"is_enabled":true,"name":"extract_kv_to_target","operation":{"key_to_extract":"name","override_on_conflict":true,"source":"tags","target":"extracted","type":"key-value","value_to_extract":"value"},"type":"array-processor"}],"tags":[]}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v1/logs/config/pipelines + response: + body: + encoding: UTF-8 + string: '{"id":"LsxyDpcbTL6KztluS2oBYA","type":"pipeline","name":"testPipelineArrayKeyValueTarget","is_enabled":false,"is_read_only":false,"filter":{"query":"source:python"},"processors":[{"name":"extract_kv_to_target","is_enabled":true,"operation":{"source":"tags","target":"extracted","key_to_extract":"name","value_to_extract":"value","override_on_conflict":true,"type":"key-value"},"type":"array-processor"}],"tags":[]} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Wed, 22 Jul 2026 18:27:15 GMT + request: + body: null + headers: + Accept: + - '*/*' + method: DELETE + uri: https://api.datadoghq.com/api/v1/logs/config/pipelines/LsxyDpcbTL6KztluS2oBYA + response: + body: + encoding: UTF-8 + string: '{} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/examples/v1/logs-pipelines/CreateLogsPipeline_2595757342.rb b/examples/v1/logs-pipelines/CreateLogsPipeline_2595757342.rb new file mode 100644 index 000000000000..40aa18385415 --- /dev/null +++ b/examples/v1/logs-pipelines/CreateLogsPipeline_2595757342.rb @@ -0,0 +1,26 @@ +# Create a pipeline with Array Processor Key Value Operation returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V1::LogsPipelinesAPI.new + +body = DatadogAPIClient::V1::LogsPipeline.new({ + filter: DatadogAPIClient::V1::LogsFilter.new({ + query: "source:python", + }), + name: "testPipelineArrayKeyValue", + processors: [ + DatadogAPIClient::V1::LogsArrayProcessor.new({ + type: DatadogAPIClient::V1::LogsArrayProcessorType::ARRAY_PROCESSOR, + is_enabled: true, + name: "extract_kv", + operation: DatadogAPIClient::V1::LogsArrayProcessorOperationExtractKeyValue.new({ + type: DatadogAPIClient::V1::LogsArrayProcessorOperationExtractKeyValueType::KEY_VALUE, + source: "tags", + key_to_extract: "name", + value_to_extract: "value", + }), + }), + ], + tags: [], +}) +p api_instance.create_logs_pipeline(body) diff --git a/examples/v1/logs-pipelines/CreateLogsPipeline_4041812833.rb b/examples/v1/logs-pipelines/CreateLogsPipeline_4041812833.rb new file mode 100644 index 000000000000..906d7cbd0399 --- /dev/null +++ b/examples/v1/logs-pipelines/CreateLogsPipeline_4041812833.rb @@ -0,0 +1,28 @@ +# Create a pipeline with Array Processor Key Value Operation with target and override_on_conflict returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V1::LogsPipelinesAPI.new + +body = DatadogAPIClient::V1::LogsPipeline.new({ + filter: DatadogAPIClient::V1::LogsFilter.new({ + query: "source:python", + }), + name: "testPipelineArrayKeyValueTarget", + processors: [ + DatadogAPIClient::V1::LogsArrayProcessor.new({ + type: DatadogAPIClient::V1::LogsArrayProcessorType::ARRAY_PROCESSOR, + is_enabled: true, + name: "extract_kv_to_target", + operation: DatadogAPIClient::V1::LogsArrayProcessorOperationExtractKeyValue.new({ + type: DatadogAPIClient::V1::LogsArrayProcessorOperationExtractKeyValueType::KEY_VALUE, + source: "tags", + key_to_extract: "name", + value_to_extract: "value", + target: "extracted", + override_on_conflict: true, + }), + }), + ], + tags: [], +}) +p api_instance.create_logs_pipeline(body) diff --git a/features/v1/logs_pipelines.feature b/features/v1/logs_pipelines.feature index ac28f052615b..8b584949d9ae 100644 --- a/features/v1/logs_pipelines.feature +++ b/features/v1/logs_pipelines.feature @@ -84,6 +84,20 @@ Feature: Logs Pipelines When the request is sent Then the response status is 200 OK + @team:DataDog/logs-onboarding + Scenario: Create a pipeline with Array Processor Key Value Operation returns "OK" response + Given new "CreateLogsPipeline" request + And body with value {"filter": {"query": "source:python"}, "name": "testPipelineArrayKeyValue", "processors": [{"type": "array-processor", "is_enabled": true, "name": "extract_kv", "operation": {"type": "key-value", "source": "tags", "key_to_extract": "name", "value_to_extract": "value"}}], "tags": []} + When the request is sent + Then the response status is 200 OK + + @team:DataDog/logs-onboarding + Scenario: Create a pipeline with Array Processor Key Value Operation with target and override_on_conflict returns "OK" response + Given new "CreateLogsPipeline" request + And body with value {"filter": {"query": "source:python"}, "name": "testPipelineArrayKeyValueTarget", "processors": [{"type": "array-processor", "is_enabled": true, "name": "extract_kv_to_target", "operation": {"type": "key-value", "source": "tags", "key_to_extract": "name", "value_to_extract": "value", "target": "extracted", "override_on_conflict": true}}], "tags": []} + When the request is sent + Then the response status is 200 OK + @team:DataDog/logs-onboarding Scenario: Create a pipeline with Array Processor Length Operation returns "OK" response Given new "CreateLogsPipeline" request diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index b69f176fec30..2323ebd9b927 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -307,6 +307,8 @@ def overrides "v1.logs_array_processor_operation" => "LogsArrayProcessorOperation", "v1.logs_array_processor_operation_append" => "LogsArrayProcessorOperationAppend", "v1.logs_array_processor_operation_append_type" => "LogsArrayProcessorOperationAppendType", + "v1.logs_array_processor_operation_extract_key_value" => "LogsArrayProcessorOperationExtractKeyValue", + "v1.logs_array_processor_operation_extract_key_value_type" => "LogsArrayProcessorOperationExtractKeyValueType", "v1.logs_array_processor_operation_length" => "LogsArrayProcessorOperationLength", "v1.logs_array_processor_operation_length_type" => "LogsArrayProcessorOperationLengthType", "v1.logs_array_processor_operation_select" => "LogsArrayProcessorOperationSelect", diff --git a/lib/datadog_api_client/v1/models/logs_array_processor.rb b/lib/datadog_api_client/v1/models/logs_array_processor.rb index 9dd154d45155..102bcd5a5e95 100644 --- a/lib/datadog_api_client/v1/models/logs_array_processor.rb +++ b/lib/datadog_api_client/v1/models/logs_array_processor.rb @@ -22,6 +22,7 @@ module DatadogAPIClient::V1 # - Select value from matching element # - Compute array length # - Append a value to an array + # - Extract key-value pairs from an array class LogsArrayProcessor include BaseGenericModel diff --git a/lib/datadog_api_client/v1/models/logs_array_processor_operation.rb b/lib/datadog_api_client/v1/models/logs_array_processor_operation.rb index f66b9a99b5d9..062cb8b485ad 100644 --- a/lib/datadog_api_client/v1/models/logs_array_processor_operation.rb +++ b/lib/datadog_api_client/v1/models/logs_array_processor_operation.rb @@ -28,7 +28,8 @@ def openapi_one_of [ :'LogsArrayProcessorOperationAppend', :'LogsArrayProcessorOperationLength', - :'LogsArrayProcessorOperationSelect' + :'LogsArrayProcessorOperationSelect', + :'LogsArrayProcessorOperationExtractKeyValue' ] end # Builds the object diff --git a/lib/datadog_api_client/v1/models/logs_array_processor_operation_extract_key_value.rb b/lib/datadog_api_client/v1/models/logs_array_processor_operation_extract_key_value.rb new file mode 100644 index 000000000000..5d5b1d0754be --- /dev/null +++ b/lib/datadog_api_client/v1/models/logs_array_processor_operation_extract_key_value.rb @@ -0,0 +1,206 @@ +=begin +#Datadog API V1 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::V1 + # Operation that extracts key-value pairs from a `source` array and stores the result in the `target` attribute. + class LogsArrayProcessorOperationExtractKeyValue + include BaseGenericModel + + # Key of the attribute in each array element that holds the name to use for the extracted attribute. + attr_reader :key_to_extract + + # Whether to override the target element if it's already set. + attr_accessor :override_on_conflict + + # Attribute path of the array to extract key-value pairs from. + attr_reader :source + + # Attribute that receives the extracted key-value pairs. If not specified, the extracted attributes are added at the root level of the log. + attr_accessor :target + + # Operation type. + attr_reader :type + + # Key of the attribute in each array element that holds the value to use for the extracted attribute. + attr_reader :value_to_extract + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'key_to_extract' => :'key_to_extract', + :'override_on_conflict' => :'override_on_conflict', + :'source' => :'source', + :'target' => :'target', + :'type' => :'type', + :'value_to_extract' => :'value_to_extract' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'key_to_extract' => :'String', + :'override_on_conflict' => :'Boolean', + :'source' => :'String', + :'target' => :'String', + :'type' => :'LogsArrayProcessorOperationExtractKeyValueType', + :'value_to_extract' => :'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::V1::LogsArrayProcessorOperationExtractKeyValue` 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_to_extract') + self.key_to_extract = attributes[:'key_to_extract'] + end + + if attributes.key?(:'override_on_conflict') + self.override_on_conflict = attributes[:'override_on_conflict'] + end + + if attributes.key?(:'source') + self.source = attributes[:'source'] + end + + if attributes.key?(:'target') + self.target = attributes[:'target'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'value_to_extract') + self.value_to_extract = attributes[:'value_to_extract'] + 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_to_extract.nil? + return false if @source.nil? + return false if @type.nil? + return false if @value_to_extract.nil? + true + end + + # Custom attribute writer method with validation + # @param key_to_extract [Object] Object to be assigned + # @!visibility private + def key_to_extract=(key_to_extract) + if key_to_extract.nil? + fail ArgumentError, 'invalid value for "key_to_extract", key_to_extract cannot be nil.' + end + @key_to_extract = key_to_extract + end + + # Custom attribute writer method with validation + # @param source [Object] Object to be assigned + # @!visibility private + def source=(source) + if source.nil? + fail ArgumentError, 'invalid value for "source", source cannot be nil.' + end + @source = source + 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 + + # Custom attribute writer method with validation + # @param value_to_extract [Object] Object to be assigned + # @!visibility private + def value_to_extract=(value_to_extract) + if value_to_extract.nil? + fail ArgumentError, 'invalid value for "value_to_extract", value_to_extract cannot be nil.' + end + @value_to_extract = value_to_extract + 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_to_extract == o.key_to_extract && + override_on_conflict == o.override_on_conflict && + source == o.source && + target == o.target && + type == o.type && + value_to_extract == o.value_to_extract && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [key_to_extract, override_on_conflict, source, target, type, value_to_extract, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/logs_array_processor_operation_extract_key_value_type.rb b/lib/datadog_api_client/v1/models/logs_array_processor_operation_extract_key_value_type.rb new file mode 100644 index 000000000000..6772a2b0aaf5 --- /dev/null +++ b/lib/datadog_api_client/v1/models/logs_array_processor_operation_extract_key_value_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V1 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::V1 + # Operation type. + class LogsArrayProcessorOperationExtractKeyValueType + include BaseEnumModel + + KEY_VALUE = "key-value".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/logs_attribute_remapper.rb b/lib/datadog_api_client/v1/models/logs_attribute_remapper.rb index 295fb83ad0b3..f3a06e2c1fa7 100644 --- a/lib/datadog_api_client/v1/models/logs_attribute_remapper.rb +++ b/lib/datadog_api_client/v1/models/logs_attribute_remapper.rb @@ -29,7 +29,7 @@ class LogsAttributeRemapper # Name of the processor. attr_accessor :name - # Override or not the target element if already set, + # Whether to override the target element if it's already set. attr_accessor :override_on_conflict # Remove or preserve the remapped source element. diff --git a/lib/datadog_api_client/v1/models/logs_schema_remapper.rb b/lib/datadog_api_client/v1/models/logs_schema_remapper.rb index 82c7fc985ecc..0bf29b8981e3 100644 --- a/lib/datadog_api_client/v1/models/logs_schema_remapper.rb +++ b/lib/datadog_api_client/v1/models/logs_schema_remapper.rb @@ -24,7 +24,7 @@ class LogsSchemaRemapper # Name of the logs schema remapper. attr_reader :name - # Override or not the target element if already set. + # Whether to override the target element if it's already set. attr_accessor :override_on_conflict # Remove or preserve the remapped source element. From 4e815fa1ac307fc366740bd93833ac9967010f22 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Fri, 24 Jul 2026 20:34:11 +0000 Subject: [PATCH 5/5] Regenerate client from commit d953cb9 of spec repo (#3613) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 12 +++++++++--- .../v2/api/service_level_objectives_api.rb | 9 +++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 203a2ac6cdfc..92d598bce345 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -189759,6 +189759,7 @@ paths: Please check the documentation regularly for updates. /api/v2/slo/report: post: + deprecated: true description: |- Create a job to generate an SLO report. The report job is processed asynchronously and eventually results in a CSV report being available for download. @@ -189821,10 +189822,12 @@ paths: operator: OR permissions: - slos_read + x-sunset: "2027-01-25" x-unstable: |- - **Note**: This feature is in private beta. To request access, use the request access form in the [Service Level Objectives](https://docs.datadoghq.com/service_management/service_level_objectives/#slo-csv-export) docs. + **Note**: This feature is in private beta and is no longer accepting requests for access. /api/v2/slo/report/{report_id}/download: get: + deprecated: true description: |- Download an SLO report. This can only be performed after the report job has completed. @@ -189870,10 +189873,12 @@ paths: summary: Get SLO report tags: - Service Level Objectives + x-sunset: "2027-01-25" x-unstable: |- - **Note**: This feature is in private beta. To request access, use the request access form in the [Service Level Objectives](https://docs.datadoghq.com/service_management/service_level_objectives/#slo-csv-export) docs. + **Note**: This feature is in private beta and is no longer accepting requests for access. /api/v2/slo/report/{report_id}/status: get: + deprecated: true description: Get the status of the SLO report job. operationId: GetSLOReportJobStatus parameters: @@ -189921,8 +189926,9 @@ paths: summary: Get SLO report status tags: - Service Level Objectives + x-sunset: "2027-01-25" x-unstable: |- - **Note**: This feature is in private beta. To request access, use the request access form in the [Service Level Objectives](https://docs.datadoghq.com/service_management/service_level_objectives/#slo-csv-export) docs. + **Note**: This feature is in private beta and is no longer accepting requests for access. /api/v2/slo/{slo_id}/status: get: description: |- diff --git a/lib/datadog_api_client/v2/api/service_level_objectives_api.rb b/lib/datadog_api_client/v2/api/service_level_objectives_api.rb index 8fd5b67ce46e..d4881018c4c5 100644 --- a/lib/datadog_api_client/v2/api/service_level_objectives_api.rb +++ b/lib/datadog_api_client/v2/api/service_level_objectives_api.rb @@ -37,10 +37,13 @@ def create_slo_report_job(body, opts = {}) # # Check the status of the job and download the CSV report using the returned `report_id`. # + # @deprecated This API is deprecated. + # # @param body [SloReportCreateRequest] Create SLO report job request body. # @param opts [Hash] the optional parameters # @return [Array<(SLOReportPostResponse, Integer, Hash)>] SLOReportPostResponse data, response status code and response headers def create_slo_report_job_with_http_info(body, opts = {}) + warn "[DEPRECATION] `CreateSLOReportJob` is deprecated." unstable_enabled = @api_client.config.unstable_operations["v2.create_slo_report_job".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_slo_report_job") @@ -112,10 +115,13 @@ def get_slo_report(report_id, opts = {}) # # Reports are not guaranteed to exist indefinitely. Datadog recommends that you download the report as soon as it is available. # + # @deprecated This API is deprecated. + # # @param report_id [String] The ID of the report job. # @param opts [Hash] the optional parameters # @return [Array<(String, Integer, Hash)>] String data, response status code and response headers def get_slo_report_with_http_info(report_id, opts = {}) + warn "[DEPRECATION] `GetSLOReport` is deprecated." unstable_enabled = @api_client.config.unstable_operations["v2.get_slo_report".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_slo_report") @@ -183,10 +189,13 @@ def get_slo_report_job_status(report_id, opts = {}) # # Get the status of the SLO report job. # + # @deprecated This API is deprecated. + # # @param report_id [String] The ID of the report job. # @param opts [Hash] the optional parameters # @return [Array<(SLOReportStatusGetResponse, Integer, Hash)>] SLOReportStatusGetResponse data, response status code and response headers def get_slo_report_job_status_with_http_info(report_id, opts = {}) + warn "[DEPRECATION] `GetSLOReportJobStatus` is deprecated." unstable_enabled = @api_client.config.unstable_operations["v2.get_slo_report_job_status".to_sym] if unstable_enabled @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_slo_report_job_status")