Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6212,6 +6212,38 @@ components:
type: string
x-enum-varnames:
- DECODER_PROCESSOR
LogsExcludeAttributeProcessor:
description: |-
Use this processor to remove an attribute from a log during processing.
The processor strips the specified attribute from the log event, which is useful
when the attribute contains sensitive data or is no longer needed downstream.
properties:
attribute_to_exclude:
description: Name of the log attribute to remove from the log event.
example: foo
type: string
is_enabled:
default: false
description: Whether or not the processor is enabled.
type: boolean
name:
description: Name of the processor.
type: string
type:
$ref: "#/components/schemas/LogsExcludeAttributeProcessorType"
required:
- type
- attribute_to_exclude
type: object
LogsExcludeAttributeProcessorType:
default: exclude-attribute
description: Type of logs exclude attribute processor.
enum:
- exclude-attribute
example: exclude-attribute
type: string
x-enum-varnames:
- EXCLUDE_ATTRIBUTE
LogsExclusion:
description: Represents the index exclusion filter object from configuration API.
properties:
Expand Down Expand Up @@ -6819,6 +6851,7 @@ components:
- $ref: "#/components/schemas/LogsArrayProcessor"
- $ref: "#/components/schemas/LogsDecoderProcessor"
- $ref: "#/components/schemas/LogsSchemaProcessor"
- $ref: "#/components/schemas/LogsExcludeAttributeProcessor"
LogsQueryCompute:
description: Define computation for a log query.
properties:
Expand Down
2 changes: 2 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,8 @@ def overrides
"v1.logs_decoder_processor_binary_to_text_encoding" => "LogsDecoderProcessorBinaryToTextEncoding",
"v1.logs_decoder_processor_input_representation" => "LogsDecoderProcessorInputRepresentation",
"v1.logs_decoder_processor_type" => "LogsDecoderProcessorType",
"v1.logs_exclude_attribute_processor" => "LogsExcludeAttributeProcessor",
"v1.logs_exclude_attribute_processor_type" => "LogsExcludeAttributeProcessorType",
"v1.logs_exclusion" => "LogsExclusion",
"v1.logs_exclusion_filter" => "LogsExclusionFilter",
"v1.logs_filter" => "LogsFilter",
Expand Down
166 changes: 166 additions & 0 deletions lib/datadog_api_client/v1/models/logs_exclude_attribute_processor.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
=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
# Use this processor to remove an attribute from a log during processing.
# The processor strips the specified attribute from the log event, which is useful
# when the attribute contains sensitive data or is no longer needed downstream.
class LogsExcludeAttributeProcessor
include BaseGenericModel

# Name of the log attribute to remove from the log event.
attr_reader :attribute_to_exclude

# Whether or not the processor is enabled.
attr_accessor :is_enabled

# Name of the processor.
attr_accessor :name

# Type of logs exclude attribute processor.
attr_reader :type

attr_accessor :additional_properties

# Attribute mapping from ruby-style variable name to JSON key.
# @!visibility private
def self.attribute_map
{
:'attribute_to_exclude' => :'attribute_to_exclude',
:'is_enabled' => :'is_enabled',
:'name' => :'name',
:'type' => :'type'
}
end

# Attribute type mapping.
# @!visibility private
def self.openapi_types
{
:'attribute_to_exclude' => :'String',
:'is_enabled' => :'Boolean',
:'name' => :'String',
:'type' => :'LogsExcludeAttributeProcessorType'
}
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::LogsExcludeAttributeProcessor` initialize method"
end

self.additional_properties = {}
# check to see if the attribute exists and convert string to symbol for hash key
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
self.additional_properties[k.to_sym] = v
else
h[k.to_sym] = v
end
}

if attributes.key?(:'attribute_to_exclude')
self.attribute_to_exclude = attributes[:'attribute_to_exclude']
end

if attributes.key?(:'is_enabled')
self.is_enabled = attributes[:'is_enabled']
end

if attributes.key?(:'name')
self.name = attributes[:'name']
end

if attributes.key?(:'type')
self.type = attributes[:'type']
end
end

# Check to see if the all the properties in the model are valid
# @return true if the model is valid
# @!visibility private
def valid?
return false if @attribute_to_exclude.nil?
return false if @type.nil?
true
end

# Custom attribute writer method with validation
# @param attribute_to_exclude [Object] Object to be assigned
# @!visibility private
def attribute_to_exclude=(attribute_to_exclude)
if attribute_to_exclude.nil?
fail ArgumentError, 'invalid value for "attribute_to_exclude", attribute_to_exclude cannot be nil.'
end
@attribute_to_exclude = attribute_to_exclude
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 &&
attribute_to_exclude == o.attribute_to_exclude &&
is_enabled == o.is_enabled &&
name == o.name &&
type == o.type &&
additional_properties == o.additional_properties
end

# Calculates hash code according to all attributes.
# @return [Integer] Hash code
# @!visibility private
def hash
[attribute_to_exclude, is_enabled, name, type, additional_properties].hash
end
end
end
Original file line number Diff line number Diff line change
@@ -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
# Type of logs exclude attribute processor.
class LogsExcludeAttributeProcessorType
include BaseEnumModel

EXCLUDE_ATTRIBUTE = "exclude-attribute".freeze
end
end
3 changes: 2 additions & 1 deletion lib/datadog_api_client/v1/models/logs_processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ def openapi_one_of
:'LogsSpanRemapper',
:'LogsArrayProcessor',
:'LogsDecoderProcessor',
:'LogsSchemaProcessor'
:'LogsSchemaProcessor',
:'LogsExcludeAttributeProcessor'
]
end
# Builds the object
Expand Down
Loading