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
4 changes: 4 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2875,6 +2875,8 @@ components:
type: string
group_by:
description: Array of fields to group results by.
example:
- "resource_name"
items:
description: Field to group results by.
example: "resource_name"
Expand Down Expand Up @@ -2912,6 +2914,8 @@ components:
- name
- service
- stat
- operation_name
- group_by
type: object
FormulaAndFunctionCloudCostDataSource:
description: Data source for Cloud Cost queries.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ class FormulaAndFunctionApmResourceStatsQueryDefinition
attr_reader :env

# Array of fields to group results by.
attr_accessor :group_by
attr_reader :group_by

# Name of this query to use in formulas.
attr_reader :name

# Name of operation on service.
attr_accessor :operation_name
attr_reader :operation_name

# Name of the second primary tag used within APM. Required when `primary_tag_value` is specified. See https://docs.datadoghq.com/tracing/guide/setting_primary_tags_to_scope/#add-a-second-primary-tag-in-datadog
attr_accessor :primary_tag_name
Expand Down Expand Up @@ -166,7 +166,9 @@ def valid?
return false if !@cross_org_uuids.nil? && @cross_org_uuids.length > 1
return false if @data_source.nil?
return false if @env.nil?
return false if @group_by.nil?
return false if @name.nil?
return false if @operation_name.nil?
return false if @service.nil?
return false if @stat.nil?
true
Expand Down Expand Up @@ -202,6 +204,16 @@ def env=(env)
@env = env
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?
fail ArgumentError, 'invalid value for "group_by", group_by cannot be nil.'
end
@group_by = group_by
end

# Custom attribute writer method with validation
# @param name [Object] Object to be assigned
# @!visibility private
Expand All @@ -212,6 +224,16 @@ def name=(name)
@name = name
end

# Custom attribute writer method with validation
# @param operation_name [Object] Object to be assigned
# @!visibility private
def operation_name=(operation_name)
if operation_name.nil?
fail ArgumentError, 'invalid value for "operation_name", operation_name cannot be nil.'
end
@operation_name = operation_name
end

# Custom attribute writer method with validation
# @param service [Object] Object to be assigned
# @!visibility private
Expand Down
Loading