// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.cloud.chronicle.v1;

import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/chronicle/v1/dashboard_query.proto";

option csharp_namespace = "Google.Cloud.Chronicle.V1";
option go_package = "cloud.google.com/go/chronicle/apiv1/chroniclepb;chroniclepb";
option java_multiple_files = true;
option java_outer_classname = "DashboardChartProto";
option java_package = "com.google.cloud.chronicle.v1";
option php_namespace = "Google\\Cloud\\Chronicle\\V1";
option ruby_package = "Google::Cloud::Chronicle::V1";

// A service providing functionality for managing dashboards' charts.
service DashboardChartService {
  option (google.api.default_host) = "chronicle.googleapis.com";
  option (google.api.oauth_scopes) =
      "https://www.googleapis.com/auth/chronicle,"
      "https://www.googleapis.com/auth/chronicle.readonly,"
      "https://www.googleapis.com/auth/cloud-platform";

  // Get a dashboard chart.
  rpc GetDashboardChart(GetDashboardChartRequest) returns (DashboardChart) {
    option (google.api.http) = {
      get: "/v1/{name=projects/*/locations/*/instances/*/dashboardCharts/*}"
    };
    option (google.api.method_signature) = "name";
  }

  // Get dashboard charts in batches.
  rpc BatchGetDashboardCharts(BatchGetDashboardChartsRequest)
      returns (BatchGetDashboardChartsResponse) {
    option (google.api.http) = {
      get: "/v1/{parent=projects/*/locations/*/instances/*}/dashboardCharts:batchGet"
    };
    option (google.api.method_signature) = "parent,names";
  }
}

// TileType indicates what type of chart tile it is i.e., visualization chart,
// button or text.
enum TileType {
  // Defaults to VISUALIZATION.
  TILE_TYPE_UNSPECIFIED = 0;

  // Visualization i.e., bar charts, pie charts etc.
  TILE_TYPE_VISUALIZATION = 1;

  // Button with hyperlink.
  TILE_TYPE_BUTTON = 2;

  // Markdown tile.
  TILE_TYPE_MARKDOWN = 3;
}

// Render type of the data in the chart.
enum RenderType {
  // Defaults to Unspecified.
  RENDER_TYPE_UNSPECIFIED = 0;

  // Text render type.
  RENDER_TYPE_TEXT = 1;

  // Icon render type.
  RENDER_TYPE_ICON = 2;

  // Icon and text render type.
  RENDER_TYPE_ICON_AND_TEXT = 3;
}

enum AxisType {
  AXIS_TYPE_UNSPECIFIED = 0;

  VALUE = 1;

  CATEGORY = 2;

  TIME = 3;

  LOG = 4;
}

enum SeriesType {
  SERIES_TYPE_UNSPECIFIED = 0;

  LINE = 1;

  BAR = 2;

  PIE = 3;

  TEXT = 4;

  // Represents map chart type.
  MAP = 5;

  // Represents gauge chart type.
  GAUGE = 6;

  // Represents scatterplot chart type.
  SCATTERPLOT = 7;
}

enum SeriesStackStrategy {
  SERIES_STACK_STRATEGY_UNSPECIFIED = 0;

  SAMESIGN = 1;

  ALL = 2;

  POSITIVE = 3;

  NEGATIVE = 4;
}

enum ToolTipTrigger {
  TOOLTIP_TRIGGER_UNSPECIFIED = 0;

  TOOLTIP_TRIGGER_NONE = 1;

  TOOLTIP_TRIGGER_ITEM = 2;

  TOOLTIP_TRIGGER_AXIS = 3;
}

enum LegendOrient {
  LEGEND_ORIENT_UNSPECIFIED = 0;

  VERTICAL = 1;

  HORIZONTAL = 2;
}

enum LegendAlign {
  LEGEND_ALIGN_UNSPECIFIED = 0;

  AUTO = 1;

  LEFT = 2;

  RIGHT = 3;
}

enum ButtonStyle {
  BUTTON_STYLE_UNSPECIFIED = 0;

  BUTTON_STYLE_FILLED = 1;

  BUTTON_STYLE_OUTLINED = 2;

  BUTTON_STYLE_TRANSPARENT = 3;
}

// Plot mode for the map.
enum PlotMode {
  // Plot mode is not specified.
  PLOT_MODE_UNSPECIFIED = 0;

  // Plot mode is points.
  PLOT_MODE_POINTS = 1;

  // Plot mode is heatmap.
  PLOT_MODE_HEATMAP = 2;

  // Plot mode is both points and heatmap.
  PLOT_MODE_BOTH = 3;
}

// Point size type for the map.
enum PointSizeType {
  // Point size is not specified.
  POINT_SIZE_TYPE_UNSPECIFIED = 0;

  // Point size is fixed.
  POINT_SIZE_TYPE_FIXED = 1;

  // Point size is proportional to the size of the data point.
  POINT_SIZE_TYPE_PROPORTIONAL_TO_SIZE = 2;
}

// Metric format to be displayed for the metric charts.
enum MetricFormat {
  // Metric format is not specified.
  METRIC_FORMAT_UNSPECIFIED = 0;

  // Metric format in number
  METRIC_FORMAT_NUMBER = 1;

  // Metric format in plain text
  METRIC_FORMAT_PLAIN_TEXT = 2;
}

// Trend to be displayed for the metric charts as.
enum MetricDisplayTrend {
  // Trend is not specified.
  METRIC_DISPLAY_TREND_UNSPECIFIED = 0;

  // Trend data in absolute value
  METRIC_DISPLAY_TREND_ABSOLUTE_VALUE = 2;

  // Trend data in percentage
  METRIC_DISPLAY_TREND_PERCENTAGE = 3;

  // Trend data in both absolute value and percentage
  METRIC_DISPLAY_TREND_ABSOLUTE_VALUE_AND_PERCENTAGE = 4;
}

// Trend to be displayed for the metric charts as.
enum MetricTrendType {
  // Trend type is not specified.
  METRIC_TREND_TYPE_UNSPECIFIED = 0;

  // The trend type is regular(green for positive delta)
  METRIC_TREND_TYPE_REGULAR = 1;

  // The trend type is inverse(red for positive delta)
  METRIC_TREND_TYPE_INVERSE = 2;
}

// Visual map for various charts. More info:
// https://echarts.apache.org/en/option.html#visualMap
enum VisualMapType {
  // Visual map type is not specified
  VISUAL_MAP_TYPE_UNSPECIFIED = 0;

  // Continuous visual map
  CONTINUOUS = 1;

  // Piecewise visual map
  PIECEWISE = 2;
}

// DashboardChart resource.
message DashboardChart {
  option (google.api.resource) = {
    type: "chronicle.googleapis.com/DashboardChart"
    pattern: "projects/{project}/locations/{location}/instances/{instance}/dashboardCharts/{chart}"
    plural: "dashboardCharts"
    singular: "dashboardChart"
  };

  // Datasource of the chart including the query reference and source name.
  message ChartDatasource {
    // Reference to dashboard query resource used in the chart.
    string dashboard_query = 1 [(google.api.resource_reference) = {
      type: "chronicle.googleapis.com/DashboardQuery"
    }];

    // Name of the datasource used in the chart.
    repeated DataSource data_sources = 3;
  }

  // Visualization config for a chart.
  // https://echarts.apache.org/en/option.html#series
  message Visualization {
    message Axis {
      AxisType axis_type = 4;

      string display_name = 5;

      // Minimum value to be rendered in ECharts as per
      // https://echarts.apache.org/en/option.html#xAxis.min
      optional int32 min = 6;

      // Maximum value to be rendered in ECharts as per
      // https://echarts.apache.org/en/option.html#xAxis.max
      optional int32 max = 7;
    }

    message Series {
      message Encode {
        string x = 1;

        string y = 2;

        // For some type of series that are not in any coordinate system, like
        // 'pie'
        string value = 3;

        // This is useful in charts like 'pie', where data item name can be
        // displayed in legend.
        string item_name = 4;
      }

      // Data label config for a series.
      message DataLabel {
        // Optional. Whether to show data label.
        bool show = 1 [(google.api.field_behavior) = OPTIONAL];
      }

      // Custom styling for chart
      message ItemStyle {
        // Optional. Used to add border width
        int32 border_width = 1 [(google.api.field_behavior) = OPTIONAL];

        // Optional. Used to add border color
        string border_color = 2 [(google.api.field_behavior) = OPTIONAL];

        // Optional. Used to add color
        string color = 3 [(google.api.field_behavior) = OPTIONAL];
      }

      // Custom styling for area chart
      message AreaStyle {
        // Optional. Used to add color
        string color = 1 [(google.api.field_behavior) = OPTIONAL];

        // Optional. Used to add origin
        string origin = 2 [(google.api.field_behavior) = OPTIONAL];

        // Optional. Used to add shadow blur
        int32 shadow_blur = 3 [(google.api.field_behavior) = OPTIONAL];

        // Optional. Used to add shadow color
        string shadow_color = 4 [(google.api.field_behavior) = OPTIONAL];

        // Optional. Used to add shadow offsetX
        int32 shadow_offset_x = 5 [(google.api.field_behavior) = OPTIONAL];

        // Optional. Used to add shadow offsetY
        int32 shadow_offset_y = 6 [(google.api.field_behavior) = OPTIONAL];

        // Optional. Used to add opacity
        int32 opacity = 7 [(google.api.field_behavior) = OPTIONAL];
      }

      // User selected color and label for the slice of the chart
      message UserSelectedValues {
        // Optional. User specified color of a pie slice
        string color = 1 [(google.api.field_behavior) = OPTIONAL];

        // Optional. User specified label for a pie slice
        string label = 2 [(google.api.field_behavior) = OPTIONAL];
      }

      // Slice containing the key and value for a slice in the chart
      message ChartSliceColor {
        // Optional. Key for the slice
        string key = 1 [(google.api.field_behavior) = OPTIONAL];

        // Optional. Value for the slice
        UserSelectedValues value = 2 [(google.api.field_behavior) = OPTIONAL];
      }

      // Field to be saved for retrieving slice colors for the chart
      message ItemColors {
        // Optional. Slice colors array
        repeated ChartSliceColor colors = 1
            [(google.api.field_behavior) = OPTIONAL];
      }

      // Field to be saved for retrieving value and color for gauge chart
      message GaugeValue {
        // Optional. Value for gauge chart
        int32 value = 1 [(google.api.field_behavior) = OPTIONAL];

        // Optional. Color for gauge chart
        string color = 2 [(google.api.field_behavior) = OPTIONAL];
      }

      // Field to be saved for retrieving value and color for gauge chart
      message GaugeConfig {
        // Optional. Base value for gauge chart
        GaugeValue base_value = 1 [(google.api.field_behavior) = OPTIONAL];

        // Optional. Limit value for gauge chart
        GaugeValue limit_value = 2 [(google.api.field_behavior) = OPTIONAL];

        // Optional. Threshold values for gauge chart
        repeated GaugeValue threshold_values = 3
            [(google.api.field_behavior) = OPTIONAL];
      }

      // Metric trend config for displaying trend value in Metrics chart
      message MetricTrendConfig {
        // Optional. Metric chart configuration to display metric trend
        MetricFormat metric_format = 1 [(google.api.field_behavior) = OPTIONAL];

        // Optional. Metric chart configuration to toggle the trend value
        // display
        bool show_metric_trend = 5 [(google.api.field_behavior) = OPTIONAL];

        // Optional. Metric chart configuration to display the trend value
        MetricDisplayTrend metric_display_trend = 3
            [(google.api.field_behavior) = OPTIONAL];

        // Optional. Metric chart configuration to display trend type whether
        // regular or inverse
        MetricTrendType metric_trend_type = 4
            [(google.api.field_behavior) = OPTIONAL];
      }

      SeriesType series_type = 8;

      // user specified series label
      string series_name = 2;

      bool show_symbol = 4;

      bool show_background = 5;

      string stack = 6;

      SeriesStackStrategy series_stack_strategy = 9;

      Encode encode = 10;

      string label = 11;

      string field = 12;

      // Optional. Data label config for a series.
      // Displays data vaule in the chart
      DataLabel data_label = 13 [(google.api.field_behavior) = OPTIONAL];

      // Optional. Used to make a pie chart into a douhnut chart
      repeated string radius = 14 [(google.api.field_behavior) = OPTIONAL];

      // Optional. Custom styling for chart
      ItemStyle item_style = 15 [(google.api.field_behavior) = OPTIONAL];

      // Optional. Series unique value from the query result
      string series_unique_value = 16 [(google.api.field_behavior) = OPTIONAL];

      // Optional. Custom styling for area chart
      AreaStyle area_style = 17 [(google.api.field_behavior) = OPTIONAL];

      // Optional. Field to be saved for retrieving slice colors for the chart
      ItemColors item_colors = 18 [(google.api.field_behavior) = OPTIONAL];

      // Optional. Field to be saved for retrieving gauge config for gauge chart
      GaugeConfig gauge_config = 19 [(google.api.field_behavior) = OPTIONAL];

      // Optional. Fields to capture trend config for metric charts
      MetricTrendConfig metric_trend_config = 20
          [(google.api.field_behavior) = OPTIONAL];
    }

    message Tooltip {
      bool show = 1;

      ToolTipTrigger tooltip_trigger = 3;
    }

    message Legend {
      string id = 1;

      bool show = 2;

      int32 z_level = 3;

      int32 z = 4;

      int32 left = 5;

      int32 top = 6;

      int32 right = 7;

      int32 bottom = 8;

      LegendOrient legend_orient = 12;

      LegendAlign legend_align = 13;

      repeated int32 padding = 11;
    }

    // Column Definition.
    message ColumnDef {
      // Field key in data.
      string field = 1;

      // Header name for column.
      string header = 2;
    }

    // Column render type settings. This is used to determine the data render
    // type of the column in the table.
    message ColumnRenderTypeSettings {
      // Optional. Field key in data.
      string field = 1 [(google.api.field_behavior) = OPTIONAL];

      // Optional. Column render type.
      RenderType column_render_type = 2
          [(google.api.field_behavior) = OPTIONAL];
    }

    // Settings for tooltip for column header and cell.
    message ColumnTooltipSettings {
      // Required. Field key in data.
      string field = 1 [(google.api.field_behavior) = REQUIRED];

      // Optional. Column header tooltip text.
      string header_tooltip_text = 2 [(google.api.field_behavior) = OPTIONAL];

      // Optional. Column cell tooltip text.
      string cell_tooltip_text = 3 [(google.api.field_behavior) = OPTIONAL];
    }

    // Configuration for table appearance.
    message TableConfig {
      // Optional. Whether to show the table.
      bool enable_text_wrap = 1 [(google.api.field_behavior) = OPTIONAL];

      // Optional. Column render type settings.
      repeated ColumnRenderTypeSettings column_render_type_settings = 2
          [(google.api.field_behavior) = OPTIONAL];

      // Optional. Settings for tooltip for column header and cell.
      repeated ColumnTooltipSettings column_tooltip_settings = 3
          [(google.api.field_behavior) = OPTIONAL];
    }

    // Google Maps config for a chart if chart type is map.
    message GoogleMapsConfig {
      // Data settings for the map.
      message DataSettings {
        // Optional. Latitude column.
        string latitude_column = 1 [(google.api.field_behavior) = OPTIONAL];

        // Optional. Longitude column.
        string longitude_column = 2 [(google.api.field_behavior) = OPTIONAL];

        // Optional. Field to count.
        string count_column = 3 [(google.api.field_behavior) = OPTIONAL];
      }

      // Map position settings for the map.
      message MapPosition {
        // Optional. Whether to fit the map to the data.
        // If true, the map will be resized to fit the data.
        // If false, langitude and longitude will be used to set the map size.
        bool fit_data = 1 [(google.api.field_behavior) = OPTIONAL];

        // Optional. Latitude of the map.
        double latitude_value = 5 [(google.api.field_behavior) = OPTIONAL];

        // Optional. Longitude of the map.
        double longitude_value = 6 [(google.api.field_behavior) = OPTIONAL];

        // Optional. Scale of the map.
        double zoom_scale_value = 7 [(google.api.field_behavior) = OPTIONAL];
      }

      // Point settings for the map.
      message PointSettings {
        // Optional. Point size type for the map. This is used to
        // determine the size of the points on the map.
        PointSizeType point_size_type = 1
            [(google.api.field_behavior) = OPTIONAL];

        // Optional. Color for the point on the map.
        string color = 2 [(google.api.field_behavior) = OPTIONAL];
      }

      // Optional. Data settings for the map.
      DataSettings data_settings = 1 [(google.api.field_behavior) = OPTIONAL];

      // Optional. Plot mode for the map. This is used to determine whether to
      // show points, heatmap or both.
      PlotMode plot_mode = 2 [(google.api.field_behavior) = OPTIONAL];

      // Optional. Map position settings for the map.
      MapPosition map_position = 3 [(google.api.field_behavior) = OPTIONAL];

      // Optional. Point settings for the map.
      PointSettings point_settings = 4 [(google.api.field_behavior) = OPTIONAL];
    }

    // Conveys what range of values should be rendered in what color. This field
    // is used when threshold_coloring_enabled is true.
    message VisualMap {
      // An ECharts visual map of type 'piecewise' contain many pieces. Each
      // piece has a min, max, and color with which it's rendered.
      message VisualMapPiece {
        // Optional. Minimum value for the piece.
        optional int64 min = 1 [(google.api.field_behavior) = OPTIONAL];

        // Optional. Minimum value for the piece.
        optional int64 max = 2 [(google.api.field_behavior) = OPTIONAL];

        // Optional. Color to render the piece in when the value is between min
        // and max.
        string color = 3 [(google.api.field_behavior) = OPTIONAL];

        // Optional. Label used in visual map controller.
        string label = 4 [(google.api.field_behavior) = OPTIONAL];
      }

      // Optional. Contains one of the valid visual map types such as
      // 'continuous' or 'piecewise'.
      VisualMapType visual_map_type = 1
          [(google.api.field_behavior) = OPTIONAL];

      // Optional. Pieces of the visual map.
      repeated VisualMapPiece pieces = 2
          [(google.api.field_behavior) = OPTIONAL];
    }

    repeated Axis x_axes = 7;

    repeated Axis y_axes = 8;

    repeated Series series = 3;

    Tooltip tooltip = 4;

    repeated Legend legends = 9;

    // Column Definition to represent chart as a table.
    repeated ColumnDef column_defs = 10;

    // Optional. Configuration for table appearance.
    TableConfig table_config = 18 [(google.api.field_behavior) = OPTIONAL];

    // Button config for a chart if tileType is TILE_TYPE_BUTTON.
    Button button = 11;

    // Optional. Markdown config for a chart if tileType is TILE_TYPE_MARKDOWN.
    Markdown markdown = 17 [(google.api.field_behavior) = OPTIONAL];

    // Optional. Selected column for series
    repeated string series_column = 12 [(google.api.field_behavior) = OPTIONAL];

    // Optional. Selected grouping type for series
    string grouping_type = 13 [(google.api.field_behavior) = OPTIONAL];

    // Optional. Google Maps config for a chart if type is GOOGLE MAPS.
    GoogleMapsConfig google_maps_config = 14
        [(google.api.field_behavior) = OPTIONAL];

    // Optional. Whether threshold coloring is enabled for the chart. If it's
    // enabled, the chart will be colored based on the values stored in
    // VisualMap below.
    bool threshold_coloring_enabled = 15
        [(google.api.field_behavior) = OPTIONAL];

    // Optional. Visual maps for the chart.
    repeated VisualMap visual_maps = 16
        [(google.api.field_behavior) = OPTIONAL];
  }

  // Drill down configuration.
  message DrillDownConfig {
    // Drill down config.
    message DrillDown {
      // Default drill down settings.
      message DefaultDrillDownSettings {
        // Required. Whether the default drill down is enabled.
        bool enabled = 1 [(google.api.field_behavior) = REQUIRED];
      }

      // Custom drill down settings.
      message CustomDrillDownSettings {
        // Drill down query config.
        message DrillDownQuery {
          // Required. Search query to be executed on drill down.
          string query = 1 [(google.api.field_behavior) = REQUIRED];
        }

        // Drill down filter config.
        message DrillDownFilter {
          // Drill down dashboard filter config.
          message DrillDownDashboardFilter {
            // Required. ID of the dashboard filter.
            string dashboard_filter_id = 1
                [(google.api.field_behavior) = REQUIRED];

            // Required. Filter operator and field values for the dashboard
            // filter.
            repeated FilterOperatorAndValues filter_operator_and_values = 2
                [(google.api.field_behavior) = REQUIRED];
          }

          // Required. Dashboard filters to be applied on drill down.
          repeated DrillDownDashboardFilter dashboard_filters = 1
              [(google.api.field_behavior) = REQUIRED];
        }

        // Drill down external link config.
        message DrillDownExternalLink {
          // Required. External link the drill down action should redirect to.
          string link = 1 [(google.api.field_behavior) = REQUIRED];

          // Optional. Description of the external link.
          string description = 2 [(google.api.field_behavior) = OPTIONAL];
        }

        // Action to be performed on drill down.
        oneof action {
          // Drill down query action config.
          DrillDownQuery query = 3;

          // Drill down filter action config.
          DrillDownFilter filter = 4;

          // Drill down external link action config.
          DrillDownExternalLink external_link = 5;
        }

        // Required. Whether to open the drill down action in a new tab.
        bool new_tab = 1 [(google.api.field_behavior) = REQUIRED];

        // Optional. Table chart column name to associate the custom drill down
        // action on left click.
        string left_click_column = 2 [(google.api.field_behavior) = OPTIONAL];
      }

      // Drill down settings.
      oneof settings {
        // Default drill down settings.
        DefaultDrillDownSettings default_settings = 3;

        // Custom drill down settings.
        CustomDrillDownSettings custom_settings = 4;
      }

      // Required. ID of the drill down.
      string id = 1 [(google.api.field_behavior) = REQUIRED];

      // Required. Display name of the drill down.
      string display_name = 2 [(google.api.field_behavior) = REQUIRED];
    }

    // Required. Left click drill downs.
    repeated DrillDown left_drill_downs = 1
        [(google.api.field_behavior) = REQUIRED];

    // Required. Right click drill downs.
    repeated DrillDown right_drill_downs = 2
        [(google.api.field_behavior) = REQUIRED];
  }

  // Output only. Name of the dashboardChart.
  string name = 1 [
    (google.api.field_behavior) = OUTPUT_ONLY,
    (google.api.resource_reference) = {
      type: "chronicle.googleapis.com/DashboardChart"
    }
  ];

  // Required. Display name/Title of the dashboardChart visible to users.
  string display_name = 2 [(google.api.field_behavior) = REQUIRED];

  // Optional. Description of the dashboardChart.
  string description = 3 [(google.api.field_behavior) = OPTIONAL];

  // Output only. NativeDashboard this chart belongs to.
  string native_dashboard = 4 [
    (google.api.field_behavior) = OUTPUT_ONLY,
    (google.api.resource_reference) = {
      type: "chronicle.googleapis.com/NativeDashboard"
    }
  ];

  // Optional. Type of tile i.e., visualization, button or text.
  TileType tile_type = 7 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Query and datasource used in the chart. Should be empty for
  // Button Tiles.
  ChartDatasource chart_datasource = 5 [(google.api.field_behavior) = OPTIONAL];

  // Required. Depending on tile_type one of below fields will be required.
  Visualization visualization = 6 [(google.api.field_behavior) = REQUIRED];

  // Optional. This checksum is computed by the server based on the value of
  // other fields, and may be sent on update and delete requests to ensure the
  // client has an up-to-date value before proceeding.
  string etag = 8 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Drill down configuration.
  DrillDownConfig drill_down_config = 9
      [(google.api.field_behavior) = OPTIONAL];

  // Optional. List of Advanced Filter tokens used in this chart's query (e.g.,
  // "hostname", "ip"). This allows the UI to identify dependencies without
  // parsing the query text. The tokens are stored without the wrapping '$'
  // characters.
  // The number of tokens are not expected to be more than 10.
  repeated string tokens = 10 [(google.api.field_behavior) = OPTIONAL];
}

// Button config for a chart.
message Button {
  message Properties {
    string color = 1 [(google.api.field_behavior) = OPTIONAL];

    ButtonStyle button_style = 2 [(google.api.field_behavior) = OPTIONAL];
  }

  string label = 1 [(google.api.field_behavior) = REQUIRED];

  string hyperlink = 2 [(google.api.field_behavior) = REQUIRED];

  string description = 3 [(google.api.field_behavior) = OPTIONAL];

  // Optional. Whether to open the link in a new tab.
  bool new_tab = 4 [(google.api.field_behavior) = OPTIONAL];

  Properties properties = 5 [(google.api.field_behavior) = OPTIONAL];
}

// Markdown config for a dashboard tile.
message Markdown {
  // Properties for the markdown.
  message MarkdownProperties {
    // Optional. Background color of the markdown.
    string background_color = 3 [(google.api.field_behavior) = OPTIONAL];
  }

  // Required. Markdown content.
  string content = 1 [(google.api.field_behavior) = REQUIRED];

  // Optional. Properties for the markdown.
  MarkdownProperties properties = 2 [(google.api.field_behavior) = OPTIONAL];
}

// Request message to get a dashboard chart.
message GetDashboardChartRequest {
  // Required. The name of the dashboardChart to retrieve.
  // Format:
  // projects/{project}/locations/{location}/instances/{instance}/dashboardCharts/{chart}
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "chronicle.googleapis.com/DashboardChart"
    }
  ];
}

// Request message to get dashboard charts in batch.
message BatchGetDashboardChartsRequest {
  // Required. The parent resource shared by all dashboard charts being
  // retrieved. Format:
  // projects/{project}/locations/{location}/instances/{instance} If this is
  // set, the parent of all of the dashboard charts specified in `names` must
  // match this field.
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      child_type: "chronicle.googleapis.com/DashboardChart"
    }
  ];

  // Required. The names of the dashboard charts to get.
  repeated string names = 2 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "chronicle.googleapis.com/DashboardChart"
    }
  ];
}

// Response message for getting dashboard charts in batch.
message BatchGetDashboardChartsResponse {
  // The dashboardCharts from the specified chronicle instance.
  repeated DashboardChart dashboard_charts = 1;
}
