forked from TheThingsNetwork/lorawan-stack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathidentifiers.proto
More file actions
102 lines (80 loc) · 4.37 KB
/
identifiers.proto
File metadata and controls
102 lines (80 loc) · 4.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// Copyright © 2019 The Things Network Foundation, The Things Industries B.V.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
syntax = "proto3";
import "github.com/envoyproxy/protoc-gen-validate/validate/validate.proto";
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
package ttn.lorawan.v3;
option go_package = "go.thethings.network/lorawan-stack/v3/pkg/ttnpb";
message ApplicationIdentifiers {
option (gogoproto.populate) = false;
string application_id = 1 [(gogoproto.customname) = "ApplicationID", (validate.rules).string = {pattern: "^[a-z0-9](?:[-]?[a-z0-9]){2,}$" , max_len: 36}];
}
message ClientIdentifiers {
option (gogoproto.populate) = false;
string client_id = 1 [(gogoproto.customname) = "ClientID", (validate.rules).string = {pattern: "^[a-z0-9](?:[-]?[a-z0-9]){2,}$" , max_len: 36}];
}
message EndDeviceIdentifiers {
option (gogoproto.populate) = false;
string device_id = 1 [(gogoproto.customname) = "DeviceID", (validate.rules).string = {pattern: "^[a-z0-9](?:[-]?[a-z0-9]){2,}$" , max_len: 36}];
ApplicationIdentifiers application_ids = 2 [(gogoproto.embed) = true, (gogoproto.nullable) = false, (validate.rules).message.required = true];
// The LoRaWAN DevEUI.
bytes dev_eui = 4 [(gogoproto.customtype) = "go.thethings.network/lorawan-stack/v3/pkg/types.EUI64", (gogoproto.customname) = "DevEUI"];
// The LoRaWAN JoinEUI (AppEUI until LoRaWAN 1.0.3 end devices).
bytes join_eui = 5 [(gogoproto.customtype) = "go.thethings.network/lorawan-stack/v3/pkg/types.EUI64", (gogoproto.customname) = "JoinEUI"];
// The LoRaWAN DevAddr.
bytes dev_addr = 6 [(gogoproto.customtype) = "go.thethings.network/lorawan-stack/v3/pkg/types.DevAddr"];
}
message GatewayIdentifiers {
option (gogoproto.populate) = false;
string gateway_id = 1 [(gogoproto.customname) = "GatewayID", (validate.rules).string = {pattern: "^[a-z0-9](?:[-]?[a-z0-9]){2,}$" , max_len: 36}];
// Secondary identifier, which can only be used in specific requests.
bytes eui = 2 [(gogoproto.customtype) = "go.thethings.network/lorawan-stack/v3/pkg/types.EUI64", (gogoproto.customname) = "EUI"];
}
message OrganizationIdentifiers {
option (gogoproto.populate) = false;
// This ID shares namespace with user IDs.
string organization_id = 1 [(gogoproto.customname) = "OrganizationID", (validate.rules).string = {pattern: "^[a-z0-9](?:[-]?[a-z0-9]){2,}$" , max_len: 36}];
}
message UserIdentifiers {
option (gogoproto.populate) = false;
// This ID shares namespace with organization IDs.
string user_id = 1 [(gogoproto.customname) = "UserID", (validate.rules).string = {pattern: "^[a-z0-9](?:[-]?[a-z0-9]){2,}$" , max_len: 36}];
// Secondary identifier, which can only be used in specific requests.
string email = 2;
}
// OrganizationOrUserIdentifiers contains either organization or user identifiers.
message OrganizationOrUserIdentifiers {
oneof ids {
option (validate.required) = true;
OrganizationIdentifiers organization_ids = 1 [(gogoproto.customname) = "OrganizationIDs"];
UserIdentifiers user_ids = 2 [(gogoproto.customname) = "UserIDs"];
}
}
// EntityIdentifiers contains one of the possible entity identifiers.
message EntityIdentifiers {
oneof ids {
option (validate.required) = true;
ApplicationIdentifiers application_ids = 1 [(gogoproto.customname) = "ApplicationIDs"];
ClientIdentifiers client_ids = 2 [(gogoproto.customname) = "ClientIDs"];
EndDeviceIdentifiers device_ids = 3 [(gogoproto.customname) = "DeviceIDs"];
GatewayIdentifiers gateway_ids = 4 [(gogoproto.customname) = "GatewayIDs"];
OrganizationIdentifiers organization_ids = 5 [(gogoproto.customname) = "OrganizationIDs"];
UserIdentifiers user_ids = 6 [(gogoproto.customname) = "UserIDs"];
}
}
// Combine the identifiers of multiple entities.
// The main purpose of this message is its use in events.
message CombinedIdentifiers {
repeated EntityIdentifiers entity_identifiers = 1;
}