Skip to content

Commit 68b0e16

Browse files
committed
Update API examples
re AB#9112
1 parent c1b2c20 commit 68b0e16

File tree

8 files changed

+43
-112
lines changed

8 files changed

+43
-112
lines changed

datatrails-common-api/assets/v2/assets/assetresponse.proto

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,9 @@ message AssetResponse {
2525
"\"identity\": \"assets/add30235-1424-4fda-840a-d5ef82c4c96f\", "
2626
"\"behaviours\": [\"RecordEvidence\"], "
2727
"\"attributes\": { "
28-
" \"arc_firmware_version\": \"3.2.1\", "
29-
" \"arc_attachments\": ["
30-
" {"
31-
" \"arc_attachment_identity\": \"blobs/1754b920-cf20-4d7e-9d36-9ed7d479744d\","
32-
" \"arc_hash_value\": \"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b\","
33-
" \"arc_display_name\": \"Picture from yesterday\","
34-
" \"arc_hash_alg\": \"sha256\""
35-
" }"
36-
" ],"
37-
" \"arc_home_location_identity\": \"locations/42054f10-9952-4c10-a082-9fd0d10295ae\""
28+
" \"arc_display_type\": \"Garden Fence\", "
29+
" \"arc_display_name\": \"My Garden Fence\", "
30+
" \"colour\": \"Plain wood\" "
3831
"}, "
3932
"\"confirmation_status\": \"PENDING\", "
4033
"\"tracked\": \"TRACKED\", "

datatrails-common-api/assets/v2/assets/createasset.proto

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,9 @@ message CreateAssetRequest {
2121
example:"{ "
2222
"\"behaviours\": [\"RecordEvidence\"], "
2323
"\"attributes\": { "
24-
" \"arc_firmware_version\": \"3.2.1\", "
25-
" \"arc_attachments\": ["
26-
" {"
27-
" \"arc_attachment_identity\": \"blobs/1754b920-cf20-4d7e-9d36-9ed7d479744d\","
28-
" \"arc_hash_value\": \"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b\","
29-
" \"arc_display_name\": \"Picture from yesterday\","
30-
" \"arc_hash_alg\": \"sha256\""
31-
" }"
32-
" ],"
33-
" \"arc_home_location_identity\": \"locations/42054f10-9952-4c10-a082-9fd0d10295ae\""
24+
" \"arc_display_type\": \"Garden Fence\", "
25+
" \"arc_display_name\": \"My Garden Fence\", "
26+
" \"colour\": \"Plain wood\" "
3427
"}, "
3528
"\"proof_mechanism\": \"SIMPLE_HASH\","
3629
"\"public\": false"

datatrails-common-api/assets/v2/assets/createevent.proto

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,12 @@ message CreateEventRequest {
2222
"\"operation\": \"Record\", "
2323
"\"behaviour\": \"RecordEvidence\", "
2424
"\"event_attributes\": { "
25-
" \"arc_attachments\": ["
26-
" {"
27-
" \"arc_attachment_identity\": \"blobs/1754b920-cf20-4d7e-9d36-9ed7d479744d\","
28-
" \"arc_hash_value\": \"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b\","
29-
" \"arc_display_name\": \"Picture from yesterday\","
30-
" \"arc_hash_alg\": \"sha256\""
31-
" }"
32-
" ]"
25+
" \"arc_display_type\": \"Paint\", "
26+
" \"arc_description\": \"Painted the fence\""
3327
"}, "
3428
"\"asset_attributes\": { "
35-
" \"arc_firmware_version\": \"3.2.1\", "
36-
" \"arc_home_location_identity\": \"locations/42054f10-9952-4c10-a082-9fd0d10295ae\""
37-
"}, "
38-
"\"timestamp_declared\": \"2019-11-27T14:44:19Z\", "
39-
"\"principal_declared\": { "
40-
" \"issuer\": \"job.idp.server/1234\", \"subject\":\"bob@job\" "
41-
" } "
29+
" \"colour\": \"Midnight Blue\" "
30+
"} "
4231
"}"
4332
};
4433

datatrails-common-api/assets/v2/assets/eventresponse.proto

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,11 @@ message EventResponse {
2626
"\"operation\": \"Record\", "
2727
"\"behaviour\": \"RecordEvidence\", "
2828
"\"event_attributes\": { "
29-
" \"arc_attachments\": ["
30-
" {"
31-
" \"arc_attachment_identity\": \"blobs/1754b920-cf20-4d7e-9d36-9ed7d479744d\","
32-
" \"arc_hash_value\": \"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b\","
33-
" \"arc_display_name\": \"Picture from yesterday\","
34-
" \"arc_hash_alg\": \"sha256\""
35-
" }"
36-
" ]"
29+
" \"arc_display_type\": \"Paint\", "
30+
" \"arc_description\": \"Painted the fence\" "
3731
"}, "
3832
"\"asset_attributes\": { "
39-
" \"arc_firmware_version\": \"3.2.1\", "
40-
" \"arc_home_location_identity\": \"locations/42054f10-9952-4c10-a082-9fd0d10295ae\""
33+
" \"colour\": \"Midnight Blue\" "
4134
"}, "
4235
"\"timestamp_accepted\": \"2019-11-27T14:44:19Z\", "
4336
"\"timestamp_declared\": \"2019-11-27T14:44:19Z\", "

datatrails-common-api/assets/v2/assets/eventresponsejsonapi.proto

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,11 @@ message EventResponseJSONAPI {
2828
"\"operation\": \"Record\", "
2929
"\"behaviour\": \"RecordEvidence\", "
3030
"\"event_attributes\": { "
31-
" \"arc_attachments\": ["
32-
" {"
33-
" \"arc_attachment_identity\": \"blobs/1754b920-cf20-4d7e-9d36-9ed7d479744d\","
34-
" \"arc_hash_value\": \"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b\","
35-
" \"arc_display_name\": \"Picture from yesterday\","
36-
" \"arc_hash_alg\": \"sha256\""
37-
" }"
38-
" ]"
31+
" \"arc_display_type\": \"Paint\", "
32+
" \"arc_description\": \"Painted the fence\" "
3933
"}, "
4034
"\"asset_attributes\": { "
41-
" \"arc_firmware_version\": \"3.2.1\", "
42-
" \"arc_home_location_identity\": \"locations/42054f10-9952-4c10-a082-9fd0d10295ae\""
35+
" \"colour\": \"Midnight Blue\" "
4336
"}, "
4437
"\"timestamp_accepted\": \"2019-11-27T14:44:19Z\", "
4538
"\"timestamp_declared\": \"2019-11-27T14:44:19Z\", "

datatrails-common-api/assets/v2/assets/listassets.proto

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,9 @@ message ListAssetsResponse {
102102
" \"identity\": \"assets/add30235-1424-4fda-840a-d5ef82c4c96f\", "
103103
" \"behaviours\": [\"RecordEvidence\"], "
104104
" \"attributes\": { "
105-
" \"arc_firmware_version\": \"3.2.1\", "
106-
" \"arc_attachments\": ["
107-
" {"
108-
" \"arc_attachment_identity\": \"blobs/1754b920-cf20-4d7e-9d36-9ed7d479744d\","
109-
" \"arc_hash_value\": \"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b\","
110-
" \"arc_display_name\": \"Picture from yesterday\","
111-
" \"arc_hash_alg\": \"sha256\""
112-
" }"
113-
" ],"
114-
" \"arc_home_location_identity\": \"locations/42054f10-9952-4c10-a082-9fd0d10295ae\""
105+
" \"arc_display_type\": \"Garden Fence\", "
106+
" \"arc_display_name\": \"My Garden Fence\", "
107+
" \"colour\": \"Plain wood\""
115108
" }, "
116109
" \"confirmation_status\": \"PENDING\", "
117110
" \"tracked\": \"TRACKED\", "
@@ -125,22 +118,15 @@ message ListAssetsResponse {
125118
" \"identity\": \"assets/cef61346-2453-5aeb-921c-e6fa93d5b032\", "
126119
" \"behaviours\": [\"RecordEvidence\"], "
127120
" \"attributes\": { "
128-
" \"arc_firmware_version\": \"3.2.1\", "
129-
" \"arc_attachments\": ["
130-
" {"
131-
" \"arc_attachment_identity\": \"blobs/2865ca31-d01f-5e6f-4621-de562470732e\","
132-
" \"arc_hash_value\": \"12bc4819d90b6fe911b091a7c05134b65edfce045e09b048caaa7916ecdd458c\","
133-
" \"arc_display_name\": \"Picture\","
134-
" \"arc_hash_alg\": \"sha256\""
135-
" }"
136-
" ],"
137-
" \"arc_home_location_identity\": \"locations/53165a2c-6054-dd68-f093-a0e1e21304fd\""
121+
" \"arc_display_type\": \"IoT Device\", "
122+
" \"arc_display_name\": \"My IoT Device\", "
123+
" \"arc_firmware_version\": \"3.2.1\""
138124
" }, "
139125
" \"confirmation_status\": \"PENDING\", "
140126
" \"tracked\": \"TRACKED\", "
141127
" \"owner\": \"0x601f5A7D3e6dcB55e87bf2F17bC8A27AaCD3511\","
142128
" \"at_time\": \"2019-11-27T14:44:19Z\", "
143-
" \"proof_mechanism\": \"KHIPU\","
129+
" \"proof_mechanism\": \"SIMPLE_HASH\","
144130
" \"public\": false,"
145131
" \"tenant_identity\": \"tenant/8e0b600c-8234-43e4-860c-e95bdcd695a9\" "
146132
" }"

datatrails-common-api/assets/v2/assets/listevents.proto

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -154,18 +154,11 @@ message ListEventsResponse {
154154
" \"operation\": \"Record\", "
155155
" \"behaviour\": \"RecordEvidence\", "
156156
" \"event_attributes\": { "
157-
" \"arc_attachments\": ["
158-
" {"
159-
" \"arc_attachment_identity\": \"blobs/1754b920-cf20-4d7e-9d36-9ed7d479744d\","
160-
" \"arc_hash_value\": \"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b\","
161-
" \"arc_display_name\": \"Picture from yesterday\","
162-
" \"arc_hash_alg\": \"sha256\""
163-
" }"
164-
" ]"
157+
" \"arc_display_type\": \"Paint\", "
158+
" \"arc_description\": \"Painted the fence\" "
165159
" }, "
166160
" \"asset_attributes\": { "
167-
" \"arc_firmware_version\": \"3.2.1\", "
168-
" \"arc_home_location_identity\": \"locations/42054f10-9952-4c10-a082-9fd0d10295ae\""
161+
" \"colour\": \"Midnight Blue\" "
169162
" }, "
170163
" \"timestamp_accepted\": \"2019-11-27T14:44:19Z\", "
171164
" \"timestamp_declared\": \"2019-11-27T14:44:19Z\", "
@@ -188,18 +181,10 @@ message ListEventsResponse {
188181
" \"operation\": \"Record\", "
189182
" \"behaviour\": \"RecordEvidence\", "
190183
" \"event_attributes\": { "
191-
" \"arc_attachments\": ["
192-
" {"
193-
" \"arc_attachment_identity\": \"blobs/1754b920-cf20-4d7e-9d36-9ed7d479744d\","
194-
" \"arc_hash_value\": \"01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b\","
195-
" \"arc_display_name\": \"Picture\","
196-
" \"arc_hash_alg\": \"sha256\""
197-
" }"
198-
" ]"
184+
" \"arc_display_type\": \"Update Firmware\" "
199185
" }, "
200186
" \"asset_attributes\": { "
201-
" \"arc_firmware_version\": \"3.2.1\", "
202-
" \"arc_home_location_identity\": \"locations/42054f10-9952-4c10-a082-9fd0d10295ae\""
187+
" \"arc_firmware_version\": \"3.2.1\" "
203188
" }, "
204189
" \"timestamp_accepted\": \"2019-07-27T14:44:19Z\", "
205190
" \"timestamp_declared\": \"2019-07-27T14:44:19Z\", "

datatrails-common-api/assets/v2/assets/service.proto

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ service Assets {
6060
};
6161
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
6262
tags: [ "Assets & Events" ]
63-
summary: "List Archivist assets"
64-
description: "Retrieves a list of Archivist assets"
63+
summary: "List Assets"
64+
description: "Retrieves a list of Assets"
6565
responses: {
6666
key: "206";
6767
value: {
@@ -105,8 +105,8 @@ service Assets {
105105
};
106106
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
107107
tags: [ "Assets & Events" ]
108-
summary: "Create an Archivist asset"
109-
description: "Creates an Archivist asset"
108+
summary: "Create an Asset"
109+
description: "Creates an Asset"
110110
responses: {
111111
key: "401";
112112
value: {
@@ -116,8 +116,7 @@ service Assets {
116116
responses: {
117117
key: "402";
118118
value: {
119-
description: "Returned when the user either has not enabled blockchain storage or"
120-
"the number of assets would exceed the user's quota"
119+
description: "Returned when the number of assets would exceed the user's quota"
121120
}
122121
}
123122
responses: {
@@ -141,8 +140,8 @@ service Assets {
141140
};
142141
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
143142
tags: [ "Assets & Events" ]
144-
summary: "Retrieves a specific Archivist asset"
145-
description: "Retrieves a specific Archivist asset"
143+
summary: "Retrieves a specific Asset"
144+
description: "Retrieves a specific Asset"
146145
responses: {
147146
key: "401";
148147
value: {
@@ -176,8 +175,8 @@ service Assets {
176175
};
177176
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
178177
tags: [ "Assets & Events" ]
179-
summary: "Retrieves the public url for a specific Archivist asset."
180-
description: "Retrieves the public url for a specific Archivist asset."
178+
summary: "Retrieves the public url for a specific Asset."
179+
description: "Retrieves the public url for a specific Asset."
181180
responses: {
182181
key: "401";
183182
value: {
@@ -211,8 +210,8 @@ service Assets {
211210
};
212211
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
213212
tags: [ "Assets & Events" ]
214-
summary: "Retrieves Archivist event"
215-
description: "Retrieves a specific Archivist event"
213+
summary: "Retrieves Event"
214+
description: "Retrieves a specific Event"
216215
responses: {
217216
key: "401";
218217
value: {
@@ -246,8 +245,8 @@ service Assets {
246245
};
247246
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
248247
tags: [ "Assets & Events" ]
249-
summary: "Retrieves the public url for a specific Archivist event."
250-
description: "Retrieves the public url for a specific Archivist event."
248+
summary: "Retrieves the public url for a specific Event."
249+
description: "Retrieves the public url for a specific Event."
251250
responses: {
252251
key: "401";
253252
value: {
@@ -281,8 +280,8 @@ service Assets {
281280
};
282281
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
283282
tags: [ "Assets & Events" ]
284-
summary: "List Archivist events"
285-
description: "Lists Archivist events"
283+
summary: "List Events"
284+
description: "Lists Events"
286285
responses: {
287286
key: "206";
288287
value: {

0 commit comments

Comments
 (0)