chirpstack_api 3.8.1

ChirpStack Protobuf / gRPC API definitions.
Documentation
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
syntax = "proto3";

package api;

option go_package = "github.com/brocaar/chirpstack-api/go/v3/as/external/api";
option java_package = "io.chirpstack.api.as.external.api";

import "google/api/annotations.proto";
import "google/protobuf/empty.proto";


// ApplicationService is the service managing applications.
service ApplicationService {
	// Create creates the given application.
	rpc Create(CreateApplicationRequest) returns (CreateApplicationResponse) {
		option(google.api.http) = {
			post: "/api/applications"
			body: "*"
		};
	}

	// Get returns the requested application.
	rpc Get(GetApplicationRequest) returns (GetApplicationResponse) {
		option(google.api.http) = {
			get: "/api/applications/{id}"
		};
	}

	// Update updates the given application.
	rpc Update(UpdateApplicationRequest) returns (google.protobuf.Empty) {
		option(google.api.http) = {
			put: "/api/applications/{application.id}"
			body: "*"
		};
	}

	// Delete deletes the given application.
	rpc Delete(DeleteApplicationRequest) returns (google.protobuf.Empty) {
		option(google.api.http) = {
			delete: "/api/applications/{id}"
		};
	}

	// List lists the available applications.
	rpc List(ListApplicationRequest) returns (ListApplicationResponse) {
		option(google.api.http) = {
			get: "/api/applications"
		};
	}

	// CreateHTTPIntegration creates a HTTP application-integration.
	rpc CreateHTTPIntegration(CreateHTTPIntegrationRequest) returns (google.protobuf.Empty) {
		option(google.api.http) = {
			post: "/api/applications/{integration.application_id}/integrations/http"
			body: "*"
		};
	}

	// GetHTTPIntegration returns the HTTP application-integration.
	rpc GetHTTPIntegration(GetHTTPIntegrationRequest) returns (GetHTTPIntegrationResponse) {
		option(google.api.http) = {
			get: "/api/applications/{application_id}/integrations/http"
		};
	}

	// UpdateHTTPIntegration updates the HTTP application-integration.
	rpc UpdateHTTPIntegration(UpdateHTTPIntegrationRequest) returns (google.protobuf.Empty) {
		option(google.api.http) = {
			put: "/api/applications/{integration.application_id}/integrations/http"
			body: "*"
		};
	}

	// DeleteIntegration deletes the HTTP application-integration.
	rpc DeleteHTTPIntegration(DeleteHTTPIntegrationRequest) returns (google.protobuf.Empty) {
		option(google.api.http) = {
			delete: "/api/applications/{application_id}/integrations/http"
		};
	}

	// CreateInfluxDBIntegration create an InfluxDB application-integration.
	rpc CreateInfluxDBIntegration(CreateInfluxDBIntegrationRequest) returns (google.protobuf.Empty) {
		option(google.api.http) = {
			post: "/api/applications/{integration.application_id}/integrations/influxdb"
			body: "*"
		};
	}

	// GetInfluxDBIntegration returns the InfluxDB application-integration.
	rpc GetInfluxDBIntegration(GetInfluxDBIntegrationRequest) returns (GetInfluxDBIntegrationResponse) {
		option(google.api.http) = {
			get: "/api/applications/{application_id}/integrations/influxdb"
		};
	}

	// UpdateInfluxDBIntegration updates the InfluxDB application-integration.
	rpc UpdateInfluxDBIntegration(UpdateInfluxDBIntegrationRequest) returns (google.protobuf.Empty) {
		option(google.api.http) = {
			put: "/api/applications/{integration.application_id}/integrations/influxdb"
			body: "*"
		};
	}

	// DeleteInfluxDBIntegration deletes the InfluxDB application-integration.
	rpc DeleteInfluxDBIntegration(DeleteInfluxDBIntegrationRequest) returns (google.protobuf.Empty) {
		option(google.api.http) = {
			delete: "/api/applications/{application_id}/integrations/influxdb"
		};
	}

    // CreateThingsBoardIntegration creates a ThingsBoard application-integration.
    rpc CreateThingsBoardIntegration(CreateThingsBoardIntegrationRequest) returns (google.protobuf.Empty) {
        option(google.api.http) = {
            post: "/api/applications/{integration.application_id}/integrations/thingsboard"
            body: "*"
        };
    }

    // GetThingsBoardIntegration returns the ThingsBoard application-integration.
    rpc GetThingsBoardIntegration(GetThingsBoardIntegrationRequest) returns (GetThingsBoardIntegrationResponse) {
        option(google.api.http) = {
            get: "/api/applications/{application_id}/integrations/thingsboard"
        };
    }

    // UpdateThingsBoardIntegration updates the ThingsBoard application-integration.
    rpc UpdateThingsBoardIntegration(UpdateThingsBoardIntegrationRequest) returns (google.protobuf.Empty) {
        option(google.api.http) = {
            put: "/api/applications/{integration.application_id}/integrations/thingsboard"
            body: "*"
        };
    }

    // DeleteThingsBoardIntegration deletes the ThingsBoard application-integration.
    rpc DeleteThingsBoardIntegration(DeleteThingsBoardIntegrationRequest) returns (google.protobuf.Empty) {
        option(google.api.http) = {
            delete: "/api/applications/{application_id}/integrations/thingsboard"
        };
    }

    // CreateMyDevicesIntegration creates a MyDevices application-integration.
    rpc CreateMyDevicesIntegration(CreateMyDevicesIntegrationRequest) returns (google.protobuf.Empty) {
        option(google.api.http) = {
            post: "/api/applications/{integration.application_id}/integrations/mydevices"
            body: "*"
        };
    }

    // GetMyDevicesIntegration returns the MyDevices application-integration.
    rpc GetMyDevicesIntegration(GetMyDevicesIntegrationRequest) returns (GetMyDevicesIntegrationResponse) {
        option(google.api.http) = {
            get: "/api/applications/{application_id}/integrations/mydevices"
        };
    }

    // UpdateMyDevicesIntegration updates the MyDevices application-integration.
    rpc UpdateMyDevicesIntegration(UpdateMyDevicesIntegrationRequest) returns (google.protobuf.Empty) {
        option(google.api.http) = {
            put: "/api/applications/{integration.application_id}/integrations/mydevices"
            body: "*"
        };
    }

    // DeleteMyDevicesIntegration deletes the MyDevices application-integration.
    rpc DeleteMyDevicesIntegration(DeleteMyDevicesIntegrationRequest) returns (google.protobuf.Empty) {
        option(google.api.http) = {
            delete: "/api/applications/{application_id}/integrations/mydevices"
        };
    }

    // CreateLoRaCloudIntegration creates A LoRaCloud application-integration.
    rpc CreateLoRaCloudIntegration(CreateLoRaCloudIntegrationRequest) returns (google.protobuf.Empty) {
        option(google.api.http) = {
            post: "/api/applications/{integration.application_id}/integrations/loracloud"
            body: "*"
        };
    }

    // GetLoRaCloudIntegration returns the LoRaCloud application-integration.
    rpc GetLoRaCloudIntegration(GetLoRaCloudIntegrationRequest) returns (GetLoRaCloudIntegrationResponse) {
        option(google.api.http) = {
            get: "/api/applications/{application_id}/integrations/loracloud"
        };
    }

    // UpdateLoRaCloudIntegration updates the LoRaCloud application-integration.
    rpc UpdateLoRaCloudIntegration(UpdateLoRaCloudIntegrationRequest) returns (google.protobuf.Empty) {
        option(google.api.http) = {
            put: "/api/applications/{integration.application_id}/integrations/loracloud"
            body: "*"
        };
    }

    // DeleteLoRaCloudIntegration deletes the LoRaCloud application-integration.
    rpc DeleteLoRaCloudIntegration(DeleteLoRaCloudIntegrationRequest) returns (google.protobuf.Empty) {
        option(google.api.http) = {
            delete: "/api/applications/{application_id}/integrations/loracloud"
        };
    }

    // CreateGCPPubSubIntegration creates a GCP PubSub application-integration.
    rpc CreateGCPPubSubIntegration(CreateGCPPubSubIntegrationRequest) returns (google.protobuf.Empty) {
        option(google.api.http) = {
            post: "/api/applications/{integration.application_id}/integrations/gcp-pub-sub"
            body: "*"
        };
    }

    // GetGCPPubSubIntegration returns the GCP PubSub application-integration.
    rpc GetGCPPubSubIntegration(GetGCPPubSubIntegrationRequest) returns (GetGCPPubSubIntegrationResponse) {
        option(google.api.http) = {
            get: "/api/applications/{application_id}/integrations/gcp-pub-sub"
        };
    }

    // UpdateGCPPubSubIntegration updates the GCP PubSub application-integration.
    rpc UpdateGCPPubSubIntegration(UpdateGCPPubSubIntegrationRequest) returns (google.protobuf.Empty) {
        option(google.api.http) = {
            put: "/api/applications/{integration.application_id}/integrations/gcp-pub-sub"
            body: "*"
        };
    }

    // DeleteGCPPubSubIntegration deletes the GCP PubSub application-integration.
    rpc DeleteGCPPubSubIntegration(DeleteGCPPubSubIntegrationRequest) returns (google.protobuf.Empty) {
        option(google.api.http) = {
            delete: "/api/applications/{application_id}/integrations/gcp-pub-sub"
        };
    }

    // CreateAWSSNSIntegration creates a AWS SNS application-integration.
    rpc CreateAWSSNSIntegration(CreateAWSSNSIntegrationRequest) returns (google.protobuf.Empty) {
        option(google.api.http) = {
            post: "/api/applications/{integration.application_id}/integrations/aws-sns"
            body: "*"
        };
    }

    // GetAWSSNSIntegration returns the AWS SNS application-integration.
    rpc GetAWSSNSIntegration(GetAWSSNSIntegrationRequest) returns (GetAWSSNSIntegrationResponse) {
        option(google.api.http) = {
            get: "/api/applications/{application_id}/integrations/aws-sns"
        };
    }

    // UpdateAWSSNSIntegration updates the AWS SNS application-integration.
    rpc UpdateAWSSNSIntegration(UpdateAWSSNSIntegrationRequest) returns (google.protobuf.Empty) {
        option(google.api.http) = {
            put: "/api/applications/{integration.application_id}/integrations/aws-sns"
            body: "*"
        };
    }

    // DeleteAWSSNSIntegration deletes the AWS SNS application-integration.
    rpc DeleteAWSSNSIntegration(DeleteAWSSNSIntegrationRequest) returns (google.protobuf.Empty) {
        option(google.api.http) = {
            delete: "/api/applications/{application_id}/integrations/aws-sns"
        };
    }

    // CreateAzureServiceBusIntegration creates an Azure Service-Bus application-integration.
    rpc CreateAzureServiceBusIntegration(CreateAzureServiceBusIntegrationRequest) returns (google.protobuf.Empty) {
        option(google.api.http) = {
            post: "/api/applications/{integration.application_id}/integrations/azure-service-bus"
            body: "*"
        };
    }

    // GetAzureServiceBusIntegration returns the Azure Service-Bus application-integration.
    rpc GetAzureServiceBusIntegration(GetAzureServiceBusIntegrationRequest) returns (GetAzureServiceBusIntegrationResponse) {
        option(google.api.http) = {
            get: "/api/applications/{application_id}/integrations/azure-service-bus"
        };
    }

    // UpdateAzureServiceBusIntegration updates the Azure Service-Bus application-integration.
    rpc UpdateAzureServiceBusIntegration(UpdateAzureServiceBusIntegrationRequest) returns (google.protobuf.Empty) {
        option(google.api.http) = {
            put: "/api/applications/{integration.application_id}/integrations/azure-service-bus"
            body: "*"
        };
    }

    // DeleteAzureServiceBusIntegration deletes the Azure Service-Bus application-integration.
    rpc DeleteAzureServiceBusIntegration(DeleteAzureServiceBusIntegrationRequest) returns (google.protobuf.Empty) {
        option(google.api.http) = {
            delete: "/api/applications/{application_id}/integrations/azure-service-bus"
        };
    }

    // CreatePilotThingsIntegration creates an Pilot Things application-integration.
    rpc CreatePilotThingsIntegration(CreatePilotThingsIntegrationRequest) returns (google.protobuf.Empty) {
        option(google.api.http) = {
            post: "/api/applications/{integration.application_id}/integrations/pilot-things"
            body: "*"
        };
    }

    // GetPilotThingsIntegration returns the Pilot Things application-integration.
    rpc GetPilotThingsIntegration(GetPilotThingsIntegrationRequest) returns (GetPilotThingsIntegrationResponse) {
        option(google.api.http) = {
            get: "/api/applications/{application_id}/integrations/pilot-things"
        };
    }

    // UpdatePilotThingsIntegration updates the Pilot Things application-integration.
    rpc UpdatePilotThingsIntegration(UpdatePilotThingsIntegrationRequest) returns (google.protobuf.Empty) {
        option(google.api.http) = {
            put: "/api/applications/{integration.application_id}/integrations/pilot-things"
            body: "*"
        };
    }

    // DeletePilotThingsIntegration deletes the Pilot Things application-integration.
    rpc DeletePilotThingsIntegration(DeletePilotThingsIntegrationRequest) returns (google.protobuf.Empty) {
        option(google.api.http) = {
            delete: "/api/applications/{application_id}/integrations/pilot-things"
        };
    }

	// ListIntegrations lists all configured integrations.
	rpc ListIntegrations(ListIntegrationRequest) returns (ListIntegrationResponse) {
		option(google.api.http) = {
			get: "/api/applications/{application_id}/integrations"
		};
	}
}

enum IntegrationKind {
	HTTP = 0;
	INFLUXDB = 1;
    THINGSBOARD = 2;
    MYDEVICES = 3;
    LORACLOUD = 4;
    GCP_PUBSUB = 5;
    AWS_SNS = 6;
    AZURE_SERVICE_BUS = 7;
    PILOT_THINGS = 8;
}

enum Marshaler {
    JSON = 0;
    PROTOBUF = 1;
    JSON_V3 = 2;
}

message Application {
	// Application ID.
	// This will be automatically assigned on create.
	int64 id = 1;

	// Name of the application (must be unique).
	string name = 2;

	// Description of the application.
	string description = 3;

	// ID of the organization to which the application belongs.
    // After create, this can not be modified.
	int64 organization_id = 4 [json_name = "organizationID"];

	// ID of the service profile.
	string service_profile_id = 5 [json_name = "serviceProfileID"];

	// Payload codec.
    // NOTE: These field have moved to the device-profile and will be removed
    // in the next major release. When set, the device-profile payload_ fields
    // have priority over the application payload_ fields.
	string payload_codec = 6;

	// Payload encoder script.
    // NOTE: These field have moved to the device-profile and will be removed
    // in the next major release. When set, the device-profile payload_ fields
    // have priority over the application payload_ fields.
	string payload_encoder_script = 7;

	// Payload decoder script.
    // NOTE: These field have moved to the device-profile and will be removed
    // in the next major release. When set, the device-profile payload_ fields
    // have priority over the application payload_ fields.
	string payload_decoder_script = 8;
}

message ApplicationListItem {
	// Application ID.
	int64 id = 1;

	// Name of the application.
	string name = 2;

	// Description of the application.
	string description = 3;

	// ID of the organization to which the application belongs.
	int64 organization_id = 4 [json_name = "organizationID"];

	// ID of the service profile.
	string service_profile_id = 5 [json_name = "serviceProfileID"];

	// Service-profile name.
	string service_profile_name = 6;
}


message CreateApplicationRequest {
	// Application object to create.
	Application application = 1;
}

message CreateApplicationResponse {
	// Application ID.
	int64 id = 1;
}

message GetApplicationRequest {
	// Application ID.
	int64 id = 1;
}

message GetApplicationResponse {
	// Application object.
	Application application = 1;
}

message UpdateApplicationRequest {
	// Application object to update.
	Application application = 1;
}

message DeleteApplicationRequest {
	// Application ID.
	int64 id = 1;
}

message ListApplicationRequest {
	// Max number of applications to return in the result-test.
	int64 limit = 1;

	// Offset in the result-set (for pagination).
	int64 offset = 2;

	// ID of the organization to filter on.
	int64 organization_id = 3 [json_name = "organizationID"];

	// Search on name (optional).
	string search = 4;
}

message ListApplicationResponse {
	// Total number of applications available within the result-set.
	int64 total_count = 1;
	
	// Applications within this result-set.
	repeated ApplicationListItem result = 2;
}

message HTTPIntegrationHeader {
	// Key
	string key = 1;

	// Value
	string value = 2;
}

message HTTPIntegration {
	// The id of the application.
	int64 application_id = 1 [json_name = "applicationID"];

	// The headers to use when making HTTP callbacks.
	repeated HTTPIntegrationHeader headers = 2;

	// The URL to call for uplink data.
    // Deprecated: use event_endpoint_url.
	string uplink_data_url = 3 [json_name = "uplinkDataURL"];

	// The URL to call for join notifications.
    // Deprecated: use event_endpoint_url.
	string join_notification_url = 4 [json_name = "joinNotificationURL"];

	// The URL to call for ACK notifications (for confirmed downlink data).
    // Deprecated: use event_endpoint_url.
	string ack_notification_url = 5 [json_name = "ackNotificationURL"];

	// The URL to call for error notifications.
    // Deprecated: use event_endpoint_url.
	string error_notification_url = 6 [json_name = "errorNotificationURL"];

	// The URL to call for device-status notifications.
    // Deprecated: use event_endpoint_url.
	string status_notification_url = 7 [json_name = "statusNotificationURL"];

	// The URL to call for location notifications.
    // Deprecated: use event_endpoint_url.
	string location_notification_url = 8 [json_name = "locationNotificationURL"];

    // The URL to call for tx ack notifications (downlink acknowledged by gateway for transmission).
    // Deprecated: use event_endpoint_url.
    string tx_ack_notification_url = 9 [json_name = "txAckNotificationURL"];

    // The URL to call for integration notifications.
    // Deprecated: use event_endpoint_url.
    string integration_notification_url = 10 [json_name = "integrationNotificationURL"];

    // Marshaler.
    // This defines the marshaler that is used to encode the event payload.
    Marshaler marshaler = 11;

    // Event endpoint URL.
    // The HTTP integration will POST all events to this enpoint. The request
    // will contain a query parameters "event" containing the type of the
    // event.
    string event_endpoint_url = 12 [json_name = "eventEndpointURL"];
}

message CreateHTTPIntegrationRequest {
	// Integration object to create.
	HTTPIntegration integration = 1;
}

message GetHTTPIntegrationRequest {
	// Application ID.
	int64 application_id = 1 [json_name = "applicationID"];
}

message GetHTTPIntegrationResponse {
	// Integration object.
	HTTPIntegration integration = 1;
}

message UpdateHTTPIntegrationRequest {
	// Integration object to update.
	HTTPIntegration integration = 1;
}

message DeleteHTTPIntegrationRequest {
	// The id of the application.
	int64 application_id = 1 [json_name = "applicationID"];
}

message ListIntegrationRequest {
	// The id of the application.
	int64 application_id = 1 [json_name = "applicationID"];
}

message IntegrationListItem {
	// Integration kind.
	IntegrationKind kind = 1;
}

message ListIntegrationResponse {
	// Total number of integrations available within the result-set.
	int64 total_count = 1;

	// Integrations within result-set.
	repeated IntegrationListItem result = 2;
}

enum InfluxDBPrecision {
	NS = 0;
	U = 1;
	MS = 2;
	S = 3;
	M = 4;
	H = 5;
}

message InfluxDBIntegration {
	// Application ID.
	int64 application_id = 1 [json_name = "applicationID"];

	// InfluxDB API write endpoint (e.g. http://localhost:8086/write).
	string endpoint = 2;

	// InfluxDB database name.
	string db = 3;

	// InfluxDB username.
	string username = 4;

	// InfluxDB password.
	string password = 5;

	// InfluxDB retention policy name.
	string retention_policy_name = 6;

	// InfluxDB timestamp precision.
	InfluxDBPrecision precision = 7;
}

message CreateInfluxDBIntegrationRequest {
	// Integration object to create.
	InfluxDBIntegration integration = 1;
}

message GetInfluxDBIntegrationRequest {
	// Application ID.
	int64 application_id = 1 [json_name = "applicationID"];
}

message GetInfluxDBIntegrationResponse {
	// Integration object.
	InfluxDBIntegration integration = 1;
}

message UpdateInfluxDBIntegrationRequest {
	// Integration object.
	InfluxDBIntegration integration = 1;
}

message DeleteInfluxDBIntegrationRequest {
	// Application ID.
	int64 application_id = 1 [json_name = "applicationID"];
}

message ThingsBoardIntegration {
	// Application ID.
	int64 application_id = 1 [json_name = "applicationID"];

    // ThingsBoard server endpoint, e.g. https://example.com
    string server = 2;
}

message CreateThingsBoardIntegrationRequest {
    // Integration object to create.
    ThingsBoardIntegration integration = 1;
}

message GetThingsBoardIntegrationRequest {
	// Application ID.
	int64 application_id = 1 [json_name = "applicationID"];
}

message GetThingsBoardIntegrationResponse {
    // Integration object.
    ThingsBoardIntegration integration = 1;
}

message UpdateThingsBoardIntegrationRequest {
    // Integration object.
    ThingsBoardIntegration integration = 1;
}

message DeleteThingsBoardIntegrationRequest {
	// Application ID.
	int64 application_id = 1 [json_name = "applicationID"];
}

message MyDevicesIntegration {
	// Application ID.
	int64 application_id = 1 [json_name = "applicationID"];

    // MyDevices API endpoint.
    string endpoint = 2;
}

message CreateMyDevicesIntegrationRequest {
    // Integration object to create.
    MyDevicesIntegration integration = 1;
}

message GetMyDevicesIntegrationRequest {
	// Application ID.
	int64 application_id = 1 [json_name = "applicationID"];
}

message GetMyDevicesIntegrationResponse {
    // Integration object.
    MyDevicesIntegration integration = 1;
}

message UpdateMyDevicesIntegrationRequest {
    // Integration object.
    MyDevicesIntegration integration = 1;
}

message DeleteMyDevicesIntegrationRequest {
	// Application ID.
	int64 application_id = 1 [json_name = "applicationID"];
}

message LoRaCloudIntegration {
    // Application ID.
    int64 application_id = 1 [json_name = "applicationID"];

    // Geolocation enabled.
    bool geolocation = 2;

    // Geolocation token.
    // This token can be obtained from the LoRa Cloud console.
    string geolocation_token = 3;

    // Geolocation buffer TTL (in seconds).
    // When > 0, uplink RX meta-data will be stored in a buffer so that
    // the meta-data of multiple uplinks can be used for geolocation.
    uint32 geolocation_buffer_ttl = 4 [json_name = "geolocationBufferTTL"];

    // Geolocation minimum buffer size.
    // When > 0, geolocation will only be performed when the buffer has
    // at least the given size.
    uint32 geolocation_min_buffer_size = 5;

    // TDOA based geolocation is enabled.
    bool geolocation_tdoa = 6 [json_name = "geolocationTDOA"];

    // RSSI based geolocation is enabled.
    bool geolocation_rssi = 7 [json_name = "geolocationRSSI"];

    // GNSS based geolocation is enabled (LR1110).
    bool geolocation_gnss = 8 [json_name = "geolocationGNSS"];

    // GNSS payload field.
    // This holds the name of the field in the decoded payload object which
    // contains the GNSS payload bytes.
    string geolocation_gnss_payload_field = 9 [json_name = "geolocationGNSSPayloadField"];

    // GNSS use RX time.
    // In case this is set to true, the resolver will use the RX time of the
    // network instead of the timestamp included in the LR1110 payload.
    bool geolocation_gnss_use_rx_time = 10 [json_name = "geolocationGNSSUseRxTime"];

    // Wifi based geolocation is enabled.
    bool geolocation_wifi = 11 [json_name = "geolocationWifi"];

    // Wifi payload field.
    // This holds the name of the field in the decoded payload object which
    // contains an array of objects with the following fields:
    // * macAddress - e.g. 01:23:45:67:89:ab
    // * signalStrength - e.g. -51 (optional)
    string geolocation_wifi_payload_field = 12 [json_name = "geolocationWifiPayloadField"];

    // Device Application Services enabled.
    bool das = 13;

    // Device Application Services token.
    // This token can be obtained from the LoRa Cloud console.
    string das_token = 14;

    // Device Application Services modem port (FPort).
    // ChirpStack Application Server will only forward the FRMPayload to DAS
    // when the uplink FPort is equal to this value.
    uint32 das_modem_port = 15;

    // Device Application Services GNSS port (FPort).
    // ChirpStack Application Server will forward the FRMPayload to DAS when
    // as GNSS payload when the uplink FPort is equal to this value.
    uint32 das_gnss_port = 16 [json_name = "dasGNSSPort"];

    // Device Application Services GNSS use RX time.
    // In case this is set to true, the DAS resolver will use the RX time of the
    // network instead of the timestamp included in the LR1110 payload.
    bool das_gnss_use_rx_time = 17 [json_name = "dasGNSSUseRxTime"];

    // Device Application Services streaming geoloc work-around.
    // This is a temporarily work-around for processing streaming geolocation
    // data. When enabled, stream records (expected in TLV format) are scanned
    // for GNSS data (0x06 or 0x07). If found, the ChirpStack Application Server
    // will make an additional call to the DAS API for resolving the location
    // using the detected payload.
    bool das_streaming_geoloc_workaround = 18;
}

message CreateLoRaCloudIntegrationRequest {
    // Integration object to create.
    LoRaCloudIntegration integration = 1;
}

message GetLoRaCloudIntegrationRequest {
    // Application ID.
    int64 application_id = 1 [json_name = "applicationID"];
}

message GetLoRaCloudIntegrationResponse {
    // Integration object.
    LoRaCloudIntegration integration = 1;
}

message UpdateLoRaCloudIntegrationRequest {
    // Integration object.
    LoRaCloudIntegration integration = 1;
}

message DeleteLoRaCloudIntegrationRequest {
    // Application ID.
    int64 application_id = 1 [json_name = "applicationID"];
}

message GCPPubSubIntegration {
    // Application ID.
    int64 application_id = 1 [json_name = "applicationID"];

    // Marshaler.
    // This defines the marshaler that is used to encode the event payload.
    Marshaler marshaler = 2;

    // Credentials file.
    // This IAM service-account credentials file (JSON) must have the following Pub/Sub roles:
    // * Pub/Sub Publisher
    string credentials_file = 3;

    // Project ID.
    string project_id = 4 [json_name = "projectID"];

    // Topic name.
    // This is the name of the Pub/Sub topic.
    string topic_name = 5;
}

message CreateGCPPubSubIntegrationRequest {
    // Integration object to create.
    GCPPubSubIntegration integration = 1;
}

message GetGCPPubSubIntegrationRequest {
	// Application ID.
	int64 application_id = 1 [json_name = "applicationID"];
}

message GetGCPPubSubIntegrationResponse {
    // Integration object.
    GCPPubSubIntegration integration = 1;
}

message UpdateGCPPubSubIntegrationRequest {
	// Integration object to update.
	GCPPubSubIntegration integration = 1;
}

message DeleteGCPPubSubIntegrationRequest {
	// The id of the application.
	int64 application_id = 1 [json_name = "applicationID"];
}

message AWSSNSIntegration {
    // Application ID.
    int64 application_id = 1 [json_name = "applicationID"];

    // Marshaler.
    // This defines the marshaler that is used to encode the event payload.
    Marshaler marshaler = 2;

    // AWS region.
    string region = 3;

    // AWS Access Key ID.
    string access_key_id = 4 [json_name="accessKeyID"];

    // AWS Secret Access Key.
    string secret_access_key = 5;

    // Topic ARN.
    string topic_arn = 6 [json_name="topicARN"];
}

message CreateAWSSNSIntegrationRequest {
    // Integration object to create.
    AWSSNSIntegration integration = 1;
}

message GetAWSSNSIntegrationRequest {
	// Application ID.
	int64 application_id = 1 [json_name = "applicationID"];
}

message GetAWSSNSIntegrationResponse {
    // Integration object.
    AWSSNSIntegration integration = 1;
}

message UpdateAWSSNSIntegrationRequest {
	// Integration object to update.
	AWSSNSIntegration integration = 1;
}

message DeleteAWSSNSIntegrationRequest {
	// The id of the application.
	int64 application_id = 1 [json_name = "applicationID"];
}

message AzureServiceBusIntegration {
    // Application ID.
    int64 application_id = 1 [json_name = "applicationID"];

    // Marshaler.
    // This defines the marshaler that is used to encode the event payload.
    Marshaler marshaler = 2;

    // Connection string.
    string connection_string = 3;

    // Publish name.
    // This is the name of the topic or queue.
    string publish_name = 4;
}

message CreateAzureServiceBusIntegrationRequest {
    // Integration object to create.
    AzureServiceBusIntegration integration = 1;
}

message GetAzureServiceBusIntegrationRequest {
	// Application ID.
	int64 application_id = 1 [json_name = "applicationID"];
}

message GetAzureServiceBusIntegrationResponse {
    // Integration object.
    AzureServiceBusIntegration integration = 1;
}

message UpdateAzureServiceBusIntegrationRequest {
	// Integration object to update.
	AzureServiceBusIntegration integration = 1;
}

message DeleteAzureServiceBusIntegrationRequest {
	// The id of the application.
	int64 application_id = 1 [json_name = "applicationID"];
}

message PilotThingsIntegration {
    // Application ID.
    int64 application_id = 1 [json_name = "applicationID"];

    // Server URL
    string server = 2;

    // Authentication token
    string token = 3;
}

message CreatePilotThingsIntegrationRequest {
    // Integration object to create.
    PilotThingsIntegration integration = 1;
}

message GetPilotThingsIntegrationRequest {
	// Application ID.
	int64 application_id = 1 [json_name = "applicationID"];
}

message GetPilotThingsIntegrationResponse {
    // Integration object.
    PilotThingsIntegration integration = 1;
}

message UpdatePilotThingsIntegrationRequest {
	// Integration object to update.
	PilotThingsIntegration integration = 1;
}

message DeletePilotThingsIntegrationRequest {
	// The id of the application.
	int64 application_id = 1 [json_name = "applicationID"];
}