diff --git a/apis/datasets/v1/collections.proto b/apis/datasets/v1/collections.proto index 6ae771f..7a8cc07 100644 --- a/apis/datasets/v1/collections.proto +++ b/apis/datasets/v1/collections.proto @@ -1,10 +1,14 @@ // Proto messages and service definition for the APIs related to creating and managing collections. -syntax = "proto3"; +edition = "2023"; package datasets.v1; import "datasets/v1/core.proto"; +import "google/protobuf/go_features.proto"; + +option features.(pb.go).api_level = API_OPAQUE; +option features.field_presence = IMPLICIT; // CreateCollectionRequest is used to create a new collection. message CreateCollectionRequest { diff --git a/apis/datasets/v1/core.proto b/apis/datasets/v1/core.proto index f23b617..2297063 100644 --- a/apis/datasets/v1/core.proto +++ b/apis/datasets/v1/core.proto @@ -12,14 +12,18 @@ - e.g. message Collections contains a list of Collection messages. */ -syntax = "proto3"; +edition = "2023"; package datasets.v1; import "datasets/v1/dataset_type.proto"; +import "google/protobuf/go_features.proto"; // https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp import "google/protobuf/timestamp.proto"; +option features.(pb.go).api_level = API_OPAQUE; +option features.field_presence = IMPLICIT; + /* * General, multi purpose messages */ @@ -58,19 +62,19 @@ message DatapointInterval { // LegacyPagination - used for backwards compatibility, will be removed as soon as all datasets are migrated message LegacyPagination { // The maximum number of entries to return. - optional int64 limit = 1; + int64 limit = 1 [features.field_presence = EXPLICIT]; // Return entries starting after this entry. // This is the id of the last entry returned in the previous page as the next parameter in each paginated query. - optional string starting_after = 2; + string starting_after = 2 [features.field_presence = EXPLICIT]; } // Pagination information for paginated queries message Pagination { // The maximum number of entries to return. - optional int64 limit = 1; + int64 limit = 1 [features.field_presence = EXPLICIT]; // Return entries starting after this entry. // This is the id of the last entry returned in the previous page as the next parameter in each paginated query. - optional ID starting_after = 2; + ID starting_after = 2 [features.field_presence = EXPLICIT]; } // Any is a message that can hold any other message as bytes. @@ -98,7 +102,7 @@ message RepeatedAny { message DatapointMetadata { google.protobuf.Timestamp event_time = 1; // The time the message was received by the on-board computer. google.protobuf.Timestamp ingestion_time = 2; // The time the message was ingested by Tilebox. - optional string id = 3; // The external id of the datapoint. + string id = 3 [features.field_presence = EXPLICIT]; // The external id of the datapoint. } // Datapoints is a list of datapoints in a Tilebox dataset, with all data points sharing the same type. @@ -111,7 +115,7 @@ message Datapoints { message DatapointPage { repeated DatapointMetadata meta = 1; // A metadata for a datapoint. RepeatedAny data = 2; // The datapoints. - optional LegacyPagination next_page = 3; // The pagination parameters for the next page. + LegacyPagination next_page = 3 [features.field_presence = EXPLICIT]; // The pagination parameters for the next page. } // Datapoint is a single datapoint in a Tilebox Dataset @@ -130,8 +134,8 @@ message Collection { // CollectionInfo contains information about the data available in a dataset collection message CollectionInfo { Collection collection = 1; - optional TimeInterval availability = 2; // The time interval for which data is available. - optional uint64 count = 3; // Number of entries in the dataset. + TimeInterval availability = 2 [features.field_presence = EXPLICIT]; // The time interval for which data is available. + uint64 count = 3 [features.field_presence = EXPLICIT]; // Number of entries in the dataset. } // CollectionInfos contains a list of CollectionInfo messages. diff --git a/apis/datasets/v1/data_access.proto b/apis/datasets/v1/data_access.proto index 7a59b08..470f792 100644 --- a/apis/datasets/v1/data_access.proto +++ b/apis/datasets/v1/data_access.proto @@ -1,11 +1,15 @@ // Proto messages and service definition for the APIs related to querying data. -syntax = "proto3"; +edition = "2023"; package datasets.v1; import "datasets/v1/core.proto"; import "datasets/v1/well_known_types.proto"; +import "google/protobuf/go_features.proto"; + +option features.(pb.go).api_level = API_OPAQUE; +option features.field_presence = IMPLICIT; // Legacy message, to be removed in the future. // GetDatasetForIntervalRequest contains the request parameters for retrieving data for a time interval. @@ -16,7 +20,7 @@ message GetDatasetForIntervalRequest { TimeInterval time_interval = 2; // The time interval for which data is requested. DatapointInterval datapoint_interval = 6; // The datapoint interval for which data is requested. - optional LegacyPagination page = 3; // The pagination parameters for this request. + LegacyPagination page = 3 [features.field_presence = EXPLICIT]; // The pagination parameters for this request. bool skip_data = 4; // If true, the datapoint data is not returned. // If true, the datapoint metadata is not returned. // If both skip_data and skip_meta are true, @@ -77,14 +81,14 @@ message QueryRequest { repeated ID collection_ids = 1; // collection ids to query. QueryFilters filters = 2; // Filters to apply to the query. - optional Pagination page = 3; // The pagination parameters for this request. + Pagination page = 3 [features.field_presence = EXPLICIT]; // The pagination parameters for this request. bool skip_data = 4; // If true, only datapoint metadata, such as id, time and ingestion_time are returned. } // QueryResultPage is a single page of data points of a Tilebox dataset message QueryResultPage { RepeatedAny data = 1; // The datapoints. - optional Pagination next_page = 2; // The pagination parameters for the next page. + Pagination next_page = 2 [features.field_presence = EXPLICIT]; // The pagination parameters for the next page. } // DataAccessService provides data access and querying capabilities for Tilebox datasets. diff --git a/apis/datasets/v1/data_ingestion.proto b/apis/datasets/v1/data_ingestion.proto index 9af1552..002eb2d 100644 --- a/apis/datasets/v1/data_ingestion.proto +++ b/apis/datasets/v1/data_ingestion.proto @@ -1,10 +1,14 @@ // Proto messages and service definition for the APIs related to ingesting and deleting datapoints. -syntax = "proto3"; +edition = "2023"; package datasets.v1; import "datasets/v1/core.proto"; +import "google/protobuf/go_features.proto"; + +option features.(pb.go).api_level = API_OPAQUE; +option features.field_presence = IMPLICIT; // Legacy ingest request // IngestDatapointsRequest is used to ingest one or multiple datapoints into a collection. diff --git a/apis/datasets/v1/dataset_type.proto b/apis/datasets/v1/dataset_type.proto index 93b284e..7988a9f 100644 --- a/apis/datasets/v1/dataset_type.proto +++ b/apis/datasets/v1/dataset_type.proto @@ -1,13 +1,17 @@ // This file contains the proto messages describing a dataset type. A dataset type is akin to a protobuf message type, // and can be converted to it. -syntax = "proto3"; +edition = "2023"; package datasets.v1; import "datasets/v1/well_known_types.proto"; import "google/protobuf/descriptor.proto"; +import "google/protobuf/go_features.proto"; import "google/protobuf/timestamp.proto"; +option features.(pb.go).api_level = API_OPAQUE; +option features.field_presence = IMPLICIT; + // Field describes a field of a dataset. message Field { // The descriptor contains the name of the field, the type, optional labels (e.g. repeated) and other information. diff --git a/apis/datasets/v1/datasets.proto b/apis/datasets/v1/datasets.proto index f79153d..45caba2 100644 --- a/apis/datasets/v1/datasets.proto +++ b/apis/datasets/v1/datasets.proto @@ -1,11 +1,15 @@ // Proto messages and service definition for the APIs related to creating and managing datasets. -syntax = "proto3"; +edition = "2023"; package datasets.v1; import "datasets/v1/core.proto"; import "datasets/v1/dataset_type.proto"; +import "google/protobuf/go_features.proto"; + +option features.(pb.go).api_level = API_OPAQUE; +option features.field_presence = IMPLICIT; // CreateDatasetRequest is used to create a new dataset. message CreateDatasetRequest { @@ -95,7 +99,7 @@ message ListDatasetsResponse { // Number of datasets that the users organization is the owner of int64 owned_datasets = 4; // Maximum number of datasets that can be created and therefore owned by the organization. Nil means unlimited. - optional int64 maximum_owned_datasets = 5; + int64 maximum_owned_datasets = 5 [features.field_presence = EXPLICIT]; } // DatasetsService is the CRUD service for Tilebox datasets. diff --git a/apis/datasets/v1/timeseries.proto b/apis/datasets/v1/timeseries.proto index 2a16429..607ec7f 100644 --- a/apis/datasets/v1/timeseries.proto +++ b/apis/datasets/v1/timeseries.proto @@ -1,11 +1,15 @@ // Timeseries types for workflows -syntax = "proto3"; +edition = "2023"; package datasets.v1; import "datasets/v1/core.proto"; import "google/protobuf/duration.proto"; +import "google/protobuf/go_features.proto"; + +option features.(pb.go).api_level = API_OPAQUE; +option features.field_presence = IMPLICIT; // TimeseriesDatasetChunk is a message that represents a chunk of a timeseries dataset. // used by workflow tasks that are executed once for each datapoint in a timeseries dataset diff --git a/apis/datasets/v1/well_known_types.proto b/apis/datasets/v1/well_known_types.proto index b22f5a5..da20330 100644 --- a/apis/datasets/v1/well_known_types.proto +++ b/apis/datasets/v1/well_known_types.proto @@ -1,15 +1,19 @@ // This file contains some well-known types that are available to use for all dataset protobuf messages. // They are specially handled in our client libraries and converted to the corresponding representations. -syntax = "proto3"; +edition = "2023"; package datasets.v1; // in addition to the well-known types defined here, we also include Timestamp and Duration // buf:lint:ignore IMPORT_USED import "google/protobuf/duration.proto"; +import "google/protobuf/go_features.proto"; // buf:lint:ignore IMPORT_USED import "google/protobuf/timestamp.proto"; +option features.(pb.go).api_level = API_OPAQUE; +option features.field_presence = IMPLICIT; + // Bytes field (in message) message UUID { bytes uuid = 1; diff --git a/apis/examples/v1/workflow.proto b/apis/examples/v1/workflow.proto index 43e3235..575253c 100644 --- a/apis/examples/v1/workflow.proto +++ b/apis/examples/v1/workflow.proto @@ -1,9 +1,14 @@ // A sample tree workflow. -syntax = "proto3"; +edition = "2023"; package examples.v1; +import "google/protobuf/go_features.proto"; + +option features.(pb.go).api_level = API_OPAQUE; +option features.field_presence = IMPLICIT; + // SpawnWorkflowTreeTask is a task that spawns a tree of tasks. message SpawnWorkflowTreeTask { int64 current_level = 1; diff --git a/apis/workflows/v1/automation.proto b/apis/workflows/v1/automation.proto index f783e08..8e34ff8 100644 --- a/apis/workflows/v1/automation.proto +++ b/apis/workflows/v1/automation.proto @@ -1,13 +1,17 @@ // The external API for managing automations in the Workflows service. -syntax = "proto3"; +edition = "2023"; package workflows.v1; import "google/protobuf/empty.proto"; +import "google/protobuf/go_features.proto"; import "google/protobuf/timestamp.proto"; import "workflows/v1/core.proto"; +option features.(pb.go).api_level = API_OPAQUE; +option features.field_presence = IMPLICIT; + // StorageType specifies a kind of storage bucket that we support. enum StorageType { STORAGE_TYPE_UNSPECIFIED = 0; diff --git a/apis/workflows/v1/core.proto b/apis/workflows/v1/core.proto index 3a8d2ce..89ceb95 100644 --- a/apis/workflows/v1/core.proto +++ b/apis/workflows/v1/core.proto @@ -1,12 +1,16 @@ // Core types for workflows. -syntax = "proto3"; +edition = "2023"; package workflows.v1; import "google/protobuf/duration.proto"; +import "google/protobuf/go_features.proto"; import "google/protobuf/timestamp.proto"; +option features.(pb.go).api_level = API_OPAQUE; +option features.field_presence = IMPLICIT; + // A cluster is a grouping of tasks that are related. message Cluster { // 1 is reserved for a potential id field in the future. @@ -57,9 +61,9 @@ message Task { // Unique identifier for the task. Used by runners to match tasks to specific functions. TaskIdentifier identifier = 2; TaskState state = 3; // The current state of the task. - optional bytes input = 4; // The serialized input parameters for the task in the format that this task expects. + bytes input = 4 [features.field_presence = EXPLICIT]; // The serialized input parameters for the task in the format that this task expects. // Display is a human readable representation of the Task used for printing or visualizations - optional string display = 5; + string display = 5 [features.field_presence = EXPLICIT]; Job job = 6; // The job that this task belongs to. UUID parent_id = 7; // The id of the parent task. repeated UUID depends_on = 8; // The ids of the tasks that this task depends on. @@ -147,8 +151,8 @@ message IDInterval { // Pagination information for paginated queries message Pagination { // The maximum number of entries to return. - optional int64 limit = 1; + int64 limit = 1 [features.field_presence = EXPLICIT]; // Return entries starting after this entry. // This is the id of the last entry returned in the previous page as the next parameter in each paginated query. - optional UUID starting_after = 2; + UUID starting_after = 2 [features.field_presence = EXPLICIT]; } diff --git a/apis/workflows/v1/diagram.proto b/apis/workflows/v1/diagram.proto index f1f054a..5eda97c 100644 --- a/apis/workflows/v1/diagram.proto +++ b/apis/workflows/v1/diagram.proto @@ -1,9 +1,14 @@ // Diagram service for rendering diagrams -syntax = "proto3"; +edition = "2023"; package workflows.v1; +import "google/protobuf/go_features.proto"; + +option features.(pb.go).api_level = API_OPAQUE; +option features.field_presence = IMPLICIT; + // Request to render a diagram message RenderDiagramRequest { string diagram = 1; // The diagram graph in the D2 syntax @@ -17,7 +22,7 @@ message RenderOptions { string layout = 1; // The D2 theme to use when rendering the diagram: https://d2lang.com/tour/themes/ - optional int64 theme_id = 2; + int64 theme_id = 2 [features.field_presence = EXPLICIT]; // Whether to render the diagram in a sketchy (hand-drawn) style bool sketchy = 3; diff --git a/apis/workflows/v1/job.proto b/apis/workflows/v1/job.proto index 2b2f511..638960e 100644 --- a/apis/workflows/v1/job.proto +++ b/apis/workflows/v1/job.proto @@ -1,12 +1,16 @@ // The externally facing API allowing users to interact with jobs. -syntax = "proto3"; +edition = "2023"; package workflows.v1; +import "google/protobuf/go_features.proto"; import "workflows/v1/core.proto"; import "workflows/v1/diagram.proto"; +option features.(pb.go).api_level = API_OPAQUE; +option features.field_presence = IMPLICIT; + // SubmitJobRequest submits and schedules a job for execution. The job can have multiple root tasks. message SubmitJobRequest { // The root tasks for the job. @@ -81,7 +85,7 @@ message QueryFilters { } // Filter jobs by automation id. - optional UUID automation_id = 3; + UUID automation_id = 3 [features.field_presence = EXPLICIT]; } // QueryJobsRequest requests a list of jobs. @@ -89,7 +93,7 @@ message QueryJobsRequest { // Filters to apply to the query. QueryFilters filters = 1; // The pagination parameters for this request. - optional Pagination page = 2; + Pagination page = 2 [features.field_presence = EXPLICIT]; } // A list of jobs. @@ -97,7 +101,7 @@ message QueryJobsResponse { // The jobs. repeated Job jobs = 1; // The pagination parameters for the next page. - optional Pagination next_page = 3; + Pagination next_page = 3 [features.field_presence = EXPLICIT]; } // GetJobPrototypeRequest requests a clone prototype of a job. diff --git a/apis/workflows/v1/task.proto b/apis/workflows/v1/task.proto index 2aa7af5..680453a 100644 --- a/apis/workflows/v1/task.proto +++ b/apis/workflows/v1/task.proto @@ -1,17 +1,22 @@ // The internal API a task runner uses to communicate with a workflows-service. -syntax = "proto3"; +edition = "2023"; package workflows.v1; import "google/protobuf/duration.proto"; +import "google/protobuf/go_features.proto"; import "workflows/v1/core.proto"; +option features.(pb.go).api_level = API_OPAQUE; +option features.field_presence = IMPLICIT; + // NextTaskRequest is the request for requesting the next task to run and marking a task as computed. message NextTaskRequest { - optional ComputedTask computed_task = 1; // The task that has been computed. If not set, the next task will + // The task that has been computed. If not set, the next task will + ComputedTask computed_task = 1 [features.field_presence = EXPLICIT]; // The capabilities of the task runner, and therefore the potential tasks that can be run by that task runner. - optional NextTaskToRun next_task_to_run = 2; + NextTaskToRun next_task_to_run = 2 [features.field_presence = EXPLICIT]; } // NextTaskToRun is a message specifying the capabilities of the task runner, and therefore the potential @@ -52,7 +57,7 @@ message TaskStateResponse { // TaskLease is a message specifying the new lease expiration time of a task. message TaskLeaseRequest { UUID task_id = 1; - optional google.protobuf.Duration requested_lease = 2; + google.protobuf.Duration requested_lease = 2 [features.field_presence = EXPLICIT]; } // A service for task runners to communicate with the workflows service. diff --git a/apis/workflows/v1/workflows.proto b/apis/workflows/v1/workflows.proto index 46f4a1f..24ccb3c 100644 --- a/apis/workflows/v1/workflows.proto +++ b/apis/workflows/v1/workflows.proto @@ -1,11 +1,15 @@ // The externally facing API allowing users to interact with workflows. -syntax = "proto3"; +edition = "2023"; package workflows.v1; +import "google/protobuf/go_features.proto"; import "workflows/v1/core.proto"; +option features.(pb.go).api_level = API_OPAQUE; +option features.field_presence = IMPLICIT; + // CreateClusterRequest creates a new cluster. message CreateClusterRequest { // The name of the cluster.