diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index daa9d89fc342..1b8843ed56bc 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -3942,6 +3942,773 @@ components: type: string x-enum-varnames: - GROUP + GuidedTableColumn: + description: Definition of a single column in a guided table widget. A column + can be a computed value, a preset comparison, or a formula. + oneOf: + - $ref: '#/components/schemas/GuidedTableComputeColumn' + - $ref: '#/components/schemas/GuidedTablePresetColumn' + - $ref: '#/components/schemas/GuidedTableFormulaColumn' + GuidedTableColumnComparison: + description: Comparison to display in a guided table column. + oneOf: + - $ref: '#/components/schemas/GuidedTableColumnComparisonWithSelf' + - $ref: '#/components/schemas/GuidedTableColumnComparisonWithOtherColumn' + GuidedTableColumnComparisonWithOtherColumn: + description: Comparison of a column value against another column. + properties: + column: + description: Name of the column to compare against. + example: '' + type: string + type: + $ref: '#/components/schemas/GuidedTableColumnComparisonWithOtherColumnType' + required: + - type + - column + type: object + GuidedTableColumnComparisonWithOtherColumnType: + enum: + - diff_from + - percent_of + - percent_diff_from + example: diff_from + type: string + x-enum-varnames: + - DIFF_FROM + - PERCENT_OF + - PERCENT_DIFF_FROM + GuidedTableColumnComparisonWithSelf: + description: Comparison of a column value against the column's own total (percent + of column total). + properties: + type: + $ref: '#/components/schemas/GuidedTableColumnComparisonWithSelfType' + required: + - type + type: object + GuidedTableColumnComparisonWithSelfType: + enum: + - percent_column_total + example: percent_column_total + type: string + x-enum-varnames: + - PERCENT_COLUMN_TOTAL + GuidedTableColumnFormat: + description: Visual formatting applied to values in a guided table column. Supports + number/bar mode and trend mode. + oneOf: + - $ref: '#/components/schemas/GuidedTableNumberBarColumnFormat' + - $ref: '#/components/schemas/GuidedTableTrendColumnFormat' + GuidedTableColumnFunction: + description: A function to apply when computing a column's value. + properties: + args: + description: Arguments passed to the function in order. + items: + oneOf: + - type: string + - type: number + - type: boolean + type: array + name: + description: Function name (e.g. `clamp_min`, `abs`, `round`). Not restricted + to a fixed set. + example: '' + type: string + required: + - name + type: object + GuidedTableComputeColumn: + description: A guided table column that computes an aggregation directly from + one of the table's base queries. + properties: + alias: + description: Display name shown as the column header. + type: string + comparison: + $ref: '#/components/schemas/GuidedTableColumnComparison' + compute: + $ref: '#/components/schemas/GuidedTableComputeColumnCompute' + format: + $ref: '#/components/schemas/GuidedTableColumnFormat' + functions: + description: Functions to apply sequentially to the computed value. + items: + $ref: '#/components/schemas/GuidedTableColumnFunction' + type: array + is_hidden: + description: Whether this column is hidden in the rendered table. + type: boolean + name: + description: Auto-generated name used to refer to this column. + example: '' + type: string + type: + $ref: '#/components/schemas/GuidedTableComputeColumnType' + required: + - name + - type + - compute + - format + type: object + GuidedTableComputeColumnCompute: + description: Aggregation configuration. + properties: + aggregation: + description: Aggregation type (e.g. `avg`, `sum`, `count`). + example: '' + type: string + filter: + description: Additional filter criteria. + type: string + property: + description: Attribute to aggregate on. Depends on the data source (e.g. + a log attribute). + type: string + query: + description: Name of the source query. + example: '' + type: string + required: + - query + - aggregation + type: object + GuidedTableComputeColumnType: + enum: + - compute + example: compute + type: string + x-enum-varnames: + - COMPUTE + GuidedTableConditionalFormats: + description: Conditional formatting rules for a guided table column. Either + an array of threshold-based rules or a single range-based rule. + oneOf: + - $ref: '#/components/schemas/GuidedTableThresholdConditionalFormats' + - $ref: '#/components/schemas/GuidedTableRangeConditionalFormats' + GuidedTableEventsQuery: + description: An events-platform query fragment used as source data for a guided + table. Covers logs, RUM, spans, CI pipelines, events, and product analytics. + properties: + alias: + description: Display alias for the query. + type: string + data_source: + $ref: '#/components/schemas/GuidedTableEventsQueryDataSource' + indexes: + description: Indexes to search for events. + items: + type: string + type: array + name: + description: Variable name used to reference this query in columns and formulas. + example: '' + type: string + search: + $ref: '#/components/schemas/GuidedTableEventsQuerySearch' + storage: + $ref: '#/components/schemas/GuidedTableStorageType' + required: + - name + - data_source + type: object + GuidedTableEventsQueryDataSource: + description: Events data source. + enum: + - logs + - rum + - spans + - ci_pipelines + - events + - product_analytics + example: logs + type: string + x-enum-varnames: + - LOGS + - RUM + - SPANS + - CI_PIPELINES + - EVENTS + - PRODUCT_ANALYTICS + GuidedTableEventsQuerySearch: + description: Search filter for matching events. + properties: + query: + description: Events search query string using events-platform search grammar. + type: string + type: object + GuidedTableFormulaColumn: + description: A guided table column that displays the result of evaluating a + formula over other columns. + properties: + alias: + description: Display name shown as the column header. + type: string + comparison: + $ref: '#/components/schemas/GuidedTableColumnComparison' + format: + $ref: '#/components/schemas/GuidedTableColumnFormat' + formula: + description: The formula expression to evaluate. + example: '' + type: string + is_hidden: + description: Whether this column is hidden in the rendered table. + type: boolean + name: + description: Auto-generated name used to refer to this column. + example: '' + type: string + type: + $ref: '#/components/schemas/FormulaType' + required: + - name + - type + - formula + - format + type: object + GuidedTableGroupKey: + description: Maps a specific base query to the field name used for grouping. + properties: + group_key: + description: Field name in the query result used as the grouping key. + example: '' + type: string + query: + description: Name of the source query. + example: '' + type: string + required: + - query + - group_key + type: object + GuidedTableMetricsQuery: + description: A metrics (or cloud cost) query fragment used as source data for + a guided table. Group-by and time/space aggregation are defined separately. + properties: + alias: + description: Display alias for the query. + type: string + data_source: + $ref: '#/components/schemas/GuidedTableMetricsQueryDataSource' + filter: + description: Filter string to apply to the metric query. + type: string + metric_name: + description: Name of the metric to query. + example: '' + type: string + name: + description: Variable name used to reference this query in columns and formulas. + example: '' + type: string + required: + - name + - data_source + - metric_name + type: object + GuidedTableMetricsQueryDataSource: + description: Metrics data source. + enum: + - metrics + - cloud_cost + example: metrics + type: string + x-enum-varnames: + - METRICS + - CLOUD_COST + GuidedTableNumberBarColumnFormat: + description: Formats a guided table column as a number or a bar. + properties: + conditional_formats: + $ref: '#/components/schemas/GuidedTableConditionalFormats' + mode: + $ref: '#/components/schemas/GuidedTableNumberBarColumnFormatMode' + number_format: + $ref: '#/components/schemas/GuidedTableNumberFormat' + required: + - mode + type: object + GuidedTableNumberBarColumnFormatMode: + enum: + - number + - bar + example: number + type: string + x-enum-varnames: + - NUMBER + - BAR + GuidedTableNumberFormat: + description: Number display format for a guided table column value. + properties: + precision: + $ref: '#/components/schemas/GuidedTableNumberFormatPrecision' + unit: + $ref: '#/components/schemas/NumberFormatUnit' + unit_scale: + $ref: '#/components/schemas/NumberFormatUnitScale' + type: object + GuidedTableNumberFormatPrecision: + description: Number of digits after the decimal point. Use `*` for full precision, + `integer` to show full integer values, or omit for automatic precision. + oneOf: + - type: string + - format: int32 + maximum: 100 + minimum: 0 + type: integer + GuidedTablePresetColumn: + description: A guided table column that displays values for the previous time + period based on another column's full query. + properties: + alias: + description: Display name shown as the column header. + type: string + comparison: + $ref: '#/components/schemas/GuidedTableColumnComparison' + format: + $ref: '#/components/schemas/GuidedTableColumnFormat' + functions: + description: Functions to apply sequentially to the computed value. + items: + $ref: '#/components/schemas/GuidedTableColumnFunction' + type: array + is_hidden: + description: Whether this column is hidden in the rendered table. + type: boolean + name: + description: Auto-generated name used to refer to this column. + example: '' + type: string + preset: + $ref: '#/components/schemas/GuidedTablePresetColumnPreset' + type: + $ref: '#/components/schemas/GuidedTablePresetColumnType' + required: + - name + - type + - preset + - format + type: object + GuidedTablePresetColumnPreset: + description: Preset configuration. + properties: + column: + description: Name of the column whose full query is reused. + example: '' + type: string + type: + $ref: '#/components/schemas/GuidedTablePresetColumnPresetType' + required: + - type + - column + type: object + GuidedTablePresetColumnPresetType: + enum: + - previous_period + example: previous_period + type: string + x-enum-varnames: + - PREVIOUS_PERIOD + GuidedTablePresetColumnType: + enum: + - preset + example: preset + type: string + x-enum-varnames: + - PRESET + GuidedTableQuery: + description: A base query used as source data for a guided table widget. Either + a metrics query or an events-platform query. + oneOf: + - $ref: '#/components/schemas/GuidedTableMetricsQuery' + - $ref: '#/components/schemas/GuidedTableEventsQuery' + GuidedTableRangeConditionalFormats: + description: Single range-based conditional formatting rule. + items: + $ref: '#/components/schemas/GuidedTableRangeFormattingRule' + maxItems: 1 + type: array + GuidedTableRangeFormattingRule: + description: Formats values according to where they fall on a color scale. + properties: + max: + description: Maximum value on the mapping scale. + format: double + type: number + min: + description: Minimum value on the mapping scale. + format: double + type: number + palette: + $ref: '#/components/schemas/GuidedTableRangePalette' + reverse: + description: Whether to reverse the palette scale direction. + type: boolean + scale: + $ref: '#/components/schemas/GuidedTableRangeFormattingRuleScale' + type: + $ref: '#/components/schemas/GuidedTableRangeFormattingRuleType' + required: + - type + - palette + type: object + GuidedTableRangeFormattingRuleScale: + description: Scale function for mapping values to colors. + enum: + - linear + - log + - pow + - sqrt + type: string + x-enum-varnames: + - LINEAR + - LOG + - POW + - SQRT + GuidedTableRangeFormattingRuleType: + enum: + - range + example: range + type: string + x-enum-varnames: + - RANGE + GuidedTableRangePalette: + description: Color palette used by range-based conditional formatting rules. + enum: + - transparent_to_green + - transparent_to_orange + - transparent_to_red + - transparent_to_blue + - red_transparent_green + - red_transparent_blue + - vivid_transparent_to_green + - vivid_transparent_to_orange + - vivid_transparent_to_red + - vivid_transparent_to_blue + - vivid_red_transparent_green + - vivid_red_transparent_blue + example: transparent_to_green + type: string + x-enum-varnames: + - TRANSPARENT_TO_GREEN + - TRANSPARENT_TO_ORANGE + - TRANSPARENT_TO_RED + - TRANSPARENT_TO_BLUE + - RED_TRANSPARENT_GREEN + - RED_TRANSPARENT_BLUE + - VIVID_TRANSPARENT_TO_GREEN + - VIVID_TRANSPARENT_TO_ORANGE + - VIVID_TRANSPARENT_TO_RED + - VIVID_TRANSPARENT_TO_BLUE + - VIVID_RED_TRANSPARENT_GREEN + - VIVID_RED_TRANSPARENT_BLUE + GuidedTableRequest: + description: "Request definition for the guided table widget \u2014 a structured, + guided format for defining a table of data. Used when the `graphing_new_table_widget_editor` + feature flag is enabled; otherwise use the classic `TableWidgetRequest`. Defines + base queries, how to produce rows, and how to compute columns." + example: + columns: + - compute: + aggregation: avg + query: query1 + format: + mode: number + name: column1 + type: compute + queries: + - data_source: metrics + metric_name: system.cpu.user + name: query1 + request_type: table + rows: + group_by: + - group_keys: + - group_key: service + query: query1 + name: groupBy1 + sort: + columns: + - column: column1 + order: desc + limit: 10 + properties: + columns: + description: Column definitions that describe how to compute and display + table values. + example: + - compute: + aggregation: avg + query: query1 + format: + mode: number + name: column1 + type: compute + items: + $ref: '#/components/schemas/GuidedTableColumn' + type: array + queries: + description: Base queries that provide the source data for the table. + example: + - data_source: metrics + metric_name: system.cpu.user + name: query1 + items: + $ref: '#/components/schemas/GuidedTableQuery' + minItems: 1 + type: array + request_type: + $ref: '#/components/schemas/GuidedTableRequestRequestType' + rows: + $ref: '#/components/schemas/GuidedTableRows' + required: + - request_type + - queries + - rows + - columns + type: object + GuidedTableRequestRequestType: + description: Identifies this as a guided table request. + enum: + - table + example: table + type: string + x-enum-varnames: + - TABLE + GuidedTableRowGroupBy: + description: Defines one group-by dimension used to produce the rows of a guided + table. + properties: + alias: + description: Display name used as the column header for this group-by. + type: string + format: + $ref: '#/components/schemas/GuidedTableRowGroupByFormat' + group_keys: + description: Mapping from each source query to the field name used as the + grouping key. Different data sources may use different field names for + the same concept. + items: + $ref: '#/components/schemas/GuidedTableGroupKey' + type: array + is_hidden: + description: Whether this group-by column is hidden in the rendered table. + type: boolean + name: + description: Auto-generated name for this group-by parameter. + example: '' + type: string + required: + - name + - group_keys + type: object + GuidedTableRowGroupByFormat: + description: Text formatting configuration for this group-by column. + properties: + text_formats: + items: + $ref: '#/components/schemas/GuidedTableTextFormattingRule' + type: array + type: object + GuidedTableRows: + description: Defines how to compute the rows of a guided table. + properties: + group_by: + description: Grouping dimensions that form each row. Must be non-empty. + items: + $ref: '#/components/schemas/GuidedTableRowGroupBy' + minItems: 1 + type: array + sort: + $ref: '#/components/schemas/GuidedTableSort' + required: + - group_by + - sort + type: object + GuidedTableSort: + description: Sort configuration for a guided table. + properties: + columns: + description: Columns to sort by, in order of application. + items: + $ref: '#/components/schemas/WidgetFieldSort' + type: array + limit: + description: Maximum number of rows to show after sorting. + example: 1 + format: int64 + minimum: 1 + type: integer + required: + - limit + - columns + type: object + GuidedTableStorageType: + description: Storage tier to target for an events-platform query in a guided + table. + enum: + - live + - hot + - online_archives + - driveline + - flex_tier + - case_insensitive + - cloud_prem + type: string + x-enum-varnames: + - LIVE + - HOT + - ONLINE_ARCHIVES + - DRIVELINE + - FLEX_TIER + - CASE_INSENSITIVE + - CLOUD_PREM + GuidedTableTextFormattingRule: + description: Rule for applying visual formatting to text values in a guided + table group-by column. + properties: + custom_bg_color: + description: Custom background color hex code. Used with `custom_bg` palette. + example: '#632ca6' + type: string + custom_fg_color: + description: Custom text color hex code. Used with `custom_text` palette. + example: '#632ca6' + type: string + match: + $ref: '#/components/schemas/TableWidgetTextFormatMatch' + palette: + $ref: '#/components/schemas/GuidedTableThresholdPalette' + replace: + $ref: '#/components/schemas/GuidedTableTextFormattingRuleReplace' + required: + - match + type: object + GuidedTableTextFormattingRuleReplace: + description: Optional replacement to apply to matched text. + oneOf: + - $ref: '#/components/schemas/TableWidgetTextFormatReplaceAll' + - $ref: '#/components/schemas/GuidedTableTextFormattingRuleReplaceOneOf4484404608' + GuidedTableTextFormattingRuleReplaceOneOf4484404608: + description: Replace a specific substring. + properties: + substring: + example: '' + type: string + type: + $ref: '#/components/schemas/TableWidgetTextFormatReplaceSubstringType' + with: + example: '' + type: string + required: + - type + - substring + - with + type: object + GuidedTableThresholdConditionalFormats: + description: Array of threshold-based conditional formatting rules. + items: + $ref: '#/components/schemas/GuidedTableThresholdFormattingRule' + type: array + GuidedTableThresholdFormattingRule: + description: Conditional formatting rule that applies when a value satisfies + a threshold comparator condition. + properties: + comparator: + $ref: '#/components/schemas/WidgetComparator' + custom_bg_color: + description: Custom background color. Used with `custom_bg` palette. + type: string + custom_fg_color: + description: Custom text color. Used with `custom_text` palette. + type: string + hide_value: + description: Whether to hide the data value when this rule matches. + type: boolean + image_url: + description: URL of an image to display as background. + type: string + palette: + $ref: '#/components/schemas/GuidedTableThresholdPalette' + value: + $ref: '#/components/schemas/GuidedTableThresholdFormattingRuleValue' + required: + - comparator + - palette + type: object + GuidedTableThresholdFormattingRuleValue: + description: Threshold value to compare against. + oneOf: + - format: double + type: number + - type: string + GuidedTableThresholdPalette: + description: Color palette used by threshold-based conditional formatting and + text formatting rules in a guided table. + enum: + - white_on_red + - black_on_light_red + - white_on_green + - black_on_light_green + - white_on_yellow + - black_on_light_yellow + - white_on_gray + - green_on_white + - yellow_on_white + - red_on_white + - gray_on_white + - red + - green + - orange + - gray + - custom_bg + - custom_text + - custom_image + example: white_on_red + type: string + x-enum-varnames: + - WHITE_ON_RED + - BLACK_ON_LIGHT_RED + - WHITE_ON_GREEN + - BLACK_ON_LIGHT_GREEN + - WHITE_ON_YELLOW + - BLACK_ON_LIGHT_YELLOW + - WHITE_ON_GRAY + - GREEN_ON_WHITE + - YELLOW_ON_WHITE + - RED_ON_WHITE + - GRAY_ON_WHITE + - RED + - GREEN + - ORANGE + - GRAY + - CUSTOM_BG + - CUSTOM_TEXT + - CUSTOM_IMAGE + GuidedTableTrendColumnFormat: + description: Formats a guided table column as a trend sparkline. + properties: + conditional_formats: + $ref: '#/components/schemas/GuidedTableConditionalFormats' + mode: + $ref: '#/components/schemas/GuidedTableTrendColumnFormatMode' + number_format: + $ref: '#/components/schemas/GuidedTableNumberFormat' + trend_options: + $ref: '#/components/schemas/WidgetFormulaCellDisplayModeOptions' + required: + - mode + - trend_options + type: object + GuidedTableTrendColumnFormatMode: + enum: + - trend + example: trend + type: string + x-enum-varnames: + - TREND HTTPLog: description: Structured log message. items: @@ -19454,11 +20221,15 @@ components: has_search_bar: $ref: '#/components/schemas/TableWidgetHasSearchBar' requests: - description: Widget definition. + description: Widget definition. Each item is either a classic `TableWidgetRequest` + or an experimental `GuidedTableRequest` (used when the `graphing_new_table_widget_editor` + feature flag is enabled). example: - q/apm_query/log_query: {} items: - $ref: '#/components/schemas/TableWidgetRequest' + oneOf: + - $ref: '#/components/schemas/TableWidgetRequest' + - $ref: '#/components/schemas/GuidedTableRequest' type: array time: $ref: '#/components/schemas/WidgetTime' diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index d50fa5f2e08f..18a56da2ffc3 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -179,6 +179,54 @@ def overrides "v1.group_type" => "GroupType", "v1.group_widget_definition" => "GroupWidgetDefinition", "v1.group_widget_definition_type" => "GroupWidgetDefinitionType", + "v1.guided_table_column" => "GuidedTableColumn", + "v1.guided_table_column_comparison" => "GuidedTableColumnComparison", + "v1.guided_table_column_comparison_with_other_column" => "GuidedTableColumnComparisonWithOtherColumn", + "v1.guided_table_column_comparison_with_other_column_type" => "GuidedTableColumnComparisonWithOtherColumnType", + "v1.guided_table_column_comparison_with_self" => "GuidedTableColumnComparisonWithSelf", + "v1.guided_table_column_comparison_with_self_type" => "GuidedTableColumnComparisonWithSelfType", + "v1.guided_table_column_format" => "GuidedTableColumnFormat", + "v1.guided_table_column_function" => "GuidedTableColumnFunction", + "v1.guided_table_column_function_args_item" => "GuidedTableColumnFunctionArgsItem", + "v1.guided_table_compute_column" => "GuidedTableComputeColumn", + "v1.guided_table_compute_column_compute" => "GuidedTableComputeColumnCompute", + "v1.guided_table_compute_column_type" => "GuidedTableComputeColumnType", + "v1.guided_table_conditional_formats" => "GuidedTableConditionalFormats", + "v1.guided_table_events_query" => "GuidedTableEventsQuery", + "v1.guided_table_events_query_data_source" => "GuidedTableEventsQueryDataSource", + "v1.guided_table_events_query_search" => "GuidedTableEventsQuerySearch", + "v1.guided_table_formula_column" => "GuidedTableFormulaColumn", + "v1.guided_table_group_key" => "GuidedTableGroupKey", + "v1.guided_table_metrics_query" => "GuidedTableMetricsQuery", + "v1.guided_table_metrics_query_data_source" => "GuidedTableMetricsQueryDataSource", + "v1.guided_table_number_bar_column_format" => "GuidedTableNumberBarColumnFormat", + "v1.guided_table_number_bar_column_format_mode" => "GuidedTableNumberBarColumnFormatMode", + "v1.guided_table_number_format" => "GuidedTableNumberFormat", + "v1.guided_table_number_format_precision" => "GuidedTableNumberFormatPrecision", + "v1.guided_table_preset_column" => "GuidedTablePresetColumn", + "v1.guided_table_preset_column_preset" => "GuidedTablePresetColumnPreset", + "v1.guided_table_preset_column_preset_type" => "GuidedTablePresetColumnPresetType", + "v1.guided_table_preset_column_type" => "GuidedTablePresetColumnType", + "v1.guided_table_query" => "GuidedTableQuery", + "v1.guided_table_range_formatting_rule" => "GuidedTableRangeFormattingRule", + "v1.guided_table_range_formatting_rule_scale" => "GuidedTableRangeFormattingRuleScale", + "v1.guided_table_range_formatting_rule_type" => "GuidedTableRangeFormattingRuleType", + "v1.guided_table_range_palette" => "GuidedTableRangePalette", + "v1.guided_table_request" => "GuidedTableRequest", + "v1.guided_table_request_request_type" => "GuidedTableRequestRequestType", + "v1.guided_table_row_group_by" => "GuidedTableRowGroupBy", + "v1.guided_table_row_group_by_format" => "GuidedTableRowGroupByFormat", + "v1.guided_table_rows" => "GuidedTableRows", + "v1.guided_table_sort" => "GuidedTableSort", + "v1.guided_table_storage_type" => "GuidedTableStorageType", + "v1.guided_table_text_formatting_rule" => "GuidedTableTextFormattingRule", + "v1.guided_table_text_formatting_rule_replace" => "GuidedTableTextFormattingRuleReplace", + "v1.guided_table_text_formatting_rule_replace_one_of4484404608" => "GuidedTableTextFormattingRuleReplaceOneOf4484404608", + "v1.guided_table_threshold_formatting_rule" => "GuidedTableThresholdFormattingRule", + "v1.guided_table_threshold_formatting_rule_value" => "GuidedTableThresholdFormattingRuleValue", + "v1.guided_table_threshold_palette" => "GuidedTableThresholdPalette", + "v1.guided_table_trend_column_format" => "GuidedTableTrendColumnFormat", + "v1.guided_table_trend_column_format_mode" => "GuidedTableTrendColumnFormatMode", "v1.heat_map_widget_definition" => "HeatMapWidgetDefinition", "v1.heat_map_widget_definition_type" => "HeatMapWidgetDefinitionType", "v1.heat_map_widget_request" => "HeatMapWidgetRequest", @@ -799,6 +847,7 @@ def overrides "v1.synthetics_warning_type" => "SyntheticsWarningType", "v1.table_widget_cell_display_mode" => "TableWidgetCellDisplayMode", "v1.table_widget_definition" => "TableWidgetDefinition", + "v1.table_widget_definition_requests_item" => "TableWidgetDefinitionRequestsItem", "v1.table_widget_definition_type" => "TableWidgetDefinitionType", "v1.table_widget_has_search_bar" => "TableWidgetHasSearchBar", "v1.table_widget_request" => "TableWidgetRequest", diff --git a/lib/datadog_api_client/v1/models/guided_table_column.rb b/lib/datadog_api_client/v1/models/guided_table_column.rb new file mode 100644 index 000000000000..80f010b6d2e3 --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_column.rb @@ -0,0 +1,64 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Definition of a single column in a guided table widget. A column can be a computed value, a preset comparison, or a formula. + module GuidedTableColumn + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'GuidedTableComputeColumn', + :'GuidedTablePresetColumn', + :'GuidedTableFormulaColumn' + ] + end + # Builds the object + # @param data [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 de facto 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) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_column_comparison.rb b/lib/datadog_api_client/v1/models/guided_table_column_comparison.rb new file mode 100644 index 000000000000..f084d522230a --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_column_comparison.rb @@ -0,0 +1,63 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Comparison to display in a guided table column. + module GuidedTableColumnComparison + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'GuidedTableColumnComparisonWithSelf', + :'GuidedTableColumnComparisonWithOtherColumn' + ] + end + # Builds the object + # @param data [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 de facto 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) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_column_comparison_with_other_column.rb b/lib/datadog_api_client/v1/models/guided_table_column_comparison_with_other_column.rb new file mode 100644 index 000000000000..40bc73293c49 --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_column_comparison_with_other_column.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Comparison of a column value against another column. + class GuidedTableColumnComparisonWithOtherColumn + include BaseGenericModel + + # Name of the column to compare against. + attr_reader :column + + # + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'column' => :'column', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'column' => :'String', + :'type' => :'GuidedTableColumnComparisonWithOtherColumnType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::GuidedTableColumnComparisonWithOtherColumn` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'column') + self.column = attributes[:'column'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @column.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param column [Object] Object to be assigned + # @!visibility private + def column=(column) + if column.nil? + fail ArgumentError, 'invalid value for "column", column cannot be nil.' + end + @column = column + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + column == o.column && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [column, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_column_comparison_with_other_column_type.rb b/lib/datadog_api_client/v1/models/guided_table_column_comparison_with_other_column_type.rb new file mode 100644 index 000000000000..9cec05f45e76 --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_column_comparison_with_other_column_type.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # + class GuidedTableColumnComparisonWithOtherColumnType + include BaseEnumModel + + DIFF_FROM = "diff_from".freeze + PERCENT_OF = "percent_of".freeze + PERCENT_DIFF_FROM = "percent_diff_from".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_column_comparison_with_self.rb b/lib/datadog_api_client/v1/models/guided_table_column_comparison_with_self.rb new file mode 100644 index 000000000000..c47eed9b25c1 --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_column_comparison_with_self.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Comparison of a column value against the column's own total (percent of column total). + class GuidedTableColumnComparisonWithSelf + include BaseGenericModel + + # + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'type' => :'GuidedTableColumnComparisonWithSelfType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::GuidedTableColumnComparisonWithSelf` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_column_comparison_with_self_type.rb b/lib/datadog_api_client/v1/models/guided_table_column_comparison_with_self_type.rb new file mode 100644 index 000000000000..7400747f12f4 --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_column_comparison_with_self_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # + class GuidedTableColumnComparisonWithSelfType + include BaseEnumModel + + PERCENT_COLUMN_TOTAL = "percent_column_total".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_column_format.rb b/lib/datadog_api_client/v1/models/guided_table_column_format.rb new file mode 100644 index 000000000000..c1b9362509ab --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_column_format.rb @@ -0,0 +1,63 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Visual formatting applied to values in a guided table column. Supports number/bar mode and trend mode. + module GuidedTableColumnFormat + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'GuidedTableNumberBarColumnFormat', + :'GuidedTableTrendColumnFormat' + ] + end + # Builds the object + # @param data [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 de facto 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) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_column_function.rb b/lib/datadog_api_client/v1/models/guided_table_column_function.rb new file mode 100644 index 000000000000..2872774ef61b --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_column_function.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # A function to apply when computing a column's value. + class GuidedTableColumnFunction + include BaseGenericModel + + # Arguments passed to the function in order. + attr_accessor :args + + # Function name (e.g. `clamp_min`, `abs`, `round`). Not restricted to a fixed set. + attr_reader :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'args' => :'args', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'args' => :'Array', + :'name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::GuidedTableColumnFunction` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'args') + if (value = attributes[:'args']).is_a?(Array) + self.args = value + end + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + args == o.args && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [args, name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_column_function_args_item.rb b/lib/datadog_api_client/v1/models/guided_table_column_function_args_item.rb new file mode 100644 index 000000000000..33204de4fabf --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_column_function_args_item.rb @@ -0,0 +1,64 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # + module GuidedTableColumnFunctionArgsItem + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'String', + :'Float', + :'Boolean' + ] + end + # Builds the object + # @param data [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 de facto 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) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_compute_column.rb b/lib/datadog_api_client/v1/models/guided_table_compute_column.rb new file mode 100644 index 000000000000..88c72a18c734 --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_compute_column.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://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # A guided table column that computes an aggregation directly from one of the table's base queries. + class GuidedTableComputeColumn + include BaseGenericModel + + # Display name shown as the column header. + attr_accessor :_alias + + # Comparison to display in a guided table column. + attr_accessor :comparison + + # Aggregation configuration. + attr_reader :compute + + # Visual formatting applied to values in a guided table column. Supports number/bar mode and trend mode. + attr_reader :format + + # Functions to apply sequentially to the computed value. + attr_accessor :functions + + # Whether this column is hidden in the rendered table. + attr_accessor :is_hidden + + # Auto-generated name used to refer to this column. + attr_reader :name + + # + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'_alias' => :'alias', + :'comparison' => :'comparison', + :'compute' => :'compute', + :'format' => :'format', + :'functions' => :'functions', + :'is_hidden' => :'is_hidden', + :'name' => :'name', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'_alias' => :'String', + :'comparison' => :'GuidedTableColumnComparison', + :'compute' => :'GuidedTableComputeColumnCompute', + :'format' => :'GuidedTableColumnFormat', + :'functions' => :'Array', + :'is_hidden' => :'Boolean', + :'name' => :'String', + :'type' => :'GuidedTableComputeColumnType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::GuidedTableComputeColumn` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'_alias') + self._alias = attributes[:'_alias'] + end + + if attributes.key?(:'comparison') + self.comparison = attributes[:'comparison'] + end + + if attributes.key?(:'compute') + self.compute = attributes[:'compute'] + end + + if attributes.key?(:'format') + self.format = attributes[:'format'] + end + + if attributes.key?(:'functions') + if (value = attributes[:'functions']).is_a?(Array) + self.functions = value + end + end + + if attributes.key?(:'is_hidden') + self.is_hidden = attributes[:'is_hidden'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @compute.nil? + return false if @format.nil? + return false if @name.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param compute [Object] Object to be assigned + # @!visibility private + def compute=(compute) + if compute.nil? + fail ArgumentError, 'invalid value for "compute", compute cannot be nil.' + end + @compute = compute + end + + # Custom attribute writer method with validation + # @param format [Object] Object to be assigned + # @!visibility private + def format=(format) + if format.nil? + fail ArgumentError, 'invalid value for "format", format cannot be nil.' + end + @format = format + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _alias == o._alias && + comparison == o.comparison && + compute == o.compute && + format == o.format && + functions == o.functions && + is_hidden == o.is_hidden && + name == o.name && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [_alias, comparison, compute, format, functions, is_hidden, name, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_compute_column_compute.rb b/lib/datadog_api_client/v1/models/guided_table_compute_column_compute.rb new file mode 100644 index 000000000000..6887ffbc44d1 --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_compute_column_compute.rb @@ -0,0 +1,164 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Aggregation configuration. + class GuidedTableComputeColumnCompute + include BaseGenericModel + + # Aggregation type (e.g. `avg`, `sum`, `count`). + attr_reader :aggregation + + # Additional filter criteria. + attr_accessor :filter + + # Attribute to aggregate on. Depends on the data source (e.g. a log attribute). + attr_accessor :property + + # Name of the source query. + attr_reader :query + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'aggregation' => :'aggregation', + :'filter' => :'filter', + :'property' => :'property', + :'query' => :'query' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'aggregation' => :'String', + :'filter' => :'String', + :'property' => :'String', + :'query' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::GuidedTableComputeColumnCompute` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'aggregation') + self.aggregation = attributes[:'aggregation'] + end + + if attributes.key?(:'filter') + self.filter = attributes[:'filter'] + end + + if attributes.key?(:'property') + self.property = attributes[:'property'] + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @aggregation.nil? + return false if @query.nil? + true + end + + # Custom attribute writer method with validation + # @param aggregation [Object] Object to be assigned + # @!visibility private + def aggregation=(aggregation) + if aggregation.nil? + fail ArgumentError, 'invalid value for "aggregation", aggregation cannot be nil.' + end + @aggregation = aggregation + end + + # Custom attribute writer method with validation + # @param query [Object] Object to be assigned + # @!visibility private + def query=(query) + if query.nil? + fail ArgumentError, 'invalid value for "query", query cannot be nil.' + end + @query = query + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + aggregation == o.aggregation && + filter == o.filter && + property == o.property && + query == o.query && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [aggregation, filter, property, query, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_compute_column_type.rb b/lib/datadog_api_client/v1/models/guided_table_compute_column_type.rb new file mode 100644 index 000000000000..afd80536cdb5 --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_compute_column_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # + class GuidedTableComputeColumnType + include BaseEnumModel + + COMPUTE = "compute".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_conditional_formats.rb b/lib/datadog_api_client/v1/models/guided_table_conditional_formats.rb new file mode 100644 index 000000000000..ef3c9a034d1f --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_conditional_formats.rb @@ -0,0 +1,63 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Conditional formatting rules for a guided table column. Either an array of threshold-based rules or a single range-based rule. + module GuidedTableConditionalFormats + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Array', + :'Array' + ] + end + # Builds the object + # @param data [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 de facto 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) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_events_query.rb b/lib/datadog_api_client/v1/models/guided_table_events_query.rb new file mode 100644 index 000000000000..9234bceba49d --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_events_query.rb @@ -0,0 +1,186 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # An events-platform query fragment used as source data for a guided table. Covers logs, RUM, spans, CI pipelines, events, and product analytics. + class GuidedTableEventsQuery + include BaseGenericModel + + # Display alias for the query. + attr_accessor :_alias + + # Events data source. + attr_reader :data_source + + # Indexes to search for events. + attr_accessor :indexes + + # Variable name used to reference this query in columns and formulas. + attr_reader :name + + # Search filter for matching events. + attr_accessor :search + + # Storage tier to target for an events-platform query in a guided table. + attr_accessor :storage + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'_alias' => :'alias', + :'data_source' => :'data_source', + :'indexes' => :'indexes', + :'name' => :'name', + :'search' => :'search', + :'storage' => :'storage' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'_alias' => :'String', + :'data_source' => :'GuidedTableEventsQueryDataSource', + :'indexes' => :'Array', + :'name' => :'String', + :'search' => :'GuidedTableEventsQuerySearch', + :'storage' => :'GuidedTableStorageType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::GuidedTableEventsQuery` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'_alias') + self._alias = attributes[:'_alias'] + end + + if attributes.key?(:'data_source') + self.data_source = attributes[:'data_source'] + 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 + + if attributes.key?(:'storage') + self.storage = attributes[:'storage'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data_source.nil? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param data_source [Object] Object to be assigned + # @!visibility private + def data_source=(data_source) + if data_source.nil? + fail ArgumentError, 'invalid value for "data_source", data_source cannot be nil.' + end + @data_source = data_source + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _alias == o._alias && + data_source == o.data_source && + indexes == o.indexes && + name == o.name && + search == o.search && + storage == o.storage && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [_alias, data_source, indexes, name, search, storage, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_events_query_data_source.rb b/lib/datadog_api_client/v1/models/guided_table_events_query_data_source.rb new file mode 100644 index 000000000000..f37ac7a90ecc --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_events_query_data_source.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://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Events data source. + class GuidedTableEventsQueryDataSource + include BaseEnumModel + + LOGS = "logs".freeze + RUM = "rum".freeze + SPANS = "spans".freeze + CI_PIPELINES = "ci_pipelines".freeze + EVENTS = "events".freeze + PRODUCT_ANALYTICS = "product_analytics".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_events_query_search.rb b/lib/datadog_api_client/v1/models/guided_table_events_query_search.rb new file mode 100644 index 000000000000..14b56c66e687 --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_events_query_search.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Search filter for matching events. + class GuidedTableEventsQuerySearch + include BaseGenericModel + + # Events search query string using events-platform search grammar. + attr_accessor :query + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'query' => :'query' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'query' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::GuidedTableEventsQuerySearch` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + query == o.query && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [query, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_formula_column.rb b/lib/datadog_api_client/v1/models/guided_table_formula_column.rb new file mode 100644 index 000000000000..c042c8a48192 --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_formula_column.rb @@ -0,0 +1,216 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # A guided table column that displays the result of evaluating a formula over other columns. + class GuidedTableFormulaColumn + include BaseGenericModel + + # Display name shown as the column header. + attr_accessor :_alias + + # Comparison to display in a guided table column. + attr_accessor :comparison + + # Visual formatting applied to values in a guided table column. Supports number/bar mode and trend mode. + attr_reader :format + + # The formula expression to evaluate. + attr_reader :formula + + # Whether this column is hidden in the rendered table. + attr_accessor :is_hidden + + # Auto-generated name used to refer to this column. + attr_reader :name + + # Set the sort type to formula. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'_alias' => :'alias', + :'comparison' => :'comparison', + :'format' => :'format', + :'formula' => :'formula', + :'is_hidden' => :'is_hidden', + :'name' => :'name', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'_alias' => :'String', + :'comparison' => :'GuidedTableColumnComparison', + :'format' => :'GuidedTableColumnFormat', + :'formula' => :'String', + :'is_hidden' => :'Boolean', + :'name' => :'String', + :'type' => :'FormulaType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::GuidedTableFormulaColumn` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'_alias') + self._alias = attributes[:'_alias'] + end + + if attributes.key?(:'comparison') + self.comparison = attributes[:'comparison'] + end + + if attributes.key?(:'format') + self.format = attributes[:'format'] + end + + if attributes.key?(:'formula') + self.formula = attributes[:'formula'] + end + + if attributes.key?(:'is_hidden') + self.is_hidden = attributes[:'is_hidden'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @format.nil? + return false if @formula.nil? + return false if @name.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param format [Object] Object to be assigned + # @!visibility private + def format=(format) + if format.nil? + fail ArgumentError, 'invalid value for "format", format cannot be nil.' + end + @format = format + end + + # Custom attribute writer method with validation + # @param formula [Object] Object to be assigned + # @!visibility private + def formula=(formula) + if formula.nil? + fail ArgumentError, 'invalid value for "formula", formula cannot be nil.' + end + @formula = formula + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _alias == o._alias && + comparison == o.comparison && + format == o.format && + formula == o.formula && + is_hidden == o.is_hidden && + name == o.name && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [_alias, comparison, format, formula, is_hidden, name, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_group_key.rb b/lib/datadog_api_client/v1/models/guided_table_group_key.rb new file mode 100644 index 000000000000..2fda8618cc41 --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_group_key.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Maps a specific base query to the field name used for grouping. + class GuidedTableGroupKey + include BaseGenericModel + + # Field name in the query result used as the grouping key. + attr_reader :group_key + + # Name of the source query. + attr_reader :query + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'group_key' => :'group_key', + :'query' => :'query' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'group_key' => :'String', + :'query' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::GuidedTableGroupKey` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'group_key') + self.group_key = attributes[:'group_key'] + end + + if attributes.key?(:'query') + self.query = attributes[:'query'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @group_key.nil? + return false if @query.nil? + true + end + + # Custom attribute writer method with validation + # @param group_key [Object] Object to be assigned + # @!visibility private + def group_key=(group_key) + if group_key.nil? + fail ArgumentError, 'invalid value for "group_key", group_key cannot be nil.' + end + @group_key = group_key + end + + # Custom attribute writer method with validation + # @param query [Object] Object to be assigned + # @!visibility private + def query=(query) + if query.nil? + fail ArgumentError, 'invalid value for "query", query cannot be nil.' + end + @query = query + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + group_key == o.group_key && + query == o.query && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [group_key, query, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_metrics_query.rb b/lib/datadog_api_client/v1/models/guided_table_metrics_query.rb new file mode 100644 index 000000000000..7d1b0ed89e06 --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_metrics_query.rb @@ -0,0 +1,185 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # A metrics (or cloud cost) query fragment used as source data for a guided table. Group-by and time/space aggregation are defined separately. + class GuidedTableMetricsQuery + include BaseGenericModel + + # Display alias for the query. + attr_accessor :_alias + + # Metrics data source. + attr_reader :data_source + + # Filter string to apply to the metric query. + attr_accessor :filter + + # Name of the metric to query. + attr_reader :metric_name + + # Variable name used to reference this query in columns and formulas. + attr_reader :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'_alias' => :'alias', + :'data_source' => :'data_source', + :'filter' => :'filter', + :'metric_name' => :'metric_name', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'_alias' => :'String', + :'data_source' => :'GuidedTableMetricsQueryDataSource', + :'filter' => :'String', + :'metric_name' => :'String', + :'name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::GuidedTableMetricsQuery` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'_alias') + self._alias = attributes[:'_alias'] + end + + if attributes.key?(:'data_source') + self.data_source = attributes[:'data_source'] + end + + if attributes.key?(:'filter') + self.filter = attributes[:'filter'] + end + + if attributes.key?(:'metric_name') + self.metric_name = attributes[:'metric_name'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data_source.nil? + return false if @metric_name.nil? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param data_source [Object] Object to be assigned + # @!visibility private + def data_source=(data_source) + if data_source.nil? + fail ArgumentError, 'invalid value for "data_source", data_source cannot be nil.' + end + @data_source = data_source + end + + # Custom attribute writer method with validation + # @param metric_name [Object] Object to be assigned + # @!visibility private + def metric_name=(metric_name) + if metric_name.nil? + fail ArgumentError, 'invalid value for "metric_name", metric_name cannot be nil.' + end + @metric_name = metric_name + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _alias == o._alias && + data_source == o.data_source && + filter == o.filter && + metric_name == o.metric_name && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [_alias, data_source, filter, metric_name, name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_metrics_query_data_source.rb b/lib/datadog_api_client/v1/models/guided_table_metrics_query_data_source.rb new file mode 100644 index 000000000000..932a02f16d0d --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_metrics_query_data_source.rb @@ -0,0 +1,27 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Metrics data source. + class GuidedTableMetricsQueryDataSource + include BaseEnumModel + + METRICS = "metrics".freeze + CLOUD_COST = "cloud_cost".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_number_bar_column_format.rb b/lib/datadog_api_client/v1/models/guided_table_number_bar_column_format.rb new file mode 100644 index 000000000000..67d4c31aff9d --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_number_bar_column_format.rb @@ -0,0 +1,143 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Formats a guided table column as a number or a bar. + class GuidedTableNumberBarColumnFormat + include BaseGenericModel + + # Conditional formatting rules for a guided table column. Either an array of threshold-based rules or a single range-based rule. + attr_accessor :conditional_formats + + # + attr_reader :mode + + # Number display format for a guided table column value. + attr_accessor :number_format + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'conditional_formats' => :'conditional_formats', + :'mode' => :'mode', + :'number_format' => :'number_format' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'conditional_formats' => :'GuidedTableConditionalFormats', + :'mode' => :'GuidedTableNumberBarColumnFormatMode', + :'number_format' => :'GuidedTableNumberFormat' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::GuidedTableNumberBarColumnFormat` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'conditional_formats') + self.conditional_formats = attributes[:'conditional_formats'] + end + + if attributes.key?(:'mode') + self.mode = attributes[:'mode'] + end + + if attributes.key?(:'number_format') + self.number_format = attributes[:'number_format'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @mode.nil? + true + end + + # Custom attribute writer method with validation + # @param mode [Object] Object to be assigned + # @!visibility private + def mode=(mode) + if mode.nil? + fail ArgumentError, 'invalid value for "mode", mode cannot be nil.' + end + @mode = mode + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + conditional_formats == o.conditional_formats && + mode == o.mode && + number_format == o.number_format && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [conditional_formats, mode, number_format, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_number_bar_column_format_mode.rb b/lib/datadog_api_client/v1/models/guided_table_number_bar_column_format_mode.rb new file mode 100644 index 000000000000..fa0e97db4d5e --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_number_bar_column_format_mode.rb @@ -0,0 +1,27 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # + class GuidedTableNumberBarColumnFormatMode + include BaseEnumModel + + NUMBER = "number".freeze + BAR = "bar".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_number_format.rb b/lib/datadog_api_client/v1/models/guided_table_number_format.rb new file mode 100644 index 000000000000..cab157472e60 --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_number_format.rb @@ -0,0 +1,133 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Number display format for a guided table column value. + class GuidedTableNumberFormat + include BaseGenericModel + + # Number of digits after the decimal point. Use `*` for full precision, `integer` to show full integer values, or omit for automatic precision. + attr_accessor :precision + + # Number format unit. + attr_accessor :unit + + # The definition of `NumberFormatUnitScale` object. + attr_accessor :unit_scale + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'precision' => :'precision', + :'unit' => :'unit', + :'unit_scale' => :'unit_scale' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'precision' => :'GuidedTableNumberFormatPrecision', + :'unit' => :'NumberFormatUnit', + :'unit_scale' => :'NumberFormatUnitScale' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'unit_scale', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::GuidedTableNumberFormat` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'precision') + self.precision = attributes[:'precision'] + end + + if attributes.key?(:'unit') + self.unit = attributes[:'unit'] + end + + if attributes.key?(:'unit_scale') + self.unit_scale = attributes[:'unit_scale'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + precision == o.precision && + unit == o.unit && + unit_scale == o.unit_scale && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [precision, unit, unit_scale, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_number_format_precision.rb b/lib/datadog_api_client/v1/models/guided_table_number_format_precision.rb new file mode 100644 index 000000000000..831d1f3dc774 --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_number_format_precision.rb @@ -0,0 +1,63 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Number of digits after the decimal point. Use `*` for full precision, `integer` to show full integer values, or omit for automatic precision. + module GuidedTableNumberFormatPrecision + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'String', + :'Integer' + ] + end + # Builds the object + # @param data [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 de facto 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) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_preset_column.rb b/lib/datadog_api_client/v1/models/guided_table_preset_column.rb new file mode 100644 index 000000000000..d29e245854e8 --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_preset_column.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://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # A guided table column that displays values for the previous time period based on another column's full query. + class GuidedTablePresetColumn + include BaseGenericModel + + # Display name shown as the column header. + attr_accessor :_alias + + # Comparison to display in a guided table column. + attr_accessor :comparison + + # Visual formatting applied to values in a guided table column. Supports number/bar mode and trend mode. + attr_reader :format + + # Functions to apply sequentially to the computed value. + attr_accessor :functions + + # Whether this column is hidden in the rendered table. + attr_accessor :is_hidden + + # Auto-generated name used to refer to this column. + attr_reader :name + + # Preset configuration. + attr_reader :preset + + # + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'_alias' => :'alias', + :'comparison' => :'comparison', + :'format' => :'format', + :'functions' => :'functions', + :'is_hidden' => :'is_hidden', + :'name' => :'name', + :'preset' => :'preset', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'_alias' => :'String', + :'comparison' => :'GuidedTableColumnComparison', + :'format' => :'GuidedTableColumnFormat', + :'functions' => :'Array', + :'is_hidden' => :'Boolean', + :'name' => :'String', + :'preset' => :'GuidedTablePresetColumnPreset', + :'type' => :'GuidedTablePresetColumnType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::GuidedTablePresetColumn` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'_alias') + self._alias = attributes[:'_alias'] + end + + if attributes.key?(:'comparison') + self.comparison = attributes[:'comparison'] + end + + if attributes.key?(:'format') + self.format = attributes[:'format'] + end + + if attributes.key?(:'functions') + if (value = attributes[:'functions']).is_a?(Array) + self.functions = value + end + end + + if attributes.key?(:'is_hidden') + self.is_hidden = attributes[:'is_hidden'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'preset') + self.preset = attributes[:'preset'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @format.nil? + return false if @name.nil? + return false if @preset.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param format [Object] Object to be assigned + # @!visibility private + def format=(format) + if format.nil? + fail ArgumentError, 'invalid value for "format", format cannot be nil.' + end + @format = format + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param preset [Object] Object to be assigned + # @!visibility private + def preset=(preset) + if preset.nil? + fail ArgumentError, 'invalid value for "preset", preset cannot be nil.' + end + @preset = preset + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _alias == o._alias && + comparison == o.comparison && + format == o.format && + functions == o.functions && + is_hidden == o.is_hidden && + name == o.name && + preset == o.preset && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [_alias, comparison, format, functions, is_hidden, name, preset, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_preset_column_preset.rb b/lib/datadog_api_client/v1/models/guided_table_preset_column_preset.rb new file mode 100644 index 000000000000..030a0218d4b7 --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_preset_column_preset.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Preset configuration. + class GuidedTablePresetColumnPreset + include BaseGenericModel + + # Name of the column whose full query is reused. + attr_reader :column + + # + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'column' => :'column', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'column' => :'String', + :'type' => :'GuidedTablePresetColumnPresetType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::GuidedTablePresetColumnPreset` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'column') + self.column = attributes[:'column'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @column.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param column [Object] Object to be assigned + # @!visibility private + def column=(column) + if column.nil? + fail ArgumentError, 'invalid value for "column", column cannot be nil.' + end + @column = column + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + column == o.column && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [column, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_preset_column_preset_type.rb b/lib/datadog_api_client/v1/models/guided_table_preset_column_preset_type.rb new file mode 100644 index 000000000000..0c18af5e092f --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_preset_column_preset_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # + class GuidedTablePresetColumnPresetType + include BaseEnumModel + + PREVIOUS_PERIOD = "previous_period".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_preset_column_type.rb b/lib/datadog_api_client/v1/models/guided_table_preset_column_type.rb new file mode 100644 index 000000000000..fb8ce6aefaeb --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_preset_column_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # + class GuidedTablePresetColumnType + include BaseEnumModel + + PRESET = "preset".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_query.rb b/lib/datadog_api_client/v1/models/guided_table_query.rb new file mode 100644 index 000000000000..7731f3487fa7 --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_query.rb @@ -0,0 +1,63 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # A base query used as source data for a guided table widget. Either a metrics query or an events-platform query. + module GuidedTableQuery + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'GuidedTableMetricsQuery', + :'GuidedTableEventsQuery' + ] + end + # Builds the object + # @param data [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 de facto 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) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_range_formatting_rule.rb b/lib/datadog_api_client/v1/models/guided_table_range_formatting_rule.rb new file mode 100644 index 000000000000..7a3939b04b8a --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_range_formatting_rule.rb @@ -0,0 +1,184 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Formats values according to where they fall on a color scale. + class GuidedTableRangeFormattingRule + include BaseGenericModel + + # Maximum value on the mapping scale. + attr_accessor :max + + # Minimum value on the mapping scale. + attr_accessor :min + + # Color palette used by range-based conditional formatting rules. + attr_reader :palette + + # Whether to reverse the palette scale direction. + attr_accessor :reverse + + # Scale function for mapping values to colors. + attr_accessor :scale + + # + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'max' => :'max', + :'min' => :'min', + :'palette' => :'palette', + :'reverse' => :'reverse', + :'scale' => :'scale', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'max' => :'Float', + :'min' => :'Float', + :'palette' => :'GuidedTableRangePalette', + :'reverse' => :'Boolean', + :'scale' => :'GuidedTableRangeFormattingRuleScale', + :'type' => :'GuidedTableRangeFormattingRuleType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::GuidedTableRangeFormattingRule` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'max') + self.max = attributes[:'max'] + end + + if attributes.key?(:'min') + self.min = attributes[:'min'] + end + + if attributes.key?(:'palette') + self.palette = attributes[:'palette'] + end + + if attributes.key?(:'reverse') + self.reverse = attributes[:'reverse'] + end + + if attributes.key?(:'scale') + self.scale = attributes[:'scale'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @palette.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param palette [Object] Object to be assigned + # @!visibility private + def palette=(palette) + if palette.nil? + fail ArgumentError, 'invalid value for "palette", palette cannot be nil.' + end + @palette = palette + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + max == o.max && + min == o.min && + palette == o.palette && + reverse == o.reverse && + scale == o.scale && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [max, min, palette, reverse, scale, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_range_formatting_rule_scale.rb b/lib/datadog_api_client/v1/models/guided_table_range_formatting_rule_scale.rb new file mode 100644 index 000000000000..f50468c810d6 --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_range_formatting_rule_scale.rb @@ -0,0 +1,29 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Scale function for mapping values to colors. + class GuidedTableRangeFormattingRuleScale + include BaseEnumModel + + LINEAR = "linear".freeze + LOG = "log".freeze + POW = "pow".freeze + SQRT = "sqrt".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_range_formatting_rule_type.rb b/lib/datadog_api_client/v1/models/guided_table_range_formatting_rule_type.rb new file mode 100644 index 000000000000..e7650a5db756 --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_range_formatting_rule_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # + class GuidedTableRangeFormattingRuleType + include BaseEnumModel + + RANGE = "range".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_range_palette.rb b/lib/datadog_api_client/v1/models/guided_table_range_palette.rb new file mode 100644 index 000000000000..5b1b202095e8 --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_range_palette.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://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Color palette used by range-based conditional formatting rules. + class GuidedTableRangePalette + include BaseEnumModel + + TRANSPARENT_TO_GREEN = "transparent_to_green".freeze + TRANSPARENT_TO_ORANGE = "transparent_to_orange".freeze + TRANSPARENT_TO_RED = "transparent_to_red".freeze + TRANSPARENT_TO_BLUE = "transparent_to_blue".freeze + RED_TRANSPARENT_GREEN = "red_transparent_green".freeze + RED_TRANSPARENT_BLUE = "red_transparent_blue".freeze + VIVID_TRANSPARENT_TO_GREEN = "vivid_transparent_to_green".freeze + VIVID_TRANSPARENT_TO_ORANGE = "vivid_transparent_to_orange".freeze + VIVID_TRANSPARENT_TO_RED = "vivid_transparent_to_red".freeze + VIVID_TRANSPARENT_TO_BLUE = "vivid_transparent_to_blue".freeze + VIVID_RED_TRANSPARENT_GREEN = "vivid_red_transparent_green".freeze + VIVID_RED_TRANSPARENT_BLUE = "vivid_red_transparent_blue".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_request.rb b/lib/datadog_api_client/v1/models/guided_table_request.rb new file mode 100644 index 000000000000..5bd59d01f4d0 --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_request.rb @@ -0,0 +1,194 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Request definition for the guided table widget — a structured, guided format for defining a table of data. Used when the `graphing_new_table_widget_editor` feature flag is enabled; otherwise use the classic `TableWidgetRequest`. Defines base queries, how to produce rows, and how to compute columns. + class GuidedTableRequest + include BaseGenericModel + + # Column definitions that describe how to compute and display table values. + attr_reader :columns + + # Base queries that provide the source data for the table. + attr_reader :queries + + # Identifies this as a guided table request. + attr_reader :request_type + + # Defines how to compute the rows of a guided table. + attr_reader :rows + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'columns' => :'columns', + :'queries' => :'queries', + :'request_type' => :'request_type', + :'rows' => :'rows' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'columns' => :'Array', + :'queries' => :'Array', + :'request_type' => :'GuidedTableRequestRequestType', + :'rows' => :'GuidedTableRows' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::GuidedTableRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'columns') + if (value = attributes[:'columns']).is_a?(Array) + self.columns = value + end + end + + if attributes.key?(:'queries') + if (value = attributes[:'queries']).is_a?(Array) + self.queries = value + end + end + + if attributes.key?(:'request_type') + self.request_type = attributes[:'request_type'] + end + + if attributes.key?(:'rows') + self.rows = attributes[:'rows'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @columns.nil? + return false if @queries.nil? + return false if @queries.length < 1 + return false if @request_type.nil? + return false if @rows.nil? + true + end + + # Custom attribute writer method with validation + # @param columns [Object] Object to be assigned + # @!visibility private + def columns=(columns) + if columns.nil? + fail ArgumentError, 'invalid value for "columns", columns cannot be nil.' + end + @columns = columns + end + + # Custom attribute writer method with validation + # @param queries [Object] Object to be assigned + # @!visibility private + def queries=(queries) + if queries.nil? + fail ArgumentError, 'invalid value for "queries", queries cannot be nil.' + end + if queries.length < 1 + fail ArgumentError, 'invalid value for "queries", number of items must be greater than or equal to 1.' + end + @queries = queries + end + + # Custom attribute writer method with validation + # @param request_type [Object] Object to be assigned + # @!visibility private + def request_type=(request_type) + if request_type.nil? + fail ArgumentError, 'invalid value for "request_type", request_type cannot be nil.' + end + @request_type = request_type + end + + # Custom attribute writer method with validation + # @param rows [Object] Object to be assigned + # @!visibility private + def rows=(rows) + if rows.nil? + fail ArgumentError, 'invalid value for "rows", rows cannot be nil.' + end + @rows = rows + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + columns == o.columns && + queries == o.queries && + request_type == o.request_type && + rows == o.rows && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [columns, queries, request_type, rows, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_request_request_type.rb b/lib/datadog_api_client/v1/models/guided_table_request_request_type.rb new file mode 100644 index 000000000000..19cf83de081c --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_request_request_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Identifies this as a guided table request. + class GuidedTableRequestRequestType + include BaseEnumModel + + TABLE = "table".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_row_group_by.rb b/lib/datadog_api_client/v1/models/guided_table_row_group_by.rb new file mode 100644 index 000000000000..17e444189754 --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_row_group_by.rb @@ -0,0 +1,176 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Defines one group-by dimension used to produce the rows of a guided table. + class GuidedTableRowGroupBy + include BaseGenericModel + + # Display name used as the column header for this group-by. + attr_accessor :_alias + + # Text formatting configuration for this group-by column. + attr_accessor :format + + # Mapping from each source query to the field name used as the grouping key. Different data sources may use different field names for the same concept. + attr_reader :group_keys + + # Whether this group-by column is hidden in the rendered table. + attr_accessor :is_hidden + + # Auto-generated name for this group-by parameter. + attr_reader :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'_alias' => :'alias', + :'format' => :'format', + :'group_keys' => :'group_keys', + :'is_hidden' => :'is_hidden', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'_alias' => :'String', + :'format' => :'GuidedTableRowGroupByFormat', + :'group_keys' => :'Array', + :'is_hidden' => :'Boolean', + :'name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::GuidedTableRowGroupBy` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'_alias') + self._alias = attributes[:'_alias'] + end + + if attributes.key?(:'format') + self.format = attributes[:'format'] + end + + if attributes.key?(:'group_keys') + if (value = attributes[:'group_keys']).is_a?(Array) + self.group_keys = value + end + end + + if attributes.key?(:'is_hidden') + self.is_hidden = attributes[:'is_hidden'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @group_keys.nil? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param group_keys [Object] Object to be assigned + # @!visibility private + def group_keys=(group_keys) + if group_keys.nil? + fail ArgumentError, 'invalid value for "group_keys", group_keys cannot be nil.' + end + @group_keys = group_keys + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + _alias == o._alias && + format == o.format && + group_keys == o.group_keys && + is_hidden == o.is_hidden && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [_alias, format, group_keys, is_hidden, name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_row_group_by_format.rb b/lib/datadog_api_client/v1/models/guided_table_row_group_by_format.rb new file mode 100644 index 000000000000..52d69fcb0e50 --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_row_group_by_format.rb @@ -0,0 +1,107 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Text formatting configuration for this group-by column. + class GuidedTableRowGroupByFormat + include BaseGenericModel + + # + attr_accessor :text_formats + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'text_formats' => :'text_formats' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'text_formats' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::GuidedTableRowGroupByFormat` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'text_formats') + if (value = attributes[:'text_formats']).is_a?(Array) + self.text_formats = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + text_formats == o.text_formats && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [text_formats, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_rows.rb b/lib/datadog_api_client/v1/models/guided_table_rows.rb new file mode 100644 index 000000000000..1aa04d689393 --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_rows.rb @@ -0,0 +1,150 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Defines how to compute the rows of a guided table. + class GuidedTableRows + include BaseGenericModel + + # Grouping dimensions that form each row. Must be non-empty. + attr_reader :group_by + + # Sort configuration for a guided table. + attr_reader :sort + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'group_by' => :'group_by', + :'sort' => :'sort' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'group_by' => :'Array', + :'sort' => :'GuidedTableSort' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::GuidedTableRows` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'group_by') + if (value = attributes[:'group_by']).is_a?(Array) + self.group_by = value + end + end + + if attributes.key?(:'sort') + self.sort = attributes[:'sort'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @group_by.nil? + return false if @group_by.length < 1 + return false if @sort.nil? + true + end + + # Custom attribute writer method with validation + # @param group_by [Object] Object to be assigned + # @!visibility private + def group_by=(group_by) + if group_by.nil? + fail ArgumentError, 'invalid value for "group_by", group_by cannot be nil.' + end + if group_by.length < 1 + fail ArgumentError, 'invalid value for "group_by", number of items must be greater than or equal to 1.' + end + @group_by = group_by + end + + # Custom attribute writer method with validation + # @param sort [Object] Object to be assigned + # @!visibility private + def sort=(sort) + if sort.nil? + fail ArgumentError, 'invalid value for "sort", sort cannot be nil.' + end + @sort = sort + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + group_by == o.group_by && + sort == o.sort && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [group_by, sort, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_sort.rb b/lib/datadog_api_client/v1/models/guided_table_sort.rb new file mode 100644 index 000000000000..fedf8028b2a9 --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_sort.rb @@ -0,0 +1,150 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Sort configuration for a guided table. + class GuidedTableSort + include BaseGenericModel + + # Columns to sort by, in order of application. + attr_reader :columns + + # Maximum number of rows to show after sorting. + attr_reader :limit + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'columns' => :'columns', + :'limit' => :'limit' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'columns' => :'Array', + :'limit' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::GuidedTableSort` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'columns') + if (value = attributes[:'columns']).is_a?(Array) + self.columns = value + end + end + + if attributes.key?(:'limit') + self.limit = attributes[:'limit'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @columns.nil? + return false if @limit.nil? + return false if @limit < 1 + true + end + + # Custom attribute writer method with validation + # @param columns [Object] Object to be assigned + # @!visibility private + def columns=(columns) + if columns.nil? + fail ArgumentError, 'invalid value for "columns", columns cannot be nil.' + end + @columns = columns + end + + # Custom attribute writer method with validation + # @param limit [Object] Object to be assigned + # @!visibility private + def limit=(limit) + if limit.nil? + fail ArgumentError, 'invalid value for "limit", limit cannot be nil.' + end + if limit < 1 + fail ArgumentError, 'invalid value for "limit", must be greater than or equal to 1.' + end + @limit = limit + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + columns == o.columns && + limit == o.limit && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [columns, limit, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_storage_type.rb b/lib/datadog_api_client/v1/models/guided_table_storage_type.rb new file mode 100644 index 000000000000..9018c6f18271 --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_storage_type.rb @@ -0,0 +1,32 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Storage tier to target for an events-platform query in a guided table. + class GuidedTableStorageType + include BaseEnumModel + + LIVE = "live".freeze + HOT = "hot".freeze + ONLINE_ARCHIVES = "online_archives".freeze + DRIVELINE = "driveline".freeze + FLEX_TIER = "flex_tier".freeze + CASE_INSENSITIVE = "case_insensitive".freeze + CLOUD_PREM = "cloud_prem".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_text_formatting_rule.rb b/lib/datadog_api_client/v1/models/guided_table_text_formatting_rule.rb new file mode 100644 index 000000000000..ab46cedfe8a1 --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_text_formatting_rule.rb @@ -0,0 +1,163 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Rule for applying visual formatting to text values in a guided table group-by column. + class GuidedTableTextFormattingRule + include BaseGenericModel + + # Custom background color hex code. Used with `custom_bg` palette. + attr_accessor :custom_bg_color + + # Custom text color hex code. Used with `custom_text` palette. + attr_accessor :custom_fg_color + + # Match rule for the table widget text format. + attr_reader :match + + # Color palette used by threshold-based conditional formatting and text formatting rules in a guided table. + attr_accessor :palette + + # Optional replacement to apply to matched text. + attr_accessor :replace + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'custom_bg_color' => :'custom_bg_color', + :'custom_fg_color' => :'custom_fg_color', + :'match' => :'match', + :'palette' => :'palette', + :'replace' => :'replace' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'custom_bg_color' => :'String', + :'custom_fg_color' => :'String', + :'match' => :'TableWidgetTextFormatMatch', + :'palette' => :'GuidedTableThresholdPalette', + :'replace' => :'GuidedTableTextFormattingRuleReplace' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::GuidedTableTextFormattingRule` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'custom_bg_color') + self.custom_bg_color = attributes[:'custom_bg_color'] + end + + if attributes.key?(:'custom_fg_color') + self.custom_fg_color = attributes[:'custom_fg_color'] + end + + if attributes.key?(:'match') + self.match = attributes[:'match'] + end + + if attributes.key?(:'palette') + self.palette = attributes[:'palette'] + end + + if attributes.key?(:'replace') + self.replace = attributes[:'replace'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @match.nil? + true + end + + # Custom attribute writer method with validation + # @param match [Object] Object to be assigned + # @!visibility private + def match=(match) + if match.nil? + fail ArgumentError, 'invalid value for "match", match cannot be nil.' + end + @match = match + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + custom_bg_color == o.custom_bg_color && + custom_fg_color == o.custom_fg_color && + match == o.match && + palette == o.palette && + replace == o.replace && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [custom_bg_color, custom_fg_color, match, palette, replace, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_text_formatting_rule_replace.rb b/lib/datadog_api_client/v1/models/guided_table_text_formatting_rule_replace.rb new file mode 100644 index 000000000000..f20030ca2395 --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_text_formatting_rule_replace.rb @@ -0,0 +1,63 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Optional replacement to apply to matched text. + module GuidedTableTextFormattingRuleReplace + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'TableWidgetTextFormatReplaceAll', + :'GuidedTableTextFormattingRuleReplaceOneOf4484404608' + ] + end + # Builds the object + # @param data [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 de facto 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) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_text_formatting_rule_replace_one_of4484404608.rb b/lib/datadog_api_client/v1/models/guided_table_text_formatting_rule_replace_one_of4484404608.rb new file mode 100644 index 000000000000..639733d109dc --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_text_formatting_rule_replace_one_of4484404608.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Replace a specific substring. + class GuidedTableTextFormattingRuleReplaceOneOf4484404608 + include BaseGenericModel + + # + attr_reader :substring + + # Table widget text format replace sub-string type. + attr_reader :type + + # + attr_reader :with + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'substring' => :'substring', + :'type' => :'type', + :'with' => :'with' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'substring' => :'String', + :'type' => :'TableWidgetTextFormatReplaceSubstringType', + :'with' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::GuidedTableTextFormattingRuleReplaceOneOf4484404608` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'substring') + self.substring = attributes[:'substring'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'with') + self.with = attributes[:'with'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @substring.nil? + return false if @type.nil? + return false if @with.nil? + true + end + + # Custom attribute writer method with validation + # @param substring [Object] Object to be assigned + # @!visibility private + def substring=(substring) + if substring.nil? + fail ArgumentError, 'invalid value for "substring", substring cannot be nil.' + end + @substring = substring + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Custom attribute writer method with validation + # @param with [Object] Object to be assigned + # @!visibility private + def with=(with) + if with.nil? + fail ArgumentError, 'invalid value for "with", with cannot be nil.' + end + @with = with + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + substring == o.substring && + type == o.type && + with == o.with && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [substring, type, with, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_threshold_formatting_rule.rb b/lib/datadog_api_client/v1/models/guided_table_threshold_formatting_rule.rb new file mode 100644 index 000000000000..ef0c12e10914 --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_threshold_formatting_rule.rb @@ -0,0 +1,194 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Conditional formatting rule that applies when a value satisfies a threshold comparator condition. + class GuidedTableThresholdFormattingRule + include BaseGenericModel + + # Comparator to apply. + attr_reader :comparator + + # Custom background color. Used with `custom_bg` palette. + attr_accessor :custom_bg_color + + # Custom text color. Used with `custom_text` palette. + attr_accessor :custom_fg_color + + # Whether to hide the data value when this rule matches. + attr_accessor :hide_value + + # URL of an image to display as background. + attr_accessor :image_url + + # Color palette used by threshold-based conditional formatting and text formatting rules in a guided table. + attr_reader :palette + + # Threshold value to compare against. + attr_accessor :value + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'comparator' => :'comparator', + :'custom_bg_color' => :'custom_bg_color', + :'custom_fg_color' => :'custom_fg_color', + :'hide_value' => :'hide_value', + :'image_url' => :'image_url', + :'palette' => :'palette', + :'value' => :'value' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'comparator' => :'WidgetComparator', + :'custom_bg_color' => :'String', + :'custom_fg_color' => :'String', + :'hide_value' => :'Boolean', + :'image_url' => :'String', + :'palette' => :'GuidedTableThresholdPalette', + :'value' => :'GuidedTableThresholdFormattingRuleValue' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::GuidedTableThresholdFormattingRule` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'comparator') + self.comparator = attributes[:'comparator'] + end + + if attributes.key?(:'custom_bg_color') + self.custom_bg_color = attributes[:'custom_bg_color'] + end + + if attributes.key?(:'custom_fg_color') + self.custom_fg_color = attributes[:'custom_fg_color'] + end + + if attributes.key?(:'hide_value') + self.hide_value = attributes[:'hide_value'] + end + + if attributes.key?(:'image_url') + self.image_url = attributes[:'image_url'] + end + + if attributes.key?(:'palette') + self.palette = attributes[:'palette'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @comparator.nil? + return false if @palette.nil? + true + end + + # Custom attribute writer method with validation + # @param comparator [Object] Object to be assigned + # @!visibility private + def comparator=(comparator) + if comparator.nil? + fail ArgumentError, 'invalid value for "comparator", comparator cannot be nil.' + end + @comparator = comparator + end + + # Custom attribute writer method with validation + # @param palette [Object] Object to be assigned + # @!visibility private + def palette=(palette) + if palette.nil? + fail ArgumentError, 'invalid value for "palette", palette cannot be nil.' + end + @palette = palette + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + comparator == o.comparator && + custom_bg_color == o.custom_bg_color && + custom_fg_color == o.custom_fg_color && + hide_value == o.hide_value && + image_url == o.image_url && + palette == o.palette && + value == o.value && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [comparator, custom_bg_color, custom_fg_color, hide_value, image_url, palette, value, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_threshold_formatting_rule_value.rb b/lib/datadog_api_client/v1/models/guided_table_threshold_formatting_rule_value.rb new file mode 100644 index 000000000000..2ff9ff05588e --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_threshold_formatting_rule_value.rb @@ -0,0 +1,63 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Threshold value to compare against. + module GuidedTableThresholdFormattingRuleValue + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'Float', + :'String' + ] + end + # Builds the object + # @param data [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 de facto 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) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_threshold_palette.rb b/lib/datadog_api_client/v1/models/guided_table_threshold_palette.rb new file mode 100644 index 000000000000..a788b657d24c --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_threshold_palette.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://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Color palette used by threshold-based conditional formatting and text formatting rules in a guided table. + class GuidedTableThresholdPalette + include BaseEnumModel + + WHITE_ON_RED = "white_on_red".freeze + BLACK_ON_LIGHT_RED = "black_on_light_red".freeze + WHITE_ON_GREEN = "white_on_green".freeze + BLACK_ON_LIGHT_GREEN = "black_on_light_green".freeze + WHITE_ON_YELLOW = "white_on_yellow".freeze + BLACK_ON_LIGHT_YELLOW = "black_on_light_yellow".freeze + WHITE_ON_GRAY = "white_on_gray".freeze + GREEN_ON_WHITE = "green_on_white".freeze + YELLOW_ON_WHITE = "yellow_on_white".freeze + RED_ON_WHITE = "red_on_white".freeze + GRAY_ON_WHITE = "gray_on_white".freeze + RED = "red".freeze + GREEN = "green".freeze + ORANGE = "orange".freeze + GRAY = "gray".freeze + CUSTOM_BG = "custom_bg".freeze + CUSTOM_TEXT = "custom_text".freeze + CUSTOM_IMAGE = "custom_image".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_trend_column_format.rb b/lib/datadog_api_client/v1/models/guided_table_trend_column_format.rb new file mode 100644 index 000000000000..2724f279085f --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_trend_column_format.rb @@ -0,0 +1,164 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # Formats a guided table column as a trend sparkline. + class GuidedTableTrendColumnFormat + include BaseGenericModel + + # Conditional formatting rules for a guided table column. Either an array of threshold-based rules or a single range-based rule. + attr_accessor :conditional_formats + + # + attr_reader :mode + + # Number display format for a guided table column value. + attr_accessor :number_format + + # Cell display mode options for the widget formula. (only if `cell_display_mode` is set to `trend`). + attr_reader :trend_options + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'conditional_formats' => :'conditional_formats', + :'mode' => :'mode', + :'number_format' => :'number_format', + :'trend_options' => :'trend_options' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'conditional_formats' => :'GuidedTableConditionalFormats', + :'mode' => :'GuidedTableTrendColumnFormatMode', + :'number_format' => :'GuidedTableNumberFormat', + :'trend_options' => :'WidgetFormulaCellDisplayModeOptions' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::GuidedTableTrendColumnFormat` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'conditional_formats') + self.conditional_formats = attributes[:'conditional_formats'] + end + + if attributes.key?(:'mode') + self.mode = attributes[:'mode'] + end + + if attributes.key?(:'number_format') + self.number_format = attributes[:'number_format'] + end + + if attributes.key?(:'trend_options') + self.trend_options = attributes[:'trend_options'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @mode.nil? + return false if @trend_options.nil? + true + end + + # Custom attribute writer method with validation + # @param mode [Object] Object to be assigned + # @!visibility private + def mode=(mode) + if mode.nil? + fail ArgumentError, 'invalid value for "mode", mode cannot be nil.' + end + @mode = mode + end + + # Custom attribute writer method with validation + # @param trend_options [Object] Object to be assigned + # @!visibility private + def trend_options=(trend_options) + if trend_options.nil? + fail ArgumentError, 'invalid value for "trend_options", trend_options cannot be nil.' + end + @trend_options = trend_options + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + conditional_formats == o.conditional_formats && + mode == o.mode && + number_format == o.number_format && + trend_options == o.trend_options && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [conditional_formats, mode, number_format, trend_options, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/guided_table_trend_column_format_mode.rb b/lib/datadog_api_client/v1/models/guided_table_trend_column_format_mode.rb new file mode 100644 index 000000000000..a30c8288e4f6 --- /dev/null +++ b/lib/datadog_api_client/v1/models/guided_table_trend_column_format_mode.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # + class GuidedTableTrendColumnFormatMode + include BaseEnumModel + + TREND = "trend".freeze + end +end diff --git a/lib/datadog_api_client/v1/models/table_widget_definition.rb b/lib/datadog_api_client/v1/models/table_widget_definition.rb index e2bdfd2590b8..3886a699b9db 100644 --- a/lib/datadog_api_client/v1/models/table_widget_definition.rb +++ b/lib/datadog_api_client/v1/models/table_widget_definition.rb @@ -27,7 +27,7 @@ class TableWidgetDefinition # Controls the display of the search bar. attr_accessor :has_search_bar - # Widget definition. + # Widget definition. Each item is either a classic `TableWidgetRequest` or an experimental `GuidedTableRequest` (used when the `graphing_new_table_widget_editor` feature flag is enabled). attr_reader :requests # Time setting for the widget. @@ -68,7 +68,7 @@ def self.openapi_types { :'custom_links' => :'Array', :'has_search_bar' => :'TableWidgetHasSearchBar', - :'requests' => :'Array', + :'requests' => :'Array', :'time' => :'WidgetTime', :'title' => :'String', :'title_align' => :'WidgetTextAlign', diff --git a/lib/datadog_api_client/v1/models/table_widget_definition_requests_item.rb b/lib/datadog_api_client/v1/models/table_widget_definition_requests_item.rb new file mode 100644 index 000000000000..266ce3f1beaa --- /dev/null +++ b/lib/datadog_api_client/v1/models/table_widget_definition_requests_item.rb @@ -0,0 +1,63 @@ +=begin +#Datadog API V1 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V1 + # + module TableWidgetDefinitionRequestsItem + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'TableWidgetRequest', + :'GuidedTableRequest' + ] + end + # Builds the object + # @param data [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 de facto 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) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end