Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[formulas and functions] Make query name required #237

Merged
merged 1 commit into from
Mar 8, 2021
Merged
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
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.4.1.dev8",
"regenerated": "2021-03-08 08:26:53.597276",
"spec_repo_commit": "317577f"
"regenerated": "2021-03-08 11:23:25.061959",
"spec_repo_commit": "a75da1e"
},
"v2": {
"apigentools_version": "1.4.1.dev8",
"regenerated": "2021-03-08 08:27:04.989376",
"spec_repo_commit": "317577f"
"regenerated": "2021-03-08 11:23:38.208550",
"spec_repo_commit": "a75da1e"
}
}
}
4 changes: 4 additions & 0 deletions data/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1657,6 +1657,7 @@ components:
required:
- data_source
- compute
- name
type: object
FormulaAndFunctionEventQueryGroupBy:
description: List of objects used to group by.
Expand Down Expand Up @@ -1753,6 +1754,7 @@ components:
required:
- data_source
- query
- name
type: object
FormulaAndFunctionProcessQueryDataSource:
description: Data sources that rely on the process backend.
Expand Down Expand Up @@ -1783,6 +1785,7 @@ components:
type: string
name:
description: Name of query for use in formulas.
example: query_errors
type: string
sort:
$ref: '#/components/schemas/QuerySortOrder'
Expand All @@ -1798,6 +1801,7 @@ components:
required:
- data_source
- metric
- name
type: object
FormulaAndFunctionQueryDefinition:
description: A formula and function query.
Expand Down
2 changes: 1 addition & 1 deletion docs/v1/FormulaAndFunctionEventQueryDefinition.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
| **data_source** | [**FormulaAndFunctionEventsDataSource**](FormulaAndFunctionEventsDataSource.md) | | |
| **group_by** | [**Array<FormulaAndFunctionEventQueryGroupBy>**](FormulaAndFunctionEventQueryGroupBy.md) | Group by options. | [optional] |
| **indexes** | **Array<String>** | An array of index names to query in the stream. Omit or use `[]` to query all indexes at once. | [optional] |
| **name** | **String** | Name of the query for use in formulas. | [optional] |
| **name** | **String** | Name of the query for use in formulas. | |
| **search** | [**FormulaAndFunctionEventQueryDefinitionSearch**](FormulaAndFunctionEventQueryDefinitionSearch.md) | | [optional] |

## Example
Expand Down
2 changes: 1 addition & 1 deletion docs/v1/FormulaAndFunctionMetricQueryDefinition.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
| ---- | ---- | ----------- | ----- |
| **aggregator** | [**FormulaAndFunctionMetricAggregation**](FormulaAndFunctionMetricAggregation.md) | | [optional] |
| **data_source** | [**FormulaAndFunctionMetricDataSource**](FormulaAndFunctionMetricDataSource.md) | | |
| **name** | **String** | Name of the query for use in formulas. | [optional] |
| **name** | **String** | Name of the query for use in formulas. | |
| **query** | **String** | Metrics query definition. | |

## Example
Expand Down
4 changes: 2 additions & 2 deletions docs/v1/FormulaAndFunctionProcessQueryDefinition.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
| **is_normalized_cpu** | **Boolean** | Whether to normalize the CPU percentages. | [optional] |
| **limit** | **Integer** | Number of hits to return. | [optional] |
| **metric** | **String** | Process metric name. | |
| **name** | **String** | Name of query for use in formulas. | [optional] |
| **name** | **String** | Name of query for use in formulas. | |
| **sort** | [**QuerySortOrder**](QuerySortOrder.md) | | [optional][default to 'desc'] |
| **tag_filters** | **Array<String>** | An array of tags to filter by. | [optional] |
| **text_filter** | **String** | Text to use as filter. | [optional] |
Expand All @@ -25,7 +25,7 @@ instance = DatadogAPIClient::V1::FormulaAndFunctionProcessQueryDefinition.new(
is_normalized_cpu: null,
limit: null,
metric: avg:system.cpu.user{*},
name: null,
name: query_errors,
sort: null,
tag_filters: null,
text_filter: null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ def list_invalid_properties
invalid_properties.push('invalid value for "data_source", data_source cannot be nil.')
end

if @name.nil?
invalid_properties.push('invalid value for "name", name cannot be nil.')
end

invalid_properties
end

Expand All @@ -133,6 +137,7 @@ def list_invalid_properties
def valid?
return false if @compute.nil?
return false if @data_source.nil?
return false if @name.nil?
true
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ def list_invalid_properties
invalid_properties.push('invalid value for "data_source", data_source cannot be nil.')
end

if @name.nil?
invalid_properties.push('invalid value for "name", name cannot be nil.')
end

if @query.nil?
invalid_properties.push('invalid value for "query", query cannot be nil.')
end
Expand All @@ -111,6 +115,7 @@ def list_invalid_properties
# @return true if the model is valid
def valid?
return false if @data_source.nil?
return false if @name.nil?
return false if @query.nil?
true
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,10 @@ def list_invalid_properties
invalid_properties.push('invalid value for "metric", metric cannot be nil.')
end

if @name.nil?
invalid_properties.push('invalid value for "name", name cannot be nil.')
end

invalid_properties
end

Expand All @@ -160,6 +164,7 @@ def list_invalid_properties
def valid?
return false if @data_source.nil?
return false if @metric.nil?
return false if @name.nil?
true
end

Expand Down