Skip to content

Commit

Permalink
feature(protos): new protos and various protos updates
Browse files Browse the repository at this point in the history
  • Loading branch information
solidiquis committed Aug 15, 2024
1 parent cca1321 commit 4fddf51
Show file tree
Hide file tree
Showing 22 changed files with 546 additions and 25 deletions.
2 changes: 1 addition & 1 deletion protos/sift/annotation_logs/v1/annotation_logs.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "google/api/field_behavior.proto";
import "google/protobuf/timestamp.proto";
import "protoc-gen-openapiv2/options/annotations.proto";

option go_package = "azimuth/gen/protos/go/sift/annotation_logs/v1;annotation_logsv1pb";


service AnnotationLogService {
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_tag) = {
Expand Down
7 changes: 5 additions & 2 deletions protos/sift/annotations/v1/annotations.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
import "protoc-gen-openapiv2/options/annotations.proto";

option go_package = "azimuth/gen/protos/go/sift/annotations/v1;annotationsv1pb";

option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {title: "Annotation Service"}
};
Expand Down Expand Up @@ -104,6 +104,7 @@ message Annotation {
repeated string tags = 15 [(google.api.field_behavior) = REQUIRED];
optional string legend_config = 16 [(google.api.field_behavior) = OPTIONAL];
optional string created_by_condition_id = 17 [(google.api.field_behavior) = OPTIONAL];
optional string created_by_rule_condition_version_id = 18 [(google.api.field_behavior) = OPTIONAL];
}

enum AnnotationState {
Expand Down Expand Up @@ -167,6 +168,8 @@ message CreateAnnotationRequest {
optional string created_by_condition_id = 14 [(google.api.field_behavior) = OPTIONAL];
// A JSON string containing the axes configuration of the annotation's linked channels.
optional string legend_config = 13 [(google.api.field_behavior) = OPTIONAL];
// The ID of the rule condition version that created this annotation.
optional string created_by_rule_condition_version_id = 15 [(google.api.field_behavior) = OPTIONAL];
}

// The result of a call to `AnnotationService_CreateAnnotation`.
Expand Down Expand Up @@ -213,7 +216,7 @@ message ListAnnotationsRequest {

// A [Common Expression Language (CEL)](https://github.com/google/cel-spec) filter string.
// Available fields to filter by are `annotation_id`, `start_time`, `end_time`,
// `created_date`, `modified_date`, `run_id`, `name`, `description`, `state`, `created_by_user_id`, `created_by_condition_id`,
// `created_date`, `modified_date`, `run_id`, `name`, `description`, `state`, `created_by_user_id`, `created_by_rule_condition_version_id`,
// and `annotation_type`.
// For further information about how to use CELs, please refer to [this guide](https://github.com/google/cel-spec/blob/master/doc/langdef.md#standard-definitions).
// For more information about the fields used for filtering, please refer to [this definition](/protocol-buffers/documentation#annotation). Optional.
Expand Down
2 changes: 1 addition & 1 deletion protos/sift/assets/v1/assets.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "google/api/field_behavior.proto";
import "google/protobuf/timestamp.proto";
import "protoc-gen-openapiv2/options/annotations.proto";

option go_package = "azimuth/gen/protos/go/sift/assets/v1;assetsv1pb";

option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {title: "Asset Service"}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "google/api/field_behavior.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
import "sift/common/type/v1/channel_data_type.proto";

option go_package = "azimuth/gen/protos/go/sift/calculated_channels/v1;calculatedchannelsv1pb";

option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {title: "Calculated Channels Service"}
};
Expand Down
2 changes: 1 addition & 1 deletion protos/sift/channel_schemas/v1/channel_schemas.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import "sift/common/type/v1/channel_bit_field_element.proto";
import "sift/common/type/v1/channel_data_type.proto";
import "sift/common/type/v1/channel_enum_type.proto";

option go_package = "azimuth/gen/protos/go/sift/channel_schemas/v1;channelschemasv1pb";

option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {title: "Channel Schema Service"}
};
Expand Down
2 changes: 1 addition & 1 deletion protos/sift/channels/v2/channels.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import "sift/common/type/v1/channel_bit_field_element.proto";
import "sift/common/type/v1/channel_data_type.proto";
import "sift/common/type/v1/channel_enum_type.proto";

option go_package = "azimuth/gen/protos/go/sift/channels/v2;channelsv2pb";

option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {title: "Channel service"}
};
Expand Down
2 changes: 1 addition & 1 deletion protos/sift/common/type/v1/channel_bit_field_element.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package sift.common.type.v1;

import "google/api/field_behavior.proto";

option go_package = "azimuth/gen/protos/go/sift/common/type/v1;typev1pb";


message ChannelBitFieldElement {
string name = 1 [(google.api.field_behavior) = REQUIRED];
Expand Down
2 changes: 1 addition & 1 deletion protos/sift/common/type/v1/channel_data_type.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package sift.common.type.v1;

option go_package = "azimuth/gen/protos/go/sift/common/type/v1;typev1pb";


enum ChannelDataType {
CHANNEL_DATA_TYPE_UNSPECIFIED = 0 [deprecated = true];
Expand Down
2 changes: 1 addition & 1 deletion protos/sift/common/type/v1/channel_enum_type.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package sift.common.type.v1;

import "google/api/field_behavior.proto";

option go_package = "azimuth/gen/protos/go/sift/common/type/v1;typev1pb";


message ChannelEnumType {
string name = 1 [(google.api.field_behavior) = REQUIRED];
Expand Down
2 changes: 1 addition & 1 deletion protos/sift/common/type/v1/organization.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ syntax = "proto3";

package sift.common.type.v1;

option go_package = "azimuth/gen/protos/go/sift/common/type/v1;typev1pb";


message Organization {
string organization_id = 1;
Expand Down
2 changes: 1 addition & 1 deletion protos/sift/common/type/v1/user.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package sift.common.type.v1;
import "google/api/field_behavior.proto";
import "sift/common/type/v1/organization.proto";

option go_package = "azimuth/gen/protos/go/sift/common/type/v1;typev1pb";


message User {
string user_id = 1 [(google.api.field_behavior) = REQUIRED];
Expand Down
2 changes: 1 addition & 1 deletion protos/sift/data/v1/data.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import "sift/common/type/v1/channel_bit_field_element.proto";
import "sift/common/type/v1/channel_data_type.proto";
import "sift/common/type/v1/channel_enum_type.proto";

option go_package = "azimuth/gen/protos/go/sift/data/v1;datav1pb";

option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {title: "Data Service"}
};
Expand Down
2 changes: 1 addition & 1 deletion protos/sift/ingest/v1/ingest.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package sift.ingest.v1;
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";

option go_package = "azimuth/gen/protos/go/sift/ingest/v1;ingestv1pb";


service IngestService {
rpc IngestWithConfigDataStream(stream IngestWithConfigDataStreamRequest) returns (IngestWithConfigDataStreamResponse);
Expand Down
2 changes: 1 addition & 1 deletion protos/sift/ingestion_configs/v1/ingestion_configs.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import "sift/common/type/v1/channel_bit_field_element.proto";
import "sift/common/type/v1/channel_data_type.proto";
import "sift/common/type/v1/channel_enum_type.proto";

option go_package = "azimuth/gen/protos/go/sift/ingestion_configs/v1;ingestion_configsv1pb";

option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {title: "Ingestion Config Service"}
};
Expand Down
2 changes: 1 addition & 1 deletion protos/sift/notifications/v1/notifications.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
import "protoc-gen-openapiv2/options/annotations.proto";

option go_package = "azimuth/gen/protos/go/sift/notifications/v1;notificationsv1pb";

option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {title: "Notification Service"}
};
Expand Down
234 changes: 234 additions & 0 deletions protos/sift/remote_files/v1/remote_files.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
syntax = "proto3";

package sift.remote_files.v1;

import "google/api/annotations.proto";
import "google/api/field_behavior.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
import "protoc-gen-openapiv2/options/annotations.proto";


option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {title: "RemoteFile service"}
};

service RemoteFileService {
// Retrieve a remote file.
rpc GetRemoteFile(GetRemoteFileRequest) returns (GetRemoteFileResponse) {
option (google.api.http) = {get: "/api/v1/remote-files/{remote_file_id}"};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "GetRemoteFile",
description: "Retrieve a remote file."
};
}

// Create a remote file.
rpc CreateRemoteFile(CreateRemoteFileRequest) returns (CreateRemoteFileResponse) {
option (google.api.http) = {
post: "/api/v1/remote-files"
body: "*"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "CreateRemoteFile"
description: "Create a remote file."
};
}

// List remote files.
rpc ListRemoteFiles(ListRemoteFilesRequest) returns (ListRemoteFilesResponse) {
option (google.api.http) = {get: "/api/v1/remote-files"};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "ListRemoteFiles"
description: "List remote files."
};
}

// Updates an existing remote file using using the list of fields specified in `update_mask`.
rpc UpdateRemoteFile(UpdateRemoteFileRequest) returns (UpdateRemoteFileResponse) {
option (google.api.http) = {
patch: "/api/v1/remote-files"
body: "*"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "UpdateRemoteFile"
description: "Updates an existing remote file using using the list of fields specified in `update_mask`."
};
}

// Delete a remote file.
rpc DeleteRemoteFile(DeleteRemoteFileRequest) returns (DeleteRemoteFileResponse) {
option (google.api.http) = {delete: "/api/v1/remote-files/{remote_file_id}"};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "DeleteRemoteFile"
description: "Delete a remote file."
};
}

// Batch deletes remote files. Each batch is limited to 1000 records.
rpc BatchDeleteRemoteFiles(BatchDeleteRemoteFilesRequest) returns (BatchDeleteRemoteFilesResponse) {
option (google.api.http) = {
post: "/api/v1/remote-files:batchDelete",
body: "*"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "BatchDeleteRemoteFiles"
description: "Batch delete remote files. Each batch is limited to 1000 records."
};
}

// Gets a download URL for the remote file.
rpc GetRemoteFileDownloadUrl(GetRemoteFileDownloadUrlRequest) returns (GetRemoteFileDownloadUrlResponse) {
option (google.api.http) = {get: "/api/v1/remote-files/{remote_file_id}/download-url"};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "GetRemoteFileUrl",
description: "Gets a download URL for the remote file."
};
}
}

message RemoteFile {
string remote_file_id = 1 [(google.api.field_behavior) = REQUIRED];
string organization_id = 2 [(google.api.field_behavior) = REQUIRED];
string entity_id = 3 [(google.api.field_behavior) = REQUIRED];
EntityType entity_type = 4 [(google.api.field_behavior) = REQUIRED];
string file_name = 5 [(google.api.field_behavior) = REQUIRED];
string file_mime_type = 6 [(google.api.field_behavior) = REQUIRED];
string file_content_encoding = 7 [(google.api.field_behavior) = REQUIRED];
string storage_key = 8 [(google.api.field_behavior) = REQUIRED];
uint64 file_size = 9 [(google.api.field_behavior) = REQUIRED];
optional string description = 10 [(google.api.field_behavior) = OPTIONAL];
oneof metadata {
VideoMetadata video_metadata = 11 [(google.api.field_behavior) = OPTIONAL];
ImageMetadata image_metadata = 12 [(google.api.field_behavior) = OPTIONAL];
}
string created_by_user_id = 13 [(google.api.field_behavior) = REQUIRED];
string modified_by_user_id = 14 [(google.api.field_behavior) = REQUIRED];
google.protobuf.Timestamp created_date = 15 [(google.api.field_behavior) = REQUIRED];
google.protobuf.Timestamp modified_date = 16 [(google.api.field_behavior) = REQUIRED];
}

message VideoMetadata {
uint32 height = 1 [(google.api.field_behavior) = OPTIONAL];
uint32 width = 2 [(google.api.field_behavior) = OPTIONAL];
float duration_seconds = 3 [(google.api.field_behavior) = OPTIONAL];
}

message ImageMetadata {
uint32 height = 1 [(google.api.field_behavior) = OPTIONAL];
uint32 width = 2 [(google.api.field_behavior) = OPTIONAL];
}

enum EntityType {
ENTITY_TYPE_UNSPECIFIED = 0;
ENTITY_TYPE_RUN = 1;
ENTITY_TYPE_ANNOTATION = 2;
ENTITY_TYPE_ASSET = 3;
ENTITY_TYPE_ANNOTATION_LOG = 4;
}

// The request for a call to `RemoteFileService_GetRemoteFile` to retrieve a remote file;
message GetRemoteFileRequest {
string remote_file_id = 1 [(google.api.field_behavior) = REQUIRED];
}

// The response of a call to `RemoteFileService_GetRemoteFile`.
message GetRemoteFileResponse {
RemoteFile remote_file = 1 [(google.api.field_behavior) = REQUIRED];
}

// The request for a call to `RemoteFileService_ListRemoteFiles` to retrieve remote files.
message ListRemoteFilesRequest {
// The maximum number of remote files to return. The service may return fewer than this value.
// If unspecified, at most 50 remote files will be returned. The maximum value is 1000; values above
// 1000 will be coerced to 1000. Optional.
uint32 page_size = 1 [(google.api.field_behavior) = OPTIONAL];

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

// A [Common Expression Language (CEL)](https://github.com/google/cel-spec) filter string.
// Available fields to filter by are `remote_file_id`, `entity_id`, `entity_type`, and `file_name`.
// For further information about how to use CELs, please refer to [this guide](https://github.com/google/cel-spec/blob/master/doc/langdef.md#standard-definitions).
// For more information about the fields used for filtering, please refer to [this definition](/protocol-buffers/documentation#remote_files). Optional.
string filter = 3 [(google.api.field_behavior) = OPTIONAL];

// This field is only required if your user belongs to multiple organizations.
string organization_id = 4 [(google.api.field_behavior) = OPTIONAL];
}

// The response of a call to `RemoteFileService_ListRemoteFilesResponse`.
message ListRemoteFilesResponse {
repeated RemoteFile remote_files = 1;
string next_page_token = 2;
}

// The request for a call to `RemoteFileService_CreateRemoteFile` to create a remote file.
message CreateRemoteFileRequest {
string file_name = 1 [(google.api.field_behavior) = REQUIRED];
string entity_id = 2 [(google.api.field_behavior) = REQUIRED];
EntityType entity_type = 3 [(google.api.field_behavior) = REQUIRED];
string file_mime_type = 4 [(google.api.field_behavior) = REQUIRED];
string file_content_encoding = 5 [(google.api.field_behavior) = REQUIRED];
uint64 file_size = 6 [(google.api.field_behavior) = REQUIRED];
optional string description = 7 [(google.api.field_behavior) = OPTIONAL];

// This field is only required if your user belongs to multiple organizations.
string organization_id = 8 [(google.api.field_behavior) = OPTIONAL];
oneof metadata {
VideoMetadata video_metadata = 9 [(google.api.field_behavior) = OPTIONAL];
ImageMetadata image_metadata = 10 [(google.api.field_behavior) = OPTIONAL];
}

// A custom UUID used to generate the object key. Recommended to be left unset.
optional string custom_uuid = 11 [(google.api.field_behavior) = OPTIONAL];
}

// The response for a call to `RemoteFileService_CreateRemoteFile`.
message CreateRemoteFileResponse {
RemoteFile remote_file = 1 [(google.api.field_behavior) = REQUIRED];
}

// The request for a call to `RemoteFileService_DeleteRemoteFile` to delete a remote file.
message DeleteRemoteFileRequest {
string remote_file_id = 1 [(google.api.field_behavior) = REQUIRED];
}

// The response of a call to `RemoteFileService_DeleteRemoteFile`.
message DeleteRemoteFileResponse {}

// The request for a call to `RemoteFileService_BatchDeleteRemoteFiles` to delete remote files.
message BatchDeleteRemoteFilesRequest {
// Up to 1000 remote file IDs can be provided per request.
repeated string remote_file_ids = 1;
}

// The response of a call to `RemoteFileService_BatchDeleteRemoteFiles`.
message BatchDeleteRemoteFilesResponse {}

// The request for a call to `RemoteFileService_UpdateRemoteFile` to update a remote file.
message UpdateRemoteFileRequest {
// The remote file to update.
RemoteFile remote_file = 1 [(google.api.field_behavior) = REQUIRED];

// The list of fields to be updated. The field available to be updated is `description`.
google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
}

// The response of a call to `RemoteFileService_UpdateRemoteFile`.
message UpdateRemoteFileResponse {
RemoteFile remote_file = 1 [(google.api.field_behavior) = REQUIRED];
}

// The request for a call to `RemoteFileService_GetRemoteFileDownloadUrl`.
message GetRemoteFileDownloadUrlRequest {
string remote_file_id = 1 [(google.api.field_behavior) = REQUIRED];
}

// The response of a call to `RemoteFileService_GetRemoteFileDownloadUrl`.
message GetRemoteFileDownloadUrlResponse {
string download_url = 1 [(google.api.field_behavior) = REQUIRED];
}
Loading

0 comments on commit 4fddf51

Please sign in to comment.