Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature(protos): update protos #104

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions protos/buf.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ deps:
- remote: buf.build
owner: googleapis
repository: googleapis
commit: 8bc2c51e08c447cd8886cdea48a73e14
digest: shake256:a969155953a5cedc5b2df5b42c368f2bc66ff8ce1804bc96e0f14ff2ee8a893687963058909df844d1643cdbc98ff099d2daa6bc9f9f5b8886c49afdc60e19af
commit: e7f8d366f5264595bcc4cd4139af9973
digest: shake256:e5e5f1c12f82e028ea696faa43b4f9dc6258a6d1226282962a8c8b282e10946281d815884f574bd279ebd9cd7588629beb3db17b892af6c33b56f92f8f67f509
- remote: buf.build
owner: grpc-ecosystem
repository: grpc-gateway
Expand Down
6 changes: 5 additions & 1 deletion protos/sift/annotations/v1/annotations.proto
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ message DeleteAnnotationRequest {
message DeleteAnnotationResponse {}

message BatchDeleteAnnotationsRequest {
// Limit of 1000 annotations per batch
repeated string annotation_ids = 1 [(google.api.field_behavior) = REQUIRED];
}

Expand Down Expand Up @@ -217,10 +218,13 @@ 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_rule_condition_version_id`,
// and `annotation_type`.
// `annotation_type`, `tag_name`, and `assignee`.
// 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.
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 result of a call to `AnnotationService_ListAnnotations`.
Expand Down
2 changes: 2 additions & 0 deletions protos/sift/assets/v1/assets.proto
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ message Asset {
string created_by_user_id = 6 [(google.api.field_behavior) = REQUIRED];
google.protobuf.Timestamp modified_date = 7 [(google.api.field_behavior) = REQUIRED];
string modified_by_user_id = 8 [(google.api.field_behavior) = REQUIRED];

// The names of the tags to associate with this asset.
repeated string tags = 9 [(google.api.field_behavior) = REQUIRED];
}

Expand Down
11 changes: 11 additions & 0 deletions protos/sift/calculated_channels/v1/calculated_channels.proto
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ message ExpressionIdentifier {
string description = 2 [(google.api.field_behavior) = REQUIRED];
ExpressionIdentifierType type = 3 [(google.api.field_behavior) = REQUIRED];
string display_name = 4 [(google.api.field_behavior) = REQUIRED];
ExpressionIdentifierLibrary library = 5 [(google.api.field_behavior) = REQUIRED];
}

enum ExpressionIdentifierType {
Expand All @@ -82,6 +83,16 @@ enum ExpressionIdentifierType {
EXPRESSION_IDENTIFIER_TYPE_CHANNEL = 2;
}

enum ExpressionIdentifierLibrary {
EXPRESSION_IDENTIFIER_LIBRARY_UNSPECIFIED = 0;
EXPRESSION_IDENTIFIER_LIBRARY_MATH = 1;
EXPRESSION_IDENTIFIER_LIBRARY_STRING = 2;
EXPRESSION_IDENTIFIER_LIBRARY_LIST = 3;
EXPRESSION_IDENTIFIER_LIBRARY_ITER = 4;
EXPRESSION_IDENTIFIER_LIBRARY_STATEFUL = 5;
EXPRESSION_IDENTIFIER_LIBRARY_SUMMARY = 6;
}

enum ExpressionMode {
EXPRESSION_MODE_UNSPECIFIED = 0 [deprecated = true];
EXPRESSION_MODE_RULES = 1;
Expand Down
1 change: 1 addition & 0 deletions protos/sift/channel_schemas/v1/channel_schemas.proto
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ message CreateChannelSchemaResponse {}

// The request for a call to `ChannelSchemaService_BatchCreateChannelSchemas`.
message BatchCreateChannelSchemasRequest {
// Limit of 1000 channels schemas per batch
repeated CreateChannelSchemaRequest requests = 1 [(google.api.field_behavior) = REQUIRED];
// The asset to which the channel schemas belong (case-insensitive).
// If this field, and any of the child requests specify an asset, the assets must match.
Expand Down
7 changes: 5 additions & 2 deletions protos/sift/channels/v2/channels.proto
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ message GetChannelResponse {
// The request for a call to `ChannelService_ListChannels` to retrieve channels.
message ListChannelsRequest {
// The maximum number of channels to return. The service may return fewer than this value.
// If unspecified, at most 50 channels will be returned. The maximum value is 1000; values above
// 1000 will be coerced to 1000. Optional.
// If unspecified, at most 50 channels will be returned. The maximum value is 10,000; values above
// 10,000 will be coerced to 10,000. Optional.
uint32 page_size = 1 [(google.api.field_behavior) = OPTIONAL];

// A page token, received from a previous `ListChannels` call.
Expand All @@ -88,6 +88,9 @@ message ListChannelsRequest {
// 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#channel). 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 result of a call to `ChannelService_ListChannels`.
Expand Down
47 changes: 47 additions & 0 deletions protos/sift/common/type/v1/resource_identifier.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
syntax = "proto3";

package sift.common.type.v1;

import "google/api/field_behavior.proto";



message ResourceIdentifier {
oneof identifier {
string id = 1;
string client_key = 2;
}
}

message NamedResource {
oneof resource {
string id = 1;
string name = 2;
}
}

message ResourceIdentifiers {
oneof identifiers {
Ids ids = 1;
ClientKeys client_keys = 2;
}
}

message NamedResources {
oneof resources {
Ids ids = 1;
Names names = 2;
}
}

message Ids {
repeated string ids = 1 [(google.api.field_behavior) = REQUIRED];
}

message ClientKeys {
repeated string client_keys = 1 [(google.api.field_behavior) = REQUIRED];
}

message Names {
repeated string names = 1 [(google.api.field_behavior) = REQUIRED];
}
1 change: 1 addition & 0 deletions protos/sift/notifications/v1/notifications.proto
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ enum NotificationKind {
NOTIFICATION_KIND_MENTIONED_IN_ANNOTATION_COMMENT = 3;
NOTIFICATION_KIND_CONDITION_TRIGGERED = 4;
NOTIFICATION_KIND_ANNOTATION_STATE_CHANGED = 5;
NOTIFICATION_KIND_REPORT_READY = 6;
}

// The request for a call to `NotificationService_ListNotifications` to retrieve notifications.
Expand Down
75 changes: 73 additions & 2 deletions protos/sift/report_templates/v1/report_templates.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package sift.report_templates.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";

Expand Down Expand Up @@ -32,10 +33,31 @@ service ReportTemplateService {
body: "*"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "InsertReportTemplate",
summary: "CreateReportTemplate",
description: "Create a report template."
};
}

// List report templates.
rpc ListReportTemplates(ListReportTemplatesRequest) returns (ListReportTemplatesResponse) {
option (google.api.http) = {get: "/api/v1/report-templates"};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "ListReportTemplates"
description: "List report templates."
};
}

// Updates an existing report template using the list of fields specified in `update_mask`.
rpc UpdateReportTemplate(UpdateReportTemplateRequest) returns (UpdateReportTemplateResponse) {
option (google.api.http) = {
patch: "/api/v1/report-templates"
body: "*"
};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "UpdateReportTemplate"
description: "Updates an existing report template using the list of fields specified in `update_mask`."
};
}
}

message ReportTemplate {
Expand All @@ -57,6 +79,7 @@ message ReportTemplateRule {
string rule_id = 1 [(google.api.field_behavior) = REQUIRED];
string rule_version_id = 2 [(google.api.field_behavior) = REQUIRED];
uint32 rule_version_number = 3 [(google.api.field_behavior) = REQUIRED];
string client_key = 4 [(google.api.field_behavior) = OPTIONAL];
}

message ReportTemplateTag {
Expand Down Expand Up @@ -85,7 +108,7 @@ message CreateReportTemplateRequest {
optional string description = 3 [(google.api.field_behavior) = OPTIONAL];
repeated string tag_names = 4 [(google.api.field_behavior) = REQUIRED];
// `organization_id` is only required if your user belongs to multiple organizations
string organization_id = 6 [(google.api.field_behavior) = REQUIRED];
string organization_id = 6 [(google.api.field_behavior) = OPTIONAL];
oneof rule_identifiers {
CreateReportTemplateRequestRuleIds rule_ids = 7 [(google.api.field_behavior) = OPTIONAL];
CreateReportTemplateRequestClientKeys rule_client_keys = 8 [(google.api.field_behavior) = OPTIONAL];
Expand All @@ -104,3 +127,51 @@ message CreateReportTemplateRequestClientKeys {
message CreateReportTemplateResponse {
ReportTemplate report_template = 1 [(google.api.field_behavior) = REQUIRED];
}

// The request for a call to `ReportTemplateService_ListReportTemplates` to retrieve report templates.
message ListReportTemplatesRequest {
// The maximum number of report templates to return. The service may return fewer than this value.
// If unspecified, at most 50 report templates 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 `ListReportTemplates` call.
// Provide this to retrieve the subsequent page.
// When paginating, all other parameters provided to `ListReportTemplates` 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 `report_template_id`, `client_key`, and `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#report_templates). 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];

// If `true` then archived report templates will be included in the query. Defaults to `false`.
bool include_archived = 5 [(google.api.field_behavior) = OPTIONAL];
}

// The response of a call to `ReportTemplateService_ListReportTemplatesResponse`.
message ListReportTemplatesResponse {
repeated ReportTemplate report_templates = 1;
string next_page_token = 2;
}

// The request for a call to `ReportTemplateService_UpdateReportTemplate` to update a report template. When updating
// tags or rules, the update will perform a full replace. Additionally, when updating rules, only the rule ID or the rule client key
// is required, but it is okay to provide both. If some rules contain only client keys and others only rule IDs, they will be consolidated.
message UpdateReportTemplateRequest {
// The report template to update.
ReportTemplate report_template = 1 [(google.api.field_behavior) = REQUIRED];

// The list of fields to be updated. The fields available to be updated are `name`, `archived_date`, `description`, `tags`, and `rules`.
google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED];
}

// The response of a call to `ReportTemplateService_UpdateReportTemplate`.
message UpdateReportTemplateResponse {
ReportTemplate report_template = 1 [(google.api.field_behavior) = REQUIRED];
}
Loading
Loading