Skip to content

Commit e0ea903

Browse files
committed
Upgrade notification center SDK
1 parent 9bffb2c commit e0ea903

24 files changed

+434
-293
lines changed

proto/com/coralogixapis/notification_center/common/common.proto

+7-10
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,7 @@ syntax = "proto3";
22

33
package com.coralogixapis.notification_center;
44

5-
enum OrderByDirection {
6-
ORDER_BY_DIRECTION_UNSPECIFIED = 0;
7-
ASC = 1;
8-
DESC = 2;
9-
}
10-
11-
message OrderBy {
12-
string field_name = 1;
13-
OrderByDirection direction = 2;
14-
}
5+
option go_package = "com/coralogixapis/notification_center";
156

167
enum ConnectorType {
178
CONNECTOR_TYPE_UNSPECIFIED = 0;
@@ -21,3 +12,9 @@ enum ConnectorType {
2112
AWS = 4;
2213
IBM_EVENT_NOTIFICATIONS = 5;
2314
}
15+
16+
enum EntityType {
17+
ENTITY_TYPE_UNSPECIFIED = 0;
18+
ALERTS = 1;
19+
TEST_NOTIFICATIONS = 2;
20+
}

proto/com/coralogixapis/notification_center/common/config_overrides.proto

+10-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@ syntax = "proto3";
22

33
package com.coralogixapis.notification_center;
44

5+
import "com/coralogixapis/notification_center/common/common.proto";
56
import "com/coralogixapis/notification_center/common/v1/config_fields.proto";
67

8+
option go_package = "com/coralogixapis/notification_center";
9+
710
message ConfigOverrides {
11+
reserved 4;
12+
813
ConditionType condition_type = 1;
9-
string output_schema_id = 2;
14+
optional string payload_type = 2;
1015
MessageConfig message_config = 3;
1116
}
1217

@@ -22,10 +27,12 @@ message MessageConfig {
2227
}
2328

2429
message MatchEntityTypeCondition {
25-
string entity_type = 1;
30+
string deprecated_entity_type = 1 [deprecated = true];
31+
EntityType entity_type = 2 [deprecated = true];
2632
}
2733

2834
message MatchEntityTypeAndSubTypeCondition {
29-
string entity_type = 1;
35+
string deprecated_entity_type = 1 [deprecated = true];
3036
string entity_sub_type = 2;
37+
EntityType entity_type = 3 [deprecated = true];
3138
}

proto/com/coralogixapis/notification_center/common/rpc_common.proto

-10
This file was deleted.

proto/com/coralogixapis/notification_center/common/v1/config_fields.proto

+7
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,19 @@ syntax = "proto3";
33
package com.coralogixapis.notification_center;
44
import "protoc-gen-openapiv2/options/annotations.proto";
55

6+
option go_package = "com/coralogixapis/notification_center";
7+
68
/**
79
* This file contains public models used across the notification sources APIs.
810
* any updates should be made with caution to ensure backward compatibility.
911
*/
1012

1113
message ConnectorConfigField {
14+
string field_name = 1;
15+
string value = 2;
16+
}
17+
18+
message TemplatedConnectorConfigField {
1219
string field_name = 1;
1320
string template = 2;
1421
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
syntax = "proto3";
2+
3+
package com.coralogixapis.notification_center;
4+
5+
option go_package = "com/coralogixapis/notification_center";
6+
7+
/**
8+
* This file contains public models used across the notification sources APIs.
9+
* any updates should be made with caution to ensure backward compatibility.
10+
*/
11+
12+
message ConnectorIdentifier {
13+
oneof value {
14+
// The unique identifier automatically generated by the service
15+
string id = 1;
16+
// The unique identifier provided by the user
17+
string user_defined_id = 2;
18+
}
19+
}
20+
21+
message PresetIdentifier {
22+
oneof value {
23+
// The unique identifier automatically generated by the service
24+
string id = 1;
25+
// The unique identifier provided by the user
26+
string user_defined_id = 2;
27+
}
28+
}
29+
30+
message GlobalRouterIdentifier {
31+
oneof value {
32+
// The unique identifier automatically generated by the service
33+
string id = 1;
34+
// The unique identifier provided by the user
35+
string user_defined_id = 2;
36+
}
37+
}

proto/com/coralogixapis/notification_center/common/v1/routing.proto renamed to proto/com/coralogixapis/notification_center/common/v1/routing/routing.proto

+15-5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ syntax = "proto3";
33
package com.coralogixapis.notification_center.routing;
44
import "com/coralogixapis/notification_center/common/v1/config_fields.proto";
55
import "protoc-gen-openapiv2/options/annotations.proto";
6+
import "com/coralogixapis/notification_center/common/v1/identifier.proto";
7+
8+
option go_package = "com/coralogixapis/notification_center/routing";
69

710
/**
811
* This file contains public models used across the notification sources APIs.
@@ -33,6 +36,9 @@ message RoutingRule {
3336
}
3437

3538
message RoutingTarget {
39+
reserved 3;
40+
reserved "config_overrides";
41+
3642
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
3743
json_schema: {
3844
title: "Routing Target"
@@ -46,17 +52,21 @@ message RoutingTarget {
4652
};
4753

4854
//Connector ID to send the notification to
49-
string connector_id = 1;
55+
string deprecated_connector_id = 1 [deprecated = true];
5056
// Preset to use for rendering notification content, default preset is used if not provided
51-
optional string preset_id = 2;
52-
optional SourceOverrides config_overrides = 3;
57+
optional string deprecated_preset_id = 2 [deprecated = true];
5358
map<string, string> custom_details = 4;
59+
ConnectorIdentifier connector_identifier = 5 [deprecated = true];
60+
optional PresetIdentifier preset_identifier = 6 [deprecated = true];
61+
string connector_id = 7;
62+
optional string preset_id = 8;
5463
}
5564

5665
message SourceOverrides {
57-
string output_schema_id = 1;
66+
string payload_type = 1;
5867
repeated MessageConfigField message_config_fields = 3;
59-
repeated ConnectorConfigField connector_config_fields = 4;
68+
repeated ConnectorConfigField deprecated_connector_config_fields = 4 [deprecated=true];
69+
repeated TemplatedConnectorConfigField connector_config_fields = 5;
6070
}
6171

6272
message GlobalRouterIdentifier {

proto/com/coralogixapis/notification_center/connectors/v1/connector.proto

+16-11
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ import "com/coralogixapis/notification_center/common/v1/config_fields.proto";
77
import "google/protobuf/timestamp.proto";
88
import "protoc-gen-openapiv2/options/annotations.proto";
99

10+
option go_package = "com/coralogixapis/notification_center/connectors/v1";
11+
1012
message Connector {
11-
// Deprecated with the introduction of Global connectors.
12-
reserved 10;
13-
reserved "entity_type";
13+
reserved 2, 9, 10;
14+
reserved "connector_configs", "entity_type";
1415

1516
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
1617
json_schema: {
@@ -23,10 +24,8 @@ message Connector {
2324
description: "Find out more about notification center"
2425
}
2526
};
26-
// A unique identifier automatically generated by the service (do not provide this from the client side)
27+
// A unique identifier (generated by the system if not provided)
2728
optional string id = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "\"a16e24c8-4db2-4abf-ba3c-c9e1fc35a3b9\"" }];
28-
// A unique identifier provided by the user
29-
optional string user_facing_id = 2 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "\"user-connector-id\"" }];
3029
ConnectorType type = 3;
3130
optional uint32 team_id = 4 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "\"12345\"" }];
3231
string name = 5 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "\"My Slack Connector\"", max_length: 200 }];
@@ -35,14 +34,18 @@ message Connector {
3534
optional google.protobuf.Timestamp create_time = 7;
3635
// System-generated timestamp for when the connector was last updated
3736
optional google.protobuf.Timestamp update_time = 8;
38-
repeated ConnectorConfig connector_configs = 9;
3937
// Configuration override templates for specific entity types, values from connector_configs will be used if not overridden
4038
repeated EntityTypeConfigOverrides config_overrides = 11;
39+
ConnectorConfig connector_config = 12;
4140
}
4241

4342
message EntityTypeConfigOverrides {
44-
string entity_type = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "\"alerts\"" }];
45-
repeated ConnectorConfig connector_configs = 2;
43+
reserved 2;
44+
reserved "connector_configs";
45+
46+
string deprecated_entity_type = 1 [deprecated = true];
47+
EntityType entity_type = 3 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "\"ALERTS\"" }];
48+
repeated TemplatedConnectorConfigField fields = 4;
4649
}
4750

4851
message ConnectorSummary {
@@ -52,7 +55,7 @@ message ConnectorSummary {
5255

5356
optional string id = 1;
5457
// for declarative API
55-
optional string user_facing_id = 2;
58+
optional string user_defined_id = 2;
5659
ConnectorType type = 3;
5760
optional uint32 team_id = 4;
5861
string name = 5;
@@ -62,6 +65,9 @@ message ConnectorSummary {
6265
}
6366

6467
message ConnectorConfig {
68+
reserved 1;
69+
reserved "output_schema_id";
70+
6571
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
6672
json_schema: {
6773
title: "Connector Config"
@@ -73,7 +79,6 @@ message ConnectorConfig {
7379
description: "Find out more about notification center"
7480
}
7581
};
76-
string output_schema_id = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "\"schema-id\"" }];
7782
repeated ConnectorConfigField fields = 2;
7883
}
7984

proto/com/coralogixapis/notification_center/connectors/v1/connectors_service.proto

+19-11
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ import "com/coralogixapis/notification_center/connectors/v1/connector.proto";
77
import "google/protobuf/descriptor.proto";
88
import "google/api/annotations.proto";
99
import "protoc-gen-openapiv2/options/annotations.proto";
10+
import "com/coralogixapis/notification_center/common/v1/identifier.proto";
11+
12+
option go_package = "com/coralogixapis/notification_center/connectors/v1";
1013

1114
// Public API that allows managing connectors.
1215
service ConnectorsService {
@@ -138,7 +141,9 @@ message DeleteConnectorRequest {
138141
description: "Find out more about notification center"
139142
}
140143
};
141-
string id = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "\"connector-id\"" }];
144+
string deprecated_id = 1 [deprecated = true];
145+
ConnectorIdentifier identifier = 2 [deprecated = true];
146+
string id = 3;
142147
}
143148

144149
message DeleteConnectorResponse {
@@ -156,7 +161,10 @@ message GetConnectorRequest {
156161
description: "Find out more about notification center"
157162
}
158163
};
159-
string id = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "\"connector-id\"" }];
164+
165+
string deprecated_id = 1 [deprecated = true];
166+
ConnectorIdentifier identifier = 2 [deprecated = true];
167+
string id = 3;
160168
}
161169

162170
message GetConnectorResponse {
@@ -175,8 +183,7 @@ message GetConnectorResponse {
175183
}
176184

177185
message ListConnectorsRequest {
178-
// Deprecated with the introduction of Global connectors.
179-
reserved 3;
186+
reserved 2, 3;
180187
reserved "entity_type";
181188

182189
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
@@ -191,7 +198,6 @@ message ListConnectorsRequest {
191198
}
192199
};
193200
ConnectorType connector_type = 1;
194-
repeated OrderBy order_bys = 2;
195201
}
196202

197203
message ListConnectorsResponse {
@@ -221,7 +227,9 @@ message BatchGetConnectorsRequest {
221227
description: "Find out more about notification center"
222228
}
223229
};
224-
repeated string ids = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "[\"connector-id-1\", \"connector-id-2\"]" }];
230+
repeated string deprecated_ids = 1 [deprecated = true];
231+
repeated ConnectorIdentifier deprecated_identifiers = 2 [deprecated = true];
232+
repeated string ids = 3;
225233
}
226234

227235
message BatchGetConnectorsResponse {
@@ -252,7 +260,9 @@ message BatchGetConnectorSummariesRequest {
252260
description: "Find out more about notification center"
253261
}
254262
};
255-
repeated string ids = 1 [(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { example: "[\"connector-id-1\", \"connector-id-2\"]" }];
263+
repeated string deprecated_ids = 1 [deprecated = true];
264+
repeated ConnectorIdentifier deprecated_identifiers = 2 [deprecated = true];
265+
repeated string ids = 3;
256266
}
257267
message BatchGetConnectorSummariesResponse {
258268
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
@@ -285,8 +295,7 @@ message GetConnectorTypeSummariesRequest {
285295
}
286296

287297
message ListConnectorSummariesRequest {
288-
// Deprecated with the introduction of Global connectors.
289-
reserved 3;
298+
reserved 2, 3;
290299
reserved "entity_type";
291300

292301
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
@@ -301,7 +310,6 @@ message ListConnectorSummariesRequest {
301310
}
302311
};
303312
ConnectorType connector_type = 1;
304-
repeated OrderBy order_bys = 2;
305313
}
306314
message ListConnectorSummariesResponse {
307315
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
@@ -315,7 +323,7 @@ message ListConnectorSummariesResponse {
315323
description: "Find out more about notification center"
316324
}
317325
};
318-
repeated ConnectorSummary connector_summaries = 1;
326+
repeated ConnectorSummary connectors = 1;
319327
}
320328

321329
message GetConnectorTypeSummariesResponse {

0 commit comments

Comments
 (0)