Skip to content
Closed
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
4 changes: 2 additions & 2 deletions .generated-info
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"spec_repo_commit": "b75095c",
"generated": "2025-07-31 10:45:49.687"
"spec_repo_commit": "b14c9da",
"generated": "2025-07-31 15:31:39.889"
}
10 changes: 10 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27480,6 +27480,16 @@ components:
description: The `sample` processor allows probabilistic sampling of logs at
a fixed rate.
properties:
group_by:
description: Optional list of fields to group events by. Each group will
be sampled independently
example:
- service
- host
items:
type: string
minItems: 1
type: array
id:
description: The unique identifier for this component. Used to reference
this component in other parts of the pipeline (for example, as the `input`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ module DatadogAPIClient::V2
class ObservabilityPipelineSampleProcessor
include BaseGenericModel

# Optional list of fields to group events by. Each group will be sampled independently
attr_reader :group_by

# The unique identifier for this component. Used to reference this component in other parts of the pipeline (for example, as the `input` to downstream components).
attr_reader :id

Expand All @@ -45,6 +48,7 @@ class ObservabilityPipelineSampleProcessor
# @!visibility private
def self.attribute_map
{
:'group_by' => :'group_by',
:'id' => :'id',
:'include' => :'include',
:'inputs' => :'inputs',
Expand All @@ -58,6 +62,7 @@ def self.attribute_map
# @!visibility private
def self.openapi_types
{
:'group_by' => :'Array<String>',
:'id' => :'String',
:'include' => :'String',
:'inputs' => :'Array<String>',
Expand Down Expand Up @@ -85,6 +90,12 @@ def initialize(attributes = {})
end
}

if attributes.key?(:'group_by')
if (value = attributes[:'group_by']).is_a?(Array)
self.group_by = value
end
end

if attributes.key?(:'id')
self.id = attributes[:'id']
end
Expand Down Expand Up @@ -116,6 +127,7 @@ def initialize(attributes = {})
# @return true if the model is valid
# @!visibility private
def valid?
return false if !@group_by.nil? && @group_by.length < 1
return false if @id.nil?
return false if @include.nil?
return false if @inputs.nil?
Expand All @@ -124,6 +136,16 @@ def valid?
true
end

# Custom attribute writer method with validation
# @param group_by [Object] Object to be assigned
# @!visibility private
def group_by=(group_by)
if !group_by.nil? && group_by.length < 1
fail ArgumentError, 'invalid value for "group_by", number of items must be greater than or equal to 1.'
end
@group_by = group_by
end

# Custom attribute writer method with validation
# @param id [Object] Object to be assigned
# @!visibility private
Expand Down Expand Up @@ -200,6 +222,7 @@ def to_hash
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
group_by == o.group_by &&
id == o.id &&
include == o.include &&
inputs == o.inputs &&
Expand All @@ -213,7 +236,7 @@ def ==(o)
# @return [Integer] Hash code
# @!visibility private
def hash
[id, include, inputs, percentage, rate, type, additional_properties].hash
[group_by, id, include, inputs, percentage, rate, type, additional_properties].hash
end
end
end
Loading