// Proto messages and service definition for the APIs related to creating and managing collections. edition = "2023"; package datasets.v1; import "buf/validate/validate.proto"; import "datasets/v1/core.proto"; import "tilebox/v1/id.proto"; option features.field_presence = IMPLICIT; // CreateCollectionRequest is used to create a new collection. message CreateCollectionRequest { // The dataset id where the collection should be created. tilebox.v1.ID dataset_id = 1 [(buf.validate.field).required = true]; // The name of the collection to create. string name = 2 [(buf.validate.field).string.pattern = "^[^,]+$"]; } // GetCollectionByNameRequest contains the request parameters for retrieving a single collection by its name. message GetCollectionByNameRequest { // The name of the collection to retrieve. string collection_name = 1 [(buf.validate.field).string.pattern = "^[^,]+$"]; // If true, the response will include the availability interval. bool with_availability = 2; // If true, the response will include the number of entries. bool with_count = 3; // The dataset id. tilebox.v1.ID dataset_id = 4 [(buf.validate.field).required = true]; } // DeleteCollectionRequest contains the request parameters for deleting a single collection. message DeleteCollectionRequest { // The id of the collection to delete. tilebox.v1.ID collection_id = 1 [(buf.validate.field).required = true]; // The dataset id. tilebox.v1.ID dataset_id = 2 [(buf.validate.field).required = true]; } // DeleteCollectionResponse is the response to DeleteCollectionRequest. message DeleteCollectionResponse {} // ListCollectionsRequest contains the request parameters // for retrieving a list of all available collections for a given dataset. message ListCollectionsRequest { // The dataset id. tilebox.v1.ID dataset_id = 1 [(buf.validate.field).required = true]; // If true, the response will include the availability interval. bool with_availability = 2; // If true, the response will include the number of entries. bool with_count = 3; } // ListCollectionsResponse is the response to ListCollectionsRequest. // It contains a list of collections for the requested dataset, as well as // some organization level metadata about the number of collections the organization owns // and the maximum number of collections it can own. message ListCollectionsResponse { // List of collections in the dataset. repeated CollectionInfo data = 1; // Number of collections in all datasets that the users organization is the owner of int64 owned_collections = 2; // Maximum number of collections that can be created and therefore owned by the organization. Nil means unlimited. int64 maximum_owned_collections = 3 [features.field_presence = EXPLICIT]; } // CollectionService is the service definition for the Tilebox datasets service, which provides access to datasets service CollectionService { rpc CreateCollection(CreateCollectionRequest) returns (CollectionInfo) {} rpc GetCollectionByName(GetCollectionByNameRequest) returns (CollectionInfo) {} rpc DeleteCollection(DeleteCollectionRequest) returns (DeleteCollectionResponse) {} rpc ListCollections(ListCollectionsRequest) returns (ListCollectionsResponse) {} }