diff --git a/.apigentools-info b/.apigentools-info index 5bab706cc56c..7b2b75bd966f 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.4.1.dev2", - "regenerated": "2021-01-25 13:05:54.837397", - "spec_repo_commit": "0c67e7b" + "regenerated": "2021-01-26 17:15:04.320994", + "spec_repo_commit": "db8c9ba" }, "v2": { "apigentools_version": "1.4.1.dev2", - "regenerated": "2021-01-25 13:06:08.348450", - "spec_repo_commit": "0c67e7b" + "regenerated": "2021-01-26 17:15:16.348572", + "spec_repo_commit": "db8c9ba" } } } \ No newline at end of file diff --git a/data/v1/openapi.yaml b/data/v1/openapi.yaml index 72ba01d3f48e..d15c3a57059f 100644 --- a/data/v1/openapi.yaml +++ b/data/v1/openapi.yaml @@ -1543,6 +1543,114 @@ components: type: string x-enum-varnames: - EVENT_TIMELINE + FormulaAndFunctionEventAggregation: + description: Aggregation methods for event platform queries. + enum: + - count + - cardinality + - pc75 + - pc90 + - pc95 + - pc98 + - pc99 + - sum + - min + - max + - avg + example: avg + type: string + x-enum-varnames: + - COUNT + - CARDINALITY + - PC75 + - PC90 + - PC95 + - PC98 + - PC99 + - SUM + - MIN + - MAX + - AVG + FormulaAndFunctionEventsDataSource: + description: Data source for event platform-based queries. + enum: + - logs + - analyzed_spans + - network + - rum + - security_signals + - profiles + example: logs + type: string + x-enum-varnames: + - LOGS + - ANALYZED_SPANS + - NETWORK + - RUM + - SECURITY_SIGNALS + - PROFILES + FormulaAndFunctionEventsSortType: + description: Method for sorting event platform results. + enum: + - alphabetical + - measure + type: string + x-enum-varnames: + - ALPHABETICAL + - MEASURE + FormulaAndFunctionMetricAggregation: + description: The aggregation methods available for metrics queries. + enum: + - avg + - min + - max + - sum + - last + - area + - l2norm + example: avg + type: string + x-enum-varnames: + - AVG + - MIN + - MAX + - SUM + - LAST + - AREA + - L2NORM + FormulaAndFunctionMetricDataSource: + description: Data source for metrics queries. + enum: + - metrics + example: metrics + type: string + x-enum-varnames: + - METRICS + FormulaAndFunctionProcessQueryDataSource: + description: Data sources that rely on the process backend. + enum: + - process + - container + type: string + x-enum-varnames: + - PROCESS + - CONTAINER + FormulaAndFunctionQueryDefinition: + description: A formula and function query. + oneOf: + - $ref: '#/components/schemas/TimeSeriesFormulaAndFunctionMetricQueryDefinition' + - $ref: '#/components/schemas/TimeSeriesFormulaAndFunctionEventQueryDefinition' + - $ref: '#/components/schemas/TimeSeriesFormulaAndFunctionProcessQueryDefinition' + type: object + FormulaAndFunctionResponseFormat: + description: Timeseries or Scalar response. This feature is currently in beta. + enum: + - timeseries + - scalar + type: string + x-enum-varnames: + - TIMESERIES + - SCALAR FreeTextWidgetDefinition: description: Free text is a widget that allows you to add headings to your screenboard. Commonly used to state the overall purpose of the dashboard. Only available @@ -4631,6 +4739,16 @@ components: required: - metric type: object + QuerySortOrder: + default: desc + description: Direction of sort. + enum: + - asc + - desc + type: string + x-enum-varnames: + - ASC + - DESC QueryValueWidgetDefinition: description: Query values display the current value of a given metric, APM, or log query. @@ -7456,6 +7574,146 @@ components: - STRING - INTEGER - DOUBLE + TimeSeriesFormulaAndFunctionEventQueryDefinition: + description: A timeseries formula and functions events query. + properties: + compute: + description: Compute options. + properties: + aggregation: + $ref: '#/components/schemas/FormulaAndFunctionEventAggregation' + interval: + description: A time interval in milliseconds. + example: 60000 + format: int64 + type: integer + metric: + description: Measurable attribute to compute. + example: '@duration' + type: string + required: + - aggregation + type: object + data_source: + $ref: '#/components/schemas/FormulaAndFunctionEventsDataSource' + group_by: + description: Group by options. + properties: + facet: + description: Event facet. + example: status. + type: string + limit: + description: Number of groups to return. + example: 10 + format: int64 + type: integer + sort: + description: Options for sorting group by results. + properties: + aggregation: + $ref: '#/components/schemas/FormulaAndFunctionEventAggregation' + metric: + description: Metric used for sorting group by results. + type: string + order: + $ref: '#/components/schemas/QuerySortOrder' + type: + $ref: '#/components/schemas/FormulaAndFunctionEventsSortType' + required: + - aggregation + type: object + required: + - facet + type: object + indexes: + description: An array of index names to query in the stream. Omit or use + `[]` to query all indexes at once. + example: + - days-3 + - days-7 + items: + description: A log index set up for your organization. For additional + indexes, see the [multiple indexes](https://docs.datadoghq.com/logs/indexes/#multiple-indexes) + documentation. + type: string + type: array + name: + description: Name of the query for use in formulas. + example: query_errors + type: string + search: + description: Search options. + properties: + query: + description: Events search string. + example: service:query + type: string + required: + - query + type: object + required: + - data_source + - compute + type: object + TimeSeriesFormulaAndFunctionMetricQueryDefinition: + description: A timeseries formula and functions metrics query. + example: + data_source: metrics + query: avg:system.cpu.user{*} + properties: + aggregator: + $ref: '#/components/schemas/FormulaAndFunctionMetricAggregation' + data_source: + $ref: '#/components/schemas/FormulaAndFunctionMetricDataSource' + name: + description: Name of the query for use in formulas. + example: my_query + type: string + query: + description: Metrics query definition. + example: avg:system.cpu.user{*} + type: string + required: + - data_source + - query + type: object + TimeSeriesFormulaAndFunctionProcessQueryDefinition: + description: Process query using formulas and functions. + properties: + aggregator: + $ref: '#/components/schemas/FormulaAndFunctionMetricAggregation' + data_source: + $ref: '#/components/schemas/FormulaAndFunctionProcessQueryDataSource' + is_normalized_cpu: + description: Whether to normalize the CPU percentages. + type: boolean + limit: + description: Number of hits to return. + format: int64 + type: integer + metric: + description: Process metric name. + example: avg:system.cpu.user{*} + type: string + name: + description: Name of query for use in formulas. + type: string + sort: + $ref: '#/components/schemas/QuerySortOrder' + tag_filters: + description: An array of tags to filter by. + items: + description: One of the tags to filter by. + type: string + type: array + text_filter: + description: Text to use as filter. + type: string + required: + - data_source + - metric + type: object TimeseriesWidgetDefinition: description: The timeseries visualization allows you to display the evolution of one or more metrics, log events, or Indexed Spans over time. @@ -7526,6 +7784,12 @@ components: $ref: '#/components/schemas/WidgetDisplayType' event_query: $ref: '#/components/schemas/LogQueryDefinition' + formulas: + description: List of formulas that operate on queries. This feature is currently + in beta. + items: + $ref: '#/components/schemas/WidgetFormula' + type: array log_query: $ref: '#/components/schemas/LogQueryDefinition' metadata: @@ -7554,6 +7818,14 @@ components: q: description: Widget query. type: string + queries: + description: List of queries that can be returned directly or used in formulas. + This feature is currently in beta. + items: + $ref: '#/components/schemas/FormulaAndFunctionQueryDefinition' + type: array + response_format: + $ref: '#/components/schemas/FormulaAndFunctionResponseFormat' rum_query: $ref: '#/components/schemas/LogQueryDefinition' security_query: @@ -9552,6 +9824,29 @@ components: - column - order type: object + WidgetFormula: + description: Formula to be used in a widget query. + properties: + alias: + description: Expression alias. + type: string + formula: + description: String expression built from queries, formulas, and functions. + example: func(a) + b + type: string + limit: + description: Options for limiting results returned. + properties: + count: + description: Number of results to return. + format: int64 + type: integer + order: + $ref: '#/components/schemas/QuerySortOrder' + type: object + required: + - formula + type: object WidgetGrouping: description: The kind of grouping to use. enum: diff --git a/docs/v1/FormulaAndFunctionEventAggregation.md b/docs/v1/FormulaAndFunctionEventAggregation.md new file mode 100644 index 000000000000..007c9f585dd3 --- /dev/null +++ b/docs/v1/FormulaAndFunctionEventAggregation.md @@ -0,0 +1,15 @@ +# DatadogAPIClient::V1::FormulaAndFunctionEventAggregation + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'datadog_api_client/v1' + +instance = DatadogAPIClient::V1::FormulaAndFunctionEventAggregation.new() +``` + diff --git a/docs/v1/FormulaAndFunctionEventsDataSource.md b/docs/v1/FormulaAndFunctionEventsDataSource.md new file mode 100644 index 000000000000..07c510456134 --- /dev/null +++ b/docs/v1/FormulaAndFunctionEventsDataSource.md @@ -0,0 +1,15 @@ +# DatadogAPIClient::V1::FormulaAndFunctionEventsDataSource + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'datadog_api_client/v1' + +instance = DatadogAPIClient::V1::FormulaAndFunctionEventsDataSource.new() +``` + diff --git a/docs/v1/FormulaAndFunctionEventsSortType.md b/docs/v1/FormulaAndFunctionEventsSortType.md new file mode 100644 index 000000000000..3eddb96264bd --- /dev/null +++ b/docs/v1/FormulaAndFunctionEventsSortType.md @@ -0,0 +1,15 @@ +# DatadogAPIClient::V1::FormulaAndFunctionEventsSortType + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'datadog_api_client/v1' + +instance = DatadogAPIClient::V1::FormulaAndFunctionEventsSortType.new() +``` + diff --git a/docs/v1/FormulaAndFunctionMetricAggregation.md b/docs/v1/FormulaAndFunctionMetricAggregation.md new file mode 100644 index 000000000000..da6c0a704122 --- /dev/null +++ b/docs/v1/FormulaAndFunctionMetricAggregation.md @@ -0,0 +1,15 @@ +# DatadogAPIClient::V1::FormulaAndFunctionMetricAggregation + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'datadog_api_client/v1' + +instance = DatadogAPIClient::V1::FormulaAndFunctionMetricAggregation.new() +``` + diff --git a/docs/v1/FormulaAndFunctionMetricDataSource.md b/docs/v1/FormulaAndFunctionMetricDataSource.md new file mode 100644 index 000000000000..4607b6764d54 --- /dev/null +++ b/docs/v1/FormulaAndFunctionMetricDataSource.md @@ -0,0 +1,15 @@ +# DatadogAPIClient::V1::FormulaAndFunctionMetricDataSource + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'datadog_api_client/v1' + +instance = DatadogAPIClient::V1::FormulaAndFunctionMetricDataSource.new() +``` + diff --git a/docs/v1/FormulaAndFunctionProcessQueryDataSource.md b/docs/v1/FormulaAndFunctionProcessQueryDataSource.md new file mode 100644 index 000000000000..66c649c22e5c --- /dev/null +++ b/docs/v1/FormulaAndFunctionProcessQueryDataSource.md @@ -0,0 +1,15 @@ +# DatadogAPIClient::V1::FormulaAndFunctionProcessQueryDataSource + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'datadog_api_client/v1' + +instance = DatadogAPIClient::V1::FormulaAndFunctionProcessQueryDataSource.new() +``` + diff --git a/docs/v1/FormulaAndFunctionQueryDefinition.md b/docs/v1/FormulaAndFunctionQueryDefinition.md new file mode 100644 index 000000000000..3ed6476a4477 --- /dev/null +++ b/docs/v1/FormulaAndFunctionQueryDefinition.md @@ -0,0 +1,51 @@ +# DatadogAPIClient::V1::FormulaAndFunctionQueryDefinition + +## Class instance methods + +### `openapi_one_of` + +Returns the list of classes defined in oneOf. + +#### Example + +```ruby +require 'datadog_api_client/v1' + +DatadogAPIClient::V1::FormulaAndFunctionQueryDefinition.openapi_one_of +# => +# [ +# :'TimeSeriesFormulaAndFunctionEventQueryDefinition', +# :'TimeSeriesFormulaAndFunctionMetricQueryDefinition', +# :'TimeSeriesFormulaAndFunctionProcessQueryDefinition' +# ] +``` + +### build + +Find the appropriate object from the `openapi_one_of` list and casts the data into it. + +#### Example + +```ruby +require 'datadog_api_client/v1' + +DatadogAPIClient::V1::FormulaAndFunctionQueryDefinition.build(data) +# => # + +DatadogAPIClient::V1::FormulaAndFunctionQueryDefinition.build(data_that_doesnt_match) +# => nil +``` + +#### Parameters + +| Name | Type | Description | +| ---- | ---- | ----------- | +| **data** | **Mixed** | data to be matched against the list of oneOf items | + +#### Return type + +- `TimeSeriesFormulaAndFunctionEventQueryDefinition` +- `TimeSeriesFormulaAndFunctionMetricQueryDefinition` +- `TimeSeriesFormulaAndFunctionProcessQueryDefinition` +- `nil` (if no type matches) + diff --git a/docs/v1/FormulaAndFunctionResponseFormat.md b/docs/v1/FormulaAndFunctionResponseFormat.md new file mode 100644 index 000000000000..90534a0e9c80 --- /dev/null +++ b/docs/v1/FormulaAndFunctionResponseFormat.md @@ -0,0 +1,15 @@ +# DatadogAPIClient::V1::FormulaAndFunctionResponseFormat + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'datadog_api_client/v1' + +instance = DatadogAPIClient::V1::FormulaAndFunctionResponseFormat.new() +``` + diff --git a/docs/v1/QuerySortOrder.md b/docs/v1/QuerySortOrder.md new file mode 100644 index 000000000000..18e36fb09841 --- /dev/null +++ b/docs/v1/QuerySortOrder.md @@ -0,0 +1,15 @@ +# DatadogAPIClient::V1::QuerySortOrder + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | + +## Example + +```ruby +require 'datadog_api_client/v1' + +instance = DatadogAPIClient::V1::QuerySortOrder.new() +``` + diff --git a/docs/v1/README.md b/docs/v1/README.md index 8489ced19cb1..74fe56dae01f 100644 --- a/docs/v1/README.md +++ b/docs/v1/README.md @@ -327,6 +327,14 @@ Class | Method | HTTP request | Description - [DatadogAPIClient::V1::EventStreamWidgetDefinitionType](EventStreamWidgetDefinitionType.md) - [DatadogAPIClient::V1::EventTimelineWidgetDefinition](EventTimelineWidgetDefinition.md) - [DatadogAPIClient::V1::EventTimelineWidgetDefinitionType](EventTimelineWidgetDefinitionType.md) + - [DatadogAPIClient::V1::FormulaAndFunctionEventAggregation](FormulaAndFunctionEventAggregation.md) + - [DatadogAPIClient::V1::FormulaAndFunctionEventsDataSource](FormulaAndFunctionEventsDataSource.md) + - [DatadogAPIClient::V1::FormulaAndFunctionEventsSortType](FormulaAndFunctionEventsSortType.md) + - [DatadogAPIClient::V1::FormulaAndFunctionMetricAggregation](FormulaAndFunctionMetricAggregation.md) + - [DatadogAPIClient::V1::FormulaAndFunctionMetricDataSource](FormulaAndFunctionMetricDataSource.md) + - [DatadogAPIClient::V1::FormulaAndFunctionProcessQueryDataSource](FormulaAndFunctionProcessQueryDataSource.md) + - [DatadogAPIClient::V1::FormulaAndFunctionQueryDefinition](FormulaAndFunctionQueryDefinition.md) + - [DatadogAPIClient::V1::FormulaAndFunctionResponseFormat](FormulaAndFunctionResponseFormat.md) - [DatadogAPIClient::V1::FreeTextWidgetDefinition](FreeTextWidgetDefinition.md) - [DatadogAPIClient::V1::FreeTextWidgetDefinitionType](FreeTextWidgetDefinitionType.md) - [DatadogAPIClient::V1::GCPAccount](GCPAccount.md) @@ -459,6 +467,7 @@ Class | Method | HTTP request | Description - [DatadogAPIClient::V1::PagerDutyServiceKey](PagerDutyServiceKey.md) - [DatadogAPIClient::V1::PagerDutyServiceName](PagerDutyServiceName.md) - [DatadogAPIClient::V1::ProcessQueryDefinition](ProcessQueryDefinition.md) + - [DatadogAPIClient::V1::QuerySortOrder](QuerySortOrder.md) - [DatadogAPIClient::V1::QueryValueWidgetDefinition](QueryValueWidgetDefinition.md) - [DatadogAPIClient::V1::QueryValueWidgetDefinitionType](QueryValueWidgetDefinitionType.md) - [DatadogAPIClient::V1::QueryValueWidgetRequest](QueryValueWidgetRequest.md) @@ -593,6 +602,13 @@ Class | Method | HTTP request | Description - [DatadogAPIClient::V1::TableWidgetRequest](TableWidgetRequest.md) - [DatadogAPIClient::V1::TagToHosts](TagToHosts.md) - [DatadogAPIClient::V1::TargetFormatType](TargetFormatType.md) + - [DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinition](TimeSeriesFormulaAndFunctionEventQueryDefinition.md) + - [DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionCompute](TimeSeriesFormulaAndFunctionEventQueryDefinitionCompute.md) + - [DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBy](TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBy.md) + - [DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBySort](TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBySort.md) + - [DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionSearch](TimeSeriesFormulaAndFunctionEventQueryDefinitionSearch.md) + - [DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionMetricQueryDefinition](TimeSeriesFormulaAndFunctionMetricQueryDefinition.md) + - [DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionProcessQueryDefinition](TimeSeriesFormulaAndFunctionProcessQueryDefinition.md) - [DatadogAPIClient::V1::TimeseriesWidgetDefinition](TimeseriesWidgetDefinition.md) - [DatadogAPIClient::V1::TimeseriesWidgetDefinitionType](TimeseriesWidgetDefinitionType.md) - [DatadogAPIClient::V1::TimeseriesWidgetRequest](TimeseriesWidgetRequest.md) @@ -688,6 +704,8 @@ Class | Method | HTTP request | Description - [DatadogAPIClient::V1::WidgetEvent](WidgetEvent.md) - [DatadogAPIClient::V1::WidgetEventSize](WidgetEventSize.md) - [DatadogAPIClient::V1::WidgetFieldSort](WidgetFieldSort.md) + - [DatadogAPIClient::V1::WidgetFormula](WidgetFormula.md) + - [DatadogAPIClient::V1::WidgetFormulaLimit](WidgetFormulaLimit.md) - [DatadogAPIClient::V1::WidgetGrouping](WidgetGrouping.md) - [DatadogAPIClient::V1::WidgetImageSizing](WidgetImageSizing.md) - [DatadogAPIClient::V1::WidgetLayout](WidgetLayout.md) diff --git a/docs/v1/TimeSeriesFormulaAndFunctionEventQueryDefinition.md b/docs/v1/TimeSeriesFormulaAndFunctionEventQueryDefinition.md new file mode 100644 index 000000000000..c02a18b6e57c --- /dev/null +++ b/docs/v1/TimeSeriesFormulaAndFunctionEventQueryDefinition.md @@ -0,0 +1,28 @@ +# DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinition + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **compute** | [**TimeSeriesFormulaAndFunctionEventQueryDefinitionCompute**](TimeSeriesFormulaAndFunctionEventQueryDefinitionCompute.md) | | | +| **data_source** | [**FormulaAndFunctionEventsDataSource**](FormulaAndFunctionEventsDataSource.md) | | | +| **group_by** | [**TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBy**](TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBy.md) | | [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] | +| **search** | [**TimeSeriesFormulaAndFunctionEventQueryDefinitionSearch**](TimeSeriesFormulaAndFunctionEventQueryDefinitionSearch.md) | | [optional] | + +## Example + +```ruby +require 'datadog_api_client/v1' + +instance = DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinition.new( + compute: null, + data_source: null, + group_by: null, + indexes: ["days-3","days-7"], + name: query_errors, + search: null +) +``` + diff --git a/docs/v1/TimeSeriesFormulaAndFunctionEventQueryDefinitionCompute.md b/docs/v1/TimeSeriesFormulaAndFunctionEventQueryDefinitionCompute.md new file mode 100644 index 000000000000..a00e7733125d --- /dev/null +++ b/docs/v1/TimeSeriesFormulaAndFunctionEventQueryDefinitionCompute.md @@ -0,0 +1,22 @@ +# DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionCompute + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **aggregation** | [**FormulaAndFunctionEventAggregation**](FormulaAndFunctionEventAggregation.md) | | | +| **interval** | **Integer** | A time interval in milliseconds. | [optional] | +| **metric** | **String** | Measurable attribute to compute. | [optional] | + +## Example + +```ruby +require 'datadog_api_client/v1' + +instance = DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionCompute.new( + aggregation: null, + interval: 60000, + metric: @duration +) +``` + diff --git a/docs/v1/TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBy.md b/docs/v1/TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBy.md new file mode 100644 index 000000000000..fea1141ee911 --- /dev/null +++ b/docs/v1/TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBy.md @@ -0,0 +1,22 @@ +# DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBy + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **facet** | **String** | Event facet. | | +| **limit** | **Integer** | Number of groups to return. | [optional] | +| **sort** | [**TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBySort**](TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBySort.md) | | [optional] | + +## Example + +```ruby +require 'datadog_api_client/v1' + +instance = DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBy.new( + facet: status., + limit: 10, + sort: null +) +``` + diff --git a/docs/v1/TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBySort.md b/docs/v1/TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBySort.md new file mode 100644 index 000000000000..f601f1f8f285 --- /dev/null +++ b/docs/v1/TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBySort.md @@ -0,0 +1,24 @@ +# DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBySort + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **aggregation** | [**FormulaAndFunctionEventAggregation**](FormulaAndFunctionEventAggregation.md) | | | +| **metric** | **String** | Metric used for sorting group by results. | [optional] | +| **order** | [**QuerySortOrder**](QuerySortOrder.md) | | [optional][default to 'desc'] | +| **type** | [**FormulaAndFunctionEventsSortType**](FormulaAndFunctionEventsSortType.md) | | [optional] | + +## Example + +```ruby +require 'datadog_api_client/v1' + +instance = DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBySort.new( + aggregation: null, + metric: null, + order: null, + type: null +) +``` + diff --git a/docs/v1/TimeSeriesFormulaAndFunctionEventQueryDefinitionSearch.md b/docs/v1/TimeSeriesFormulaAndFunctionEventQueryDefinitionSearch.md new file mode 100644 index 000000000000..735baba6d66c --- /dev/null +++ b/docs/v1/TimeSeriesFormulaAndFunctionEventQueryDefinitionSearch.md @@ -0,0 +1,18 @@ +# DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionSearch + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **query** | **String** | Events search string. | | + +## Example + +```ruby +require 'datadog_api_client/v1' + +instance = DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionSearch.new( + query: service:query +) +``` + diff --git a/docs/v1/TimeSeriesFormulaAndFunctionMetricQueryDefinition.md b/docs/v1/TimeSeriesFormulaAndFunctionMetricQueryDefinition.md new file mode 100644 index 000000000000..3f54468ece77 --- /dev/null +++ b/docs/v1/TimeSeriesFormulaAndFunctionMetricQueryDefinition.md @@ -0,0 +1,24 @@ +# DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionMetricQueryDefinition + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **aggregator** | [**FormulaAndFunctionMetricAggregation**](FormulaAndFunctionMetricAggregation.md) | | [optional] | +| **data_source** | [**FormulaAndFunctionMetricDataSource**](FormulaAndFunctionMetricDataSource.md) | | | +| **name** | **String** | Name of the query for use in formulas. | [optional] | +| **query** | **String** | Metrics query definition. | | + +## Example + +```ruby +require 'datadog_api_client/v1' + +instance = DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionMetricQueryDefinition.new( + aggregator: null, + data_source: null, + name: my_query, + query: avg:system.cpu.user{*} +) +``` + diff --git a/docs/v1/TimeSeriesFormulaAndFunctionProcessQueryDefinition.md b/docs/v1/TimeSeriesFormulaAndFunctionProcessQueryDefinition.md new file mode 100644 index 000000000000..853185fa445c --- /dev/null +++ b/docs/v1/TimeSeriesFormulaAndFunctionProcessQueryDefinition.md @@ -0,0 +1,34 @@ +# DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionProcessQueryDefinition + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **aggregator** | [**FormulaAndFunctionMetricAggregation**](FormulaAndFunctionMetricAggregation.md) | | [optional] | +| **data_source** | [**FormulaAndFunctionProcessQueryDataSource**](FormulaAndFunctionProcessQueryDataSource.md) | | | +| **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] | +| **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] | + +## Example + +```ruby +require 'datadog_api_client/v1' + +instance = DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionProcessQueryDefinition.new( + aggregator: null, + data_source: null, + is_normalized_cpu: null, + limit: null, + metric: avg:system.cpu.user{*}, + name: null, + sort: null, + tag_filters: null, + text_filter: null +) +``` + diff --git a/docs/v1/TimeseriesWidgetRequest.md b/docs/v1/TimeseriesWidgetRequest.md index 8515d3304e93..514338ee2bc9 100644 --- a/docs/v1/TimeseriesWidgetRequest.md +++ b/docs/v1/TimeseriesWidgetRequest.md @@ -7,12 +7,15 @@ | **apm_query** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] | | **display_type** | [**WidgetDisplayType**](WidgetDisplayType.md) | | [optional] | | **event_query** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] | +| **formulas** | [**Array<WidgetFormula>**](WidgetFormula.md) | List of formulas that operate on queries. This feature is currently in beta. | [optional] | | **log_query** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] | | **metadata** | [**Array<TimeseriesWidgetRequestMetadata>**](TimeseriesWidgetRequestMetadata.md) | Used to define expression aliases. | [optional] | | **network_query** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] | | **on_right_yaxis** | **Boolean** | Whether or not to display a second y-axis on the right. | [optional] | | **process_query** | [**ProcessQueryDefinition**](ProcessQueryDefinition.md) | | [optional] | | **q** | **String** | Widget query. | [optional] | +| **queries** | [**Array<FormulaAndFunctionQueryDefinition>**](FormulaAndFunctionQueryDefinition.md) | List of queries that can be returned directly or used in formulas. This feature is currently in beta. | [optional] | +| **response_format** | [**FormulaAndFunctionResponseFormat**](FormulaAndFunctionResponseFormat.md) | | [optional] | | **rum_query** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] | | **security_query** | [**LogQueryDefinition**](LogQueryDefinition.md) | | [optional] | | **style** | [**WidgetRequestStyle**](WidgetRequestStyle.md) | | [optional] | @@ -26,12 +29,15 @@ instance = DatadogAPIClient::V1::TimeseriesWidgetRequest.new( apm_query: null, display_type: null, event_query: null, + formulas: null, log_query: null, metadata: null, network_query: null, on_right_yaxis: null, process_query: null, q: null, + queries: null, + response_format: null, rum_query: null, security_query: null, style: null diff --git a/docs/v1/WidgetFormula.md b/docs/v1/WidgetFormula.md new file mode 100644 index 000000000000..54f2b0ab6ac2 --- /dev/null +++ b/docs/v1/WidgetFormula.md @@ -0,0 +1,22 @@ +# DatadogAPIClient::V1::WidgetFormula + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **_alias** | **String** | Expression alias. | [optional] | +| **formula** | **String** | String expression built from queries, formulas, and functions. | | +| **limit** | [**WidgetFormulaLimit**](WidgetFormulaLimit.md) | | [optional] | + +## Example + +```ruby +require 'datadog_api_client/v1' + +instance = DatadogAPIClient::V1::WidgetFormula.new( + _alias: null, + formula: func(a) + b, + limit: null +) +``` + diff --git a/docs/v1/WidgetFormulaLimit.md b/docs/v1/WidgetFormulaLimit.md new file mode 100644 index 000000000000..9bf4fcd54864 --- /dev/null +++ b/docs/v1/WidgetFormulaLimit.md @@ -0,0 +1,20 @@ +# DatadogAPIClient::V1::WidgetFormulaLimit + +## Properties + +| Name | Type | Description | Notes | +| ---- | ---- | ----------- | ----- | +| **count** | **Integer** | Number of results to return. | [optional] | +| **order** | [**QuerySortOrder**](QuerySortOrder.md) | | [optional][default to 'desc'] | + +## Example + +```ruby +require 'datadog_api_client/v1' + +instance = DatadogAPIClient::V1::WidgetFormulaLimit.new( + count: null, + order: null +) +``` + diff --git a/lib/datadog_api_client/v1.rb b/lib/datadog_api_client/v1.rb index da5a1e101780..1d71c00f6dbb 100644 --- a/lib/datadog_api_client/v1.rb +++ b/lib/datadog_api_client/v1.rb @@ -91,6 +91,14 @@ require 'datadog_api_client/v1/models/event_stream_widget_definition_type' require 'datadog_api_client/v1/models/event_timeline_widget_definition' require 'datadog_api_client/v1/models/event_timeline_widget_definition_type' +require 'datadog_api_client/v1/models/formula_and_function_event_aggregation' +require 'datadog_api_client/v1/models/formula_and_function_events_data_source' +require 'datadog_api_client/v1/models/formula_and_function_events_sort_type' +require 'datadog_api_client/v1/models/formula_and_function_metric_aggregation' +require 'datadog_api_client/v1/models/formula_and_function_metric_data_source' +require 'datadog_api_client/v1/models/formula_and_function_process_query_data_source' +require 'datadog_api_client/v1/models/formula_and_function_query_definition' +require 'datadog_api_client/v1/models/formula_and_function_response_format' require 'datadog_api_client/v1/models/free_text_widget_definition' require 'datadog_api_client/v1/models/free_text_widget_definition_type' require 'datadog_api_client/v1/models/gcp_account' @@ -223,6 +231,7 @@ require 'datadog_api_client/v1/models/pager_duty_service_key' require 'datadog_api_client/v1/models/pager_duty_service_name' require 'datadog_api_client/v1/models/process_query_definition' +require 'datadog_api_client/v1/models/query_sort_order' require 'datadog_api_client/v1/models/query_value_widget_definition' require 'datadog_api_client/v1/models/query_value_widget_definition_type' require 'datadog_api_client/v1/models/query_value_widget_request' @@ -357,6 +366,13 @@ require 'datadog_api_client/v1/models/table_widget_request' require 'datadog_api_client/v1/models/tag_to_hosts' require 'datadog_api_client/v1/models/target_format_type' +require 'datadog_api_client/v1/models/time_series_formula_and_function_event_query_definition' +require 'datadog_api_client/v1/models/time_series_formula_and_function_event_query_definition_compute' +require 'datadog_api_client/v1/models/time_series_formula_and_function_event_query_definition_group_by' +require 'datadog_api_client/v1/models/time_series_formula_and_function_event_query_definition_group_by_sort' +require 'datadog_api_client/v1/models/time_series_formula_and_function_event_query_definition_search' +require 'datadog_api_client/v1/models/time_series_formula_and_function_metric_query_definition' +require 'datadog_api_client/v1/models/time_series_formula_and_function_process_query_definition' require 'datadog_api_client/v1/models/timeseries_widget_definition' require 'datadog_api_client/v1/models/timeseries_widget_definition_type' require 'datadog_api_client/v1/models/timeseries_widget_request' @@ -452,6 +468,8 @@ require 'datadog_api_client/v1/models/widget_event' require 'datadog_api_client/v1/models/widget_event_size' require 'datadog_api_client/v1/models/widget_field_sort' +require 'datadog_api_client/v1/models/widget_formula' +require 'datadog_api_client/v1/models/widget_formula_limit' require 'datadog_api_client/v1/models/widget_grouping' require 'datadog_api_client/v1/models/widget_image_sizing' require 'datadog_api_client/v1/models/widget_layout' diff --git a/lib/datadog_api_client/v1/models/formula_and_function_event_aggregation.rb b/lib/datadog_api_client/v1/models/formula_and_function_event_aggregation.rb new file mode 100644 index 000000000000..e1dddcfa4432 --- /dev/null +++ b/lib/datadog_api_client/v1/models/formula_and_function_event_aggregation.rb @@ -0,0 +1,49 @@ +=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://openapi-generator.tech + + 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 + class FormulaAndFunctionEventAggregation + COUNT = "count".freeze + CARDINALITY = "cardinality".freeze + PC75 = "pc75".freeze + PC90 = "pc90".freeze + PC95 = "pc95".freeze + PC98 = "pc98".freeze + PC99 = "pc99".freeze + SUM = "sum".freeze + MIN = "min".freeze + MAX = "max".freeze + AVG = "avg".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = FormulaAndFunctionEventAggregation.constants.select { |c| FormulaAndFunctionEventAggregation::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #FormulaAndFunctionEventAggregation" if constantValues.empty? + value + end + end +end diff --git a/lib/datadog_api_client/v1/models/formula_and_function_events_data_source.rb b/lib/datadog_api_client/v1/models/formula_and_function_events_data_source.rb new file mode 100644 index 000000000000..6c4c8102e3a0 --- /dev/null +++ b/lib/datadog_api_client/v1/models/formula_and_function_events_data_source.rb @@ -0,0 +1,44 @@ +=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://openapi-generator.tech + + 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 + class FormulaAndFunctionEventsDataSource + LOGS = "logs".freeze + ANALYZED_SPANS = "analyzed_spans".freeze + NETWORK = "network".freeze + RUM = "rum".freeze + SECURITY_SIGNALS = "security_signals".freeze + PROFILES = "profiles".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = FormulaAndFunctionEventsDataSource.constants.select { |c| FormulaAndFunctionEventsDataSource::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #FormulaAndFunctionEventsDataSource" if constantValues.empty? + value + end + end +end diff --git a/lib/datadog_api_client/v1/models/formula_and_function_events_sort_type.rb b/lib/datadog_api_client/v1/models/formula_and_function_events_sort_type.rb new file mode 100644 index 000000000000..a9a4c44cd94f --- /dev/null +++ b/lib/datadog_api_client/v1/models/formula_and_function_events_sort_type.rb @@ -0,0 +1,40 @@ +=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://openapi-generator.tech + + 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 + class FormulaAndFunctionEventsSortType + ALPHABETICAL = "alphabetical".freeze + MEASURE = "measure".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = FormulaAndFunctionEventsSortType.constants.select { |c| FormulaAndFunctionEventsSortType::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #FormulaAndFunctionEventsSortType" if constantValues.empty? + value + end + end +end diff --git a/lib/datadog_api_client/v1/models/formula_and_function_metric_aggregation.rb b/lib/datadog_api_client/v1/models/formula_and_function_metric_aggregation.rb new file mode 100644 index 000000000000..1212cc6a2905 --- /dev/null +++ b/lib/datadog_api_client/v1/models/formula_and_function_metric_aggregation.rb @@ -0,0 +1,45 @@ +=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://openapi-generator.tech + + 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 + class FormulaAndFunctionMetricAggregation + AVG = "avg".freeze + MIN = "min".freeze + MAX = "max".freeze + SUM = "sum".freeze + LAST = "last".freeze + AREA = "area".freeze + L2NORM = "l2norm".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = FormulaAndFunctionMetricAggregation.constants.select { |c| FormulaAndFunctionMetricAggregation::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #FormulaAndFunctionMetricAggregation" if constantValues.empty? + value + end + end +end diff --git a/lib/datadog_api_client/v1/models/formula_and_function_metric_data_source.rb b/lib/datadog_api_client/v1/models/formula_and_function_metric_data_source.rb new file mode 100644 index 000000000000..92dd1ef06639 --- /dev/null +++ b/lib/datadog_api_client/v1/models/formula_and_function_metric_data_source.rb @@ -0,0 +1,39 @@ +=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://openapi-generator.tech + + 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 + class FormulaAndFunctionMetricDataSource + METRICS = "metrics".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = FormulaAndFunctionMetricDataSource.constants.select { |c| FormulaAndFunctionMetricDataSource::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #FormulaAndFunctionMetricDataSource" if constantValues.empty? + value + end + end +end diff --git a/lib/datadog_api_client/v1/models/formula_and_function_process_query_data_source.rb b/lib/datadog_api_client/v1/models/formula_and_function_process_query_data_source.rb new file mode 100644 index 000000000000..f1694f238411 --- /dev/null +++ b/lib/datadog_api_client/v1/models/formula_and_function_process_query_data_source.rb @@ -0,0 +1,40 @@ +=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://openapi-generator.tech + + 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 + class FormulaAndFunctionProcessQueryDataSource + PROCESS = "process".freeze + CONTAINER = "container".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = FormulaAndFunctionProcessQueryDataSource.constants.select { |c| FormulaAndFunctionProcessQueryDataSource::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #FormulaAndFunctionProcessQueryDataSource" if constantValues.empty? + value + end + end +end diff --git a/lib/datadog_api_client/v1/models/formula_and_function_query_definition.rb b/lib/datadog_api_client/v1/models/formula_and_function_query_definition.rb new file mode 100644 index 000000000000..32e5c93bc2b4 --- /dev/null +++ b/lib/datadog_api_client/v1/models/formula_and_function_query_definition.rb @@ -0,0 +1,110 @@ +=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://openapi-generator.tech + + 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 + # A formula and function query. + module FormulaAndFunctionQueryDefinition + class << self + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'TimeSeriesFormulaAndFunctionEventQueryDefinition', + :'TimeSeriesFormulaAndFunctionMetricQueryDefinition', + :'TimeSeriesFormulaAndFunctionProcessQueryDefinition' + ] + end + + # Builds the object + # @param [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are defacto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + openapi_one_of.include?(:AnyType) ? data : nil + end + + private + + SchemaMismatchError = Class.new(StandardError) + + # Note: 'File' is missing here because in the regular case we get the data _after_ a call to JSON.parse. + def find_and_cast_into_type(klass, data) + return if data.nil? + + case klass.to_s + when 'Boolean' + return data if data.instance_of?(TrueClass) || data.instance_of?(FalseClass) + when 'Float' + return data if data.instance_of?(Float) + when 'Integer' + return data if data.instance_of?(Integer) + when 'Time' + return Time.parse(data) + when 'Date' + return Date.parse(data) + when 'String' + return data if data.instance_of?(String) + when 'Object' # "type: object" + return data if data.instance_of?(Hash) + when /\AArray<(?.+)>\z/ # "type: array" + if data.instance_of?(Array) + sub_type = Regexp.last_match[:sub_type] + return data.map { |item| find_and_cast_into_type(sub_type, item) } + end + when /\AHash.+)>\z/ # "type: object" with "additionalProperties: { ... }" + if data.instance_of?(Hash) && data.keys.all? { |k| k.instance_of?(Symbol) || k.instance_of?(String) } + sub_type = Regexp.last_match[:sub_type] + return data.each_with_object({}) { |(k, v), hsh| hsh[k] = find_and_cast_into_type(sub_type, v) } + end + else # model + const = DatadogAPIClient::V1.const_get(klass) + if const + if const.respond_to?(:openapi_one_of) # nested oneOf model + model = const.build(data) + return model if model + else + # raise if data contains keys that are not known to the model + raise unless (data.keys - const.acceptable_attributes).empty? + model = const.build_from_hash(data) + return model if model && model.valid? + end + end + end + + raise # if no match by now, raise + rescue + raise SchemaMismatchError, "#{data} doesn't match the #{klass} type" + end + end + end + +end diff --git a/lib/datadog_api_client/v1/models/formula_and_function_response_format.rb b/lib/datadog_api_client/v1/models/formula_and_function_response_format.rb new file mode 100644 index 000000000000..cfa201799082 --- /dev/null +++ b/lib/datadog_api_client/v1/models/formula_and_function_response_format.rb @@ -0,0 +1,40 @@ +=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://openapi-generator.tech + + 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 + class FormulaAndFunctionResponseFormat + TIMESERIES = "timeseries".freeze + SCALAR = "scalar".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = FormulaAndFunctionResponseFormat.constants.select { |c| FormulaAndFunctionResponseFormat::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #FormulaAndFunctionResponseFormat" if constantValues.empty? + value + end + end +end diff --git a/lib/datadog_api_client/v1/models/query_sort_order.rb b/lib/datadog_api_client/v1/models/query_sort_order.rb new file mode 100644 index 000000000000..6a8dbeaf284a --- /dev/null +++ b/lib/datadog_api_client/v1/models/query_sort_order.rb @@ -0,0 +1,40 @@ +=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://openapi-generator.tech + + 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 + class QuerySortOrder + ASC = "asc".freeze + DESC = "desc".freeze + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def self.build_from_hash(value) + new.build_from_hash(value) + end + + # Builds the enum from string + # @param [String] The enum value in the form of the string + # @return [String] The enum value + def build_from_hash(value) + constantValues = QuerySortOrder.constants.select { |c| QuerySortOrder::const_get(c) == value } + raise "Invalid ENUM value #{value} for class #QuerySortOrder" if constantValues.empty? + value + end + end +end diff --git a/lib/datadog_api_client/v1/models/time_series_formula_and_function_event_query_definition.rb b/lib/datadog_api_client/v1/models/time_series_formula_and_function_event_query_definition.rb new file mode 100644 index 000000000000..3b46f9430426 --- /dev/null +++ b/lib/datadog_api_client/v1/models/time_series_formula_and_function_event_query_definition.rb @@ -0,0 +1,281 @@ +=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://openapi-generator.tech + + 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 + # A timeseries formula and functions events query. + class TimeSeriesFormulaAndFunctionEventQueryDefinition + attr_accessor :compute + + attr_accessor :data_source + + attr_accessor :group_by + + # An array of index names to query in the stream. Omit or use `[]` to query all indexes at once. + attr_accessor :indexes + + # Name of the query for use in formulas. + attr_accessor :name + + attr_accessor :search + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'compute' => :'compute', + :'data_source' => :'data_source', + :'group_by' => :'group_by', + :'indexes' => :'indexes', + :'name' => :'name', + :'search' => :'search' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'compute' => :'TimeSeriesFormulaAndFunctionEventQueryDefinitionCompute', + :'data_source' => :'FormulaAndFunctionEventsDataSource', + :'group_by' => :'TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBy', + :'indexes' => :'Array', + :'name' => :'String', + :'search' => :'TimeSeriesFormulaAndFunctionEventQueryDefinitionSearch' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinition` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinition`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'compute') + self.compute = attributes[:'compute'] + end + + if attributes.key?(:'data_source') + self.data_source = attributes[:'data_source'] + end + + if attributes.key?(:'group_by') + self.group_by = attributes[:'group_by'] + end + + if attributes.key?(:'indexes') + if (value = attributes[:'indexes']).is_a?(Array) + self.indexes = value + end + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'search') + self.search = attributes[:'search'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @compute.nil? + invalid_properties.push('invalid value for "compute", compute cannot be nil.') + end + + if @data_source.nil? + invalid_properties.push('invalid value for "data_source", data_source cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @compute.nil? + return false if @data_source.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + compute == o.compute && + data_source == o.data_source && + group_by == o.group_by && + indexes == o.indexes && + name == o.name && + search == o.search + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [compute, data_source, group_by, indexes, name, search].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = DatadogAPIClient::V1.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + 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 + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/datadog_api_client/v1/models/time_series_formula_and_function_event_query_definition_compute.rb b/lib/datadog_api_client/v1/models/time_series_formula_and_function_event_query_definition_compute.rb new file mode 100644 index 000000000000..28a801ec43f5 --- /dev/null +++ b/lib/datadog_api_client/v1/models/time_series_formula_and_function_event_query_definition_compute.rb @@ -0,0 +1,247 @@ +=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://openapi-generator.tech + + 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 + # Compute options. + class TimeSeriesFormulaAndFunctionEventQueryDefinitionCompute + attr_accessor :aggregation + + # A time interval in milliseconds. + attr_accessor :interval + + # Measurable attribute to compute. + attr_accessor :metric + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'aggregation' => :'aggregation', + :'interval' => :'interval', + :'metric' => :'metric' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'aggregation' => :'FormulaAndFunctionEventAggregation', + :'interval' => :'Integer', + :'metric' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionCompute` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionCompute`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'aggregation') + self.aggregation = attributes[:'aggregation'] + end + + if attributes.key?(:'interval') + self.interval = attributes[:'interval'] + end + + if attributes.key?(:'metric') + self.metric = attributes[:'metric'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @aggregation.nil? + invalid_properties.push('invalid value for "aggregation", aggregation cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @aggregation.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + aggregation == o.aggregation && + interval == o.interval && + metric == o.metric + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [aggregation, interval, metric].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = DatadogAPIClient::V1.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + 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 + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/datadog_api_client/v1/models/time_series_formula_and_function_event_query_definition_group_by.rb b/lib/datadog_api_client/v1/models/time_series_formula_and_function_event_query_definition_group_by.rb new file mode 100644 index 000000000000..4589ad92b801 --- /dev/null +++ b/lib/datadog_api_client/v1/models/time_series_formula_and_function_event_query_definition_group_by.rb @@ -0,0 +1,247 @@ +=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://openapi-generator.tech + + 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 + # Group by options. + class TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBy + # Event facet. + attr_accessor :facet + + # Number of groups to return. + attr_accessor :limit + + attr_accessor :sort + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'facet' => :'facet', + :'limit' => :'limit', + :'sort' => :'sort' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'facet' => :'String', + :'limit' => :'Integer', + :'sort' => :'TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBySort' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBy` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBy`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'facet') + self.facet = attributes[:'facet'] + end + + if attributes.key?(:'limit') + self.limit = attributes[:'limit'] + end + + if attributes.key?(:'sort') + self.sort = attributes[:'sort'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @facet.nil? + invalid_properties.push('invalid value for "facet", facet cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @facet.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + facet == o.facet && + limit == o.limit && + sort == o.sort + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [facet, limit, sort].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = DatadogAPIClient::V1.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + 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 + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/datadog_api_client/v1/models/time_series_formula_and_function_event_query_definition_group_by_sort.rb b/lib/datadog_api_client/v1/models/time_series_formula_and_function_event_query_definition_group_by_sort.rb new file mode 100644 index 000000000000..784b3c5859f4 --- /dev/null +++ b/lib/datadog_api_client/v1/models/time_series_formula_and_function_event_query_definition_group_by_sort.rb @@ -0,0 +1,257 @@ +=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://openapi-generator.tech + + 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 + # Options for sorting group by results. + class TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBySort + attr_accessor :aggregation + + # Metric used for sorting group by results. + attr_accessor :metric + + attr_accessor :order + + attr_accessor :type + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'aggregation' => :'aggregation', + :'metric' => :'metric', + :'order' => :'order', + :'type' => :'type' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'aggregation' => :'FormulaAndFunctionEventAggregation', + :'metric' => :'String', + :'order' => :'QuerySortOrder', + :'type' => :'FormulaAndFunctionEventsSortType' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBySort` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBySort`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'aggregation') + self.aggregation = attributes[:'aggregation'] + end + + if attributes.key?(:'metric') + self.metric = attributes[:'metric'] + end + + if attributes.key?(:'order') + self.order = attributes[:'order'] + else + self.order = 'desc' + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @aggregation.nil? + invalid_properties.push('invalid value for "aggregation", aggregation cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @aggregation.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + aggregation == o.aggregation && + metric == o.metric && + order == o.order && + type == o.type + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [aggregation, metric, order, type].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = DatadogAPIClient::V1.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + 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 + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/datadog_api_client/v1/models/time_series_formula_and_function_event_query_definition_search.rb b/lib/datadog_api_client/v1/models/time_series_formula_and_function_event_query_definition_search.rb new file mode 100644 index 000000000000..512e843e7488 --- /dev/null +++ b/lib/datadog_api_client/v1/models/time_series_formula_and_function_event_query_definition_search.rb @@ -0,0 +1,228 @@ +=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://openapi-generator.tech + + 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 + # Search options. + class TimeSeriesFormulaAndFunctionEventQueryDefinitionSearch + # Events search string. + attr_accessor :query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'query' => :'query' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'query' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionSearch` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionSearch`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @query.nil? + invalid_properties.push('invalid value for "query", query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @query.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + query == o.query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [query].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = DatadogAPIClient::V1.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + 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 + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/datadog_api_client/v1/models/time_series_formula_and_function_metric_query_definition.rb b/lib/datadog_api_client/v1/models/time_series_formula_and_function_metric_query_definition.rb new file mode 100644 index 000000000000..8aeb75541512 --- /dev/null +++ b/lib/datadog_api_client/v1/models/time_series_formula_and_function_metric_query_definition.rb @@ -0,0 +1,261 @@ +=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://openapi-generator.tech + + 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 + # A timeseries formula and functions metrics query. + class TimeSeriesFormulaAndFunctionMetricQueryDefinition + attr_accessor :aggregator + + attr_accessor :data_source + + # Name of the query for use in formulas. + attr_accessor :name + + # Metrics query definition. + attr_accessor :query + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'aggregator' => :'aggregator', + :'data_source' => :'data_source', + :'name' => :'name', + :'query' => :'query' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'aggregator' => :'FormulaAndFunctionMetricAggregation', + :'data_source' => :'FormulaAndFunctionMetricDataSource', + :'name' => :'String', + :'query' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionMetricQueryDefinition` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionMetricQueryDefinition`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'aggregator') + self.aggregator = attributes[:'aggregator'] + end + + if attributes.key?(:'data_source') + self.data_source = attributes[:'data_source'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @data_source.nil? + invalid_properties.push('invalid value for "data_source", data_source cannot be nil.') + end + + if @query.nil? + invalid_properties.push('invalid value for "query", query cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @data_source.nil? + return false if @query.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + aggregator == o.aggregator && + data_source == o.data_source && + name == o.name && + query == o.query + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [aggregator, data_source, name, query].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = DatadogAPIClient::V1.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + 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 + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/datadog_api_client/v1/models/time_series_formula_and_function_process_query_definition.rb b/lib/datadog_api_client/v1/models/time_series_formula_and_function_process_query_definition.rb new file mode 100644 index 000000000000..3cc37ef43214 --- /dev/null +++ b/lib/datadog_api_client/v1/models/time_series_formula_and_function_process_query_definition.rb @@ -0,0 +1,314 @@ +=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://openapi-generator.tech + + 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 + # Process query using formulas and functions. + class TimeSeriesFormulaAndFunctionProcessQueryDefinition + attr_accessor :aggregator + + attr_accessor :data_source + + # Whether to normalize the CPU percentages. + attr_accessor :is_normalized_cpu + + # Number of hits to return. + attr_accessor :limit + + # Process metric name. + attr_accessor :metric + + # Name of query for use in formulas. + attr_accessor :name + + attr_accessor :sort + + # An array of tags to filter by. + attr_accessor :tag_filters + + # Text to use as filter. + attr_accessor :text_filter + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'aggregator' => :'aggregator', + :'data_source' => :'data_source', + :'is_normalized_cpu' => :'is_normalized_cpu', + :'limit' => :'limit', + :'metric' => :'metric', + :'name' => :'name', + :'sort' => :'sort', + :'tag_filters' => :'tag_filters', + :'text_filter' => :'text_filter' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'aggregator' => :'FormulaAndFunctionMetricAggregation', + :'data_source' => :'FormulaAndFunctionProcessQueryDataSource', + :'is_normalized_cpu' => :'Boolean', + :'limit' => :'Integer', + :'metric' => :'String', + :'name' => :'String', + :'sort' => :'QuerySortOrder', + :'tag_filters' => :'Array', + :'text_filter' => :'String' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionProcessQueryDefinition` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionProcessQueryDefinition`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'aggregator') + self.aggregator = attributes[:'aggregator'] + end + + if attributes.key?(:'data_source') + self.data_source = attributes[:'data_source'] + end + + if attributes.key?(:'is_normalized_cpu') + self.is_normalized_cpu = attributes[:'is_normalized_cpu'] + end + + if attributes.key?(:'limit') + self.limit = attributes[:'limit'] + end + + if attributes.key?(:'metric') + self.metric = attributes[:'metric'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'sort') + self.sort = attributes[:'sort'] + else + self.sort = 'desc' + end + + if attributes.key?(:'tag_filters') + if (value = attributes[:'tag_filters']).is_a?(Array) + self.tag_filters = value + end + end + + if attributes.key?(:'text_filter') + self.text_filter = attributes[:'text_filter'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @data_source.nil? + invalid_properties.push('invalid value for "data_source", data_source cannot be nil.') + end + + if @metric.nil? + invalid_properties.push('invalid value for "metric", metric cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @data_source.nil? + return false if @metric.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + aggregator == o.aggregator && + data_source == o.data_source && + is_normalized_cpu == o.is_normalized_cpu && + limit == o.limit && + metric == o.metric && + name == o.name && + sort == o.sort && + tag_filters == o.tag_filters && + text_filter == o.text_filter + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [aggregator, data_source, is_normalized_cpu, limit, metric, name, sort, tag_filters, text_filter].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = DatadogAPIClient::V1.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + 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 + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/datadog_api_client/v1/models/timeseries_widget_request.rb b/lib/datadog_api_client/v1/models/timeseries_widget_request.rb index d1f510a68141..1bdc69276073 100644 --- a/lib/datadog_api_client/v1/models/timeseries_widget_request.rb +++ b/lib/datadog_api_client/v1/models/timeseries_widget_request.rb @@ -25,6 +25,9 @@ class TimeseriesWidgetRequest attr_accessor :event_query + # List of formulas that operate on queries. This feature is currently in beta. + attr_accessor :formulas + attr_accessor :log_query # Used to define expression aliases. @@ -40,6 +43,11 @@ class TimeseriesWidgetRequest # Widget query. attr_accessor :q + # List of queries that can be returned directly or used in formulas. This feature is currently in beta. + attr_accessor :queries + + attr_accessor :response_format + attr_accessor :rum_query attr_accessor :security_query @@ -52,12 +60,15 @@ def self.attribute_map :'apm_query' => :'apm_query', :'display_type' => :'display_type', :'event_query' => :'event_query', + :'formulas' => :'formulas', :'log_query' => :'log_query', :'metadata' => :'metadata', :'network_query' => :'network_query', :'on_right_yaxis' => :'on_right_yaxis', :'process_query' => :'process_query', :'q' => :'q', + :'queries' => :'queries', + :'response_format' => :'response_format', :'rum_query' => :'rum_query', :'security_query' => :'security_query', :'style' => :'style' @@ -75,12 +86,15 @@ def self.openapi_types :'apm_query' => :'LogQueryDefinition', :'display_type' => :'WidgetDisplayType', :'event_query' => :'LogQueryDefinition', + :'formulas' => :'Array', :'log_query' => :'LogQueryDefinition', :'metadata' => :'Array', :'network_query' => :'LogQueryDefinition', :'on_right_yaxis' => :'Boolean', :'process_query' => :'ProcessQueryDefinition', :'q' => :'String', + :'queries' => :'Array', + :'response_format' => :'FormulaAndFunctionResponseFormat', :'rum_query' => :'LogQueryDefinition', :'security_query' => :'LogQueryDefinition', :'style' => :'WidgetRequestStyle' @@ -120,6 +134,12 @@ def initialize(attributes = {}) self.event_query = attributes[:'event_query'] end + if attributes.key?(:'formulas') + if (value = attributes[:'formulas']).is_a?(Array) + self.formulas = value + end + end + if attributes.key?(:'log_query') self.log_query = attributes[:'log_query'] end @@ -146,6 +166,16 @@ def initialize(attributes = {}) self.q = attributes[:'q'] end + if attributes.key?(:'queries') + if (value = attributes[:'queries']).is_a?(Array) + self.queries = value + end + end + + if attributes.key?(:'response_format') + self.response_format = attributes[:'response_format'] + end + if attributes.key?(:'rum_query') self.rum_query = attributes[:'rum_query'] end @@ -180,12 +210,15 @@ def ==(o) apm_query == o.apm_query && display_type == o.display_type && event_query == o.event_query && + formulas == o.formulas && log_query == o.log_query && metadata == o.metadata && network_query == o.network_query && on_right_yaxis == o.on_right_yaxis && process_query == o.process_query && q == o.q && + queries == o.queries && + response_format == o.response_format && rum_query == o.rum_query && security_query == o.security_query && style == o.style @@ -200,7 +233,7 @@ def eql?(o) # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [apm_query, display_type, event_query, log_query, metadata, network_query, on_right_yaxis, process_query, q, rum_query, security_query, style].hash + [apm_query, display_type, event_query, formulas, log_query, metadata, network_query, on_right_yaxis, process_query, q, queries, response_format, rum_query, security_query, style].hash end # Builds the object from hash diff --git a/lib/datadog_api_client/v1/models/widget_formula.rb b/lib/datadog_api_client/v1/models/widget_formula.rb new file mode 100644 index 000000000000..c489debe1f0c --- /dev/null +++ b/lib/datadog_api_client/v1/models/widget_formula.rb @@ -0,0 +1,247 @@ +=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://openapi-generator.tech + + 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 + # Formula to be used in a widget query. + class WidgetFormula + # Expression alias. + attr_accessor :_alias + + # String expression built from queries, formulas, and functions. + attr_accessor :formula + + attr_accessor :limit + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'_alias' => :'alias', + :'formula' => :'formula', + :'limit' => :'limit' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'_alias' => :'String', + :'formula' => :'String', + :'limit' => :'WidgetFormulaLimit' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::WidgetFormula` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::WidgetFormula`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'_alias') + self._alias = attributes[:'_alias'] + end + + if attributes.key?(:'formula') + self.formula = attributes[:'formula'] + end + + if attributes.key?(:'limit') + self.limit = attributes[:'limit'] + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + if @formula.nil? + invalid_properties.push('invalid value for "formula", formula cannot be nil.') + end + + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + return false if @formula.nil? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _alias == o._alias && + formula == o.formula && + limit == o.limit + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [_alias, formula, limit].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = DatadogAPIClient::V1.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + 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 + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/lib/datadog_api_client/v1/models/widget_formula_limit.rb b/lib/datadog_api_client/v1/models/widget_formula_limit.rb new file mode 100644 index 000000000000..1c063a558e00 --- /dev/null +++ b/lib/datadog_api_client/v1/models/widget_formula_limit.rb @@ -0,0 +1,234 @@ +=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://openapi-generator.tech + + 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 + # Options for limiting results returned. + class WidgetFormulaLimit + # Number of results to return. + attr_accessor :count + + attr_accessor :order + + # Attribute mapping from ruby-style variable name to JSON key. + def self.attribute_map + { + :'count' => :'count', + :'order' => :'order' + } + end + + # Returns all the JSON keys this model knows about + def self.acceptable_attributes + attribute_map.values + end + + # Attribute type mapping. + def self.openapi_types + { + :'count' => :'Integer', + :'order' => :'QuerySortOrder' + } + end + + # List of attributes with nullable: true + def self.openapi_nullable + Set.new([ + ]) + end + + # Initializes the object + # @param [Hash] attributes Model attributes in the form of hash + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::WidgetFormulaLimit` initialize method" + end + + # 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)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::WidgetFormulaLimit`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect + end + h[k.to_sym] = v + } + + if attributes.key?(:'count') + self.count = attributes[:'count'] + end + + if attributes.key?(:'order') + self.order = attributes[:'order'] + else + self.order = 'desc' + end + end + + # Show invalid properties with the reasons. Usually used together with valid? + # @return Array for valid properties with the reasons + def list_invalid_properties + invalid_properties = Array.new + invalid_properties + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + def valid? + true + end + + # Checks equality by comparing each attribute. + # @param [Object] Object to be compared + def ==(o) + return true if self.equal?(o) + self.class == o.class && + count == o.count && + order == o.order + end + + # @see the `==` method + # @param [Object] Object to be compared + def eql?(o) + self == o + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + def hash + [count, order].hash + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def self.build_from_hash(attributes) + new.build_from_hash(attributes) + end + + # Builds the object from hash + # @param [Hash] attributes Model attributes in the form of hash + # @return [Object] Returns the model itself + def build_from_hash(attributes) + return nil unless attributes.is_a?(Hash) + self.class.openapi_types.each_pair do |key, type| + if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) + self.send("#{key}=", nil) + elsif type =~ /\AArray<(.*)>/i + # check to ensure the input is an array given that the attribute + # is documented as an array but the input is not + if attributes[self.class.attribute_map[key]].is_a?(Array) + self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) + end + elsif !attributes[self.class.attribute_map[key]].nil? + self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) + end + end + + self + end + + # Deserializes the data based on type + # @param string type Data type + # @param string value Value to be deserialized + # @return [Object] Deserialized data + def _deserialize(type, value) + case type.to_sym + when :Time + Time.parse(value) + when :Date + Date.parse(value) + when :String + value.to_s + when :Integer + value.to_i + when :Float + value.to_f + when :Boolean + if value.to_s =~ /\A(true|t|yes|y|1)\z/i + true + else + false + end + when :Object + # generic object (usually a Hash), return directly + value + when /\AArray<(?.+)>\z/ + inner_type = Regexp.last_match[:inner_type] + value.map { |v| _deserialize(inner_type, v) } + when /\AHash<(?.+?), (?.+)>\z/ + k_type = Regexp.last_match[:k_type] + v_type = Regexp.last_match[:v_type] + {}.tap do |hash| + value.each do |k, v| + hash[_deserialize(k_type, k)] = _deserialize(v_type, v) + end + end + else # model + # models (e.g. Pet) or oneOf + klass = DatadogAPIClient::V1.const_get(type) + klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) + end + end + + # Returns the string representation of the object + # @return [String] String presentation of the object + def to_s + to_hash.to_s + end + + # to_body is an alias to to_hash (backward compatibility) + # @return [Hash] Returns the object in the form of hash + def to_body + to_hash + end + + # Returns the object in the form of hash + # @return [Hash] Returns the object in the form of hash + 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 + hash + end + + # Outputs non-array value in the form of hash + # For object, use to_hash. Otherwise, just return the value + # @param [Object] value Any valid value + # @return [Hash] Returns the value in the form of hash + def _to_hash(value) + if value.is_a?(Array) + value.compact.map { |v| _to_hash(v) } + elsif value.is_a?(Hash) + {}.tap do |hash| + value.each { |k, v| hash[k] = _to_hash(v) } + end + elsif value.respond_to? :to_hash + value.to_hash + else + value + end + end + + end + +end diff --git a/spec/v1/models/formula_and_function_event_aggregation_spec.rb b/spec/v1/models/formula_and_function_event_aggregation_spec.rb new file mode 100644 index 000000000000..bb9d8a39129d --- /dev/null +++ b/spec/v1/models/formula_and_function_event_aggregation_spec.rb @@ -0,0 +1,31 @@ +=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://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V1::FormulaAndFunctionEventAggregation +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V1::FormulaAndFunctionEventAggregation do + let(:instance) { DatadogAPIClient::V1::FormulaAndFunctionEventAggregation.new } + + describe 'test an instance of FormulaAndFunctionEventAggregation' do + it 'should create an instance of FormulaAndFunctionEventAggregation' do + expect(instance).to be_instance_of(DatadogAPIClient::V1::FormulaAndFunctionEventAggregation) + end + end +end diff --git a/spec/v1/models/formula_and_function_events_data_source_spec.rb b/spec/v1/models/formula_and_function_events_data_source_spec.rb new file mode 100644 index 000000000000..639e3b4055ef --- /dev/null +++ b/spec/v1/models/formula_and_function_events_data_source_spec.rb @@ -0,0 +1,31 @@ +=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://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V1::FormulaAndFunctionEventsDataSource +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V1::FormulaAndFunctionEventsDataSource do + let(:instance) { DatadogAPIClient::V1::FormulaAndFunctionEventsDataSource.new } + + describe 'test an instance of FormulaAndFunctionEventsDataSource' do + it 'should create an instance of FormulaAndFunctionEventsDataSource' do + expect(instance).to be_instance_of(DatadogAPIClient::V1::FormulaAndFunctionEventsDataSource) + end + end +end diff --git a/spec/v1/models/formula_and_function_events_sort_type_spec.rb b/spec/v1/models/formula_and_function_events_sort_type_spec.rb new file mode 100644 index 000000000000..86454f136f1c --- /dev/null +++ b/spec/v1/models/formula_and_function_events_sort_type_spec.rb @@ -0,0 +1,31 @@ +=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://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V1::FormulaAndFunctionEventsSortType +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V1::FormulaAndFunctionEventsSortType do + let(:instance) { DatadogAPIClient::V1::FormulaAndFunctionEventsSortType.new } + + describe 'test an instance of FormulaAndFunctionEventsSortType' do + it 'should create an instance of FormulaAndFunctionEventsSortType' do + expect(instance).to be_instance_of(DatadogAPIClient::V1::FormulaAndFunctionEventsSortType) + end + end +end diff --git a/spec/v1/models/formula_and_function_metric_aggregation_spec.rb b/spec/v1/models/formula_and_function_metric_aggregation_spec.rb new file mode 100644 index 000000000000..cf2d3e038bfe --- /dev/null +++ b/spec/v1/models/formula_and_function_metric_aggregation_spec.rb @@ -0,0 +1,31 @@ +=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://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V1::FormulaAndFunctionMetricAggregation +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V1::FormulaAndFunctionMetricAggregation do + let(:instance) { DatadogAPIClient::V1::FormulaAndFunctionMetricAggregation.new } + + describe 'test an instance of FormulaAndFunctionMetricAggregation' do + it 'should create an instance of FormulaAndFunctionMetricAggregation' do + expect(instance).to be_instance_of(DatadogAPIClient::V1::FormulaAndFunctionMetricAggregation) + end + end +end diff --git a/spec/v1/models/formula_and_function_metric_data_source_spec.rb b/spec/v1/models/formula_and_function_metric_data_source_spec.rb new file mode 100644 index 000000000000..c0ca7f493b5e --- /dev/null +++ b/spec/v1/models/formula_and_function_metric_data_source_spec.rb @@ -0,0 +1,31 @@ +=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://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V1::FormulaAndFunctionMetricDataSource +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V1::FormulaAndFunctionMetricDataSource do + let(:instance) { DatadogAPIClient::V1::FormulaAndFunctionMetricDataSource.new } + + describe 'test an instance of FormulaAndFunctionMetricDataSource' do + it 'should create an instance of FormulaAndFunctionMetricDataSource' do + expect(instance).to be_instance_of(DatadogAPIClient::V1::FormulaAndFunctionMetricDataSource) + end + end +end diff --git a/spec/v1/models/formula_and_function_process_query_data_source_spec.rb b/spec/v1/models/formula_and_function_process_query_data_source_spec.rb new file mode 100644 index 000000000000..2715437d7465 --- /dev/null +++ b/spec/v1/models/formula_and_function_process_query_data_source_spec.rb @@ -0,0 +1,31 @@ +=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://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V1::FormulaAndFunctionProcessQueryDataSource +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V1::FormulaAndFunctionProcessQueryDataSource do + let(:instance) { DatadogAPIClient::V1::FormulaAndFunctionProcessQueryDataSource.new } + + describe 'test an instance of FormulaAndFunctionProcessQueryDataSource' do + it 'should create an instance of FormulaAndFunctionProcessQueryDataSource' do + expect(instance).to be_instance_of(DatadogAPIClient::V1::FormulaAndFunctionProcessQueryDataSource) + end + end +end diff --git a/spec/v1/models/formula_and_function_query_definition_spec.rb b/spec/v1/models/formula_and_function_query_definition_spec.rb new file mode 100644 index 000000000000..c50d63215d22 --- /dev/null +++ b/spec/v1/models/formula_and_function_query_definition_spec.rb @@ -0,0 +1,34 @@ +=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://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V1::FormulaAndFunctionQueryDefinition +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V1::FormulaAndFunctionQueryDefinition do + describe '.openapi_one_of' do + it 'lists the items referenced in the oneOf array' do + expect(described_class.openapi_one_of).to_not be_empty + end + end + + describe '.build' do + it 'returns the correct model' do + end + end +end diff --git a/spec/v1/models/formula_and_function_response_format_spec.rb b/spec/v1/models/formula_and_function_response_format_spec.rb new file mode 100644 index 000000000000..328073a0c51f --- /dev/null +++ b/spec/v1/models/formula_and_function_response_format_spec.rb @@ -0,0 +1,31 @@ +=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://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V1::FormulaAndFunctionResponseFormat +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V1::FormulaAndFunctionResponseFormat do + let(:instance) { DatadogAPIClient::V1::FormulaAndFunctionResponseFormat.new } + + describe 'test an instance of FormulaAndFunctionResponseFormat' do + it 'should create an instance of FormulaAndFunctionResponseFormat' do + expect(instance).to be_instance_of(DatadogAPIClient::V1::FormulaAndFunctionResponseFormat) + end + end +end diff --git a/spec/v1/models/query_sort_order_spec.rb b/spec/v1/models/query_sort_order_spec.rb new file mode 100644 index 000000000000..a6850168eb5b --- /dev/null +++ b/spec/v1/models/query_sort_order_spec.rb @@ -0,0 +1,31 @@ +=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://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V1::QuerySortOrder +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V1::QuerySortOrder do + let(:instance) { DatadogAPIClient::V1::QuerySortOrder.new } + + describe 'test an instance of QuerySortOrder' do + it 'should create an instance of QuerySortOrder' do + expect(instance).to be_instance_of(DatadogAPIClient::V1::QuerySortOrder) + end + end +end diff --git a/spec/v1/models/time_series_formula_and_function_event_query_definition_compute_spec.rb b/spec/v1/models/time_series_formula_and_function_event_query_definition_compute_spec.rb new file mode 100644 index 000000000000..2ce5b2514118 --- /dev/null +++ b/spec/v1/models/time_series_formula_and_function_event_query_definition_compute_spec.rb @@ -0,0 +1,49 @@ +=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://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionCompute +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionCompute do + let(:instance) { DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionCompute.new } + + describe 'test an instance of TimeSeriesFormulaAndFunctionEventQueryDefinitionCompute' do + it 'should create an instance of TimeSeriesFormulaAndFunctionEventQueryDefinitionCompute' do + expect(instance).to be_instance_of(DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionCompute) + end + end + describe 'test attribute "aggregation"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "interval"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "metric"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/v1/models/time_series_formula_and_function_event_query_definition_group_by_sort_spec.rb b/spec/v1/models/time_series_formula_and_function_event_query_definition_group_by_sort_spec.rb new file mode 100644 index 000000000000..f4c5132ece0a --- /dev/null +++ b/spec/v1/models/time_series_formula_and_function_event_query_definition_group_by_sort_spec.rb @@ -0,0 +1,55 @@ +=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://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBySort +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBySort do + let(:instance) { DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBySort.new } + + describe 'test an instance of TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBySort' do + it 'should create an instance of TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBySort' do + expect(instance).to be_instance_of(DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBySort) + end + end + describe 'test attribute "aggregation"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "metric"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "order"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "type"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/v1/models/time_series_formula_and_function_event_query_definition_group_by_spec.rb b/spec/v1/models/time_series_formula_and_function_event_query_definition_group_by_spec.rb new file mode 100644 index 000000000000..4e6da147cc8c --- /dev/null +++ b/spec/v1/models/time_series_formula_and_function_event_query_definition_group_by_spec.rb @@ -0,0 +1,49 @@ +=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://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBy +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBy do + let(:instance) { DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBy.new } + + describe 'test an instance of TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBy' do + it 'should create an instance of TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBy' do + expect(instance).to be_instance_of(DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionGroupBy) + end + end + describe 'test attribute "facet"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "limit"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "sort"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/v1/models/time_series_formula_and_function_event_query_definition_search_spec.rb b/spec/v1/models/time_series_formula_and_function_event_query_definition_search_spec.rb new file mode 100644 index 000000000000..f4f35876aea8 --- /dev/null +++ b/spec/v1/models/time_series_formula_and_function_event_query_definition_search_spec.rb @@ -0,0 +1,37 @@ +=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://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionSearch +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionSearch do + let(:instance) { DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionSearch.new } + + describe 'test an instance of TimeSeriesFormulaAndFunctionEventQueryDefinitionSearch' do + it 'should create an instance of TimeSeriesFormulaAndFunctionEventQueryDefinitionSearch' do + expect(instance).to be_instance_of(DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinitionSearch) + end + end + describe 'test attribute "query"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/v1/models/time_series_formula_and_function_event_query_definition_spec.rb b/spec/v1/models/time_series_formula_and_function_event_query_definition_spec.rb new file mode 100644 index 000000000000..8f61e6e44610 --- /dev/null +++ b/spec/v1/models/time_series_formula_and_function_event_query_definition_spec.rb @@ -0,0 +1,67 @@ +=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://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinition +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinition do + let(:instance) { DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinition.new } + + describe 'test an instance of TimeSeriesFormulaAndFunctionEventQueryDefinition' do + it 'should create an instance of TimeSeriesFormulaAndFunctionEventQueryDefinition' do + expect(instance).to be_instance_of(DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionEventQueryDefinition) + end + end + describe 'test attribute "compute"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "data_source"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "group_by"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "indexes"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "search"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/v1/models/time_series_formula_and_function_metric_query_definition_spec.rb b/spec/v1/models/time_series_formula_and_function_metric_query_definition_spec.rb new file mode 100644 index 000000000000..ae0a289df730 --- /dev/null +++ b/spec/v1/models/time_series_formula_and_function_metric_query_definition_spec.rb @@ -0,0 +1,55 @@ +=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://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionMetricQueryDefinition +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionMetricQueryDefinition do + let(:instance) { DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionMetricQueryDefinition.new } + + describe 'test an instance of TimeSeriesFormulaAndFunctionMetricQueryDefinition' do + it 'should create an instance of TimeSeriesFormulaAndFunctionMetricQueryDefinition' do + expect(instance).to be_instance_of(DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionMetricQueryDefinition) + end + end + describe 'test attribute "aggregator"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "data_source"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "query"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/v1/models/time_series_formula_and_function_process_query_definition_spec.rb b/spec/v1/models/time_series_formula_and_function_process_query_definition_spec.rb new file mode 100644 index 000000000000..18467e5171fa --- /dev/null +++ b/spec/v1/models/time_series_formula_and_function_process_query_definition_spec.rb @@ -0,0 +1,85 @@ +=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://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionProcessQueryDefinition +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionProcessQueryDefinition do + let(:instance) { DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionProcessQueryDefinition.new } + + describe 'test an instance of TimeSeriesFormulaAndFunctionProcessQueryDefinition' do + it 'should create an instance of TimeSeriesFormulaAndFunctionProcessQueryDefinition' do + expect(instance).to be_instance_of(DatadogAPIClient::V1::TimeSeriesFormulaAndFunctionProcessQueryDefinition) + end + end + describe 'test attribute "aggregator"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "data_source"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "is_normalized_cpu"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "limit"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "metric"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "name"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "sort"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "tag_filters"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "text_filter"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/v1/models/widget_formula_limit_spec.rb b/spec/v1/models/widget_formula_limit_spec.rb new file mode 100644 index 000000000000..65d166794a17 --- /dev/null +++ b/spec/v1/models/widget_formula_limit_spec.rb @@ -0,0 +1,43 @@ +=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://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V1::WidgetFormulaLimit +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V1::WidgetFormulaLimit do + let(:instance) { DatadogAPIClient::V1::WidgetFormulaLimit.new } + + describe 'test an instance of WidgetFormulaLimit' do + it 'should create an instance of WidgetFormulaLimit' do + expect(instance).to be_instance_of(DatadogAPIClient::V1::WidgetFormulaLimit) + end + end + describe 'test attribute "count"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "order"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end diff --git a/spec/v1/models/widget_formula_spec.rb b/spec/v1/models/widget_formula_spec.rb new file mode 100644 index 000000000000..ed83b09a0f76 --- /dev/null +++ b/spec/v1/models/widget_formula_spec.rb @@ -0,0 +1,49 @@ +=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://openapi-generator.tech + + 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 'spec_helper' +require 'json' +require 'date' + +# Unit tests for DatadogAPIClient::V1::WidgetFormula +# Automatically generated by openapi-generator (https://openapi-generator.tech) +# Please update as you see appropriate +describe DatadogAPIClient::V1::WidgetFormula do + let(:instance) { DatadogAPIClient::V1::WidgetFormula.new } + + describe 'test an instance of WidgetFormula' do + it 'should create an instance of WidgetFormula' do + expect(instance).to be_instance_of(DatadogAPIClient::V1::WidgetFormula) + end + end + describe 'test attribute "_alias"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "formula"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + + describe 'test attribute "limit"' do + it 'should work' do + # assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers + end + end + +end