// Copyright 2023 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.maps.mapsplatformdatasets.v1;

import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/maps/mapsplatformdatasets/v1/data_source.proto";
import "google/maps/mapsplatformdatasets/v1/dataset.proto";
import "google/protobuf/field_mask.proto";

option csharp_namespace = "Google.Maps.MapsPlatformDatasets.V1";
option go_package = "cloud.google.com/go/maps/mapsplatformdatasets/apiv1/mapsplatformdatasetspb;mapsplatformdatasetspb";
option java_multiple_files = true;
option java_outer_classname = "MapsPlatformDatasetsProto";
option java_package = "com.google.maps.mapsplatformdatasets.v1";
option objc_class_prefix = "MDV1";
option php_namespace = "Google\\Maps\\MapsPlatformDatasets\\V1";

// Request to create a maps dataset.
message CreateDatasetRequest {
  // Required. Parent project that will own the dataset.
  // Format: projects/{$project}
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "cloudresourcemanager.googleapis.com/Project"
    }
  ];

  // Required. The dataset version to create.
  Dataset dataset = 2 [(google.api.field_behavior) = REQUIRED];
}

// Request to update the metadata fields of the dataset.
message UpdateDatasetMetadataRequest {
  // Required. The dataset to update. The dataset's name is used to identify the
  // dataset to be updated. The name has the format:
  // projects/{project}/datasets/{dataset_id}
  Dataset dataset = 1 [(google.api.field_behavior) = REQUIRED];

  // The list of fields to be updated. Support the value "*" for full
  // replacement.
  google.protobuf.FieldMask update_mask = 2;
}

// Request to get the specified dataset.
message GetDatasetRequest {
  // Required. Resource name. projects/{project}/datasets/{dataset_id}
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "mapsplatformdatasets.googleapis.com/Dataset"
    }
  ];
}

// Request to list datasets for the project.
message ListDatasetsRequest {
  // Required. The name of the project to list all the datasets for.
  string parent = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "cloudresourcemanager.googleapis.com/Project"
    }
  ];

  // The maximum number of versions to return per page.
  // If unspecified (or zero), all datasets will be returned.
  int32 page_size = 2;

  // The page token, received from a previous ListDatasets call.
  // Provide this to retrieve the subsequent page.
  string page_token = 3;
}

// Response to list datasets for the project.
message ListDatasetsResponse {
  // All the datasets for the project.
  repeated Dataset datasets = 1;

  // A token that 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 to delete a dataset.
//
// The dataset to be deleted.
message DeleteDatasetRequest {
  // Required. Format: projects/${project}/datasets/{dataset_id}
  string name = 1 [
    (google.api.field_behavior) = REQUIRED,
    (google.api.resource_reference) = {
      type: "mapsplatformdatasets.googleapis.com/Dataset"
    }
  ];
}
