@@ -6,17 +6,16 @@ option go_package="github.com/datatrails/go-datatrails-common-api-gen/assets/v2/
66
77import "google/api/annotations.proto" ;
88import "protoc-gen-openapiv2/options/annotations.proto" ;
9-
10- import "datatrails-common-api/assets/v2/assets/assetresponse.proto" ;
9+ import "datatrails-common-api/caps/v1/caps/caps.proto" ;
1110import "datatrails-common-api/assets/v2/assets/createasset.proto" ;
11+ import "datatrails-common-api/assets/v2/assets/assetresponse.proto" ;
12+ import "datatrails-common-api/assets/v2/assets/getasset.proto" ;
13+ import "datatrails-common-api/assets/v2/assets/listassets.proto" ;
1214import "datatrails-common-api/assets/v2/assets/createevent.proto" ;
1315import "datatrails-common-api/assets/v2/assets/eventresponse.proto" ;
14- import "datatrails-common-api/assets/v2/assets/getasset.proto" ;
1516import "datatrails-common-api/assets/v2/assets/getevent.proto" ;
16- import "datatrails-common-api/assets/v2/assets/listassets.proto" ;
1717import "datatrails-common-api/assets/v2/assets/listevents.proto" ;
1818import "datatrails-common-api/assets/v2/assets/miscmessages.proto" ;
19- import "datatrails-common-api/caps/v1/caps/caps.proto" ;
2019
2120option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger ) = {
2221 info : {
@@ -25,41 +24,28 @@ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
2524 version : "2.0"
2625 contact : {
2726 name : "DataTrails"
28- url : "https://www.datatrails.com "
27+ url : "https://www.datatrails.ai "
2928 }
3029 };
31- base_path : "/_api " ;
30+ base_path : "/archivist/v2/assets " ;
3231 schemes : HTTPS;
3332 consumes : "application/json" ;
3433 produces : "application/json" ;
3534 tags : [
3635 {
37- name : "Assets & Events" ,
36+ name : "Assets and Events" ,
3837 description : "Primary API for Asset management"
39- },
40- {
41- name : "Unsupported" ,
42- description : "Internal APIs that are unstable and should not be used in a production setting."
4338 }
4439 ];
4540};
4641
47- service Events {
48- rpc Create (CreateEventRequest ) returns (EventResponse ) {
49- option (google.api.http ) = {
50- post : "/archivist/v2/assets/{uuid}/events"
51- body : "*"
52- };
53- }
54- }
55-
5642service Assets {
5743 rpc ListAssets (ListAssetsRequest ) returns (ListAssetsResponse ) {
5844 option (google.api.http ) = {
5945 get : "/archivist/v2/assets"
6046 };
6147 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation ) = {
62- tags : [ "Assets & Events" ]
48+ tags : [ "Assets and Events" ]
6349 summary : "List Assets"
6450 description : "Retrieves a list of Assets"
6551 responses : {
@@ -83,6 +69,12 @@ service Assets {
8369 description : "Returned when the user is not authenticated to the system."
8470 }
8571 }
72+ responses : {
73+ key : "402" ;
74+ value : {
75+ description : "Returned when the user's quota of Assets for the given proof mechanism has been reached."
76+ }
77+ }
8678 responses : {
8779 key : "403" ;
8880 value : {
@@ -104,7 +96,7 @@ service Assets {
10496 body : "*"
10597 };
10698 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation ) = {
107- tags : [ "Assets & Events" ]
99+ tags : [ "Assets and Events" ]
108100 summary : "Create an Asset"
109101 description : "Creates an Asset"
110102 responses : {
@@ -139,7 +131,7 @@ service Assets {
139131 get : "/archivist/v2/assets/{uuid}"
140132 };
141133 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation ) = {
142- tags : [ "Assets & Events" ]
134+ tags : [ "Assets and Events" ]
143135 summary : "Retrieves a specific Asset"
144136 description : "Retrieves a specific Asset"
145137 responses : {
@@ -174,7 +166,7 @@ service Assets {
174166 get : "/archivist/v2/assets/{uuid}:publicurl"
175167 };
176168 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation ) = {
177- tags : [ "Assets & Events" ]
169+ tags : [ "Assets and Events" ]
178170 summary : "Retrieves the public url for a specific Asset."
179171 description : "Retrieves the public url for a specific Asset."
180172 responses : {
@@ -209,7 +201,7 @@ service Assets {
209201 get : "/archivist/v2/assets/{asset_uuid}/events/{uuid}"
210202 };
211203 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation ) = {
212- tags : [ "Assets & Events" ]
204+ tags : [ "Assets and Events" ]
213205 summary : "Retrieves Event"
214206 description : "Retrieves a specific Event"
215207 responses : {
@@ -244,7 +236,7 @@ service Assets {
244236 get : "/archivist/v2/assets/{asset_uuid}/events/{uuid}:publicurl"
245237 };
246238 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation ) = {
247- tags : [ "Assets & Events" ]
239+ tags : [ "Assets and Events" ]
248240 summary : "Retrieves the public url for a specific Event."
249241 description : "Retrieves the public url for a specific Event."
250242 responses : {
@@ -279,7 +271,7 @@ service Assets {
279271 get : "/archivist/v2/assets/{uuid}/events"
280272 };
281273 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation ) = {
282- tags : [ "Assets & Events" ]
274+ tags : [ "Assets and Events" ]
283275 summary : "List Events"
284276 description : "Lists Events"
285277 responses : {
@@ -324,7 +316,7 @@ service Assets {
324316 get : "/archivist/v2/assets:caps"
325317 };
326318 option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation ) = {
327- tags : [ "Assets & Events", "Unsupported" ] // Unsupported is signal for future OAPI parsing
319+ tags : [ "Assets and Events", "Unsupported" ] // Unsupported is signal for future OAPI parsing
328320 summary : "Get remaining capped resources for Assets"
329321 description : "Not stable or officially supported. Get remaining capped resources for Assets"
330322 responses : {
@@ -341,4 +333,37 @@ service Assets {
341333 }
342334 };
343335 }
344- }
336+ }
337+
338+ service Events {
339+ rpc Create (CreateEventRequest ) returns (EventResponse ) {
340+ option (google.api.http ) = {
341+ post : "/archivist/v2/assets/{uuid}/events"
342+ body : "*"
343+ };
344+ option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation ) = {
345+ tags : [ "Assets and Events" ]
346+ summary : "Creates an Event"
347+ description : "Creates an Event"
348+ responses : {
349+ key : "401" ;
350+ value : {
351+ description : "Returned when the user is not authenticated to the system."
352+ }
353+ }
354+ responses : {
355+ key : "402" ;
356+ value : {
357+ description : "Returned when the user's quota of Events has been reached."
358+ }
359+ }
360+ responses : {
361+ key : "429" ;
362+ value : {
363+ description : "Returned when a user exceeds their subscription's rate limit for requests." ;
364+ }
365+ }
366+ };
367+ }
368+ }
369+
0 commit comments