// 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/featured_content_metadata.proto";
import "google/cloud/chronicle/v1/native_dashboard.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 = "FeaturedContentNativeDashboardProto";
option java_package = "com.google.cloud.chronicle.v1";
option php_namespace = "Google\\Cloud\\Chronicle\\V1";
option ruby_package = "Google::Cloud::Chronicle::V1";
option (google.api.resource_definition) = {
  type: "chronicle.googleapis.com/ContentHub"
  pattern: "projects/{project}/locations/{location}/instances/{instance}/contentHub"
  plural: "contentHub"
  singular: "contentHub"
};

// This service provides functionality for managing
// FeaturedContentNativeDashboard.
service FeaturedContentNativeDashboardService {
  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 native dashboard featured content.
  rpc GetFeaturedContentNativeDashboard(
      GetFeaturedContentNativeDashboardRequest)
      returns (FeaturedContentNativeDashboard) {
    option (google.api.http) = {
      get: "/v1/{name=projects/*/locations/*/instances/*/contentHub/featuredContentNativeDashboards/*}"
    };
    option (google.api.method_signature) = "name";
  }

  // List all native dashboards featured content.
  rpc ListFeaturedContentNativeDashboards(
      ListFeaturedContentNativeDashboardsRequest)
      returns (ListFeaturedContentNativeDashboardsResponse) {
    option (google.api.http) = {
      get: "/v1/{parent=projects/*/locations/*/instances/*/contentHub}/featuredContentNativeDashboards"
    };
    option (google.api.method_signature) = "parent";
  }

  // Install a native dashboard featured content.
  rpc InstallFeaturedContentNativeDashboard(
      InstallFeaturedContentNativeDashboardRequest)
      returns (InstallFeaturedContentNativeDashboardResponse) {
    option (google.api.http) = {
      post: "/v1/{name=projects/*/locations/*/instances/*/contentHub/featuredContentNativeDashboards/*}:install"
      body: "*"
    };
    option (google.api.method_signature) = "name";
  }
}

// FeaturedContentNativeDashboard resource.
message FeaturedContentNativeDashboard {
  option (google.api.resource) = {
    type: "chronicle.googleapis.com/FeaturedContentNativeDashboard"
    pattern: "projects/{project}/locations/{location}/instances/{instance}/contentHub/featuredContentNativeDashboards/{featured_content_native_dashboard}"
    plural: "featuredContentNativeDashboards"
    singular: "featuredContentNativeDashboard"
  };

  // Identifier. The resource name of the FeaturedContentNativeDashboard.
  // Format:
  // projects/{project}/locations/{location}/instances/{instance}/contentHub/featuredContentNativeDashboards/{featured_content_native_dashboard}
  string name = 1 [(google.api.field_behavior) = IDENTIFIER];

  // Output only. Metadata about the FeaturedContentNativeDashboard.
  FeaturedContentMetadata content_metadata = 2
      [(google.api.field_behavior) = OUTPUT_ONLY];

  // Optional. The dashboard content.
  NativeDashboardWithChartsAndQueries dashboard_content = 3
      [(google.api.field_behavior) = OPTIONAL];
}

// Request message to get a FeaturedContentNativeDashboard.
message GetFeaturedContentNativeDashboardRequest {
  // Required. The resource name of the FeaturedContentNativeDashboard to
  // retrieve. Format:
  // projects/{project}/locations/{location}/instances/{instance}/contentHub/featuredContentNativeDashboards/{featured_content_native_dashboard}
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "chronicle.googleapis.com/FeaturedContentNativeDashboard"
    }
  ];
}

// Request message to list FeaturedContentNativeDashboards.
message ListFeaturedContentNativeDashboardsRequest {
  // Required. The parent, which owns this collection of
  // FeaturedContentNativeDashboards. Format:
  // projects/{project}/locations/{location}/instances/{instance}/contentHub
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      child_type: "chronicle.googleapis.com/FeaturedContentNativeDashboard"
    }
  ];

  // Optional. The maximum number of FeaturedContentNativeDashboards to return.
  // The service may return fewer than this value. If unspecified, at most 100
  // FeaturedContentNativeDashboards will be returned. The maximum value is 100;
  // values above 100 will be coerced to 100.
  int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];

  // Optional. A page token, received from a previous
  // `ListFeaturedContentNativeDashboards` call. Provide this to retrieve the
  // subsequent page.
  //
  // When paginating, all other parameters provided to
  // `ListFeaturedContentNativeDashboards` must match the call that provided the
  // page token.
  string page_token = 3 [(google.api.field_behavior) = OPTIONAL];

  // Optional. The filter to apply to list the FeaturedContentNativeDashboards.
  //
  // The filter syntax follows Google Cloud syntax: https://google.aip.dev/160.
  //
  // Supported fields for filtering:
  //
  // *   `name`: The resource name of the featured content.
  // *   `content_metadata.description`: The description of the featured
  // content.
  //
  // When a literal value is provided without a field, it will perform a
  // substring search across both `name` and `content_metadata.description`.
  //
  // Examples:
  //
  // *   `"test"`: Matches featured content where either the name or description
  //     contains "test" as a substring.
  // *   `name="test"`: Matches featured content where the name contains "test".
  // *   `content_metadata.description="test"`: Matches featured content where
  //     the description contains "test".
  string filter = 4 [(google.api.field_behavior) = OPTIONAL];
}

// Response message for listing FeaturedContentNativeDashboards.
message ListFeaturedContentNativeDashboardsResponse {
  // The list of FeaturedContentNativeDashboards.
  // Ordered by name by default.
  repeated FeaturedContentNativeDashboard featured_content_native_dashboards =
      1;

  // A token, which can be sent as `page_token` to retrieve the next page.
  // If this field is omitted, there are no subsequent pages.
  string next_page_token = 2;
}

// Request message to install a FeaturedContentNativeDashboard.
message InstallFeaturedContentNativeDashboardRequest {
  // Required. The resource name of the FeaturedContentNativeDashboard to
  // install. Format:
  // projects/{project}/locations/{location}/instances/{instance}/contentHub/featuredContentNativeDashboards/{featured_content_native_dashboard}
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "chronicle.googleapis.com/FeaturedContentNativeDashboard"
    }
  ];

  // Optional. The FeaturedContentNativeDashboard to install.
  FeaturedContentNativeDashboard featured_content_native_dashboard = 2
      [(google.api.field_behavior) = OPTIONAL];
}

// Response message for installing a FeaturedContentNativeDashboard.
message InstallFeaturedContentNativeDashboardResponse {
  // Optional. The resource name of the NativeDashboard created.
  // Format:
  // projects/{project}/locations/{location}/instances/{instance}/nativeDashboards/{native_dashboard_id}
  string native_dashboard = 1 [
    (google.api.field_behavior) = OPTIONAL,
    (google.api.resource_reference) = {
      type: "chronicle.googleapis.com/NativeDashboard"
    }
  ];
}
